Version 1.9.0-dev.0.0

svn merge -r 41683:42029 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@42033 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/docs/language/Makefile b/docs/language/Makefile
new file mode 100644
index 0000000..9c76ad4
--- /dev/null
+++ b/docs/language/Makefile
@@ -0,0 +1,42 @@
+NAME=dartLangSpec
+SPEC=$(NAME).tex
+HASH=$(NAME)-hash.tex
+LIST=$(NAME)-list.txt
+HASHER=../../tools/addlatexhash.dart
+
+pdf:
+	pdflatex $(SPEC)
+	pdflatex $(SPEC)
+	pdflatex $(SPEC)
+
+pdfhash: hash_and_list
+	pdflatex $(HASH)
+	pdflatex $(HASH)
+	pdflatex $(HASH)
+
+dvi:
+	latex $(SPEC)
+	latex $(SPEC)
+	latex $(SPEC)
+
+dvihash: hash_and_list
+	latex $(HASH)
+	latex $(HASH)
+	latex $(HASH)
+
+hash_and_list:
+	dart $(HASHER) $(SPEC) $(HASH) $(LIST)
+
+help:
+	@echo "Goals:"
+	@echo "  pdf, dvi: generate the pdf/dvi file containing the spec"
+	@echo "  pdfhash, dvihash: ditto, with location markers filled in"
+	@echo "  cleanish: remove [pdf]latex generated intermediate files"
+	@echo "  clean: remove all generated files"
+
+cleanish:
+	rm -f *.aux *.log *.toc *.out
+
+clean: cleanish
+	rm -f *.dvi *.pdf $(HASH) $(LIST)
+
diff --git a/docs/language/dart.sty b/docs/language/dart.sty
index 7da3c7b..6b21815 100644
--- a/docs/language/dart.sty
+++ b/docs/language/dart.sty
@@ -118,7 +118,7 @@
 % ----------------------------------------------------------------------
 % Support for hash valued Location Markers
 
-% very small font, to enable 33 char hash values in the margin
+% very small font, to enable 40 char hash values in the margin
 \makeatletter
 \ifcase \@ptsize \relax% 10pt
   \newcommand{\miniscule}{\@setfontsize\miniscule{2}{3}}% \tiny: 5/6
@@ -141,11 +141,7 @@
 
 % define a label, and show the associated logical location marker
 \newcommand{\LMLabel}[1]{%
-  \vspace{-\baselineskip}\hspace{0pt}\OriginalLMHash{\raisebox{10ex}{sec:#1}}%
+  \vspace{-\baselineskip}\hspace{0pt}\OriginalLMHash{\raisebox{10ex}{#1}}%
   \label{#1}}
-
-% dummy version of LMHash, always shows the same arbitrary hash value
-\renewcommand{\LMHash}[1]{\OriginalLMHash{ba01b04d58c8c4e259764498f823cc65}}
-
 % ----------------------------------------------------------------------
 
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index fd3073c..7931a37 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -1,12 +1,19 @@
 \documentclass{article}
 \usepackage{epsfig}
+\usepackage{color}
 \usepackage{dart}
 \usepackage{bnf}
 \usepackage{hyperref}
+\usepackage{lmodern}
 \newcommand{\code}[1]{{\sf #1}}
 \title{Dart Programming Language  Specification \\
 {\large Version 1.6}}
 %\author{The Dart Team}
+
+% For information about Location Markers (and in particular the
+% commands \LMHash and \LMLabel), see the long comment at the
+% end of this file.
+
 \begin{document}
 \maketitle
 \tableofcontents
@@ -19,22 +26,26 @@
 
 % begin Ecma boilerplate
 \section{Scope}
-\label{ecmaScope}
+\LMLabel{ecmaScope}
 
+\LMHash{}
 This Ecma standard specifies the syntax and semantics of the Dart programming language.  It does not specify the APIs of the Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
 
 \section{Conformance}
-\label{ecmaConformance}
+\LMLabel{ecmaConformance}
 
+\LMHash{}
 A conforming  implementation of the Dart programming language must provide and support all the  APIs (libraries, types, functions, getters, setters, whether top-level, static, instance or local) mandated in this specification. 
 
+\LMHash{}
 A conforming implementation is permitted to provide additional APIs, but not additional syntax.
 
 % A claim of conformance with this Ecma Standard shall specify?
 
 \section{Normative References}
-\label{ecmaNormativeReferences}
+\LMLabel{ecmaNormativeReferences}
 
+\LMHash{}
 The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
 
 \begin{enumerate}
@@ -46,15 +57,17 @@
 
 
 \section{Terms and Definitions}
-\label{ecmaTermsAndDefinitions}
+\LMLabel{ecmaTermsAndDefinitions}
 
+\LMHash{}
 Terms and definitions used in this specification are given in the body of the specification proper. Such terms are highlighted in italics when they are introduced, e.g., `we use the term {\em verbosity} to refer to the property of excess verbiage'.
 % End Ecma Boilerplate
 
   
 \section{Notation}
-\label{notation}
+\LMLabel{notation}
 
+\LMHash{}
 We distinguish between normative and non-normative text. Normative text defines the rules of Dart. It is given in this font. At this time, non-normative text includes:
 \begin{itemize}
 \item[Rationale] Discussion of the motivation for language design decisions appears in italics. \rationale{Distinguishing normative from non-normative helps clarify what part of the text is binding and what part is merely expository.}
@@ -62,6 +75,7 @@
 \item[Open questions] (\Q{in this font}). Open questions are points that are unsettled in the mind of the author(s) of the specification; expect them (the questions, not the authors; precision is important in a specification) to be eliminated in the final specification. \Q{Should the text at the end of the previous bullet be rationale or commentary?}
 \end{itemize}
 
+\LMHash{}
 Reserved words and built-in identifiers  (\ref{identifierReference}) appear in {\bf bold}.
 
 \commentary{
@@ -69,6 +83,7 @@
 }
 
 
+\LMHash{}
 Grammar productions are given in a common variant of EBNF.  The left hand side of a production ends with a colon.  On the right hand side, alternation is represented by vertical bars, and sequencing by spacing.  As in PEGs, alternation gives priority to the left. Optional elements of a production are suffixed by a question mark like so: \code{anElephant?}.  Appending a star to an element of a production means it may be repeated zero or more times.  Appending a plus sign to a production means it occurs one or more times. Parentheses are used for grouping. Negation  is represented by prefixing an element of a production with a tilde. Negation is similar to the not combinator of PEGs, but it consumes input if it matches. In the context of a lexical production it consumes a single character if there is one;  otherwise, a single token if there is one.
 
 \commentary{ An example would be:}
@@ -95,17 +110,23 @@
 % The alternative is to define ~X as anything but X, or to introduce an anthingBut(X) 
 % combinator, such as !X
 
+\LMHash{}
 Both syntactic and lexical productions are represented this way. Lexical productions are distinguished by their names. The names of lexical productions consist exclusively of upper case characters and underscores.  As always, within grammatical productions, whitespace and comments between elements of the production are implicitly ignored unless stated otherwise. 
 Punctuation tokens appear in quotes. 
 
+\LMHash{}
 Productions are embedded, as much as possible, in the discussion of the constructs they represent. 
 
+\LMHash{}
 A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
 
+\LMHash{}
 The notation $[x_1, \ldots, x_n/y_1, \ldots, y_n]E$ denotes a copy of $E$ in which all occurrences of $y_i, 1 \le i \le n$ have been replaced with $x_i$.
 
+\LMHash{}
 We sometimes abuse list or map literal syntax, writing $[o_1, \ldots, o_n]$  (respectively $\{k_1: o_1, \ldots, k_n: o_n\}$) where the $o_i$ and $k_i$ may be objects rather than expressions. The intent is to denote a list (respectively map) object whose elements are the $o_i$ (respectively, whose keys are the $k_i$ and values are the $o_i$).
 
+\LMHash{}
 The specifications of operators often involve statements such as $x$ $op$ $y$ is equivalent to the method invocation $x.op(y)$. Such specifications should be understood as a shorthand for:
 \begin{itemize}
 \item
@@ -115,8 +136,10 @@
  \rationale{This circumlocution is required because x.op(y), where op is an operator, is not legal syntax. However, it is painfully verbose, and we prefer to state this rule once here, and use a concise and clear notation across the specification.
  }
 
+\LMHash{}
 When the specification refers to the order given in the program, it means the order of the program source code text, scanning left-to-right and top-to-bottom.
 
+\LMHash{}
 References to otherwise unspecified names of program entities (such as classes or functions) are interpreted as the names of members of the Dart core library.
 
 \commentary{
@@ -124,12 +147,15 @@
 }
 
 \section{Overview}
-\label{overview}
+\LMLabel{overview}
 
+\LMHash{}
 Dart is a class-based, single-inheritance, pure object-oriented programming language. Dart is optionally typed (\ref{types}) and supports reified generics. The run-time type of every object is represented as an instance of class \code{Type}  which can be obtained by calling the getter  \code{runtimeType} declared in class \code{Object}, the root of the Dart class hierarchy.
 
+\LMHash{}
 Dart programs may be statically checked. The static checker will report some violations of the type rules, but such violations do not abort compilation or preclude execution. 
 
+\LMHash{}
 Dart programs may be executed in one of two modes: production mode or checked mode. In production mode, static type annotations (\ref{staticTypes}) have absolutely no effect on execution with the exception of reflection and structural type tests. 
 
 \commentary{
@@ -138,6 +164,7 @@
 Type tests also examine the types in a program explicitly. Nevertheless, in most cases, these will not depend on type annotations. The exceptions to this rule are type tests involving function types. Function types are structural, and so depend on the types declared for their parameters and on their return types. 
 }
 
+\LMHash{}
 In checked mode, assignments are dynamically checked, and certain violations of the type system raise exceptions at run time.
 
 \commentary{
@@ -150,30 +177,36 @@
 \end{enumerate}
 }
 
+\LMHash{}
 Dart programs are organized in a modular fashion into units called {\em libraries} (\ref{librariesAndScripts}). Libraries are units of encapsulation and may be mutually recursive. 
 
 \commentary{However they are not first class.  To get multiple copies of a library running simultaneously, one needs to spawn an isolate. 
 }
 
 \subsection{Scoping}
-\label{scoping}
+\LMLabel{scoping}
 
+\LMHash{}
 A {\em namespace} is a mapping of names denoting declarations to actual declarations.  Let $NS$ be a namespace. We say that a name $n$ {\em is in }$NS$ if $n$ is a key of $NS$. We say a declaration $d$ {\em is in }$NS$ if a key of $NS$ maps to $d$.
 
+\LMHash{}
 A scope $S_0$ induces a namespace $NS_0$ that maps the simple name of each variable, type or function declaration $d$ declared in $S_0$ to $d$. Labels are not included in the induced namespace of a scope; instead they have their own dedicated namespace.
 
 \commentary{It is therefore impossible, e.g.,  to define a class that declares a method and a field with the same name in Dart. Similarly one cannot declare a top-level function with the same name as a library variable or class.
   }
   
+\LMHash{}
 It is a compile-time error if there is more than one entity with the same name declared in the same scope.
 
 \commentary{
 In some cases, the name of the declaration differs from the identifier used to declare it.  Setters have names that are distinct from the corresponding getters because they always have an = automatically added at the end, and unary minus has the special name unary-.
 }
 
+\LMHash{}
 Dart is lexically scoped.    Scopes may nest.  A name or declaration $d$ is {\em available in scope} $S$ if $d$ is in the namespace induced by $S$ or if $d$ is available in the lexically enclosing scope of $S$. We  say that a name or declaration $d$ is {\em in scope} if $d$ is available in the current scope. 
 
 
+\LMHash{}
 If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$. 
 
 \commentary {
@@ -187,6 +220,7 @@
 \}
 \end{dartCode}
 
+\LMHash{}
 Names may be introduced into a scope by  declarations within the scope or  by other mechanisms such as imports or inheritance.
 
 \rationale{
@@ -227,17 +261,20 @@
 
 
 \subsection{Privacy}
-\label{privacy}
+\LMLabel{privacy}
 
+\LMHash{}
 Dart supports two levels of privacy: {\em public} and {\em private}.  A declaration is {\em private} iff its name is private, otherwise it is {\em public.}  A  name $q$ is private iff any one of the identifiers that comprise $q$ is private,  otherwise it is {\em public.}  An identifier is private iff it
 begins with an underscore (the \_ character) otherwise it is {\em public.} 
 
+\LMHash{}
 A declaration $m$ is {\em accessible to library $L$}  if $m$ is declared in $L$ or if $m$ is public.
 
 \commentary{
 This means private declarations may only be accessed within the library in which they are declared.
 }
 
+\LMHash{}
 Privacy applies only to declarations within a library, not to library declarations themselves. 
 
 \rationale{Libraries do not reference each other by name and so the idea of a private library is meaningless.
@@ -249,17 +286,22 @@
 Privacy is indicated by the name of a declaration - hence privacy and naming are not orthogonal. This has the advantage that both humans and machines can recognize access to private declarations at the point of use without knowledge of the context from which the declaration is derived.}
 
 \subsection{Concurrency}
+\LMLabel{concurrency}
 
+\LMHash{}
 Dart code is always single threaded. There is no shared-state concurrency in Dart. Concurrency is supported via actor-like entities called {\em isolates}.
 
+\LMHash{}
 An isolate is a unit of concurrency. It has its own memory and its own thread of control. Isolates communicate by message passing (\ref{sendingMessages}). No state is ever shared between isolates. Isolates are created by spawning (\ref{spawningAnIsolate}). 
 
 
 \section{Errors and Warnings}
-\label{errorsAndWarnings}
+\LMLabel{errorsAndWarnings}
 
+\LMHash{}
 This specification distinguishes between several kinds of errors.
 
+\LMHash{}
 {\em Compile-time errors} are errors that preclude execution. A compile-time error must be reported by a Dart compiler before the erroneous code is executed. 
 
 \rationale{A Dart implementation has considerable freedom as to when compilation takes place. Modern programming language implementations often interleave compilation and execution, so that compilation of a method may be delayed, e.g.,  until it is first invoked. Consequently, compile-time errors in a method $m$ may be reported as late as the time of $m$'s first invocation.
@@ -269,6 +311,7 @@
 In a development environment a compiler should of course report compilation errors eagerly so as to  best serve the programmer.
 }
 
+\LMHash{}
 If an uncaught compile-time error occurs within the code of a running isolate $A$, $A$ is immediately suspended.  The only circumstance where a compile-time error could be caught would be via code run reflectively, where the mirror system can catch it.
 
 \rationale{Typically, once a compile-time error is thrown and $A$ is suspended, $A$ will then be terminated. However, this depends on the overall environment. 
@@ -276,18 +319,23 @@
 a program that interfaces between the engine and the surrounding computing environment. The embedder will often be a web browser, but need not be; it may be a C++ program on the server for example. When an isolate fails with a compile-time error as described above, control returns to the embedder, along with an exception describing the problem.  This is necessary so that the embedder can clean up resources etc. It is then the embedder's decision whether to terminate the isolate or not.
 }
 
+\LMHash{}
 {\em Static  warnings} are those errors reported by the static checker. They have no effect on execution. Many, but not all, static warnings relate to types, in which case they are known as {\em static type warnings.} Static warnings must be provided by Dart compilers used during development such as those incorporated in IDEs or otherwise intended to be used by developers for developing code. Compilers that are part of runtime execution environments such as virtual machines should not issue static warnings.
 
+\LMHash{}
 {\em Dynamic type errors} are type errors reported in checked mode.
 
+\LMHash{}
 {\em Run-time errors} are exceptions raised during execution. Whenever we say that an exception $ex$ is {\em raised} or {\em thrown}, we mean that a throw expression  (\ref{throw}) of the form: \code{\THROW{} $ex$;} was implicitly evaluated or that a rethrow statement (\ref{rethrow}) of the form \code{\RETHROW} was executed. When we say that {\em a} $C$ {\em is thrown}, where $C$ is a class, we mean that an instance of class $C$ is thrown.
 
+\LMHash{}
 If an uncaught exception is thrown by a running isolate $A$, $A$ is immediately suspended. 
 
 
 \section{Variables}
-\label{variables}
+\LMLabel{variables}
 
+\LMHash{}
 Variables are storage locations in memory.  
 
 \begin{grammar}
@@ -325,19 +373,25 @@
 
   \end{grammar}
 
+\LMHash{}
 A variable that has not been initialized has the initial value \NULL{} (\ref{null}).
 
+\LMHash{}
 A variable declared at the top-level of a library is referred to as either a {\em library variable} or simply a top-level variable. 
 
+\LMHash{}
 A {\em static variable} is a variable that is not associated with a particular instance, but rather with an entire library or class.  Static variables include library variables and class variables. Class variables are variables whose declaration is immediately nested inside a class declaration and includes the modifier \STATIC{}. A library variable is implicitly static. It is a compile-time error to preface a top-level variable declaration with the built-in identifier  (\ref{identifierReference}) \STATIC{}.  
 
+\LMHash{}
 Static variable declarations are initialized lazily. When a static variable $v$ is read, iff it has not yet been assigned,  it is set to the result of evaluating its initializer. The precise rules are given in section \ref{evaluationOfImplicitVariableGetters}. 
 
 \rationale{The lazy semantics are given because we do not want a language where one tends to define expensive initialization computations, causing long application startup times. This is especially crucial for Dart, which must support the coding of  client applications.
 }
 
+\LMHash{}
 A {\em final variable} is a variable whose binding is fixed upon initialization; a final variable $v$ will always refer to the same object after $v$ has been initialized. The declaration of a final variable must  include the modifier \FINAL{}. 
 
+\LMHash{}
 It is a static warning if a final instance variable that has been initialized at its point of declaration  is  also initialized in a constructor. 
 % It is a static warning if a final instance variable that has been initialized by means of an initializing formal of a constructor is  also initialized elsewhere in the same constructor.
 It is a compile-time error if a local variable $v$ is final and $v$ is not initialized at its point of declaration.
@@ -351,20 +405,27 @@
 Taken as a whole, the rules ensure that any attempt to execute multiple assignments to a final variable will yield static warnings and repeated assignments will fail dynamically.
 }
 
+\LMHash{}
 A {\em constant variable} is a variable whose declaration includes the modifier \CONST{}. A constant variable is always implicitly final. A constant variable must be initialized to a compile-time constant (\ref{constants}) or a compile-time error occurs.
 
+\LMHash{}
 We say that a variable $v$ is {\em potentially mutated} in some scope $s$ if $v$ is not final or constant and an assignment to $v$ occurs in $s$.
 
+\LMHash{}
 If a variable declaration does not explicitly specify a type, the type of the declared variable(s) is  \DYNAMIC{}, the unknown type (\ref{typeDynamic}). 
 
+\LMHash{}
 A variable is {\em mutable} if it is not final.
 Static and instance variable declarations always induce implicit getters. If the variable is mutable it also introduces an implicit setter.
 The scope into which the implicit getters and setters are introduced depends on the kind of variable declaration involved. 
 
+\LMHash{}
 A library variable introduces a getter into the top level scope of the enclosing library. A static class variable introduces a static getter into the immediately enclosing class. An instance variable introduces an instance getter into the immediately enclosing class. 
 
+\LMHash{}
 A mutable library variable introduces a setter into the top level scope of the enclosing library. A mutable static class variable introduces a static setter into the immediately enclosing class. A mutable instance variable introduces an instance setter into the immediately enclosing class. 
 
+\LMHash{}
 Local variables are added to the innermost enclosing scope.  They do not induce getters and setters.  A local variable may only be referenced at a source code location that is after its initializer, if any, is complete, or a compile-time error occurs.  The error may be reported either at the point where the premature reference occurs, or at the variable declaration.
 
 \rationale {
@@ -422,8 +483,10 @@
 
 % the grammar does not support local getters and setters. The local var discussion does not seem to mention getters and setters based semantics. It simply discusses the creation of the variable, not its access. Access is either assignment or identifiers. Identifiers ignore the getter story. 
 
+\LMHash{}
 The following rules apply to all static and instance variables.
 
+\LMHash{}
 A  variable declaration  of one of the forms \code{$T$ $v$;},  \code{$T$ $v$ = $e$;} ,  \code{\CONST{} $T$ $v$ = $e$;}, \code{\FINAL{} $T$ $v$;}  or \code{\FINAL{} $T$ $v$ = $e$;} always induces an implicit  getter function (\ref{getters}) with signature 
 
 $T$ \GET{} $v$
@@ -431,18 +494,21 @@
 whose invocation evaluates as described below (\ref{evaluationOfImplicitVariableGetters}).
 
 
+\LMHash{}
 A  variable declaration  of one of the forms \code{\VAR{} $v$;},  \code{\VAR{} $v$ = $e$;} ,  \code{\CONST{} $v$ = $e$;}, \code{\FINAL{} $v$;} or \code{\FINAL{}  $v$ = $e$;}  always induces an implicit  getter function with signature 
 
  \GET{} $v$
 
 whose  invocation evaluates as described below (\ref{evaluationOfImplicitVariableGetters}).
 
+\LMHash{}
 A non-final  variable declaration  of the form \code{{} $T$ $v$;} or the form  \code{$T$ $v$ = $e$;}   always induces an implicit  setter function (\ref{setters}) with signature 
 
  \VOID{} \SET{} $v=(T$ $x)$
 
 whose execution sets the value of $v$ to the incoming argument $x$.
 
+\LMHash{}
 A  non-final variable declaration  of the form \code{\VAR{} $v$;} or the form  \code{\VAR{} $v$ = $e$;}   always induces an implicit  setter function with signature 
 
 \SET{} $v=(x)$
@@ -451,8 +517,9 @@
 
 
 \subsection{Evaluation of Implicit  Variable Getters}
-\label{evaluationOfImplicitVariableGetters}
+\LMLabel{evaluationOfImplicitVariableGetters}
 
+\LMHash{}
 Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
 If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows: 
 \begin{itemize}
@@ -467,8 +534,9 @@
 
 
 \section{Functions}
-\label{functions}
+\LMLabel{functions}
 
+\LMHash{}
 Functions abstract over executable actions.
 
 \begin{grammar}
@@ -491,8 +559,10 @@
 
 \end{grammar}
 
+\LMHash{}
 Functions include  function declarations (\ref{functionDeclarations}), methods (\ref{instanceMethods},  \ref{staticMethods}), getters  (\ref{getters}), setters  (\ref{setters}), constructors  (\ref{constructors}) and function literals  (\ref{functionExpressions}).  
 
+\LMHash{}
 All functions have a signature and a body. The signature describes the formal parameters of the function, and possibly its name and return type.  A function body is either:
 \begin{itemize}
 \item A block statement  (\ref{blocks}) containing the statements  (\ref{statements}) executed by the function, optionally marked with one of the modifiers: \ASYNC, \ASYNC* or \SYNC*. In this case, if the last statement of a function is not a return statement (\ref{return}), the statement \code{\RETURN{};} is implicitly appended to the function body.
@@ -506,12 +576,14 @@
 
 \end{itemize}
 
+\LMHash{}
 A function is {\em asynchronous} if its body is marked with the \ASYNC{} or \ASYNC* modifier. Otherwise the function is {\em synchronous}. A function is a {\em generator} if its body is marked with the \SYNC* or \ASYNC* modifier.  
 
 \commentary{
 Whether a function is synchronous or asynchronous is orthogonal to whether it is a generator or not. Generator functions are a sugar for functions that produce collections in a systematic way, by lazily applying a function that {\em generates} individual elements of a collection. Dart provides such a sugar in both the synchronous case, where one returns an iterable, and in the asynchronous case, where one returns a stream. Dart also allows both synchronous and asynchronous functions that produce a single value. 
 }
 
+\LMHash{}
 It is a compile-time error if an \ASYNC, \ASYNC* or \SYNC* modifier is attached to the body of a setter or constructor.
 
 \rationale{
@@ -524,14 +596,17 @@
 
 
 \subsection{Function Declarations}
-\label{functionDeclarations}
+\LMLabel{functionDeclarations}
 
+\LMHash{}
 A {\em function declaration} is a function that is neither a member of a class nor a function literal. Function declarations include {\em library functions}, which are function declarations 
 %(including getters and setters) 
 at the top level of a library, and {\em local functions}, which are function declarations declared inside other functions. Library functions are often referred to simply as top-level functions.
 
+\LMHash{}
 A function declaration consists of an identifier indicating the function's name, possibly prefaced by a return type. The function name is followed by a signature and body. For getters, the signature  is empty. The body is empty for functions that are external.
 
+\LMHash{}
 The scope of a library function is the scope of the enclosing library. The scope of a local function is  described in section \ref{localFunctionDeclaration}. In both cases, the name of the function is in scope in its formal parameter scope (\ref{formalParameters}).
 
 %A function declaration of the form  $T_0$ $id(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k}= d_k])\{s\}$}, where $F$ is the function type alias (\ref{typedef}) \code{\TYPEDEF{} $T_0$ $F(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}])$}.  Likewise,  a function declaration of the form  $id(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$}, where $F$ is the function type alias \code{\TYPEDEF{}  $F(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}])$}. 
@@ -552,18 +627,23 @@
 
 %A function declaration of the form  $T_0$ $id(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$}, where $F$ is the function type alias (\ref{typedef}) \code{\TYPEDEF{} $T_0$ $F(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]\}$}.  Likewise,  a function declaration of the form  $id(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$}, where $F$ is the function type alias \code{\TYPEDEF{}  $F(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\})$}.
 
+\LMHash{}
 It is a compile-time error to preface a function declaration with the built-in identifier \STATIC{}.
 
+\LMHash{}
 When we say that a function $f_1$ {\em forwards} to another function $f_2$, we mean that  invoking $f_1$ causes $f_2$ to  be executed with the same arguments and/or receiver as $f_1$, and returns the result of executing $f_2$ to the caller of $f_1$, unless $f_2$ throws an exception, in which case $f_1$ throws the same exception. Furthermore, we only use the term for synthetic functions introduced by the specification.
 
 
 \subsection{Formal Parameters}
-\label{formalParameters}
+\LMLabel{formalParameters}
 
+\LMHash{}
 Every function includes a {\em formal parameter list}, which consists of a list of required positional parameters (\ref{requiredFormals}), followed by any optional parameters (\ref{optionalFormals}). The optional parameters may be specified either as a set of named parameters or as a list of positional parameters, but not both.
 
+\LMHash{}
 The formal parameter list of a function introduces a new scope known as the function's {\em formal parameter scope}. The formal parameter scope of a function $f$  is enclosed in the scope where $f$ is declared.   Every formal parameter introduces a local variable into the formal parameter scope. However, the scope of a function's signature is the function's enclosing scope, not the formal parameter scope.
 
+\LMHash{}
 The body of a function introduces a new scope known as the function's {\em  body scope}. The body scope of a function $f$  is enclosed  in the scope introduced by the formal parameter scope of $f$.
 
 
@@ -572,6 +652,7 @@
 % The formal parameters of a function are processed in the enclosing scope of the function. 
 % \commentary{this means that the parameters themselves may not be referenced within the formal parameter list.}
 
+\LMHash{}
 It is a compile-time error if a formal parameter is declared as a constant variable (\ref{variables}).
 
 \begin{grammar}
@@ -611,8 +692,9 @@
 
 
 \subsubsection{Required Formals} 
-\label{requiredFormals}
+\LMLabel{requiredFormals}
 
+\LMHash{}
 A {\em required formal parameter} may be specified in one of three ways:
 \begin{itemize}
 \item By means of a function signature that names the parameter and describes its type as a function type (\ref{functionTypes}).  It is a compile-time error if any default values are specified in the signature of such a function type.% explain what the type is in this case? Where is this described in general?
@@ -636,6 +718,7 @@
 \end{grammar}
 
 %\subsubsection{Rest Formals}
+%\LMLabel{restFormals}
 
 %A rest formal $R$ must be the last parameter in a formal parameter list.  If a  type $T$ is specified for $R$, it signifies that the type of $R$ is $T[]$. 
 
@@ -645,8 +728,9 @@
  %\end{grammar}
 
 \subsubsection{Optional Formals}
-\label{optionalFormals}
+\LMLabel{optionalFormals}
 
+\LMHash{}
 Optional parameters may be specified and provided with default values.
 
 \begin{grammar}
@@ -659,8 +743,10 @@
     .   
 \end{grammar}
 
+\LMHash{}
 It is a compile-time error if the default value of an optional parameter is not a compile-time constant (\ref{constants}). If no default is explicitly specified for an optional parameter an implicit default of \NULL{} is provided.
 
+\LMHash{}
 It is a compile-time error if the name of a named optional parameter begins with an `\_' character.
 
 \rationale{
@@ -669,16 +755,21 @@
 }
 
 \subsection{Type of a Function}
-\label{typeOfAFunction}
+\LMLabel{typeOfAFunction}
 
+\LMHash{}
 If a function does not declare a return type explicitly, its return type is \DYNAMIC{} (\ref{typeDynamic}).
 
+\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and no optional parameters. Then the type of $F$ is $(T_1 ,\ldots, T_n) \rightarrow T_0$.
 
+\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and positional optional parameters $T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $ p_{n+k}$. Then the type of $F$ is $(T_1 ,\ldots, T_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$  $p_{n+k}]) \rightarrow T_0$.
 
+\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and named optional parameters $T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $ p_{n+k}$. Then the type of $F$ is $(T_1 ,\ldots, T_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$  $p_{n+k}\}) \rightarrow T_0$.
 
+\LMHash{}
 The run time type of a function object always implements the class \cd{Function}. 
 
 \commentary{
@@ -692,8 +783,9 @@
 }
 
 \subsection{External Functions}
-\label{externalFunctions}
+\LMLabel{externalFunctions}
 
+\LMHash{}
 An {\em external function} is a function whose body is provided separately from its declaration. An external function may be a top-level function (\ref{librariesAndScripts}), a method (\ref{instanceMethods}, \ref{staticMethods}), a getter (\ref{getters}), a setter (\ref{setters}) or a non-redirecting constructor (\ref{generativeConstructors}, \ref{factories}). External functions are introduced via the built-in identifier \EXTERNAL{}  (\ref{identifierReference}) followed by the function signature.  
 
 \rationale{
@@ -704,13 +796,16 @@
 Examples of external functions might be foreign functions (defined in C, or Javascript etc.), primitives of the implementation (as defined by the Dart runtime), or code that was dynamically generated but whose interface is statically known. However, an abstract method is different from an external function, as it has {\em no} body.
 }
 
+\LMHash{}
 An external function is connected to its body by an implementation specific mechanism. Attempting to invoke an external function that has not been connected to its body will raise a \code{NoSuchMethodError} or some subclass thereof.
 
+\LMHash{}
 The actual syntax is given in sections \ref{classes} and \ref{librariesAndScripts} below.
 
 \section{Classes}
-\label{classes}
+\LMLabel{classes}
 
+\LMHash{}
 A {\em class} defines the form and behavior of a set of objects which are its {\em instances}.  Classes may be defined by class declarations as described below, or via mixin applications (\ref{mixinApplication}).
 
 \begin{grammar}
@@ -761,6 +856,7 @@
 
 \end{grammar}
 
+\LMHash{}
 A class has constructors,  instance members and static members. The instance members of a class are its instance methods, getters, setters and instance variables. The static members of a class are its static methods, getters, setters and static variables. The members of a class are its static and instance members.
 
 % A class has a static scope and an instance scope. The enclosing scope of the static scope of a non-generic class is the enclosing scope of the class declaration. The enclosing scope of the static scope of a generic class is the type parameter scope (\ref{}) of the generic class declaration.
@@ -771,12 +867,14 @@
 %The enclosing scope of a static member declaration is the static scope of the class in which it is declared.
 
 
+\LMHash{}
 Every class has a single superclass  except class \code{Object} which has no superclass. A class may implement a number of interfaces
 %, either 
 by declaring them in its implements clause  (\ref{superinterfaces}).
 % or via interface injection declarations (\ref{interfaceInjection}) outside the class declaration
 
 
+\LMHash{}
 An {\em abstract class} is 
 %either 
 a class that is explicitly declared with the  \ABSTRACT{}  modifier, either by means of a class declaration or via a type alias (\ref{typedef}) for a mixin application (\ref{mixinApplication}). A {\em concrete class} is a class that is not abstract.
@@ -787,6 +885,7 @@
 We want different behavior for concrete classes and abstract classes. If $A$ is intended to be abstract, we want the static checker to warn about any attempt to instantiate $A$, and we do not want the checker to complain about unimplemented methods in $A$. In contrast, if $A$ is intended to be concrete, the checker should warn about all unimplemented methods, but allow clients to instantiate it freely.
 }
 
+\LMHash{}
 The {\em interface of class $C$} is an implicit interface that declares instance members that correspond to the instance members declared by $C$, and whose direct superinterfaces are the direct superinterfaces of $C$ (\ref{superinterfaces}). When a class name appears as a type, that name denotes the interface of the class.
 
 % making an exception for the setters generated for final fields is tempting but problematic.
@@ -794,6 +893,7 @@
 % Maybe the final field hides the setter in scope?
 % I think the original rules were best.
 
+\LMHash{}
  It is a compile-time error if a class declares two members of the same name.
  %, except that a getter and a setter may be declared with the same name provided both are instance members or both are static members.
 It is a compile-time error if a class has an instance member and a static member  with the same name. 
@@ -819,27 +919,32 @@
 \}
 \end{dartCode}
 
+\LMHash{}
 It is a compile time error if a class $C$ declares a member with the same name as $C$. It is a compile time error if a generic class declares a type variable with the same name as the class or any of its members or constructors.
 
 \subsection{Instance Methods}
-\label{instanceMethods}
+\LMLabel{instanceMethods}
 
+\LMHash{}
 Instance methods are functions (\ref{functions}) whose declarations are immediately contained within a class declaration and that are not declared \STATIC{}. The instance methods of a class $C$ are those instance methods declared by $C$ and the instance methods inherited by $C$ from its superclass.
 
 %make these warnings if possible
 
+\LMHash{}
 It is a static warning if an instance method $m_1$ overrides  (\ref{inheritanceAndOverriding}) an instance member $m_2$ and  $m_1$ has a greater number of required parameters than $m_2$. It is a static warning if an instance method $m_1$ overrides  an instance member $m_2$ and  $m_1$ has fewer positional parameters than $m_2$.  It is a static warning if an instance method $m_1$ overrides  an instance member $m_2$ and  $m_1$ does not declare all the named parameters declared by $m_2$. 
 
 % not quite right. It should be ok to override a method that requires N parameters with one that requires M < N but accepts the others as optional.
 
+\LMHash{}
 It is a static warning if an instance method $m_1$ overrides an instance member $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$. It is a static warning if an instance method $m_1$ overrides an instance member $m_2$,  the signature of $m_2$ explicitly specifies a default value for a formal parameter $p$ and the signature of $m_1$ implies a different default value for $p$. It is a static warning if a class $C$ declares an instance method named $n$ and has a setter named $n=$. It is a static warning if a class $C$ declares an instance method named $n$ and an accessible static member named $n$ is declared in a superclass of $C$.
 
 % Works. If the name is public, no issue. If it's private, if a subclass has a conflicting inst var, it either is in the same lib and will be flagged, or is in another and is not an issue.
 
 
 \subsubsection{Operators}
-\label{operators}
+\LMLabel{operators}
 
+\LMHash{}
 {\em Operators} are instance methods with special names. 
 
 \begin{grammar}
@@ -862,33 +967,41 @@
     .
  \end{grammar}
 
+\LMHash{}
 An operator declaration is identified using the built-in identifier (\ref{identifierReference}) \OPERATOR{}.
 
+\LMHash{}
 The following names are allowed for user-defined operators: \code{$<$, $>$, $<$=, $>$=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$,  []=, [], \~{}.}
 
 
+\LMHash{}
 It is a compile-time error if the arity of the user-declared operator \code{[]=} is not 2. It is a compile-time error if the arity of a user-declared operator with one of the names:  \code{ $<$, $>$, $<$=, $>$=, ==, -, +,  \~{}/, /, *, \%, $|$, \^{}, \&, $<<$, $>>$, []} is not 1. It is a compile-time error if the arity of the user-declared operator  \code{-} is not 0 or 1. 
 
 \commentary{
 The \code{-} operator is unique in that two overloaded versions are permitted. If the operator has no arguments, it denotes unary minus. If it has an argument, it denotes binary subtraction. 
 }
 
+\LMHash{}
 The name of the unary operator \code{-} is \code{unary-}.
 
 \rationale{
 This device allows the two methods to be distinguished for purposes of method lookup, override and reflection.
 }
 
+\LMHash{}
 It is a compile-time error if the arity of the user-declared operator  \code{ \~{}} is not 0. 
 
+\LMHash{}
 It is a compile-time error to declare an optional parameter in an operator.
 
+\LMHash{}
 It is a static warning if the return type of the user-declared operator \code{[]=} is explicitly declared and not \VOID{}.
 
 
 \subsection{Getters} 
-\label{getters}
+\LMLabel{getters}
 
+\LMHash{}
 Getters are functions (\ref{functions})  that are used to retrieve the values of object properties.
 
 \begin{grammar}
@@ -899,29 +1012,36 @@
 
 %\Q{Why does a getter have a formal parameter list at all?}
 
+\LMHash{}
 If no return type is specified, the return type of the getter is  \DYNAMIC{}.
 
+\LMHash{}
 A getter definition that is prefixed with the \STATIC{} modifier defines a static getter. Otherwise, it defines an instance getter. The name of the getter is given by the identifier in the definition. The effect of a static getter declaration in class $C$ is to add an instance getter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static getter.
 
 %It is a compile-time error if a getter`s formal parameter list is not empty.
 
+\LMHash{}
 The instance getters of a class $C$ are those instance getters declared by $C$, either implicitly or explicitly, and the instance getters inherited by $C$ from its superclass. The static getters of a class $C$ are those static getters declared by $C$.
 
+\LMHash{}
 It is a compile-time error if a class has both a getter and a method with the same name. This restriction holds regardless of whether the getter is defined explicitly or implicitly, or whether the getter or the method are inherited or not.
 
 \commentary{
 This implies that a getter can never override a method, and a method can never override a getter or field. 
 }
 
+\LMHash{}
 It is a static warning if the return type of a getter is \VOID.
 It is a static warning if a getter $m_1$ overrides  (\ref{inheritanceAndOverriding}) a getter 
 $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$.   
 
+\LMHash{}
 It is a static warning if a class  declares a static getter named $v$ and also has a non-static setter named $v=$. It is a static warning if a class $C$ declares an instance getter named $v$ and an accessible static member named $v$ or $v=$ is declared in a superclass of $C$. These warnings must be issued regardless of whether the getters or setters are declared explicitly or implicitly.
 
 \subsection{Setters}
-\label{setters}
+\LMLabel{setters}
 
+\LMHash{}
 Setters are functions (\ref{functions}) that are used to set the values of object properties.
 
 % what about top level ones? Same for getters
@@ -932,28 +1052,36 @@
 .
 \end{grammar}
 
+\LMHash{}
 If no return type is specified, the return type of the setter is  \DYNAMIC{}.
 
+\LMHash{}
 A setter definition that is prefixed with the \STATIC{} modifier defines a static setter. Otherwise, it defines an instance setter. The name of a setter is  obtained by appending the  string `='  to the identifier given in its signature. The effect of a static setter declaration in class $C$ is to add an instance setter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static setter.
 
 \commentary{Hence, a setter name can never conflict with, override or be overridden by a getter or method.}
 
+\LMHash{}
 The instance setters of a class $C$ are those instance setters declared by $C$ either implicitly or explicitly, and the instance setters inherited by $C$ from its superclass. The static setters of a class $C$ are those static setters declared by $C$.
 
+\LMHash{}
 It is a compile-time error if a setter's formal parameter list does not consist of exactly one required formal parameter $p$.  \rationale{We could enforce this via the grammar, but we'd have to specify the evaluation rules in that case.}
 
 %It is a compile-time error if a class has both a setter and a method with the same name. This restriction holds regardless of whether the setter is defined explicitly or implicitly, or whether the setter or the method are inherited or not.
 
+\LMHash{}
 It is a static warning if a setter declares a return type other than \VOID{}.
 It is a static warning if a setter $m_1$ overrides  (\ref{inheritanceAndOverriding}) a setter $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$. It is a static warning if a class has a setter named $v=$ with argument type $T$ and a getter named $v$ with return type $S$, and $T$ may not be assigned to $S$. 
 
+\LMHash{}
 It is a static warning if a class  declares a static setter named $v=$ and also has a non-static member named $v$. It is a static warning if a class $C$ declares an instance setter named $v=$ and an accessible static member named $v=$ or $v$ is declared in a superclass of $C$.
 
+\LMHash{}
 These warnings must be issued regardless of whether the getters or setters are declared explicitly or implicitly.
 
 \subsection{Abstract Instance Members}
-\label{abstractInstanceMembers}
+\LMLabel{abstractInstanceMembers}
 
+\LMHash{}
 An {\em abstract method} (respectively, {\em abstract getter} or {\em abstract setter)} is an instance method, getter or setter that is not declared \EXTERNAL{} and does not  provide an implementation. A {\em concrete method} (respectively, {\em concrete getter} or {\em concrete setter)} is an instance method, getter or setter that is not abstract.
 %The declaration of an abstract method is prefixed by the built-in identifier (\ref{identifierReference}) \ABSTRACT{}.
 
@@ -977,6 +1105,7 @@
 }
 %always results in a run-time error. This must be \code{NoSuchMethodError} or an instance of a subclass of \code{NoSuchMethodError}, such as \code{AbstractMethodError}.
 
+\LMHash{}
 It is a static warning if an abstract member is declared or inherited in a concrete class unless that member overrides a concrete one.
 
 \rationale {
@@ -1001,10 +1130,12 @@
 \rationale{At run time, the concrete method \cd{one} declared in \cd{Base} will be executed, and no problem should arise. Therefore no warning should be issued and so we suppress warnings if a corresponding concrete member exists in the hierarchy. }
 
 \subsection{Instance Variables}
-\label{instanceVariables}
+\LMLabel{instanceVariables}
 
+\LMHash{}
 Instance variables are variables whose declarations are immediately contained within a class declaration and that are not declared \STATIC{}. The instance variables of a class $C$ are those instance variables declared by $C$ and the instance variables inherited by $C$ from its superclass.
 
+\LMHash{}
 It is a compile-time error if an instance variable is declared to be constant.
 
 \rationale{
@@ -1048,10 +1179,12 @@
 
 
 \subsection{Constructors}
-\label{constructors}
+\LMLabel{constructors}
 
+\LMHash{}
 A {\em constructor} is a special function that is used in instance creation expressions (\ref{instanceCreation}) to produce objects. Constructors may be generative (\ref{generativeConstructors}) or they may be factories (\ref{factories}). 
 
+\LMHash{}
 A {\em constructor name} always begins with the name of its immediately enclosing class, and may optionally be followed by a dot and an identifier $id$. It is a compile-time error if $id$ is the name of a member  declared in the immediately enclosing class. It is a compile-time error if the name of a  constructor is not a constructor name. 
 
 
@@ -1059,11 +1192,13 @@
 
 % The enclosing scope of a generative constructor is the instance scope of the class in which it is declared (but what about redirecting?) 
 
+\LMHash{}
 Iff no constructor is specified for a class $C$, it implicitly has a default constructor \code{C() : \SUPER{}() \{\}}, unless $C$ is class \code{Object}.
 
 \subsubsection{Generative Constructors}
-\label{generativeConstructors}
+\LMLabel{generativeConstructors}
 
+\LMHash{}
 A {\em generative constructor} consists of a constructor name, a constructor parameter list, and either a redirect clause or an  initializer list and an optional body.
 
 \begin{grammar}
@@ -1072,12 +1207,16 @@
     .
  \end{grammar}
 
+\LMHash{}
 A {\em constructor parameter list} is a parenthesized, comma-separated list of formal constructor parameters. A {\em formal constructor parameter} is either a formal parameter (\ref{formalParameters}) or an initializing formal. An {\em initializing formal} has the form \code{\THIS{}.id}, where \code{id} is the name of an instance variable of the immediately enclosing class.  It is a compile-time error if \code{id} is not an instance variable of the immediately enclosing class. It is a compile-time error if an initializing formal is used by a function other than a non-redirecting generative constructor. 
 
+\LMHash{}
 If an explicit type is attached to the initializing formal, that is its static type. Otherwise, the type of an initializing formal named \code{id} is $T_{id}$, where $T_{id}$ is the type of the field named \code{id} in the immediately enclosing class. It is a static warning if the static type of \code{id} is not assignable to $T_{id}$.
 
+\LMHash{}
 Using an initializing formal \code{\THIS{}.id} in a formal parameter list does not introduce a formal parameter name into the scope of the constructor. However, the initializing formal does effect the type of the constructor function exactly as if a formal parameter  named \code{id}  of the same type were introduced in the same position.
 
+\LMHash{}
 Initializing formals are executed during the execution of generative constructors detailed below. Executing an initializing formal  \code{\THIS{}.id} causes the field \code{id} of the immediately surrounding class to be assigned the value of the corresponding actual parameter, unless $id$ is a final variable that has already been initialized, in which case a runtime error occurs.
 
 
@@ -1101,18 +1240,21 @@
 \}
 \end{dartCode}
 
+\LMHash{}
 A {\em fresh instance} is an instance whose identity  is distinct from any previously allocated instance of its class. A generative constructor always operates on a fresh instance of its immediately enclosing class. 
 
 \commentary{
 The above holds if the constructor is actually run, as it is by \NEW{}. If a constructor $c$ is referenced by \CONST{}, $c$ may not be run; instead, a canonical object may be looked up. See the section on instance creation (\ref{instanceCreation}).
 }
 
+\LMHash{}
 If a generative constructor $c$  is not a redirecting constructor and no body is provided, then $c$ implicitly has an empty body \code{\{\}}.
 
 
 \paragraph{Redirecting Constructors}
-\label{redirectingConstructors}
+\LMLabel{redirectingConstructors}
 
+\LMHash{}
 A generative constructor may be {\em redirecting}, in which case its only action is to invoke another generative constructor.  A redirecting constructor has no body; instead, it has a redirect clause that specifies which constructor the invocation is redirected to, and with what arguments.
 
 \begin{grammar}
@@ -1127,7 +1269,9 @@
 %\Q{We now have generative constructors with no bodies as well.}
 
 \paragraph{Initializer Lists}
+\LMLabel{initializerLists}
 
+\LMHash{}
 An initializer list begins with a colon, and consists of a comma-separated list of individual {\em initializers}. There are two kinds of initializers.
 \begin{itemize}
 \item A {\em superinitializer} identifies a {\em superconstructor} - that is, a specific  constructor of the superclass.  Execution of the superinitializer causes the initializer list of the superconstructor to be executed.
@@ -1152,8 +1296,10 @@
 
 \end{grammar}
 
+\LMHash{}
 Let $k$ be a generative constructor.  Then $k$ may include at most one  superinitializer in its initializer list or a compile-time error occurs. If no superinitializer is provided, an implicit superinitializer of the form \SUPER{}() is added at the end of $k$'s initializer list, unless the enclosing class is class \code{Object}. It is a compile-time error if more than one initializer corresponding to a given instance variable appears in $k$'s initializer list. It is a compile-time error if $k$'s initializer list contains an initializer for a variable that is initialized by means of an initializing formal of $k$. % It is a compile-time error if  $k$'s initializer list contains an initializer for a final variable $f$ whose declaration includes an initialization expression.
  
+\LMHash{}
 Each final instance variable $f$ declared in the immediately enclosing class must have an initializer in $k$'s initializer list unless it has already been initialized by one of the following means:
  \begin{itemize}
  \item Initialization at the declaration of $f$.
@@ -1166,21 +1312,26 @@
 \commentary{The  initializer list may of course contain an initializer for any  instance variable declared by the immediately surrounding class, even if it is not final. 
 }
 
+\LMHash{}
  It is a compile-time error if a  generative constructor of class \code{Object} includes a superinitializer. 
 
+\LMHash{}
 Execution of a generative constructor $k$ is always done with respect to a set of bindings for its formal parameters and with  \THIS{} bound to a fresh instance $i$ and the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$. 
 
 \commentary{These bindings are usually determined by the instance creation expression that invoked the constructor (directly or indirectly). However, they may also be determined by a reflective call,.
 }
 
+\LMHash{}
 If $k$ is redirecting then its redirect clause has the form 
 
 \THIS{}$.g(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
 
 where $g$ identifies another  generative constructor of the immediately surrounding class. Then execution of $k$ proceeds by evaluating the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, and then executing $g$ with respect to the bindings resulting from the evaluation of $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ and with  \THIS{} bound to $i$ and the type parameters of the immediately enclosing class bound to $V_1, \ldots , V_m$. 
 
+\LMHash{}
 Otherwise, execution  proceeds as follows:
 
+\LMHash{}
 %First, a fresh instance (\ref{generativeConstructors}) $i$ of the immediately enclosing class is allocated.  Next, the instance variable declarations of the immediately enclosing class are visited in the order they appear in the program text. For each such declaration $d$, if $d$ has the form  \code{$finalConstVarOrType$ $v$ = $e$; } then the instance variable $v$ of $i$ is bound to the value of $e$ (which is necessarily a compile-time constant).
 %Next, a
 Any initializing formals declared in $k$'s parameter list are executed in the order they appear in the program text.  
@@ -1190,18 +1341,23 @@
 
 \rationale {We could observe the order by side  effecting external routines called. So we need to specify the order.}
 
+\LMHash{}
 After all the initializers  have completed, the body of $k$ is executed  in a scope where \THIS{} is bound to $i$. Execution of the body begins with execution of the body of the superconstructor  with \THIS{} bound to $i$, the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$ and the formal parameters bindings determined by the argument list of the superinitializer of $k$.
 
 \rationale{
 This process ensures that no uninitialized final field is ever seen by code. Note that \THIS{} is not in scope on the right hand side of an initializer (see \ref{this}) so no instance method can execute during initialization: an instance method cannot be directly invoked, nor can  \THIS{} be passed into any other code being invoked in the initializer. 
 }
 
+\LMHash{}
 Execution of an initializer of the form \code{\THIS{}.$v$ = $e$} proceeds as follows:
 
+\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. Then, the instance variable $v$ of the object denoted by \THIS{} is bound to $o$, unless $v$ is a final variable that has already been initialized, in which case a runtime error occurs. In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type of the field $v$.
 
+\LMHash{}
 An initializer of the form \code{$v$ = $e$} is equivalent to an initializer of the form  \code{\THIS{}.$v$ = $e$}. 
 
+\LMHash{}
 Execution of a superinitializer of the form 
 
 \SUPER{}$(a_1, \ldots, a_n,  x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$ 
@@ -1210,17 +1366,22 @@
 
 proceeds as follows:
 
+\LMHash{}
 First, the argument list $(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$ is evaluated.
 
+\LMHash{}
 Let $C$ be the class in which the superinitializer appears and let $S$ be the superclass of $C$.  If $S$ is generic (\ref{generics}), let $U_1, , \ldots, U_m$ be the actual type arguments passed to $S$ in the superclass clause of $C$.
 
+\LMHash{}
 Then, the initializer list of the constructor $S$ (respectively $S.id$) is executed with respect to the bindings that resulted from the evaluation of the argument list,  with \THIS{} bound to the current binding of \THIS{}, and  the type parameters (if any) of class $S$ bound to the current bindings of $U_1, , \ldots, U_m$.
 
+\LMHash{}
 It is a compile-time error if class $S$ does not declare a generative constructor named $S$ (respectively $S.id$).
 
 \subsubsection{Factories}
-\label{factories}
+\LMLabel{factories}
 
+\LMHash{}
 A {\em factory} is a constructor prefaced by the built-in identifier  (\ref{identifierReference})   \FACTORY{}. 
 
 \begin{grammar}
@@ -1232,10 +1393,13 @@
 
 %The enclosing scope of a factory constructor is the static scope \ref{} of the class in which it is declared.
 
+\LMHash{}
 The {\em return type} of a factory whose signature is of the form \FACTORY{} $M$ or the form \FACTORY{} $M.id$ is $M$ if $M$ is not a generic type; otherwise the return type is  $M <T_1, \ldots, T_n>$ where $T_1, \ldots, T_n$ are the type parameters of the enclosing class
 
+\LMHash{}
 It is a compile-time error if $M$ is not the name of the immediately enclosing class. 
 
+\LMHash{}
 In checked mode, it is a dynamic type error if a factory returns a non-null object whose type is not a subtype of its actual (\ref{actualTypeOfADeclaration}) return type.
 
 \rationale{It seems useless to allow a factory to return null. But it is more uniform to allow it, as the rules currently do.}
@@ -1246,8 +1410,9 @@
 }
 
 \paragraph{Redirecting Factory Constructors}
-\label{redirectingFactoryConstructors}
+\LMLabel{redirectingFactoryConstructors}
 
+\LMHash{}
 A {\em redirecting factory constructor} specifies a call to a constructor of another class that is to be used whenever the redirecting constructor is called.
 
 \begin{grammar}
@@ -1256,16 +1421,19 @@
     .
 \end{grammar}
 
+\LMHash{}
 Calling a redirecting factory constructor $k$ causes the constructor $k^\prime$ denoted by $type$ (respectively, $type.identifier$) to be called with the actual arguments passed to $k$, and returns the result of $k^\prime$ as the result of $k$.  The resulting constructor call is governed by the same rules as an instance creation expression using \NEW{} (\ref{instanceCreation}). 
 
 \commentary{
 It follows that if $type$ or $type.id$ are not defined, or do not refer to a class or constructor, a dynamic error occurs, as with any other undefined constructor call. The same holds if $k$ is called with fewer required parameters or more positional parameters than $k^\prime$ expects, or if $k$  is called with a named parameter that is not declared by $k^\prime$.
 }
 
+\LMHash{}
 It is a compile-time error if $k$ explicitly specifies a default value for an optional parameter.\commentary{
 Default values specified in $k$ would be ignored, since it is the {\em actual} parameters that are passed to $k^\prime$. Hence, default values are disallowed.
 }
 
+\LMHash{}
 It is a run-time error if a redirecting factory constructor redirects to itself, either directly or indirectly via a sequence of redirections. %does not redirect to a non-redirecting factory constructor or to a generative constructor in a finite number of steps.
 
 % Make this a runtime error so deferred loading works
@@ -1275,6 +1443,7 @@
 } 
 
 
+\LMHash{}
 It is a static warning if $type$ does not denote a class accessible in the current scope; if $type$ does denote such a class $C$ it is a static warning if the referenced constructor (be it $type$ or $type.id$) is not a constructor of $C$.
 
 \commentary{
@@ -1316,20 +1485,24 @@
 }
 %\end{dartCode}
 
+\LMHash{}
 It is a compile-time error if $k$ is prefixed with the \CONST{} modifier but $k^\prime$ is not a constant constructor (\ref{constantConstructors}).
 
+\LMHash{}
 It is a static warning if the function type of $k^\prime$ is not a subtype of the type of $k$.
 
 \commentary{
 This implies that the  resulting object conforms to the interface of the immediately enclosing class of $k$.
 }
 
+\LMHash{}
 It is a static type warning if any of the type arguments to $k^\prime$ are not subtypes of the bounds of the corresponding formal type parameters of $type$.
 
 
 \subsubsection{Constant Constructors}
-\label{constantConstructors}
+\LMLabel{constantConstructors}
 
+\LMHash{}
 A {\em constant constructor} may be used to create compile-time constant  (\ref{constants}) objects. A constant constructor is prefixed by the reserved word \CONST{}. 
 
 \begin{grammar}
@@ -1345,22 +1518,27 @@
 
 \commentary{All the work of a constant constructor must be handled via its initializers.}
 
+\LMHash{}
 It is a compile-time error if a constant constructor is declared by a class that has a non-final instance variable.  
 
 \commentary{
 The above refers to both locally declared and inherited instance variables.
 }
 
+\LMHash{}
 It is a compile-time error if a constant constructor is declared by a class $C$ if any instance variable declared in $C$ is initialized with an expression that is not a constant expression.
 
 \commentary {
 A superclass of $C$ cannot declare such an initializer either, because it must necessarily declare constant constructor as well (unless it is \code{Object}, which declares no instance variables).
 }
 
+\LMHash{}
 The superinitializer that appears, explicitly or implicitly, in the initializer list of a constant constructor must specify a constant constructor of the superclass of the immediately enclosing class or a compile-time error occurs.
 
+\LMHash{}
 Any expression that appears within the initializer list of a constant constructor must be a potentially constant expression, or a compile-time error occurs. 
 
+\LMHash{}
 A {\em potentially constant expression} is an expression $e$ that would be a valid constant expression if all formal parameters of $e$'s immediately enclosing constant constructor were treated as compile-time constants that were guaranteed to evaluate to an integer, boolean or string value as required by their immediately enclosing superexpression.
 
 \commentary{
@@ -1424,15 +1602,18 @@
 Careful readers will of course worry about cases where the actual arguments to \code{C()} are constants, but are not numeric. This is precluded by the following rule, combined with the rules for evaluating constant objects (\ref{const}).
 }
 
+\LMHash{}
 When invoked from a constant object expression, a constant constructor must throw an exception if any of its actual parameters is a value that would prevent one of the potentially constant expressions within it from being a valid compile-time constant.
 
 %Discuss External Constructors in ne subsubsection here
 
 \subsection{Static Methods}
-\label{staticMethods}
+\LMLabel{staticMethods}
 
+\LMHash{}
 {\em Static methods} are functions, other than getters or setters, whose declarations are immediately contained within a class declaration and that are declared \STATIC{}. The static methods of a class $C$ are those static methods declared by $C$.
 
+\LMHash{}
 The effect of a static method declaration in class $C$ is to add an instance method with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static method.
 
 \rationale{
@@ -1441,6 +1622,7 @@
 Of course, the entire notion of static methods is debatable, but it is retained here because so many programmers are familiar with it. Dart static methods may be seen as functions of the enclosing library. 
 }
 
+\LMHash{}
 It is a static warning if a class $C$ declares a static method named $n$ and has a setter named $n=$. 
 %It is a static warning if a class has a static method with the same name as a static member of one of its superclasses.
 
@@ -1453,8 +1635,9 @@
 
 
 \subsection{Static Variables}
-\label{staticVariables}
+\LMLabel{staticVariables}
 
+\LMHash{}
 {\em Static variables} are variables whose declarations are immediately contained within a class declaration and that are declared \STATIC{}. The static variables of a class $C$ are those static variables declared by $C$.
 
 %A static variable declaration  of one of the forms \code{\STATIC{} $T$ $v$;},  \code{\STATIC{} $T$ $v$ = $e$;} ,  \code{\STATIC{} \CONST{} $T$ $v$ = $e$;}  or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} always induces an implicit static getter function (\ref{getters}) with signature 
@@ -1485,7 +1668,7 @@
 %Extrernal static functions, getters, setters
 
 %\subsubsection{Evaluation of Implicit Static Variable Getters}
-%\label{evaluationOfStaticVariableGetters}
+%\LMLabel{evaluationOfStaticVariableGetters}
 
 %Let $d$ be the declaration of a static variable $v$. The implicit getter method of $v$ executes as follows: 
 %\begin{itemize}
@@ -1498,14 +1681,16 @@
 
 
 \subsection{Superclasses}
-\label{superclasses}
+\LMLabel{superclasses}
 
+\LMHash{}
 The superclass of a class $C$ that has a with clause \code{\WITH{} $M_1, \ldots, M_k$} and an extends clause \code{\EXTENDS{} S} is the application of mixin (\ref{mixins}) $M_k* \cdots * M_1$  to S.  If no \WITH{} clause is specified then  the \EXTENDS{} clause of a class $C$ specifies its superclass. If no \EXTENDS{} clause is specified, then either:
 \begin{itemize}
 \item $C$ is \code{Object}, which has no superclass. OR
 \item Class $C$ is  deemed to have an \EXTENDS{} clause of the form \code{\EXTENDS{} Object}, and the rules above apply. 
 \end{itemize}
 
+\LMHash{}
 It is a compile-time error to specify an \EXTENDS{} clause for class \code{Object}.
 
 \begin{grammar}
@@ -1519,6 +1704,7 @@
 %This means that in a generic class, the type parameters of the generic are available in the superclass clause.
 %} 
 
+\LMHash{}
 %It is a compile-time error if  the \EXTENDS{} clause of a class $C$ includes a type expression that does not denote a class available in the lexical scope of $C$. 
 It is a compile-time error if  the \EXTENDS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a malformed  type or a deferred type (\ref{staticTypes}) as a superclass.
 % too strict? Do we e want extends List<Undeclared> to work as List<dynamic>? 
@@ -1535,23 +1721,26 @@
 \end{dartCode}
 
 
+\LMHash{}
 A class $S$ is {\em a superclass} of a class $C$ iff either:
 \begin{itemize}
 \item $S$ is the superclass of $C$, or 
 \item $S$ is a superclass of a class $S^{\prime}$ and $S^{\prime}$ is a superclass of $C$. 
 \end{itemize}
 
+\LMHash{}
 It is a compile-time error if a class $C$ is a superclass of itself.
 
 
     
  
  \subsubsection{Inheritance and Overriding}
- \label{inheritanceAndOverriding}
+ \LMLabel{inheritanceAndOverriding}
 
 
 %A class $C$  {\em inherits} any accessible instance members of its superclass that are not overridden by members declared in $C$. 
 
+\LMHash{}
 Let $C$ be a class,  let $A$ be a superclass of $C$, and let  $S_1 \ldots S_k$ be superclasses of $C$ that are also subclasses of $A$. $C$ {\em inherits} all accessible instance  members of  $A$ that have not been overridden by a declaration in $C$ or in at least one of $S_1 \ldots S_k$.
 
 \rationale {
@@ -1560,8 +1749,10 @@
 the superclass chain of $S$ includes a class declared in $L_1$.
 }
 
+\LMHash{}
 A class may override instance members that would otherwise have been inherited from its superclass. 
 
+\LMHash{}
 Let $C = S_0$ be a class declared in library $L$, and let $\{S_1 \ldots S_k\}$ be the set of all superclasses of $C$, where $S_i$ is the superclass of $S_{i-1}$ for $i \in 1 .. k$. Let $C$ declare a member $m$, and let  $m^\prime$ be a member of $S_j, j  \in 1 .. k$,  that has the same name as $m$, such that $m^\prime$ is accessible to $L$.  Then $m$ overrides $m^\prime$ if $m^\prime$ is not already overridden by a member of at least one of $S_1 \ldots S_{j-1}$ and neither $m$ nor $m^\prime$ are fields.
 
 %Let $C$ be a class declared in library $L$, with superclass $S$ and let $C$ declare an instance member $m$, and  assume $S$ declares an instance member $m^\prime$ with the same name as $m$. Then $m$ {\em overrides} $m^\prime$ iff $m^\prime$ is accessible (\ref{privacy}) to $L$, $m$ has the same name as  $m^\prime$  and neither $m$ nor $m^\prime$ are fields.
@@ -1571,6 +1762,7 @@
 \rationale{Again, a local definition of overriding would be preferable, but fails to account for library privacy.
 }
 
+\LMHash{}
 Whether an override is legal or not is described elsewhere in this specification (see \ref{instanceMethods}, \ref{getters} and \ref{setters}). 
 
 \commentary{For example getters may not legally override methods and vice versa. Setters never override methods or getters, and vice versa, because their names always differ.
@@ -1584,6 +1776,7 @@
 Note that instance variables do not participate in the override relation, but the getters and setters they induce do. Also, getters don't override setters and vice versa.  Finally, static members never override anything.
 }
 
+\LMHash{}
 It is a static warning if a non-abstract class inherits an abstract method.
 
 \commentary {
@@ -1631,9 +1824,10 @@
 %Can we have abstract getters and setters?
 
 \subsection{ Superinterfaces}
-\label{superinterfaces}
+\LMLabel{superinterfaces}
 % what about rules about classes that fail to implement their interfaces?
 
+\LMHash{}
 A class has a set of direct superinterfaces. This set includes the interface of its superclass and the interfaces specified in the the \IMPLEMENTS{}  clause of the class.
 % and any superinterfaces specified by interface injection (\ref{interfaceInjection}).  \Q{The latter needs to be worded carefully - when do interface injection clauses execute and in what scope?}
 
@@ -1643,6 +1837,7 @@
     .
 \end{grammar}
 
+\LMHash{}
 It is a compile-time error if  the \IMPLEMENTS{}  clause of a class $C$ specifies a type variable as a superinterface. It is a compile-time error if  the  \IMPLEMENTS{} clause of a class $C$ specifies an enumerated type (\ref{enums}),  a malformed type or deferred type (\ref{staticTypes}) as a superinterface  It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface. It is a compile-time error if  the  \IMPLEMENTS{} clause of a class $C$ specifies  a type $T$ as a superinterface more than once.
 It is a compile-time error if the superclass of a class $C$ is specified as a superinterface of $C$.
 
@@ -1650,8 +1845,10 @@
 One might argue that it is harmless to repeat a type in the superinterface list, so why make it an error? The issue is not so much that the situation described in program source is erroneous, but that it is pointless. As such, it is an indication that the programmer may very well have meant to say something else - and that is a mistake that should be called to her or his attention.  Nevertheless, we could simply issue a warning; and perhaps we should and will. That said, problems like these are local and easily corrected on the spot, so we feel justified in taking a harder line. 
 }
 
+\LMHash{}
 It is a compile-time error if the interface of a class $C$ is a superinterface of itself.
 
+\LMHash{}
 Let $C$ be a concrete class that does not declare its own \code{noSuchMethod()} method.
 It is a static warning if the implicit interface of  $C$ includes an instance member $m$ of type $F$ and $C$ does not declare or inherit a corresponding non-abstract instance member $m$ of type $F'$ such that $F' <: F$. 
 
@@ -1670,6 +1867,7 @@
 noSuchMethod(inv) =$>$ \SUPER.noSuchMethod(inv);
 \end{dartCode}
 
+\LMHash{}
 It is a static warning if the implicit interface of  a class $C$ includes an instance member $m$ of type $F$ and $C$ declares or inherits a corresponding instance member $m$ of type $F'$ if  $F'$ is not a subtype of $F$. 
 
 \rationale{
@@ -1704,23 +1902,27 @@
 
 
 \section{Interfaces}
-\label{interfaces}
+\LMLabel{interfaces}
 
+\LMHash{}
 An {\em interface} defines how one may interact with an object. An interface has methods, getters and setters and a set of superinterfaces.
 
 \subsection{Superinterfaces}
-\label{interfaceSuperinterfaces}
+\LMLabel{interfaceSuperinterfaces}
 
+\LMHash{}
 An interface has a set of direct superinterfaces. 
 
+\LMHash{}
 An interface $J$ is a superinterface of an interface $I$ iff either $J$ is a direct superinterface of $I$ or $J$ is a superinterface of a direct superinterface of $I$.
 
 
 
 
 \subsubsection{Inheritance and Overriding}
-\label{interfaceInheritanceAndOverriding}
+\LMLabel{interfaceInheritanceAndOverriding}
 
+\LMHash{}
 Let $J$ be an interface and $K$ be a library. We define $inherited(J, K)$  to be the set of members $m$ such that   all of the following hold:
 \begin{itemize}
 \item $m$ is accessible to $K$ and 
@@ -1732,6 +1934,7 @@
 \item $m$ is not overridden by $J$.
 \end{itemize}
 
+\LMHash{}
 Furthermore, we define $overrides(J, K)$  to be the set of members $m^\prime$ such that  all of the following hold:
 \begin{itemize}
 \item $J$ is the implicit interface of a class $C$.
@@ -1746,10 +1949,13 @@
 \end{itemize}
 
 
+\LMHash{}
 Let $I$ be the implicit interface of a class $C$ declared in library $L$.  $I$ {\em inherits} all members of $inherited(I, L)$ and $I$ {\em overrides} $m^\prime$ if  $m^\prime \in overrides(I, L)$. 
 
+\LMHash{}
 All the static warnings pertaining to the overriding of instance members given in section \ref{classes} above hold for overriding between interfaces as well.
 
+\LMHash{}
 It is a static warning if $m$ is a method and $m^\prime$ is a getter, or if $m$ is a getter and $m^\prime$ is a method.
 
 
@@ -1760,10 +1966,13 @@
 
 % tighten definition? do we need chain as for classes?  Definition for interface override?
 
+\LMHash{}
 However, if the above rules would cause multiple members $m_1, \ldots,  m_k$ with the same name $n$ to be inherited (because identically named members existed in several superinterfaces) then at most one member is inherited. 
 
+\LMHash{}
 If some but not all of the $m_i, 1 \le i \le k$ are getters none of the $m_i$ are inherited, and a static warning is issued.
 
+\LMHash{}
 Otherwise, if the static types $T_1, \ldots,  T_k$ of the members $m_1, \ldots,  m_k$  are not identical, then there must be a member $m_x$ such that $T_x <: T_i, 1 \le x \le k$ for all  $i  \in 1..k$, or a static type warning occurs. The member that is inherited  is $m_x$, if it exists; otherwise:
  let $numberOfPositionals(f)$ denote the number of positional parameters of a function $f$, and let $numberOfRequiredParams(f)$ denote the number of required parameters of a function $f$. Furthermore, let $s$ denote the set of all named parameters of the $m_1, \ldots,  m_k$.  Then let 
 
@@ -1771,6 +1980,7 @@
 
 $r = min(numberOfRequiredParams(m_i)), i \in 1..k$. 
 
+\LMHash{}
 Then $I$ has a method named $n$, with $r$ required parameters of type \DYNAMIC{}, $h$  positional parameters of type \DYNAMIC{}, named parameters $s$ of type  \DYNAMIC{} and  return type  \DYNAMIC{}.  
 
 
@@ -1787,11 +1997,13 @@
 % Need warnings if overrider conflicts with overriddee either because signatures are incompatible or because done is a method and one is a getter or setter.
 
 \section{Mixins}
-\label{mixins} 
+\LMLabel{mixins} 
 
 
+\LMHash{}
 A mixin describes the difference between a class and its superclass. A mixin is always derived from an existing class declaration. 
 
+\LMHash{}
 It is a compile-time error if a declared or derived mixin refers to \SUPER{}. It is a compile-time error if a declared or derived mixin explicitly declares a constructor. It is a compile-time error if a mixin is derived from a class whose superclass is not \code{Object}.
 
 \rationale{
@@ -1807,8 +2019,9 @@
 }
 
 \subsection{Mixin Application}
-\label{mixinApplication}
+\LMLabel{mixinApplication}
 
+\LMHash{}
 A mixin may be applied to a superclass, yielding a new class. Mixin application occurs when a mixin is mixed into a class declaration via its \WITH{} clause.  The mixin application may be used to extend a class per section (\ref{classes}); alternately, a class may be defined as a mixin application as described in this section.   It is a compile-time error if the \WITH{} clause of a mixin application $C$ includes a deferred type expression.
 
 
@@ -1821,12 +2034,16 @@
     .
 \end{grammar}
 
+\LMHash{}
 A  mixin application of the form  \code{$S$ \WITH{} $M$;} defines a class  $C$ with superclass  $S$. 
 
+\LMHash{}
 A  mixin application of the form  \code{$S$ \WITH{} $M_1, \ldots, M_k$;} defines a class  $C$ whose superclass is the application of the mixin composition (\ref{mixinComposition}) $M_{k-1} * \ldots * M_1$ to $S$. 
 
+\LMHash{}
 In both cases above, $C$ declares the same instance members as $M$ (respectively, $M_k$). If any of the instance fields of $M$ (respectively, $M_k$) have initializers, they are executed in the scope of $M$ (respectively, $M_k$) to initialize the corresponding fields of $C$. 
 
+\LMHash{}
 For each generative constructor named $q_i(T_{i1}$ $ a_{i1}, \ldots , T_{ik_i}$ $ a_{ik_i}), i \in 1..n$ of $S$, $C$ has an implicitly declared constructor named
 $q'_i = [C/S]q_i$ of the form 
 
@@ -1834,10 +2051,13 @@
 
 %super.id
 
+\LMHash{}
 If the mixin application declares support for interfaces, the resulting class implements those interfaces.
 
+\LMHash{}
 It is a compile-time error if $S$ is an enumerated type (\ref{enums}) or a malformed type. It is a compile-time error if $M$ (respectively, any of $M_1, \ldots, M_k$) is an enumerated type (\ref{enums}) or a malformed type. It is a compile time error if a well formed mixin cannot be derived from $M$ (respectively, from each of $M_1, \ldots, M_k$). 
 
+\LMHash{}
 Let $K$ be a class declaration  with the same constructors, superclass and interfaces as $C$,  and the instance members declared by $M$ (respectively $M_1, \ldots, M_k$). It is a static warning if the declaration of $K$ would cause a static warning.  It is a compile-time error if the declaration of $K$ would cause a compile-time error.
 
 \commentary{
@@ -1845,17 +2065,19 @@
 
 }
 
+\LMHash{}
 The effect of a class definition of the form \code{\CLASS{} $C$ = $M$; } or the form 
  \code{\CLASS{} $C<T_1, \ldots, T_n>$ = $M$; } in library $L$  is to introduce the name $C$ into the scope of $L$, bound to the class (\ref{classes}) defined by the mixin application $M$. The name of the class is also set to $C$. Iff the  class is prefixed by the built-in identifier \ABSTRACT{}, the class being defined is an abstract class.
  
 
 \subsection{Mixin Composition}
-\label{mixinComposition}
+\LMLabel{mixinComposition}
 
 \rationale{
 Dart does not directly support mixin composition, but the concept is useful when defining how the superclass of a class with a mixin clause is created.
 }
 
+\LMHash{}
 The {\em composition of two mixins}, $M_1<T_1 \ldots T_{k_{M_1}}>$ and $M_2<U_1  \ldots U_{k_{M_2}}>$, written $M_1<T_1 \ldots T_{k_{M_1}}> * M_2<U_1  \ldots U_{k_{M_2}}>$ defines an anonymous mixin such that for any class $S<V_1 \ldots V_{k_S}>$, the application of 
 
 $M_1<T_1 \ldots T_{k_{M_1}}> * M_2<U_1  \ldots U_{k_{M_2}}>$  
@@ -1880,6 +2102,7 @@
 The classes produced by mixin composition are regarded as abstract because they cannot be instantiated independently. They are only introduced as anonymous superclasses of ordinary class declarations and mixin applications. Consequently, no warning is given if a mixin composition includes abstract members, or incompletely implements an interface.
 }
 
+\LMHash{}
 Mixin composition is associative.
 
 
@@ -1889,8 +2112,9 @@
 
 
 \section{Enums}
-\label{enums}
+\LMLabel{enums}
 
+\LMHash{}
 An {\em enumerated type}, or {\em enum}, is used to represent a fixed number of constant values.
 
 \begin{grammar}
@@ -1899,6 +2123,7 @@
     .
 \end{grammar}
 
+\LMHash{}
 The declaration of an enum of the form \code{metadata \ENUM{} E \{ id$_0$, \ldots id$_{n-1}$\};}
 has the same effect as a class declaration
 
@@ -1919,8 +2144,9 @@
 }
 
 \section{Generics}
-\label{generics}
+\LMLabel{generics}
 
+\LMHash{}
 A class declaration (\ref{classes}) or type alias (\ref{typedef}) 
 $G$ may be {\em generic}, that is, $G$ may have formal type parameters declared. A generic declaration induces a family of declarations, one for each set of actual type parameters provided in the program. 
 
@@ -1933,8 +2159,10 @@
     .
 \end{grammar}
 
+\LMHash{}
 A type parameter $T$ may be suffixed with an \EXTENDS{} clause that specifies the {\em upper bound} for $T$. If no  \EXTENDS{} clause is present, the upper bound is \code{Object}.  It is a static type warning if a type parameter is a supertype of its upper bound. The bounds of type variables are a form of type annotation and have no effect on execution in production mode.
 
+\LMHash{}
 The type parameters of a generic $G$ are in scope in the bounds of all of the type parameters of $G$. The type parameters of a generic class declaration $G$ are also in scope in the \EXTENDS{} and \IMPLEMENTS{} clauses of $G$ (if these exist) and in the body of $G$.   However, a type parameter is considered to be a malformed type when referenced by a static member.
 
 \rationale{
@@ -2010,7 +2238,7 @@
 
 
 %\subsection{Interface Injection}
-%\label{interfaceInjection}
+%\LMLabel{interfaceInjection}
 
 %An {\em interface injection declaration} causes a pre-existing class $S$ to be considered a subinterface of another interface $I$. It is a static type warning if $S$ is not a structural subtype of $I$. However, the subinterface relations implied by the interface injection declaration are considered to hold by both the typechecker and the runtime, regardless.
 
@@ -2040,8 +2268,9 @@
 
 
 \section{Metadata}
-\label{metadata}
+\LMLabel{metadata}
 
+\LMHash{}
 Dart supports metadata which is used to attach user defined annotations to program structures.  
 
 \begin{grammar}
@@ -2050,12 +2279,14 @@
     .
 \end{grammar}
 
+\LMHash{}
 Metadata consists of a series of annotations, each of which begin with the character @, followed by  a constant expression that starts with an identifier. It is a compile time error if the expression is not one of the following:
 \begin{itemize}
 \item A reference to a compile-time constant variable.
 \item A call to a constant constructor.
 \end{itemize}
 
+\LMHash{}
 Metadata is associated with the abstract syntax tree of the program construct $p$ that immediately follows the metadata, assuming $p$ is not itself metadata or a comment. Metadata can be retrieved at runtime via a reflective call, provided the annotated program construct $p$ is accessible via reflection.
 
 \commentary{
@@ -2070,14 +2301,17 @@
 It is possible to associate metadata with constructs that may not be accessible via reflection, such as local variables (though it is conceivable that in the future, richer reflective libraries might provide access to these as well).  This is not as useless as it might seem. As noted above, the data can be retrieved statically if source code is available.
 }
 
+\LMHash{}
 Metadata can appear before a library, part header, class, typedef, type parameter, constructor, factory, function, field, parameter, or variable declaration and before an import, export or part directive.
 
+\LMHash{}
 The constant expression given in an annotation  is type checked and evaluated in the scope surrounding the declaration being annotated.  
 
 
 \section{Expressions}
-\label{expressions}
+\LMLabel{expressions}
 
+\LMHash{}
 An {\em expression} is a fragment of Dart code that can be evaluated at run time to yield a {\em value}, which is always an object. Every expression has an associated static type (\ref{staticTypes}). Every value has an associated dynamic type (\ref{dynamicTypeSystem}).
 
 
@@ -2112,6 +2346,7 @@
     
 \end{grammar}   
 
+\LMHash{}
 An expression $e$ may always be enclosed in parentheses, but this never has any semantic effect on $e$.
 
 \commentary{
@@ -2119,8 +2354,9 @@
 }
 
  \subsubsection{Object Identity}
- \label{objectIdentity}
+ \LMLabel{objectIdentity}
  
+\LMHash{}
 The predefined Dart function \cd{identical()} is defined such that \code{identical($c_1$, $c_2$)} iff:
  \begin{itemize}
  \item $c_1$  evaluates to either \NULL{} or  an instance of \code{bool} and \code{$c_1$ == $c_2$}, OR
@@ -2154,10 +2390,12 @@
     
     
 \subsection{Constants}
-\label{constants}
+\LMLabel{constants}
 
+\LMHash{}
 A {\em constant expression} is an expression whose value can never change, and that can be evaluated entirely at compile time. 
 
+\LMHash{}
 A constant expression is one of the following:
 \begin{itemize}
 \item A literal number (\ref{numbers}).
@@ -2192,6 +2430,7 @@
 
 % designed so constants do not depend on check diode being on or not.
 
+\LMHash{}
 It is a compile-time error if an expression is required to be a constant expression but its evaluation  would raise an exception. 
 
 % so, checked mode? analyzers? editor/development compilers?
@@ -2234,6 +2473,7 @@
 \end{enumerate}
 }
 
+\LMHash{}
 It is a compile-time error if the value of a compile-time constant expression depends on itself.
 
 \commentary{
@@ -2263,8 +2503,9 @@
 
 
 \subsection{Null}
-\label{null}
+\LMLabel{null}
 
+\LMHash{}
 The reserved word \NULL{} denotes the {\em null object}.
 %\Q{Any methods, such as \code{isNull}?}
 
@@ -2274,9 +2515,11 @@
 .
 \end{grammar}
 
+\LMHash{}
 The null object is the sole instance of the built-in class \code{Null}. Attempting to instantiate \code{Null} causes a run-time error. It is a compile-time error for a class to attempt to extend or implement \code{Null}. 
 Invoking a method on \NULL{}  yields a \code{NoSuchMethodError} unless the method is explicitly implemented by class \code{Null}.
 
+\LMHash{}
 The static type of \NULL{} is $\bot$.
 
 \rationale{The decision to use $\bot$ instead of \code{Null} allows \NULL{} to be be assigned everywhere without complaint by the static checker. 
@@ -2284,8 +2527,9 @@
 
 
 \subsection{Numbers}
-\label{numbers}
+\LMLabel{numbers}
 
+\LMHash{}
 A {\em numeric literal} is either a decimal or hexadecimal integer of arbitrary size, or a decimal double.
 
 \begin{grammar}
@@ -2311,24 +2555,30 @@
     .
  \end{grammar}
  
+\LMHash{}
 If a numeric literal begins with the prefix `0x' or `0X', it denotes the hexadecimal integer represented by the part of the literal following `0x' (respectively `0X'). Otherwise, if the numeric literal does not include a decimal point  it denotes a decimal integer.  Otherwise, the numeric literal  denotes a 64 bit double precision floating point number as specified by the IEEE 754 standard. 
 
+\LMHash{}
 In principle, the range of integers supported by a Dart implementations is unlimited. In practice, it is limited by available memory. Implementations may also be limited by other considerations.
 
 \commentary{
 For example, implementations may choose to limit the range to facilitate efficient compilation to Javascript. These limitations should be relaxed as soon as technologically feasible.
 }
 
+\LMHash{}
 It is a compile-time error for a class to attempt to extend or implement \code{int}. It is a compile-time error for a class to attempt to extend or implement \code{double}. It is a compile-time error for any type other than the types \code{int} and \code{double} to attempt to extend or implement \code{num}.
 
+\LMHash{}
 An {\em integer literal} is either a hexadecimal integer literal or a  decimal integer literal. Invoking the getter \code{runtimeType} on an integer literal returns the \code{Type} object that is the value of the expression \code{int}. The static type of an integer literal is \code{int}. 
 
+\LMHash{}
 A {\em literal double} is a numeric literal that is not an integer literal. Invoking the getter \code{runtimeType} on a literal double returns the \code{Type} object that is the value of the expression \code{double}.
 The static type of a literal double is \code{double}.
     
 \subsection{Booleans}
-\label{booleans}
+\LMLabel{booleans}
 
+\LMHash{}
 The reserved words \TRUE{} and \FALSE{} denote objects that represent the boolean values true and false respectively. They are the {\em boolean literals}.
 
 \begin{grammar}
@@ -2337,17 +2587,20 @@
     .
 \end{grammar}
 
+\LMHash{}
 Both  \TRUE{} and \FALSE{} implement the built-in class \code{bool}.  It is a compile-time error for a class to attempt to extend or implement\code{ bool}. 
 
 \commentary{
 It follows that the two boolean literals are the only two instances of \code{bool}. 
 }
 
+\LMHash{}
 Invoking the getter \code{runtimeType} on a boolean literal returns the \code{Type} object that is the value of the expression \code{bool}. The static type of a boolean literal is \code{bool}.
 
 \subsubsection{Boolean Conversion}
-\label{booleanConversion}
+\LMLabel{booleanConversion}
 
+\LMHash{}
 {\em Boolean conversion} maps any object $o$ into a boolean. Boolean conversion is  defined by the function application
 
 \begin{dartCode}
@@ -2370,8 +2623,9 @@
  }
     
 \subsection{Strings}
-\label{strings}
+\LMLabel{strings}
 
+\LMHash{}
 A {\em string} is a sequence of UTF-16 code units. 
 
 \rationale{
@@ -2383,6 +2637,7 @@
     .
 \end{grammar}
 
+\LMHash{}
 A string can be either a sequence of single line strings or a multiline string. 
 
 \begin{grammar}
@@ -2393,6 +2648,7 @@
     .
 \end{grammar}
 
+\LMHash{}
 A single line string is delimited by either matching single quotes or matching double quotes.  
 
 \commentary{
@@ -2402,6 +2658,7 @@
 \commentary{The grammar ensures that a single line string cannot span more than one line of source code, unless it includes an interpolated expression that spans multiple lines.
 }
 
+\LMHash{}
 Adjacent 
 %single line 
 strings are implicitly concatenated to form a single string literal.
@@ -2474,6 +2731,7 @@
    
 \end{grammar}
 
+\LMHash{}
 Multiline strings are delimited by either matching triples of single quotes or matching triples of double quotes. If the first line of a multiline string consists solely of the whitespace characters defined by the production {\em WHITESPACE}  \ref{lexicalRules}), possibly prefixed by $\backslash$, then that line is ignored, including the new line at its end.
 
  
@@ -2481,6 +2739,7 @@
  The idea is to ignore whitespace, where whitespace is defined as tabs, spaces and newlines. These can be represented directly, but since for most characters prefixing by backslash is an identity, we allow those forms as well.
  }
 
+\LMHash{}
 Strings support escape sequences for special characters. The escapes are:
 \begin{itemize}
 \item  $\backslash$n for newline, equivalent to $\backslash$x0A.
@@ -2498,8 +2757,10 @@
 \item Otherwise, $\backslash k$ indicates the character $k$ for any $k$ not in $\{n, r, f, b, t, v, x, u\}$.
  \end{itemize}
 
+\LMHash{}
 Any string may be prefixed with the character `r', indicating that it is a {\em raw string}, in which case no escapes or interpolations are recognized.
 
+\LMHash{}
 It is a compile-time error if a non-raw string literal contains a character sequence of the form $\backslash$x that is not followed by a sequence of two hexadecimal digits. It is a compile-time error if a non-raw string literal  contains a character sequence of the form $\backslash$u that is not followed by either a sequence of four hexadecimal digits, or by curly brace delimited sequence of hexadecimal digits.
 
 
@@ -2530,11 +2791,13 @@
 
  \end{grammar}
  
+\LMHash{}
 All string literals implement the built-in class \code{String}. It is a compile-time error for a class to attempt to extend or implement \code{String}. Invoking the getter \code{runtimeType} on a string literal returns the \code{Type} object that is the value of the expression \code{String}. The static type of a string literal is \code{String}.
 
 \subsubsection{String Interpolation}
-\label{stringInterpolation}
+\LMLabel{stringInterpolation}
 
+\LMHash{}
 It is possible to embed expressions within non-raw string literals, such that the these expressions are evaluated, and the resulting values are converted into strings and concatenated with the enclosing string. This process is known as {\em string interpolation}.
 
  \begin{grammar}
@@ -2546,17 +2809,20 @@
 \commentary{The reader will note that the expression inside the interpolation could itself include strings, which could again be interpolated recursively. 
 }
 
+\LMHash{}
 An unescaped \$ character in a string signifies the beginning of an interpolated expression.  The \$ sign may be followed by either:
 \begin{itemize}
 \item A single identifier $id$ that must not contain the \$ character. 
 \item An expression $e$ delimited by curly braces.
 \end{itemize}
 
+\LMHash{}
 The form \code{\$id} is equivalent to the form \code{\$\{id\}}.  An interpolated string \code{`$s_1$\$\{$e$\}$s_2$'}  is equivalent to the concatenation of the  strings \code{`$s_1$'},  \code{$e$.toString()} and  \code{$`s_2$'}. Likewise an interpolated string \code{``$s_1$\$\{e\}$s_2$''} is equivalent to the concatenation of the strings \code{``$s_1$''}, \code{$e$.toString()} and  \code{``$s_2$''}.
 
 \subsection{Symbols}
-\label{symbols}
+\LMLabel{symbols}
 
+\LMHash{}
 A {\em symbol literal} denotes the name of a declaration in a Dart program. 
 
 \begin{grammar}
@@ -2564,9 +2830,11 @@
       `\#'  (operator $|$ (identifier (`{\escapegrammar .}' identifier)*))  .
 \end{grammar}
 
+\LMHash{}
 A symbol literal \code{\#id} where \code{id} does not begin with an underscore ('\code{\_}')  is equivalent to the expression \code{\CONST{} Symbol('id')}.  
 
-A symbol literal \code{\#\_id} evaluates to the object that would be returned by the call \code{mirror.getPrivateSymbol('id')} where mirror is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library. 
+\LMHash{}
+A symbol literal \code{\#\_id} evaluates to the object that would be returned by the call \code{mirror.getPrivateSymbol('id')} where mirror is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library.
 
 \rationale{
 One may well ask what is the motivation for introducing literal symbols? In some languages, symbols are canonicalized whereas strings are not. However literal strings are already canonicalized in Dart.  Symbols are slightly easier to type compared to strings and their use can become strangely addictive, but this is not nearly sufficient justification for adding a literal form to the language. The primary motivation is related to the use of reflection and a web specific practice known as minification. 
@@ -2574,11 +2842,13 @@
 Minification compresses identifiers consistently throughout a program in order to reduce download size.  This practice poses difficulties for reflective programs that refer to program declarations via strings. A string will refer to an identifier in the source, but the identifier will no longer be used in the minified code, and reflective code using these would fail.  Therefore, Dart reflection uses  objects of type \code{Symbol} rather than strings. Instances of \code{Symbol} are guaranteed to be stable with repeat to minification. Providing a literal form for symbols makes reflective code easier to read and write. The fact that symbols are easy to type and can often act as convenient substitutes for enums are secondary benefits.
 }
 
+\LMHash{}
 The static type of a symbol literal is \code{Symbol}.
 
 \subsection{Lists}
-\label{lists}
+\LMLabel{lists}
 
+\LMHash{}
 A {\em list literal} denotes a list, which is an integer indexed collection of objects. 
 
 \begin{grammar}
@@ -2587,28 +2857,33 @@
     .
 \end{grammar}
 
+\LMHash{}
 A list may contain zero or more objects. The number of elements in a list is its size. A list has an associated set of indices.  An empty list has an empty set of indices. A non-empty list has the index set $\{0 \ldots n -1\}$ where $n$ is the size of the list. It is a runtime error to attempt to access a list using an index that is not a member of its set of indices.
 
 
+\LMHash{}
 If a list literal begins with the reserved word \CONST{}, it is a {\em constant list literal} which is a compile-time constant (\ref{constants}) and therefore evaluated at compile-time. Otherwise, it is a {\em run-time list literal} and it is evaluated at run-time. Only run-time list literals can be mutated
 after they are created. Attempting to mutate a constant list literal will result in a dynamic error.
 
+\LMHash{}
 It is a compile-time error if an element of a constant list literal is not a compile-time constant. It is a compile-time error if the type argument of a constant list literal includes a type parameter.
 \rationale{The binding of a type parameter is not known at compile-time, so we cannot use type parameters inside compile-time constants.}
 
+\LMHash{}
 The value of a constant list literal  \CONST{} $<E>[e_1\ldots e_n]$ is an object $a$ whose class implements the built-in class $List<E>$. The $i$th element of $a$ is $v_{i+1}$, where $v_i$ is the value of the compile-time expression $e_i$.  The value of a constant list literal  \CONST{} $[e_1 \ldots e_n]$ is defined as the value of the constant list literal \CONST{}$ < \DYNAMIC{}>[e_1\ldots e_n]$.
 
+\LMHash{}
 Let $list_1 =$ \CONST{} $<V>[e_{11} \ldots e_{1n}]$ and $list_2 =$  \CONST{} $<U>[e_{21} \ldots e_{2n}]$ be two constant list literals and let the  elements of $list_1$ and $list_2$  evaluate to  $o_{11} \ldots o_{1n}$ and $o_{21} \ldots o_{2n}$ respectively. Iff \code{identical($o_{1i}$, $o_{2i}$)} for $i \in 1.. n$ and $V = U$ then \code{identical($list_1$, $list_2$)}. 
 
 \commentary{In other words, constant list literals are canonicalized.}
 
+\LMHash{}
 A run-time list literal $<E>[e_1 \ldots e_n]$  is evaluated as follows:
 \begin{itemize}
 \item
 First, the expressions $e_1 \ldots e_n$ are evaluated in order they appear in the program, yielding objects $o_1 \ldots o_n$.
 \item A fresh instance  (\ref{generativeConstructors}) $a$, of size $n$,  whose class implements the built-in class $List<E>$ is allocated. 
 \item
-
 The operator \code{[]=} is invoked on $a$ with  first  argument $i$ and second argument
 %The $i$th element of $a$ is set to 
 $o_{i+1}, 0 \le i < n$.
@@ -2621,6 +2896,7 @@
 Note that this document does not specify an order in which the elements are set. This allows for parallel assignments into the list if an implementation so desires.  The order can only be observed in checked mode (and may not be relied upon): if element $i$ is not a subtype of the element type of the list, a dynamic type error will occur when $a[i]$ is assigned $o_{i-1}$. 
 }
 
+\LMHash{}
 A runtime list literal  $[e_1 \ldots e_n]$ is evaluated as  $< \DYNAMIC{}>[e_1\ldots e_n]$.
 
 
@@ -2629,6 +2905,7 @@
 $<List<int>>[[1, 2, 3], [4, 5, 6]]$ is a list with type parameter $List<int>$, containing two lists with type parameter  \DYNAMIC{}. 
 }
 
+\LMHash{}
 The static type of a list literal of the form  \CONST{}$ <E>[e_1\ldots e_n]$  or the form $<E>[e_1 \ldots e_n]$ is $List<E>$. The static type a list literal of the form  \CONST{} $[e_1 \ldots e_n$]  or the form $[e_1\ldots e_n$] is $List< \DYNAMIC{}>$.
 
 \rationale{
@@ -2639,8 +2916,9 @@
 % what about generics?
     
 \subsection{Maps}
-\label{maps}
+\LMLabel{maps}
 
+\LMHash{}
 A {\em map literal} denotes a map object. 
 
 \begin{grammar}
@@ -2654,22 +2932,28 @@
     .
 \end{grammar}
 
+\LMHash{}
 A {\em map literal} consists of zero or more entries. Each entry has a {\em key} and a {\em value}.  Each key and each value is denoted by an expression. 
  
+\LMHash{}
 If a map literal begins with the reserved word \CONST{}, it is a {\em constant map literal} which is a compile-time constant (\ref{constants}) and therefore evaluated at compile-time. Otherwise, it is a {\em run-time map literal} and it is evaluated at run-time. Only run-time map literals can be mutated
 after they are created. Attempting to mutate a constant map literal will result in a dynamic error.
 
+\LMHash{}
 It is a compile-time error if either a key or a value of an entry in a constant map literal is not a compile-time constant. It is a compile-time error if the key of an entry in a constant map literal is an instance of a class that implements the operator $==$ unless the key is a 
 %symbol, 
 string, an integer, a literal symbol or the result of invoking a constant constructor of class \cd{Symbol}. 
 It is a compile-time error if the type arguments of a constant map literal include a type parameter. 
 
+\LMHash{}
 The value of a constant map literal  \CONST{}$ <K, V>\{k_1:e_1\ldots k_n :e_n\}$ is an object $m$ whose class implements the built-in class $Map<K, V>$. The entries of $m$ are $u_i:v_i, i \in 1 .. n$, where $u_i$ is the value of the compile-time expression $k_i$ and $v_i$ is the value of the compile-time expression $e_i$.  The value of a constant map literal  \CONST{} $\{k_1:e_1\ldots k_n :e_n\}$ is defined as the value of a constant map literal \CONST{} $<\DYNAMIC{}, \DYNAMIC{}>\{k_1:e_1\ldots k_n :e_n\}$.
 
+\LMHash{}
 Let $map_1 =$ \CONST{}$ <K, V>\{k_{11}:e_{11} \ldots k_{1n} :e_{1n}\}$ and  $map_2 =$  \CONST{}$ <J, U>\{k_{21}:e_{21} \ldots k_{2n} :e_{2n}\}$ be two constant map literals. Let the keys of $map_1$ and $map_2$ evaluate to  $s_{11} \ldots  s_{1n}$  and   $s_{21} \ldots  s_{2n}$ respectively, and let the elements of $map_1$ and $map_2$ evaluate to $o_{11} \ldots  o_{1n}$ and $o_{21} \ldots  o_{2n}$ respectively. Iff \code{identical($o_{1i}$, $o_{2i}$)}  and \code{identical($s_{1i}$, $s_{2i}$)} for $i \in 1.. n$, and $K = J, V = U$ then \code{identical($map_1$, $map_2$)}. 
 
 \commentary{In other words, constant map literals are canonicalized.}
 
+\LMHash{}
 A runtime map literal $<K, V>\{k_1:e_1\ldots k_n :e_n\}$  is evaluated as follows:
 \begin{itemize}
 \item
@@ -2684,12 +2968,15 @@
 \end{itemize}
 
 
+\LMHash{}
 A runtime map literal  $\{k_1:e_1\ldots k_n :e_n\}$ is evaluated as  
 
 $<\DYNAMIC{},  \DYNAMIC{}>\{k_1:e_1\ldots k_n :e_n\}$.
 
+\LMHash{}
 Iff all the keys in a map literal are compile-time constants, it is a static warning if the values of any two keys in a map literal are equal.
 
+\LMHash{}
 A map literal is ordered: iterating over the keys and/or values of the maps always happens in the 
  order the keys appeared in the source code.
 
@@ -2697,12 +2984,14 @@
 Of course, if a key repeats, the order is defined by first occurrence, but the value is defined by the last.
 } 
 
+\LMHash{}
 The static type of a map literal of the form  \CONST{}$ <K, V>\{k_1:e_1\ldots k_n :e_n\}$ or the form $<K, V>\{k_1:e_1\ldots k_n :e_n\}$ is $Map<K, V>$. The static type a map literal of the form  \CONST{}$\{k_1:e_1\ldots k_n :e_n\}$ or the form $\{k_1:e_1\ldots k_n :e_n\}$ is $Map<\DYNAMIC{},  \DYNAMIC{}>$. 
 
 
 \subsection{Throw}
-\label{throw}
+\LMLabel{throw}
 
+\LMHash{}
 The {\em throw expression}  is used to raise an exception.
 
  \begin{grammar}
@@ -2716,43 +3005,53 @@
  
  \end{grammar}
  
+\LMHash{}
  The {\em current exception} is the last exception raised and not subsequently caught at a given moment during runtime. 
 
+\LMHash{}
  Evaluation of a throw expression of the form  \code{\THROW{} $e$;} proceeds as follows:
  
+\LMHash{}
 The expression $e$ is evaluated yielding a value $v$. 
 
 \commentary{
 There is no requirement that the expression $e$ evaluate to a special kind of exception or error object.
 }
 
+\LMHash{}
 If $e$ evaluates to \NULL{} (\ref{null}), then a \code{NullThrownError} is thrown. Otherwise the current exception is set to $v$ and the current return value (\ref{return}) becomes undefined.
 
 \rationale{The current exception and the current return value must never be simultaneously defined, as they represent mutually exclusive options for exiting the current function. 
 }
 
+\LMHash{}
 Let $f$ be the immediately enclosing function. 
 
+\LMHash{}
 If $f$ is synchronous (\ref{functions}), control is transferred to the nearest dynamically enclosing exception handler.
 
 \commentary{
 If $f$ is marked \SYNC* then a dynamically enclosing exception handler encloses the call to \code{moveNext()} that initiated the evaluation of the throw expression.
 }
 
+\LMHash{}
 If $f$ is asynchronous  then if there is a dynamically enclosing exception handler $h$  (\ref{try}) introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
 
 \rationale{
 The rules for where a thrown exception will be handled must necessarily differ between the synchronous and asynchronous cases. Asynchronous functions cannot transfer control to an exception handler defined outside themselves.  Asynchronous generators post exceptions to their stream. Other asynchronous functions report exceptions via their future.
 }
 
+\LMHash{}
 If the object being thrown is an instance of class \code{Error} or a subclass thereof, its \code{stackTrace} getter will return the stack trace current at the point where the the object was first thrown.
 
+\LMHash{}
 The static type of a throw expression is $\bot$.
 
 
 \subsection{ Function Expressions}
-\label{functionExpressions}
+\LMLabel{functionExpressions}
 
+\LMHash{}
 A {\em function literal} is an object that encapsulates an executable unit of code. 
 
 \begin{grammar}
@@ -2761,6 +3060,7 @@
     .
  \end{grammar}   
  
+\LMHash{}
 The class of a function literal implements the built-in class \code{Function}.   
 %Invoking the getter \code{runtimeType} on a function literal returns the \code{Type} object that is the value of the expression \code{Function}.
 % not necessarily
@@ -2768,6 +3068,7 @@
 
 %Q{Can anyone implement it? Then we should define things via call}
 
+\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k]) => e$ 
@@ -2775,11 +3076,13 @@
 
 $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow T_0$, where $T_0$ is the static type of $e$. 
 
+\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k])$ \ASYNC{} $=> e$
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Future<T_0>$, where $T_0$ is the static type of $e$. 
 
+\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\}) => e$ 
@@ -2787,34 +3090,40 @@
 
 $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow T_0$, where $T_0$ is the static type of $e$. 
 
+\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ \ASYNC{}  $=> e$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow Future<T_0>$, where $T_0$ is the static type of $e$. 
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])\{s\}$ 
 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow  \DYNAMIC{}$.
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \ASYNC{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Future$. 
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \ASYNC*{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Stream$. 
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \SYNC*{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Iterable$. 
 
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])\{s\}$ 
@@ -2822,30 +3131,35 @@
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow  \DYNAMIC{}$. 
 
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Future{}$.
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC*{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Stream{}$.
 
+\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\SYNC*{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Iterable{}$.
 
+\LMHash{}
 In all of the above cases, whenever $T_i, 1 \le i \le n+k$, is not specified, it is considered to have been specified as  \DYNAMIC{}.
 
 
 \subsection{ This}
-\label{this}
+\LMLabel{this}
 
+\LMHash{}
 The reserved word \THIS{} denotes the target of the current instance member invocation.
 
 \begin{grammar}
@@ -2854,23 +3168,27 @@
      .
 \end{grammar}
 
+\LMHash{}
 The static type of \THIS{} is the interface of the immediately enclosing class.
 
 \commentary{
 We do not support self-types at this point. 
 }
 
+\LMHash{}
 It is a compile-time error if \THIS{} appears, implicitly or explicitly,  in a top-level function or variable initializer,  in a factory constructor, or in a static method or variable initializer, or in the initializer of an instance variable. 
 
 \subsection{ Instance Creation}
-\label{instanceCreation}
+\LMLabel{instanceCreation}
 
+\LMHash{}
 Instance creation expressions invoke constructors to produce instances. 
 
 %It is a compile-time error if any of the type arguments to a constructor of a generic type invoked by a new expression or a constant object expression do not denote types in the enclosing lexical scope. 
 
 %It is a compile-time error if a constructor of a non-generic type invoked by a new expression or a constant object expression is passed any type arguments. It is a compile-time error if a constructor of a generic type with $n$ type parameters invoked by a new expression or a constant object expression is passed $m$ type arguments where $m \ne n$, or if any of its type arguments is  misconstructed (\ref{parameterizedTypes}).
 
+\LMHash{}
 It is a static type warning if
 the type $T$ in an instance creation expression of one of  the forms 
 
@@ -2882,6 +3200,7 @@
 
 \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is malformed (\ref{dynamicTypeSystem}) or malbounded (\ref{parameterizedTypes}).
 
+\LMHash{}
 It is a compile-time error if the type $T$ in an instance creation expression of one of the forms 
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$,  
@@ -2897,8 +3216,9 @@
 
 
 \subsubsection{ New}
-\label{new}
+\LMLabel{new}
 
+\LMHash{}
 The {\em new expression} invokes a constructor (\ref{constructors}).
 
 \begin{grammar}
@@ -2907,6 +3227,7 @@
 .
 \end{grammar}
 
+\LMHash{}
 Let $e$ be a new expression of the form  
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ or the form  
@@ -2919,12 +3240,14 @@
 
 %not a class accessible in the current scope,  optionally followed by type arguments. 
 
+\LMHash{}
 If $T$ is  a class or parameterized type accessible in the current scope then:
 \begin{itemize}
 \item
 If $e$ is of the form \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a static warning if $T.id$ is not the name of a constructor declared by the type $T$. If $e$ is of the form  \NEW{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a static warning if the type $T$ does not declare a constructor with the same name as the declaration of $T$. 
 \end{itemize}
 
+\LMHash{}
 If $T$ is a parameterized type (\ref{parameterizedTypes}) $S<U_1,  \ldots, U_m>$, let $R = S$.  
 %It is a 
 %compile-time CHANGED
@@ -2933,46 +3256,60 @@
 If $T$ is not a parameterized type, let $R = T$.
 Furthermore, if $e$ is of the form \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ then let  $q$ be the constructor  $T.id$, otherwise let $q$ be the constructor $T$. 
 
+\LMHash{}
 If $R$ is a generic with $l = m$ type parameters then
 \begin{itemize}
 \item  If $T$ is not a parameterized type, then for $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$.
 \item  If $T$ is  a parameterized type then let $V_i = U_i$ for $ i \in 1 .. m$.  
 \end{itemize}
 
+\LMHash{}
 If $R$ is a generic with $l \ne m$ type parameters then for $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$. In any other case, let $V_i = U_i$ for $ i \in 1 .. m$.  
 
+\LMHash{}
 Evaluation of $e$ proceeds as follows:
 
+\LMHash{}
 First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated. 
 
+\LMHash{}
 If $T$ is a deferred type with prefix $p$, then if $p$ has not been successfully loaded, a dynamic error occurs.
 
+\LMHash{}
 Then, if $q$ is a non-factory constructor of an abstract class then an \code{AbstractClassInstantiationError} is thrown.
 
+\LMHash{}
 If $T$  is malformed or if $T$ is a type variable a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs.
  Otherwise, if $q$ is not defined or not accessible, a \code{NoSuchMethodError} is thrown.  If $q$ has  less than $n$ positional parameters or more than $n$ required parameters, or if $q$ lacks any of the keyword parameters $\{ x_{n+1}, \ldots, x_{n+k}\}$ a \code{NoSuchMethodError} is thrown.
 
+\LMHash{}
 Otherwise, if $q$ is a generative constructor (\ref{generativeConstructors}), then:
 
 \commentary{Note that it this point we are assured that the number of actual type arguments match the number of formal type parameters.}
 
+\LMHash{}
 A fresh instance (\ref{generativeConstructors}), $i$,  of class $R$ is allocated. For each instance variable $f$ of $i$,  if the variable declaration of $f$ has an initializer expression $e_f$, then $e_f$ is evaluated to an object $o_f$ and $f$ is bound to $o_f$. Otherwise $f$ is bound to \NULL{}.
 
 \commentary{
 Observe that \THIS{} is not in scope in $e_f$. Hence, the initialization cannot depend on other properties of the object being instantiated.
 }
 
+\LMHash{}
 Next,  $q$ is executed  with \THIS{} bound to $i$,  the type parameters (if any) of $R$ bound to the actual type arguments $V_1, \ldots, V_l$ and the formal parameter bindings that resulted from the evaluation of the argument list. The result of the evaluation of $e$ is $i$.
 
+\LMHash{}
 Otherwise, $q$ is a factory constructor (\ref{factories}). Then:
 
+\LMHash{}
 If $q$ is a redirecting factory constructor of the form $T(p_1, \ldots, p_{n+k}) = c;$ or of the form  $T.id(p_1, \ldots, p_{n+k}) = c;$ then the result of the evaluation of $e$ is equivalent to evaluating the expression 
 
 $[V_1,  \ldots, V_m/T_1,  \ldots, T_m]($\code{\NEW{} $c(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k}))$}.  If evaluation of $q$ causes $q$ to be re-evaluated cyclically, a runtime error occurs.
 
 
+\LMHash{}
 Otherwise, the body of $q$ is executed with respect to the bindings that resulted from the evaluation of the argument list and the type parameters (if any) of $q$ bound to the actual type arguments $V_1, \ldots, V_l$ resulting in an object $i$. The result of the evaluation of $e$ is $i$.
 
+\LMHash{}
 It is a static warning if $q$ is a constructor of an abstract class and $q$ is not a factory constructor.
 
 \commentary{The above gives precise meaning to the idea that instantiating an abstract class leads to a warning. 
@@ -2982,6 +3319,7 @@
 \rationale{In particular, a factory constructor can be declared in an abstract class and used safely, as it will either produce a valid instance or lead to a warning inside its own declaration.
 }
 
+\LMHash{}
 The static type of an instance creation expression of either the form 
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -2996,8 +3334,9 @@
 
 
 \subsubsection{ Const}
-\label{const}
+\LMLabel{const}
 
+\LMHash{}
 A {\em constant object expression} invokes a constant constructor (\ref{constantConstructors}). 
 
 \begin{grammar}
@@ -3006,6 +3345,7 @@
 .
 \end{grammar}
 
+\LMHash{}
 Let $e$ be a constant object expression of the form  
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3014,18 +3354,23 @@
 
 \commentary{In particular, $T$ may not be a type variable.}
 
+\LMHash{}
 If $T$ is a parameterized type, it is a compile-time error if $T$ includes a type variable among its type arguments.
 
+\LMHash{}
 If $e$ is of the form \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a compile-time error if $T.id$ is not the name of a constant constructor declared by the type $T$. If $e$ is of the form  \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a compile-time error if the type $T$ does not declare a constant constructor with the same name as the declaration of $T$. 
 
+\LMHash{}
 In all of the above cases, it is a compile-time error if $a_i,  i\in 1 .. n + k$, is not a compile-time constant expression.
 
 %If $T$ is a parameterized type (\ref{parameterizedTypes}) $S<U_1,  \ldots, U_m>$, let $R = S$.  It is a compile-time error if $T$ is is malformed. If $T$ is not a parameterized type, let $R = T$.
  %Finally, 
 % If $T$ is a generic with $l$ retype parameters, then for all $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$.  
 
+\LMHash{}
 Evaluation of $e$ proceeds as follows:
 
+\LMHash{}
 First, if $e$ is of the form 
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3034,6 +3379,7 @@
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. 
 
+\LMHash{}
 Otherwise, $e$ must be of the form  
 
 \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, 
@@ -3042,6 +3388,7 @@
 
 \NEW{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. 
 
+\LMHash{}
 Then:
 \begin{itemize}
 \item If during execution of the program, a constant object expression has already evaluated to an instance $j$ of class $R$ with type arguments $V_i, 1 \le i \le m$, then: 
@@ -3055,6 +3402,7 @@
 In other words, constant objects are canonicalized.  In order to determine if an object is actually new, one has to compute it; then it can be compared to any cached instances. If an equivalent object exists in the cache, we throw away the newly created object and use the cached one. Objects are equivalent if they have identical fields and identical type arguments. Since the constructor cannot induce any side effects, the execution of the constructor is unobservable.  The constructor need only be executed once per call site, at compile-time.
 }
 
+\LMHash{}
 The static type of a constant object expression of either the form 
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3065,6 +3413,7 @@
 
 is $T$. It is a static warning if the static type of $a_i, 1 \le i \le n+ k$ may not be assigned to the type of the corresponding formal parameter of the constructor $T.id$ (respectively $T$).
 
+\LMHash{}
 It is a compile-time error if evaluation of a constant object results in an uncaught exception being thrown.
 
 \commentary{
@@ -3096,14 +3445,17 @@
 }
 
 
+\LMHash{}
 Given an instance creation expression of the form \CONST{} $q(a_1, \ldots , a_n)$ it is a static warning if $q$ is a constructor of an abstract class  (\ref{abstractInstanceMembers}) but $q$ is not a factory constructor.  
 
 
 \subsection{ Spawning an Isolate}
-\label{spawningAnIsolate}
+\LMLabel{spawningAnIsolate}
 
+\LMHash{}
 Spawning an isolate is accomplished via what is syntactically an ordinary library call, invoking one of the functions \code{spawnUri()} or \code{spawnFunction()}defined in the \code{dart:isolate} library. However, such calls  have the  semantic effect of creating a new isolate with its own memory and thread of control.
 
+\LMHash{}
 An isolate's memory is finite, as is the space available to its thread's call stack. It is possible for a running isolate to exhaust its memory or stack, resulting in a run-time error that cannot be effectively caught, which will force the isolate to be suspended.
 
 \commentary{
@@ -3113,12 +3465,15 @@
 
 
 \subsection{ Function Invocation}
-\label{functionInvocation}
+\LMLabel{functionInvocation}
  
+\LMHash{}
 Function invocation occurs in the following cases: when a function expression  (\ref{functionExpressions}) is invoked (\ref{functionExpressionInvocation}), when a method (\ref{methodInvocation}), getter (\ref{topLevelGetterInvocation}, \ref{propertyExtraction}) or setter (\ref{assignment}) is invoked or when a constructor is invoked (either via instance creation (\ref{instanceCreation}), constructor redirection (\ref{redirectingConstructors}) or super initialization). The various kinds of function invocation differ as to how the function to be invoked, $f$,  is determined, as well as whether \THIS{} (\ref{this}) is bound. Once $f$ has been determined, the formal parameters of $f$ are bound to corresponding actual arguments. When the body of $f$ is executed it will be executed with the aforementioned bindings. 
 
+\LMHash{}
 If $f$ is marked \ASYNC{} (\ref{functions}), then a fresh instance (\ref{generativeConstructors}) $o$ implementing the built-in class \code{Future} is associated with the invocation and immediately returned to the caller. The body of $f$ is scheduled for execution at some future time. The future $o$ will complete when $f$ terminates. The value used to complete $o$ is the current return value (\ref{return}), if it is defined, and the current exception (\ref{throw}) otherwise. 
 
+\LMHash{}
 If $f$ is marked \ASYNC* (\ref{functions}), then a fresh instance $s$ implementing the built-in class \code{Stream} is associated with the invocation and immediately returned. When $s$ is listened to, execution of the body of $f$ will begin.  When $f$ terminates:
 \begin{itemize}
 \item If the current return value is defined then, if $s$ has been canceled then its cancellation future is completed with \NULL{} (\ref{null}). 
@@ -3134,16 +3489,20 @@
 When an asynchronous generator's stream has been canceled, cleanup will occur in the \FINALLY{} clauses (\ref{try}) inside the generator. We choose to direct any exceptions that occur at this time to the cancellation future rather than have them be lost. 
 }
 
+\LMHash{}
 If $f$ is asynchronous then, when $f$ terminates, any open stream subscriptions associated with any asynchronous for loops  (\ref{asynchronousFor-in}) or yield-each statements  (\ref{yieldEach}) executing within $f$ are canceled.
 
 \rationale{Such streams may be left open by for loops that were escaped when an exception was thrown within them for example.
 }
 
+\LMHash{}
 If $f$ is marked \SYNC* (\ref{functions}), then a fresh instance $i$ implementing the built-in class \code{Iterable} is associated with the invocation and immediately returned. When iteration over the iterable is started, by getting an iterator $j$ from the iterable and calling \code{moveNext()} on it, execution of the body of $f$ will begin. When $f$ terminates, $j$ is positioned after its last element, so that its current value is \NULL{} and the current call to \code{moveNext()} on $j$ returns false, as will all further calls.
 
+\LMHash{}
 If $f$ is synchronous and is not a generator (\ref{functions}) then execution of the body of $f$ begins immediately.  When $f$ terminates the current return value is returned to the caller.
 
 
+\LMHash{}
 Execution of $f$ terminates when the first of the following occurs:
 \begin{itemize}
 \item An exception is thrown and not caught within the current function activation. 
@@ -3155,8 +3514,9 @@
 
 
 \subsubsection{ Actual Argument List Evaluation}
-\label{actualArguments}
+\LMLabel{actualArguments}
 
+\LMHash{}
 Function invocation involves evaluation of the list of actual arguments to the function and binding of the results to the function's formal parameters.
 
 \begin{grammar}
@@ -3175,12 +3535,14 @@
     .
  \end{grammar}
 
+\LMHash{}
 Evaluation of an actual argument list of the form 
 
 $(a_1, \ldots, a_m, q_1: a_{m+1}, \ldots, q_l: a_{m+l})$ 
 
 proceeds as follows:
 
+\LMHash{}
 The arguments $a_1, \ldots, a_{m+l}$ are evaluated in the order they appear in the program, yielding objects $o_1, \ldots, o_{m+l}$.
 
 \commentary{Simply stated, an argument list consisting of $m$ positional arguments and $l$ named arguments is evaluated from left to right.
@@ -3188,10 +3550,12 @@
 
 
 \subsubsection{ Binding Actuals to Formals}
-\label{bindingActualsToFormals}
+\LMLabel{bindingActualsToFormals}
 
+\LMHash{}
 Let $f$ be a function with $h$ required parameters,  let $p_1 \ldots p_n$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+k}$ be the optional parameters declared by $f$.
 
+\LMHash{}
 An evaluated actual argument list $o_1 \ldots o_{m+l}$ derived from an actual argument list of the form $(a_1, \ldots, a_m, q_1: a_{m+1}, \ldots, q_l: a_{m+l})$ is bound to the formal parameters of $f$ as follows:
 
 \commentary{
@@ -3203,25 +3567,31 @@
 }
 
 
+\LMHash{}
 If  $m < h$, or $m > n$, a \cd{NoSuchMethodError} is thrown. Furthermore, each $q_i, 1 \le i \le l$,  must have a corresponding named parameter in the set $\{p_{n+1}, \ldots, p_{n +k}\}$ or a \cd{NoSuchMethodError} is thrown. Then $p_i$ is bound to $o_i, i \in 1.. m$, and $q_j$  is bound to $o_{m+j}, j \in 1.. l$.  All remaining formal parameters of $f$  are bound to their default values. 
 
 \commentary{All of these remaining parameters are necessarily optional and thus have default values.}
 
+\LMHash{}
 In checked mode, it is a dynamic type error if  $o_i$ is not \NULL{} and the actual type  (\ref{actualTypeOfADeclaration}) of $p_i$ is not a supertype of the type of $o_i, i \in 1.. m$. In checked mode, it is a dynamic type error if  $o_{m+j}$ is not \NULL{} and the actual type  (\ref{actualTypeOfADeclaration}) of $q_j$ is not a supertype of the type of $o_{m+j}, j \in 1.. l$.
 
+\LMHash{}
 It is a compile-time error if $q_i = q_j$ for any $i \ne j$.
 
+\LMHash{}
 Let $T_i$ be the static type of $a_i$, let $S_i$ be the type of $p_i, i \in 1 .. h+k$ and let $S_q$ be the type of the named parameter $q$ of $f$.  It is a static warning if $T_j$ may not be assigned to $S_j, j \in 1..m$.  It is a static warning if $m < h$ or if $m > n$. Furthermore, each $q_i, 1 \le i \le l$,  must have a corresponding named parameter in the set $\{p_{n+1}, \ldots, p_{n +k}\}$ or a static warning occurs.  It is a static warning if $T_{m+j}$ may not be assigned to $S_{q_j}, j \in 1 .. l$.
 
 \subsubsection{ Unqualified Invocation}
-\label{unqualifiedInvocation}
+\LMLabel{unqualifiedInvocation}
 
+\LMHash{}
 An unqualified function invocation $i$ has the form 
 
 $id(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$, 
 
 where $id$ is an identifier. 
 
+\LMHash{}
 If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
 \begin{itemize}
 \item
@@ -3237,8 +3607,10 @@
 %Unqualified access to static methods of superclasses is inconsistent with the idea that static methods are not inherited. It is not particularly necessary and  may be restricted in future versions.
 %}
 
+\LMHash{}
 Otherwise, if $i$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, evaluation of $i$ causes a \cd{NoSuchMethodError} to be thrown.
 
+\LMHash{}
 If $i$ does not occur inside a top level or static function, $i$ is equivalent to $\THIS{}.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
 % Should also say:
@@ -3249,8 +3621,9 @@
 
 
 \subsubsection{ Function Expression Invocation}
-\label{functionExpressionInvocation}
+\LMLabel{functionExpressionInvocation}
 
+\LMHash{}
 A function expression invocation $i$ has the form 
 
 $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, 
@@ -3261,6 +3634,7 @@
 \code{$a.b(x)$} is parsed as a method invocation of method \code{$b()$} on object \code{$a$}, not as an invocation of getter \code{$b$} on \code{$a$} followed by a function call \code{$(a.b)(x)$}.  If a method or getter \code{$b$} exists, the two will be equivalent. However, if \code{$b$} is not defined on \code{$a$}, the resulting invocation of \code{noSuchMethod()} would differ.  The \code{Invocation} passed to \code{noSuchMethod()} would describe a call to a method \code{$b$} with argument \code{$x$} in the former case, and a call to a getter \code{$b$} (with no arguments) in the latter.
 }
 
+\LMHash{}
 Otherwise:
 
 A function expression invocation $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is equivalent to $e_f.call(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
@@ -3269,18 +3643,22 @@
 The implication of this definition, and the other definitions involving the method \code{call()}, is that user defined types can be used as function values provided they define a \CALL{} method. The method \CALL{} is special in this regard. The signature of the \CALL{} method determines the signature used when using the object via the built-in invocation syntax.
 }
 
+\LMHash{}
 It is a static warning if the static type $F$ of $e_f$ may not be assigned to a function type.  If $F$ is not a function type, the static type of $i$ is \DYNAMIC{}. Otherwise 
 the static type of $i$ is the declared return type of  $F$.  
 %\item Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \to \bot$.
 %\end{itemize}
 
 \subsection{ Lookup}
+\LMLabel{lookup}
 
 \subsubsection{Method Lookup}
-\label{methodLookup}
+\LMLabel{methodLookup}
 
+\LMHash{}
 The result of a lookup of a method $m$ in object $o$ with respect to library $L$ is the result of  a lookup of method $m$ in class $C$ with respect to library $L$, where $C$ is the class of $o$.
 
+\LMHash{}
 The result of  a lookup of method $m$ in class $C$ with respect to library $L$ is:
 If $C$ declares a concrete instance method named $m$ that is accessible to $L$,  then that method is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up $m$  in $S$ with respect to $L$. Otherwise, we say that the method lookup has failed.
 
@@ -3290,10 +3668,12 @@
 
 
 \subsubsection{ Getter and Setter Lookup}
-\label{getterAndSetterLookup}
+\LMLabel{getterAndSetterLookup}
 
+\LMHash{}
 The result of a lookup of a getter (respectively setter) $m$ in object $o$  with respect  to  library $L$ is the result of looking up getter (respectively setter) $m$ in class $C$ with respect to $L$, where $C$ is the class of $o$.
 
+\LMHash{}
 The result of a lookup of a getter (respectively setter) $m$ in class $C$  with respect to library $L$ is:
 If $C$ declares a concrete instance getter (respectively setter) named $m$  that is accessible to $L$,  then that getter (respectively setter) is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up getter (respectively setter) $m$ in $S$ with respect to $L$. Otherwise, we say that the lookup has failed.
 
@@ -3303,52 +3683,64 @@
 
 
 \subsection{ Top level Getter Invocation}
-\label{topLevelGetterInvocation}
+\LMLabel{topLevelGetterInvocation}
 
+\LMHash{}
 Evaluation of a top-level getter invocation $i$ of the form $m$, where $m$ is an identifier, proceeds as follows:
 
+\LMHash{}
 The getter function $m$ is invoked. The value of $i$ is the result returned by the call to the getter function.
 \commentary{
 Note that the invocation is always defined. Per the rules for identifier references, an identifier will not be treated as a top-level getter invocation unless the getter $i$ is defined. 
 }
 
+\LMHash{}
 The static type of $i$ is the declared return type of $m$.
 
 \subsection{ Method Invocation}
-\label{methodInvocation}
+\LMLabel{methodInvocation}
 
+\LMHash{}
 Method invocation can take several forms as specified below. 
 
 \subsubsection{Ordinary Invocation}
-\label{ordinaryInvocation}
+\LMLabel{ordinaryInvocation}
 
+\LMHash{}
 An ordinary method invocation $i$ has the form 
 
 $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
+\LMHash{}
 Evaluation of an ordinary method invocation $i$ of the form 
 
 $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
 
 proceeds as follows:
 
+\LMHash{}
 First, the expression $o$ is evaluated to a value $v_o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up (\ref{methodLookup}) method $m$  in $v_o$ with respect to the current library $L$. 
 
+\LMHash{}
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
 \commentary{
 We have an argument list consisting of $n$ positional arguments and $k$ named arguments. We have a function with $h$ required parameters and $l$ optional parameters. The number of positional arguments must be at least as large as the number of required parameters, and no larger than the number of positional parameters. All named arguments must have a corresponding named parameter. 
 }
 
+\LMHash{}
 If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method, method lookup fails. Otherwise method lookup has succeeded.
 
+\LMHash{}
 If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed.
 
+\LMHash{}
 If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. 
 f $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $g$ is a getter that forwards to a static getter, getter lookup fails.
 If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $o.m$. Then the value of $i$ is the result of invoking 
 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
 
+\LMHash{}
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3357,6 +3749,7 @@
 \item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}.
 \end{itemize}
 
+\LMHash{}
 Then the method \code{noSuchMethod()} is looked up in $v_o$ and invoked with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $v_o$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3380,6 +3773,7 @@
 
 \commentary{Notice that the wording carefully avoids re-evaluating the receiver $o$ and the arguments $a_i$. }
 
+\LMHash{}
 Let $T$ be the  static type of $o$. It is a static type warning if $T$ does not have an accessible  (\ref{privacy}) instance member named $m$ unless  either:
 \begin{itemize}
 \item
@@ -3387,14 +3781,17 @@
 \item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static getter named $m$.
 \end{itemize}
 
+\LMHash{}
 If $T.m$ exists, it  is a static type warning if the type $F$ of $T.m$ may not be assigned to a function type. If $T.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
 
+\LMHash{}
 It is a compile-time error to invoke any of the methods of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
 
 
 \subsubsection{Cascaded Invocations}
-\label{cascadedInvocations}
+\LMLabel{cascadedInvocations}
 
+\LMHash{}
 A {\em cascaded method invocation} has the form {\em e..suffix}
 where $e$ is an expression and {\em suffix} is a sequence of operator, method, getter or setter invocations.
 
@@ -3408,27 +3805,35 @@
       .
 \end{grammar}
 
+\LMHash{}
 A cascaded method invocation expression of the form {\em e..suffix} is equivalent to the expression \code{(t)\{t.{\em suffix}; \RETURN{} t;\}($e$)}.
 
 \subsubsection{Super Invocation}
-\label{superInvocation}
+\LMLabel{superInvocation}
 
+\LMHash{}
 A super method invocation $i$ has the form 
 
 $\SUPER{}.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
+\LMHash{}
 Evaluation of $i$ proceeds as follows:
 
+\LMHash{}
 First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated  yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $S$ be the superclass of the immediately enclosing class, and let $f$ be the result of looking up method (\ref{ordinaryInvocation})  $m$ in $S$  with respect to the current library $L$. 
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
+\LMHash{}
 If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  Otherwise method lookup has succeeded.
 
+\LMHash{}
 If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to the current value of \THIS{}. The value of $i$ is the value returned after $f$ is executed.
 
+\LMHash{}
 If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $S$ with respect to $L$. If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $\SUPER{}.m$. Then the value of $i$ is the result of invoking 
 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
  
+\LMHash{}
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3447,8 +3852,10 @@
 and the result of this latter invocation is the result of evaluating $i$.
 
 
+\LMHash{}
 It is a compile-time error if a super method invocation occurs in a top-level function or variable initializer, in an instance variable initializer or initializer list, in class \code{Object}, in a factory constructor or in a static method or variable initializer.
 
+\LMHash{}
 It is a static type warning if $S$ does not have an accessible (\ref{privacy}) instance member named $m$ unless $S$ or a superinterface of $S$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. If $S.m$ exists, it  is a static type warning if the type $F$ of $S.m$ may not be assigned to a function type. If $S.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
 % The following is not needed because it is specified in 'Binding Actuals to Formals"
 %Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, t_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \to \bot$.
@@ -3457,9 +3864,9 @@
 
 
 \subsubsection{Sending Messages}
+\LMLabel{sendingMessages}
 
-\label{sendingMessages}
-
+\LMHash{}
 Messages are the sole means of communication among isolates. Messages are sent by invoking specific  methods in the Dart libraries; there is no specific syntax for sending a message. 
 
 \commentary{In other words, the methods supporting sending messages embody primitives of Dart that are not accessible to ordinary code, much like the methods that spawn isolates.
@@ -3468,8 +3875,9 @@
 
 
 \subsection{ Property Extraction}
-\label{propertyExtraction}
+\LMLabel{propertyExtraction}
 
+\LMHash{}
 {\em Property extraction} allows for a member of an object to be concisely extracted from the object.
 A property extraction can be either:
 \begin{enumerate}
@@ -3477,12 +3885,16 @@
 \item A {\em getter invocation} which returns the result of invoking of a getter method.
 \end{enumerate}
 
+\LMHash{}
 Evaluation of a property extraction $i$ of the form $e.m$ proceeds as follows:
 
+\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. Let $f$ be the result of looking up (\ref{methodLookup}) method  (\ref{instanceMethods}) $m$ in $o$ with respect to the current library $L$.  If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method,  method lookup fails. If method lookup succeeds and $f$ is a concrete method then $i$ evaluates to the closurization of $o.m$.  
 
+\LMHash{}
 Otherwise, $i$ is a getter invocation, and the getter function (\ref{getters}) $m$ is looked up (\ref{getterAndSetterLookup}) in $o$  with respect to $L$. If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a getter that forwards  to a static getter,  getter lookup fails. Otherwise, the body of $m$ is executed with \THIS{} bound to $o$.  The value of $i$ is the result returned by the call to the getter function. 
 
+\LMHash{}
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isGetter} evaluates to \code{\TRUE{}}.
@@ -3500,12 +3912,14 @@
 
 and the result of this latter invocation is the result of evaluating $i$.
 
+\LMHash{}
 It is a compile-time error if $m$ is a member of class \cd{Object} and $e$ is either a prefix object (\ref{imports}) or a constant type literal.
 
 \commentary {
 This precludes \code{int.toString} but not \code{(int).toString} because in the latter case, $e$ is a parenthesized expression.
 }
 
+\LMHash{}
 Let $T$ be the  static type of $e$. It is a static type warning if $T$ does not have a method or getter named $m$ unless either:
 \begin{itemize}
 \item
@@ -3513,6 +3927,7 @@
 \item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static method or getter named $m$.
 \end{itemize}
 
+\LMHash{}
 If $i$ is a getter invocation, the static type of $i$ is:
 \begin{itemize}
 \item The declared return type of $T.m$, if $T.m$ exists.
@@ -3520,14 +3935,19 @@
 \item  The type \DYNAMIC{} otherwise.  
 \end{itemize}
 
+\LMHash{}
 If $i$ is a closurization, its static type is as described in section \ref{closurization}.
 
+\LMHash{}
 Evaluation of a property extraction $i$ of the form $\SUPER.m$ proceeds as follows:
 
+\LMHash{}
  Let $S$ be the superclass of the immediately enclosing class. Let $f$ be the result of looking up method $m$ in $S$ with respect to the current library $L$.  If $f$ is a concrete method then $i$ evaluates to the closurization of $\SUPER.m$ with respect to superclass $S$(\ref{closurization}).  
  
+\LMHash{}
  Otherwise, $i$ is a getter invocation and the getter function $m$ is looked up in $S$  with respect to $L$, and its body is executed with \THIS{} bound to the current value of  \THIS{}.  The value of $i$ is the result returned by the call to the getter function. 
 
+\LMHash{}
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isGetter} evaluates to \code{\TRUE{}}.
@@ -3545,12 +3965,14 @@
 
 and the result of this latter invocation is the result of evaluating $i$.
 
+\LMHash{}
 It is a static type warning if $S$ does not have a method or getter named $m$.  If $i$ is a getter invocation, the static type of $i$ is the declared return type of $S.m$, if $S.m$ exists and  \DYNAMIC{} otherwise. If $i$ is a closurization, its static type is as described in section \ref{closurization}.
 
 
 \subsubsection{Closurization}
-\label{closurization}
+\LMLabel{closurization}
 
+\LMHash{}
 The {\em closurization of $o.m$} is defined to be equivalent to:
 
 \begin{itemize}
@@ -3600,6 +4022,7 @@
 
 
  
+\LMHash{}
 The closurization of $\SUPER{}.m$ with respect to superclass $S$ is defined to be equivalent to:
 
 \begin{itemize}
@@ -3624,6 +4047,7 @@
 if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
 \end{itemize}
 
+\LMHash{}
 Except that:
 \begin{enumerate}
 \item  iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
@@ -3633,8 +4057,9 @@
 
 
 \subsection{ Assignment}
-\label{assignment}
+\LMLabel{assignment}
 
+\LMHash{}
 An assignment changes the value associated with a mutable variable or property.
 
 \begin{grammar}
@@ -3643,6 +4068,7 @@
     .
 \end{grammar}
 
+\LMHash{}
 Evaluation of an assignment $a$ of the form $v$ \code{=} $e$ proceeds as follows:
 
 
@@ -3654,27 +4080,38 @@
  
 %Otherwise,  
 
+\LMHash{}
 Let $d$ be the innermost declaration whose name is $v$ or $v=$, if it exists.
 
+\LMHash{}
 If $d$ is the declaration of a local variable, the expression $e$ is evaluated to an object $o$. Then, the variable $v$ is bound to $o$ unless $v$ is \FINAL{} or \CONST{}, in which case a dynamic error occurs.
 If no error occurs, the value of the assignment expression is $o$.  
 
+\LMHash{}
 If $d$ is the declaration of a library variable, top level getter or top level setter, the expression $e$ is evaluated to an object $o$. Then the setter $v=$ is invoked with its formal parameter bound to $o$. The value of the assignment expression is $o$.  
 
+\LMHash{}
 Otherwise, if $d$ is the declaration of a static variable, static getter or static setter in class $C$, then the assignment is equivalent to the assignment \code{$C.v$ = $e$}.
 
+\LMHash{}
 Otherwise, If  $a$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, evaluation of $a$ causes $e$ to be evaluated, after which a \code{NoSuchMethodError} is thrown. 
 
+\LMHash{}
 Otherwise, the assignment is equivalent to the assignment \code{ \THIS{}.$v$ = $e$}. 
 
+\LMHash{}
 In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type (\ref{actualTypeOfADeclaration}) of $v$.
 
+\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to the static type of $v$. The static type of the expression $v$ \code{=} $e$ is the static type of $e$.
 
+\LMHash{}
 Evaluation of an assignment of the form $e_1.v$ \code{=} $e_2$ proceeds as follows:
 
+\LMHash{}
 The expression $e_1$ is evaluated to an object $o_1$. Then, the expression $e_2$  is evaluated to an object $o_2$. Then, the setter $v=$ is looked up (\ref{getterAndSetterLookup}) in $o_1$ with respect to the current library.  If $o_1$ is an instance of \code{Type} but $e_1$ is not a constant type literal, then if $v=$ is a setter that forwards (\ref{functionDeclarations}) to a static setter, setter lookup fails. Otherwise, the body  of $v=$ is executed with its formal parameter bound to $o_2$ and \THIS{} bound to $o_1$. 
 
+\LMHash{}
 If the setter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isSetter} evaluates to \code{\TRUE{}}.
@@ -3683,6 +4120,7 @@
 \item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
+\LMHash{}
 Then the method \code{noSuchMethod()} is looked up in $o_1$ and invoked  with argument $im$. 
 However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $o_1$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
@@ -3692,10 +4130,13 @@
 \item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
+\LMHash{}
 The value of the assignment expression is $o_2$ irrespective of whether setter lookup has failed or succeeded.
 
+\LMHash{}
 In checked mode, it is a dynamic type error if $o_2$ is not \NULL{} and the interface of the class of $o_2$ is not a subtype of the actual type of $e_1.v$.
 
+\LMHash{}
 Let $T$ be the static type of $e_1$. It is a static type warning if $T$ does not have an accessible instance setter named $v=$ unless either:
 \begin{itemize}
 \item $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. Or
@@ -3704,21 +4145,26 @@
 
 
 
+\LMHash{}
 It is a static type warning if the static type of $e_2$ may not be assigned to the static type of the formal parameter of the setter $v=$.   The static type of the expression $e_1.v$ \code{=} $e_2$ is the static type of $e_2$.
 
+\LMHash{}
 Evaluation of an assignment of the form $e_1[e_2]$ \code{=} $e_3$ is equivalent to the evaluation of the expression \code{(a, i, e)\{a.[]=(i, e); \RETURN{} e; \} ($e_1, e_2, e_3$)}.  The static type of the expression $e_1[e_2]$ \code{=} $e_3$ is the static type of $e_3$.
 
 % Should we add: It is a dynamic error if $e_1$ evaluates to an  constant list or map.
 
+\LMHash{}
 It is a static warning if an assignment of the form $v = e$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is neither a local variable declaration with name $v$  nor setter declaration with name $v=$ in the lexical scope enclosing the assignment.
 
+\LMHash{}
 It is a compile-time error to invoke any of the setters of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
 
 
 
 \subsubsection{Compound Assignment}
-\label{compoundAssignment}
+\LMLabel{compoundAssignment}
 
+\LMHash{}
 A compound assignment of the form $v$ $op\code{=} e$ is equivalent to $v \code{=} v$ $op$ $e$. A compound assignment of the form $C.v$ $op \code{=} e$ is equivalent to $C.v \code{=} C.v$ $op$ $e$. A compound assignment of the form $e_1.v$ $op = e_2$ is equivalent to \code{((x) $=>$ x.v = x.v $op$ $e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$. A compound assignment of the form  $e_1[e_2]$ $op\code{=} e_3$ is equivalent to 
 \code{((a, i) $=>$ a[i] = a[i] $op$ $e_3$)($e_1, e_2$)} where $a$ and $i$ are a variables that are not used in $e_3$. 
 
@@ -3740,8 +4186,9 @@
 
     
 \subsection{ Conditional}
-\label{conditional}
+\LMLabel{conditional}
 
+\LMHash{}
 A {\em conditional expression} evaluates one of two expressions based on a boolean condition.
 
 \begin{grammar}
@@ -3750,10 +4197,13 @@
     . % the first  branches could  top level expressions, it seems, but certainly NOT the second
 \end{grammar}
 
+\LMHash{}
 Evaluation of a conditional expression $c$ of the form $e_1 ? e_2 : e_3$ proceeds as follows:
 
+\LMHash{}
 First, $e_1$ is evaluated to an object $o_1$.  Then, $o_1$ is  subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$.  If $r$ is \TRUE, then the value of $c$ is the result of evaluating the expression $e_2$. Otherwise the value of $c$ is the result of evaluating the expression $e_3$. 
 
+\LMHash{}
 If all of the following hold:
 \begin{itemize}
 \item $e_1$ shows that a variable $v$ has type $T$.
@@ -3764,12 +4214,14 @@
 then the type of $v$ is known to be $T$ in $e_2$.
 
 
+\LMHash{}
  It is a static type warning if the static type of $e_1$ may not be assigned to \code{bool}.  The static type of $c$ is the least upper bound (\ref{leastUpperBounds}) of the static type of $e_2$ and the static type of $e_3$.
   
 
 \subsection{ Logical Boolean Expressions}
-\label{logicalBooleanExpressions}
+\LMLabel{logicalBooleanExpressions}
 
+\LMHash{}
 The logical boolean expressions combine boolean objects using the boolean conjunction and disjunction operators.
 
 \begin{grammar}
@@ -3784,12 +4236,16 @@
     .
  \end{grammar}
  
+\LMHash{}
 A {\em logical boolean expression} is either an equality expression (\ref{equality}), or an invocation of a logical boolean operator on an expression $e_1$ with argument $e_2$.
  
+\LMHash{}
 Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ which is then  subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$, which is the value of $b$. 
 
+\LMHash{}
 Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is not  \TRUE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion producing an object $r$, which is the value of $b$. 
 
+\LMHash{}
 A logical boolean expression $b$ of the form $e_1 \&\& e_2$ shows that a variable $v$ has type 
 $T$ if all of the following conditions hold:
 \begin{itemize}
@@ -3798,6 +4254,7 @@
 \item The variable $v$ is not mutated in $e_2$ or within a closure.
 \end{itemize}
 
+\LMHash{}
 Furthermore, if all of the following hold:
 \begin{itemize}
 \item $e_1$ shows that $v$ has type $T$.
@@ -3806,12 +4263,14 @@
 \end{itemize}
 then the type of $v$ is known to be $T$ in $e_2$.
 
+\LMHash{}
 It is a static warning if the static type of $e_1$ may not be assigned to \cd{bool} or if the static type of $e_2$ may not be assigned to \cd{bool}. The static type of a logical boolean expression is \code{bool}.
 
      
  \subsection{ Equality}
- \label{equality}
+ \LMLabel{equality}
  
+\LMHash{}
 Equality expressions test objects for equality.
 
  \begin{grammar}
@@ -3824,9 +4283,11 @@
     .
  \end{grammar}
  
+\LMHash{}
 An {\em equality expression} is either a relational expression (\ref{relationalExpressions}), or an invocation of an equality operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
 
 
+\LMHash{}
 Evaluation of an equality expression $ee$ of the form \code{$e_1$ == $e_2$} proceeds as follows:
 \begin{itemize}
 \item The expression $e_1$ is evaluated to an object $o_1$.
@@ -3836,6 +4297,7 @@
 \end{itemize}
 
 
+\LMHash{}
 Evaluation of an equality expression $ee$ of the form \code{\SUPER{} == $e$} proceeds as follows:
 \begin{itemize}
 \item The expression $e$ is evaluated to an object $o$.
@@ -3850,6 +4312,7 @@
 Another implication is that there is never a need to use \code{identical()} to test against \NULL{}, nor should anyone ever worry about whether to write \NULL{} == $e$ or $e$ == \NULL{}. 
 }
 
+\LMHash{}
 An equality expression of the form \code{$e_1$ != $e_2$}  is equivalent to the expression \code{!($e_1$ == $e_2$)}. An equality expression of the form \code{\SUPER{} != $e$} is equivalent to the expression \code{!(\SUPER{} == $e$)}.
 
 
@@ -3857,12 +4320,14 @@
  %The expression $e_1$ is evaluated to an object $o_1$; then the expression $e_2$ is evaluated to an object $o_2$.  Next, if $o_1$ and $o_2$ are the same object, then $ee$ evaluates to \TRUE{}, otherwise $ee$ evaluates to \FALSE{}. 
  
 
+\LMHash{}
  The static type of an equality expression is \code{bool}.
  
  
 \subsection{ Relational Expressions}
-\label{relationalExpressions}
+\LMLabel{relationalExpressions}
 
+\LMHash{}
 Relational expressions invoke the relational operators on objects.
 
  \begin{grammar}
@@ -3878,13 +4343,16 @@
     .
  \end{grammar}
  
+\LMHash{}
 A {\em relational expression} is either a bitwise expression (\ref{bitwiseExpressions}), or an invocation of a relational operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
+\LMHash{}
 A relational expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A relational expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
 \subsection{ Bitwise Expressions}
-\label{bitwiseExpressions}
+\LMLabel{bitwiseExpressions}
 
+\LMHash{}
 Bitwise expressions invoke the bitwise operators on objects.
 
  \begin{grammar}
@@ -3906,8 +4374,10 @@
     .
  \end{grammar}
  
+\LMHash{}
 A {\em bitwise expression} is either a shift expression (\ref{shift}), or an invocation of a bitwise operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
+\LMHash{}
  A bitwise expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation $e_1.op(e_2)$.
 A bitwise expression of the form  \code{\SUPER{} $op$ $e_2$} is equivalent to the method invocation \code{\SUPER{}.op($e_2$)}.
 
@@ -3917,8 +4387,9 @@
 
  
 \subsection{ Shift}
-\label{shift}
+\LMLabel{shift}
 
+\LMHash{}
 Shift expressions invoke the shift operators on objects.
 
  \begin{grammar}
@@ -3931,8 +4402,10 @@
     .
  \end{grammar}
  
+\LMHash{}
 A {\em shift expression} is either an additive expression (\ref{additiveExpressions}), or an invocation of a shift operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
+\LMHash{}
  A shift expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A shift expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
 \commentary{
@@ -3945,8 +4418,9 @@
 }
      
  \subsection{ Additive Expressions}
-\label{additiveExpressions}
+\LMLabel{additiveExpressions}
 
+\LMHash{}
 Additive expressions invoke the addition operators on objects.
 
  \begin{grammar}
@@ -3959,16 +4433,20 @@
     .
  \end{grammar}
  
+\LMHash{}
 An {\em additive expression} is either a multiplicative expression (\ref{multiplicativeExpressions}), or an invocation of an additive operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
 
+\LMHash{}
 An additive expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. An additive expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
+\LMHash{}
 The static type of an additive expression is usually determined by the signature given in the declaration of the operator used. However, invocations of the operators \cd{+}  and \cd{-} of class \cd{int} are treated specially by the typechecker. The static type of an expression $e_1 + e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}. The static type of an expression $e_1 - e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}.
  
  
 \subsection{ Multiplicative Expressions}
-\label{multiplicativeExpressions}
+\LMLabel{multiplicativeExpressions}
 
+\LMHash{}
 Multiplicative expressions invoke the multiplication operators on objects.
 
  \begin{grammar}
@@ -3984,15 +4462,19 @@
     
  \end{grammar}
     
+\LMHash{}
  A {\em multiplicative expression} is either a unary expression (\ref{unaryExpressions}), or an invocation of a multiplicative operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
+\LMHash{}
  A multiplicative expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A multiplicative expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}.   
  
+\LMHash{}
 The static type of an multiplicative expression is usually determined by the signature given in the declaration of the operator used. However, invocations of the operators \cd{*}, \cd{\%}  and \cd{\~{}/} of class \cd{int} are treated specially by the typechecker. The static type of an expression $e_1 * e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}. The static type of an expression $e_1 \% e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}.  The static type of an expression \cd{$e_1$ \~{}/ $e_2$} where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}.
  
 \subsection{ Unary Expressions}
-\label{unaryExpressions}
+\LMLabel{unaryExpressions}
 
+\LMHash{}
 Unary expressions invoke unary operators on objects.
 
 \begin{grammar}
@@ -4021,19 +4503,24 @@
     
 \end{grammar}
 
+\LMHash{}
 A {\em unary expression} is either a postfix expression  (\ref{postfixExpressions}), an await expression (\ref{awaitExpressions}) or an invocation of a prefix operator on an expression or an invocation of a unary operator on either \SUPER{} or an expression $e$.
 
+\LMHash{}
 The expression $!e$ is equivalent to the expression $e?$ $ \FALSE{} :\TRUE{}$. 
 
+\LMHash{}
 Evaluation of an expression of the form \code{++$e$} is equivalent to \code{$e$ += 1}.  Evaluation of an expression of the form \code{-{}-$e$} is equivalent to \code{$e$ -= 1}. 
 
 %The expression $-e$ is equivalent to the method invocation \code{$e$.-()}.  The expression \code{-\SUPER{}} is equivalent  to the method invocation \code{\SUPER{}.-()}.
 
+\LMHash{}
 An expression of the form \code{$op$ $e$} is equivalent to the method invocation \code{$e.op()$}. An expression of the form \code{$op$ \SUPER{}} is equivalent to the method invocation  (\ref{superInvocation}) \code{\SUPER{}.$op()$}.
 
 \subsection{ Await Expressions}
-\label{awaitExpressions}
+\LMLabel{awaitExpressions}
 
+\LMHash{}
 An {\em await expression} allows code to yield control until an asynchronous operation (\ref{functions}) completes. 
 
  \begin{grammar}
@@ -4041,11 +4528,14 @@
       \AWAIT{} unaryExpression
  \end{grammar}
 
+\LMHash{}
 Evaluation of an await expression $a$ of the form \AWAIT{} $e$ proceeds as follows:
 First, the expression $e$ is evaluated. Next:
 
+\LMHash{}
 If $e$ raises an exception $x$, then an instance $f$ of class \code{Future} is allocated and later completed with $x$. Otherwise, if $e$ evaluates to an object $o$ that is not an instance of \code{Future}, then let $f$ be the result of calling \code{Future.value()} with $o$ as its argument; otherwise let $f$ be the result of evaluating $e$. 
 
+\LMHash{}
 Next,  execution of the function $m$ immediately enclosing $a$ is suspended until after $f$ completes. The stream associated with the innermost enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused. At some time after $f$ is completed, control returns to the current invocation. The stream associated with the innermost enclosing asynchronous for loop  (\ref{asynchronousFor-in}), if any, is resumed. If $f$ has completed with an exception $x$, $a$ raises $x$. If $f$ completes with a value $v$, $a$ evaluates to $v$.
 
 %Otherwise, the value of $a$ is the value of $e$. If evaluation of $e$ raises an exception $x$, $a$ raises $x$.
@@ -4062,6 +4552,7 @@
 It is not a static warning if the type of $e$ is not a subtype of \code{Future}. Tools may choose to give a hint in such cases.
 }
 
+\LMHash{}
 Let $flatten(T) = flatten(S)$ if $T = Future<S>$, and $T$ otherwise. The static type of $a$ is $flatten(T)$ where $T$ is the static type of $e$.
 
 \rationale{
@@ -4072,8 +4563,9 @@
 
      
 \subsection{ Postfix Expressions}
-\label{postfixExpressions}
+\LMLabel{postfixExpressions}
 
+\LMHash{}
 Postfix expressions invoke the postfix operators on objects.
 
  \begin{grammar}
@@ -4095,45 +4587,55 @@
         
  \end{grammar}
  
+\LMHash{}
  A {\em postfix expression} is either a primary expression, a function, method or getter invocation, or an invocation of a postfix operator on an expression $e$.
 
+\LMHash{}
 A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is equivalent to \code{()\{var r = $v$; $v$ = r + 1; return r\}()}.
 
 \rationale{The above ensures that if $v$ is a field, the getter gets called exactly once. Likewise in the cases below. 
 }
 
+\LMHash{}
 A postfix expression of the form \code{$C.v$ ++} is equivalent to 
 
 \code{()\{var r = $C.v$; $C.v$ = r + 1; return r\}()}.
 
+\LMHash{}
 A postfix expression of the form \code{$e_1.v$++} is equivalent to 
 
 \code{(x)\{var r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
 
+\LMHash{}
 A postfix expression of the form \code{$e_1[e_2]$++},  is equivalent to 
 
 \code{(a, i)\{var r = a[i]; a[i] = r + 1; return r\}($e_1$, $e_2$)}.
 
+\LMHash{}
 A postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to 
 
 \code{()\{var r = $v$; $v$ = r - 1; return r\}()}.
 
+\LMHash{}
 A postfix expression of the form \code{$C.v$-{}-} is equivalent to 
 
 \code{()\{var r = $C.v$; $C.v$ = r - 1; return r\}()}.
 
+\LMHash{}
 A postfix expression of the form \code{$e_1.v$-{}-} is equivalent to 
 
 \code{(x)\{var r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
 
+\LMHash{}
 A postfix expression of the form \code{$e_1[e_2]$-{}-},  is equivalent to 
 
 \code{(a, i)\{var r = a[i]; a[i] = r - 1; return r\}($e_1$, $e_2$)}.
  
 
 \subsection{ Assignable Expressions}
-\label{assignableExpressions}
+\LMLabel{assignableExpressions}
 
+\LMHash{}
 Assignable expressions are expressions that can appear on the left hand side of an assignment.
 This section describes how to evaluate these expressions when they do not constitute the complete left hand side of an assignment.
 
@@ -4156,6 +4658,7 @@
 
 \end{grammar}
 
+\LMHash{}
 An {\em assignable expression} is either:
 \begin{itemize}
  \item An identifier. 
@@ -4164,21 +4667,27 @@
 \end{itemize}
 
 
+\LMHash{}
 An assignable expression of the form $id$ is evaluated as an identifier expression (\ref{identifierReference}).
 
 %An assignable expression of the form $e.id(a_1, \ldots, a_n)$ is evaluated as a method invocation (\ref{methodInvocation}).
 
+\LMHash{}
 An assignable expression of the form $e.id$ is evaluated as a property extraction  (\ref{propertyExtraction}).
 
+\LMHash{}
 An assignable expression of the form \code{$e_1$[$e_2$]} is evaluated as a method invocation of the operator method \code{[]} on $e_1$ with argument $e_2$.
 
+\LMHash{}
 An assignable expression of the form \code{\SUPER{}.id}  is evaluated as a property extraction.
 
+\LMHash{}
 An assignable expression of the form \code{\SUPER{}[$e_2$]} is equivalent to the method invocation  \code{\SUPER{}.[]($e_2$)}.
 
 \subsection{ Identifier Reference}
-\label{identifierReference}
+\LMLabel{identifierReference}
 
+\LMHash{}
 An {\em identifier expression} consists of a single identifier; it provides access to an object via an unqualified name.
 
 \begin{grammar}
@@ -4237,21 +4746,25 @@
       . 
 \end{grammar}
 
+\LMHash{}
 A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is used as the declared name of a prefix, class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a type annotation or type parameter.
 
 \rationale{
 Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Javascript code to Dart, we do not make these into reserved words. A built-in identifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types.  This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur.  Furthermore, types should begin with an uppercase letter (see the appendix) and so no clash should occur in any Dart user program anyway.
 }
 
+\LMHash{}
 It is a compile-time error if any of the identifiers \ASYNC, \AWAIT{} or \YIELD{} is used as an identifier in a function body marked with either \ASYNC{}, \ASYNC* or \SYNC*.
 
 \rationale{
 For compatibility reasons, new constructs cannot  rely upon new reserved words or even built-in identifiers. However, the constructs above are only usable in contexts that require special markers introduced concurrently with these constructs, so no old code could use them. Hence the restriction, which treats these names as reserved words in a limited context.
 }
 
+\LMHash{}
 Evaluation of an identifier expression $e$ of the form $id$ proceeds as follows:
 
 
+\LMHash{}
 Let $d$ be the innermost declaration in the enclosing lexical scope whose name is $id$ or $id=$.  If no such declaration exists in the lexical scope, let $d$ be the declaration of the inherited member named $id$ if it exists. 
 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists.
 
@@ -4278,6 +4791,7 @@
 % This implies that referring to an undefined static getter by simple name is an error, whereas doing so by qualified name is only a warning. Same with assignments.  Revise?
 \end{itemize}
 
+\LMHash{}
 The static type of $e$ is determined as follows:
 
 \begin{itemize}
@@ -4296,11 +4810,13 @@
  This prevents situations where one uses uncorrelated setters and getters. The intent is to prevent errors when a  getter in a surrounding scope is used accidentally.
  }
  
+\LMHash{}
 It is a static warning if an identifier expression $id$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is no declaration $d$ with name $id$ in the lexical scope enclosing the expression.
 
 \subsection{ Type Test}
-\label{typeTest}
+\LMLabel{typeTest}
 
+\LMHash{}
 The {\em is-expression} tests if an object is a member of a type.
 
  \begin{grammar}
@@ -4314,8 +4830,10 @@
     .
  \end{grammar}
  
+\LMHash{}
  Evaluation of the is-expression \code{$e$ \IS{} $T$} proceeds as follows:
 
+\LMHash{}
 The expression $e$ is evaluated to a value $v$. Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs. Otherwise, if the interface of the class of $v$ is a subtype of $T$, the is-expression evaluates to \TRUE. Otherwise it evaluates to \FALSE.
 
 \commentary{It follows that \code{$e$ \IS{} Object} is always true. This makes sense in a language where everything is an object. 
@@ -4323,11 +4841,13 @@
 Also note that \code{\NULL{} \IS{} $T$} is false unless $T = \code{Object}$, $T = \code{\DYNAMIC{}}$ or $T = \code{Null}$.  The former two are useless, as is anything of the form \code{$e$ \IS{} Object} or \code{$e$ \IS{} \DYNAMIC{}}.  Users should test for a null value directly rather than via type tests.
 }
 
+\LMHash{}
 The is-expression \code{$e$ \IS{}! $T$} is equivalent to \code{!($e$ \IS{} $T$)}.
 
 % Add flow dependent types
 
 
+\LMHash{}
 Let $v$  be a local variable or a formal parameter. An is-expression of the form \code{$v$ \IS{} $T$} shows that $v$  has type $T$ iff $T$ is more specific than the type $S$ of the expression $v$ and  both $T \ne \DYNAMIC{}$ and $S \ne \DYNAMIC{}$.
 
 \rationale{
@@ -4340,12 +4860,14 @@
 We do not want to refine the type of a variable of type \DYNAMIC{}, as this could lead to more warnings rather than less.  The opposite requirement, that $T \ne \DYNAMIC{}$ is a safeguard lest $S$ ever be $\bot$.
 }
 
+\LMHash{}
 The static type of an is-expression is \code{bool}. 
 
 
 \subsection{ Type Cast}
-\label{typeCast}
+\LMLabel{typeCast}
 
+\LMHash{}
 The {\em cast expression} ensures that an object is a member of a type.
 
  \begin{grammar}
@@ -4359,16 +4881,19 @@
     .
  \end{grammar}
  
+\LMHash{}
  Evaluation of the cast expression \code{$e$ \AS{} $T$} proceeds as follows:
 
+\LMHash{}
 The expression $e$ is evaluated to a value $v$. Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs. Otherwise, if the interface of the class of $v$ is a subtype of $T$, the cast expression evaluates to $v$. Otherwise, if $v$ is \NULL{}, the cast expression evaluates to $v$. 
 In all other cases,  a \code{CastError} is thrown.
  
+\LMHash{}
 The static type of a cast expression  \code{$e$ \AS{} $T$}  is $T$. 
 
 
 \section{Statements}
-\label{statements}
+\LMLabel{statements}
 
  \begin{grammar}
 {\bf statements:}
@@ -4401,21 +4926,26 @@
  \end{grammar}
  
  \subsection{Blocks}
- \label{blocks}
+ \LMLabel{blocks}
  
+\LMHash{}
  A {\em block statement} supports sequencing of code.
 
+\LMHash{}
 Execution of a block statement $\{s_1, \ldots,  s_n\}$ proceeds as follows:
 
+\LMHash{}
 For $i \in 1 .. n, s_i$ is executed.
 
+\LMHash{}
 A block statement introduces a new scope, which is nested in the lexically enclosing scope in which the block statement appears.
 
 
 
  \subsection{Expression Statements}
- \label{expressionStatements}
+ \LMLabel{expressionStatements}
  
+\LMHash{}
 An {\em expression statement} consists of an expression other than a non-constant map literal (\ref{maps}) that has no explicit type arguments. 
 
 \rationale{
@@ -4428,14 +4958,17 @@
   .
  \end{grammar}
  
+\LMHash{}
 Execution of an expression statement \code{$e$;} proceeds by evaluating $e$. 
 
+\LMHash{}
 It is a compile-time error if a non-constant map literal that has no explicit type arguments appears in a place where a statement is expected.
 
 \subsection{Local Variable Declaration}
-\label{localVariableDeclaration}
+\LMLabel{localVariableDeclaration}
 
 
+\LMHash{}
 A {\em variable declaration statement }declares a new local variable.
 
  \begin{grammar}
@@ -4444,10 +4977,13 @@
   .
  \end{grammar}
  
+\LMHash{}
  Executing a variable declaration statement of one of the forms  \VAR{} $v = e;$, $T$ $v = e; $, \CONST{}  $v = e;$, \CONST{} $T$ $v = e;$, \FINAL{}  $v = e;$ or \FINAL{} $T$ $v = e;$ proceeds as follows:
  
+\LMHash{}
  The expression $e$ is evaluated to an object $o$. Then, the variable $v$ is set to $o$.
  
+\LMHash{}
  A variable declaration statement of the form \VAR{} $v;$ is equivalent to \VAR{} $v = \NULL{};$. A variable declaration statement of the form $T$ $v;$ is equivalent to $T$ $v = \NULL{};$. 
 
 \commentary{
@@ -4472,9 +5008,9 @@
 
 
 \subsection{Local Function Declaration}
+\LMLabel{localFunctionDeclaration}
 
-\label{localFunctionDeclaration}
-
+\LMHash{}
 A function declaration statement declares a new local function (\ref{functionDeclarations}). 
 
  \begin{grammar}
@@ -4483,6 +5019,7 @@
   .
  \end{grammar}
  
+\LMHash{}
 A function declaration statement of one of the forms $id$ $signature$ $\{ statements \}$ or $T$ $id$ $signature$ $\{ statements \}$ causes a new function named $id$ to be added to the innermost enclosing scope. It is a compile-time error to reference a local function before its declaration. 
 
 
@@ -4526,8 +5063,9 @@
 % elaborate on function identity and equality, runtime type. Likewsie in function expressions (closures) and declarations
 
 \subsection{If}
-\label{if}
+\LMLabel{if}
 
+\LMHash{}
 The {\em if statement} allows for conditional execution of statements.
 
 \begin{grammar}
@@ -4538,6 +5076,7 @@
  
 Execution of an if statement of the form  \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} } $s_2$ proceeds as follows:
  
+\LMHash{}
  First, the expression $b$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \TRUE{}, then the statement $\{s_1\}$ is executed, otherwise statement $\{s_2\}$ is executed.
 
  
@@ -4561,8 +5100,10 @@
 Under reasonable scope rules  such code is problematic. If we assume that \code{v} is declared in the scope of the method \code{main()}, then when \code{somePredicate} is false, \code{v} will be uninitialized when accessed.  The cleanest approach would be to require a block following the test, rather than an arbitrary statement. However, this goes against long standing custom, undermining Dart's goal of familiarity.  Instead, we choose to insert a block, introducing a scope,  around the statement following the predicate (and similarly for \ELSE{} and loops). This will cause both a warning and a runtime error in the case above.  Of course, if there is a declaration of \code{v} in the surrounding scope, programmers might still be surprised. We expect tools to highlight cases of shadowing to help avoid such situations.
  }
  
+\LMHash{}
   It is a static type warning if the type of the expression $b$ may not be assigned to \code{bool}.  
   
+\LMHash{}
 If:
 \begin{itemize}
 \item  $b$ shows that a variable $v$ has type $T$.
@@ -4571,6 +5112,7 @@
 \end{itemize}
 then the type of $v$ is known to be $T$ in $s_1$.  
 
+\LMHash{}
  An if statement of the form  \code {\IF{} (}$b$\code{)}$s_1$ is equivalent to the if statement  
  
  \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} \{\}}.
@@ -4578,8 +5120,9 @@
 
     
 \subsection{For}
-\label{for}
+\LMLabel{for}
 
+\LMHash{}
 The {\em for statement} supports iteration.
 
 \begin{grammar}
@@ -4597,16 +5140,20 @@
     .
  \end{grammar}
  
+\LMHash{}
  The for statement has three forms - the traditional for loop and two forms of the for-in statement - synchronous and asynchronous.
 
 \subsubsection{For Loop}
-\label{forLoop}
+\LMLabel{forLoop}
 
 
+\LMHash{}
 Execution of a for statement of the form   \code{ \FOR{} (\VAR{} $v = e_0$ ; $c$; $e$) $s$} proceeds as follows:
 
+\LMHash{}
 If $c$ is empty then let $c^\prime$ be \TRUE{} otherwise let  $c^\prime$ be $c$.
 
+\LMHash{}
 First the variable declaration statement \VAR{} $v = e_0$ is executed. Then:
 \begin{enumerate}
 \item
@@ -4632,6 +5179,7 @@
 Instead, each iteration has its own distinct variable.  The first iteration uses the variable created by the initial declaration. The expression executed at the end of each iteration uses a fresh variable $v^{\prime\prime}$, bound to the value of the current iteration variable, and then modifies $v^{\prime\prime}$ as required for the next iteration.
 }
 
+\LMHash{}
 It is a static warning if the static type of $c$ may not be assigned to \cd{bool}.
 
 %A for statement of the form \code{ \FOR{} ($d$ ; $c$; $e$) $s$} is equivalent to the the following code:
@@ -4647,8 +5195,9 @@
 %If $c$ is empty, it is interpreted as \TRUE{}.
 
 \subsubsection{For-in}
-\label{for-in}
+\LMLabel{for-in}
 
+\LMHash{}
 A for statement of the form \code{ \FOR{} ($finalConstVarOrType?$ id \IN{} $e$) $s$} is equivalent to the following code: 
 
 \begin{dartCode}
@@ -4665,30 +5214,37 @@
 }
  
 \subsubsection{Asynchronous For-in}
-\label{asynchronousFor-in}
+\LMLabel{asynchronousFor-in}
 
+\LMHash{}
 A for-in statement may be asynchronous. The asynchronous form is designed to iterate over streams. An asynchronous for loop is distinguished by the keyword \AWAIT{} immediately preceding the keyword \FOR.
 
+\LMHash{}
 Execution of a for-in statement of the form  \code{\AWAIT{} \FOR{} (finalConstVarOrType? id \IN{} $e$) $s$} proceeds as follows:
 
+\LMHash{}
 The expression $e$ is evaluated to an object $o$. It is a dynamic error if $o$ is not an instance of a class that implements \code{Stream}. Otherwise, the expression \code{\AWAIT{} $v_f$}  (\ref{awaitExpressions}) is evaluated, where $v_f$ is a fresh variable whose value is a fresh instance (\ref{generativeConstructors}) $f$ implementing the built-in class \code{Future}.
 
+\LMHash{}
 The stream $o$ is listened to,  and on each data event in $o$ the statement $s$ is executed with \code{id} bound to the value of the current element of the stream. If $s$ raises an exception, or if $o$ raises an exception, then $f$ is completed with that exception. Otherwise, when all events in the stream $o$ have been processed, $f$ is completed with \NULL{}  (\ref{null}).
 
+\LMHash{}
 Let $u$ be the stream associated with the immediately enclosing asynchronous for loop or generator function (\ref{functions}), if any. If another event $e_u$ of $u$ occurs before execution of $s$ is complete, handling of $e_u$ must wait until $s$ is complete.
 
 \rationale{
 The future $f$ and the corresponding \AWAIT{} expression ensure that execution suspends as an asynchronous for loop begins and resumes after the \FOR{} statement when it ends. They also ensure that the stream of any enclosing asynchronous \FOR{} loop is paused for the duration of this loop.
 }
 
+\LMHash{}
 It is a compile-time error if an asynchronous for-in statement appears inside a synchronous function (\ref{functions}). It is a compile-time error if a traditional for loop  (\ref{forLoop}) is prefixed by the \AWAIT{}  keyword.
 
 \rationale{An asynchronous loop would make no sense within a synchronous function, for the same reasons that an await expression makes no sense in a synchronous function.}
 
  
 \subsection{While}
-\label{while}
+\LMLabel{while}
 
+\LMHash{}
 The while statement supports conditional iteration, where the condition is evaluated prior to the loop.
 
 \begin{grammar}
@@ -4697,16 +5253,20 @@
 .
  \end{grammar}
  
+\LMHash{}
  Execution of a while statement of the form \code{\WHILE{} ($e$) $s$;} proceeds as follows: 
 
+\LMHash{}
 The expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.  If $r$ is \TRUE{}, then the statement $\{s\}$ is executed and then the while statement is re-executed recursively. If $r$ is \FALSE{}, execution of the while statement is complete.
 
+\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}.
     
 
 \subsection{Do}
-\label{do}
+\LMLabel{do}
 
+\LMHash{}
 The do statement supports conditional iteration, where the condition is evaluated after the loop.
 
 \begin{grammar}
@@ -4716,15 +5276,19 @@
  \end{grammar}
 
     
+\LMHash{}
 Execution of a do statement of the form \code{\DO{} $s$ \WHILE{} ($e$);} proceeds as follows: 
 
+\LMHash{}
 The statement $\{s\}$ is executed. Then, the expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \FALSE{}, execution of the do statement is complete. If $r$ is \TRUE{}, then the do statement is re-executed recursively. 
 
+\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}. 
 
 \subsection{Switch}
-\label{switch}
+\LMLabel{switch}
 
+\LMHash{}
 The {\em switch statement} supports dispatching control among a large number of cases.
 
  \begin{grammar}
@@ -4742,6 +5306,7 @@
     .
  \end{grammar}
  
+\LMHash{}
  Given a switch statement of the form 
  
 \begin{dartCode}
@@ -4773,6 +5338,7 @@
 \commentary{In other words,  all the expressions in the cases evaluate to constants of the exact same user defined class or are of certain known types.  Note that the values of the expressions are known at compile-time, and are independent of any static type annotations.
 }
 
+\LMHash{}
 It is a compile-time error if the class $C$ has an implementation of the operator $==$ other than the one inherited from \code{Object} unless the value of the expression is a string, an integer, literal symbol or the result of invoking a constant constructor of class \cd{Symbol}.
  
  \rationale{
@@ -4784,6 +5350,7 @@
 The \SWITCH{}  statement should only be used in very limited situations (e.g., interpreters or scanners).  
 }
 
+\LMHash{}
 Execution of a switch statement of the form
 
 \begin{dartCode}
@@ -4807,14 +5374,18 @@
 
 proceeds as follows:
 
+\LMHash{}
 The statement \code{\VAR{} id = $e$;} is evaluated, where \code{id} is a variable whose name is distinct from any other variable in the program. In checked mode, it is a run time error if the value of $e$ is not an instance of the same class as the constants $e_1 \ldots e_n$. 
 
 \commentary{Note that if there are no case clauses ($n = 0$), the type of $e$ does not matter.}
 
+\LMHash{}
 Next, the case clause \CASE{} $e_{1}: s_{1}$ is executed if it exists. If \CASE{} $e_{1}: s_{1}$ does not exist, then if there is a  \DEFAULT{} clause it is executed by executing $s_{n+1}$.
 
+\LMHash{}
 A case clause introduces a new scope, nested in the lexically surrounding scope. The scope of a case clause ends immediately after the case clause's statement list.
 
+\LMHash{}
 Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement  
 
 \begin{dartCode}
@@ -4828,11 +5399,13 @@
 
 proceeds as follows:
 
+\LMHash{}
 The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$. 
 If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists. If  \CASE{} $e_{k+1}: s_{k+1}$ does not exist, then the \DEFAULT{} clause is executed by executing $s_{n+1}$.
 If $v$ is \TRUE{},   let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty. If no such $h$ exists, let $h = n + 1$. The  sequence of statements $s_h$ is then executed.
 If execution reaches the point after $s_h$  then  a runtime error occurs, unless $h = n+1$.
 
+\LMHash{}
 Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement  
 
 \begin{dartCode}
@@ -4845,6 +5418,7 @@
 
 proceeds as follows:
 
+\LMHash{}
 The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$. 
 If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists. 
 If $v$ is \TRUE{},   let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty. The  sequence of statements $s_h$ is  executed if it exists.
@@ -4855,6 +5429,7 @@
 In other words, there is no implicit fall-through between cases. The last case in a switch (default or otherwise) can `fall-through' to the end of the statement.
 }
 
+\LMHash{}
 It is a static warning if the type of $e$ may not be assigned to the type of $e_k$. It is a static warning if the last statement of the statement sequence $s_k$ is not a \BREAK{}, \CONTINUE{}, \RETURN{} or \THROW{} statement.
 
 \rationale{
@@ -4873,6 +5448,7 @@
   Very elaborate code in a case clause is probably bad style in any case, and such code can always be refactored.
 }
  
+\LMHash{}
  It is a static warning if all of the following conditions hold:
  \begin{itemize}
 \item  The switch statement does not have a default clause.
@@ -4886,9 +5462,10 @@
 
  
 \subsection{ Rethrow}
-\label{rethrow}
+\LMLabel{rethrow}
 
 
+\LMHash{}
 The {\em rethrow statement}  is used to re-raise an exception.
 
  \begin{grammar}
@@ -4897,33 +5474,40 @@
     .
  \end{grammar}
  
+\LMHash{}
 Execution of a \code{\RETHROW{}} statement proceeds as follows:
 
+\LMHash{}
 Let $f$ be the immediately enclosing function, and let \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$)}  be the immediately enclosing catch clause (\ref{try}).
 
 \rationale{
 A \RETHROW{} statement always appears inside a \CATCH{} clause, and any \CATCH{} clause is semantically equivalent to some \CATCH{} clause of the form \code{\ON{} $T$ \CATCH{} (p1, p2)}.  So we can assume that the \RETHROW{} is enclosed in a \CATCH{} clause of that form.
 }
 
+\LMHash{}
 The current exception (\ref{throw}) is set to $p_1$, the current return value (\ref{return}) becomes undefined, and the active stack trace (\ref{try}) is set to $p_2$.
 
+\LMHash{}
 If $f$ is marked \ASYNC{} or \ASYNC* (\ref{functions}) and there is a dynamically enclosing exception handler (\ref{try}) $h$ introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
 
 \rationale{
 In the case of an asynchronous function, the dynamically enclosing exception handler is only relevant within the function. If an exception is not caught within the function, the exception value is channelled through a future or stream rather than propagating via exception handlers.
 }
 
+\LMHash{}
 Otherwise, control is transferred to the  innermost enclosing exception handler.
 
 \commentary{The change in control may result in multiple functions terminating if these functions do not catch the exception via a \CATCH{} or \FINALLY{} clause, both of which introduce a dynamically enclosing exception handler.}
 
+\LMHash{}
 It is a compile-time error if a  \code{\RETHROW{}} statement is not enclosed within an \ON-\CATCH{} clause. 
 
 
 
 \subsection{ Try}
-\label{try}
+\LMLabel{try}
 
+\LMHash{}
 The try statement supports the definition of exception handling code in a structured way.
 
 \begin{grammar}
@@ -4944,6 +5528,7 @@
     .
  \end{grammar}
  
+\LMHash{}
  A try statement consists of a block statement, followed by at least one of:
  \begin{enumerate}
  \item
@@ -4956,23 +5541,28 @@
 The syntax is designed to be upward compatible with existing Javascript programs. The \ON{} clause can be omitted, leaving what looks like a Javascript catch clause.
 }
 
+\LMHash{}
 An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$}  {\em matches} an object $o$  if the type of $o$ is a subtype of $T$.  If $T$ is a malformed or deferred type  (\ref{staticTypes}), then performing a match causes a run time error.
 
 \commentary {
 It is of course a static warning if $T$ is a deferred or malformed type.
 }
 
+\LMHash{}
 An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} introduces a new scope $CS$ in which final local variables specified by $p_1$ and $p_2$ are defined. The statement $s$ is enclosed within $CS$. The static type of $p_1$ is $T$ and the static type of $p_2$ is \code{StackTrace}.
 
 
+\LMHash{}
 An \ON{}-\CATCH{} clause of the form  \code{\ON{} $T$ \CATCH{} ($p_1$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} where $p_2$ is an identifier that does not occur anywhere else in the program. 
 
 
+\LMHash{}
 An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p$) $s$}. An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p_1, p_2$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p_1, p_2$) $s$}.
 
 
 %If an explicit type is associated with of $p_2$, it is a static warning if that type is not \code{Object} or \DYNAMIC{}.
 
+\LMHash{}
 The {\em active stack trace} is an object whose \code{toString()} method produces a string that is a record of exactly those function activations within the current isolate that had not completed execution at the point where the current exception (\ref{throw}) was thrown.
 %\begin{enumerate}
 %\item Started execution after the currently executing function.
@@ -5003,19 +5593,24 @@
  
  % A position can be represented via a Token. If we make that part of the core reflection facility, we can state this here.
 
+\LMHash{}
 A try statement \TRY{} $s_1$ $on-catch_1 \ldots  on-catch_n$ \FINALLY{} $s_f$  defines an exception handler $h$ that executes as follows:
 
+\LMHash{}
 The \ON{}-\CATCH{} clauses are examined in order, starting with $catch_1$, until either an \ON{}-\CATCH{} clause that matches the current exception (\ref{throw}) is found, or the list of \ON{}-\CATCH{} clauses has been exhausted. If an \ON{}-\CATCH{} clause $on-catch_k$ is found, then $p_{k1}$ is bound to the current exception,  $p_{k2}$, if declared,  is bound to the active stack trace, and then $catch_k$ is executed. If no \ON{}-\CATCH{} clause is found, the \FINALLY{} clause is executed. Then, execution resumes at the end of the try statement.
 
 
+\LMHash{}
 A finally clause \FINALLY{} $s$ defines an exception handler $h$ that executes as follows:
 
+\LMHash{}
 Let $r$ be the current return value (\ref{return}). Then the current return value becomes undefined. Any open streams associated with any asynchronous for loops (\ref{asynchronousFor-in}) and yield-each (\ref{yieldEach}) statements executing within the dynamic scope of $h$ are canceled. 
 
 \rationale{
 Streams left open by for loops that were escaped for whatever reason would be canceled at function termination, but it is best to cancel them as soon as possible.
 }
 
+\LMHash{}
 Then the \FINALLY{} clause is executed. Let $m$ be the immediately enclosing function. If $r$ is defined then the current return value is set to $r$ and then:
 \begin{itemize}
 \item
@@ -5026,15 +5621,20 @@
 
 Otherwise, execution resumes at the end of the try statement.
 
+\LMHash{}
 Execution of an \ON{}-\CATCH{} clause \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$)} $s$ of a try statement $t$ proceeds as follows: The statement $s$ is executed in the dynamic scope of the exception handler defined by the finally clause of $t$. Then, the current exception and active stack trace both become undefined.
 
+\LMHash{}
 Execution of a \FINALLY{} clause \FINALLY{} $s$ of a try statement proceeds as follows: 
 
+\LMHash{}
 Let $x$ be the current exception and let $t$ be the active stack trace. Then the current exception and the active stack trace both become undefined. The statement $s$ is executed. Then, if $x$ is defined,  it is rethrown as if by a rethrow statement (\ref{rethrow}) enclosed in a \CATCH{} clause of the form \code{\CATCH{} ($v_x$, $v_t$)} where $v_x$ and $v_t$ are fresh variables bound to $x$ and $t$ respectively.
 
 
+\LMHash{}
 Execution of a try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $s_f$;}  proceeds as follows:
 
+\LMHash{}
 The statement $s_1$ is executed in the dynamic scope of the exception handler defined by the try statement. Then, the \FINALLY{} clause is executed.
 
 \commentary{
@@ -5049,12 +5649,14 @@
 If no exception was raised, the \FINALLY{} clause is also executed. Execution of the \FINALLY{} clause could also raise an exception, which will cause transfer of control to the next enclosing handler. 
 }
 
+\LMHash{}
 A try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$;} is equivalent to the statement \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $\{\}$}.
  
 
 \subsection{ Return}
-\label{return}
+\LMLabel{return}
 
+\LMHash{}
 The {\em return statement} returns a result to the caller of a synchronous function,  completes the future associated with an asynchronous function or terminates the stream or iterable associated with a generator (\ref{functions}).
 
 
@@ -5068,10 +5670,13 @@
  Due to \FINALLY{} clauses, the precise behavior of \RETURN{} is a little more involved. Whether the value a return statement is supposed to return is actually returned depends on the behavior of any \FINALLY{} clauses in effect when executing the return. A \FINALLY{} clause may choose to return another value, or throw an exception, or even redirect control flow leading to other returns or throws. All a return statement really does is set a value that is intended to be returned when the function terminates. 
  }
 
+\LMHash{}
 The {\em current return value} is a unique value specific to a given function activation. It is undefined unless explicitly set in this specification.
     
+\LMHash{}
 Executing a return statement \code{\RETURN{} $e$;} proceeds as follows:
 
+\LMHash{}
 First the expression $e$ is evaluated, producing an object $o$. Next:
 \begin{itemize}
 \item  
@@ -5087,28 +5692,34 @@
 The enclosing function cannot be marked as generator (i.e, \ASYNC* or \SYNC*), since generators are not allowed to contain a statement of the form \code{\RETURN{} $e$;} as discussed below.
 }
 
+\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  
 
+\LMHash{}
 It is a static type warning if the body of $f$ is marked \ASYNC{} and the type \code{Future$<$flatten(T)$>$} (\ref{awaitExpressions}) may not be assigned to the declared return type of $f$.   Otherwise, it is a static type warning if $T$ may not be assigned to the declared return type of $f$. 
 
+\LMHash{}
 Let $S$ be the runtime type of $o$. In checked mode:
 \begin{itemize}
 \item  If the body of $f$ is marked \ASYNC{} (\ref{functions}) it is a dynamic type error if $o$ is not \NULL{} (\ref{null}) and \code{Future$<$S$>$} is not a subtype of the actual return type  (\ref{actualTypeOfADeclaration}) of $f$.
 \item Otherwise, it is a dynamic type error if $o$ is not \NULL{} and the runtime type of $o$ is not a subtype of the actual return type of $f$.
 \end{itemize}
 
+\LMHash{}
 It is a compile-time error if a return statement of the form \code{\RETURN{} $e$;} appears in a generative constructor (\ref{generativeConstructors}).
 
 \rationale{
 It is quite easy to forget to add the factory prefix for a constructor, accidentally converting a factory into a generative constructor. The static checker may detect a type mismatch in some, but not all, of these cases. The rule above helps catch such errors, which can otherwise be very hard to recognize. There is no real downside to it, as returning a value from a generative constructor is meaningless.
 }
 
+\LMHash{}
 It is a compile-time error if a return statement of the form \code{\RETURN{} $e$;} appears in a generator function.
 
 \rationale{
 In the case of a generator function, the value returned by the function is the iterable or stream associated with it, and individual elements are added to that iterable using yield statements, and so returning a value makes no sense. 
 }
 
+\LMHash{}
 Let $f$ be the function immediately enclosing a return statement of the form \RETURN{}; It is a static warning  $f$ is neither a generator nor a generative constructor and either:
 \begin{itemize}
 \item  $f$ is synchronous and the return type of $f$ may not be assigned to \VOID{} (\ref{typeVoid}) or, 
@@ -5122,8 +5733,10 @@
 
 \rationale{ An asynchronous non-generator always returns a future of some sort. If no expression is given, the future will be completed with \NULL{} and this motivates the requirement above.} \commentary{Leaving the return type of a function marked \ASYNC{}  blank will be interpreted as \DYNAMIC{} as always, and cause no type error. Using \code{Future} or \code{Future$<$Object$>$} is acceptable as well, but any other type will cause a warning, since \NULL{} has no subtypes.}
 
+\LMHash{}
 A return statement with no expression, \code{\RETURN;} is executed as follows:
 
+\LMHash{}
 If the immediately enclosing function $f$ is a generator, then:
 \begin{itemize}
 \item
@@ -5134,6 +5747,7 @@
 Otherwise, execution of the current method terminates. 
 \end{itemize}
 
+\LMHash{}
 Otherwise the return statement is executed by executing the statement  \code{\RETURN{} \NULL{};} if it occurs inside a method, getter, setter or factory; otherwise, the return statement necessarily occurs inside a generative constructor, in which case it is executed by executing  \code{\RETURN{} \THIS{};}.
 
 \commentary{Despite the fact that \code{\RETURN{};} is executed as if by a \code{\RETURN{} $e$;}, it is important to understand that it is not a static warning to include a statement of the form \code{\RETURN{};} 
@@ -5148,14 +5762,16 @@
 The question then becomes, what value should a return statement return when no return expression is given. In a generative constructor, it is obviously the object being constructed (\THIS{}). A void function is not expected to participate in an expression, which is why it is marked \VOID{} in the first place. Hence, this situation is a mistake which should be detected as soon as possible. The static rules help here, but if the code is executed, using \NULL{} leads to fast failure, which is desirable in this case. The same rationale applies for function bodies that do not contain a return statement at all.
 }
 
+\LMHash{}
 It is a static warning if a  function contains both one or more explicit return statements of the form \code{\RETURN;} and one or more return statements of the form \code{\RETURN{} $e$;}.
 
 
 
 
 \subsection{ Labels}
-\label{labels}
+\LMLabel{labels}
 
+\LMHash{}
 A {\em label} is an identifier followed by a colon. A {\em labeled statement} is a statement prefixed by a label $L$.  A {\em labeled case clause} is a case clause within a switch statement (\ref{switch}) prefixed by a label $L$.
 
 \rationale{The sole role of labels is to provide targets for the break (\ref{break}) and continue (\ref{continue}) statements.}
@@ -5168,8 +5784,10 @@
     .
  \end{grammar}
  
+\LMHash{}
  The semantics of a labeled statement $L: s$ are identical to those of the statement $s$. The namespace of labels is distinct from the one used for types, functions and variables.
 
+\LMHash{}
 The scope of a label that labels a statement $s$ is $s$. The scope of a label that labels a case clause of a switch statement $s$ is $s$.
 
 \rationale{Labels should be avoided by programmers at all costs. The motivation for including labels in the language is primarily making Dart a better target for code generation.
@@ -5177,8 +5795,9 @@
 
  
 \subsection{ Break}
-\label{break}
+\LMLabel{break}
 
+\LMHash{}
 The {\em break statement} consists of the reserved word \BREAK{} and an optional label (\ref{labels}). 
 
 \begin{grammar}
@@ -5187,15 +5806,18 @@
     .
  \end{grammar}
  
+\LMHash{}
 Let $s_b$ be a \BREAK{} statement. If $s_b$ is of the form  \code{\BREAK{} $L$;}, then let $s_E$ be the the innermost labeled statement with label $L$ enclosing $s_b$. If $s_b$ is of the form \code{\BREAK{};},  then let $s_E$ be the the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}), \SWITCH{} (\ref{switch}) or \WHILE{} (\ref{while}) statement enclosing  $s_b$. It is a compile-time error if no such statement $s_E$ exists within the innermost function in which  $s_b$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_b$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_b$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order and then terminates $s_E$. 
 
+\LMHash{}
 If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), its associated stream subscription is canceled. Furthermore, let $a_k$ be the set of asynchronous for loops  and yield-each statements (\ref{yieldEach}) enclosing $s_b$ that are enclosed in $s_E , 1 \le k \le m$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$. 
 
 
 
 \subsection{ Continue}
-\label{continue}
+\LMLabel{continue}
 
+\LMHash{}
 The {\em continue statement} consists of the reserved word \CONTINUE{} and an optional label (\ref{labels}). 
 
 \begin{grammar}
@@ -5204,20 +5826,23 @@
         .
  \end{grammar}      
  
+\LMHash{}
  Let $s_c$ be a \CONTINUE{} statement. If $s_c$ is of the form  \code{\CONTINUE{} $L$;}, then let $s_E$ be the the innermost labeled \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement or case clause with label $L$ enclosing $s_c$. If $s_c$ is of the form \code{\CONTINUE{};}  then let $s_E$ be the the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement enclosing  $s_c$. It is a compile-time error if no such statement or case clause $s_E$ exists within the innermost function in which  $s_c$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_c$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_c$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order. Then, if $s_E$ is a case clause, control is transferred to the case clause. Otherwise, $s_E$ is necessarily a loop and execution resumes after the last statement in the loop body.
  
  \commentary{
  In a while loop, that would be the boolean expression before the body. In a do loop, it would be the boolean expression after the body. In a for loop, it would be the increment clause.  In other words, execution continues to the next iteration of the loop.
  }
  
+\LMHash{}
  If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), let $a_k$ be the set of asynchronous for loops and yield-each statements (\ref{yieldEach}) enclosing $s_c$ that are enclosed in $s_E , 1 \le k \le m$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$. 
  
  \subsection{ Yield and Yield-Each}
- \label{yieldAndYieldEach}
+ \LMLabel{yieldAndYieldEach}
  
  \subsubsection{ Yield}
- \label{yield}
+ \LMLabel{yield}
  
+\LMHash{}
  The {\em yield statement} adds an element to the result of a generator function (\ref{functions}).
 
  \begin{grammar}
@@ -5226,18 +5851,23 @@
       .
 \end{grammar}
 
+\LMHash{}
 Execution of a statement $s$ of the form \code{\YIELD{} $e$;}  proceeds as follows:
 
+\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. If the enclosing function $m$ is marked \ASYNC* (\ref{functions}) and the stream $u$ associated with $m$ has been paused,  then execution of $m$ is suspended until $u$ is resumed or canceled.
 
+\LMHash{}
 Next, $o$ is added to the iterable or stream associated with the immediately enclosing function. 
 
+\LMHash{}
 If the enclosing function $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined, let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
 
 \rationale{
 The stream associated with an asynchronous generator could be canceled by any code with a reference to that stream at any point where the generator was passivated.  Such a cancellation constitutes an irretrievable error for the generator. At this point, the only plausible action for the generator is to clean up after itself via its \FINALLY{} clauses.
 }
 
+\LMHash{}
 If the enclosing function $m$ is marked \SYNC* (\ref{functions}) then:
 \begin{itemize}
 \item
@@ -5246,8 +5876,10 @@
 The current call to \code{moveNext()} returns \TRUE.
 \end{itemize}
 
+\LMHash{}
 It is a compile-time error if a yield statement appears in a function that is not a generator function.
 
+\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  It is a static type warning if either:
 \begin{itemize}
 \item
@@ -5258,8 +5890,9 @@
 
  
  \subsubsection{ Yield-Each}
- \label{yieldEach}
+ \LMLabel{yieldEach}
  
+\LMHash{}
  The {\em yield-each statement} adds a series of values to the result of a generator function (\ref{functions}).
  
  \begin{grammar}
@@ -5268,8 +5901,10 @@
       .
 \end{grammar}
 
+\LMHash{}
 Execution of a statement s of the form \code{\YIELD* $e$;}  proceeds as follows:
 
+\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. If the immediately enclosing function $m$ is synchronous, then it is a dynamic error if the class of $o$ does not implement \code{Iterable}.  If $m$ asynchronous, then it is a dynamic error if the class of $o$ does not implement \code{Stream}. Next, for each element $x$ of $o$:
 \begin{itemize}
 \item
@@ -5280,6 +5915,7 @@
 If $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined,  let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
 \end{itemize}
 
+\LMHash{}
 If the enclosing function is marked \SYNC* (\ref{functions}) then:
 \begin{itemize}
 \item
@@ -5288,14 +5924,17 @@
 The current call to \code{moveNext()} returns \TRUE.
 \end{itemize}
 
+\LMHash{}
 It is a compile-time error if a yield-each statement appears in a function that is not a generator function.
 
+\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  It is a static type warning if $T$ may not be assigned to the declared return type of $f$. 
 
 
 \subsection{ Assert}
-\label{assert}
+\LMLabel{assert}
 
+\LMHash{}
 An {\em assert statement} is used to disrupt normal execution if a given boolean condition does not hold.
 
 \begin{grammar}
@@ -5304,14 +5943,17 @@
       .
 \end{grammar}
       
+\LMHash{}
 The assert statement has no effect in production mode. In checked mode, execution of an assert statement \code{\ASSERT{}($e$);} proceeds as follows:
 
+\LMHash{}
 The conditional expression $e$ is evaluated to an object $o$. If the class of $o$ is a subtype of \code{Function} then let $r$ be the result of invoking $o$ with no arguments. Otherwise, let $r$ be $o$. 
 It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Function}, or if $r$ is not of type \code{bool}.  If $r$ is \FALSE{}, we say that the assertion failed. If $r$ is \TRUE{}, we say that the assertion succeeded. If the assertion succeeded, execution of the assert statement is complete. If the assertion failed, an \code{AssertionError} is thrown.
 
 %\Q{Might be cleaner to define it as \code{if (!$e$) \{\THROW{} \NEW{} AssertionError();\}} (in checked mode only).
 %What about an error message as part of the assert?}
 
+\LMHash{}
  It is a static type warning if the type of $e$ may not be assigned to either  \code{bool} or $() \rightarrow$ \code{bool}.  
 
 \rationale{Why is this a statement, not a built in function call? Because it is handled magically so it has no effect and no overhead in production mode. Also, in the absence of final methods. one could not prevent it being overridden (though there is no real harm in that).  It cannot be viewed as a function call that is being optimized away because the argument might have side effects.
@@ -5341,10 +5983,12 @@
 %\rationale{therefore, we opt for the second option. Alternately, one could insist that assert be a reserved word, which may have an undesirable effect with respect to compatibility of Javascript code ported to Dart.}
 
 \section{Libraries and Scripts}
-\label{librariesAndScripts}
+\LMLabel{librariesAndScripts}
 
+\LMHash{}
 A Dart program consists of one or more libraries, and may be built out of one or more {\em compilation units}. A compilation unit may be a library or a part (\ref{parts}). 
 
+\LMHash{}
 A library consists of (a possibly empty) set of imports, a set of exports,  and a set of top-level declarations. A top-level declaration is either a class (\ref{classes}), a type alias declaration (\ref{typedef}), a function (\ref{functions}) or a variable declaration (\ref{variables}). The members of a library $L$ are those top level declarations given within $L$.
 
  \begin{grammar}
@@ -5395,12 +6039,14 @@
   libraryExport   
  \end{grammar}
  
+\LMHash{}
  Libraries may be {\em explicitly named} or {\em implicitly named}. An explicitly named library begins with  the  word \LIBRARY{} (possibly prefaced with any applicable metadata annotations), followed by a qualified identifier that gives the name of the library.
  
  \commentary{
  Technically, each dot and identifier is a separate token and so spaces between them are acceptable. However, the actual library name is the concatenation of the simple identifiers and dots and contains no spaces.
  }
  
+\LMHash{}
 An implicitly named library has the empty string as its name. 
 
  \rationale{
@@ -5411,19 +6057,23 @@
 Libraries intended for widespread use should avoid name collisions.  Dart's \code{pub} package management system provides a mechanism for doing so.  Each pub package is guaranteed a unique name, effectively enforcing a global namespace.
  }
  
+\LMHash{}
  A library may optionally begin with a {\em script tag}. Script tags are intended for use with scripts (\ref{scripts}).  A script tag can be used to identify the interpreter of the script to whatever computing environment the script is embedded in. The script tag must appear before any whitespace or comments.  A script  tag begins with the characters \#! and ends at the end of the line. Any characters that follow \#!  in the script tag are ignored by the Dart implementation.
  
+\LMHash{}
 Libraries are units of privacy. A private declaration declared within a library $L$ can only be accessed by code within $L$. Any attempt to access a private member declaration from outside $L$ will cause a method, getter or setter lookup failure.
 
 \commentary{Since top level privates are not imported, using the top level privates of another library is never possible. }
 
+\LMHash{}
 The {\em public namespace} of library $L$ is the mapping that maps the simple name of each public top-level member $m$ of $L$ to $m$. 
 The scope of a library $L$ consists of the names introduced by all top-level declarations declared in $L$, and the names added by $L$'s imports (\ref{imports}).
 
 
 \subsection{Imports}
-\label{imports}
+\LMLabel{imports}
 
+\LMHash{}
 An {\em import} specifies a library to be used in the scope of another library. 
 \begin{grammar}
 {\bf libraryImport:}
@@ -5444,12 +6094,16 @@
  \end{grammar}
  
 
+\LMHash{}
 An import specifies a URI $x$ where the declaration of an imported library is to be found. 
 
+\LMHash{}
 Imports may be {\em deferred} or {\em immediate}. A deferred import is distinguished by the appearance of the built-in identifier \DEFERRED{} after the URI. Any import that is not deferred is immediate.
 
+\LMHash{}
 It is a compile-time error if  the specified URI of an immediate import does not refer to a library declaration.  The interpretation of URIs is described in section \ref{uris} below.
 
+\LMHash{}
 It is a static warning if the specified URI of a deferred import does not refer to a library declaration.
 
 \rationale{
@@ -5457,14 +6111,19 @@
  }
 
  
+\LMHash{}
 The {\em current library} is the library currently being compiled. The import modifies the  namespace of the current library in a manner that is determined by the imported library and by the optional elements of  the import.
      
+\LMHash{}
 An immediate import directive $I$ may optionally include a prefix clause of the form \AS{} \code{Id} used to prefix names imported by $I$. A deferred import must include a prefix clause or a compile time error occurs. It is a compile-time error if a prefix used in a deferred import is used in another import clause.
 
+\LMHash{}
 An import directive $I$ may optionally include a namespace combinator clauses used to restrict the set of names imported by $I$. Currently, two namespace combinators are supported: \HIDE{} and \SHOW{}.
 
+\LMHash{}
 Let $I$ be an import directive that refers to a URI via the string $s_1$. Evaluation of $I$  proceeds as follows:
 
+\LMHash{}
 If $I$ is a deferred import, no evaluation takes place. Instead, a mapping of the name of the prefix, $p$ to a {\em deferred prefix object} is added to the scope of $L$.
 The deferred prefix object has the following methods:
 
@@ -5476,8 +6135,10 @@
 \item For every type $T$ named $id$ in $L$, a corresponding getter named $id$ with return type \code{Type}.  Calling the method results in a runtime error.
 \end{itemize}
 
+\LMHash{}
 After a call succeeds, the name $p$ is mapped to a non-deferred prefix object as described below. In addition, the prefix object also supports the \code{loadLibrary} method, and so it is possible to call \code{loadLibrary} again. If a call fails, nothing happens, and one again has the option to call \code{loadLibrary} again. Whether a repeated call to \code{loadLibrary} succeeds will vary as described below.
 
+\LMHash{}
 The effect of a repeated call to \code{$p$.loadLibrary} is as follows:
 \begin{itemize}
 \item
@@ -5499,6 +6160,7 @@
 We do not specify what value the future returned resolves to.
 }
 
+\LMHash{}
 If $I$ is an immediate import then, first
 
  \begin{itemize}
@@ -5509,6 +6171,7 @@
 \end{itemize}
 
 
+\LMHash{}
 Let $NS_0$ be the exported namespace (\ref{exports}) of $B$. Then, for each combinator clause $C_i, i \in 1..n$ in $I$:
 \begin{itemize}
 \item If $C_i$ is of the form 
@@ -5528,6 +6191,7 @@
 where $hide(l, n)$ takes a list of identfiers $l$ and a namespace $n$, and produces a namespace that is identical to $n$ except that for each name $k$ in $l$, $k$ and $k=$ are undefined. 
 \end{itemize}
  
+\LMHash{}
 Next, if $I$ includes a prefix clause of the form \AS{} $p$, let $NS =  NS_n \cup \{p: prefixObject(NS_n)\}$ where $prefixObject(NS_n)$ is a {\em prefix object} for the namespace $NS_n$, which is an object that has the following members:
 
 \begin{itemize}
@@ -5537,12 +6201,14 @@
 \item For every type $T$ named $id$ in $NS_n$, a corresponding getter named $id$ with return type \code{Type}, that, when invoked, returns the type object for $T$.
 \end{itemize}
 
+\LMHash{}
 Otherwise, let $NS = NS_n$.
 It is a compile-time error if the current library declares a top-level member named $p$.
 
 % This is problematic, because it implies that p.T would be available even in a scope that declared p. We really need to think of p as a single object with properties p.T etc., except it isn't really that
 % either. After all, p isn't actually available as a stand alone name.
 
+\LMHash{}
 Then, for each entry mapping key $k$ to declaration $d$ in $NS$,  $d$ is made available in the top level scope of $L$ under the name $k$ unless either:
 \begin{itemize}
 \item
@@ -5552,6 +6218,7 @@
 
 \rationale{The greatly increases the chance that a member can be added to a library without breaking its importers.}
 
+\LMHash{}
 A {\em system library} is a library that is part of the Dart implementation. Any other library is a {\em non-system library}. If a name $N$ is referenced by a library $L$ and $N$ would be introduced into the top level scope of $L$ by 
 imports of two libraries, $L_1$ and $L_2$, and the exported namespace of $L_1$ binds $N$ to a declaration originating in a system library:
 
@@ -5567,6 +6234,7 @@
 It is recommended that tools that deploy Dart code produce output in which all imports use show clauses to ensure that additions to the namespace of a library never impact deployed code.
 }
 
+\LMHash{}
 If a name $N$ is referenced by a library $L$ and $N$ is  introduced into  the top level scope of $L$ by more than one import, and not all the imports denote the same declaration, then:
 \begin{itemize}
 \item A static warning occurs.
@@ -5575,6 +6243,7 @@
 
 \end{itemize}
 
+\LMHash{}
 We say that the namespace $NS$ {\em has been imported into} $L$.
 
 \commentary{
@@ -5591,6 +6260,7 @@
 %On a related note, the provenance of the conflicting elements is not considered. An  element that is imported via distinct paths may conflict with itself. This avoids variants of the well known "diamond" problem.
 }
 
+\LMHash{}
 It is a static warning to import two different libraries with the same name.
 
 \commentary{
@@ -5602,6 +6272,7 @@
 This prevents situations where removing a name from a library would cause breakage of a client library.
 }
 
+\LMHash{}
 The dart core library \code{dart:core} is implicitly imported into every dart library other than itself via an  import clause of the form
 
 \code{\IMPORT{}  `dart:core';} 
@@ -5617,8 +6288,9 @@
 }
 
 \subsection{Exports}
-\label{exports}
+\LMLabel{exports}
 
+\LMHash{}
 A library $L$ exports a namespace (\ref{scoping}), meaning that the declarations in the namespace are made available to other libraries if they choose to import $L$ (\ref{imports}).  The namespace that $L$ exports is known as its {\em exported namespace}.
 
 \begin{grammar}
@@ -5627,14 +6299,19 @@
     .
  \end{grammar}
  
+\LMHash{}
  An export specifies a URI $x$ where the declaration of an exported library is to be found.  It is a compile-time error if  the specified URI does not refer to a library declaration.  
 
+\LMHash{}
 We say that a name {\em is exported by a library} (or equivalently, that a library {\em exports a name}) if the name is in the library's exported namespace. We say that a declaration {\em is exported by a library} (or equivalently, that a library {\em exports a declaration}) if the declaration is in the library's exported namespace.
 
+\LMHash{}
 A library always exports all names and all declarations in its public namespace. In addition, a library may choose to re-export additional libraries via {\em export directives}, often referred to simply as {\em exports}.
 
+\LMHash{}
 Let $E$ be an export directive that refers to a URI via the string $s_1$. Evaluation of $E$  proceeds as follows:
 
+\LMHash{}
 First,
 
  \begin{itemize}
@@ -5644,6 +6321,7 @@
 \end{itemize}
 
 
+\LMHash{}
 Let $NS_0$ be the exported namespace of $B$. Then, for each combinator clause $C_i, i \in 1..n$ in $E$:
 \begin{itemize}
 \item If $C_i$ is of the form \code{\SHOW{} $id_1, \ldots, id_k$} then let 
@@ -5654,9 +6332,11 @@
 then let $NS_i = \HIDE{}([id_1, \ldots, id_k], NS_{i-1}$). 
 \end{itemize}
 
+\LMHash{}
 For each
 entry mapping key $k$ to declaration $d$ in $NS_n$ an entry mapping $k$ to $d$ is added to the exported namespace of $L$ unless a  top-level declaration with the name $k$ exists in $L$.  
 
+\LMHash{}
 If a name $N$ is referenced by a library $L$ and $N$ would be introduced into the exported namespace of $L$ by exports of two libraries, $L_1$ and $L_2$, and the exported namespace of $L_1$ binds $N$ to a declaration originating in a system library:
 %an export of a system library and an export of a non-system library:
 \begin{itemize}
@@ -5668,17 +6348,21 @@
 See the discussion in section \ref{imports} for the reasoning behind this rule.
 }
 
+\LMHash{}
 We say that $L$ {\em re-exports library } $B$, and also that $L$ {\em re-exports namespace } $NS_n$. When no confusion can arise, we may simply state that $L$ {\em re-exports }$B$, or that $L$ {\em re-exports }$NS_n$.
 
+\LMHash{}
 It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is  introduced into the export namespace of $L$ by more than one export, unless all  exports refer to same declaration for the name $N$.  It is a static warning to export two different libraries with the same name.
 
 
 
 \subsection{Parts}
-\label{parts}
+\LMLabel{parts}
 
+\LMHash{}
 A library may be divided into {\em parts}, each of which can be stored in a separate location. A library identifies its parts by listing them via \PART{} directives. 
 
+\LMHash{}
 A {\em part directive} specifies a URI where a Dart compilation unit that should be incorporated into the current library may be found.
 
 \begin{grammar}
@@ -5694,22 +6378,27 @@
     .
 \end{grammar}
 
+\LMHash{}
 A {\em part header} begins with  \PART{} \OF{}  followed by the name of the library the part belongs to.  A part declaration consists of a part header followed by a sequence of top-level declarations.
 
+\LMHash{}
 Compiling a part directive of the form \code{\PART{} $s$;} causes the Dart system to attempt to compile the contents of the URI that is the value of $s$. The top-level declarations at that URI are then compiled by the Dart compiler in the scope of the current library. It is a compile-time error if the contents of the URI are not a valid part declaration. It is a static warning if the referenced part declaration $p$ names a library other than the current library as the library to which $p$ belongs.
 
 \subsection{Scripts}
-\label{scripts}
+\LMLabel{scripts}
 
+\LMHash{}
 A {\em script} is a library whose exported namespace  (\ref{exports}) includes a top-level function \code{main}. 
 A script $S$ may be executed as follows:
 
+\LMHash{}
 First, $S$ is compiled as a library as specified above. Then, the top-level function \code{main} that is in the exported namespace of $S$ is invoked. If \code{main} has no positional parameters, it is invoked with no arguments. Otherwise if \code{main} has exactly one positional parameter, it is invoked with a single actual argument whose runtime type implements \code{List$<$String$>$}.  Otherwise \code{main} is invoked with the following two actual arguments:
 \begin{enumerate}
 \item An object whose runtime type implements \code{List$<$String$>$}.
 \item The initial message of the current isolate $i$ as determined by the invocation of \code{Isolate.spawnUri} that spawned $i$. 
 \end{enumerate}
 
+\LMHash{}
 It is a run time error if $S$ does not declare or import a top-level function \code{main}. It is a static warning if \code{main} has more than two required parameters.
 
 \commentary {
@@ -5725,8 +6414,9 @@
 }
 
 \subsection{URIs}
-\label{uris}
+\LMLabel{uris}
 
+\LMHash{}
 URIs are specified by means of string literals:
 
 \begin{grammar}
@@ -5735,16 +6425,20 @@
     .
 \end{grammar}
 
+\LMHash{}
 It is a compile-time error if  the string literal $x$ that describes a URI is not a compile-time constant, or if $x$ involves string interpolation.
  
+\LMHash{}
 This specification does not discuss the interpretation of URIs, with the following exceptions. 
  
  \rationale{
  The interpretation of URIs is mostly left to the surrounding computing environment. For example, if Dart is running in a web browser, that browser will likely interpret some URIs. While it might seem attractive to specify, say, that URIs are interpreted with respect to a standard such as IETF RFC 3986, in practice this will usually depend on the browser and cannot be relied upon.
  }
  
+\LMHash{}
 A URI of the form \code{dart:$s$} is interpreted as a reference to a system library (\ref{imports}) $s$. 
  
+\LMHash{}
 A URI of the form \code{package:$s$} is interpreted as a URI of the form \code{packages/s} relative to an implementation specified location.
 
 \commentary{ 
@@ -5755,22 +6449,25 @@
 The intent is that, during development, Dart programmers can rely on a package manager to find elements of their program. Such package managers may provide a directory structure starting at a local directory \code{packages} where they place the required dart code (or links thereto).
 }
 
+\LMHash{}
 Otherwise, any relative URI is interpreted as relative to the the location of the current library. All further interpretation of URIs is implementation dependent. 
 
 \commentary{This means it is dependent on the embedder.}
 
 
 \section{Types}
-\label{types}
+\LMLabel{types}
 
+\LMHash{}
 Dart supports optional typing based on interface types.
 
 \rationale{The type system is unsound, due to the covariance of generic types. This is a deliberate choice (and undoubtedly controversial).  Experience has shown that sound type rules for generics fly in the face of programmer intuition. It is easy for tools to provide a sound type analysis if they choose, which may be useful for tasks like refactoring.
 }
 
 \subsection{Static Types}
-\label{staticTypes}
+\LMLabel{staticTypes}
 
+\LMHash{}
 Static type annotations are used in variable declarations (\ref{variables}) (including formal parameters (\ref{formalParameters})), in the return types of functions (\ref{functions}) and in the bounds of type variables.  Static type annotations are used during static  checking and when running programs in checked mode. They have no effect whatsoever in production mode.
 
  \begin{grammar}
@@ -5791,6 +6488,7 @@
     .
  \end{grammar}
 
+\LMHash{}
 A Dart implementation must provide a static checker that detects and reports exactly those situations this specification identifies as static warnings and only those situations. However:
 \begin{itemize}
 \item Running  the static checker on a program $P$ is not required for compiling and running $P$.  
@@ -5802,6 +6500,7 @@
 
 %\Q{Should we do something with respect to non-nullable types?}
 
+\LMHash{}
 A type $T$ is {\em malformed} iff:
 \begin{itemize}
 \item $T$ has the form $id$ or the form $prefix.id$, and in the enclosing lexical scope, the name $id$ (respectively $prefix.id$) does not denote a type.
@@ -5814,29 +6513,35 @@
 %  \end{itemize}
 \end{itemize}
 
+\LMHash{}
  Any use of a malformed  type gives rise to a static warning. A malformed type is then interpreted as \DYNAMIC{} by the static type checker and the runtime unless explicitly specified otherwise.
   
  \rationale{
 This ensures that the developer is spared a series of cascading warnings as the malformed type interacts with other types.
 }
 
+\LMHash{}
 A type $T$ is {\em deferred} iff it is of the form $p.T$ where $p$ is a deferred prefix.
 It is a static warning to use a deferred type in a type annotation, type test, type cast or as a type parameter. However, all other static warnings must be issued under the assumption that all deferred libraries have successfully been loaded.
 
 
 \subsubsection{Type Promotion}   
-\label{typePromotion}
+\LMLabel{typePromotion}
 
+\LMHash{}
 The static type system ascribes a static type to every expression.  In some cases, the types of local variables and formal parameters may be promoted from their declared types based on control flow. 
 
+\LMHash{}
 We say that a variable $v$ is known to have type $T$ whenever we allow the type of $v$ to be promoted. The exact circumstances when type promotion is allowed are given in the relevant sections of the specification (\ref{logicalBooleanExpressions}, \ref{conditional} and \ref{if}).
 
+\LMHash{}
 Type promotion for a variable $v$ is allowed only when we can deduce that such promotion is valid based on an analysis of certain boolean expressions. In such cases, we say that the boolean expression $b$ shows that $v$ has type $T$. As a rule, for all variables $v$ and types $T$, a boolean expression does not show that $v$ has type $T$. Those situations where an expression does show that a variable has a type are mentioned explicitly in the relevant sections of this specification (\ref{typeTest} and \ref{logicalBooleanExpressions}).
 
 
 \subsection{Dynamic Type System}
-\label{dynamicTypeSystem}
+\LMLabel{dynamicTypeSystem}
 
+\LMHash{}
 A Dart implementation must support execution in both {\em production mode} and {\em checked mode}.  Those dynamic checks specified as occurring specifically in checked mode must be performed iff the code is executed in checked mode.
 
 \commentary{
@@ -5850,6 +6555,7 @@
 
 %It is a run-time type error to access an undeclared type outside .
 
+\LMHash{}
 %It is a dynamic type error if a malformed type is used in a subtype test.  
 In checked mode, it is a dynamic type error if a deferred, malformed or malbounded (\ref{parameterizedTypes}) 
 type is used in a subtype test.  
@@ -5931,11 +6637,12 @@
 
 
 \subsection{Type Declarations}
-\label{typeDeclarations}
+\LMLabel{typeDeclarations}
 
 \subsubsection{Typedef}
-\label{typedef}
+\LMLabel{typedef}
 
+\LMHash{}
 A {\em type alias} declares a name for a type expression.
 
 
@@ -5959,8 +6666,10 @@
     
  \end{grammar}
  
+\LMHash{}
  The effect of a type alias of the form  \code{\TYPEDEF{} $T$ $id (T_1$ $p_1, \ldots, T_n$ $p_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}])$} declared in a library $L$ is is to introduce the name $id$ into the scope of $L$, bound to the function type $(T_1, \ldots, T_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}])  \rightarrow T$.  The effect of a type alias of the form   \code{\TYPEDEF{} $T$ $id (T_1$ $p_1, \ldots, T_n$ $p_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}\})$} declared in a library $L$ is is to introduce the name $id$ into the scope of $L$, bound to the function type $(T_1, \ldots, T_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}\})  \rightarrow T$. . In either case, iff no return type is specified, it is taken to be \DYNAMIC{}. Likewise, if a type annotation is omitted on a formal parameter, it is taken to be \DYNAMIC{}.
  
+\LMHash{}
 It is a compile-time error if any default values are specified in the signature of a function type alias. 
 %A typedef may only refer to itself  via the bounds of its generic parameters. 
 Any  self reference in a typedef, either directly, or recursively via another typedef, is a compile time error.
@@ -5969,8 +6678,9 @@
 
 
 \subsection{Interface Types}
-\label{interfaceTypes}
+\LMLabel{interfaceTypes}
 
+\LMHash{}
 The implicit interface of class $I$ is a direct supertype of the implicit interface of class  $J$ iff:
 \begin{itemize}
 \item
@@ -5993,6 +6703,7 @@
 %\Q{Can wacky stuff happen with interface injection, e.g., a direct superinterface becomes indirect? What about side effects - loading order can affect type relationships.
 %}
 
+\LMHash{}
 A type $T$ is more specific than a type $S$, written $T << S$,  if one of the following conditions is met:
 \begin{itemize}
 \item $T$ is $S$.
@@ -6008,6 +6719,7 @@
 \item $T << U$ and $U << S$.
 \end{itemize}
 
+\LMHash{}
 $<<$ is a partial order on types.
 $T$ is a subtype of $S$, written $T <: S$, iff $[\bot/\DYNAMIC{}]T << S$.
 
@@ -6017,10 +6729,12 @@
 Although $<:$ is not a partial order on types, it does contain a partial order, namely $<<$. This means that, barring raw types, intuition about classical subtype rules does apply.
 }
 
+\LMHash{}
 $S$ is a supertype of $T$, written $S :> T$, iff $T$ is a subtype of $S$.
 
 \commentary{The supertypes of an interface are its direct supertypes and their supertypes. }
 
+\LMHash{}
 An interface type $T$ may be assigned to a type $S$, written  $T \Longleftrightarrow S$, iff either $T <: S$ or $S <: T$. 
 
 \rationale{This rule may surprise readers accustomed to conventional typechecking. The intent of the $\Longleftrightarrow$ relation is not to ensure that an assignment is correct. Instead, it aims to only flag assignments that are almost certain to be erroneous, without precluding assignments that may work. 
@@ -6029,8 +6743,9 @@
 }
 
 \subsection{Function Types}
-\label{functionTypes}
+\LMLabel{functionTypes}
 
+\LMHash{}
 Function types come in two variants: 
 \begin{enumerate}
 \item
@@ -6049,6 +6764,7 @@
 %\item$ \forall i \in 1 .. n, T_i \Longleftrightarrow S_i$.
 %\end{enumerate}
 
+\LMHash{}
 %A function type $(T_1, \ldots T_n, [T_{n+1}  \ldots, T_{n+k}]) \rightarrow T$ is a subtype of the 
 % the line below revises the rule to be more liberal
 A function type $(T_1, \ldots T_{k}, [T_{k+1}  \ldots, T_{n+m}]) \rightarrow T$ is a subtype of the
@@ -6063,6 +6779,7 @@
 \end{enumerate}
 
 
+\LMHash{}
 A function type $(T_1, \ldots T_n, \{T_{x_1}$ $x_1, \ldots, T_{x_k}$ $x_k\}) \rightarrow T$ is a subtype of the function type $(S_1, \ldots, S_n, \{S_{y_1}$ $y_1, \ldots, S_{y_m}$ $y_m\}) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
 \item Either
@@ -6085,6 +6802,7 @@
 %The rules above need to be sanity checked, but the intent is that we view functions with rest parameters as having type $(T_1, ..., T_n, [\_{Tn+1}[] \_]) \rightarrow T$, where \_ is some magical identifier. Then the rules above may cover everything.
 % This is wrong - from the outside, the type takes an unbounded sequence of types, not a list. This can be modeled as $(T_1, \ldots, T_n, [T_{n+1}, \_ \ldots, T_{n+k} \_]) \rightarrow T$ for some finite $k$. 
 
+\LMHash{}
 In addition, the following subtype rules apply:
 
 
@@ -6100,8 +6818,10 @@
 The naive reader might conclude that, since it is not legal to declare a function with an empty optional parameter list, these rules are pointless. However, they induce  useful relationships between function types that declare no optional parameters and those that do.
 }
 
+\LMHash{}
 A function type $T$ may be assigned to a function type $S$, written  $T \Longleftrightarrow S$, iff  $T <: S$. 
 
+\LMHash{}
 % ensure that Object  and dynamic may be assign dot a function type
 A function is always an instance of some class that implements the class \code{Function} and implements a \CALL{} method with the same signature as the function. All function types are subtypes of \code{Function}.
 If a type $I$ includes an instance method named \CALL{}, and the type of \CALL{} is the function type $F$, then $I$ is considered to be more specific than $F$.  It is a static warning if a concrete class implements \cd{Function} and does not have a concrete method named \CALL{} unless that class declares its own implementation of \cd{noSuchMethod()}.
@@ -6111,6 +6831,7 @@
 
 %\commentary{Need to specify how a function values dynamic type is derived from its static signature.}
 
+\LMHash{}
 A function type $(T_1, \ldots T_{k}, [T_{k+1}  \ldots, T_{n+m}]) \rightarrow T$ is a more specific than the
 function type $(S_1, \ldots, S_{k+j}, [S_{k+j+1} \ldots, S_{n}]) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
@@ -6123,6 +6844,7 @@
 \end{enumerate}
 
 
+\LMHash{}
 A function type $(T_1, \ldots T_n, \{T_{x_1}$ $x_1, \ldots, T_{x_k}$ $x_k\}) \rightarrow T$ is more specific than the function type $(S_1, \ldots, S_n, \{S_{y_1}$ $y_1, \ldots, S_{y_m}$ $y_m\}) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
 \item Either
@@ -6136,19 +6858,23 @@
 \item For all $y_i \in \{y_1,  \ldots, y_m\}, y_i = x_j \Rightarrow T_j << S_i$
 \end{enumerate}
 
+\LMHash{}
 Furthermore, if $F$ is a function type, $F << \code{Function}$.
 
 
 \subsection{Type \DYNAMIC{}}
-\label{typeDynamic}
+\LMLabel{typeDynamic}
 
+\LMHash{}
 The type  \DYNAMIC{}  denotes the unknown type. 
 
+\LMHash{}
 If no static type annotation has been provided the type system assumes the declaration has the unknown type. If a generic type is used but type arguments are not provided, then the  type arguments default to the unknown type.
 
 \commentary{This means that given a generic declaration $G<T_1, \ldots, T_n>$, the type $G$ is equivalent to $G< \DYNAMIC{},  \ldots,  \DYNAMIC{}>$.
 }
 
+\LMHash{}
 Type  \DYNAMIC{} has methods for every possible identifier and arity, with every possible combination of named parameters. These methods all have  \DYNAMIC{} as their return type, and their formal parameters all have type  \DYNAMIC{}.
 Type  \DYNAMIC{} has properties for every possible identifier. These properties all have type  \DYNAMIC{}.
 
@@ -6171,6 +6897,7 @@
 What of static checking? Surely we would want to flag (2) when users have explicitly asked for static typechecking? Yes, but the reality is that the Dart static checker is likely to be running in the background by default. Engineering teams typically desire a ``clean build'' free of warnings and so the checker is designed to be extremely charitable. Other tools can interpret the type information more aggressively and warn about violations of conventional (and sound) static type discipline.
 }
 
+\LMHash{}
 The name \DYNAMIC{} denotes a \cd{Type} object even though \DYNAMIC{} is not a class.
 
 %\rationale {
@@ -6178,8 +6905,9 @@
 %}
 
 \subsection{Type Void}
-\label{typeVoid}
+\LMLabel{typeVoid}
 
+\LMHash{}
 The special type \VOID{} may only be used as the return type of a function: it is a compile-time error to use \VOID{} in any other context. 
 
 \commentary{
@@ -6214,15 +6942,18 @@
 
 
 \subsection{Parameterized Types}
-\label{parameterizedTypes} 
+\LMLabel{parameterizedTypes} 
 
+\LMHash{}
 A {\em parameterized type} is an invocation of a generic type declaration.
 
+\LMHash{}
 Let $T$ be a parameterized type  $G<S_1,  \ldots, S_n>$. If $G$ is not a generic type, the type arguments $S_i$, $1 \le i \le n$ are discarded. If $G$ has $m \ne n$ type parameters, $T$ is treated as as a parameterized type with $m$ arguments, all of which are \DYNAMIC{}. 
 
 \commentary{In short, any arity mismatch results in all type arguments being dropped, and replaced with the correct number of type arguments, all set to \DYNAMIC{}. Of course, a static warning will be issued. 
 }
 
+\LMHash{}
 Otherwise, let
  $T_i$ be the type parameters of $G$ and let $B_i$ be the bound of $T_i,  i \in 1.. n$,. $T$ is {\em malbounded} iff either $S_i$ is malbounded  or $S_i$ is not a subtype of $[S_1,  \ldots, S_n/T_1, \ldots, T_n]B_i,   i \in 1.. n$. 
  
@@ -6230,8 +6961,10 @@
 Note, that, in checked mode, it is a dynamic type error if a malbounded type is used in a type test as specified in \ref{dynamicTypeSystem}.
 }
  
+\LMHash{}
 Any use of a malbounded type gives rise to a static warning.
 
+\LMHash{}
 If $S$ is the static type of a member $m$ of $G$, then the static type of the member $m$ of  $G<A_1, \ldots, A_n>$  is $[A_1,  \ldots, A_n/T_1,  \ldots, T_n]S$ where $T_1,  \ldots, T_n$ are the formal type parameters of $G$.   Let $B_i$, be the bounds of $T_i, 1 \le i \le n$. It is a static type warning if $A_i$ is not a subtype of  $[A_1,  \ldots, A_n/T_1,  \ldots, T_n]B_i, i \in 1..n$. It is a static type warning if $G$ is not a generic type with exactly $n$ type parameters.
 
 
@@ -6239,14 +6972,16 @@
 
 
 \subsubsection{Actual Type of Declaration}
-\label{actualTypeOfADeclaration}
+\LMLabel{actualTypeOfADeclaration}
 
+\LMHash{}
 A type $T$ {\em depends on a type parameter} $U$ iff:
 \begin{itemize}
 \item $T$ is $U$.
 \item $T$ is a parameterized type, and one of the type arguments of $T$ depends on $U$.
 \end{itemize}
 
+\LMHash{}
 Let $T$ be the declared type of a declaration $d$, as it appears in the program source. The {\em actual type} of $d$ is
 
 \begin{itemize}
@@ -6255,20 +6990,24 @@
 \end{itemize}
 
 \subsubsection{Least Upper Bounds}
-\label{leastUpperBounds}
+\LMLabel{leastUpperBounds}
 
+\LMHash{}
 % does this diverge in some cases?
 Given two interfaces $I$ and $J$, let $S_I$ be the set of superinterfaces of $I$,  let $S_J$ be the set of superinterfaces of $J$ and let $S =  (I \cup S_I) \cap (J \cup S_J)$.  Furthermore, we define $S_n = \{T | T \in S  \wedge depth(T) =n\}$ for any finite $n$ %, and $k=max(depth(T_1), \ldots, depth(T_m)), T_i \in S, i \in 1..m$, 
 where $depth(T)$ is the number of steps in the longest inheritance path from $T$ to \code{Object}. Let $q$ be the largest number such that $S_q$ has cardinality one. The least upper bound of $I$ and $J$ is the sole element of  $S_q$.
 
+\LMHash{}
 The least upper bound of \DYNAMIC{} and any type $T$ is \DYNAMIC{}.
 The least upper bound of \VOID{} and any type $T \ne \DYNAMIC{}$ is \VOID{}.
 Let $U$ be a type variable with upper bound $B$. The least upper bound of $U$ and a type $T$ is the least upper bound of $B$ and $T$. 
 
+\LMHash{}
 The least upper bound relation is symmetric and reflexive.
 
 % Function types
 
+\LMHash{}
 The least upper bound of a function type and an interface type $T$ is the least upper bound of \cd{Function} and $T$.
 Let $F$ and $G$ be function types. If $F$ and $G$ differ in their number of required parameters, then the least upper bound of $F$ and $G$ is \cd{Function}.  Otherwise:
 \begin{itemize}
@@ -6311,16 +7050,18 @@
 
 
 \section{Reference}
-\label{reference}
+\LMLabel{reference}
 
 \subsection{Lexical Rules}
-\label{lexicalRules}
+\LMLabel{lexicalRules}
 
+\LMHash{}
 Dart source text is represented as a sequence of Unicode code points.  This sequence is first converted into a sequence of tokens according to the lexical rules given in this specification.  At any point in the tokenization process, the longest possible token is recognized.
 
 \subsubsection{Reserved Words} 
-\label{reservedWords}
+\LMLabel{reservedWords}
 
+\LMHash{}
 A {\em reserved word} may not be used as an identifier; it is a compile-time error if a reserved word is used where an identifier is expected.
 
 \ASSERT{}, \BREAK{}, \CASE{}, \CATCH{}, \CLASS{}, \CONST{}, \CONTINUE{}, \DEFAULT{}, \DO{}, \ELSE{}, \ENUM{}, \EXTENDS{}, \FALSE{}, \FINAL{}, \FINALLY{}, \FOR{}, \IF{}, \IN{}, \IS{}, \NEW{}, \NULL{}, \RETHROW, \RETURN{}, \SUPER{}, \SWITCH{}, \THIS{}, \THROW{}, \TRUE{}, \TRY{}, \VAR{}, \VOID{}, \WHILE{}, \WITH{}.
@@ -6344,8 +7085,9 @@
 \end{grammar}
 
 \subsubsection{Comments}
-\label{comments}
+\LMLabel{comments}
 
+\LMHash{}
 {\em Comments} are sections of program text that are used for documentation.
 
 \begin{grammar}{\bf SINGLE\_LINE\_COMMENT:}
@@ -6357,16 +7099,22 @@
     .
  \end{grammar}
   
+\LMHash{}
 Dart supports both single-line and multi-line comments. A {\em single line comment} begins with the token \code{//}. Everything between \code{//} and the end of line must be ignored by the Dart compiler unless the comment is a documentation comment. . 
 
+\LMHash{}
 A {\em multi-line comment} begins with the token \code{/*} and ends with the token \code{*/}.  Everything between \code{/}* and \code{*}/ must be ignored by the Dart compiler unless the comment is a documentation comment. Comments may nest. 
 
+\LMHash{}
 {\em Documentation comments} are comments that begin with the tokens  \code{///} or  \code{/**}. Documentation comments are intended to be processed by a tool that produces human readable documentation. 
 
+\LMHash{}
 The scope of a documentation comment  always excludes the imported namespace of the enclosing library. Only names declared in the enclosing library are considered in scope within a documentation comment.
 
+\LMHash{}
 The scope of a documentation comment immediately preceding the declaration of a class $C$ is the instance scope of $C$, excluding any names introduced via the import namespace of the enclosing library.
 
+\LMHash{}
 The scope of a documentation comment immediately preceding the declaration of a function $f$  is the  scope in force at the very beginning of the body of $f$,  excluding any names introduced via the import namespace of the enclosing library.
 
 
@@ -6374,9 +7122,11 @@
 
 
 %\subsection{Grammar}
+%\LMLabel{grammar}
 \subsection{Operator Precedence}
-\label{operatorPrecedence}
+\LMLabel{operatorPrecedence}
 
+\LMHash{}
 Operator precedence is given implicitly by the grammar.
 
 \commentary{The following non-normative table may be helpful
@@ -6419,10 +7169,12 @@
 \end{tabular}
 }
 %\subsection{Glossary}
+%\LMLabel{glossary}
 
 %\bibliographystyle{alpha}
 %\bibliography{/users/gilad/research/bibs/master}
 \section*{Appendix: Naming Conventions}
+\LMLabel{namingConventions}
 
 \commentary{
 The following naming conventions are customary in Dart programs. 
@@ -6437,3 +7189,156 @@
 
 
 \end{document}
+
+[Text after \end{document} is ignored, hence we do not need "%"]
+----------------------------------------------------------------------
+
+* On Location Markers
+
+This is a description of location markers, giving some information
+about the underlying motivation and rationale, the actual
+implementation, and the relevant tool support.
+
+** What is a Location Marker?
+
+In order to support more fine-grained update propagation from this
+language specification to artifacts that depend on it, location
+markers have been added.  The idea is that each logical unit (section,
+subsection, etc) and each paragraph containing normative text should
+be addressable using these markers, such that source code (compilers
+and other tools, tests, etc.) can contain location markers, and the
+corresponding location in the spec may be looked up using standard
+document viewer search features.
+
+An SHA1 hash value of the text is associated with each location
+marker, such that changes in the text will incur changes in this hash
+value.  Consequently, source code in tools/tests that depend on
+specific parts of the spec may be flagged for revision by checking
+whether these hash values have changed:  If a given test T depends on
+a paragraph with hash value V in the spec, and the search for V fails
+in a new version of the spec, then that paragraph has changed and T
+should be revisited and possible revised.
+
+As a result, the search for parts of source code and similar artifacts
+in likely need of updates because of spec changes can be performed
+mechanically, which should help ensure that the conformance of all
+artifacts depending on this spec is maintained more easily, and hence
+more consistently.  Note that it makes no difference whether the need
+for an update has arisen in a very recent version of the spec or it
+has existed for a long time, because the hash value just remains
+different as long as the text is different from what it was when the
+location marker was harvested from the spec.
+
+** LaTeX Commands Supporting Location Markers
+
+Concretely, this is based on the commands \LMHash and \LMLabel.
+\LMHash{V} is used to add the text V in the margin, intended to mark
+a paragraph of normative text with the SHA1 hash value of the text, V.
+\LMLabel{L} has the effect of \label{L}, and moreover it shows the
+text sec:L in the margin.  In order to indicate a dependency on a
+section or subsection an \LMLabel location marker is used, and in
+order to indicate a dependency on a specific paragraph, the hash value
+of that paragraph is used.
+
+In this file, each normative paragraph has had the command \LMHash{}
+added at the beginning, such that each of these paragraphs can be
+decorated with their hash value.  Similarly, all \section{}s,
+\subsection{}s, \subsubsection{}s, and \paragraph{}s have had
+their \label commands changed to \LMLabel, such that they are
+decorated with logical names.
+
+** Rationale
+
+The design of location markers was proposed by Erik Ernst and
+developed through discussions with several others, in particular Gilad
+Bracha and Lars Bak.  Some discussions along the way that gave rise to
+the given design are outlined below.
+
+The basic idea is that a hash value based on the actual text will
+serve well to identify a piece of text, because it will change
+whenever the text changes, and it remains the same if the text is
+moved to a different location; in other words, it characterizes the
+text itself, independently of the rest of the document.  Hence:
+
+  - references to specific paragraphs in the spec are easy to create:
+    copy the marker and paste it into the source code (but see below
+    why this uses an extra indirection as far as possible)
+
+  - such references would be robust in the sense that they depend on
+    the actual text alone, i.e., they would not be invalidated by
+    updates to section numbers, relocation of the paragraph, or
+    updates to text in different paragraphs; as Lars mentioned, we
+    should use a "stripped" version of the text, removing comments,
+    normalizing white space, etc., which would make the refs even more
+    robust in case of "inessential" changes
+
+  - artifacts depending on a given part of the spec that was
+    changed could easily be pointed out: After an update to a
+    part of the spec, that artifact would hold a marker associated
+    with a hash value which does not any more occur in the spec,
+    maintainers of the artifact would then receive a notification
+    ("test1773 depends on a part of the spec that was updated").
+    Nice tool support would show them the paragraph in the most recent
+    version of the spec as well as the old version that the artifact
+    used to depend on, and a comparison of the two would help
+    clarifying what needs fixing because of this change, if anything.
+
+However, there is a conflict in this scenario:  Lars pointed out that
+it is very inconvenient to have to create a lot of revision control
+commits (e.g., new versions of tests), just because a large number of
+artifacts depend on a specific hash value that changed, if that change
+has no real impact on each of those artifacts.  The obvious solution
+to this problem would be to use symbolic names and keep the actual
+hash values out of the primary artifacts.
+
+This approach has been used for \section{}s, \subsection{}s, etc., by
+using their labels as location markers.  For instance, dependency on
+\subsubsection{New} would be marked as a dependency on 'sec:new',
+which will (most likely) exist with the same label in the spec for a
+long time.  To detect a need for updates, the hash value associated
+with \subsubsection{New} from the date of the latest check of this
+kind to the dependent artifact should be compared with the current
+hash value for the same \subsubsection{}:  The artifact should be
+revisited iff those hash values differ.  As an easy approximation to
+this scheme, the hash values for all location markers would be
+computed for each spec update, and the location markers that have new
+hash values should cause revisits to all artifacts depending on that
+location marker.
+
+The symbolic location markers on larger units like \section{}
+etc. enable location marking in a hierarchical fashion: Dependencies
+on a \subsubsection{} or on a \section{} can be chosen according to
+the actual needs with each dependent artifact.  In general, fine
+granularity helps avoiding false positives, where an update somewhere
+in a large unit will flag too many dependent artifacts for revisits.
+In contrast, coarse granularity enables other artifacts to declare the
+actual dependencies when small units would be impractical because the
+artifact depends on so many of them.  But there is a problem at the
+bottom of this hierarchy, namely with paragraphs.
+
+It would be very inconvenient to have to invent a logical name for
+every paragraph.  Similarly, using a simple paragraph numbering would
+be unstable (add one new paragraph in the beginning of a section, and
+all the rest have new numbers, creating a massive flood of false
+update alerts, or, even worse, corrupting the declared dependencies in
+artifacts because they point to the wrong paragraphs).
+
+Hence, paragraphs have no other label than their actual hash value.
+Artifacts that depend on very specific elements in the spec may
+declare so by using an actual hash value for a given paragraph, and in
+return they pay in terms of potential updates to the marker when that
+paragraph changes, even in cases where the actual change makes no
+difference for that particular artifact.  This choice of granularity
+vs. stability is up to the creator of each artifact.
+
+** Maintenance of this document
+
+The invariant that each normative paragraph is associated with a line
+containing the text \LMHash{} should be maintained.  Extra occurrences
+of \LMHash{} can be added if needed, e.g., in order to make
+individual \item{}s in itemized lists addressable.  Each \LM.. command
+must occur on a separate line.  \LMHash{} must occur immediately
+before the associated paragraph, and \LMLabel must occur immediately
+after the associated \section{}, \subsection{} etc.
+
+----------------------------------------------------------------------
diff --git a/pkg/analysis_server/bin/dartdeps.dart b/pkg/analysis_server/bin/dartdeps.dart
index c0eaad4..8b6ad68 100644
--- a/pkg/analysis_server/bin/dartdeps.dart
+++ b/pkg/analysis_server/bin/dartdeps.dart
@@ -5,21 +5,20 @@
 import 'dart:async';
 import 'dart:io';
 
-import 'package:args/args.dart';
 import 'package:analysis_server/src/analysis_manager.dart';
+import 'package:args/args.dart';
 
 /**
  * Start analysis server as a separate process and use the websocket protocol
  * to analyze the application specified on the command line.
  */
 void main(List<String> args) {
-  new _DartDependencyAnalyzer(args).run()
-      .catchError((error, stack) {
-        print('Analysis failed: $error');
-        if (stack != null) {
-          print(stack);
-        }
-      });
+  new _DartDependencyAnalyzer(args).run().catchError((error, stack) {
+    print('Analysis failed: $error');
+    if (stack != null) {
+      print(stack);
+    }
+  });
 }
 
 /**
@@ -65,6 +64,27 @@
   _DartDependencyAnalyzer(this.args);
 
   /**
+   * Use the given manager to perform the analysis.
+   */
+  void analyze(AnalysisManager manager) {
+    if (manager == null) {
+      return;
+    }
+    this.manager = manager;
+    print('Analyzing...');
+  }
+
+  /**
+   * Print information about how to use the server.
+   */
+  void printUsage(ArgParser parser) {
+    print('Usage: $BINARY_NAME [flags] <application_directory>');
+    print('');
+    print('Supported flags are:');
+    print(parser.usage);
+  }
+
+  /**
    * Parse the command line arguments to determine the application to be
    * analyzed, then launch and manage an analysis server to do the work.
    */
@@ -79,10 +99,9 @@
    */
   Future<AnalysisManager> start() {
     ArgParser parser = new ArgParser();
-    parser.addOption(
-        DART_SDK_OPTION,
-        help: '[sdkPath] path to Dart SDK');
-    parser.addFlag(HELP_OPTION,
+    parser.addOption(DART_SDK_OPTION, help: '[sdkPath] path to Dart SDK');
+    parser.addFlag(
+        HELP_OPTION,
         help: 'print this help message without starting analysis',
         defaultsTo: false,
         negatable: false);
@@ -94,7 +113,7 @@
     ArgResults results;
     try {
       results = parser.parse(args);
-    } on FormatException catch(e) {
+    } on FormatException catch (e) {
       print(e.message);
       print('');
       printUsage(parser);
@@ -154,17 +173,6 @@
   }
 
   /**
-   * Use the given manager to perform the analysis.
-   */
-  void analyze(AnalysisManager manager) {
-    if (manager == null) {
-      return;
-    }
-    this.manager = manager;
-    print('Analyzing...');
-  }
-
-  /**
    * Stop the analysis server.
    */
   void stop() {
@@ -172,14 +180,4 @@
       manager.stop();
     }
   }
-
-  /**
-   * Print information about how to use the server.
-   */
-  void printUsage(ArgParser parser) {
-    print('Usage: $BINARY_NAME [flags] <application_directory>');
-    print('');
-    print('Supported flags are:');
-    print(parser.usage);
-  }
 }
diff --git a/pkg/analysis_server/bin/fuzz.dart b/pkg/analysis_server/bin/fuzz.dart
index 2ca29c2..49bdd1d 100644
--- a/pkg/analysis_server/bin/fuzz.dart
+++ b/pkg/analysis_server/bin/fuzz.dart
@@ -143,7 +143,8 @@
           expect(list, isNotNull);
           expect(list.length, equals(0));
           list.forEach((CompletionResults results) {
-            print('${results.elapsed} received ${results.suggestionCount} suggestions');
+            print(
+                '${results.elapsed} received ${results.suggestionCount} suggestions');
           });
           return editor;
         });
@@ -154,11 +155,11 @@
     });
   }
 
-  void _printAnalysisSummary(AnalysisResults results) {
-    print(
-        'Found ${results.errorCount} errors, ${results.warningCount} warnings,'
-            ' and ${results.hintCount} hints in $results.elapsed');
-  }
+//  void _printAnalysisSummary(AnalysisResults results) {
+//    print(
+//        'Found ${results.errorCount} errors, ${results.warningCount} warnings,'
+//            ' and ${results.hintCount} hints in $results.elapsed');
+//  }
 
   /// Print information about how to use the server.
   void _printUsage(ArgParser parser) {
diff --git a/pkg/analysis_server/bin/fuzz/server_manager.dart b/pkg/analysis_server/bin/fuzz/server_manager.dart
index 59c1b03..e9dcf24 100644
--- a/pkg/analysis_server/bin/fuzz/server_manager.dart
+++ b/pkg/analysis_server/bin/fuzz/server_manager.dart
@@ -195,8 +195,9 @@
   Future<AnalysisResults> analyze(Directory appDir) {
     this.appDir = appDir;
     Stopwatch stopwatch = new Stopwatch()..start();
-    Request request =
-        new AnalysisSetAnalysisRootsParams([appDir.path], []).toRequest(_nextRequestId);
+    Request request = new AnalysisSetAnalysisRootsParams(
+        [appDir.path],
+        []).toRequest(_nextRequestId);
 
     // Request analysis
     return channel.sendRequest(request).then((Response response) {
@@ -275,8 +276,8 @@
    * Return when the server has acknowledged that request.
    */
   Future setSubscriptions() {
-    Request request =
-        new ServerSetSubscriptionsParams([ServerService.STATUS]).toRequest(_nextRequestId);
+    Request request = new ServerSetSubscriptionsParams(
+        [ServerService.STATUS]).toRequest(_nextRequestId);
     return channel.sendRequest(request);
   }
 
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
index 597dc19..74f1dcd 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/driver.dart
@@ -8,6 +8,7 @@
 import 'dart:io';
 
 import 'package:analysis_server/http_server.dart';
+import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analysis_server/stdio_server.dart';
 import 'package:analyzer/src/generated/java_io.dart';
@@ -24,7 +25,13 @@
   /**
    * The name of the application that is used to start a server.
    */
-  static const BINARY_NAME = 'server';
+  static const BINARY_NAME = "server";
+
+  /**
+   * The name of the option used to enable incremental resolution.
+   */
+  static const String ENABLE_INCREMENTAL_RESOLUTION =
+      "enable-incremental-resolution";
 
   /**
    * The name of the option used to enable instrumentation.
@@ -40,7 +47,15 @@
    * The name of the option used to specify the log file to which
    * instrumentation data is to be written.
    */
-  static const String INSTRUMENTATION_LOG_FILE_OPTION = "instrumentation-log-file";
+  static const String INSTRUMENTATION_LOG_FILE_OPTION =
+      "instrumentation-log-file";
+
+  /**
+   * The name of the option used to specify if [print] should print to the
+   * console instead of being intercepted.
+   */
+  static const String INTERNAL_PRINT_TO_CONSOLE =
+      "internal-print-to-console";
 
   /**
    * The name of the option used to specify the port to which the server will
@@ -53,7 +68,12 @@
    * TODO(paulberry): get rid of this once the 'analysis.updateSdks' request is
    * operational.
    */
-  static const String SDK_OPTION = 'sdk';
+  static const String SDK_OPTION = "sdk";
+
+  /**
+   * The name of the option used to disable error notifications.
+   */
+  static const String NO_ERROR_NOTIFICATION = "no-error-notification";
 
   SocketServer socketServer;
 
@@ -61,28 +81,45 @@
 
   StdioAnalysisServer stdioServer;
 
-  Driver() {
-  }
-
+  Driver();
   /**
    * Use the given command-line arguments to start this server.
    */
   void start(List<String> args) {
     ArgParser parser = new ArgParser();
-    parser.addFlag(ENABLE_INSTRUMENTATION_OPTION,
+    parser.addFlag(
+        ENABLE_INCREMENTAL_RESOLUTION,
+        help: "enable using incremental resolution",
+        defaultsTo: false,
+        negatable: false);
+    parser.addFlag(
+        ENABLE_INSTRUMENTATION_OPTION,
         help: "enable sending instrumentation information to a server",
         defaultsTo: false,
         negatable: false);
-    parser.addFlag(HELP_OPTION,
+    parser.addFlag(
+        HELP_OPTION,
         help: "print this help message without starting a server",
         defaultsTo: false,
         negatable: false);
-    parser.addOption(INSTRUMENTATION_LOG_FILE_OPTION,
+    parser.addOption(
+        INSTRUMENTATION_LOG_FILE_OPTION,
         help: "[path] the file to which instrumentation data will be logged");
-    parser.addOption(PORT_OPTION,
+    parser.addFlag(
+        INTERNAL_PRINT_TO_CONSOLE,
+        help: "enable sending `print` output to the console",
+        defaultsTo: false,
+        negatable: false);
+    parser.addOption(
+        PORT_OPTION,
         help: "[port] the port on which the server will listen");
-    parser.addOption(SDK_OPTION,
-        help: "[path] the path to the sdk");
+    parser.addOption(SDK_OPTION, help: "[path] the path to the sdk");
+    parser.addFlag(
+        NO_ERROR_NOTIFICATION,
+        help:
+            "disable sending all analysis error notifications to the server (not yet implemented)",
+        defaultsTo: false,
+        negatable: false);
 
     ArgResults results = parser.parse(args);
     if (results[HELP_OPTION]) {
@@ -91,11 +128,14 @@
     }
     if (results[ENABLE_INSTRUMENTATION_OPTION]) {
       if (results[INSTRUMENTATION_LOG_FILE_OPTION] != null) {
-        // TODO(brianwilkerson) Initialize the instrumentation system with logging.
+        // TODO(brianwilkerson) Initialize the instrumentation system with
+        // logging.
       } else {
-        // TODO(brianwilkerson) Initialize the instrumentation system without logging.
+        // TODO(brianwilkerson) Initialize the instrumentation system without
+        // logging.
       }
     }
+
     int port;
     bool serve_http = false;
     if (results[PORT_OPTION] != null) {
@@ -110,6 +150,11 @@
         return;
       }
     }
+
+    AnalysisServerOptions analysisServerOptions = new AnalysisServerOptions();
+    analysisServerOptions.enableIncrementalResolution =
+        results[ENABLE_INCREMENTAL_RESOLUTION];
+
     DartSdk defaultSdk;
     if (results[SDK_OPTION] != null) {
       defaultSdk = new DirectoryBasedDartSdk(new JavaFile(results[SDK_OPTION]));
@@ -119,21 +164,31 @@
       defaultSdk = DirectoryBasedDartSdk.defaultSdk;
     }
 
-    socketServer = new SocketServer(defaultSdk);
+    socketServer = new SocketServer(analysisServerOptions, defaultSdk);
     httpServer = new HttpAnalysisServer(socketServer);
     stdioServer = new StdioAnalysisServer(socketServer);
 
     if (serve_http) {
       httpServer.serveHttp(port);
     }
-    _capturePrints(() {
+
+    if (results[INTERNAL_PRINT_TO_CONSOLE]) {
       stdioServer.serveStdio().then((_) {
         if (serve_http) {
           httpServer.close();
         }
         exit(0);
       });
-    }, httpServer.recordPrint);
+    } else {
+      _capturePrints(() {
+        stdioServer.serveStdio().then((_) {
+          if (serve_http) {
+            httpServer.close();
+          }
+          exit(0);
+        });
+      }, httpServer.recordPrint);
+    }
   }
 
   /**
@@ -141,8 +196,8 @@
    * the function [printHandler].
    */
   dynamic _capturePrints(dynamic callback(), void printHandler(String line)) {
-    ZoneSpecification zoneSpecification = new ZoneSpecification(print:
-        (Zone self, ZoneDelegate parent, Zone zone, String line) {
+    ZoneSpecification zoneSpecification = new ZoneSpecification(
+        print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
       printHandler(line);
       // Note: we don't pass the line on to stdout, because that is reserved
       // for communication to the client.
diff --git a/pkg/analysis_server/lib/http_server.dart b/pkg/analysis_server/lib/http_server.dart
index ef22a81..4d8780f 100644
--- a/pkg/analysis_server/lib/http_server.dart
+++ b/pkg/analysis_server/lib/http_server.dart
@@ -34,11 +34,6 @@
   GetHandler getHandler;
 
   /**
-   * Initialize a newly created HTTP server.
-   */
-  HttpAnalysisServer(this.socketServer);
-
-  /**
    * Future that is completed with the HTTP server once it is running.
    */
   Future<HttpServer> _server;
@@ -49,6 +44,47 @@
   List<String> _printBuffer = <String>[];
 
   /**
+   * Initialize a newly created HTTP server.
+   */
+  HttpAnalysisServer(this.socketServer);
+
+  void close() {
+    _server.then((HttpServer server) {
+      server.close();
+    });
+  }
+
+  /**
+   * Record that the given line was printed out by the analysis server.
+   */
+  void recordPrint(String line) {
+    _printBuffer.add(line);
+    if (_printBuffer.length > MAX_PRINT_BUFFER_LENGTH) {
+      _printBuffer.removeRange(
+          0,
+          _printBuffer.length - MAX_PRINT_BUFFER_LENGTH);
+    }
+  }
+
+  /**
+   * Begin serving HTTP requests over the given port.
+   */
+  void serveHttp(int port) {
+    _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
+    _server.then(_handleServer);
+  }
+
+  /**
+   * Handle a GET request received by the HTTP server.
+   */
+  void _handleGetRequest(HttpRequest request) {
+    if (getHandler == null) {
+      getHandler = new GetHandler(socketServer, _printBuffer);
+    }
+    getHandler.handleGetRequest(request);
+  }
+
+  /**
    * Attach a listener to a newly created HTTP server.
    */
   void _handleServer(HttpServer httServer) {
@@ -67,16 +103,6 @@
   }
 
   /**
-   * Handle a GET request received by the HTTP server.
-   */
-  void _handleGetRequest(HttpRequest request) {
-    if (getHandler == null) {
-      getHandler = new GetHandler(socketServer, _printBuffer);
-    }
-    getHandler.handleGetRequest(request);
-  }
-
-  /**
    * Handle an UPGRADE request received by the HTTP server by creating and
    * running an analysis server on a [WebSocket]-based communication channel.
    */
@@ -95,29 +121,4 @@
     response.write('Not found');
     response.close();
   }
-
-  /**
-   * Begin serving HTTP requests over the given port.
-   */
-  void serveHttp(int port) {
-    _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
-    _server.then(_handleServer);
-  }
-
-  void close() {
-    _server.then((HttpServer server) {
-      server.close();
-    });
-  }
-
-  /**
-   * Record that the given line was printed out by the analysis server.
-   */
-  void recordPrint(String line) {
-    _printBuffer.add(line);
-    if (_printBuffer.length > MAX_PRINT_BUFFER_LENGTH) {
-      _printBuffer.removeRange(0,
-          _printBuffer.length - MAX_PRINT_BUFFER_LENGTH);
-    }
-  }
 }
diff --git a/pkg/analysis_server/lib/src/analysis_logger.dart b/pkg/analysis_server/lib/src/analysis_logger.dart
index 477fb37..32a9417 100644
--- a/pkg/analysis_server/lib/src/analysis_logger.dart
+++ b/pkg/analysis_server/lib/src/analysis_logger.dart
@@ -5,8 +5,8 @@
 library analysis.logger;
 
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:logging/logging.dart' as logging;
 import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:logging/logging.dart' as logging;
 
 /**
  * Instances of the class [AnalysisLogger] translate from the analysis engine's
diff --git a/pkg/analysis_server/lib/src/analysis_manager.dart b/pkg/analysis_server/lib/src/analysis_manager.dart
index 22892b8..d9c00926 100644
--- a/pkg/analysis_server/lib/src/analysis_manager.dart
+++ b/pkg/analysis_server/lib/src/analysis_manager.dart
@@ -30,19 +30,31 @@
   ClientCommunicationChannel channel;
 
   /**
-   * Launch analysis server in a separate process
-   * and return a future with a manager for that analysis server.
+   * Stop the analysis server.
+   *
+   * Returns `true` if the signal is successfully sent and process terminates.
+   * Otherwise there was no attached process or the signal could not be sent,
+   * usually meaning that the process is already dead.
    */
-  static Future<AnalysisManager> start(String serverPath) {
-    return new AnalysisManager()._launchServer(serverPath);
-  }
-
-  /**
-   * Open a connection to a running analysis server
-   * and return a future with a manager for that analysis server.
-   */
-  static Future<AnalysisManager> connect(String serverUrl) {
-    return new AnalysisManager()._openConnection(serverUrl);
+  Future<bool> stop() {
+    if (process == null) {
+      return channel.close().then((_) => false);
+    }
+    return channel.sendRequest(
+        new ServerShutdownParams().toRequest(
+            '0')).timeout(new Duration(seconds: 2), onTimeout: () {
+      print('Expected shutdown response');
+    }).then((Response response) {
+      return channel.close().then((_) => process.exitCode);
+    }).timeout(new Duration(seconds: 2), onTimeout: () {
+      print('Expected server to shutdown');
+      process.kill();
+    }).then((int result) {
+      if (result != null && result != 0) {
+        exitCode = result;
+      }
+      return true;
+    });
   }
 
   /**
@@ -51,12 +63,10 @@
   Future<AnalysisManager> _launchServer(String pathToServer) {
     // TODO dynamically allocate port and/or allow client to specify port
     List<String> serverArgs = [pathToServer, '--port', PORT.toString()];
-    return Process.start(Platform.executable, serverArgs)
-        .catchError((error) {
-          exitCode = 1;
-          throw 'Failed to launch analysis server: $error';
-        })
-        .then(_listenForPort);
+    return Process.start(Platform.executable, serverArgs).catchError((error) {
+      exitCode = 1;
+      throw 'Failed to launch analysis server: $error';
+    }).then(_listenForPort);
   }
 
   /**
@@ -72,18 +82,18 @@
 
     // Listen for port from server
     const String pattern = 'Listening on port ';
-    return out.firstWhere((String line) => line.startsWith(pattern))
-        .timeout(new Duration(seconds: 10))
-        .catchError((error) {
-          exitCode = 1;
-          process.kill();
-          throw 'Expected port from analysis server';
-        })
-        .then((String line) {
-          String port = line.substring(pattern.length).trim();
-          String url = 'ws://${InternetAddress.LOOPBACK_IP_V4.address}:$port/';
-          return _openConnection(url);
-        });
+    return out.firstWhere(
+        (String line) =>
+            line.startsWith(
+                pattern)).timeout(new Duration(seconds: 10)).catchError((error) {
+      exitCode = 1;
+      process.kill();
+      throw 'Expected port from analysis server';
+    }).then((String line) {
+      String port = line.substring(pattern.length).trim();
+      String url = 'ws://${InternetAddress.LOOPBACK_IP_V4.address}:$port/';
+      return _openConnection(url);
+    });
   }
 
   /**
@@ -98,45 +108,29 @@
       throw 'Failed to connect to analysis server at $serverUrl\n  $error';
     };
     try {
-      return WebSocket.connect(serverUrl)
-          .catchError(onError)
-          .then((WebSocket socket) {
-            this.channel = new WebSocketClientChannel(socket);
-            return this;
-          });
+      return WebSocket.connect(
+          serverUrl).catchError(onError).then((WebSocket socket) {
+        this.channel = new WebSocketClientChannel(socket);
+        return this;
+      });
     } catch (error) {
       onError(error);
     }
   }
 
   /**
-   * Stop the analysis server.
-   *
-   * Returns `true` if the signal is successfully sent and process terminates.
-   * Otherwise there was no attached process or the signal could not be sent,
-   * usually meaning that the process is already dead.
+   * Open a connection to a running analysis server
+   * and return a future with a manager for that analysis server.
    */
-  Future<bool> stop() {
-    if (process == null) {
-      return channel.close().then((_) => false);
-    }
-    return channel
-        .sendRequest(new ServerShutdownParams().toRequest('0'))
-        .timeout(new Duration(seconds: 2), onTimeout: () {
-          print('Expected shutdown response');
-        })
-        .then((Response response) {
-          return channel.close().then((_) => process.exitCode);
-        })
-        .timeout(new Duration(seconds: 2), onTimeout: () {
-          print('Expected server to shutdown');
-          process.kill();
-        })
-        .then((int result) {
-          if (result != null && result != 0) {
-            exitCode = result;
-          }
-          return true;
-        });
+  static Future<AnalysisManager> connect(String serverUrl) {
+    return new AnalysisManager()._openConnection(serverUrl);
+  }
+
+  /**
+   * Launch analysis server in a separate process
+   * and return a future with a manager for that analysis server.
+   */
+  static Future<AnalysisManager> start(String serverPath) {
+    return new AnalysisManager()._launchServer(serverPath);
   }
 }
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 7abc951..c346682 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -7,88 +7,28 @@
 import 'dart:async';
 import 'dart:collection';
 
-import 'package:analyzer/file_system/file_system.dart';
 import 'package:analysis_server/src/analysis_logger.dart';
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/context_manager.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation_queue.dart';
 import 'package:analysis_server/src/protocol.dart' hide Element;
-import 'package:analyzer/source/package_map_provider.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analysis_server/src/services/correction/namespace.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/source/package_map_provider.dart';
+import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analysis_server/src/services/correction/namespace.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/source_io.dart';
 
 
-class ServerContextManager extends ContextManager {
-  final AnalysisServer analysisServer;
-
-  /**
-   * The default options used to create new analysis contexts.
-   */
-  AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
-
-  ServerContextManager(this.analysisServer, ResourceProvider resourceProvider,
-      PackageMapProvider packageMapProvider)
-      : super(resourceProvider, packageMapProvider);
-
-  @override
-  void addContext(Folder folder, UriResolver packageUriResolver) {
-    AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
-    analysisServer.folderMap[folder] = context;
-    context.sourceFactory = _createSourceFactory(packageUriResolver);
-    context.analysisOptions = new AnalysisOptionsImpl.con1(defaultOptions);
-    analysisServer.schedulePerformAnalysisOperation(context);
-  }
-
-  @override
-  void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
-    AnalysisContext context = analysisServer.folderMap[contextFolder];
-    if (context != null) {
-      context.applyChanges(changeSet);
-      analysisServer.schedulePerformAnalysisOperation(context);
-    }
-  }
-
-  @override
-  void removeContext(Folder folder) {
-    AnalysisContext context = analysisServer.folderMap.remove(folder);
-    if (analysisServer.index != null) {
-      analysisServer.index.removeContext(context);
-    }
-    analysisServer.sendContextAnalysisDoneNotifications(
-        context,
-        AnalysisDoneReason.CONTEXT_REMOVED);
-  }
-
-  @override
-  void updateContextPackageUriResolver(Folder contextFolder,
-                                       UriResolver packageUriResolver) {
-    AnalysisContext context = analysisServer.folderMap[contextFolder];
-    context.sourceFactory = _createSourceFactory(packageUriResolver);
-    analysisServer.schedulePerformAnalysisOperation(context);
-  }
-
-  /**
-   * Set up a [SourceFactory] that resolves packages using the given
-   * [packageUriResolver].
-   */
-  SourceFactory _createSourceFactory(UriResolver packageUriResolver) {
-    List<UriResolver> resolvers = <UriResolver>[
-        new DartUriResolver(analysisServer.defaultSdk),
-        new ResourceUriResolver(resourceProvider),
-        packageUriResolver];
-    return new SourceFactory(resolvers);
-  }
-}
+typedef void OptionUpdater(AnalysisOptionsImpl options);
 
 
 /**
@@ -223,6 +163,11 @@
   StreamController<ChangeNotice> _onFileAnalyzedController;
 
   /**
+   * The controller used to notify others when priority sources change.
+   */
+  StreamController<PriorityChangeEvent> _onPriorityChangeController;
+
+  /**
    * True if any exceptions thrown by analysis should be propagated up the call
    * stack.
    */
@@ -238,16 +183,21 @@
    * running a full analysis server.
    */
   AnalysisServer(this.channel, this.resourceProvider,
-      PackageMapProvider packageMapProvider, this.index, this.defaultSdk,
+      PackageMapProvider packageMapProvider, this.index,
+      AnalysisServerOptions analysisServerOptions, this.defaultSdk,
       {this.rethrowExceptions: true}) {
     searchEngine = createSearchEngine(index);
     operationQueue = new ServerOperationQueue(this);
     contextDirectoryManager =
         new ServerContextManager(this, resourceProvider, packageMapProvider);
+    contextDirectoryManager.defaultOptions.incremental =
+        analysisServerOptions.enableIncrementalResolution;
     AnalysisEngine.instance.logger = new AnalysisLogger();
     _onAnalysisStartedController = new StreamController.broadcast();
     _onAnalysisCompleteController = new StreamController.broadcast();
     _onFileAnalyzedController = new StreamController.broadcast();
+    _onPriorityChangeController =
+        new StreamController<PriorityChangeEvent>.broadcast();
     running = true;
     Notification notification = new ServerConnectedParams().toNotification();
     channel.sendNotification(notification);
@@ -255,107 +205,9 @@
   }
 
   /**
-   * If the given notice applies to a file contained within an analysis root,
-   * notify interested parties that the file has been (at least partially)
-   * analyzed.
+   * The stream that is notified when analysis is complete.
    */
-  void fileAnalyzed(ChangeNotice notice) {
-    if (contextDirectoryManager.isInAnalysisRoot(notice.source.fullName)) {
-      _onFileAnalyzedController.add(notice);
-    }
-  }
-
-  /**
-   * Schedules execution of the given [ServerOperation].
-   */
-  void scheduleOperation(ServerOperation operation) {
-    addOperation(operation);
-    if (!performOperationPending) {
-      _schedulePerformOperation();
-    }
-  }
-
-  /**
-   * Schedules analysis of the given context.
-   */
-  void schedulePerformAnalysisOperation(AnalysisContext context) {
-    _onAnalysisStartedController.add(context);
-    scheduleOperation(new PerformAnalysisOperation(context, false));
-  }
-
-  /**
-   * Send the given [notification] to the client.
-   */
-  void sendNotification(Notification notification) {
-    channel.sendNotification(notification);
-  }
-
-  /**
-   * Send the given [response] to the client.
-   */
-  void sendResponse(Response response) {
-    channel.sendResponse(response);
-  }
-
-  /**
-   * Set the priority files to the given [files].
-   */
-  void setPriorityFiles(Request request, List<String> files) {
-    Map<AnalysisContext, List<Source>> sourceMap =
-        new HashMap<AnalysisContext, List<Source>>();
-    List<String> unanalyzed = new List<String>();
-    files.forEach((file) {
-      AnalysisContext analysisContext = getAnalysisContext(file);
-      if (analysisContext == null) {
-        unanalyzed.add(file);
-      } else {
-        List<Source> sourceList = sourceMap[analysisContext];
-        if (sourceList == null) {
-          sourceList = <Source>[];
-          sourceMap[analysisContext] = sourceList;
-        }
-        sourceList.add(getSource(file));
-      }
-    });
-    if (unanalyzed.isNotEmpty) {
-      StringBuffer buffer = new StringBuffer();
-      buffer.writeAll(unanalyzed, ', ');
-      throw new RequestFailure(
-          new Response.unanalyzedPriorityFiles(request, buffer.toString()));
-    }
-    folderMap.forEach((Folder folder, AnalysisContext context) {
-      List<Source> sourceList = sourceMap[context];
-      if (sourceList == null) {
-        sourceList = Source.EMPTY_ARRAY;
-      }
-      context.analysisPriorityOrder = sourceList;
-    });
-  }
-
-  /**
-   * Use the given updaters to update the values of the options in every
-   * existing analysis context.
-   */
-  void updateOptions(List<OptionUpdater> optionUpdaters) {
-    //
-    // Update existing contexts.
-    //
-    folderMap.forEach((Folder folder, AnalysisContext context) {
-      AnalysisOptionsImpl options =
-          new AnalysisOptionsImpl.con1(context.analysisOptions);
-      optionUpdaters.forEach((OptionUpdater optionUpdater) {
-        optionUpdater(options);
-      });
-      context.analysisOptions = options;
-    });
-    //
-    // Update the defaults used to create new contexts.
-    //
-    AnalysisOptionsImpl options = contextDirectoryManager.defaultOptions;
-    optionUpdaters.forEach((OptionUpdater optionUpdater) {
-      optionUpdater(options);
-    });
-  }
+  Stream get onAnalysisComplete => _onAnalysisCompleteController.stream;
 
   /**
    * The stream that is notified when analysis of a context is started.
@@ -365,9 +217,10 @@
   }
 
   /**
-   * The stream that is notified when analysis is complete.
+   * The stream that is notified when contexts are added or removed.
    */
-  Stream get onAnalysisComplete => _onAnalysisCompleteController.stream;
+  Stream<ContextsChangedEvent> get onContextsChanged =>
+      contextDirectoryManager.onContextsChanged;
 
   /**
    * The stream that is notified when a single file has been analyzed.
@@ -375,6 +228,12 @@
   Stream get onFileAnalyzed => _onFileAnalyzedController.stream;
 
   /**
+   * The stream that is notified when priority sources change.
+   */
+  Stream<PriorityChangeEvent> get onPriorityChange =>
+      _onPriorityChangeController.stream;
+
+  /**
    * Adds the given [ServerOperation] to the queue, but does not schedule
    * operations execution.
    */
@@ -398,6 +257,110 @@
     running = false;
   }
 
+  /**
+   * If the given notice applies to a file contained within an analysis root,
+   * notify interested parties that the file has been (at least partially)
+   * analyzed.
+   */
+  void fileAnalyzed(ChangeNotice notice) {
+    if (contextDirectoryManager.isInAnalysisRoot(notice.source.fullName)) {
+      _onFileAnalyzedController.add(notice);
+    }
+  }
+
+  /**
+   * Return the [AnalysisContext] that is used to analyze the given [path].
+   * Return `null` if there is no such context.
+   */
+  AnalysisContext getAnalysisContext(String path) {
+    // try to find a containing context
+    for (Folder folder in folderMap.keys) {
+      if (folder.contains(path)) {
+        return folderMap[folder];
+      }
+    }
+    // check if there is a context that analyzed this source
+    Source source = getSource(path);
+    for (AnalysisContext context in folderMap.values) {
+      SourceKind kind = context.getKindOf(source);
+      if (kind != null) {
+        return context;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Return the [AnalysisContext]s that are being used to analyze the analysis
+   * roots.
+   */
+  Iterable<AnalysisContext> getAnalysisContexts() {
+    return folderMap.values;
+  }
+
+  /**
+   * Returns [Element]s at the given [offset] of the given [file].
+   *
+   * May be empty if cannot be resolved, but not `null`.
+   */
+  List<Element> getElementsAtOffset(String file, int offset) {
+    List<AstNode> nodes = getNodesAtOffset(file, offset);
+    return getElementsOfNodes(nodes, offset);
+  }
+
+  /**
+   * Returns [Element]s of the given [nodes].
+   *
+   * May be empty if not resolved, but not `null`.
+   */
+  List<Element> getElementsOfNodes(List<AstNode> nodes, int offset) {
+    List<Element> elements = <Element>[];
+    for (AstNode node in nodes) {
+      if (node is SimpleIdentifier && node.parent is LibraryIdentifier) {
+        node = node.parent;
+      }
+      if (node is LibraryIdentifier) {
+        node = node.parent;
+      }
+      Element element = ElementLocator.locateWithOffset(node, offset);
+      if (node is SimpleIdentifier && element is PrefixElement) {
+        element = getImportElement(node);
+      }
+      if (element != null) {
+        elements.add(element);
+      }
+    }
+    return elements;
+  }
+
+  /**
+   * Return an analysis error info containing the array of all of the errors and
+   * the line info associated with [file].
+   *
+   * Returns `null` if [file] does not belong to any [AnalysisContext], or the
+   * file does not exist.
+   *
+   * The array of errors will be empty if there are no errors in [file]. The
+   * errors contained in the array can be incomplete.
+   *
+   * This method does not wait for all errors to be computed, and returns just
+   * the current state.
+   */
+  AnalysisErrorInfo getErrors(String file) {
+    // prepare AnalysisContext
+    AnalysisContext context = getAnalysisContext(file);
+    if (context == null) {
+      return null;
+    }
+    // prepare Source
+    Source source = getSource(file);
+    if (context.getKindOf(source) == SourceKind.UNKNOWN) {
+      return null;
+    }
+    // get errors for the file
+    return context.getErrors(source);
+  }
+
 // TODO(brianwilkerson) Add the following method after 'prioritySources' has
 // been added to InternalAnalysisContext.
 //  /**
@@ -416,6 +379,93 @@
 //  }
 
   /**
+   * Returns resolved [AstNode]s at the given [offset] of the given [file].
+   *
+   * May be empty, but not `null`.
+   */
+  List<AstNode> getNodesAtOffset(String file, int offset) {
+    List<CompilationUnit> units = getResolvedCompilationUnits(file);
+    List<AstNode> nodes = <AstNode>[];
+    for (CompilationUnit unit in units) {
+      AstNode node = new NodeLocator.con1(offset).searchWithin(unit);
+      if (node != null) {
+        nodes.add(node);
+      }
+    }
+    return nodes;
+  }
+
+  /**
+   * Returns resolved [CompilationUnit]s of the Dart file with the given [path].
+   *
+   * May be empty, but not `null`.
+   */
+  List<CompilationUnit> getResolvedCompilationUnits(String path) {
+    List<CompilationUnit> units = <CompilationUnit>[];
+    // prepare AnalysisContext
+    AnalysisContext context = getAnalysisContext(path);
+    if (context == null) {
+      return units;
+    }
+    // add a unit for each unit/library combination
+    Source unitSource = getSource(path);
+    List<Source> librarySources = context.getLibrariesContaining(unitSource);
+    for (Source librarySource in librarySources) {
+      CompilationUnit unit =
+          context.resolveCompilationUnit2(unitSource, librarySource);
+      if (unit != null) {
+        units.add(unit);
+      }
+    }
+    // done
+    return units;
+  }
+
+  /**
+   * Returns the [CompilationUnit] of the Dart file with the given [path] that
+   * should be used to resend notifications for already resolved unit.
+   * Returns `null` if the file is not a part of any context, library has not
+   * been yet resolved, or any problem happened.
+   */
+  CompilationUnit getResolvedCompilationUnitToResendNotification(String path) {
+    // prepare AnalysisContext
+    AnalysisContext context = getAnalysisContext(path);
+    if (context == null) {
+      return null;
+    }
+    // prepare sources
+    Source unitSource = getSource(path);
+    List<Source> librarySources = context.getLibrariesContaining(unitSource);
+    if (librarySources.isEmpty) {
+      return null;
+    }
+    // if library has not been resolved yet, the unit will be resolved later
+    Source librarySource = librarySources[0];
+    if (context.getLibraryElement(librarySource) == null) {
+      return null;
+    }
+    // if library has been already resolved, resolve unit
+    return context.resolveCompilationUnit2(unitSource, librarySource);
+  }
+
+  /**
+   * Return the [Source] of the Dart file with the given [path].
+   */
+  Source getSource(String path) {
+    // try SDK
+    {
+      Uri uri = resourceProvider.pathContext.toUri(path);
+      Source sdkSource = defaultSdk.fromFileUri(uri);
+      if (sdkSource != null) {
+        return sdkSource;
+      }
+    }
+    // file-based source
+    File file = resourceProvider.getResource(path);
+    return file.createSource();
+  }
+
+  /**
    * Handle a [request] that was read from the communication channel.
    */
   void handleRequest(Request request) {
@@ -435,9 +485,8 @@
           channel.sendResponse(exception.response);
           return;
         } catch (exception, stackTrace) {
-          RequestError error = new RequestError(
-              RequestErrorCode.SERVER_ERROR,
-              exception.toString());
+          RequestError error =
+              new RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
           if (stackTrace != null) {
             error.stackTrace = stackTrace.toString();
           }
@@ -459,15 +508,6 @@
   }
 
   /**
-   * Returns `true` if errors should be reported for [file] with the given
-   * absolute path.
-   */
-  bool shouldSendErrorsNotificationFor(String file) {
-    // TODO(scheglov) add support for the "--no-error-notification" flag.
-    return contextDirectoryManager.isInAnalysisRoot(file);
-  }
-
-  /**
    * Return `true` if analysis is complete.
    */
   bool isAnalysisComplete() {
@@ -483,6 +523,39 @@
   }
 
   /**
+   * Returns a [Future] completing when [file] has been completely analyzed, in
+   * particular, all its errors have been computed.  The future is completed
+   * with an [AnalysisDoneReason] indicating what caused the file's analysis to
+   * be considered complete.
+   *
+   * If the given file doesn't belong to any context, null is returned.
+   *
+   * TODO(scheglov) this method should be improved.
+   *
+   * 1. The analysis context should be told to analyze this particular file ASAP.
+   *
+   * 2. We should complete the future as soon as the file is analyzed (not wait
+   *    until the context is completely finished)
+   */
+  Future<AnalysisDoneReason> onFileAnalysisComplete(String file) {
+    // prepare AnalysisContext
+    AnalysisContext context = getAnalysisContext(file);
+    if (context == null) {
+      return null;
+    }
+    // schedule context analysis
+    schedulePerformAnalysisOperation(context);
+    // associate with the context completer
+    Completer<AnalysisDoneReason> completer =
+        contextAnalysisDoneCompleters[context];
+    if (completer == null) {
+      completer = new Completer<AnalysisDoneReason>();
+      contextAnalysisDoneCompleters[context] = completer;
+    }
+    return completer.future;
+  }
+
+  /**
    * Perform the next available [ServerOperation].
    */
   void performOperation() {
@@ -538,6 +611,51 @@
   }
 
   /**
+   * Schedules execution of the given [ServerOperation].
+   */
+  void scheduleOperation(ServerOperation operation) {
+    addOperation(operation);
+    if (!performOperationPending) {
+      _schedulePerformOperation();
+    }
+  }
+
+  /**
+   * Schedules analysis of the given context.
+   */
+  void schedulePerformAnalysisOperation(AnalysisContext context) {
+    _onAnalysisStartedController.add(context);
+    scheduleOperation(new PerformAnalysisOperation(context, false));
+  }
+
+  /**
+   * This method is called when analysis of the given [AnalysisContext] is
+   * done.
+   */
+  void sendContextAnalysisDoneNotifications(AnalysisContext context,
+      AnalysisDoneReason reason) {
+    Completer<AnalysisDoneReason> completer =
+        contextAnalysisDoneCompleters.remove(context);
+    if (completer != null) {
+      completer.complete(reason);
+    }
+  }
+
+  /**
+   * Send the given [notification] to the client.
+   */
+  void sendNotification(Notification notification) {
+    channel.sendNotification(notification);
+  }
+
+  /**
+   * Send the given [response] to the client.
+   */
+  void sendResponse(Response response) {
+    channel.sendResponse(response);
+  }
+
+  /**
    * Send status notification to the client. The `operation` is the operation
    * being performed or `null` if analysis is complete.
    */
@@ -583,51 +701,6 @@
   }
 
   /**
-   * Implementation for `analysis.updateContent`.
-   */
-  void updateContent(String id, Map<String, dynamic> changes) {
-    changes.forEach((file, change) {
-      AnalysisContext analysisContext = getAnalysisContext(file);
-      // TODO(paulberry): handle the case where a file is referred to by more
-      // than one context (e.g package A depends on package B using a local
-      // path, user has both packages open for editing in separate contexts,
-      // and user modifies a file in package B).
-      if (analysisContext != null) {
-        Source source = getSource(file);
-        if (change is AddContentOverlay) {
-          analysisContext.setContents(source, change.content);
-        } else if (change is ChangeContentOverlay) {
-          // TODO(paulberry): an error should be generated if source is not
-          // currently in the content cache.
-          TimestampedData<String> oldContents =
-              analysisContext.getContents(source);
-          String newContents;
-          try {
-            newContents =
-                SourceEdit.applySequence(oldContents.data, change.edits);
-          } on RangeError {
-            throw new RequestFailure(
-                new Response(
-                    id,
-                    error: new RequestError(
-                        RequestErrorCode.INVALID_OVERLAY_CHANGE,
-                        'Invalid overlay change')));
-          }
-          // TODO(paulberry): to aid in incremental processing it would be
-          // better to use setChangedContents.
-          analysisContext.setContents(source, newContents);
-        } else if (change is RemoveContentOverlay) {
-          analysisContext.setContents(source, null);
-        } else {
-          // Protocol parsing should have ensured that we never get here.
-          throw new AnalysisException('Illegal change type');
-        }
-        schedulePerformAnalysisOperation(analysisContext);
-      }
-    });
-  }
-
-  /**
    * Implementation for `analysis.setSubscriptions`.
    */
   void setAnalysisSubscriptions(Map<AnalysisService,
@@ -681,229 +754,49 @@
   }
 
   /**
-   * Return the [AnalysisContext]s that are being used to analyze the analysis
-   * roots.
+   * Set the priority files to the given [files].
    */
-  Iterable<AnalysisContext> getAnalysisContexts() {
-    return folderMap.values;
-  }
-
-  /**
-   * Return the [AnalysisContext] that is used to analyze the given [path].
-   * Return `null` if there is no such context.
-   */
-  AnalysisContext getAnalysisContext(String path) {
-    // try to find a containing context
-    for (Folder folder in folderMap.keys) {
-      if (folder.contains(path)) {
-        return folderMap[folder];
+  void setPriorityFiles(String requestId, List<String> files) {
+    Map<AnalysisContext, List<Source>> sourceMap =
+        new HashMap<AnalysisContext, List<Source>>();
+    List<String> unanalyzed = new List<String>();
+    files.forEach((file) {
+      AnalysisContext analysisContext = getAnalysisContext(file);
+      if (analysisContext == null) {
+        unanalyzed.add(file);
+      } else {
+        List<Source> sourceList = sourceMap[analysisContext];
+        if (sourceList == null) {
+          sourceList = <Source>[];
+          sourceMap[analysisContext] = sourceList;
+        }
+        sourceList.add(getSource(file));
       }
+    });
+    if (unanalyzed.isNotEmpty) {
+      StringBuffer buffer = new StringBuffer();
+      buffer.writeAll(unanalyzed, ', ');
+      throw new RequestFailure(
+          new Response.unanalyzedPriorityFiles(requestId, buffer.toString()));
     }
-    // check if there is a context that analyzed this source
-    Source source = getSource(path);
-    for (AnalysisContext context in folderMap.values) {
-      SourceKind kind = context.getKindOf(source);
-      if (kind != null) {
-        return context;
+    folderMap.forEach((Folder folder, AnalysisContext context) {
+      List<Source> sourceList = sourceMap[context];
+      if (sourceList == null) {
+        sourceList = Source.EMPTY_ARRAY;
       }
-    }
-    return null;
+      context.analysisPriorityOrder = sourceList;
+    });
+    Source firstSource = files.length > 0 ? getSource(files[0]) : null;
+    _onPriorityChangeController.add(new PriorityChangeEvent(firstSource));
   }
 
   /**
-   * Return the [Source] of the Dart file with the given [path].
+   * Returns `true` if errors should be reported for [file] with the given
+   * absolute path.
    */
-  Source getSource(String path) {
-    // try SDK
-    {
-      Uri uri = resourceProvider.pathContext.toUri(path);
-      Source sdkSource = defaultSdk.fromFileUri(uri);
-      if (sdkSource != null) {
-        return sdkSource;
-      }
-    }
-    // file-based source
-    File file = resourceProvider.getResource(path);
-    return file.createSource();
-  }
-
-  /**
-   * Returns the [CompilationUnit] of the Dart file with the given [path] that
-   * should be used to resend notifications for already resolved unit.
-   * Returns `null` if the file is not a part of any context, library has not
-   * been yet resolved, or any problem happened.
-   */
-  CompilationUnit getResolvedCompilationUnitToResendNotification(String path) {
-    // prepare AnalysisContext
-    AnalysisContext context = getAnalysisContext(path);
-    if (context == null) {
-      return null;
-    }
-    // prepare sources
-    Source unitSource = getSource(path);
-    List<Source> librarySources = context.getLibrariesContaining(unitSource);
-    if (librarySources.isEmpty) {
-      return null;
-    }
-    // if library has not been resolved yet, the unit will be resolved later
-    Source librarySource = librarySources[0];
-    if (context.getLibraryElement(librarySource) == null) {
-      return null;
-    }
-    // if library has been already resolved, resolve unit
-    return context.resolveCompilationUnit2(unitSource, librarySource);
-  }
-
-  /**
-   * Return an analysis error info containing the array of all of the errors and
-   * the line info associated with [file].
-   *
-   * Returns `null` if [file] does not belong to any [AnalysisContext], or the
-   * file does not exist.
-   *
-   * The array of errors will be empty if there are no errors in [file]. The
-   * errors contained in the array can be incomplete.
-   *
-   * This method does not wait for all errors to be computed, and returns just
-   * the current state.
-   */
-  AnalysisErrorInfo getErrors(String file) {
-    // prepare AnalysisContext
-    AnalysisContext context = getAnalysisContext(file);
-    if (context == null) {
-      return null;
-    }
-    // prepare Source
-    Source source = getSource(file);
-    if (context.getKindOf(source) == SourceKind.UNKNOWN) {
-      return null;
-    }
-    // get errors for the file
-    return context.getErrors(source);
-  }
-
-  /**
-   * Returns resolved [CompilationUnit]s of the Dart file with the given [path].
-   *
-   * May be empty, but not `null`.
-   */
-  List<CompilationUnit> getResolvedCompilationUnits(String path) {
-    List<CompilationUnit> units = <CompilationUnit>[];
-    // prepare AnalysisContext
-    AnalysisContext context = getAnalysisContext(path);
-    if (context == null) {
-      return units;
-    }
-    // add a unit for each unit/library combination
-    Source unitSource = getSource(path);
-    List<Source> librarySources = context.getLibrariesContaining(unitSource);
-    for (Source librarySource in librarySources) {
-      CompilationUnit unit =
-          context.resolveCompilationUnit2(unitSource, librarySource);
-      if (unit != null) {
-        units.add(unit);
-      }
-    }
-    // done
-    return units;
-  }
-
-  /**
-   * Returns resolved [AstNode]s at the given [offset] of the given [file].
-   *
-   * May be empty, but not `null`.
-   */
-  List<AstNode> getNodesAtOffset(String file, int offset) {
-    List<CompilationUnit> units = getResolvedCompilationUnits(file);
-    List<AstNode> nodes = <AstNode>[];
-    for (CompilationUnit unit in units) {
-      AstNode node = new NodeLocator.con1(offset).searchWithin(unit);
-      if (node != null) {
-        nodes.add(node);
-      }
-    }
-    return nodes;
-  }
-
-  /**
-   * Returns [Element]s at the given [offset] of the given [file].
-   *
-   * May be empty if cannot be resolved, but not `null`.
-   */
-  List<Element> getElementsAtOffset(String file, int offset) {
-    List<AstNode> nodes = getNodesAtOffset(file, offset);
-    return getElementsOfNodes(nodes, offset);
-  }
-
-  /**
-   * Returns [Element]s of the given [nodes].
-   *
-   * May be empty if not resolved, but not `null`.
-   */
-  List<Element> getElementsOfNodes(List<AstNode> nodes, int offset) {
-    List<Element> elements = <Element>[];
-    for (AstNode node in nodes) {
-      if (node is SimpleIdentifier && node.parent is LibraryIdentifier) {
-        node = node.parent;
-      }
-      if (node is LibraryIdentifier) {
-        node = node.parent;
-      }
-      Element element = ElementLocator.locateWithOffset(node, offset);
-      if (node is SimpleIdentifier && element is PrefixElement) {
-        element = getImportElement(node);
-      }
-      if (element != null) {
-        elements.add(element);
-      }
-    }
-    return elements;
-  }
-
-  /**
-   * Returns a [Future] completing when [file] has been completely analyzed, in
-   * particular, all its errors have been computed.  The future is completed
-   * with an [AnalysisDoneReason] indicating what caused the file's analysis to
-   * be considered complete.
-   *
-   * If the given file doesn't belong to any context, null is returned.
-   *
-   * TODO(scheglov) this method should be improved.
-   *
-   * 1. The analysis context should be told to analyze this particular file ASAP.
-   *
-   * 2. We should complete the future as soon as the file is analyzed (not wait
-   *    until the context is completely finished)
-   */
-  Future<AnalysisDoneReason> onFileAnalysisComplete(String file) {
-    // prepare AnalysisContext
-    AnalysisContext context = getAnalysisContext(file);
-    if (context == null) {
-      return null;
-    }
-    // schedule context analysis
-    schedulePerformAnalysisOperation(context);
-    // associate with the context completer
-    Completer<AnalysisDoneReason> completer =
-        contextAnalysisDoneCompleters[context];
-    if (completer == null) {
-      completer = new Completer<AnalysisDoneReason>();
-      contextAnalysisDoneCompleters[context] = completer;
-    }
-    return completer.future;
-  }
-
-  /**
-   * This method is called when analysis of the given [AnalysisContext] is
-   * done.
-   */
-  void sendContextAnalysisDoneNotifications(AnalysisContext context,
-      AnalysisDoneReason reason) {
-    Completer<AnalysisDoneReason> completer =
-        contextAnalysisDoneCompleters.remove(context);
-    if (completer != null) {
-      completer.complete(reason);
-    }
+  bool shouldSendErrorsNotificationFor(String file) {
+    // TODO(scheglov) add support for the "--no-error-notification" flag.
+    return contextDirectoryManager.isInAnalysisRoot(file);
   }
 
   void shutdown() {
@@ -917,10 +810,80 @@
   }
 
   /**
+   * Implementation for `analysis.updateContent`.
+   */
+  void updateContent(String id, Map<String, dynamic> changes) {
+    changes.forEach((file, change) {
+      AnalysisContext analysisContext = getAnalysisContext(file);
+      // TODO(paulberry): handle the case where a file is referred to by more
+      // than one context (e.g package A depends on package B using a local
+      // path, user has both packages open for editing in separate contexts,
+      // and user modifies a file in package B).
+      if (analysisContext != null) {
+        Source source = getSource(file);
+        if (change is AddContentOverlay) {
+          analysisContext.setContents(source, change.content);
+        } else if (change is ChangeContentOverlay) {
+          // TODO(paulberry): an error should be generated if source is not
+          // currently in the content cache.
+          TimestampedData<String> oldContents =
+              analysisContext.getContents(source);
+          String newContents;
+          try {
+            newContents =
+                SourceEdit.applySequence(oldContents.data, change.edits);
+          } on RangeError {
+            throw new RequestFailure(
+                new Response(
+                    id,
+                    error: new RequestError(
+                        RequestErrorCode.INVALID_OVERLAY_CHANGE,
+                        'Invalid overlay change')));
+          }
+          // TODO(paulberry): to aid in incremental processing it would be
+          // better to use setChangedContents.
+          analysisContext.setContents(source, newContents);
+        } else if (change is RemoveContentOverlay) {
+          analysisContext.setContents(source, null);
+        } else {
+          // Protocol parsing should have ensured that we never get here.
+          throw new AnalysisException('Illegal change type');
+        }
+        schedulePerformAnalysisOperation(analysisContext);
+      }
+    });
+  }
+
+  /**
+   * Use the given updaters to update the values of the options in every
+   * existing analysis context.
+   */
+  void updateOptions(List<OptionUpdater> optionUpdaters) {
+    //
+    // Update existing contexts.
+    //
+    folderMap.forEach((Folder folder, AnalysisContext context) {
+      AnalysisOptionsImpl options =
+          new AnalysisOptionsImpl.con1(context.analysisOptions);
+      optionUpdaters.forEach((OptionUpdater optionUpdater) {
+        optionUpdater(options);
+      });
+      context.analysisOptions = options;
+    });
+    //
+    // Update the defaults used to create new contexts.
+    //
+    AnalysisOptionsImpl options = contextDirectoryManager.defaultOptions;
+    optionUpdaters.forEach((OptionUpdater optionUpdater) {
+      optionUpdater(options);
+    });
+  }
+
+  /**
    * Schedules [performOperation] exection.
    */
   void _schedulePerformOperation() {
-    assert (!performOperationPending);
+    assert(!performOperationPending);
     new Future(performOperation);
     performOperationPending = true;
   }
@@ -952,4 +915,126 @@
   }
 }
 
-typedef void OptionUpdater(AnalysisOptionsImpl options);
+
+class AnalysisServerOptions {
+  bool enableIncrementalResolution = false;
+}
+
+/**
+ * A [ContextsChangedEvent] indicate what contexts were added or removed.
+ *
+ * No context should be added to the event more than once. It does not make
+ * sense, for example, for a context to be both added and removed.
+ */
+class ContextsChangedEvent {
+
+  /**
+   * The contexts that were added to the server.
+   */
+  final List<AnalysisContext> added;
+
+  /**
+   * The contexts that were changed.
+   */
+  final List<AnalysisContext> changed;
+
+  /**
+   * The contexts that were removed from the server.
+   */
+  final List<AnalysisContext> removed;
+
+  ContextsChangedEvent({this.added: AnalysisContext.EMPTY_LIST, this.changed:
+      AnalysisContext.EMPTY_LIST, this.removed: AnalysisContext.EMPTY_LIST});
+}
+
+/**
+ * A [PriorityChangeEvent] indicates the set the priority files has changed.
+ */
+class PriorityChangeEvent {
+  final Source firstSource;
+
+  PriorityChangeEvent(this.firstSource);
+}
+
+
+class ServerContextManager extends ContextManager {
+  final AnalysisServer analysisServer;
+
+  /**
+   * The default options used to create new analysis contexts.
+   */
+  AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+
+  /**
+   * The controller for sending [ContextsChangedEvent]s.
+   */
+  StreamController<ContextsChangedEvent> _onContextsChangedController;
+
+  ServerContextManager(this.analysisServer, ResourceProvider resourceProvider,
+      PackageMapProvider packageMapProvider)
+      : super(resourceProvider, packageMapProvider) {
+    _onContextsChangedController =
+        new StreamController<ContextsChangedEvent>.broadcast();
+  }
+
+  /**
+   * The stream that is notified when contexts are added or removed.
+   */
+  Stream<ContextsChangedEvent> get onContextsChanged =>
+      _onContextsChangedController.stream;
+
+  @override
+  void addContext(Folder folder, UriResolver packageUriResolver) {
+    AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
+    analysisServer.folderMap[folder] = context;
+    context.sourceFactory = _createSourceFactory(packageUriResolver);
+    context.analysisOptions = new AnalysisOptionsImpl.con1(defaultOptions);
+    _onContextsChangedController.add(
+        new ContextsChangedEvent(added: [context]));
+    analysisServer.schedulePerformAnalysisOperation(context);
+  }
+
+  @override
+  void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
+    AnalysisContext context = analysisServer.folderMap[contextFolder];
+    if (context != null) {
+      context.applyChanges(changeSet);
+      analysisServer.schedulePerformAnalysisOperation(context);
+    }
+  }
+
+  @override
+  void removeContext(Folder folder) {
+    AnalysisContext context = analysisServer.folderMap.remove(folder);
+    if (analysisServer.index != null) {
+      analysisServer.index.removeContext(context);
+    }
+    _onContextsChangedController.add(
+        new ContextsChangedEvent(removed: [context]));
+    analysisServer.sendContextAnalysisDoneNotifications(
+        context,
+        AnalysisDoneReason.CONTEXT_REMOVED);
+  }
+
+  @override
+  void updateContextPackageUriResolver(Folder contextFolder,
+      UriResolver packageUriResolver) {
+    AnalysisContext context = analysisServer.folderMap[contextFolder];
+    context.sourceFactory = _createSourceFactory(packageUriResolver);
+    _onContextsChangedController.add(
+        new ContextsChangedEvent(changed: [context]));
+    analysisServer.schedulePerformAnalysisOperation(context);
+  }
+
+  /**
+   * Set up a [SourceFactory] that resolves packages using the given
+   * [packageUriResolver].
+   */
+  SourceFactory _createSourceFactory(UriResolver packageUriResolver) {
+    List<UriResolver> resolvers = <UriResolver>[
+        new DartUriResolver(analysisServer.defaultSdk),
+        new ResourceUriResolver(resourceProvider),
+        packageUriResolver];
+    return new SourceFactory(resolvers);
+  }
+}
diff --git a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
index 730f4ec..2953701 100644
--- a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
@@ -27,19 +27,18 @@
   Stream<Notification> notificationStream;
 
   ByteStreamClientChannel(this.input, this.output) {
-    Stream jsonStream = input.transform((new Utf8Codec()).decoder)
-        .transform(new LineSplitter())
-        .transform(new JsonStreamDecoder())
-        .where((json) => json is Map)
-        .asBroadcastStream();
-    responseStream = jsonStream
-        .where((json) => json[Notification.EVENT] == null)
-        .transform(new ResponseConverter())
-        .asBroadcastStream();
-    notificationStream = jsonStream
-        .where((json) => json[Notification.EVENT] != null)
-        .transform(new NotificationConverter())
-        .asBroadcastStream();
+    Stream jsonStream = input.transform(
+        (new Utf8Codec()).decoder).transform(
+            new LineSplitter()).transform(
+                new JsonStreamDecoder()).where((json) => json is Map).asBroadcastStream();
+    responseStream = jsonStream.where(
+        (json) =>
+            json[Notification.EVENT] ==
+                null).transform(new ResponseConverter()).asBroadcastStream();
+    notificationStream = jsonStream.where(
+        (json) =>
+            json[Notification.EVENT] !=
+                null).transform(new NotificationConverter()).asBroadcastStream();
   }
 
   @override
@@ -50,7 +49,7 @@
   @override
   Future<Response> sendRequest(Request request) {
     String id = request.id;
-    output.writeln(JSON.encode(request.toJson()));
+    output.write(JSON.encode(request.toJson()) + '\n');
     return responseStream.firstWhere((Response response) => response.id == id);
   }
 }
@@ -61,15 +60,54 @@
  * standard input and standard output) to communicate with clients.
  */
 class ByteStreamServerChannel implements ServerCommunicationChannel {
+  /**
+   * Value of [_outputState] indicating that there is no outstanding data in
+   * [_pendingOutput], and that the most recent flush of [_output] has
+   * completed.
+   */
+  static const int _STATE_IDLE = 0;
+
+  /**
+   * Value of [_outputState] indicating that there is outstanding data in
+   * [_pendingOutput], and that the most recent flush of [_output] has
+   * completed; therefore a microtask has been scheduled to send the data.
+   */
+  static const int _STATE_MICROTASK_PENDING = 1;
+
+  /**
+   * Value of [_outputState] indicating that data has been sent to the
+   * [_output] stream and flushed, but the flush has not completed, so we must
+   * wait for it to complete before sending more data.  There may or may not be
+   * outstanding data in [_pendingOutput].
+   */
+  static const int _STATE_FLUSH_PENDING = 2;
+
   final Stream input;
-  final IOSink output;
+
+  final IOSink _output;
 
   /**
    * Completer that will be signalled when the input stream is closed.
    */
   final Completer _closed = new Completer();
 
-  ByteStreamServerChannel(this.input, this.output);
+  /**
+   * State of the output stream (see constants above).
+   */
+  int _outputState = _STATE_IDLE;
+
+  /**
+   * List of strings that need to be sent to [_output] at the next available
+   * opportunity.
+   */
+  List<String> _pendingOutput = <String>[];
+
+  /**
+   * True if [close] has been called.
+   */
+  bool _closeRequested = false;
+
+  ByteStreamServerChannel(this.input, this._output);
 
   /**
    * Future that will be completed when the input stream is closed.
@@ -80,19 +118,27 @@
 
   @override
   void close() {
-    output.flush().then((_) {
-      if (!_closed.isCompleted) {
+    if (!_closeRequested) {
+      _closeRequested = true;
+      if (_outputState == _STATE_IDLE) {
+        assert(!_closed.isCompleted);
         _closed.complete();
+      } else {
+        // Nothing to do.  [_flushCompleted] will call _closed.complete() after
+        // the flush completes.
       }
-    });
+    }
   }
 
   @override
   void listen(void onRequest(Request request), {Function onError, void
       onDone()}) {
-    input.transform((new Utf8Codec()).decoder).transform(new LineSplitter()
-        ).listen((String data) => _readRequest(data, onRequest), onError: onError,
-        onDone: () {
+    input.transform(
+        (new Utf8Codec()).decoder).transform(
+            new LineSplitter()).listen(
+                (String data) => _readRequest(data, onRequest),
+                onError: onError,
+                onDone: () {
       close();
       onDone();
     });
@@ -102,26 +148,72 @@
   void sendNotification(Notification notification) {
     // Don't send any further notifications after the communication channel is
     // closed.
-    if (_closed.isCompleted) {
+    if (_closeRequested) {
       return;
     }
     ServerCommunicationChannel.ToJson.start();
     String jsonEncoding = JSON.encode(notification.toJson());
     ServerCommunicationChannel.ToJson.stop();
-    output.writeln(jsonEncoding);
+    _outputLine(jsonEncoding);
   }
 
   @override
   void sendResponse(Response response) {
     // Don't send any further responses after the communication channel is
     // closed.
-    if (_closed.isCompleted) {
+    if (_closeRequested) {
       return;
     }
     ServerCommunicationChannel.ToJson.start();
     String jsonEncoding = JSON.encode(response.toJson());
     ServerCommunicationChannel.ToJson.stop();
-    output.writeln(jsonEncoding);
+    _outputLine(jsonEncoding);
+  }
+
+  /**
+   * Callback invoked after a flush of [_output] completes.  Closes the stream
+   * if necessary.  Otherwise schedules additional pending output.
+   */
+  void _flushCompleted(_) {
+    assert(_outputState == _STATE_FLUSH_PENDING);
+    if (_pendingOutput.isNotEmpty) {
+      _output.write(_pendingOutput.join());
+      _output.flush().then(_flushCompleted);
+      _pendingOutput.clear();
+      // Since we've done another flush, stay in _STATE_FLUSH_PENDING.
+    } else {
+      _outputState = _STATE_IDLE;
+      if (_closeRequested) {
+        assert(!_closed.isCompleted);
+        _closed.complete();
+      }
+    }
+  }
+
+  /**
+   * Microtask that writes pending output to the output stream and flushes it.
+   */
+  void _microtask() {
+    assert(_outputState == _STATE_MICROTASK_PENDING);
+    _output.write(_pendingOutput.join());
+    _output.flush().then(_flushCompleted);
+    _pendingOutput.clear();
+    _outputState = _STATE_FLUSH_PENDING;
+  }
+
+  /**
+   * Send the string [s] to [_output] followed by a newline.
+   */
+  void _outputLine(String s) {
+    _pendingOutput.add(s);
+    _pendingOutput.add('\n');
+    if (_outputState == _STATE_IDLE) {
+      // Don't send the output just yet; schedule a microtask to do it, so that
+      // if caller decides to output additional lines, they will get sent in
+      // the same call to _output.write().
+      new Future.microtask(_microtask);
+      _outputState = _STATE_MICROTASK_PENDING;
+    }
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/channel/channel.dart b/pkg/analysis_server/lib/src/channel/channel.dart
index 107b8b0..71ee75e 100644
--- a/pkg/analysis_server/lib/src/channel/channel.dart
+++ b/pkg/analysis_server/lib/src/channel/channel.dart
@@ -11,116 +11,6 @@
 import 'package:analyzer/src/util/utilities_timing.dart';
 
 /**
- * The abstract class [ClientCommunicationChannel] defines the behavior of
- * objects that allow a client to send [Request]s to an [AnalysisServer] and to
- * receive both [Response]s and [Notification]s.
- */
-abstract class ClientCommunicationChannel {
-  /**
-   * The stream of notifications from the server.
-   */
-  Stream<Notification> notificationStream;
-
-  /**
-   * The stream of responses from the server.
-   */
-  Stream<Response> responseStream;
-
-  /**
-   * Send the given [request] to the server
-   * and return a future with the associated [Response].
-   */
-  Future<Response> sendRequest(Request request);
-
-  /**
-   * Close the channel to the server. Once called, all future communication
-   * with the server via [sendRequest] will silently be ignored.
-   */
-  Future close();
-}
-
-/**
- * The abstract class [ServerCommunicationChannel] defines the behavior of
- * objects that allow an [AnalysisServer] to receive [Request]s and to return
- * both [Response]s and [Notification]s.
- */
-abstract class ServerCommunicationChannel {
-  /**
-   * A stopwatch used to accumulate the amount of time spent converting
-   * incomming requests from Json to objects.
-   */
-  static final CountedStopwatch FromJson = new CountedStopwatch();
-
-  /**
-   * A stopwatch used to accumulate the amount of time spent converting outgoing
-   * responses and notifications from objects to Json.
-   */
-  static final CountedStopwatch ToJson = new CountedStopwatch();
-
-  /**
-   * Listen to the channel for requests. If a request is received, invoke the
-   * [onRequest] function. If an error is encountered while trying to read from
-   * the socket, invoke the [onError] function. If the socket is closed by the
-   * client, invoke the [onDone] function.
-   * Only one listener is allowed per channel.
-   */
-  void listen(void onRequest(Request request), {Function onError, void onDone()});
-
-  /**
-   * Send the given [notification] to the client.
-   */
-  void sendNotification(Notification notification);
-
-  /**
-   * Send the given [response] to the client.
-   */
-  void sendResponse(Response response);
-
-  /**
-   * Close the communication channel.
-   */
-  void close();
-}
-
-/**
- * Instances of the class [JsonStreamDecoder] convert JSON strings to JSON
- * maps.
- */
-class JsonStreamDecoder extends Converter<String, Map> {
-  @override
-  Map convert(String text) => JSON.decode(text);
-
-  @override
-  ChunkedConversionSink startChunkedConversion(Sink sink) =>
-      new ChannelChunkSink<String, Map>(this, sink);
-}
-
-/**
- * Instances of the class [ResponseConverter] convert JSON maps to [Response]s.
- */
-class ResponseConverter extends Converter<Map, Response> {
-  @override
-  Response convert(Map json) => new Response.fromJson(json);
-
-  @override
-  ChunkedConversionSink startChunkedConversion(Sink sink) =>
-      new ChannelChunkSink<Map, Response>(this, sink);
-}
-
-/**
- * Instances of the class [NotificationConverter] convert JSON maps to
- * [Notification]s.
- */
-class NotificationConverter extends Converter<Map, Notification> {
-  @override
-  Notification convert(Map json) => new Notification.fromJson(json);
-
-  @override
-  ChunkedConversionSink startChunkedConversion(Sink sink) =>
-      new ChannelChunkSink<Map, Notification>(this, sink);
-}
-
-/**
  * Instances of the class [ChannelChunkSink] uses a [Converter] to translate
  * chunks.
  */
@@ -162,3 +52,114 @@
     sink.close();
   }
 }
+
+/**
+ * The abstract class [ClientCommunicationChannel] defines the behavior of
+ * objects that allow a client to send [Request]s to an [AnalysisServer] and to
+ * receive both [Response]s and [Notification]s.
+ */
+abstract class ClientCommunicationChannel {
+  /**
+   * The stream of notifications from the server.
+   */
+  Stream<Notification> notificationStream;
+
+  /**
+   * The stream of responses from the server.
+   */
+  Stream<Response> responseStream;
+
+  /**
+   * Close the channel to the server. Once called, all future communication
+   * with the server via [sendRequest] will silently be ignored.
+   */
+  Future close();
+
+  /**
+   * Send the given [request] to the server
+   * and return a future with the associated [Response].
+   */
+  Future<Response> sendRequest(Request request);
+}
+
+/**
+ * Instances of the class [JsonStreamDecoder] convert JSON strings to JSON
+ * maps.
+ */
+class JsonStreamDecoder extends Converter<String, Map> {
+  @override
+  Map convert(String text) => JSON.decode(text);
+
+  @override
+  ChunkedConversionSink startChunkedConversion(Sink sink) =>
+      new ChannelChunkSink<String, Map>(this, sink);
+}
+
+/**
+ * Instances of the class [NotificationConverter] convert JSON maps to
+ * [Notification]s.
+ */
+class NotificationConverter extends Converter<Map, Notification> {
+  @override
+  Notification convert(Map json) => new Notification.fromJson(json);
+
+  @override
+  ChunkedConversionSink startChunkedConversion(Sink sink) =>
+      new ChannelChunkSink<Map, Notification>(this, sink);
+}
+
+/**
+ * Instances of the class [ResponseConverter] convert JSON maps to [Response]s.
+ */
+class ResponseConverter extends Converter<Map, Response> {
+  @override
+  Response convert(Map json) => new Response.fromJson(json);
+
+  @override
+  ChunkedConversionSink startChunkedConversion(Sink sink) =>
+      new ChannelChunkSink<Map, Response>(this, sink);
+}
+
+/**
+ * The abstract class [ServerCommunicationChannel] defines the behavior of
+ * objects that allow an [AnalysisServer] to receive [Request]s and to return
+ * both [Response]s and [Notification]s.
+ */
+abstract class ServerCommunicationChannel {
+  /**
+   * A stopwatch used to accumulate the amount of time spent converting
+   * incomming requests from Json to objects.
+   */
+  static final CountedStopwatch FromJson = new CountedStopwatch();
+
+  /**
+   * A stopwatch used to accumulate the amount of time spent converting outgoing
+   * responses and notifications from objects to Json.
+   */
+  static final CountedStopwatch ToJson = new CountedStopwatch();
+
+  /**
+   * Close the communication channel.
+   */
+  void close();
+
+  /**
+   * Listen to the channel for requests. If a request is received, invoke the
+   * [onRequest] function. If an error is encountered while trying to read from
+   * the socket, invoke the [onError] function. If the socket is closed by the
+   * client, invoke the [onDone] function.
+   * Only one listener is allowed per channel.
+   */
+  void listen(void onRequest(Request request), {Function onError, void
+      onDone()});
+
+  /**
+   * Send the given [notification] to the client.
+   */
+  void sendNotification(Notification notification);
+
+  /**
+   * Send the given [response] to the client.
+   */
+  void sendResponse(Response response);
+}
diff --git a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
index c661bfb..8dfcb5c 100644
--- a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
@@ -8,8 +8,8 @@
 import 'dart:convert';
 import 'dart:io';
 
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/channel/channel.dart';
+import 'package:analysis_server/src/protocol.dart';
 
 
 /**
@@ -33,19 +33,23 @@
    * Initialize a new [WebSocket] wrapper for the given [socket].
    */
   WebSocketClientChannel(this.socket) {
-    Stream jsonStream = socket
-        .where((data) => data is String)
-        .transform(new JsonStreamDecoder())
-        .where((json) => json is Map)
-        .asBroadcastStream();
-    responseStream = jsonStream
-        .where((json) => json[Notification.EVENT] == null)
-        .transform(new ResponseConverter())
-        .asBroadcastStream();
-    notificationStream = jsonStream
-        .where((json) => json[Notification.EVENT] != null)
-        .transform(new NotificationConverter())
-        .asBroadcastStream();
+    Stream jsonStream = socket.where(
+        (data) =>
+            data is String).transform(
+                new JsonStreamDecoder()).where((json) => json is Map).asBroadcastStream();
+    responseStream = jsonStream.where(
+        (json) =>
+            json[Notification.EVENT] ==
+                null).transform(new ResponseConverter()).asBroadcastStream();
+    notificationStream = jsonStream.where(
+        (json) =>
+            json[Notification.EVENT] !=
+                null).transform(new NotificationConverter()).asBroadcastStream();
+  }
+
+  @override
+  Future close() {
+    return socket.close();
   }
 
   @override
@@ -54,11 +58,6 @@
     socket.add(JSON.encode(request.toJson()));
     return responseStream.firstWhere((Response response) => response.id == id);
   }
-
-  @override
-  Future close() {
-    return socket.close();
-  }
 }
 
 /**
@@ -78,27 +77,19 @@
   WebSocketServerChannel(this.socket);
 
   @override
-  void listen(void onRequest(Request request), {void onError(), void onDone()}) {
-    socket.listen((data) => readRequest(data, onRequest), onError: onError,
+  void close() {
+    socket.close(WebSocketStatus.NORMAL_CLOSURE);
+  }
+
+  @override
+  void listen(void onRequest(Request request), {void onError(), void
+      onDone()}) {
+    socket.listen(
+        (data) => readRequest(data, onRequest),
+        onError: onError,
         onDone: onDone);
   }
 
-  @override
-  void sendNotification(Notification notification) {
-    ServerCommunicationChannel.ToJson.start();
-    String jsonEncoding = JSON.encode(notification.toJson());
-    ServerCommunicationChannel.ToJson.stop();
-    socket.add(jsonEncoding);
-  }
-
-  @override
-  void sendResponse(Response response) {
-    ServerCommunicationChannel.ToJson.start();
-    String jsonEncoding = JSON.encode(response.toJson());
-    ServerCommunicationChannel.ToJson.stop();
-    socket.add(jsonEncoding);
-  }
-
   /**
    * Read a request from the given [data] and use the given function to handle
    * the request.
@@ -124,7 +115,18 @@
   }
 
   @override
-  void close() {
-    socket.close(WebSocketStatus.NORMAL_CLOSURE);
+  void sendNotification(Notification notification) {
+    ServerCommunicationChannel.ToJson.start();
+    String jsonEncoding = JSON.encode(notification.toJson());
+    ServerCommunicationChannel.ToJson.stop();
+    socket.add(jsonEncoding);
+  }
+
+  @override
+  void sendResponse(Response response) {
+    ServerCommunicationChannel.ToJson.start();
+    String jsonEncoding = JSON.encode(response.toJson());
+    ServerCommunicationChannel.ToJson.stop();
+    socket.add(jsonEncoding);
   }
 }
diff --git a/pkg/analysis_server/lib/src/collections.dart b/pkg/analysis_server/lib/src/collections.dart
index e49a0fe..bb3861f 100644
--- a/pkg/analysis_server/lib/src/collections.dart
+++ b/pkg/analysis_server/lib/src/collections.dart
@@ -29,4 +29,4 @@
     return null;
   }
   return list;
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
index 5f87bcc..c2af2b5 100644
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
@@ -49,16 +49,6 @@
     _addRegion(offset, length, element);
   }
 
-  void _addRegion_nodeStart_nodeStart(AstNode a, AstNode b, Element element,
-      {bool excludeLastChar: false}) {
-    int offset = a.offset;
-    int length = b.offset - offset;
-    if (excludeLastChar) {
-      length--;
-    }
-    _addRegion(offset, length, element);
-  }
-
   void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) {
     int offset = a.offset;
     int length = b.end - offset;
diff --git a/pkg/analysis_server/lib/src/constants.dart b/pkg/analysis_server/lib/src/constants.dart
index 9e5f50b..befda89 100644
--- a/pkg/analysis_server/lib/src/constants.dart
+++ b/pkg/analysis_server/lib/src/constants.dart
@@ -56,9 +56,8 @@
 const String SEARCH_FIND_ELEMENT_REFERENCES = 'search.findElementReferences';
 const String SEARCH_FIND_MEMBER_DECLARATIONS = 'search.findMemberDeclarations';
 const String SEARCH_FIND_MEMBER_REFERENCES = 'search.findMemberReferences';
-const String SEARCH_FIND_TOP_LEVEL_DECLARATIONS =
-    'search.findTopLevelDeclarations';
-    const String SEARCH_GET_TYPE_HIERARCHY = 'search.getTypeHierarchy';
+const String SEARCH_FIND_TOP_LEVEL_DECLARATIONS = 'search.findTopLevelDeclarations';
+const String SEARCH_GET_TYPE_HIERARCHY = 'search.getTypeHierarchy';
 
 //
 // Search notifications
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 6f815d1..02ac219 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -11,26 +11,26 @@
 import 'package:analyzer/source/package_map_provider.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/java_io.dart';
 import 'package:path/path.dart' as pathos;
 import 'package:watcher/watcher.dart';
 
 
 /**
- * File name of pubspec files.
- */
-const String PUBSPEC_NAME = 'pubspec.yaml';
-
-
-/**
  * The name of `packages` folders.
  */
 const String PACKAGES_NAME = 'packages';
 
 
 /**
+ * File name of pubspec files.
+ */
+const String PUBSPEC_NAME = 'pubspec.yaml';
+
+
+/**
  * Class that maintains a mapping from included/excluded paths to a set of
  * folders that should correspond to analysis contexts.
  */
@@ -116,11 +116,6 @@
   }
 
   /**
-   * Remove the context associated with the given [folder].
-   */
-  void removeContext(Folder folder);
-
-  /**
    * Rebuild the set of contexts from scratch based on the data last sent to
    * setRoots().
    */
@@ -134,6 +129,11 @@
   }
 
   /**
+   * Remove the context associated with the given [folder].
+   */
+  void removeContext(Folder folder);
+
+  /**
    * Change the set of paths which should be used as starting points to
    * determine the context directories.
    */
@@ -226,7 +226,7 @@
    * Called when the package map for a context has changed.
    */
   void updateContextPackageUriResolver(Folder contextFolder,
-                                       UriResolver packageUriResolver);
+      UriResolver packageUriResolver);
 
   /**
    * Resursively adds all Dart and HTML files to the [changeSet].
@@ -303,14 +303,14 @@
     UriResolver packageUriResolver;
     if (info.packageRoot != null) {
       info.packageMapDependencies = new Set<String>();
-      packageUriResolver = new PackageUriResolver(
-          [new JavaFile(info.packageRoot)]);
+      packageUriResolver =
+          new PackageUriResolver([new JavaFile(info.packageRoot)]);
     } else {
       PackageMapInfo packageMapInfo =
           _packageMapProvider.computePackageMap(folder);
       info.packageMapDependencies = packageMapInfo.dependencies;
-      packageUriResolver = new PackageMapUriResolver(
-          resourceProvider, packageMapInfo.packageMap);
+      packageUriResolver =
+          new PackageMapUriResolver(resourceProvider, packageMapInfo.packageMap);
       // TODO(paulberry): if any of the dependencies is outside of [folder],
       // we'll need to watch their parent folders as well.
     }
@@ -321,8 +321,8 @@
    * Create a new empty context associated with [folder].
    */
   _ContextInfo _createContext(Folder folder, List<_ContextInfo> children) {
-    _ContextInfo info = new _ContextInfo(folder, children,
-        normalizedPackageRoots[folder.path]);
+    _ContextInfo info =
+        new _ContextInfo(folder, children, normalizedPackageRoots[folder.path]);
     _contexts[folder] = info;
     info.changeSubscription = folder.changes.listen((WatchEvent event) {
       _handleWatchEvent(folder, info, event);
@@ -333,18 +333,6 @@
   }
 
   /**
-   * Create a new context associated with [folder] and fills its with sources.
-   */
-  _ContextInfo _createContextWithSources(Folder folder,
-      List<_ContextInfo> children) {
-    _ContextInfo info = _createContext(folder, children);
-    ChangeSet changeSet = new ChangeSet();
-    _addSourceFiles(changeSet, folder, info);
-    applyChangesToContext(folder, changeSet);
-    return info;
-  }
-
-  /**
    * Creates a new context associated with [folder].
    *
    * If there are subfolders with 'pubspec.yaml' files, separate contexts
@@ -385,6 +373,18 @@
   }
 
   /**
+   * Create a new context associated with [folder] and fills its with sources.
+   */
+  _ContextInfo _createContextWithSources(Folder folder,
+      List<_ContextInfo> children) {
+    _ContextInfo info = _createContext(folder, children);
+    ChangeSet changeSet = new ChangeSet();
+    _addSourceFiles(changeSet, folder, info);
+    applyChangesToContext(folder, changeSet);
+    return info;
+  }
+
+  /**
    * Clean up and destroy the context associated with the given folder.
    */
   void _destroyContext(Folder folder) {
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 3d3deb5..b5d9571 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -141,7 +141,7 @@
    */
   Response setPriorityFiles(Request request) {
     var params = new AnalysisSetPriorityFilesParams.fromRequest(request);
-    server.setPriorityFiles(request, params.files);
+    server.setPriorityFiles(request.id, params.files);
     return new AnalysisSetPriorityFilesResult().toResponse(request.id);
   }
 
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index cdda8f2..f7a1758 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -4,10 +4,18 @@
 
 library domain.completion;
 
+import 'dart:async';
+
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+export 'package:analysis_server/src/services/completion/completion_manager.dart'
+    show CompletionPerformance, OperationPerformance;
 
 /**
  * Instances of the class [CompletionDomainHandler] implement a [RequestHandler]
@@ -25,6 +33,17 @@
   int _nextCompletionId = 0;
 
   /**
+   * Cached information from a prior completion operation.
+   * The type of cached information depends upon the completion operation.
+   */
+  CompletionCache _cache;
+
+  /**
+   * The subscription for the cached context's source change stream.
+   */
+  StreamSubscription<SourcesChangedEvent> _sourcesChangedSubscription;
+
+  /**
    * Code completion peformance for the last completion operation.
    */
   CompletionPerformance performance;
@@ -32,7 +51,34 @@
   /**
    * Initialize a new request handler for the given [server].
    */
-  CompletionDomainHandler(this.server);
+  CompletionDomainHandler(this.server) {
+    server.onContextsChanged.listen(contextsChanged);
+  }
+
+  /**
+   * If the context associated with the cache has changed or been removed
+   * then discard the cache.
+   */
+  void contextsChanged(ContextsChangedEvent event) {
+    if (_cache != null) {
+      AnalysisContext context = _cache.context;
+      if (event.changed.contains(context) || event.removed.contains(context)) {
+        _discardCache();
+      }
+    }
+  }
+
+  CompletionManager createCompletionManager(AnalysisContext context,
+      Source source, int offset, SearchEngine searchEngine, CompletionCache cache,
+      CompletionPerformance performance) {
+    return new CompletionManager.create(
+        context,
+        source,
+        offset,
+        searchEngine,
+        cache,
+        performance);
+  }
 
   @override
   Response handleRequest(Request request) {
@@ -57,12 +103,14 @@
         new CompletionGetSuggestionsParams.fromRequest(request);
     // schedule completion analysis
     String completionId = (_nextCompletionId++).toString();
-    CompletionManager.create(
+    CompletionManager manager = createCompletionManager(
         server.getAnalysisContext(params.file),
         server.getSource(params.file),
         params.offset,
         server.searchEngine,
-        performance).results().listen((CompletionResult result) {
+        _cache,
+        performance);
+    manager.results().listen((CompletionResult result) {
       sendCompletionNotification(
           completionId,
           result.replacementOffset,
@@ -71,6 +119,17 @@
           result.last);
       if (result.last) {
         performance.complete();
+        CompletionCache newCache = manager.completionCache;
+        if (_cache != newCache) {
+          if (_cache != null) {
+            _discardCache();
+          }
+          _cache = newCache;
+          if (_cache.context != null) {
+            _sourcesChangedSubscription =
+                _cache.context.onSourcesChanged.listen(sourcesChanged);
+          }
+        }
       }
     });
     // initial response without results
@@ -91,4 +150,38 @@
             results,
             isLast).toNotification());
   }
+
+  /**
+   * Discard the cache if a source other than the source referenced by
+   * the cache changes or if any source is added, removed, or deleted.
+   */
+  void sourcesChanged(SourcesChangedEvent event) {
+
+    bool shouldDiscardCache(SourcesChangedEvent event) {
+      if (_cache == null) {
+        return false;
+      }
+      if (event.wereSourcesAdded || event.wereSourcesRemovedOrDeleted) {
+        return true;
+      }
+      var changedSources = event.changedSources;
+      return changedSources.length > 2 ||
+          (changedSources.length == 1 && !changedSources.contains(_cache.source));
+    }
+
+    if (shouldDiscardCache(event)) {
+      _discardCache();
+    }
+  }
+
+  /**
+   * Discard the sourcesChanged subscription if any
+   */
+  void _discardCache() {
+    if (_sourcesChangedSubscription != null) {
+      _sourcesChangedSubscription.cancel();
+      _sourcesChangedSubscription = null;
+    }
+    _cache = null;
+  }
 }
diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
index f176c08..586b659 100644
--- a/pkg/analysis_server/lib/src/domain_execution.dart
+++ b/pkg/analysis_server/lib/src/domain_execution.dart
@@ -157,9 +157,7 @@
         kind = ExecutableKind.SERVER;
       }
       server.sendNotification(
-          new ExecutionLaunchDataParams(
-              filePath,
-              kind: kind).toNotification());
+          new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
     } else if (AnalysisEngine.isHtmlFileName(filePath)) {
       List<Source> libraries = context.getLibrariesReferencedFromHtml(source);
       server.sendNotification(
@@ -173,8 +171,8 @@
    * Return `true` if the given [filePath] represents a file that is in an
    * analysis root.
    */
-  bool _isInAnalysisRoot(String filePath)
-      => server.contextDirectoryManager.isInAnalysisRoot(filePath);
+  bool _isInAnalysisRoot(String filePath) =>
+      server.contextDirectoryManager.isInAnalysisRoot(filePath);
 
   void _reportCurrentFileStatus() {
     for (AnalysisContext context in server.getAnalysisContexts()) {
@@ -199,12 +197,13 @@
       for (Source source in context.htmlSources) {
         String filePath = source.fullName;
         if (_isInAnalysisRoot(filePath)) {
-          List<Source> libraries = context.getLibrariesReferencedFromHtml(source);
+          List<Source> libraries =
+              context.getLibrariesReferencedFromHtml(source);
           server.sendNotification(
               new ExecutionLaunchDataParams(
                   filePath,
                   referencedFiles: _getFullNames(libraries)).toNotification());
-          }
+        }
       }
     }
   }
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart
index 07f87b0..bdd2266 100644
--- a/pkg/analysis_server/lib/src/domain_server.dart
+++ b/pkg/analysis_server/lib/src/domain_server.dart
@@ -37,7 +37,7 @@
       if (requestName == SERVER_GET_VERSION) {
         return getVersion(request);
       } else if (requestName == SERVER_SET_SUBSCRIPTIONS) {
-          return setSubscriptions(request);
+        return setSubscriptions(request);
       } else if (requestName == SERVER_SHUTDOWN) {
         return shutdown(request);
       }
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 693200e..ad08575 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -372,6 +372,9 @@
       if (nodes.isNotEmpty && elements.isNotEmpty) {
         AstNode node = nodes[0];
         Element element = elements[0];
+        if (element is FieldFormalParameterElement) {
+          element = (element as FieldFormalParameterElement).field;
+        }
         // climb from "Class" in "new Class()" to "new Class()"
         if (node.parent is TypeName &&
             node.parent.parent is ConstructorName &&
diff --git a/pkg/analysis_server/lib/src/get_handler.dart b/pkg/analysis_server/lib/src/get_handler.dart
index a13bcf6..96a000b 100644
--- a/pkg/analysis_server/lib/src/get_handler.dart
+++ b/pkg/analysis_server/lib/src/get_handler.dart
@@ -10,7 +10,6 @@
 
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/domain_completion.dart';
-import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -29,9 +28,10 @@
   static const String STATUS_PATH = '/status';
 
   /**
-   * The path used to request code completion information.
+   * The path used to request information about the cache entry corresponding
+   * to a single file.
    */
-  static const String COMPLETION_PATH = '/completion';
+  static const String CACHE_ENTRY_PATH = '/cache_entry';
 
   /**
    * The path used to request the list of source files in a certain cache
@@ -40,6 +40,11 @@
   static const String CACHE_STATE_PATH = '/cache_state';
 
   /**
+   * The path used to request code completion information.
+   */
+  static const String COMPLETION_PATH = '/completion';
+
+  /**
    * Query parameter used to represent the cache state to search for, when
    * accessing [CACHE_STATE_PATH].
    */
@@ -47,7 +52,7 @@
 
   /**
    * Query parameter used to represent the context to search for, when
-   * accessing [CACHE_STATE_PATH].
+   * accessing [CACHE_ENTRY_PATH] or [CACHE_STATE_PATH].
    */
   static const String CONTEXT_QUERY_PARAM = 'context';
 
@@ -58,6 +63,12 @@
   static const String DESCRIPTOR_QUERY_PARAM = 'descriptor';
 
   /**
+   * Query parameter used to represent the source to search for, when accessing
+   * [CACHE_ENTRY_PATH].
+   */
+  static const String SOURCE_QUERY_PARAM = 'entry';
+
+  /**
    * The socket server whose status is to be reported on.
    */
   SocketServer _server;
@@ -81,6 +92,8 @@
       _returnServerStatus(request);
     } else if (path == CACHE_STATE_PATH) {
       _returnCacheState(request);
+    } else if (path == CACHE_ENTRY_PATH) {
+      _returnCacheEntry(request);
     } else if (path == COMPLETION_PATH) {
       _returnCompletionInfo(request);
     } else {
@@ -98,6 +111,132 @@
   }
 
   /**
+   * Generate a table showing the cache values corresponding to the given
+   * [descriptors], using [getState] to get the cache state corresponding to
+   * each descriptor, and [getValue] to get the cached value corresponding to
+   * each descriptor.  Append the resulting HTML to [response].
+   */
+  void _outputDescriptorTable(HttpResponse response,
+      List<DataDescriptor> descriptors, CacheState getState(DataDescriptor), dynamic
+      getValue(DataDescriptor)) {
+    response.write('<dl>');
+    for (DataDescriptor descriptor in descriptors) {
+      String descriptorName = HTML_ESCAPE.convert(descriptor.toString());
+      String descriptorState =
+          HTML_ESCAPE.convert(getState(descriptor).toString());
+      response.write('<dt>$descriptorName ($descriptorState)</dt><dd>');
+      try {
+        _outputValueAsHtml(response, getValue(descriptor));
+      } catch (exception) {
+        response.write('(${HTML_ESCAPE.convert(exception.toString())})');
+      }
+      response.write('</dd>');
+    }
+    response.write('</dl>');
+  }
+
+  /**
+   * Render the given [value] as HTML and append it to [response].
+   */
+  void _outputValueAsHtml(HttpResponse response, dynamic value) {
+    if (value == null) {
+      response.write('<i>null</i>');
+    } else if (value is String) {
+      response.write('<pre>${HTML_ESCAPE.convert(value)}</pre>');
+    } else if (value is List) {
+      response.write('${value.length} entries');
+      response.write('<ul>');
+      for (var entry in value) {
+        response.write('<li>');
+        _outputValueAsHtml(response, entry);
+        response.write('</li>');
+      }
+      response.write('</ul>');
+    } else {
+      response.write(HTML_ESCAPE.convert(value.toString()));
+      response.write(
+          ' <i>(${HTML_ESCAPE.convert(value.runtimeType.toString())})</i>');
+    }
+  }
+
+  /**
+   * Return a response containing information about a single source file in the
+   * cache.
+   */
+  void _returnCacheEntry(HttpRequest request) {
+    // Figure out which context is being searched for.
+    String contextFilter = request.uri.queryParameters[CONTEXT_QUERY_PARAM];
+    if (contextFilter == null) {
+      return _returnFailure(
+          request,
+          'Query parameter $CONTEXT_QUERY_PARAM required');
+    }
+
+    // Figure out which CacheEntry is being searched for.
+    String sourceUri = request.uri.queryParameters[SOURCE_QUERY_PARAM];
+    if (sourceUri == null) {
+      return _returnFailure(
+          request,
+          'Query parameter $SOURCE_QUERY_PARAM required');
+    }
+
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      return _returnFailure(request, 'Analysis server not running');
+    }
+    HttpResponse response = request.response;
+    response.statusCode = HttpStatus.OK;
+    response.headers.add(HttpHeaders.CONTENT_TYPE, "text/html");
+    response.write('<html>');
+    response.write('<head>');
+    response.write('<title>Dart Analysis Server - Search result</title>');
+    response.write('</head>');
+    response.write('<body>');
+    response.write('<h1>');
+    response.write('File ${HTML_ESCAPE.convert(sourceUri)}');
+    response.write(' in context ${HTML_ESCAPE.convert(contextFilter)}');
+    response.write('</h1>');
+    analysisServer.folderMap.forEach(
+        (Folder folder, AnalysisContextImpl context) {
+      if (folder.path != contextFilter) {
+        return;
+      }
+      Source source = context.sourceFactory.forUri(sourceUri);
+      if (source == null) {
+        response.write('<p>Not found.</p>');
+        return;
+      }
+      SourceEntry entry = context.getReadableSourceEntryOrNull(source);
+      if (entry == null) {
+        response.write('<p>Not found.</p>');
+        return;
+      }
+      response.write('<h2>File info:</h2><dl>');
+      _outputDescriptorTable(
+          response,
+          entry.descriptors,
+          entry.getState,
+          entry.getValue);
+      if (entry is DartEntry) {
+        for (Source librarySource in entry.containingLibraries) {
+          String libraryName = HTML_ESCAPE.convert(librarySource.fullName);
+          response.write('<h2>In library $libraryName:</h2>');
+          _outputDescriptorTable(
+              response,
+              entry.libraryDescriptors,
+              (DataDescriptor descriptor) =>
+                  entry.getStateInLibrary(descriptor, librarySource),
+              (DataDescriptor descriptor) =>
+                  entry.getValueInLibrary(descriptor, librarySource));
+        }
+      }
+    });
+    response.write('</body>');
+    response.write('</html>');
+    response.close();
+  }
+
+  /**
    * Return a response indicating the set of source files in a certain cache
    * state.
    */
@@ -168,7 +307,11 @@
         if (state != stateFilter || rowDesc.toString() != descriptorFilter) {
           return;
         }
-        response.write('<li>${HTML_ESCAPE.convert(source.fullName)}</li>');
+        String link = _makeLink(CACHE_ENTRY_PATH, {
+          CONTEXT_QUERY_PARAM: folder.path,
+          SOURCE_QUERY_PARAM: source.uri.toString()
+        }, HTML_ESCAPE.convert(source.fullName));
+        response.write('<li>$link</li>');
         count++;
       });
     });
@@ -407,7 +550,7 @@
         response.write('</td>');
       }
     }
-    ;
+
     response.write('</tr>');
   }
 }
diff --git a/pkg/analysis_server/lib/src/operation/operation.dart b/pkg/analysis_server/lib/src/operation/operation.dart
index e7ce47a..5ae3e10 100644
--- a/pkg/analysis_server/lib/src/operation/operation.dart
+++ b/pkg/analysis_server/lib/src/operation/operation.dart
@@ -8,29 +8,6 @@
 
 
 /**
- * The enumeration [ServerOperationPriority] defines the priority levels used
- * to organize [ServerOperation]s in an optimal order. A smaller ordinal value
- * equates to a higher priority.
- */
-class ServerOperationPriority {
-  final int ordinal;
-  final String name;
-
-  static const int COUNT = 4;
-
-  static const ServerOperationPriority ANALYSIS_CONTINUE = const ServerOperationPriority._(0, "ANALYSIS_CONTINUE");
-  static const ServerOperationPriority ANALYSIS = const ServerOperationPriority._(1, "ANALYSIS");
-  static const ServerOperationPriority SEARCH = const ServerOperationPriority._(2, "SEARCH");
-  static const ServerOperationPriority REFACTORING = const ServerOperationPriority._(3, "REFACTORING");
-
-  @override
-  String toString() => name;
-
-  const ServerOperationPriority._(this.ordinal, this.name);
-}
-
-
-/**
  * The class [ServerOperation] defines the behavior of objects used to perform
  * operations on a [AnalysisServer].
  */
@@ -45,3 +22,30 @@
    */
   void perform(AnalysisServer server);
 }
+
+
+/**
+ * The enumeration [ServerOperationPriority] defines the priority levels used
+ * to organize [ServerOperation]s in an optimal order. A smaller ordinal value
+ * equates to a higher priority.
+ */
+class ServerOperationPriority {
+  static const int COUNT = 4;
+  static const ServerOperationPriority ANALYSIS_CONTINUE =
+      const ServerOperationPriority._(0, "ANALYSIS_CONTINUE");
+
+  static const ServerOperationPriority ANALYSIS =
+      const ServerOperationPriority._(1, "ANALYSIS");
+
+  static const ServerOperationPriority SEARCH =
+      const ServerOperationPriority._(2, "SEARCH");
+  static const ServerOperationPriority REFACTORING =
+      const ServerOperationPriority._(3, "REFACTORING");
+  final int ordinal;
+  final String name;
+
+  const ServerOperationPriority._(this.ordinal, this.name);
+
+  @override
+  String toString() => name;
+}
diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart
index c033185..b26c677 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -7,8 +7,8 @@
 import 'dart:collection';
 
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart';
 
 
 /**
@@ -30,11 +30,18 @@
   }
 
   /**
+   * Returns `true` if there are no queued [ServerOperation]s.
+   */
+  bool get isEmpty {
+    return _queues.every((queue) => queue.isEmpty);
+  }
+
+  /**
    * Adds the given operation to this queue. The exact position in the queue
    * depends on the priority of the given operation relative to the priorities
    * of the other operations in the queue.
    */
-   void add(ServerOperation operation) {
+  void add(ServerOperation operation) {
     int queueIndex = operation.priority.ordinal;
     Queue<ServerOperation> queue = _queues[queueIndex];
     queue.addLast(operation);
@@ -50,13 +57,6 @@
   }
 
   /**
-   * Returns `true` if there are no queued [ServerOperation]s.
-   */
-  bool get isEmpty {
-    return _queues.every((queue) => queue.isEmpty);
-  }
-
-  /**
    * Returns the next operation to perform or `null` if empty.
    */
   ServerOperation take() {
@@ -80,4 +80,3 @@
     return null;
   }
 }
-
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index d2afd17..2a6e978 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -232,6 +232,34 @@
 
 
 /**
+ * Type of callbacks used to decode parts of JSON objects.  [jsonPath] is a
+ * string describing the part of the JSON object being decoded, and [value] is
+ * the part to decode.
+ */
+typedef Object JsonDecoderCallback(String jsonPath, Object value);
+
+
+/**
+ * Instances of the class [DomainHandler] implement a [RequestHandler] and
+ * also startup and shutdown methods.
+ */
+abstract class DomainHandler extends RequestHandler {
+  /**
+   * Perform any operations associated with the shutdown of the domain. It is
+   * not guaranteed that this method will be called. If it is, it will be
+   * called after the last [Request] has been made.
+   */
+  void shutdown() {}
+
+  /**
+   * Perform any operations associated with the startup of the domain. This
+   * will be called before the first [Request].
+   */
+  void startup() {}
+}
+
+
+/**
  * Classes implementing [Enum] represent enumerated types in the protocol.
  */
 abstract class Enum {
@@ -244,14 +272,6 @@
 
 
 /**
- * Type of callbacks used to decode parts of JSON objects.  [jsonPath] is a
- * string describing the part of the JSON object being decoded, and [value] is
- * the part to decode.
- */
-typedef Object JsonDecoderCallback(String jsonPath, Object value);
-
-
-/**
  * Instances of the class [HasToJson] implement [toJson] method that returns
  * a JSON presentation.
  */
@@ -269,6 +289,13 @@
  */
 abstract class JsonDecoder {
   /**
+   * Retrieve the RefactoringKind that should be assumed when decoding
+   * refactoring feedback objects, or null if no refactoring feedback object is
+   * expected to be encountered.
+   */
+  RefactoringKind get refactoringKind;
+
+  /**
    * Create an exception to throw if the JSON object at [jsonPath] fails to
    * match the API definition of [expected].
    */
@@ -281,13 +308,6 @@
   dynamic missingKey(String jsonPath, String key);
 
   /**
-   * Retrieve the RefactoringKind that should be assumed when decoding
-   * refactoring feedback objects, or null if no refactoring feedback object is
-   * expected to be encountered.
-   */
-  RefactoringKind get refactoringKind;
-
-  /**
    * Decode a JSON object that is expected to be a boolean.  The strings "true"
    * and "false" are also accepted.
    */
@@ -457,7 +477,6 @@
   }
 }
 
-
 /**
  * Instances of the class [Request] represent a request that was received.
  */
@@ -553,6 +572,7 @@
   }
 }
 
+
 /**
  * JsonDecoder for decoding requests.  Errors are reporting by throwing a
  * [RequestFailure].
@@ -565,6 +585,11 @@
 
   RequestDecoder(this._request);
 
+  RefactoringKind get refactoringKind {
+    // Refactoring feedback objects should never appear in requests.
+    return null;
+  }
+
   @override
   dynamic mismatch(String jsonPath, String expected) {
     return new RequestFailure(
@@ -579,14 +604,8 @@
             jsonPath,
             'contain key ${JSON.encode(key)}'));
   }
-
-  RefactoringKind get refactoringKind {
-    // Refactoring feedback objects should never appear in requests.
-    return null;
-  }
 }
 
-
 /**
  * Instances of the class [RequestFailure] represent an exception that occurred
  * during the handling of a request that requires that an error be returned to
@@ -619,25 +638,6 @@
 }
 
 /**
- * Instances of the class [DomainHandler] implement a [RequestHandler] and
- * also startup and shutdown methods.
- */
-abstract class DomainHandler extends RequestHandler {
-  /**
-   * Perform any operations associated with the startup of the domain. This
-   * will be called before the first [Request].
-   */
-  void startup() { }
-
-  /**
-   * Perform any operations associated with the shutdown of the domain. It is
-   * not guaranteed that this method will be called. If it is, it will be
-   * called after the last [Request] has been made.
-   */
-  void shutdown() { }
-}
-
-/**
  * Instances of the class [Response] represent a response to a request.
  */
 class Response {
@@ -777,9 +777,9 @@
    * by a `analysis.setPriorityFiles` [request] that includes one or more files
    * that are not being analyzed.
    */
-  Response.unanalyzedPriorityFiles(Request request, String fileNames)
+  Response.unanalyzedPriorityFiles(String requestId, String fileNames)
       : this(
-          request.id,
+          requestId,
           error: new RequestError(
               RequestErrorCode.UNANALYZED_PRIORITY_FILES,
               "Unanalyzed files cannot be a priority: '$fileNames'"));
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 971e527..b783e84 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -91,6 +91,29 @@
 /**
  * Construct based on a value from the analyzer engine.
  */
+Element newElement_fromEngine(engine.Element element) {
+  String name = element.displayName;
+  String elementParameters = _getParametersString(element);
+  String elementReturnType = _getReturnTypeString(element);
+  return new Element(
+      newElementKind_fromEngine(element.kind),
+      name,
+      Element.makeFlags(
+          isPrivate: element.isPrivate,
+          isDeprecated: element.isDeprecated,
+          isAbstract: _isAbstract(element),
+          isConst: _isConst(element),
+          isFinal: _isFinal(element),
+          isStatic: _isStatic(element)),
+      location: newLocation_fromElement(element),
+      parameters: elementParameters,
+      returnType: elementReturnType);
+}
+
+
+/**
+ * Construct based on a value from the analyzer engine.
+ */
 ElementKind newElementKind_fromEngine(engine.ElementKind kind) {
   if (kind == engine.ElementKind.CLASS) {
     return ElementKind.CLASS;
@@ -145,29 +168,6 @@
 
 
 /**
- * Construct based on a value from the analyzer engine.
- */
-Element newElement_fromEngine(engine.Element element) {
-  String name = element.displayName;
-  String elementParameters = _getParametersString(element);
-  String elementReturnType = _getReturnTypeString(element);
-  return new Element(
-      newElementKind_fromEngine(element.kind),
-      name,
-      Element.makeFlags(
-          isPrivate: element.isPrivate,
-          isDeprecated: element.isDeprecated,
-          isAbstract: _isAbstract(element),
-          isConst: _isConst(element),
-          isFinal: _isFinal(element),
-          isStatic: _isStatic(element)),
-      location: newLocation_fromElement(element),
-      parameters: elementParameters,
-      returnType: elementReturnType);
-}
-
-
-/**
  * Create a Location based on an [engine.Element].
  */
 Location newLocation_fromElement(engine.Element element) {
@@ -240,6 +240,17 @@
 /**
  * Construct based on a value from the search engine.
  */
+SearchResult newSearchResult_fromMatch(engine.SearchMatch match) {
+  SearchResultKind kind = newSearchResultKind_fromEngine(match.kind);
+  Location location = newLocation_fromMatch(match);
+  List<Element> path = _computePath(match.element);
+  return new SearchResult(location, kind, !match.isResolved, path);
+}
+
+
+/**
+ * Construct based on a value from the search engine.
+ */
 SearchResultKind newSearchResultKind_fromEngine(engine.MatchKind kind) {
   if (kind == engine.MatchKind.DECLARATION) {
     return SearchResultKind.DECLARATION;
@@ -264,17 +275,6 @@
 
 
 /**
- * Construct based on a value from the search engine.
- */
-SearchResult newSearchResult_fromMatch(engine.SearchMatch match) {
-  SearchResultKind kind = newSearchResultKind_fromEngine(match.kind);
-  Location location = newLocation_fromMatch(match);
-  List<Element> path = _computePath(match.element);
-  return new SearchResult(location, kind, !match.isResolved, path);
-}
-
-
-/**
  * Construct based on a SourceRange.
  */
 SourceEdit newSourceEdit_range(engine.SourceRange range, String replacement,
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index a2aa59e..b7c6a26 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -105,13 +105,6 @@
     return newSearchResult_fromMatch(match);
   }
 
-  static bool _isMemberElement(Element element) {
-    if (element is ConstructorElement) {
-      return false;
-    }
-    return element.enclosingElement is ClassElement;
-  }
-
   static bool _isDeclarationInteresting(Element element) {
     if (element is LabelElement) {
       return true;
@@ -130,6 +123,13 @@
     }
     return false;
   }
+
+  static bool _isMemberElement(Element element) {
+    if (element is ConstructorElement) {
+      return false;
+    }
+    return element.enclosingElement is ClassElement;
+  }
 }
 
 
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
index 6c0eaeb..f52420b 100644
--- a/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
@@ -119,8 +119,7 @@
   }
 
   @override
-  void declaredField(FieldDeclaration fieldDecl,
-      VariableDeclaration varDecl) {
+  void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
   }
 
   @override
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
index 2253056..10b1486 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
@@ -13,18 +13,72 @@
 import 'package:analyzer/src/generated/source.dart';
 
 /**
+ * [CompletionCache] contains information about the prior code completion
+ * for use in the next code completion.
+ */
+abstract class CompletionCache {
+
+  /**
+   * The context in which the completion was computed.
+   */
+  final AnalysisContext context;
+
+  /**
+   * The source in which the completion was computed.
+   */
+  final Source source;
+
+  CompletionCache(this.context, this.source);
+}
+
+/**
  * Manages `CompletionComputer`s for a given completion request.
  */
 abstract class CompletionManager {
 
+  /**
+   * The controller used for returning completion results.
+   */
   StreamController<CompletionResult> controller;
 
+  CompletionManager();
+
+  /**
+   * Create a manager for the given request.
+   */
+  factory CompletionManager.create(AnalysisContext context, Source source,
+      int offset, SearchEngine searchEngine, CompletionCache cache,
+      CompletionPerformance performance) {
+    if (context != null) {
+      if (AnalysisEngine.isDartFileName(source.shortName)) {
+        return new DartCompletionManager.create(
+            context,
+            searchEngine,
+            source,
+            offset,
+            cache,
+            performance);
+      }
+      if (AnalysisEngine.isHtmlFileName(source.shortName)) {
+        //TODO (danrubel) implement
+//        return new HtmlCompletionManager(context, searchEngine, source, offset);
+      }
+    }
+    return new NoOpCompletionManager(source, offset);
+  }
+
+  /**
+   * Return cached information from the current completion operation
+   * if there is any. Subclasses may override this method.
+   */
+  CompletionCache get completionCache => null;
+
   /**
    * Compute completion results and append them to the stream.
-   * Subclasses should override this method, append at least one result
-   * to the [controller], and close the controller stream once complete.
    * Clients should not call this method directly as it is automatically called
    * when a client listens to the stream returned by [results].
+   * Subclasses should override this method, append at least one result
+   * to the [controller], and close the controller stream once complete.
    */
   void compute();
 
@@ -37,28 +91,6 @@
     });
     return controller.stream;
   }
-
-  /**
-   * Create a manager for the given request.
-   */
-  static CompletionManager create(AnalysisContext context, Source source,
-      int offset, SearchEngine searchEngine, CompletionPerformance performance) {
-    if (context != null) {
-      if (AnalysisEngine.isDartFileName(source.shortName)) {
-        return new DartCompletionManager(
-            context,
-            searchEngine,
-            source,
-            offset,
-            performance);
-      }
-      if (AnalysisEngine.isHtmlFileName(source.shortName)) {
-        //TODO (danrubel) implement
-//        return new HtmlCompletionManager(context, searchEngine, source, offset);
-      }
-    }
-    return new NoOpCompletionManager(source, offset);
-  }
 }
 
 /**
@@ -67,7 +99,7 @@
 class CompletionPerformance {
   final Map<String, Duration> _startTimes = new Map<String, Duration>();
   final Stopwatch _stopwatch = new Stopwatch();
-  final List<OperationPerformance> operations = [];
+  final List<OperationPerformance> operations = <OperationPerformance>[];
 
   CompletionPerformance() {
     _stopwatch.start();
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
new file mode 100644
index 0000000..2053b34
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
@@ -0,0 +1,217 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library services.completion.dart.cache;
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analysis_server/src/protocol_server.dart' hide Element,
+    ElementKind;
+import 'package:analysis_server/src/services/completion/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * The `DartCompletionCache` contains cached information from a prior code
+ * completion operation.
+ */
+class DartCompletionCache extends CompletionCache {
+
+  /**
+   * A hash of the import directives
+   * or `null` if nothing has been cached.
+   */
+  String _importKey;
+
+  /**
+   * Library prefix suggestions based upon imports,
+   * or `null` if nothing has been cached.
+   */
+  List<CompletionSuggestion> libraryPrefixSuggestions;
+
+  /**
+   * Type suggestions based upon imports,
+   * or `null` if nothing has been cached.
+   */
+  List<CompletionSuggestion> importedTypeSuggestions;
+
+  /**
+   * Suggestions for methods and functions that have void return type,
+   * or `null` if nothing has been cached.
+   */
+  List<CompletionSuggestion> importedVoidReturnSuggestions;
+
+  /**
+   * Other suggestions based upon imports,
+   * or `null` if nothing has been cached.
+   */
+  List<CompletionSuggestion> otherImportedSuggestions;
+
+  /**
+   * A collection of all imported completions
+   * or `null` if nothing has been cached.
+   */
+  HashSet<String> _importedCompletions;
+
+  /**
+   * A map of simple identifier to imported class element
+   * or `null` if nothing has been cached.
+   */
+  Map<String, ClassElement> importedClassMap;
+
+  DartCompletionCache(AnalysisContext context, Source source)
+      : super(context, source);
+
+  /**
+   * Return a hash of the import directives for the cached import info
+   * or `null` if nothing has been cached.
+   */
+  String get importKey => _importKey;
+
+  /**
+   * Compute suggestions based upon the imports in the given compilation unit.
+   * Return a future that completes when the information has been cached.
+   */
+  Future<bool> computeImportInfo(CompilationUnit unit,
+      SearchEngine searchEngine) {
+    importedTypeSuggestions = <CompletionSuggestion>[];
+    libraryPrefixSuggestions = <CompletionSuggestion>[];
+    otherImportedSuggestions = <CompletionSuggestion>[];
+    importedVoidReturnSuggestions = <CompletionSuggestion>[];
+    importedClassMap = new Map<String, ClassElement>();
+    _importedCompletions = new HashSet<String>();
+
+    // Exclude elements from local library
+    // because they are provided by LocalComputer
+    Set<LibraryElement> excludedLibs = new Set<LibraryElement>();
+    excludedLibs.add(unit.element.enclosingElement);
+
+    // Include explicitly imported elements
+    unit.directives.forEach((Directive directive) {
+      if (directive is ImportDirective) {
+        ImportElement importElem = directive.element;
+        if (importElem != null && importElem.importedLibrary != null) {
+          if (directive.prefix == null) {
+            Namespace importNamespace =
+                new NamespaceBuilder().createImportNamespaceForDirective(importElem);
+            // Include top level elements
+            importNamespace.definedNames.forEach((String name, Element elem) {
+              if (elem is ClassElement) {
+                importedClassMap[name] = elem;
+              }
+              addSuggestion(elem, CompletionRelevance.DEFAULT);
+            });
+          } else {
+            // Exclude elements from prefixed imports
+            // because they are provided by InvocationComputer
+            excludedLibs.add(importElem.importedLibrary);
+            _addLibraryPrefixSuggestion(importElem);
+          }
+        }
+      }
+    });
+
+    // Include implicitly imported dart:core elements
+    Source coreUri = context.sourceFactory.forUri('dart:core');
+    LibraryElement coreLib = context.getLibraryElement(coreUri);
+    Namespace coreNamespace =
+        new NamespaceBuilder().createPublicNamespaceForLibrary(coreLib);
+    coreNamespace.definedNames.forEach((String name, Element elem) {
+      if (elem is ClassElement) {
+        importedClassMap[name] = elem;
+      }
+      addSuggestion(elem, CompletionRelevance.DEFAULT);
+    });
+
+    // Add non-imported elements as low relevance
+    var future = searchEngine.searchTopLevelDeclarations('');
+    return future.then((List<SearchMatch> matches) {
+      matches.forEach((SearchMatch match) {
+        if (match.kind == MatchKind.DECLARATION) {
+          Element element = match.element;
+          if (element.isPublic &&
+              !excludedLibs.contains(element.library) &&
+              !_importedCompletions.contains(element.displayName)) {
+            addSuggestion(element, CompletionRelevance.LOW);
+          }
+        }
+      });
+      _importKey = _computeImportKey(unit);
+      return true;
+    });
+  }
+
+  /**
+   * Return `true` if the import information is cached for the given
+   * compilation unit.
+   */
+  bool isImportInfoCached(CompilationUnit unit) =>
+      _importKey != null && _importKey == _computeImportKey(unit);
+
+  void _addLibraryPrefixSuggestion(ImportElement importElem) {
+    CompletionSuggestion suggestion = null;
+    String completion = importElem.prefix.displayName;
+    if (completion != null && completion.length > 0) {
+      suggestion = new CompletionSuggestion(
+          CompletionSuggestionKind.INVOCATION,
+          CompletionRelevance.DEFAULT,
+          completion,
+          completion.length,
+          0,
+          importElem.isDeprecated,
+          false);
+      LibraryElement lib = importElem.importedLibrary;
+      if (lib != null) {
+        suggestion.element = newElement_fromEngine(lib);
+      }
+      libraryPrefixSuggestions.add(suggestion);
+      _importedCompletions.add(suggestion.completion);
+    }
+  }
+
+  void addSuggestion(Element element, CompletionRelevance relevance) {
+
+    if (element is ExecutableElement) {
+      if (element.isOperator) {
+        return;
+      }
+    }
+
+    CompletionSuggestion suggestion =
+        createElementSuggestion(element, relevance: relevance);
+
+    if (element is ExecutableElement) {
+      DartType returnType = element.returnType;
+      if (returnType != null && returnType.isVoid) {
+        importedVoidReturnSuggestions.add(suggestion);
+      } else {
+        otherImportedSuggestions.add(suggestion);
+      }
+    } else if (element is ClassElement) {
+      importedTypeSuggestions.add(suggestion);
+    } else {
+      otherImportedSuggestions.add(suggestion);
+    }
+    _importedCompletions.add(suggestion.completion);
+  }
+
+  /**
+   * Compute the hash of the imports for the given compilation unit.
+   */
+  String _computeImportKey(CompilationUnit unit) {
+    StringBuffer sb = new StringBuffer();
+    unit.directives.forEach((Directive directive) {
+      if (directive is ImportDirective) {
+        sb.write(directive.toSource());
+      }
+    });
+    return sb.toString();
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
index bc742d4..217ee6c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library test.services.completion.dart;
+library services.completion.dart;
 
 import 'dart:async';
 
@@ -10,6 +10,7 @@
 import 'package:analysis_server/src/services/completion/arglist_computer.dart';
 import 'package:analysis_server/src/services/completion/combinator_computer.dart';
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/imported_computer.dart';
 import 'package:analysis_server/src/services/completion/invocation_computer.dart';
 import 'package:analysis_server/src/services/completion/keyword_computer.dart';
@@ -47,22 +48,54 @@
  * Manages code completion for a given Dart file completion request.
  */
 class DartCompletionManager extends CompletionManager {
+  final DartCompletionRequest request;
   final AnalysisContext context;
   final Source source;
   final int offset;
   final CompletionPerformance performance;
-  DartCompletionRequest request;
+  final DartCompletionCache cache;
   List<DartCompletionComputer> computers;
 
-  DartCompletionManager(this.context, SearchEngine searchEngine, this.source,
-      this.offset, this.performance) {
-    request = new DartCompletionRequest(context, searchEngine, source, offset);
+  DartCompletionManager(this.request, this.context, this.source, this.offset,
+      this.cache, this.performance)
+      : computers = [
+          new KeywordComputer(),
+          new LocalComputer(),
+          new ArgListComputer(),
+          new CombinatorComputer(),
+          new ImportedComputer(),
+          new InvocationComputer()];
+
+  /**
+   * Create a new initialized Dart source completion manager
+   */
+  factory DartCompletionManager.create(AnalysisContext context,
+      SearchEngine searchEngine, Source source, int offset, CompletionCache oldCache,
+      CompletionPerformance performance) {
+    DartCompletionCache newCache;
+    if (oldCache is DartCompletionCache) {
+      if (oldCache.context == context && oldCache.source == source) {
+        newCache = oldCache;
+      }
+    }
+    if (newCache == null) {
+      newCache = new DartCompletionCache(context, source);
+    }
+    return new DartCompletionManager(
+        new DartCompletionRequest(context, searchEngine, source, offset, newCache),
+        context,
+        source,
+        offset,
+        newCache,
+        performance);
   }
 
   @override
+  CompletionCache get completionCache => cache;
+
+  @override
   void compute() {
     performance.logElapseTime('compute', () {
-      initComputers();
       computeFast();
       if (!computers.isEmpty) {
         computeFull();
@@ -124,21 +157,6 @@
   }
 
   /**
-   * Build and initialize the list of completion computers
-   */
-  void initComputers() {
-    if (computers == null) {
-      computers = [
-          new KeywordComputer(),
-          new LocalComputer(),
-          new ArgListComputer(),
-          new CombinatorComputer(),
-          new ImportedComputer(),
-          new InvocationComputer()];
-    }
-  }
-
-  /**
    * Send the current list of suggestions to the client.
    */
   void sendResults(bool last) {
@@ -196,6 +214,11 @@
   final int offset;
 
   /**
+   * Cached information from a prior code completion operation.
+   */
+  final DartCompletionCache cache;
+
+  /**
    * The compilation unit in which the completion was requested. This unit
    * may or may not be resolved when [DartCompletionComputer.computeFast]
    * is called but is resolved when [DartCompletionComputer.computeFull].
@@ -228,10 +251,10 @@
   /**
    * The list of suggestions to be sent to the client.
    */
-  final List<CompletionSuggestion> suggestions = [];
+  final List<CompletionSuggestion> suggestions = <CompletionSuggestion>[];
 
   DartCompletionRequest(this.context, this.searchEngine, this.source,
-      this.offset);
+      this.offset, this.cache);
 }
 
 /**
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
index 73f972b..0ac302a 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
@@ -5,387 +5,317 @@
 library services.completion.computer.dart.toplevel;
 
 import 'dart:async';
+import 'dart:collection';
 
 import 'package:analysis_server/src/protocol_server.dart' hide Element,
     ElementKind;
+import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
-import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/source.dart';
 
 /**
  * A computer for calculating imported class and top level variable
  * `completion.getSuggestions` request results.
  */
 class ImportedComputer extends DartCompletionComputer {
+  _ImportedSuggestionBuilder builder;
 
   @override
   bool computeFast(DartCompletionRequest request) {
-    // TODO: implement computeFast
-    // - compute results based upon current search, then replace those results
-    // during the full compute phase
-    // - filter results based upon completion offset
-    return false;
+    builder = request.node.accept(new _ImportedAstVisitor(request));
+    if (builder != null) {
+      return builder.computeFast(request.node);
+    }
+    return true;
   }
 
   @override
   Future<bool> computeFull(DartCompletionRequest request) {
-    return request.node.accept(new _ImportedVisitor(request));
+    if (builder != null) {
+      return builder.computeFull(request.node);
+    }
+    return new Future.value(false);
   }
 }
 
 /**
- * A visitor for determining which imported classes and top level variables
- * should be suggested and building those suggestions.
+ * [_ImportedAstVisitor] determines whether an import suggestions are needed
+ * and instantiates the builder to create those suggestions.
  */
-class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
+class _ImportedAstVisitor extends
+    GeneralizingAstVisitor<_ImportedSuggestionBuilder> {
   final DartCompletionRequest request;
 
-  _ImportedVisitor(this.request);
+  _ImportedAstVisitor(this.request);
 
   @override
-  Future<bool> visitArgumentList(ArgumentList node) {
-    return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+  _ImportedSuggestionBuilder visitArgumentList(ArgumentList node) {
+    return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
   }
 
   @override
-  Future<bool> visitBlock(Block node) {
-    return _addImportedElementSuggestions(node);
+  _ImportedSuggestionBuilder visitBlock(Block node) {
+    return new _ImportedSuggestionBuilder(request);
   }
 
   @override
-  Future<bool> visitCascadeExpression(CascadeExpression node) {
+  _ImportedSuggestionBuilder visitCascadeExpression(CascadeExpression node) {
     // Make suggestions for the target, but not for the selector
     // InvocationComputer makes selector suggestions
     Expression target = node.target;
     if (target != null && request.offset <= target.end) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitClassDeclaration(ClassDeclaration node) {
+  _ImportedSuggestionBuilder visitClassDeclaration(ClassDeclaration node) {
     // Make suggestions in the body of the class declaration
     Token leftBracket = node.leftBracket;
     if (leftBracket != null && request.offset >= leftBracket.end) {
-      return _addImportedElementSuggestions(node);
+      return new _ImportedSuggestionBuilder(request);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitExpression(Expression node) {
-    return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+  _ImportedSuggestionBuilder visitExpression(Expression node) {
+    return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
   }
 
   @override
-  Future<bool> visitExpressionStatement(ExpressionStatement node) {
+  _ImportedSuggestionBuilder
+      visitExpressionStatement(ExpressionStatement node) {
     Expression expression = node.expression;
     // A pre-variable declaration (e.g. C ^) is parsed as an expression
     // statement. Do not make suggestions for the variable name.
     if (expression is SimpleIdentifier && request.offset <= expression.end) {
-      return _addImportedElementSuggestions(node);
+      return new _ImportedSuggestionBuilder(request);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitFormalParameterList(FormalParameterList node) {
+  _ImportedSuggestionBuilder
+      visitFormalParameterList(FormalParameterList node) {
     Token leftParen = node.leftParenthesis;
     if (leftParen != null && request.offset > leftParen.offset) {
       Token rightParen = node.rightParenthesis;
       if (rightParen == null || request.offset <= rightParen.offset) {
-        return _addImportedElementSuggestions(node);
+        return new _ImportedSuggestionBuilder(request);
       }
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitForStatement(ForStatement node) {
+  _ImportedSuggestionBuilder visitForStatement(ForStatement node) {
     Token leftParen = node.leftParenthesis;
     if (leftParen != null && request.offset >= leftParen.end) {
-      return _addImportedElementSuggestions(node);
+      return new _ImportedSuggestionBuilder(request);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitIfStatement(IfStatement node) {
+  _ImportedSuggestionBuilder visitIfStatement(IfStatement node) {
     Token leftParen = node.leftParenthesis;
     if (leftParen != null && request.offset >= leftParen.end) {
       Token rightParen = node.rightParenthesis;
       if (rightParen == null || request.offset <= rightParen.offset) {
-        return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+        return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
       }
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitInterpolationExpression(InterpolationExpression node) {
+  _ImportedSuggestionBuilder
+      visitInterpolationExpression(InterpolationExpression node) {
     Expression expression = node.expression;
     if (expression is SimpleIdentifier) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitMethodInvocation(MethodInvocation node) {
+  _ImportedSuggestionBuilder visitMethodInvocation(MethodInvocation node) {
     Token period = node.period;
     if (period == null || request.offset <= period.offset) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitNode(AstNode node) {
-    return new Future.value(false);
+  _ImportedSuggestionBuilder visitNode(AstNode node) {
+    return null;
   }
 
   @override
-  Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) {
+  _ImportedSuggestionBuilder visitPrefixedIdentifier(PrefixedIdentifier node) {
     // Make suggestions for the prefix, but not for the selector
     // InvocationComputer makes selector suggestions
     Token period = node.period;
     if (period != null && request.offset <= period.offset) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitPropertyAccess(PropertyAccess node) {
+  _ImportedSuggestionBuilder visitPropertyAccess(PropertyAccess node) {
     // Make suggestions for the target, but not for the property name
     // InvocationComputer makes property name suggestions
     var operator = node.operator;
     if (operator != null && request.offset < operator.offset) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
   }
 
   @override
-  Future<bool> visitSimpleIdentifier(SimpleIdentifier node) {
+  _ImportedSuggestionBuilder visitSimpleIdentifier(SimpleIdentifier node) {
     return node.parent.accept(this);
   }
 
   @override
-  Future<bool> visitStringLiteral(StringLiteral node) {
-    return new Future.value(false);
+  _ImportedSuggestionBuilder visitStringLiteral(StringLiteral node) {
+    return null;
   }
 
   @override
-  Future<bool> visitTypeName(TypeName node) {
-    return _addImportedElementSuggestions(node, typesOnly: true);
+  _ImportedSuggestionBuilder visitTypeName(TypeName node) {
+    return new _ImportedSuggestionBuilder(request, typesOnly: true);
   }
 
   @override
-  visitVariableDeclaration(VariableDeclaration node) {
+  _ImportedSuggestionBuilder
+      visitVariableDeclaration(VariableDeclaration node) {
     Token equals = node.equals;
     // Make suggestions for the RHS of a variable declaration
     if (equals != null && request.offset >= equals.end) {
-      return _addImportedElementSuggestions(node, excludeVoidReturn: true);
+      return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
     }
-    return new Future.value(false);
+    return null;
+  }
+}
+
+/**
+ * [_ImportedSuggestionBuilder] traverses the imports and builds suggestions
+ * based upon imported elements.
+ */
+class _ImportedSuggestionBuilder implements SuggestionBuilder {
+  final DartCompletionRequest request;
+  final bool typesOnly;
+  final bool excludeVoidReturn;
+  DartCompletionCache cache;
+
+  _ImportedSuggestionBuilder(this.request, {this.typesOnly: false,
+      this.excludeVoidReturn: false}) {
+    cache = request.cache;
   }
 
-  void _addElementSuggestion(Element element, bool typesOnly,
-      bool excludeVoidReturn, CompletionRelevance relevance) {
-
-    if (element is ExecutableElement) {
-      if (element.isOperator) {
-        return;
-      }
-      if (excludeVoidReturn) {
-        DartType returnType = element.returnType;
-        if (returnType != null && returnType.isVoid) {
-          return;
-        }
-      }
+  /**
+   * If the needed information is cached, then add suggestions and return `true`
+   * else return `false` indicating that additional work is necessary.
+   */
+  bool computeFast(AstNode node) {
+    CompilationUnit unit = request.unit;
+    if (cache.isImportInfoCached(unit)) {
+      _addInheritedSuggestions(node);
+      _addTopLevelSuggestions();
+      return true;
     }
-    if (typesOnly && element is! ClassElement) {
-      return;
-    }
-
-    String completion = element.displayName;
-    CompletionSuggestion suggestion = new CompletionSuggestion(
-        CompletionSuggestionKind.INVOCATION,
-        element.isDeprecated ? CompletionRelevance.LOW : relevance,
-        completion,
-        completion.length,
-        0,
-        element.isDeprecated,
-        false);
-
-    suggestion.element = newElement_fromEngine(element);
-
-    DartType type;
-    if (element is FunctionElement) {
-      type = element.returnType;
-    } else if (element is PropertyAccessorElement && element.isGetter) {
-      type = element.returnType;
-    } else if (element is TopLevelVariableElement) {
-      type = element.type;
-    }
-    if (type != null) {
-      String name = type.displayName;
-      if (name != null && name.length > 0 && name != 'dynamic') {
-        suggestion.returnType = name;
-      }
-    }
-
-    request.suggestions.add(suggestion);
+    return false;
   }
 
-  void _addElementSuggestions(List<Element> elements, bool typesOnly,
-      bool excludeVoidReturn) {
-    elements.forEach((Element elem) {
-      _addElementSuggestion(
-          elem,
-          typesOnly,
-          excludeVoidReturn,
-          CompletionRelevance.DEFAULT);
+  /**
+   * Compute suggested based upon imported elements.
+   */
+  Future<bool> computeFull(AstNode node) {
+    return cache.computeImportInfo(
+        request.unit,
+        request.searchEngine).then((_) {
+      _addInheritedSuggestions(node);
+      _addTopLevelSuggestions();
+      return true;
     });
   }
 
-  Future<bool> _addImportedElementSuggestions(AstNode node, {bool typesOnly:
-      false, bool excludeVoidReturn: false}) {
-
-    // Exclude elements from local library
-    // because they are provided by LocalComputer
-    Set<LibraryElement> excludedLibs = new Set<LibraryElement>();
-    excludedLibs.add(request.unit.element.enclosingElement);
-
-    // Include explicitly imported elements
-    Map<String, ClassElement> classMap = new Map<String, ClassElement>();
-    request.unit.directives.forEach((Directive directive) {
-      if (directive is ImportDirective) {
-        ImportElement importElem = directive.element;
-        if (importElem != null && importElem.importedLibrary != null) {
-          if (directive.prefix == null) {
-            Namespace importNamespace =
-                new NamespaceBuilder().createImportNamespaceForDirective(importElem);
-            // Include top level elements
-            importNamespace.definedNames.forEach((String name, Element elem) {
-              if (elem is ClassElement) {
-                classMap[name] = elem;
-              }
-              _addElementSuggestion(
-                  elem,
-                  typesOnly,
-                  excludeVoidReturn,
-                  CompletionRelevance.DEFAULT);
-            });
-          } else {
-            // Exclude elements from prefixed imports
-            // because they are provided by InvocationComputer
-            excludedLibs.add(importElem.importedLibrary);
-            _addLibraryPrefixSuggestion(importElem);
+  /**
+   * Add imported element suggestions.
+   */
+  void _addElementSuggestions(List<Element> elements) {
+    elements.forEach((Element elem) {
+      if (elem is! ClassElement) {
+        if (typesOnly) {
+          return;
+        }
+        if (elem is ExecutableElement) {
+          if (elem.isOperator) {
+            return;
+          }
+          DartType returnType = elem.returnType;
+          if (returnType != null && returnType.isVoid) {
+            if (excludeVoidReturn) {
+              return;
+            }
           }
         }
       }
+      request.suggestions.add(
+          createElementSuggestion(elem, relevance: CompletionRelevance.DEFAULT));
     });
+  }
 
-    // Include implicitly imported dart:core elements
-    Source coreUri = request.context.sourceFactory.forUri('dart:core');
-    LibraryElement coreLib = request.context.getLibraryElement(coreUri);
-    Namespace coreNamespace =
-        new NamespaceBuilder().createPublicNamespaceForLibrary(coreLib);
-    coreNamespace.definedNames.forEach((String name, Element elem) {
-      if (elem is ClassElement) {
-        classMap[name] = elem;
-      }
-      _addElementSuggestion(
-          elem,
-          typesOnly,
-          excludeVoidReturn,
-          CompletionRelevance.DEFAULT);
-    });
-
-    // Build a list of inherited types that are imported
-    // and include any inherited imported members
+  /**
+   * Add suggestions for any inherited imported members.
+   */
+  void _addInheritedSuggestions(AstNode node) {
     var classDecl = node.getAncestor((p) => p is ClassDeclaration);
     if (classDecl is ClassDeclaration) {
+      // Build a list of inherited types that are imported
+      // and include any inherited imported members
       List<String> inheritedTypes = new List<String>();
-      visitInheritedTypes(classDecl, (ClassDeclaration classDecl) {
-        // ignored
+      visitInheritedTypes(classDecl, (_) {
+        // local declarations are handled by the local computer
       }, (String typeName) {
         inheritedTypes.add(typeName);
       });
-      Set<String> visited = new Set<String>();
+      HashSet<String> visited = new HashSet<String>();
       while (inheritedTypes.length > 0) {
         String name = inheritedTypes.removeLast();
-        ClassElement elem = classMap[name];
+        ClassElement elem = cache.importedClassMap[name];
         if (visited.add(name) && elem != null) {
-          _addElementSuggestions(elem.accessors, typesOnly, excludeVoidReturn);
-          _addElementSuggestions(elem.methods, typesOnly, excludeVoidReturn);
+          _addElementSuggestions(elem.accessors);
+          _addElementSuggestions(elem.methods);
           elem.allSupertypes.forEach((InterfaceType type) {
             if (visited.add(type.name)) {
-              _addElementSuggestions(
-                  type.accessors,
-                  typesOnly,
-                  excludeVoidReturn);
-              _addElementSuggestions(
-                  type.methods,
-                  typesOnly,
-                  excludeVoidReturn);
+              _addElementSuggestions(type.accessors);
+              _addElementSuggestions(type.methods);
             }
           });
         }
       }
     }
-
-    // Add non-imported elements as low relevance
-    var future = request.searchEngine.searchTopLevelDeclarations('');
-    return future.then((List<SearchMatch> matches) {
-      Set<String> completionSet = new Set<String>();
-      request.suggestions.forEach((CompletionSuggestion suggestion) {
-        completionSet.add(suggestion.completion);
-      });
-      matches.forEach((SearchMatch match) {
-        if (match.kind == MatchKind.DECLARATION) {
-          Element element = match.element;
-          if (element.isPublic &&
-              !excludedLibs.contains(element.library) &&
-              !completionSet.contains(element.displayName)) {
-            if (!typesOnly || element is ClassElement) {
-              _addElementSuggestion(
-                  element,
-                  typesOnly,
-                  excludeVoidReturn,
-                  CompletionRelevance.LOW);
-            }
-          }
-        }
-      });
-      return true;
-    });
   }
 
-  void _addLibraryPrefixSuggestion(ImportElement importElem) {
-    String completion = importElem.prefix.displayName;
-    if (completion != null && completion.length > 0) {
-      CompletionSuggestion suggestion = new CompletionSuggestion(
-          CompletionSuggestionKind.INVOCATION,
-          CompletionRelevance.DEFAULT,
-          completion,
-          completion.length,
-          0,
-          importElem.isDeprecated,
-          false);
-      LibraryElement lib = importElem.importedLibrary;
-      if (lib != null) {
-        suggestion.element = newElement_fromEngine(lib);
+  void _addTopLevelSuggestions() {
+    DartCompletionCache cache = request.cache;
+    request.suggestions
+        ..addAll(cache.importedTypeSuggestions)
+        ..addAll(cache.libraryPrefixSuggestions);
+    if (!typesOnly) {
+      request.suggestions.addAll(cache.otherImportedSuggestions);
+      if (!excludeVoidReturn) {
+        request.suggestions.addAll(cache.importedVoidReturnSuggestions);
       }
-      request.suggestions.add(suggestion);
     }
   }
 }
diff --git a/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart b/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
index 9b91205..7191f4e 100644
--- a/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
@@ -19,93 +19,48 @@
  * `completion.getSuggestions` request results.
  */
 class InvocationComputer extends DartCompletionComputer {
+  SuggestionBuilder builder;
 
   @override
   bool computeFast(DartCompletionRequest request) {
-    // TODO: implement computeFast
-    return false;
+    builder = request.node.accept(new _InvocationAstVisitor(request));
+    if (builder != null) {
+      return builder.computeFast(request.node);
+    }
+    return true;
   }
 
   @override
   Future<bool> computeFull(DartCompletionRequest request) {
-    return request.node.accept(new _InvocationAstVisitor(request));
+    if (builder != null) {
+      return builder.computeFull(request.node);
+    }
+    return new Future.value(false);
   }
 }
 
-/**
- * An [AstNode] vistor for determining the appropriate invocation/access
- * suggestions based upon the node in which the completion is requested.
- */
-class _InvocationAstVisitor extends GeneralizingAstVisitor<Future<bool>> {
+class _ExpressionSuggestionBuilder implements SuggestionBuilder {
   final DartCompletionRequest request;
 
-  _InvocationAstVisitor(this.request);
+  _ExpressionSuggestionBuilder(this.request);
 
   @override
-  Future<bool> visitConstructorName(ConstructorName node) {
-    // SimpleIdentifier  PrefixedIdentifier  TypeName  ConstructorName
-    Token period = node.period;
-    if (period != null && period.end <= request.offset) {
-      return _addNamedConstructorSuggestions(node);
+  bool computeFast(AstNode node) {
+    return false;
+  }
+
+  @override
+  Future<bool> computeFull(AstNode node) {
+    if (node is SimpleIdentifier) {
+      node = node.parent;
     }
-    return super.visitConstructorName(node);
-  }
-
-  @override
-  Future<bool> visitMethodInvocation(MethodInvocation node) {
-    Token period = node.period;
-    if (period == null || period.offset < request.offset) {
-      _addExpressionSuggestions(node.target);
+    if (node is MethodInvocation) {
+      node = (node as MethodInvocation).realTarget;
+    } else if (node is PropertyAccess) {
+      node = (node as PropertyAccess).realTarget;
     }
-    return new Future.value(false);
-  }
-
-  @override
-  Future<bool> visitNode(AstNode node) {
-    return new Future.value(false);
-  }
-
-  @override
-  Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) {
-    if (request.offset > node.period.offset) {
-      SimpleIdentifier prefix = node.prefix;
-      if (prefix != null) {
-        return _addElementSuggestions(prefix.bestElement);
-      }
-    }
-    return super.visitPrefixedIdentifier(node);
-  }
-
-  @override
-  Future<bool> visitPropertyAccess(PropertyAccess node) {
-    Token operator = node.operator;
-    if (operator != null && operator.offset < request.offset) {
-      return _addExpressionSuggestions(node.realTarget);
-    }
-    return super.visitPropertyAccess(node);
-  }
-
-  @override
-  Future<bool> visitSimpleIdentifier(SimpleIdentifier node) {
-    return node.parent.accept(this);
-  }
-
-  /**
-   * Add invocation / access suggestions for the given element.
-   */
-  Future<bool> _addElementSuggestions(Element element) {
-    if (element != null) {
-      return element.accept(new _InvocationElementVisitor(request));
-    }
-    return new Future.value(false);
-  }
-
-  /**
-   * Add invocation / access suggestions for the given expression.
-   */
-  Future<bool> _addExpressionSuggestions(Expression target) {
-    if (target != null) {
-      DartType type = target.bestType;
+    if (node is Expression) {
+      DartType type = node.bestType;
       if (type != null) {
         ClassElementSuggestionBuilder.suggestionsFor(request, type.element);
         return new Future.value(true);
@@ -113,17 +68,57 @@
     }
     return new Future.value(false);
   }
+}
 
-  Future<bool> _addNamedConstructorSuggestions(ConstructorName node) {
-    TypeName typeName = node.type;
-    if (typeName != null) {
-      DartType type = typeName.type;
-      if (type != null) {
-        NamedConstructorSuggestionBuilder.suggestionsFor(request, type.element);
-        return new Future.value(true);
+/**
+ * An [AstNode] vistor for determining which suggestion builder
+ * should be used to build invocation/access suggestions.
+ */
+class _InvocationAstVisitor extends GeneralizingAstVisitor<SuggestionBuilder> {
+  final DartCompletionRequest request;
+
+  _InvocationAstVisitor(this.request);
+
+  @override
+  SuggestionBuilder visitMethodInvocation(MethodInvocation node) {
+    Token period = node.period;
+    if (period == null || period.offset < request.offset) {
+      return new _ExpressionSuggestionBuilder(request);
+    }
+    return null;
+  }
+
+  @override
+  SuggestionBuilder visitNode(AstNode node) {
+    return null;
+  }
+
+  @override
+  SuggestionBuilder visitPrefixedIdentifier(PrefixedIdentifier node) {
+    // some PrefixedIdentifier nodes are transformed into
+    // ConstructorName nodes during the resolution process.
+    Token period = node.period;
+    if (request.offset > period.offset) {
+      SimpleIdentifier prefix = node.prefix;
+      if (prefix != null) {
+        return new _PrefixedIdentifierSuggestionBuilder(request);
       }
     }
-    return new Future.value(false);
+    return null;
+  }
+
+  @override
+  SuggestionBuilder visitPropertyAccess(PropertyAccess node) {
+    Token operator = node.operator;
+    if (operator != null && operator.offset < request.offset) {
+      return new _ExpressionSuggestionBuilder(request);
+    }
+    return null;
+  }
+
+  @override
+  SuggestionBuilder visitSimpleIdentifier(SimpleIdentifier node) {
+    return node.parent.accept(this);
   }
 }
 
@@ -131,11 +126,39 @@
  * An [Element] visitor for determining the appropriate invocation/access
  * suggestions based upon the element for which the completion is requested.
  */
-class _InvocationElementVisitor extends GeneralizingElementVisitor<Future<bool>>
-    {
+class _PrefixedIdentifierSuggestionBuilder extends
+    GeneralizingElementVisitor<Future<bool>> implements SuggestionBuilder {
+
   final DartCompletionRequest request;
 
-  _InvocationElementVisitor(this.request);
+  _PrefixedIdentifierSuggestionBuilder(this.request);
+
+  @override
+  bool computeFast(AstNode node) {
+    return false;
+  }
+
+  @override
+  Future<bool> computeFull(AstNode node) {
+    if (node is SimpleIdentifier) {
+      node = node.parent;
+    }
+    if (node is ConstructorName) {
+      // some PrefixedIdentifier nodes are transformed into
+      // ConstructorName nodes during the resolution process.
+      return new NamedConstructorSuggestionBuilder(request).computeFull(node);
+    }
+    if (node is PrefixedIdentifier) {
+      SimpleIdentifier prefix = node.prefix;
+      if (prefix != null) {
+        Element element = prefix.bestElement;
+        if (element != null) {
+          return element.accept(this);
+        }
+      }
+    }
+    return new Future.value(false);
+  }
 
   @override
   Future<bool> visitClassElement(ClassElement element) {
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 90a5908..082260d 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -116,41 +116,6 @@
   }
 
   @override
-  bool visitCascadeExpression(CascadeExpression node) {
-    Expression target = node.target;
-    // This computer handles the expression
-    // while InvocationComputer handles the cascade selector
-    if (target != null && offset <= target.end) {
-      return visitNode(node);
-    } else {
-      return finished;
-    }
-  }
-
-  @override
-  bool visitNamespaceDirective(NamespaceDirective node) {
-    // No suggestions
-    return finished;
-  }
-
-  @override
-  bool visitStringLiteral(StringLiteral node) {
-    // ignore
-    return finished;
-  }
-
-  @override
-  bool visitVariableDeclaration(VariableDeclaration node) {
-    // Do not add suggestions if editing the name in a var declaration
-    SimpleIdentifier name = node.name;
-    if (name == null || name.offset < offset || offset > name.end) {
-      return visitNode(node);
-    } else {
-      return finished;
-    }
-  }
-
-  @override
   void declaredFunction(FunctionDeclaration declaration) {
     if (typesOnly) {
       return;
@@ -284,6 +249,18 @@
   }
 
   @override
+  bool visitCascadeExpression(CascadeExpression node) {
+    Expression target = node.target;
+    // This computer handles the expression
+    // while InvocationComputer handles the cascade selector
+    if (target != null && offset <= target.end) {
+      return visitNode(node);
+    } else {
+      return finished;
+    }
+  }
+
+  @override
   visitCombinator(Combinator node) {
     // Handled by CombinatorComputer
   }
@@ -302,6 +279,12 @@
   }
 
   @override
+  bool visitNamespaceDirective(NamespaceDirective node) {
+    // No suggestions
+    return finished;
+  }
+
+  @override
   visitPrefixedIdentifier(PrefixedIdentifier node) {
     // InvocationComputer adds suggestions for prefixed elements
     // but this computer adds suggestions for the prefix itself
@@ -317,6 +300,12 @@
   }
 
   @override
+  bool visitStringLiteral(StringLiteral node) {
+    // ignore
+    return finished;
+  }
+
+  @override
   visitTypeName(TypeName node) {
     // If suggesting completions within a TypeName node
     // then limit suggestions to only types
@@ -324,6 +313,17 @@
     return visitNode(node);
   }
 
+  @override
+  bool visitVariableDeclaration(VariableDeclaration node) {
+    // Do not add suggestions if editing the name in a var declaration
+    SimpleIdentifier name = node.name;
+    if (name == null || name.offset < offset || offset > name.end) {
+      return visitNode(node);
+    } else {
+      return finished;
+    }
+  }
+
   CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName typeName,
       ClassDeclaration classDecl, bool isDeprecated) {
     if (id != null) {
diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
index d98c968..dd313e1 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -4,6 +4,8 @@
 
 library services.completion.suggestion.builder;
 
+import 'dart:async';
+
 import 'package:analysis_server/src/protocol_server.dart' as protocol;
 import 'package:analysis_server/src/protocol_server.dart' hide Element,
     ElementKind;
@@ -12,6 +14,40 @@
 import 'package:analyzer/src/generated/element.dart';
 
 /**
+ * Create a suggestion based upon the given imported element.
+ */
+CompletionSuggestion createElementSuggestion(Element element,
+    {CompletionRelevance relevance: CompletionRelevance.DEFAULT}) {
+  String completion = element.displayName;
+  CompletionSuggestion suggestion = new CompletionSuggestion(
+      CompletionSuggestionKind.INVOCATION,
+      element.isDeprecated ? CompletionRelevance.LOW : relevance,
+      completion,
+      completion.length,
+      0,
+      element.isDeprecated,
+      false);
+
+  suggestion.element = newElement_fromEngine(element);
+
+  DartType type;
+  if (element is FunctionElement) {
+    type = element.returnType;
+  } else if (element is PropertyAccessorElement && element.isGetter) {
+    type = element.returnType;
+  } else if (element is TopLevelVariableElement) {
+    type = element.type;
+  }
+  if (type != null) {
+    String name = type.displayName;
+    if (name != null && name.length > 0 && name != 'dynamic') {
+      suggestion.returnType = name;
+    }
+  }
+  return suggestion;
+}
+
+/**
  * Call the given function with each non-null non-empty inherited type name
  * that is defined in the given class.
  */
@@ -54,9 +90,11 @@
 }
 
 /**
- * Call the given functions with each non-null non-empty inherited class
- * declaration, if the class is defined locally, or type name if it is not
- * defined locally.
+ * Starting with the given class node, traverse the inheritence hierarchy
+ * calling the given functions with each non-null non-empty inherited class
+ * declaration. For each locally defined class declaration, call [local].
+ * For each class identifier in the hierarchy that is not defined locally,
+ * call the [imported] function.
  */
 void visitInheritedTypes(ClassDeclaration node, void
     local(ClassDeclaration classNode), void imported(String typeName)) {
@@ -219,15 +257,40 @@
 
 /**
  * This class visits elements in a class and provides suggestions based upon
- * the visible named constructors in that class. Clients should call
- * [NamedConstructorSuggestionBuilder.suggestionsFor].
+ * the visible named constructors in that class.
  */
-class NamedConstructorSuggestionBuilder extends _AbstractSuggestionBuilder {
+class NamedConstructorSuggestionBuilder extends _AbstractSuggestionBuilder
+    implements SuggestionBuilder {
 
   NamedConstructorSuggestionBuilder(DartCompletionRequest request)
       : super(request, CompletionSuggestionKind.INVOCATION);
 
   @override
+  bool computeFast(AstNode node) {
+    return false;
+  }
+
+  @override
+  Future<bool> computeFull(AstNode node) {
+    if (node is SimpleIdentifier) {
+      node = node.parent;
+    }
+    if (node is ConstructorName) {
+      TypeName typeName = node.type;
+      if (typeName != null) {
+        DartType type = typeName.type;
+        if (type != null) {
+          if (type.element is ClassElement) {
+            type.element.accept(this);
+          }
+          return new Future.value(true);
+        }
+      }
+    }
+    return new Future.value(false);
+  }
+
+  @override
   visitClassElement(ClassElement element) {
     element.visitChildren(this);
   }
@@ -244,15 +307,23 @@
   visitElement(Element element) {
     // ignored
   }
+}
+
+/**
+ * Common interface implemented by suggestion builders.
+ */
+abstract class SuggestionBuilder {
+  /**
+   * Compute suggestions and return `true` if building is complete,
+   * or `false` if [computeFull] should be called.
+   */
+  bool computeFast(AstNode node);
 
   /**
-   * Add suggestions for the visible members in the given class
+   * Return a future that computes the suggestions given a fully resolved AST.
+   * The future returns `true` if suggestions were added, else `false`.
    */
-  static void suggestionsFor(DartCompletionRequest request, Element element) {
-    if (element is ClassElement) {
-      element.accept(new NamedConstructorSuggestionBuilder(request));
-    }
-  }
+  Future<bool> computeFull(AstNode node);
 }
 
 /**
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 1837024..0c338f1 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -609,6 +609,26 @@
       SourceRange rightRange = rangeStartEnd(rightOperand, binaryExpression);
       _addReplaceEdit(leftRange, _getRangeText(rightRange));
       _addReplaceEdit(rightRange, _getRangeText(leftRange));
+      // maybe replace the operator
+      {
+        Token operator = binaryExpression.operator;
+        // prepare a new operator
+        String newOperator = null;
+        TokenType operatorType = operator.type;
+        if (operatorType == TokenType.LT) {
+          newOperator = '>=';
+        } else if (operatorType == TokenType.LT_EQ) {
+          newOperator = '>';
+        } else if (operatorType == TokenType.GT) {
+          newOperator = '<=';
+        } else if (operatorType == TokenType.GT_EQ) {
+          newOperator = '<';
+        }
+        // replace the operator
+        if (newOperator != null) {
+          _addReplaceEdit(rangeToken(operator), newOperator);
+        }
+      }
     }
     // add proposal
     _addAssist(AssistKind.EXCHANGE_OPERANDS, []);
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 086ed81f..e86a1cc 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -262,13 +262,6 @@
     exitPosition = null;
   }
 
-  void _addFixToElement(FixKind kind, List args, Element element) {
-    Source source = element.source;
-    String file = source.fullName;
-    int fileStamp = element.context.getModificationStamp(source);
-    _addFix(kind, args, file: file, fileStamp: fileStamp);
-  }
-
   void _addFix_boolInsteadOfBoolean() {
     SourceRange range = rf.rangeError(error);
     _addReplaceEdit(range, "bool");
@@ -303,12 +296,146 @@
       }
       // insert source
       _insertBuilder(sb);
-      _addLinkedPosition("NAME", rf.rangeNode(node));
+      _addLinkedPosition("NAME", sb, rf.rangeNode(node));
       // add proposal
       _addFix(FixKind.CREATE_CLASS, [name]);
     }
   }
 
+  void _addFix_createConstructor_insteadOfSyntheticDefault() {
+    TypeName typeName = null;
+    ConstructorName constructorName = null;
+    InstanceCreationExpression instanceCreation = null;
+    if (node is SimpleIdentifier) {
+      if (node.parent is TypeName) {
+        typeName = node.parent as TypeName;
+        if (typeName.name == node && typeName.parent is ConstructorName) {
+          constructorName = typeName.parent as ConstructorName;
+          // should be synthetic default constructor
+          {
+            ConstructorElement constructorElement =
+                constructorName.staticElement;
+            if (constructorElement == null ||
+                !constructorElement.isDefaultConstructor ||
+                !constructorElement.isSynthetic) {
+              return;
+            }
+          }
+          // prepare InstanceCreationExpression
+          if (constructorName.parent is InstanceCreationExpression) {
+            instanceCreation =
+                constructorName.parent as InstanceCreationExpression;
+            if (instanceCreation.constructorName != constructorName) {
+              return;
+            }
+          }
+        }
+      }
+    }
+    // do we have enough information?
+    if (instanceCreation == null) {
+      return;
+    }
+    // prepare target
+    DartType targetType = typeName.type;
+    if (targetType is! InterfaceType) {
+      return;
+    }
+    ClassElement targetElement = targetType.element as ClassElement;
+    String targetFile = targetElement.source.fullName;
+    ClassDeclaration targetClass = targetElement.node;
+    _ConstructorLocation targetLocation =
+        _prepareNewConstructorLocation(targetClass);
+    // build method source
+    SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
+    {
+      String indent = "  ";
+      sb.append(targetLocation.prefix);
+      sb.append(indent);
+      sb.append(targetElement.name);
+      _addFix_undefinedMethod_create_parameters(
+          sb,
+          instanceCreation.argumentList);
+      sb.append(") {${eol}${indent}}");
+      sb.append(targetLocation.suffix);
+    }
+    // insert source
+    _insertBuilder(sb);
+    // add proposal
+    _addFixToElement(
+        FixKind.CREATE_CONSTRUCTOR,
+        [constructorName],
+        targetElement);
+  }
+
+  void _addFix_createConstructor_named() {
+    SimpleIdentifier name = null;
+    ConstructorName constructorName = null;
+    InstanceCreationExpression instanceCreation = null;
+    if (node is SimpleIdentifier) {
+      // name
+      name = node as SimpleIdentifier;
+      if (name.parent is ConstructorName) {
+        constructorName = name.parent as ConstructorName;
+        if (constructorName.name == name) {
+          // Type.name
+          if (constructorName.parent is InstanceCreationExpression) {
+            instanceCreation =
+                constructorName.parent as InstanceCreationExpression;
+            // new Type.name()
+            if (instanceCreation.constructorName != constructorName) {
+              return;
+            }
+          }
+        }
+      }
+    }
+    // do we have enough information?
+    if (instanceCreation == null) {
+      return;
+    }
+    // prepare target interface type
+    DartType targetType = constructorName.type.type;
+    if (targetType is! InterfaceType) {
+      return;
+    }
+    ClassElement targetElement = targetType.element as ClassElement;
+    String targetFile = targetElement.source.fullName;
+    ClassDeclaration targetClass = targetElement.node;
+    _ConstructorLocation targetLocation =
+        _prepareNewConstructorLocation(targetClass);
+    // build method source
+    SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
+    {
+      String indent = "  ";
+      sb.append(targetLocation.prefix);
+      sb.append(indent);
+      sb.append(targetElement.name);
+      sb.append(".");
+      // append name
+      {
+        sb.startPosition("NAME");
+        sb.append(name.name);
+        sb.endPosition();
+      }
+      _addFix_undefinedMethod_create_parameters(
+          sb,
+          instanceCreation.argumentList);
+      sb.append(") {${eol}${indent}}");
+      sb.append(targetLocation.suffix);
+    }
+    // insert source
+    _insertBuilder(sb);
+    if (targetFile == file) {
+      _addLinkedPosition("NAME", sb, rf.rangeNode(name));
+    }
+    // add proposal
+    _addFixToElement(
+        FixKind.CREATE_CONSTRUCTOR,
+        [constructorName],
+        targetElement);
+  }
+
   void _addFix_createConstructorSuperExplicit() {
     ConstructorDeclaration targetConstructor =
         node.parent as ConstructorDeclaration;
@@ -448,140 +575,6 @@
     }
   }
 
-  void _addFix_createConstructor_insteadOfSyntheticDefault() {
-    TypeName typeName = null;
-    ConstructorName constructorName = null;
-    InstanceCreationExpression instanceCreation = null;
-    if (node is SimpleIdentifier) {
-      if (node.parent is TypeName) {
-        typeName = node.parent as TypeName;
-        if (typeName.name == node && typeName.parent is ConstructorName) {
-          constructorName = typeName.parent as ConstructorName;
-          // should be synthetic default constructor
-          {
-            ConstructorElement constructorElement =
-                constructorName.staticElement;
-            if (constructorElement == null ||
-                !constructorElement.isDefaultConstructor ||
-                !constructorElement.isSynthetic) {
-              return;
-            }
-          }
-          // prepare InstanceCreationExpression
-          if (constructorName.parent is InstanceCreationExpression) {
-            instanceCreation =
-                constructorName.parent as InstanceCreationExpression;
-            if (instanceCreation.constructorName != constructorName) {
-              return;
-            }
-          }
-        }
-      }
-    }
-    // do we have enough information?
-    if (instanceCreation == null) {
-      return;
-    }
-    // prepare target
-    DartType targetType = typeName.type;
-    if (targetType is! InterfaceType) {
-      return;
-    }
-    ClassElement targetElement = targetType.element as ClassElement;
-    String targetFile = targetElement.source.fullName;
-    ClassDeclaration targetClass = targetElement.node;
-    _ConstructorLocation targetLocation =
-        _prepareNewConstructorLocation(targetClass);
-    // build method source
-    SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
-    {
-      String indent = "  ";
-      sb.append(targetLocation.prefix);
-      sb.append(indent);
-      sb.append(targetElement.name);
-      _addFix_undefinedMethod_create_parameters(
-          sb,
-          instanceCreation.argumentList);
-      sb.append(") {${eol}${indent}}");
-      sb.append(targetLocation.suffix);
-    }
-    // insert source
-    _insertBuilder(sb);
-    // add proposal
-    _addFixToElement(
-        FixKind.CREATE_CONSTRUCTOR,
-        [constructorName],
-        targetElement);
-  }
-
-  void _addFix_createConstructor_named() {
-    SimpleIdentifier name = null;
-    ConstructorName constructorName = null;
-    InstanceCreationExpression instanceCreation = null;
-    if (node is SimpleIdentifier) {
-      // name
-      name = node as SimpleIdentifier;
-      if (name.parent is ConstructorName) {
-        constructorName = name.parent as ConstructorName;
-        if (constructorName.name == name) {
-          // Type.name
-          if (constructorName.parent is InstanceCreationExpression) {
-            instanceCreation =
-                constructorName.parent as InstanceCreationExpression;
-            // new Type.name()
-            if (instanceCreation.constructorName != constructorName) {
-              return;
-            }
-          }
-        }
-      }
-    }
-    // do we have enough information?
-    if (instanceCreation == null) {
-      return;
-    }
-    // prepare target interface type
-    DartType targetType = constructorName.type.type;
-    if (targetType is! InterfaceType) {
-      return;
-    }
-    ClassElement targetElement = targetType.element as ClassElement;
-    String targetFile = targetElement.source.fullName;
-    ClassDeclaration targetClass = targetElement.node;
-    _ConstructorLocation targetLocation =
-        _prepareNewConstructorLocation(targetClass);
-    // build method source
-    SourceBuilder sb = new SourceBuilder(targetFile, targetLocation.offset);
-    {
-      String indent = "  ";
-      sb.append(targetLocation.prefix);
-      sb.append(indent);
-      sb.append(targetElement.name);
-      sb.append(".");
-      // append name
-      {
-        sb.startPosition("NAME");
-        sb.append(name.name);
-        sb.endPosition();
-      }
-      _addFix_undefinedMethod_create_parameters(
-          sb,
-          instanceCreation.argumentList);
-      sb.append(") {${eol}${indent}}");
-      sb.append(targetLocation.suffix);
-    }
-    // insert source
-    _insertBuilder(sb);
-    if (targetFile == file) {
-      _addLinkedPosition("NAME", rf.rangeNode(name));
-    }
-    // add proposal
-    _addFixToElement(
-        FixKind.CREATE_CONSTRUCTOR,
-        [constructorName],
-        targetElement);
-  }
-
   void _addFix_createField() {
     SimpleIdentifier nameNode = node;
     String name = nameNode.name;
@@ -634,11 +627,7 @@
       // append type
       Expression fieldTypeNode = climbPropertyAccess(nameNode);
       DartType fieldType = _inferUndefinedExpressionType(fieldTypeNode);
-      if (fieldType != null) {
-        _appendType(sb, fieldType, 'TYPE');
-      } else {
-        sb.append('var ');
-      }
+      _appendType(sb, fieldType, groupId: 'TYPE', orVar: true);
       // append name
       {
         sb.startPosition('NAME');
@@ -652,7 +641,7 @@
     _insertBuilder(sb);
     // add linked positions
     if (targetFile == file) {
-      _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+      _addLinkedPosition('NAME', sb, rf.rangeNode(node));
     }
     // add proposal
     _addFixToElement(FixKind.CREATE_FIELD, [name], targetClassElement);
@@ -748,11 +737,7 @@
     {
       // append type
       DartType fieldType = _inferUndefinedExpressionType(node);
-      if (fieldType != null) {
-        _appendType(sb, fieldType, 'TYPE');
-      } else {
-        sb.append('var ');
-      }
+      _appendType(sb, fieldType, groupId: 'TYPE', orVar: true);
       // append name
       {
         sb.startPosition('NAME');
@@ -766,7 +751,7 @@
     // insert source
     _insertBuilder(sb);
     // add linked positions
-    _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+    _addLinkedPosition('NAME', sb, rf.rangeNode(node));
     // add proposal
     _addFix(FixKind.CREATE_LOCAL_VARIABLE, [name]);
   }
@@ -1281,7 +1266,7 @@
       // append return type
       {
         DartType type = _inferUndefinedExpressionType(invocation);
-        _appendType(sb, type, 'RETURN_TYPE');
+        _appendType(sb, type, groupId: 'RETURN_TYPE');
       }
       // append name
       {
@@ -1294,7 +1279,7 @@
     }
     // insert source
     _insertBuilder(sb);
-    _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+    _addLinkedPosition('NAME', sb, rf.rangeNode(node));
     // add proposal
     _addFix(FixKind.CREATE_FUNCTION, [name]);
   }
@@ -1381,10 +1366,10 @@
           sb.append("static ");
         }
         // append return type
-        _appendType(
-            sb,
-            _inferUndefinedExpressionType(invocation),
-            'RETURN_TYPE');
+        {
+          DartType type = _inferUndefinedExpressionType(invocation);
+          _appendType(sb, type, groupId: 'RETURN_TYPE');
+        }
         // append name
         {
           sb.startPosition("NAME");
@@ -1399,7 +1384,7 @@
       _insertBuilder(sb);
       // add linked positions
       if (targetFile == file) {
-        _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+        _addLinkedPosition('NAME', sb, rf.rangeNode(node));
       }
       // add proposal
       _addFixToElement(FixKind.CREATE_METHOD, [name], targetElement);
@@ -1539,6 +1524,13 @@
     }
   }
 
+  void _addFixToElement(FixKind kind, List args, Element element) {
+    Source source = element.source;
+    String file = source.fullName;
+    int fileStamp = element.context.getModificationStamp(source);
+    _addFix(kind, args, file: file, fileStamp: fileStamp);
+  }
+
   /**
    * Adds a new [Edit] to [edits].
    */
@@ -1550,22 +1542,18 @@
   /**
    * Adds a single linked position to [groupId].
    */
-  void _addLinkedPosition(String groupId, SourceRange range) {
-    Position position = new Position(file, range.offset);
-    LinkedEditGroup group = _getLinkedPosition(groupId);
-    group.addPosition(position, range.length);
-  }
-
-  /**
-   * Adds a single linked position to [groupId].
-   */
-  void _addLinkedPosition3(String groupId, SourceBuilder sb,
-      SourceRange range) {
-    if (sb.offset < range.offset) {
+  void _addLinkedPosition(String groupId, SourceBuilder sb, SourceRange range) {
+    // prepare offset
+    int offset = range.offset;
+    if (sb.offset < offset) {
       int delta = sb.length;
-      range = range.getTranslated(delta);
+      offset += delta;
     }
-    _addLinkedPosition(groupId, range);
+    // prepare group
+    LinkedEditGroup group = _getLinkedPosition(groupId);
+    // add position
+    Position position = new Position(file, offset);
+    group.addPosition(position, range.length);
   }
 
   /**
@@ -1585,7 +1573,7 @@
         sb.append("static ");
       }
       // append return type
-      _appendType(sb, functionType.returnType, 'RETURN_TYPE');
+      _appendType(sb, functionType.returnType, groupId: 'RETURN_TYPE');
       // append name
       {
         sb.startPosition("NAME");
@@ -1631,7 +1619,7 @@
     _insertBuilder(sb);
     // add linked positions
     if (targetSource == unitSource) {
-      _addLinkedPosition3("NAME", sb, rf.rangeNode(node));
+      _addLinkedPosition("NAME", sb, rf.rangeNode(node));
     }
   }
 
@@ -1709,14 +1697,6 @@
     edits.add(edit);
   }
 
-  void _appendParameterSource(SourceBuilder sb, DartType type, String name) {
-    Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
-    // TODO(scheglov) use librariesToImport
-    String parameterSource =
-        utils.getParameterSource(type, name, librariesToImport);
-    sb.append(parameterSource);
-  }
-
   void _appendParameters(SourceBuilder sb, List<ParameterElement> parameters) {
     sb.append("(");
     bool firstParameter = true;
@@ -1765,7 +1745,16 @@
     sb.append(")");
   }
 
-  void _appendType(SourceBuilder sb, DartType type, [String groupId]) {
+  void _appendParameterSource(SourceBuilder sb, DartType type, String name) {
+    Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+    // TODO(scheglov) use librariesToImport
+    String parameterSource =
+        utils.getParameterSource(type, name, librariesToImport);
+    sb.append(parameterSource);
+  }
+
+  void _appendType(SourceBuilder sb, DartType type, {String groupId, bool orVar:
+      false}) {
     if (type != null && !type.isDynamic) {
       Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
       // TODO(scheglov) use librariesToImport
@@ -1778,6 +1767,8 @@
         sb.append(typeSource);
       }
       sb.append(' ');
+    } else if (orVar) {
+      sb.append('var ');
     }
   }
 
@@ -1829,25 +1820,6 @@
   }
 
   /**
-   * Returns `true` if [node] is in static context.
-   */
-  bool _inStaticContext() {
-    // constructor initializer cannot reference "this"
-    if (node.getAncestor((node) => node is ConstructorInitializer) != null) {
-      return true;
-    }
-    // field initializer cannot reference "this"
-    if (node.getAncestor((node) => node is FieldDeclaration) != null) {
-      return true;
-    }
-    // static method
-    MethodDeclaration method = node.getAncestor((node) {
-      return node is MethodDeclaration;
-    });
-    return method != null && method.isStatic;
-  }
-
-  /**
    * Returns an expected [DartType] of [expression], may be `null` if cannot be
    * inferred.
    */
@@ -1991,6 +1963,25 @@
     });
   }
 
+  /**
+   * Returns `true` if [node] is in static context.
+   */
+  bool _inStaticContext() {
+    // constructor initializer cannot reference "this"
+    if (node.getAncestor((node) => node is ConstructorInitializer) != null) {
+      return true;
+    }
+    // field initializer cannot reference "this"
+    if (node.getAncestor((node) => node is FieldDeclaration) != null) {
+      return true;
+    }
+    // static method
+    MethodDeclaration method = node.getAncestor((node) {
+      return node is MethodDeclaration;
+    });
+    return method != null && method.isStatic;
+  }
+
   _ConstructorLocation
       _prepareNewConstructorLocation(ClassDeclaration classDeclaration) {
     List<ClassMember> members = classDeclaration.members;
diff --git a/pkg/analysis_server/lib/src/services/correction/namespace.dart b/pkg/analysis_server/lib/src/services/correction/namespace.dart
index fc0fd35..31c0477 100644
--- a/pkg/analysis_server/lib/src/services/correction/namespace.dart
+++ b/pkg/analysis_server/lib/src/services/correction/namespace.dart
@@ -10,6 +10,17 @@
 
 
 /**
+ * Returns the [Element] exported from the given [LibraryElement].
+ */
+Element getExportedElement(LibraryElement library, String name) {
+  if (library == null) {
+    return null;
+  }
+  return getExportNamespaceForLibrary(library)[name];
+}
+
+
+/**
  * Returns the namespace of the given [ExportElement].
  */
 Map<String, Element> getExportNamespaceForDirective(ExportElement exp) {
@@ -30,17 +41,6 @@
 
 
 /**
- * Returns the [Element] exported from the given [LibraryElement].
- */
-Element getExportedElement(LibraryElement library, String name) {
-  if (library == null) {
-    return null;
-  }
-  return getExportNamespaceForLibrary(library)[name];
-}
-
-
-/**
  * Returns the [ImportElement] that is referenced by [prefixNode] with
  * an [PrefixElement], maybe `null`.
  */
diff --git a/pkg/analysis_server/lib/src/services/correction/sort_members.dart b/pkg/analysis_server/lib/src/services/correction/sort_members.dart
index 9eb4db8..0c64a63 100644
--- a/pkg/analysis_server/lib/src/services/correction/sort_members.dart
+++ b/pkg/analysis_server/lib/src/services/correction/sort_members.dart
@@ -61,8 +61,10 @@
    */
   List<SourceEdit> sort() {
     _sortClassesMembers();
-    _sortUnitDirectives();
     _sortUnitMembers();
+    // Must sort unit directives last because it may insert newlines, which
+    // would confuse the offsets used by the other sort functions.
+    _sortUnitDirectives();
     // prepare edits
     List<SourceEdit> edits = <SourceEdit>[];
     if (code != initialCode) {
@@ -96,6 +98,18 @@
   }
 
   /**
+   * Sorts all members of all [ClassDeclaration]s.
+   */
+  void _sortClassesMembers() {
+    for (CompilationUnitMember unitMember in unit.declarations) {
+      if (unitMember is ClassDeclaration) {
+        ClassDeclaration classDeclaration = unitMember;
+        _sortClassMembers(classDeclaration);
+      }
+    }
+  }
+
+  /**
    * Sorts all members of the given [ClassDeclaration].
    */
   void _sortClassMembers(ClassDeclaration classDeclaration) {
@@ -149,18 +163,6 @@
   }
 
   /**
-   * Sorts all members of all [ClassDeclaration]s.
-   */
-  void _sortClassesMembers() {
-    for (CompilationUnitMember unitMember in unit.declarations) {
-      if (unitMember is ClassDeclaration) {
-        ClassDeclaration classDeclaration = unitMember;
-        _sortClassMembers(classDeclaration);
-      }
-    }
-  }
-
-  /**
    * Sorts all [Directive]s.
    */
   void _sortUnitDirectives() {
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 1e9579b..a14fb8a 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -946,7 +946,7 @@
       return source;
     }
     // check if imported
-    {
+    if (element.library != _library) {
       ImportElement importElement = _getImportElement(element);
       if (importElement != null) {
         if (importElement.prefix != null) {
diff --git a/pkg/analysis_server/lib/src/services/generated/util.dart b/pkg/analysis_server/lib/src/services/generated/util.dart
index ebd034b..a2002f9 100644
--- a/pkg/analysis_server/lib/src/services/generated/util.dart
+++ b/pkg/analysis_server/lib/src/services/generated/util.dart
@@ -114,12 +114,6 @@
  * Utilities for analyzing [CompilationUnit], its parts and source.
  */
 class CorrectionUtils {
-  /**
-   * If `true` then [addEdit] validates that
-   * [Edit] replaces correct part of the [Source].
-   */
-  static bool _DEBUG_VALIDATE_EDITS = true;
-
   static List<String> _KNOWN_METHOD_NAME_PREFIXES = ["get", "is", "to"];
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/index/index_contributor.dart b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
index 5f39378..e17a66f 100644
--- a/pkg/analysis_server/lib/src/services/index/index_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
@@ -169,9 +169,8 @@
    * [store] - the [IndexStore] to record relations into.
    */
   _AngularHtmlIndexContributor(this._store) {
-    _indexContributor = new _AngularHtmlIndexContributor_forEmbeddedDart(
-        _store,
-        this);
+    _indexContributor =
+        new _AngularHtmlIndexContributor_forEmbeddedDart(_store, this);
   }
 
   @override
@@ -252,8 +251,8 @@
   final _AngularHtmlIndexContributor angularContributor;
 
   _AngularHtmlIndexContributor_forEmbeddedDart(IndexStore store,
-      this.angularContributor) : super(
-      store);
+      this.angularContributor)
+      : super(store);
 
   @override
   Element peekElement() => angularContributor._htmlUnitElement;
@@ -421,18 +420,6 @@
   }
 
   @override
-  Object visitEnumDeclaration(EnumDeclaration node) {
-    ClassElement element = node.element;
-    enterScope(element);
-    try {
-      _recordElementDefinition(element);
-      return super.visitEnumDeclaration(node);
-    } finally {
-      _exitScope();
-    }
-  }
-
-  @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
     ClassElement element = node.element;
     enterScope(element);
@@ -540,6 +527,18 @@
   }
 
   @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    ClassElement element = node.element;
+    enterScope(element);
+    try {
+      _recordElementDefinition(element);
+      return super.visitEnumDeclaration(node);
+    } finally {
+      _exitScope();
+    }
+  }
+
+  @override
   Object visitExportDirective(ExportDirective node) {
     ExportElement element = node.element;
     if (element != null) {
@@ -915,23 +914,6 @@
   }
 
   /**
-   * Records [ImportElement] that declares given prefix and imports library with element used
-   * with given prefix node.
-   */
-  void _recordImportElementReferenceWithPrefix(SimpleIdentifier prefixNode) {
-    ImportElementInfo info = internal_getImportElementInfo(prefixNode);
-    if (info != null) {
-      int offset = prefixNode.offset;
-      int length = info.periodEnd - offset;
-      Location location = _createLocationForOffset(offset, length);
-      recordRelationship(
-          info.element,
-          IndexConstants.IS_REFERENCED_BY,
-          location);
-    }
-  }
-
-  /**
    * Records [ImportElement] reference if given [SimpleIdentifier] references some
    * top-level element and not qualified with import prefix.
    */
@@ -955,6 +937,23 @@
   }
 
   /**
+   * Records [ImportElement] that declares given prefix and imports library with element used
+   * with given prefix node.
+   */
+  void _recordImportElementReferenceWithPrefix(SimpleIdentifier prefixNode) {
+    ImportElementInfo info = internal_getImportElementInfo(prefixNode);
+    if (info != null) {
+      int offset = prefixNode.offset;
+      int length = info.periodEnd - offset;
+      Location location = _createLocationForOffset(offset, length);
+      recordRelationship(
+          info.element,
+          IndexConstants.IS_REFERENCED_BY,
+          location);
+    }
+  }
+
+  /**
    * Records reference to defining [CompilationUnitElement] of the given
    * [LibraryElement].
    */
diff --git a/pkg/analysis_server/lib/src/services/index/local_file_index.dart b/pkg/analysis_server/lib/src/services/index/local_file_index.dart
index b8a701b..940d14a 100644
--- a/pkg/analysis_server/lib/src/services/index/local_file_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_file_index.dart
@@ -7,21 +7,20 @@
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
 import 'package:analysis_server/src/services/index/store/codec.dart';
-import 'package:analysis_server/src/services/index/store/temporary_folder_file_manager.dart';
 import 'package:analysis_server/src/services/index/store/split_store.dart';
+import 'package:analysis_server/src/services/index/store/temporary_folder_file_manager.dart';
 import 'package:analyzer/src/generated/engine.dart';
 
 
 Index createLocalFileIndex() {
   var fileManager = new TemporaryFolderFileManager();
   var stringCodec = new StringCodec();
-  var nodeManager =
-      new FileNodeManager(
-          fileManager,
-          AnalysisEngine.instance.logger,
-          stringCodec,
-          new ContextCodec(),
-          new ElementCodec(stringCodec),
-          new RelationshipCodec(stringCodec));
+  var nodeManager = new FileNodeManager(
+      fileManager,
+      AnalysisEngine.instance.logger,
+      stringCodec,
+      new ContextCodec(),
+      new ElementCodec(stringCodec),
+      new RelationshipCodec(stringCodec));
   return new LocalIndex(nodeManager);
 }
diff --git a/pkg/analysis_server/lib/src/services/index/local_index.dart b/pkg/analysis_server/lib/src/services/index/local_index.dart
index 5c95b97..c95a0be 100644
--- a/pkg/analysis_server/lib/src/services/index/local_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_index.dart
@@ -7,7 +7,8 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analysis_server/src/services/index/index_contributor.dart' as contributors;
+import 'package:analysis_server/src/services/index/index_contributor.dart' as
+    contributors;
 import 'package:analysis_server/src/services/index/store/split_store.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
diff --git a/pkg/analysis_server/lib/src/services/index/store/codec.dart b/pkg/analysis_server/lib/src/services/index/store/codec.dart
index ec2bb94..de90056 100644
--- a/pkg/analysis_server/lib/src/services/index/store/codec.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/codec.dart
@@ -104,13 +104,35 @@
    * file paths instead of [Element] location URIs.
    */
   int encode(Element element, bool forKey) {
-    List<int> path = _getLocationPath(element, forKey);
-    int index = _pathToIndex[path];
-    if (index == null) {
-      index = _indexToPath.length;
-      _pathToIndex[path] = index;
-      _indexToPath.add(path);
+    ElementLocationImpl location = element.location;
+    // check the location has a cached id
+    if (!identical(location.indexOwner, this)) {
+      location.indexKeyId = null;
+      location.indexLocationId = null;
     }
+    if (forKey) {
+      int id = location.indexKeyId;
+      if (id != null) {
+        return id;
+      }
+    } else {
+      int id = location.indexLocationId;
+      if (id != null) {
+        return id;
+      }
+    }
+    // prepare an id
+    List<int> path = _getLocationPath(element, location, forKey);
+    int index = _encodePath(path);
+    // put the id into the location
+    if (forKey) {
+      location.indexOwner = this;
+      location.indexKeyId = index;
+    } else {
+      location.indexOwner = this;
+      location.indexLocationId = index;
+    }
+    // done
     return index;
   }
 
@@ -119,6 +141,11 @@
    */
   int encodeHash(Element element) {
     List<int> path = _getLocationPathLimited(element);
+    int index = _encodePath(path);
+    return index;
+  }
+
+  int _encodePath(List<int> path) {
     int index = _pathToIndex[path];
     if (index == null) {
       index = _indexToPath.length;
@@ -146,12 +173,14 @@
   /**
    * If [usePath] is `true` then [Source] path should be used instead of URI.
    */
-  List<int> _getLocationPath(Element element, bool usePath) {
+  List<int> _getLocationPath(Element element, ElementLocation location,
+      bool usePath) {
     // prepare the location components
-    List<String> components = element.location.components;
+    List<String> components = location.components;
     if (usePath) {
       LibraryElement library = element.library;
       if (library != null) {
+        components = components.toList();
         components[0] = library.source.fullName;
         if (element.enclosingElement is CompilationUnitElement) {
           components[1] = library.definingCompilationUnit.source.fullName;
@@ -203,14 +232,6 @@
     return <int>[firstId, lastId];
   }
 
-  static String _getComponentUnit(Element element) {
-    LibraryElement libraryElement = element.library;
-    if (libraryElement == null) {
-      return 'null';
-    }
-    return libraryElement.definingCompilationUnit.source.fullName;
-  }
-
   static bool _hasLocalOffset(List<String> components) {
     for (String component in components) {
       if (component.indexOf('@') != -1) {
@@ -219,14 +240,6 @@
     }
     return false;
   }
-
-  static String _substringBeforeAt(String str) {
-    int atOffset = str.indexOf('@');
-    if (atOffset != -1) {
-      str = str.substring(0, atOffset);
-    }
-    return str;
-  }
 }
 
 
diff --git a/pkg/analysis_server/lib/src/services/index/store/collection.dart b/pkg/analysis_server/lib/src/services/index/store/collection.dart
index 9002aa9..c2ad953 100644
--- a/pkg/analysis_server/lib/src/services/index/store/collection.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/collection.dart
@@ -12,8 +12,9 @@
  * A hash map with `List<int>` keys and [int] values.
  */
 class IntArrayToIntMap {
-  final Map<Int32List, int> map = new HashMap<Int32List, int>(equals:
-      _intArrayEquals, hashCode: _intArrayHashCode);
+  final Map<Int32List, int> map = new HashMap<Int32List, int>(
+      equals: _intArrayEquals,
+      hashCode: _intArrayHashCode);
 
   /**
    * Returns the value for the given [key] or null if [key] is not in the map.
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index 15b4ab6a..40cad52 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -576,14 +576,11 @@
     }
     // may be ends with "return" statement
     if (_selectionStatements != null) {
-      Statement lastStatement =
-          _selectionStatements[_selectionStatements.length - 1];
-      if (lastStatement is ReturnStatement) {
-        Expression expression = lastStatement.expression;
-        if (expression != null) {
-          _returnType = expression.bestType;
-        }
-      }
+      _ReturnTypeComputer returnTypeComputer = new _ReturnTypeComputer();
+      _selectionStatements.forEach((statement) {
+        statement.accept(returnTypeComputer);
+      });
+      _returnType = returnTypeComputer.returnType;
     }
     // may be single variable to return
     if (assignedUsedVariables.length == 1) {
@@ -1101,6 +1098,32 @@
 }
 
 
+class _ReturnTypeComputer extends RecursiveAstVisitor {
+  DartType returnType;
+
+  @override
+  visitBlockFunctionBody(BlockFunctionBody node) {
+  }
+
+  @override
+  visitReturnStatement(ReturnStatement node) {
+    Expression expression = node.expression;
+    if (expression != null) {
+      DartType type = expression.bestType;
+      if (returnType == null) {
+        returnType = type;
+      } else {
+        if (returnType is InterfaceType && type is InterfaceType) {
+          returnType = InterfaceType.getSmartLeastUpperBound(returnType, type);
+        } else {
+          returnType = returnType.getLeastUpperBound(type);
+        }
+      }
+    }
+  }
+}
+
+
 /**
  * Generalized version of some source, in which references to the specific
  * variables are replaced with pattern variables, with back mapping from the
diff --git a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
index 96dbb03..c55117e 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
@@ -101,17 +101,23 @@
     }
   });
   // replace static field "qualifier" with invocation target
-  part._staticFieldQualifiers.forEach(
-      (String className, List<SourceRange> ranges) {
-    for (SourceRange range in ranges) {
-      edits.add(newSourceEdit_range(range, className + '.'));
+  part._staticFieldOffsets.forEach((String className, List<int> offsets) {
+    for (int offset in offsets) {
+//      edits.add(newSourceEdit_range(range, className + '.'));
+      edits.add(new SourceEdit(offset, 0, className + '.'));
     }
   });
-  // replace instance field "qualifier" with invocation target
+  // replace "this" references with invocation target
   if (targetExpression != null) {
-    String targetSource = utils.getNodeText(targetExpression) + '.';
-    for (SourceRange qualifierRange in part._instanceFieldQualifiers) {
-      edits.add(newSourceEdit_range(qualifierRange, targetSource));
+    String targetSource = utils.getNodeText(targetExpression);
+    // explicit "this" references
+    for (int offset in part._explicitThisOffsets) {
+      edits.add(new SourceEdit(offset, 4, targetSource));
+    }
+    // implicit "this" references
+    targetSource += '.';
+    for (int offset in part._implicitThisOffsets) {
+      edits.add(new SourceEdit(offset, 0, targetSource));
     }
   }
   // prepare edits to replace conflicting variables
@@ -200,7 +206,6 @@
 
   ExecutableElement _methodElement;
   bool _isAccessor;
-  String _methodFile;
   CompilationUnit _methodUnit;
   CorrectionUtils _methodUtils;
   AstNode _methodNode;
@@ -340,7 +345,6 @@
     }
     _methodElement = element as ExecutableElement;
     _isAccessor = element is PropertyAccessorElement;
-    _methodFile = _methodElement.source.fullName;
     _methodUnit = element.unit;
     _methodUtils = new CorrectionUtils(_methodUnit);
     // class member
@@ -682,30 +686,36 @@
   /**
    * The occurrences of the method parameters.
    */
-  Map<ParameterElement, List<_ParameterOccurrence>> _parameters = {};
+  final Map<ParameterElement, List<_ParameterOccurrence>> _parameters = {};
 
   /**
    * The occurrences of the method local variables.
    */
-  Map<VariableElement, List<SourceRange>> _variables = {};
+  final Map<VariableElement, List<SourceRange>> _variables = {};
 
   /**
-   * The source ranges of the qualifiers in instance field references.
-   * Some of them have length `0`.
+   * The offsets of explicit `this` expression references.
    */
-  List<SourceRange> _instanceFieldQualifiers = [];
+  final List<int> _explicitThisOffsets = [];
 
   /**
-   * The source ranges of the qualifiers in instance field references.
-   * Some of them have length `0`.
+   * The offsets of implicit `this` expression references.
    */
-  Map<String, List<SourceRange>> _staticFieldQualifiers = {};
+  final List<int> _implicitThisOffsets = [];
+
+  /**
+   * The offsets of the implicit class references in static field references.
+   */
+  final Map<String, List<int>> _staticFieldOffsets = {};
 
   _SourcePart(this._base, this._source, this._prefix);
 
-  void addInstanceFieldQualifier(SourceRange range) {
-    range = rangeFromBase(range, _base);
-    _instanceFieldQualifiers.add(range);
+  void addExplicitThisOffset(int offset) {
+    _explicitThisOffsets.add(offset - _base);
+  }
+
+  void addImplicitThisOffset(int offset) {
+    _implicitThisOffsets.add(offset - _base);
   }
 
   void addParameterOccurrence(ParameterElement parameter, SourceRange range,
@@ -721,14 +731,13 @@
     }
   }
 
-  void addStaticFieldQualifier(String className, SourceRange range) {
-    List<SourceRange> ranges = _staticFieldQualifiers[className];
-    if (ranges == null) {
-      ranges = [];
-      _staticFieldQualifiers[className] = ranges;
+  void addStaticFieldOffset(String className, int offset) {
+    List<int> offsets = _staticFieldOffsets[className];
+    if (offsets == null) {
+      offsets = [];
+      _staticFieldOffsets[className] = offsets;
     }
-    range = rangeFromBase(range, _base);
-    ranges.add(range);
+    offsets.add(offset - _base);
   }
 
   void addVariable(VariableElement element, SourceRange range) {
@@ -761,6 +770,8 @@
    */
   _SourcePart result;
 
+  int offset;
+
   _VariablesVisitor(this.methodElement, this.bodyRange, this.result);
 
   @override
@@ -782,25 +793,25 @@
     }
   }
 
+  @override
+  visitThisExpression(ThisExpression node) {
+    int offset = node.offset;
+    if (bodyRange.contains(offset)) {
+      result.addExplicitThisOffset(offset);
+    }
+  }
+
   void _addInstanceFieldQualifier(SimpleIdentifier node) {
     PropertyAccessorElement accessor = getPropertyAccessorElement(node);
     if (isFieldAccessorElement(accessor)) {
       AstNode qualifier = getNodeQualifier(node);
-      if (qualifier == null || qualifier is ThisExpression) {
+      if (qualifier == null) {
+        int offset = node.offset;
         if (accessor.isStatic) {
           String className = accessor.enclosingElement.displayName;
-          if (qualifier == null) {
-            SourceRange qualifierRange = rangeStartLength(node, 0);
-            result.addStaticFieldQualifier(className, qualifierRange);
-          }
+          result.addStaticFieldOffset(className, offset);
         } else {
-          SourceRange qualifierRange;
-          if (qualifier != null) {
-            qualifierRange = rangeStartStart(qualifier, node);
-          } else {
-            qualifierRange = rangeStartLength(node, 0);
-          }
-          result.addInstanceFieldQualifier(qualifierRange);
+          result.addImplicitThisOffset(offset);
         }
       }
     }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
index 51fb74c..2f27c12 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
@@ -102,11 +102,10 @@
   // check identifiers
   List<String> identifiers = name.split('.');
   for (String identifier in identifiers) {
-    RefactoringStatus status =
-        _validateIdentifier(
-            identifier,
-            "Library name identifier",
-            "a lowercase letter or underscore");
+    RefactoringStatus status = _validateIdentifier(
+        identifier,
+        "Library name identifier",
+        "a lowercase letter or underscore");
     if (!status.isOK) {
       return status;
     }
diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart
index a994be0..7b78ecb 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -8,16 +8,16 @@
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/domain_completion.dart';
-import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/search/search_domain.dart';
+import 'package:analysis_server/src/domain_execution.dart';
 import 'package:analysis_server/src/domain_server.dart';
-import 'package:analyzer/source/pub_package_map_provider.dart';
+import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/src/generated/sdk_io.dart';
+import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_file_index.dart';
-import 'package:analysis_server/src/domain_execution.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/source/pub_package_map_provider.dart';
+import 'package:analyzer/src/generated/sdk_io.dart';
 
 
 /**
@@ -37,15 +37,16 @@
  * encode and decode the JSON messages exchanged with the client.
  */
 class SocketServer {
+  final AnalysisServerOptions analysisServerOptions;
+  final DirectoryBasedDartSdk defaultSdk;
+
   /**
    * The analysis server that was created when a client established a
    * connection, or `null` if no such connection has yet been established.
    */
   AnalysisServer analysisServer;
 
-  final DirectoryBasedDartSdk defaultSdk;
-
-  SocketServer(this.defaultSdk);
+  SocketServer(this.analysisServerOptions, this.defaultSdk);
 
   /**
    * Create an analysis server which will communicate with the client using the
@@ -54,19 +55,22 @@
   void createAnalysisServer(ServerCommunicationChannel serverChannel) {
     if (analysisServer != null) {
       RequestError error = new RequestError(
-          RequestErrorCode.SERVER_ALREADY_STARTED, "Server already started");
+          RequestErrorCode.SERVER_ALREADY_STARTED,
+          "Server already started");
       serverChannel.sendResponse(new Response('', error: error));
       serverChannel.listen((Request request) {
         serverChannel.sendResponse(new Response(request.id, error: error));
       });
       return;
     }
-    PhysicalResourceProvider resourceProvider = PhysicalResourceProvider.INSTANCE;
+    PhysicalResourceProvider resourceProvider =
+        PhysicalResourceProvider.INSTANCE;
     analysisServer = new AnalysisServer(
         serverChannel,
         resourceProvider,
         new PubPackageMapProvider(resourceProvider, defaultSdk),
         _createIndex(),
+        analysisServerOptions,
         defaultSdk,
         rethrowExceptions: false);
     _initializeHandlers(analysisServer);
@@ -82,7 +86,6 @@
         new EditDomainHandler(server),
         new SearchDomainHandler(server),
         new CompletionDomainHandler(server),
-        new ExecutionDomainHandler(server),
-    ];
+        new ExecutionDomainHandler(server),];
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/lib/stdio_server.dart b/pkg/analysis_server/lib/stdio_server.dart
index dd48f82..5c3f6ae 100644
--- a/pkg/analysis_server/lib/stdio_server.dart
+++ b/pkg/analysis_server/lib/stdio_server.dart
@@ -34,8 +34,8 @@
    * Return a future that will be completed when stdin closes.
    */
   Future serveStdio() {
-    ByteStreamServerChannel serverChannel = new ByteStreamServerChannel(stdin,
-        stdout);
+    ByteStreamServerChannel serverChannel =
+        new ByteStreamServerChannel(stdin, stdout);
     socketServer.createAnalysisServer(serverChannel);
     return serverChannel.closed;
   }
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index 30885e8..3cf179f 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -4,7 +4,6 @@
 
 library testing.abstract_context;
 
-import 'mock_sdk.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/ast.dart';
@@ -13,6 +12,8 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 
+import 'mock_sdk.dart';
+
 
 /**
  * Finds an [Element] with the given [name].
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index 836ed9b..3ff1987 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -36,6 +36,22 @@
     server.handlers = [new AnalysisDomainHandler(server),];
   }
 
+  test_notInAnalysisRoot() {
+    createProject();
+    String otherFile = '/other.dart';
+    addFile(otherFile, 'UnknownType V;');
+    addTestFile('''
+import '/other.dart';
+
+main() {
+  print(V);
+}
+''');
+    return waitForTasksFinished().then((_) {
+      expect(filesErrors[otherFile], isNull);
+    });
+  }
+
   test_ParserError() {
     createProject();
     addTestFile('library lib');
@@ -67,20 +83,4 @@
       expect(error.type, AnalysisErrorType.STATIC_WARNING);
     });
   }
-
-  test_notInAnalysisRoot() {
-    createProject();
-    String otherFile = '/other.dart';
-    addFile(otherFile, 'UnknownType V;');
-    addTestFile('''
-import '/other.dart';
-
-main() {
-  print(V);
-}
-''');
-    return waitForTasksFinished().then((_) {
-      expect(filesErrors[otherFile], isNull);
-    });
-  }
 }
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index e974dbf..378338a 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -10,11 +10,11 @@
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
-import 'mock_sdk.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:unittest/unittest.dart';
 
+import 'mock_sdk.dart';
 import 'mocks.dart';
 
 
@@ -23,8 +23,8 @@
   while (length < search.length) {
     int c = search.codeUnitAt(length);
     if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
-          c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
-          c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
+        c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
+        c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
       break;
     }
     length++;
@@ -56,9 +56,7 @@
 //  Map<String, List<Map<String, Object>>> filesNavigation = {};
 
 
-  AbstractAnalysisTest() {
-  }
-
+  AbstractAnalysisTest();
   void addAnalysisSubscription(AnalysisService service, String file) {
     // add file to subscription
     var files = analysisSubscriptions[service];
@@ -68,8 +66,8 @@
     }
     files.add(file);
     // set subscriptions
-    Request request = new AnalysisSetSubscriptionsParams(
-        analysisSubscriptions).toRequest('0');
+    Request request =
+        new AnalysisSetSubscriptionsParams(analysisSubscriptions).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
@@ -84,12 +82,6 @@
     return testFile;
   }
 
-  String modifyTestFile(String content) {
-    addFile(testFile, content);
-    this.testCode = content;
-    return testFile;
-  }
-
   Index createIndex() {
     return null;
   }
@@ -99,8 +91,8 @@
    */
   void createProject() {
     resourceProvider.newFolder(projectPath);
-    Request request = new AnalysisSetAnalysisRootsParams([projectPath],
-        []).toRequest('0');
+    Request request =
+        new AnalysisSetAnalysisRootsParams([projectPath], []).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
@@ -135,6 +127,12 @@
     return response;
   }
 
+  String modifyTestFile(String content) {
+    addFile(testFile, content);
+    this.testCode = content;
+    return testFile;
+  }
+
 //  /**
 //   * Returns [AnalysisError]s recorded for the given [file].
 //   * May be empty, but not `null`.
@@ -230,13 +228,18 @@
     packageMapProvider = new MockPackageMapProvider();
     Index index = createIndex();
     server = new AnalysisServer(
-        serverChannel, resourceProvider, packageMapProvider, index,
+        serverChannel,
+        resourceProvider,
+        packageMapProvider,
+        index,
+        new AnalysisServerOptions(),
         new MockSdk());
     server.contextDirectoryManager.defaultOptions.enableAsync = true;
     server.contextDirectoryManager.defaultOptions.enableEnum = true;
     handler = new AnalysisDomainHandler(server);
     // listen for notifications
-    Stream<Notification> notificationStream = serverChannel.notificationController.stream;
+    Stream<Notification> notificationStream =
+        serverChannel.notificationController.stream;
     notificationStream.listen((Notification notification) {
       processNotification(notification);
     });
@@ -257,11 +260,4 @@
   Future waitForTasksFinished() {
     return waitForServerOperationsPerformed(server);
   }
-
-  static String _getCodeString(code) {
-    if (code is List<String>) {
-      code = code.join('\n');
-    }
-    return code as String;
-  }
 }
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index d26041a..ca1c3cd 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -4,19 +4,19 @@
 
 library test.analysis_server;
 
-import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_server.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'mock_sdk.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:typed_mock/typed_mock.dart';
 import 'package:unittest/unittest.dart';
 
+import 'mock_sdk.dart';
 import 'mocks.dart';
 
 main() {
@@ -31,8 +31,9 @@
       notice.setErrors([], new LineInfo([0]));
       AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0);
       AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1);
-      when(context.performAnalysisTask).thenReturnList(
-          [firstResult, firstResult, firstResult, lastResult]);
+      when(
+          context.performAnalysisTask).thenReturnList(
+              [firstResult, firstResult, firstResult, lastResult]);
       helper.server.serverServices.add(ServerService.STATUS);
       helper.server.schedulePerformAnalysisOperation(context);
       // Pump the event queue to make sure the server has finished any
@@ -59,40 +60,39 @@
       AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
       helper.server.handlers = [new EchoHandler()];
       var request = new Request('my22', 'echo');
-      return helper.channel.sendRequest(request)
-          .then((Response response) {
-            expect(response.id, equals('my22'));
-            expect(response.error, isNull);
-          });
+      return helper.channel.sendRequest(request).then((Response response) {
+        expect(response.id, equals('my22'));
+        expect(response.error, isNull);
+      });
     });
 
     test('shutdown', () {
       AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
       helper.server.handlers = [new ServerDomainHandler(helper.server)];
       var request = new Request('my28', SERVER_SHUTDOWN);
-      return helper.channel.sendRequest(request)
-          .then((Response response) {
-            expect(response.id, equals('my28'));
-            expect(response.error, isNull);
-          });
+      return helper.channel.sendRequest(request).then((Response response) {
+        expect(response.id, equals('my28'));
+        expect(response.error, isNull);
+      });
     });
 
     test('unknownRequest', () {
       AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
       helper.server.handlers = [new EchoHandler()];
       var request = new Request('my22', 'randomRequest');
-      return helper.channel.sendRequest(request)
-          .then((Response response) {
-            expect(response.id, equals('my22'));
-            expect(response.error, isNotNull);
-          });
+      return helper.channel.sendRequest(request).then((Response response) {
+        expect(response.id, equals('my22'));
+        expect(response.error, isNotNull);
+      });
     });
 
     test('rethrow exceptions', () {
       AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
       Exception exceptionToThrow = new Exception('test exception');
-      MockServerOperation operation = new MockServerOperation(
-          ServerOperationPriority.ANALYSIS, (_) { throw exceptionToThrow; });
+      MockServerOperation operation =
+          new MockServerOperation(ServerOperationPriority.ANALYSIS, (_) {
+        throw exceptionToThrow;
+      });
       helper.server.operationQueue.add(operation);
       helper.server.performOperationPending = true;
       try {
@@ -102,17 +102,111 @@
         expect(exception.cause.exception, equals(exceptionToThrow));
       }
     });
+
+    test('contexts changed event', () {
+      AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
+      helper.resourceProvider.newFolder('/foo');
+
+      bool wasAdded = false;
+      bool wasChanged = false;
+      bool wasRemoved = false;
+      helper.server.onContextsChanged.listen((ContextsChangedEvent event) {
+        wasAdded = event.added.length == 1;
+        if (wasAdded) {
+          expect(event.added[0], isNotNull);
+        }
+        wasChanged = event.changed.length == 1;
+        if (wasChanged) {
+          expect(event.changed[0], isNotNull);
+        }
+        wasRemoved = event.removed.length == 1;
+        if (wasRemoved) {
+          expect(event.removed[0], isNotNull);
+        }
+      });
+
+      helper.server.setAnalysisRoots('0', ['/foo'], [], {});
+      return pumpEventQueue().then((_) {
+        expect(wasAdded, isTrue);
+        expect(wasChanged, isFalse);
+        expect(wasRemoved, isFalse);
+
+        wasAdded = false;
+        wasChanged = false;
+        wasRemoved = false;
+        helper.server.setAnalysisRoots('0', ['/foo'], [], {
+          '/foo': '/bar'
+        });
+        return pumpEventQueue();
+      }).then((_) {
+        expect(wasAdded, isFalse);
+        expect(wasChanged, isTrue);
+        expect(wasRemoved, isFalse);
+
+        wasAdded = false;
+        wasChanged = false;
+        wasRemoved = false;
+        helper.server.setAnalysisRoots('0', [], [], {});
+        return pumpEventQueue();
+      }).then((_) {
+        expect(wasAdded, isFalse);
+        expect(wasChanged, isFalse);
+        expect(wasRemoved, isTrue);
+      });
+    });
+
+    test('priority sources changed event', () {
+      AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
+      helper.resourceProvider.newFolder('/foo');
+
+      int eventCount = 0;
+      Source firstSource = null;
+      helper.server.onPriorityChange.listen((PriorityChangeEvent event) {
+        ++eventCount;
+        firstSource = event.firstSource;
+      });
+
+      helper.server.setAnalysisRoots('0', ['/foo'], [], {});
+      return pumpEventQueue().then((_) {
+        expect(eventCount, 0);
+
+        helper.server.setPriorityFiles('1', ['/foo/bar.dart']);
+        return pumpEventQueue();
+      }).then((_) {
+        expect(eventCount, 1);
+        expect(firstSource.fullName, '/foo/bar.dart');
+
+        helper.server.setPriorityFiles('2', ['/foo/b1.dart', '/foo/b2.dart']);
+        return pumpEventQueue();
+      }).then((_) {
+        expect(eventCount, 2);
+        expect(firstSource.fullName, '/foo/b1.dart');
+
+        helper.server.setPriorityFiles('17', []);
+        return pumpEventQueue();
+      }).then((_) {
+        expect(eventCount, 3);
+        expect(firstSource, isNull);
+      });
+    });
   });
 }
 
 class AnalysisServerTestHelper {
   MockServerChannel channel;
   AnalysisServer server;
+  MemoryResourceProvider resourceProvider;
 
   AnalysisServerTestHelper({bool rethrowExceptions: true}) {
     channel = new MockServerChannel();
-    server = new AnalysisServer(channel, PhysicalResourceProvider.INSTANCE,
-        new MockPackageMapProvider(), null, new MockSdk(),
+    resourceProvider = new MemoryResourceProvider();
+    server = new AnalysisServer(
+        channel,
+        resourceProvider,
+        new MockPackageMapProvider(),
+        null,
+        new AnalysisServerOptions(),
+        new MockSdk(),
         rethrowExceptions: rethrowExceptions);
   }
 }
@@ -121,7 +215,9 @@
   @override
   Response handleRequest(Request request) {
     if (request.method == 'echo') {
-      return new Response(request.id, result: {'echo': true});
+      return new Response(request.id, result: {
+        'echo': true
+      });
     }
     return null;
   }
diff --git a/pkg/analysis_server/test/channel/byte_stream_channel_test.dart b/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
index a7e88c0..3feaaa19 100644
--- a/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
+++ b/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
@@ -15,19 +15,23 @@
 import '../mocks.dart';
 
 main() {
-  group('ByteStreamClientChannel',  () {
+  group('ByteStreamClientChannel', () {
     setUp(ByteStreamClientChannelTest.setUp);
     test('close', ByteStreamClientChannelTest.close);
-    test('listen_notification', ByteStreamClientChannelTest.listen_notification);
+    test(
+        'listen_notification',
+        ByteStreamClientChannelTest.listen_notification);
     test('listen_response', ByteStreamClientChannelTest.listen_response);
     test('sendRequest', ByteStreamClientChannelTest.sendRequest);
   });
   group('ByteStreamServerChannel', () {
     setUp(ByteStreamServerChannelTest.setUp);
     test('closed', ByteStreamServerChannelTest.closed);
-    test('listen_wellFormedRequest',
+    test(
+        'listen_wellFormedRequest',
         ByteStreamServerChannelTest.listen_wellFormedRequest);
-    test('listen_invalidRequest',
+    test(
+        'listen_invalidRequest',
         ByteStreamServerChannelTest.listen_invalidRequest);
     test('listen_invalidJson', ByteStreamServerChannelTest.listen_invalidJson);
     test('listen_streamError', ByteStreamServerChannelTest.listen_streamError);
@@ -96,20 +100,17 @@
   static Future sendRequest() {
     int assertCount = 0;
     Request request = new Request('72', 'foo.bar');
-    outputLineStream.first
-        .then((line) => JSON.decode(line))
-        .then((json) {
-          expect(json[Request.ID], equals('72'));
-          expect(json[Request.METHOD], equals('foo.bar'));
-          inputSink.writeln('{"id":"73"}');
-          inputSink.writeln('{"id":"72"}');
-          assertCount++;
-        });
-    channel.sendRequest(request)
-        .then((Response response) {
-          expect(response.id, equals('72'));
-          assertCount++;
-        });
+    outputLineStream.first.then((line) => JSON.decode(line)).then((json) {
+      expect(json[Request.ID], equals('72'));
+      expect(json[Request.METHOD], equals('foo.bar'));
+      inputSink.writeln('{"id":"73"}');
+      inputSink.writeln('{"id":"72"}');
+      assertCount++;
+    });
+    channel.sendRequest(request).then((Response response) {
+      expect(response.id, equals('72'));
+      assertCount++;
+    });
     return pumpEventQueue().then((_) => expect(assertCount, equals(2)));
   }
 
@@ -117,8 +118,8 @@
     var inputStream = new StreamController<List<int>>();
     inputSink = new IOSink(inputStream);
     var outputStream = new StreamController<List<int>>();
-    outputLineStream = outputStream.stream.transform((new Utf8Codec()).decoder
-        ).transform(new LineSplitter());
+    outputLineStream = outputStream.stream.transform(
+        (new Utf8Codec()).decoder).transform(new LineSplitter());
     outputSink = new IOSink(outputStream);
     channel = new ByteStreamClientChannel(inputStream.stream, outputSink);
   }
@@ -154,14 +155,16 @@
   static Future doneFuture;
 
   static Future closed() {
-    return inputSink.close().then((_) => channel.closed.timeout(new Duration(
-        seconds: 1)));
+    return inputSink.close().then(
+        (_) => channel.closed.timeout(new Duration(seconds: 1)));
   }
 
   static Future listen_invalidJson() {
     inputSink.writeln('{"id":');
-    return inputSink.flush().then((_) => outputLineStream.first.timeout(
-        new Duration(seconds: 1))).then((String response) {
+    return inputSink.flush().then(
+        (_) =>
+            outputLineStream.first.timeout(
+                new Duration(seconds: 1))).then((String response) {
       var jsonResponse = new JsonCodec().decode(response);
       expect(jsonResponse, isMap);
       expect(jsonResponse, contains('error'));
@@ -171,8 +174,10 @@
 
   static Future listen_invalidRequest() {
     inputSink.writeln('{"id":"0"}');
-    return inputSink.flush().then((_) => outputLineStream.first.timeout(
-        new Duration(seconds: 1))).then((String response) {
+    return inputSink.flush().then(
+        (_) =>
+            outputLineStream.first.timeout(
+                new Duration(seconds: 1))).then((String response) {
       var jsonResponse = new JsonCodec().decode(response);
       expect(jsonResponse, isMap);
       expect(jsonResponse, contains('error'));
@@ -181,23 +186,25 @@
   }
 
   static Future listen_streamDone() {
-    return inputSink.close().then((_) => doneFuture.timeout(new Duration(
-        seconds: 1)));
+    return inputSink.close().then(
+        (_) => doneFuture.timeout(new Duration(seconds: 1)));
   }
 
   static Future listen_streamError() {
     var error = new Error();
     inputSink.addError(error);
-    return inputSink.flush().then((_) => errorStream.first.timeout(new Duration(
-        seconds: 1))).then((var receivedError) {
+    return inputSink.flush().then(
+        (_) =>
+            errorStream.first.timeout(new Duration(seconds: 1))).then((var receivedError) {
       expect(receivedError, same(error));
     });
   }
 
   static Future listen_wellFormedRequest() {
     inputSink.writeln('{"id":"0","method":"server.version"}');
-    return inputSink.flush().then((_) => requestStream.first.timeout(
-        new Duration(seconds: 1))).then((Request request) {
+    return inputSink.flush().then(
+        (_) =>
+            requestStream.first.timeout(new Duration(seconds: 1))).then((Request request) {
       expect(request.id, equals("0"));
       expect(request.method, equals("server.version"));
     });
@@ -205,8 +212,8 @@
 
   static Future sendNotification() {
     channel.sendNotification(new Notification('foo'));
-    return outputLineStream.first.timeout(new Duration(seconds: 1)).then((String
-        notification) {
+    return outputLineStream.first.timeout(
+        new Duration(seconds: 1)).then((String notification) {
       var jsonNotification = new JsonCodec().decode(notification);
       expect(jsonNotification, isMap);
       expect(jsonNotification, contains('event'));
@@ -216,8 +223,8 @@
 
   static Future sendResponse() {
     channel.sendResponse(new Response('foo'));
-    return outputLineStream.first.timeout(new Duration(seconds: 1)).then((String
-        response) {
+    return outputLineStream.first.timeout(
+        new Duration(seconds: 1)).then((String response) {
       var jsonResponse = new JsonCodec().decode(response);
       expect(jsonResponse, isMap);
       expect(jsonResponse, contains('id'));
@@ -228,10 +235,10 @@
   static void setUp() {
     StreamController<List<int>> inputStream = new StreamController<List<int>>();
     inputSink = new IOSink(inputStream);
-    StreamController<List<int>> outputStream = new StreamController<List<int>>(
-        );
-    outputLineStream = outputStream.stream.transform((new Utf8Codec()).decoder
-        ).transform(new LineSplitter());
+    StreamController<List<int>> outputStream =
+        new StreamController<List<int>>();
+    outputLineStream = outputStream.stream.transform(
+        (new Utf8Codec()).decoder).transform(new LineSplitter());
     IOSink outputSink = new IOSink(outputStream);
     channel = new ByteStreamServerChannel(inputStream.stream, outputSink);
     StreamController<Request> requestStreamController =
diff --git a/pkg/analysis_server/test/channel/test_all.dart b/pkg/analysis_server/test/channel/test_all.dart
index a3a0c3a..cbffffd 100644
--- a/pkg/analysis_server/test/channel/test_all.dart
+++ b/pkg/analysis_server/test/channel/test_all.dart
@@ -19,4 +19,4 @@
     byte_stream_channel_test.main();
     web_socket_channel_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/channel/web_socket_channel_test.dart b/pkg/analysis_server/test/channel/web_socket_channel_test.dart
index 9c5a763..e28aa72 100644
--- a/pkg/analysis_server/test/channel/web_socket_channel_test.dart
+++ b/pkg/analysis_server/test/channel/web_socket_channel_test.dart
@@ -19,7 +19,9 @@
     test('invalidJsonToClient', WebSocketChannelTest.invalidJsonToClient);
     test('invalidJsonToServer', WebSocketChannelTest.invalidJsonToServer);
     test('notification', WebSocketChannelTest.notification);
-    test('notificationAndResponse', WebSocketChannelTest.notificationAndResponse);
+    test(
+        'notificationAndResponse',
+        WebSocketChannelTest.notificationAndResponse);
     test('request', WebSocketChannelTest.request);
     test('requestResponse', WebSocketChannelTest.requestResponse);
     test('response', WebSocketChannelTest.response);
@@ -42,60 +44,54 @@
     return future;
   }
 
-  static void expectMsgCount({requestCount: 0,
-                              responseCount: 0,
-                              notificationCount: 0}) {
+  static void expectMsgCount({requestCount: 0, responseCount: 0,
+      notificationCount: 0}) {
     expect(requestsReceived, hasLength(requestCount));
     expect(responsesReceived, hasLength(responseCount));
     expect(notificationsReceived, hasLength(notificationCount));
   }
 
   static Future invalidJsonToClient() {
-    var result = client.responseStream
-        .first
-        .timeout(new Duration(seconds: 1))
-        .then((Response response) {
-          expect(response.id, equals('myId'));
-          expectMsgCount(responseCount: 1);
-        });
+    var result = client.responseStream.first.timeout(
+        new Duration(seconds: 1)).then((Response response) {
+      expect(response.id, equals('myId'));
+      expectMsgCount(responseCount: 1);
+    });
     socket.twin.add('{"foo":"bar"}');
     server.sendResponse(new Response('myId'));
     return result;
   }
 
   static Future invalidJsonToServer() {
-    var result = client.responseStream
-        .first
-        .timeout(new Duration(seconds: 1))
-        .then((Response response) {
-          expect(response.id, equals(''));
-          expect(response.error, isNotNull);
-          expectMsgCount(responseCount: 1);
-        });
+    var result = client.responseStream.first.timeout(
+        new Duration(seconds: 1)).then((Response response) {
+      expect(response.id, equals(''));
+      expect(response.error, isNotNull);
+      expectMsgCount(responseCount: 1);
+    });
     socket.add('"blat"');
     return result;
   }
 
   static Future notification() {
-    var result = client.notificationStream
-        .first
-        .timeout(new Duration(seconds: 1))
-        .then((Notification notification) {
-          expect(notification.event, equals('myEvent'));
-          expectMsgCount(notificationCount: 1);
-          expect(notificationsReceived.first, equals(notification));
-        });
+    var result = client.notificationStream.first.timeout(
+        new Duration(seconds: 1)).then((Notification notification) {
+      expect(notification.event, equals('myEvent'));
+      expectMsgCount(notificationCount: 1);
+      expect(notificationsReceived.first, equals(notification));
+    });
     server.sendNotification(new Notification('myEvent'));
     return result;
   }
 
   static Future notificationAndResponse() {
-    var result = Future
-        .wait([
-          client.notificationStream.first,
-          client.responseStream.first])
-        .timeout(new Duration(seconds: 1))
-        .then((_) => expectMsgCount(responseCount: 1, notificationCount: 1));
+    var result = Future.wait(
+        [
+            client.notificationStream.first,
+            client.responseStream.first]).timeout(
+                new Duration(
+                    seconds: 1)).then(
+                        (_) => expectMsgCount(responseCount: 1, notificationCount: 1));
     server
         ..sendNotification(new Notification('myEvent'))
         ..sendResponse(new Response('myId'));
@@ -113,31 +109,30 @@
 
   static Future requestResponse() {
     // Simulate server sending a response by echoing the request.
-    server.listen((Request request) =>
-        server.sendResponse(new Response(request.id)));
-    return client.sendRequest(new Request('myId', 'myMth'))
-        .timeout(new Duration(seconds: 1))
-        .then((Response response) {
-          expect(response.id, equals('myId'));
-          expectMsgCount(requestCount: 1, responseCount: 1);
+    server.listen(
+        (Request request) => server.sendResponse(new Response(request.id)));
+    return client.sendRequest(
+        new Request(
+            'myId',
+            'myMth')).timeout(new Duration(seconds: 1)).then((Response response) {
+      expect(response.id, equals('myId'));
+      expectMsgCount(requestCount: 1, responseCount: 1);
 
-          expect(requestsReceived.first is Request, isTrue);
-          Request request = requestsReceived.first;
-          expect(request.id, equals('myId'));
-          expect(request.method, equals('myMth'));
-          expect(responsesReceived.first, equals(response));
-        });
+      expect(requestsReceived.first is Request, isTrue);
+      Request request = requestsReceived.first;
+      expect(request.id, equals('myId'));
+      expect(request.method, equals('myMth'));
+      expect(responsesReceived.first, equals(response));
+    });
   }
 
   static Future response() {
     server.sendResponse(new Response('myId'));
-    return client.responseStream
-        .first
-        .timeout(new Duration(seconds: 1))
-        .then((Response response) {
-          expect(response.id, equals('myId'));
-          expectMsgCount(responseCount: 1);
-        });
+    return client.responseStream.first.timeout(
+        new Duration(seconds: 1)).then((Response response) {
+      expect(response.id, equals('myId'));
+      expectMsgCount(responseCount: 1);
+    });
   }
 
   static void setUp() {
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 0fb2192..6815aa1 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -5,7 +5,6 @@
 library test.context.directory.manager;
 
 import 'package:analysis_server/src/context_manager.dart';
-import 'reflective_tests.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/source/package_map_provider.dart';
@@ -17,6 +16,7 @@
 import 'package:unittest/unittest.dart';
 
 import 'mocks.dart';
+import 'reflective_tests.dart';
 
 
 main() {
@@ -65,7 +65,9 @@
     // set roots
     resourceProvider.newFolder(project);
     resourceProvider.newFolder(excludedFolder);
-    manager.setRoots(<String>[project], <String>[excludedFolder],
+    manager.setRoots(
+        <String>[project],
+        <String>[excludedFolder],
         <String, String>{});
     // verify
     expect(manager.isInAnalysisRoot('$excludedFolder/test.dart'), isFalse);
@@ -108,13 +110,15 @@
     resourceProvider.newFile(pubspec2Path, 'pubspec');
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     return pumpEventQueue().then((_) {
-      expect(manager.currentContextPaths.toSet(),
+      expect(
+          manager.currentContextPaths.toSet(),
           [subdir1Path, subdir2Path, projPath].toSet());
       manager.now++;
       manager.refresh();
       return pumpEventQueue().then((_) {
-        expect(manager.currentContextPaths.toSet(),
-          [subdir1Path, subdir2Path, projPath].toSet());
+        expect(
+            manager.currentContextPaths.toSet(),
+            [subdir1Path, subdir2Path, projPath].toSet());
         expect(manager.currentContextTimestamps[projPath], manager.now);
         expect(manager.currentContextTimestamps[subdir1Path], manager.now);
         expect(manager.currentContextTimestamps[subdir2Path], manager.now);
@@ -151,6 +155,15 @@
     expect(filePaths, isEmpty);
   }
 
+  void test_setRoots_addFolderWithoutPubspec() {
+    packageMapProvider.packageMap = null;
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // verify
+    expect(manager.currentContextPaths, hasLength(1));
+    expect(manager.currentContextPaths, contains(projPath));
+    expect(manager.currentContextFilePaths[projPath], hasLength(0));
+  }
+
   void test_setRoots_addFolderWithPubspec() {
     String pubspecPath = posix.join(projPath, 'pubspec.yaml');
     resourceProvider.newFile(pubspecPath, 'pubspec');
@@ -193,21 +206,14 @@
     manager.assertContextFiles(subProjectB, [subProjectB_file]);
     // verify package maps
     _checkPackageMap(root, equals(packageMapProvider.packageMaps[root]));
-    _checkPackageMap(subProjectA,
+    _checkPackageMap(
+        subProjectA,
         equals(packageMapProvider.packageMaps[subProjectA]));
-    _checkPackageMap(subProjectB,
+    _checkPackageMap(
+        subProjectB,
         equals(packageMapProvider.packageMaps[subProjectB]));
   }
 
-  void test_setRoots_addFolderWithoutPubspec() {
-    packageMapProvider.packageMap = null;
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    // verify
-    expect(manager.currentContextPaths, hasLength(1));
-    expect(manager.currentContextPaths, contains(projPath));
-    expect(manager.currentContextFilePaths[projPath], hasLength(0));
-  }
-
   void test_setRoots_addPackageRoot() {
     String packagePathFoo = '/package1/foo';
     String packageRootPath = '/package2/foo';
@@ -219,8 +225,9 @@
     List<String> excludedPaths = <String>[];
     manager.setRoots(includedPaths, excludedPaths, <String, String>{});
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
-    manager.setRoots(includedPaths, excludedPaths,
-        <String, String>{ projPath: packageRootPath });
+    manager.setRoots(includedPaths, excludedPaths, <String, String>{
+      projPath: packageRootPath
+    });
     _checkPackageRoot(projPath, equals(packageRootPath));
   }
 
@@ -229,11 +236,13 @@
     String packageRootPath2 = '/package2';
     List<String> includedPaths = <String>[projPath];
     List<String> excludedPaths = <String>[];
-    manager.setRoots(includedPaths, excludedPaths,
-        <String, String>{ projPath: packageRootPath1 });
+    manager.setRoots(includedPaths, excludedPaths, <String, String>{
+      projPath: packageRootPath1
+    });
     _checkPackageRoot(projPath, equals(packageRootPath1));
-    manager.setRoots(includedPaths, excludedPaths,
-        <String, String>{ projPath: packageRootPath2 });
+    manager.setRoots(includedPaths, excludedPaths, <String, String>{
+      projPath: packageRootPath2
+    });
     _checkPackageRoot(projPath, equals(packageRootPath2));
   }
 
@@ -381,6 +390,14 @@
     manager.assertContextFiles(subProject, [subFile]);
   }
 
+  void test_setRoots_newFolderWithPackageRoot() {
+    String packageRootPath = '/package';
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{
+      projPath: packageRootPath
+    });
+    _checkPackageRoot(projPath, equals(packageRootPath));
+  }
+
   void test_setRoots_newlyAddedFoldersGetProperPackageMap() {
     String packagePath = '/package/foo';
     Folder packageFolder = resourceProvider.newFolder(packagePath);
@@ -391,11 +408,15 @@
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
   }
 
-  void test_setRoots_newFolderWithPackageRoot() {
-    String packageRootPath = '/package';
-    manager.setRoots(<String>[projPath], <String>[],
-        <String, String>{ projPath: packageRootPath });
-    _checkPackageRoot(projPath, equals(packageRootPath));
+  void test_setRoots_removeFolderWithoutPubspec() {
+    packageMapProvider.packageMap = null;
+    // add one root - there is a context
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    expect(manager.currentContextPaths, hasLength(1));
+    // set empty roots - no contexts
+    manager.setRoots(<String>[], <String>[], <String, String>{});
+    expect(manager.currentContextPaths, hasLength(0));
+    expect(manager.currentContextFilePaths, hasLength(0));
   }
 
   void test_setRoots_removeFolderWithPubspec() {
@@ -431,7 +452,9 @@
     resourceProvider.newFile(subProjectA_file, '// sub-a');
     resourceProvider.newFile(subProjectB_file, '// sub-b');
     // set roots
-    manager.setRoots(<String>[projectA, projectB], <String>[],
+    manager.setRoots(
+        <String>[projectA, projectB],
+        <String>[],
         <String, String>{});
     manager.assertContextPaths([projectA, subProjectA, projectB, subProjectB]);
     manager.assertContextFiles(projectA, [projectA_file]);
@@ -445,17 +468,6 @@
     manager.assertContextFiles(subProjectA, [subProjectA_file]);
   }
 
-  void test_setRoots_removeFolderWithoutPubspec() {
-    packageMapProvider.packageMap = null;
-    // add one root - there is a context
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    expect(manager.currentContextPaths, hasLength(1));
-    // set empty roots - no contexts
-    manager.setRoots(<String>[], <String>[], <String, String>{});
-    expect(manager.currentContextPaths, hasLength(0));
-    expect(manager.currentContextFilePaths, hasLength(0));
-  }
-
   void test_setRoots_removePackageRoot() {
     String packagePathFoo = '/package1/foo';
     String packageRootPath = '/package2/foo';
@@ -465,8 +477,9 @@
     };
     List<String> includedPaths = <String>[projPath];
     List<String> excludedPaths = <String>[];
-    manager.setRoots(includedPaths, excludedPaths,
-        <String, String>{ projPath: packageRootPath });
+    manager.setRoots(includedPaths, excludedPaths, <String, String>{
+      projPath: packageRootPath
+    });
     _checkPackageRoot(projPath, equals(packageRootPath));
     manager.setRoots(includedPaths, excludedPaths, <String, String>{});
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
@@ -501,21 +514,6 @@
     });
   }
 
-  test_watch_addFileInSubfolder() {
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    // empty folder initially
-    Map<String, int> filePaths = manager.currentContextFilePaths[projPath];
-    expect(filePaths, hasLength(0));
-    // add file in subfolder
-    String filePath = posix.join(projPath, 'foo', 'bar.dart');
-    resourceProvider.newFile(filePath, 'contents');
-    // the file was added
-    return pumpEventQueue().then((_) {
-      expect(filePaths, hasLength(1));
-      expect(filePaths, contains(filePath));
-    });
-  }
-
   test_watch_addFile_excluded() {
     // prepare paths
     String project = '/project';
@@ -537,6 +535,21 @@
     });
   }
 
+  test_watch_addFileInSubfolder() {
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // empty folder initially
+    Map<String, int> filePaths = manager.currentContextFilePaths[projPath];
+    expect(filePaths, hasLength(0));
+    // add file in subfolder
+    String filePath = posix.join(projPath, 'foo', 'bar.dart');
+    resourceProvider.newFile(filePath, 'contents');
+    // the file was added
+    return pumpEventQueue().then((_) {
+      expect(filePaths, hasLength(1));
+      expect(filePaths, contains(filePath));
+    });
+  }
+
   test_watch_addPubspec_toRoot() {
     // prepare paths
     String root = '/root';
@@ -773,11 +786,6 @@
   Map<String, int> currentContextTimestamps = <String, int>{};
 
   /**
-   * Iterable of the paths to contexts that currently exist.
-   */
-  Iterable<String> get currentContextPaths => currentContextTimestamps.keys;
-
-  /**
    * Map from context to (map from file path to timestamp of last event).
    */
   final Map<String, Map<String, int>> currentContextFilePaths = <String,
@@ -786,13 +794,18 @@
   /**
    * Map from context to package URI resolver.
    */
-  final Map<String, UriResolver> currentContextPackageUriResolvers =
-      <String, UriResolver>{};
+  final Map<String, UriResolver> currentContextPackageUriResolvers = <String,
+      UriResolver>{};
 
   TestContextManager(MemoryResourceProvider resourceProvider,
       PackageMapProvider packageMapProvider)
       : super(resourceProvider, packageMapProvider);
 
+  /**
+   * Iterable of the paths to contexts that currently exist.
+   */
+  Iterable<String> get currentContextPaths => currentContextTimestamps.keys;
+
   @override
   void addContext(Folder folder, UriResolver packageUriResolver) {
     String path = folder.path;
@@ -839,7 +852,7 @@
 
   @override
   void updateContextPackageUriResolver(Folder contextFolder,
-                                       UriResolver packageUriResolver) {
+      UriResolver packageUriResolver) {
     currentContextPackageUriResolvers[contextFolder.path] = packageUriResolver;
   }
 }
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 9cb3f54..bc3f976 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -10,14 +10,14 @@
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'mock_sdk.dart';
-import 'reflective_tests.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 
 import 'analysis_abstract.dart';
+import 'mock_sdk.dart';
 import 'mocks.dart';
+import 'reflective_tests.dart';
 
 
 main() {
@@ -38,6 +38,7 @@
         resourceProvider,
         new MockPackageMapProvider(),
         null,
+        new AnalysisServerOptions(),
         new MockSdk());
     handler = new AnalysisDomainHandler(server);
   });
@@ -49,8 +50,8 @@
     group('setAnalysisRoots', () {
       Response testSetAnalysisRoots(List<String> included,
           List<String> excluded) {
-        Request request = new AnalysisSetAnalysisRootsParams(included,
-            excluded).toRequest('0');
+        Request request =
+            new AnalysisSetAnalysisRootsParams(included, excluded).toRequest('0');
         return handler.handleRequest(request);
       }
 
@@ -93,8 +94,8 @@
       test('invalid', () {
         // TODO(paulberry): under the "eventual consistency" model this request
         // should not be invalid.
-        var request = new AnalysisSetPriorityFilesParams(
-            ['/project/lib.dart']).toRequest('0');
+        var request =
+            new AnalysisSetPriorityFilesParams(['/project/lib.dart']).toRequest('0');
         var response = handler.handleRequest(request);
         expect(response, isResponseFailure('0'));
       });
@@ -106,14 +107,14 @@
         resourceProvider.newFile('/p2/b.dart', 'library b;');
         resourceProvider.newFile('/p2/c.dart', 'library c;');
 
-        var setRootsRequest = new AnalysisSetAnalysisRootsParams(
-            ['/p1', '/p2'], []).toRequest('0');
+        var setRootsRequest =
+            new AnalysisSetAnalysisRootsParams(['/p1', '/p2'], []).toRequest('0');
         var setRootsResponse = handler.handleRequest(setRootsRequest);
         expect(setRootsResponse, isResponseSuccess('0'));
 
         void setPriorityFiles(List<String> fileList) {
-          var request = new AnalysisSetPriorityFilesParams(
-              fileList).toRequest('0');
+          var request =
+              new AnalysisSetPriorityFilesParams(fileList).toRequest('0');
           var response = handler.handleRequest(request);
           expect(response, isResponseSuccess('0'));
           // TODO(brianwilkerson) Enable the line below after getPriorityFiles
@@ -129,9 +130,11 @@
 
     group('updateOptions', () {
       test('invalid', () {
-        var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: {
-          'not-an-option': true
-        }});
+        var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {
+          OPTIONS: {
+            'not-an-option': true
+          }
+        });
         var response = handler.handleRequest(request);
         // Invalid options should be silently ignored.
         expect(response, isResponseSuccess('0'));
@@ -139,12 +142,14 @@
 
       test('null', () {
         // null is allowed as a synonym for {}.
-        var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: null});
+        var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {
+          OPTIONS: null
+        });
         var response = handler.handleRequest(request);
         expect(response, isResponseSuccess('0'));
       });
-
-      // TODO(paulberry): disabled because analyzeAngular is currently not in the API.
+      // TODO(paulberry): disabled because analyzeAngular is currently not in
+      // the API.
 //      test('valid', () {
 //        engine.AnalysisOptions oldOptions = server.contextDirectoryManager.defaultOptions;
 //        bool analyzeAngular = !oldOptions.analyzeAngular;
@@ -162,136 +167,6 @@
 }
 
 
-testUpdateContent() {
-  test('bad type', () {
-    AnalysisTestHelper helper = new AnalysisTestHelper();
-    helper.createSingleFileProject('// empty');
-    return helper.waitForOperationsFinished().then((_) {
-      Request request = new Request('0', ANALYSIS_UPDATE_CONTENT, {
-        'files': {
-          helper.testFile: {
-            TYPE: 'foo',
-          }
-        }
-      });
-      Response response = helper.handler.handleRequest(request);
-      expect(response, isResponseFailure('0'));
-    });
-  });
-
-  test('full content', () {
-    AnalysisTestHelper helper = new AnalysisTestHelper();
-    helper.createSingleFileProject('// empty');
-    return helper.waitForOperationsFinished().then((_) {
-      // no errors initially
-      List<AnalysisError> errors = helper.getTestErrors();
-      expect(errors, isEmpty);
-      // update code
-      helper.sendContentChange(new AddContentOverlay('library lib'));
-      // wait, there is an error
-      return helper.waitForOperationsFinished().then((_) {
-        List<AnalysisError> errors = helper.getTestErrors();
-        expect(errors, hasLength(1));
-      });
-    });
-  });
-
-  test('incremental', () {
-    AnalysisTestHelper helper = new AnalysisTestHelper();
-    String initialContent = 'library A;';
-    helper.createSingleFileProject(initialContent);
-    return helper.waitForOperationsFinished().then((_) {
-      // no errors initially
-      List<AnalysisError> errors = helper.getTestErrors();
-      expect(errors, isEmpty);
-      // Add the file to the cache
-      helper.sendContentChange(new AddContentOverlay(initialContent));
-      // update code
-      helper.sendContentChange(new ChangeContentOverlay([
-          new SourceEdit('library '.length, 'A;'.length, 'lib')]));
-      // wait, there is an error
-      return helper.waitForOperationsFinished().then((_) {
-        List<AnalysisError> errors = helper.getTestErrors();
-        expect(errors, hasLength(1));
-      });
-    });
-  });
-
-  test('change on disk, normal', () {
-    AnalysisTestHelper helper = new AnalysisTestHelper();
-    helper.createSingleFileProject('library A;');
-    return helper.waitForOperationsFinished().then((_) {
-      // There should be no errors
-      expect(helper.getTestErrors(), hasLength(0));
-      // Change file on disk, adding a syntax error.
-      helper.resourceProvider.modifyFile(helper.testFile, 'library lib');
-      // There should be errors now.
-      return pumpEventQueue().then((_) {
-        return helper.waitForOperationsFinished().then((_) {
-          expect(helper.getTestErrors(), hasLength(1));
-        });
-      });
-    });
-  });
-
-  test('change on disk, during override', () {
-    AnalysisTestHelper helper = new AnalysisTestHelper();
-    helper.createSingleFileProject('library A;');
-    return helper.waitForOperationsFinished().then((_) {
-      // update code
-      helper.sendContentChange(new AddContentOverlay('library B;'));
-      // There should be no errors
-      return helper.waitForOperationsFinished().then((_) {
-        expect(helper.getTestErrors(), hasLength(0));
-        // Change file on disk, adding a syntax error.
-        helper.resourceProvider.modifyFile(helper.testFile, 'library lib');
-        // There should still be no errors (file should not have been reread).
-        return helper.waitForOperationsFinished().then((_) {
-          expect(helper.getTestErrors(), hasLength(0));
-          // Send a content change with a null content param--file should be
-          // reread from disk.
-          helper.sendContentChange(new RemoveContentOverlay());
-          // There should be errors now.
-          return helper.waitForOperationsFinished().then((_) {
-            expect(helper.getTestErrors(), hasLength(1));
-          });
-        });
-      });
-    });
-  });
-
-  group('out of range', () {
-    Future outOfRangeTest(SourceEdit edit) {
-      AnalysisTestHelper helper = new AnalysisTestHelper();
-      helper.createSingleFileProject('library A;');
-      return helper.waitForOperationsFinished().then((_) {
-        helper.sendContentChange(new AddContentOverlay('library B;'));
-        return helper.waitForOperationsFinished().then((_) {
-          ChangeContentOverlay contentChange = new ChangeContentOverlay([edit]);
-          Request request = new AnalysisUpdateContentParams({
-            helper.testFile: contentChange}).toRequest('0');
-          Response response = helper.handler.handleRequest(request);
-          expect(response, isResponseFailure('0',
-              RequestErrorCode.INVALID_OVERLAY_CHANGE));
-        });
-      });
-    }
-
-    test('negative length', () {
-      return outOfRangeTest(new SourceEdit(3, -1, 'foo'));
-    });
-
-    test('negative offset', () {
-      return outOfRangeTest(new SourceEdit(-1, 3, 'foo'));
-    });
-
-    test('beyond end', () {
-      return outOfRangeTest(new SourceEdit(6, 6, 'foo'));
-    });
-  });
-}
-
-
 void test_setSubscriptions() {
   test('before analysis', () {
     AnalysisTestHelper helper = new AnalysisTestHelper();
@@ -356,12 +231,136 @@
 }
 
 
-int _getSafeInt(Map<String, Object> json, String key, int defaultValue) {
-  Object value = json[key];
-  if (value is int) {
-    return value;
-  }
-  return defaultValue;
+testUpdateContent() {
+  test('bad type', () {
+    AnalysisTestHelper helper = new AnalysisTestHelper();
+    helper.createSingleFileProject('// empty');
+    return helper.waitForOperationsFinished().then((_) {
+      Request request = new Request('0', ANALYSIS_UPDATE_CONTENT, {
+        'files': {
+          helper.testFile: {
+            TYPE: 'foo',
+          }
+        }
+      });
+      Response response = helper.handler.handleRequest(request);
+      expect(response, isResponseFailure('0'));
+    });
+  });
+
+  test('full content', () {
+    AnalysisTestHelper helper = new AnalysisTestHelper();
+    helper.createSingleFileProject('// empty');
+    return helper.waitForOperationsFinished().then((_) {
+      // no errors initially
+      List<AnalysisError> errors = helper.getTestErrors();
+      expect(errors, isEmpty);
+      // update code
+      helper.sendContentChange(new AddContentOverlay('library lib'));
+      // wait, there is an error
+      return helper.waitForOperationsFinished().then((_) {
+        List<AnalysisError> errors = helper.getTestErrors();
+        expect(errors, hasLength(1));
+      });
+    });
+  });
+
+  test('incremental', () {
+    AnalysisTestHelper helper = new AnalysisTestHelper();
+    String initialContent = 'library A;';
+    helper.createSingleFileProject(initialContent);
+    return helper.waitForOperationsFinished().then((_) {
+      // no errors initially
+      List<AnalysisError> errors = helper.getTestErrors();
+      expect(errors, isEmpty);
+      // Add the file to the cache
+      helper.sendContentChange(new AddContentOverlay(initialContent));
+      // update code
+      helper.sendContentChange(
+          new ChangeContentOverlay(
+              [new SourceEdit('library '.length, 'A;'.length, 'lib')]));
+      // wait, there is an error
+      return helper.waitForOperationsFinished().then((_) {
+        List<AnalysisError> errors = helper.getTestErrors();
+        expect(errors, hasLength(1));
+      });
+    });
+  });
+
+  test('change on disk, normal', () {
+    AnalysisTestHelper helper = new AnalysisTestHelper();
+    helper.createSingleFileProject('library A;');
+    return helper.waitForOperationsFinished().then((_) {
+      // There should be no errors
+      expect(helper.getTestErrors(), hasLength(0));
+      // Change file on disk, adding a syntax error.
+      helper.resourceProvider.modifyFile(helper.testFile, 'library lib');
+      // There should be errors now.
+      return pumpEventQueue().then((_) {
+        return helper.waitForOperationsFinished().then((_) {
+          expect(helper.getTestErrors(), hasLength(1));
+        });
+      });
+    });
+  });
+
+  test('change on disk, during override', () {
+    AnalysisTestHelper helper = new AnalysisTestHelper();
+    helper.createSingleFileProject('library A;');
+    return helper.waitForOperationsFinished().then((_) {
+      // update code
+      helper.sendContentChange(new AddContentOverlay('library B;'));
+      // There should be no errors
+      return helper.waitForOperationsFinished().then((_) {
+        expect(helper.getTestErrors(), hasLength(0));
+        // Change file on disk, adding a syntax error.
+        helper.resourceProvider.modifyFile(helper.testFile, 'library lib');
+        // There should still be no errors (file should not have been reread).
+        return helper.waitForOperationsFinished().then((_) {
+          expect(helper.getTestErrors(), hasLength(0));
+          // Send a content change with a null content param--file should be
+          // reread from disk.
+          helper.sendContentChange(new RemoveContentOverlay());
+          // There should be errors now.
+          return helper.waitForOperationsFinished().then((_) {
+            expect(helper.getTestErrors(), hasLength(1));
+          });
+        });
+      });
+    });
+  });
+
+  group('out of range', () {
+    Future outOfRangeTest(SourceEdit edit) {
+      AnalysisTestHelper helper = new AnalysisTestHelper();
+      helper.createSingleFileProject('library A;');
+      return helper.waitForOperationsFinished().then((_) {
+        helper.sendContentChange(new AddContentOverlay('library B;'));
+        return helper.waitForOperationsFinished().then((_) {
+          ChangeContentOverlay contentChange = new ChangeContentOverlay([edit]);
+          Request request = new AnalysisUpdateContentParams({
+            helper.testFile: contentChange
+          }).toRequest('0');
+          Response response = helper.handler.handleRequest(request);
+          expect(
+              response,
+              isResponseFailure('0', RequestErrorCode.INVALID_OVERLAY_CHANGE));
+        });
+      });
+    }
+
+    test('negative length', () {
+      return outOfRangeTest(new SourceEdit(3, -1, 'foo'));
+    });
+
+    test('negative offset', () {
+      return outOfRangeTest(new SourceEdit(-1, 3, 'foo'));
+    });
+
+    test('beyond end', () {
+      return outOfRangeTest(new SourceEdit(6, 6, 'foo'));
+    });
+  });
 }
 
 
@@ -416,8 +415,8 @@
 library lib_a;
 class A {}
 ''');
-    packageMapProvider.packageMap['pkgA'] = [
-        resourceProvider.getResource('/packages/pkgA')];
+    packageMapProvider.packageMap['pkgA'] =
+        [resourceProvider.getResource('/packages/pkgA')];
     addTestFile('''
 import 'package:pkgA/libA.dart';
 main(A a) {
@@ -461,6 +460,7 @@
         resourceProvider,
         new MockPackageMapProvider(),
         null,
+        new AnalysisServerOptions(),
         new MockSdk());
     handler = new AnalysisDomainHandler(server);
     // listen for notifications
@@ -472,11 +472,13 @@
         filesErrors[decoded.file] = decoded.errors;
       }
       if (notification.event == ANALYSIS_HIGHLIGHTS) {
-        var params = new AnalysisHighlightsParams.fromNotification(notification);
+        var params =
+            new AnalysisHighlightsParams.fromNotification(notification);
         filesHighlights[params.file] = params.regions;
       }
       if (notification.event == ANALYSIS_NAVIGATION) {
-        var params = new AnalysisNavigationParams.fromNotification(notification);
+        var params =
+            new AnalysisNavigationParams.fromNotification(notification);
         filesNavigation[params.file] = params.regions;
       }
     });
@@ -491,8 +493,8 @@
     }
     files.add(file);
     // set subscriptions
-    Request request = new AnalysisSetSubscriptionsParams(
-        analysisSubscriptions).toRequest('0');
+    Request request =
+        new AnalysisSetSubscriptionsParams(analysisSubscriptions).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
@@ -509,8 +511,8 @@
    */
   void createEmptyProject() {
     resourceProvider.newFolder('/project');
-    Request request = new AnalysisSetAnalysisRootsParams(['/project'],
-        []).toRequest('0');
+    Request request =
+        new AnalysisSetAnalysisRootsParams(['/project'], []).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
@@ -522,8 +524,8 @@
     this.testCode = _getCodeString(code);
     resourceProvider.newFolder('/project');
     resourceProvider.newFile(testFile, testCode);
-    Request request = new AnalysisSetAnalysisRootsParams(['/project'],
-        []).toRequest('0');
+    Request request =
+        new AnalysisSetAnalysisRootsParams(['/project'], []).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
@@ -610,7 +612,8 @@
    */
   void sendContentChange(dynamic contentChange) {
     Request request = new AnalysisUpdateContentParams({
-      testFile: contentChange}).toRequest('0');
+      testFile: contentChange
+    }).toRequest('0');
     handleSuccessfulRequest(request);
   }
 
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 7b0ae4b..a5caa95 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -6,23 +6,174 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/domain_completion.dart';
 import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/services/index/index.dart' show Index;
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
-import 'reflective_tests.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
 
 import 'analysis_abstract.dart';
 import 'mocks.dart';
+import 'reflective_tests.dart';
 
 main() {
   groupSep = ' | ';
+  runReflectiveTests(CompletionCacheTest);
   runReflectiveTests(CompletionTest);
 }
 
 @ReflectiveTestCase()
+class CompletionCacheTest extends AbstractAnalysisTest {
+  AnalysisDomainHandler analysisDomain;
+
+  @override
+  void setUp() {
+    super.setUp();
+    createProject();
+    analysisDomain = handler;
+    handler = new Test_CompletionDomainHandler(server);
+  }
+
+  void tearDown() {
+    super.tearDown();
+    analysisDomain = null;
+  }
+
+  test_cache() {
+    Test_CompletionDomainHandler target = handler;
+    addTestFile('^library A; cl');
+    Request request =
+        new CompletionGetSuggestionsParams(testFile, 0).toRequest('0');
+
+    /*
+     * Assert cache is created by manager
+     * and context.onSourceChanged listen is called
+     */
+    Source source;
+    var expectedCache = null;
+    handleSuccessfulRequest(request);
+    return pumpEventQueue().then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expect(target.completionManager.computeCallCount, 1);
+      source = target.completionManager.source;
+      expect(source, isNotNull);
+      expectedCache = target.completionManager.cache;
+      expect(expectedCache, isNotNull);
+      expect(target.mockContext.mockStream.listenCount, 1);
+      expect(target.mockContext.mockStream.cancelCount, 0);
+
+      /*
+       * Assert cache is stored in target,
+       * and context.onSourceChanged listen has not changed
+       */
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 1);
+      expect(target.mockContext.mockStream.cancelCount, 0);
+
+      /*
+       * Assert same cache and listening is preserved across multiple calls
+       */
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 1);
+      expect(target.mockContext.mockStream.cancelCount, 0);
+
+      /*
+       * Trigger source change event that should NOT clear existing cache
+       */
+      target.sourcesChanged(new SourcesChangedEvent.changedContent(source, ''));
+    }).then((_) {
+
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 1);
+      expect(target.mockContext.mockStream.cancelCount, 0);
+
+      /*
+       * Trigger source change event that should clear existing cache
+       * and assert subscription.cancel is called when the cache is discarded.
+       */
+      ChangeSet changeSet = new ChangeSet();
+      changeSet.removedSource(source);
+      target.sourcesChanged(new SourcesChangedEvent(changeSet));
+    }).then((_) {
+      expect(target.mockContext.mockStream.listenCount, 1);
+      expect(target.mockContext.mockStream.cancelCount, 1);
+
+      /*
+       * Assert that cache was cleared, recreated,
+       * and context.onSourceChanged listen is called again.
+       */
+      expectedCache = null;
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expectedCache = target.completionManager.cache;
+      expect(expectedCache, isNotNull);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 2);
+      expect(target.mockContext.mockStream.cancelCount, 1);
+
+      /*
+       * Assert same cache and listening is preserved across multiple calls
+       */
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 2);
+      expect(target.mockContext.mockStream.cancelCount, 1);
+
+      /*
+       * Trigger context change event that should clear existing cache
+       */
+      Request request =
+          new AnalysisSetAnalysisRootsParams([], []).toRequest('0');
+      Response response = analysisDomain.handleRequest(request);
+      expect(response, isResponseSuccess('0'));
+      return pumpEventQueue();
+    }).then((_) {
+      expect(target.mockContext.mockStream.listenCount, 2);
+      expect(target.mockContext.mockStream.cancelCount, 2);
+
+      /*
+       * Assert that cache was cleared, recreated,
+       * and context.onSourceChanged listen is called again.
+       */
+      expectedCache = null;
+      handleSuccessfulRequest(request);
+      return pumpEventQueue();
+    }).then((_) {
+      expect(identical(target.cacheReceived, expectedCache), isTrue);
+      expectedCache = target.completionManager.cache;
+      expect(expectedCache, isNotNull);
+      expect(target.completionManager.computeCallCount, 1);
+      expect(target.mockContext.mockStream.listenCount, 3);
+      expect(target.mockContext.mockStream.cancelCount, 2);
+    });
+  }
+}
+
+@ReflectiveTestCase()
 class CompletionTest extends AbstractAnalysisTest {
   String completionId;
   int completionOffset;
@@ -159,6 +310,15 @@
     });
   }
 
+  test_invocation() {
+    addTestFile('class A {b() {}} main() {A a; a.^}');
+    return getSuggestions().then((_) {
+      expect(replacementOffset, equals(completionOffset));
+      expect(replacementLength, equals(0));
+      assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
+    });
+  }
+
   test_keyword() {
     addTestFile('library A; cl^');
     return getSuggestions().then((_) {
@@ -187,15 +347,6 @@
     });
   }
 
-  test_invocation() {
-    addTestFile('class A {b() {}} main() {A a; a.^}');
-    return getSuggestions().then((_) {
-      expect(replacementOffset, equals(completionOffset));
-      expect(replacementLength, equals(0));
-      assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
-    });
-  }
-
   test_topLevel() {
     addTestFile('''
       typedef foo();
@@ -211,3 +362,129 @@
     });
   }
 }
+
+class MockCache extends CompletionCache {
+  MockCache(AnalysisContext context, Source source) : super(context, source);
+}
+
+class MockCompletionManager implements CompletionManager {
+  final AnalysisContext context;
+  final Source source;
+  final int offset;
+  final SearchEngine searchEngine;
+  CompletionCache cache;
+  CompletionPerformance performance;
+  StreamController<CompletionResult> controller;
+  int computeCallCount = 0;
+
+  MockCompletionManager(this.context, this.source, this.offset,
+      this.searchEngine, this.cache, this.performance);
+
+  @override
+  CompletionCache get completionCache {
+    if (cache == null) {
+      cache = new MockCache(context, source);
+    }
+    return cache;
+  }
+
+  @override
+  void compute() {
+    ++computeCallCount;
+    CompletionResult result = new CompletionResult(0, 0, [], true);
+    controller.add(result);
+  }
+
+  @override
+  Stream<CompletionResult> results() {
+    controller = new StreamController<CompletionResult>(onListen: () {
+      scheduleMicrotask(compute);
+    });
+    return controller.stream;
+  }
+}
+
+/**
+ * Mock [AnaysisContext] for tracking usage of onSourcesChanged.
+ */
+class MockContext implements AnalysisContext {
+  MockStream<SourcesChangedEvent> mockStream;
+
+  MockContext() {
+    mockStream = new MockStream<SourcesChangedEvent>();
+  }
+
+  @override
+  Stream<SourcesChangedEvent> get onSourcesChanged => mockStream;
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+/**
+ * Mock stream for tracking calls to listen and subscription.cancel.
+ */
+class MockStream<E> implements Stream<E> {
+  MockSubscription<E> mockSubscription = new MockSubscription<E>();
+  int listenCount = 0;
+
+  int get cancelCount => mockSubscription.cancelCount;
+
+  @override
+  StreamSubscription<E> listen(void onData(E event), {Function onError, void
+      onDone(), bool cancelOnError}) {
+    ++listenCount;
+    return mockSubscription;
+  }
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+/**
+ * Mock subscription for tracking calls to subscription.cancel.
+ */
+class MockSubscription<E> implements StreamSubscription<E> {
+  int cancelCount = 0;
+
+  Future cancel() {
+    ++cancelCount;
+    return new Future.value(true);
+  }
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+/**
+ * A [CompletionDomainHandler] subclass that returns a mock completion manager
+ * so that the domain handler cache management can be tested.
+ */
+class Test_CompletionDomainHandler extends CompletionDomainHandler {
+  CompletionCache cacheReceived;
+  final MockContext mockContext = new MockContext();
+  MockCompletionManager completionManager;
+
+  Test_CompletionDomainHandler(AnalysisServer server) : super(server);
+
+  void contextsChanged(ContextsChangedEvent event) {
+    if (event.removed.length == 1) {
+      event = new ContextsChangedEvent(
+          added: event.added,
+          changed: event.changed,
+          removed: [mockContext]);
+    }
+    super.contextsChanged(event);
+  }
+
+  CompletionManager createCompletionManager(AnalysisContext context,
+      Source source, int offset, SearchEngine searchEngine, CompletionCache cache,
+      CompletionPerformance performance) {
+    cacheReceived = cache;
+    completionManager = new MockCompletionManager(
+        mockContext,
+        source,
+        offset,
+        searchEngine,
+        cache,
+        performance);
+    return completionManager;
+  }
+}
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index 447a736..baad55c 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -4,20 +4,29 @@
 
 library test.domain.execution;
 
-import 'package:analyzer/file_system/physical_file_system.dart';
+import 'dart:async';
+
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_execution.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'mock_sdk.dart';
-import 'package:unittest/unittest.dart';
-
-import 'mocks.dart';
-import 'operation/operation_queue_test.dart';
-import 'package:typed_mock/typed_mock.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'dart:async';
+import 'package:typed_mock/typed_mock.dart';
+import 'package:unittest/unittest.dart';
+
+import 'mock_sdk.dart';
+import 'mocks.dart';
+import 'operation/operation_queue_test.dart';
+
+/**
+ * Return a matcher that will match an [ExecutableFile] if it has the given
+ * [source] and [kind].
+ */
+Matcher isExecutableFile(Source source, ExecutableKind kind) {
+  return new IsExecutableFile(source.fullName, kind);
+}
 
 main() {
   group('ExecutionDomainHandler', () {
@@ -30,6 +39,7 @@
           PhysicalResourceProvider.INSTANCE,
           new MockPackageMapProvider(),
           null,
+          new AnalysisServerOptions(),
           new MockSdk());
       handler = new ExecutionDomainHandler(server);
     });
@@ -168,14 +178,15 @@
       Source source7 = new TestSource('/g.html');
 
       AnalysisContext context = new AnalysisContextMock();
-      when(context.launchableClientLibrarySources)
-          .thenReturn([source1, source2]);
-      when(context.launchableServerLibrarySources)
-          .thenReturn([source2, source3]);
+      when(
+          context.launchableClientLibrarySources).thenReturn([source1, source2]);
+      when(
+          context.launchableServerLibrarySources).thenReturn([source2, source3]);
       when(context.librarySources).thenReturn([source4]);
       when(context.htmlSources).thenReturn([source5]);
-      when(context.getLibrariesReferencedFromHtml(anyObject))
-          .thenReturn([source6, source7]);
+      when(
+          context.getLibrariesReferencedFromHtml(
+              anyObject)).thenReturn([source6, source7]);
 
       ServerContextManager manager = new ServerContextManagerMock();
       when(manager.isInAnalysisRoot(anyString)).thenReturn(true);
@@ -189,10 +200,13 @@
       when(server.onFileAnalyzed).thenReturn(controller.stream);
 
       List<String> unsentNotifications = <String>[
-          source1.fullName, source2.fullName, source3.fullName,
-          source4.fullName, source5.fullName];
-      when(server.sendNotification(anyObject))
-          .thenInvoke((Notification notification) {
+          source1.fullName,
+          source2.fullName,
+          source3.fullName,
+          source4.fullName,
+          source5.fullName];
+      when(
+          server.sendNotification(anyObject)).thenInvoke((Notification notification) {
         ExecutionLaunchDataParams params =
             new ExecutionLaunchDataParams.fromNotification(notification);
 
@@ -228,26 +242,6 @@
 }
 
 /**
- * A [Source] that knows it's [fullName].
- */
-class TestSource implements Source {
-  String fullName;
-
-  TestSource(this.fullName);
-
-  @override
-  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-/**
- * Return a matcher that will match an [ExecutableFile] if it has the given
- * [source] and [kind].
- */
-Matcher isExecutableFile(Source source, ExecutableKind kind) {
-  return new IsExecutableFile(source.fullName, kind);
-}
-
-/**
  * A matcher that will match an [ExecutableFile] if it has a specified [source]
  * and [kind].
  */
@@ -270,3 +264,15 @@
     return item.file == expectedFile && item.kind == expectedKind;
   }
 }
+
+/**
+ * A [Source] that knows it's [fullName].
+ */
+class TestSource implements Source {
+  String fullName;
+
+  TestSource(this.fullName);
+
+  @override
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
diff --git a/pkg/analysis_server/test/domain_server_test.dart b/pkg/analysis_server/test/domain_server_test.dart
index bed6f4b..4456e37 100644
--- a/pkg/analysis_server/test/domain_server_test.dart
+++ b/pkg/analysis_server/test/domain_server_test.dart
@@ -4,14 +4,14 @@
 
 library test.domain.server;
 
-import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_server.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'mock_sdk.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:unittest/unittest.dart';
 
+import 'mock_sdk.dart';
 import 'mocks.dart';
 
 main() {
@@ -22,7 +22,11 @@
     var serverChannel = new MockServerChannel();
     var resourceProvider = PhysicalResourceProvider.INSTANCE;
     server = new AnalysisServer(
-        serverChannel, resourceProvider, new MockPackageMapProvider(), null,
+        serverChannel,
+        resourceProvider,
+        new MockPackageMapProvider(),
+        null,
+        new AnalysisServerOptions(),
         new MockSdk());
     handler = new ServerDomainHandler(server);
   });
@@ -51,8 +55,8 @@
       test('success', () {
         expect(server.serverServices, isEmpty);
         // send request
-        Request request = new ServerSetSubscriptionsParams(
-            [ServerService.STATUS]).toRequest('0');
+        Request request =
+            new ServerSetSubscriptionsParams([ServerService.STATUS]).toRequest('0');
         var response = handler.handleRequest(request);
         expect(response, isResponseSuccess('0'));
         // set of services has been changed
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 099b13f..152ebbb 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -8,10 +8,10 @@
 
 import 'package:analysis_server/src/edit/edit_domain.dart';
 import 'package:analysis_server/src/protocol.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart' hide ERROR;
 
 import '../analysis_abstract.dart';
+import '../reflective_tests.dart';
 
 
 main() {
@@ -30,8 +30,8 @@
   }
 
   void prepareAssistsAt(int offset, int length) {
-    Request request = new EditGetAssistsParams(testFile, offset,
-        length).toRequest('0');
+    Request request =
+        new EditGetAssistsParams(testFile, offset, length).toRequest('0');
     Response response = handleSuccessfulRequest(request);
     var result = new EditGetAssistsResult.fromResponse(response);
     changes = result.assists;
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 76350be..cbfc511 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -1071,6 +1071,7 @@
     addTestFile('''
 class A {
   var test = 0;
+  A(this.test);
   main() {
     print(test);
   }
@@ -1081,6 +1082,7 @@
     }, '''
 class A {
   var newName = 0;
+  A(this.newName);
   main() {
     print(newName);
   }
@@ -1088,6 +1090,52 @@
 ''');
   }
 
+  test_classMember_field_onFieldFormalParameter() {
+    addTestFile('''
+class A {
+  var test = 0;
+  A(this.test);
+  main() {
+    print(test);
+  }
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('test);', 'newName');
+    }, '''
+class A {
+  var newName = 0;
+  A(this.newName);
+  main() {
+    print(newName);
+  }
+}
+''');
+  }
+
+  test_classMember_field_onFieldFormalParameter_named() {
+    addTestFile('''
+class A {
+  final int test;
+  A({this.test: 0});
+}
+main() {
+  new A(test: 42);
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('test: 42', 'newName');
+    }, '''
+class A {
+  final int newName;
+  A({this.newName: 0});
+}
+main() {
+  new A(newName: 42);
+}
+''');
+  }
+
   test_classMember_getter() {
     addTestFile('''
 class A {
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index 21330d7..cee4dfc 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -10,13 +10,16 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(AnalysisErrorIntegrationTest);
+}
+
 @ReflectiveTestCase()
 class AnalysisErrorIntegrationTest extends AbstractAnalysisServerIntegrationTest
     {
   test_detect_simple_error() {
     String pathname = sourcePath('test.dart');
-    writeFile(pathname,
-        '''
+    writeFile(pathname, '''
 main() {
   print(null) // parse error: missing ';'
 }''');
@@ -29,7 +32,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(AnalysisErrorIntegrationTest);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
index 013ca3c..6fc12f4 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_after_analysis_test.dart
@@ -5,14 +5,13 @@
 library test.integration.analysis.get.errors.after.analysis;
 
 import '../../reflective_tests.dart';
-
 import 'get_errors.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AnalysisDomainGetErrorsTest {
   Test() : super(true);
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
index a633e00..52e6a91 100644
--- a/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_errors_before_analysis_test.dart
@@ -5,14 +5,13 @@
 library test.integration.analysis.get.errors.before.analysis;
 
 import '../../reflective_tests.dart';
-
 import 'get_errors.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AnalysisDomainGetErrorsTest {
   Test() : super(false);
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
index 08431bc..0356b81 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -13,6 +13,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(AnalysisGetHoverIntegrationTest);
+}
+
 @ReflectiveTestCase()
 class AnalysisGetHoverIntegrationTest extends
     AbstractAnalysisServerIntegrationTest {
@@ -24,8 +28,7 @@
   /**
    * Dart code under test.
    */
-  final String text =
-      r'''
+  final String text = r'''
 library lib.test;
 
 List topLevelVar;
@@ -45,54 +48,6 @@
 }
 ''';
 
-  setUp() {
-    return super.setUp().then((_) {
-      pathname = sourcePath('test.dart');
-    });
-  }
-
-  test_getHover() {
-    writeFile(pathname, text);
-    standardAnalysisSetup();
-
-    // Note: analysis.getHover doesn't wait for analysis to complete--it simply
-    // returns the latest results that are available at the time that the
-    // request is made.  So wait for analysis to finish before testing anything.
-    return analysisFinished.then((_) {
-      List<Future> tests = [];
-      tests.add(checkHover('topLevelVar;', 11, ['List', 'topLevelVar'],
-          'top level variable', ['List']));
-      tests.add(checkHover('func(', 4, ['func', 'int', 'param'], 'function',
-          ['int', 'void'], docRegexp: 'Documentation for func'));
-      tests.add(checkHover('int param', 3, ['int'], 'class', ['int'], isCore:
-          true, docRegexp: '.*'));
-      tests.add(checkHover('param)', 5, ['int', 'param'], 'parameter', ['int'],
-          docRegexp: 'Documentation for func'));
-      tests.add(checkHover('num localVar', 3, ['num'], 'class', ['num'], isCore:
-          true, docRegexp: '.*'));
-      tests.add(checkHover('localVar =', 8, ['num', 'localVar'],
-          'local variable', ['num'], propagatedType: 'int'));
-      tests.add(checkHover('topLevelVar.length;', 11, ['List', 'topLevelVar'],
-          'top level variable', ['List']));
-      tests.add(checkHover('length;', 6, ['get', 'length', 'int'], 'getter',
-          ['int'], isCore: true, docRegexp: '.*'));
-      tests.add(checkHover('length =', 6, ['set', 'length', 'int'], 'setter',
-          ['int'], isCore: true, docRegexp: '.*'));
-      tests.add(checkHover('param;', 5, ['int', 'param'], 'parameter', ['int'],
-          docRegexp: 'Documentation for func', parameterRegexps: ['.*']));
-      tests.add(checkHover('add(', 3, ['List', 'add'], 'method', null, isCore:
-          true, docRegexp: '.*'));
-      tests.add(checkHover('localVar)', 8, ['num', 'localVar'],
-          'local variable', ['num'], parameterRegexps: ['.*'], propagatedType: 'int'));
-      tests.add(checkHover('func(35', 4, ['func', 'int', 'param'], 'function',
-          null, docRegexp: 'Documentation for func'));
-      tests.add(checkHover('35', 2, null, null, ['int'], isLiteral: true,
-          parameterRegexps: ['int', 'param']));
-      tests.add(checkNoHover('comment'));
-      return Future.wait(tests);
-    });
-  }
-
   /**
    * Check that a getHover request on the substring [target] produces a result
    * which has length [length], has an elementDescription matching every
@@ -106,9 +61,9 @@
    * match the hover parameters.  [propagatedType], if specified, is the
    * expected propagated type of the element.
    */
-  checkHover(String target, int length, List<String> descriptionRegexps, String
-      kind, List<String> staticTypeRegexps, {bool isCore: false, String docRegexp:
-      null, bool isLiteral: false, List<String> parameterRegexps:
+  checkHover(String target, int length, List<String> descriptionRegexps,
+      String kind, List<String> staticTypeRegexps, {bool isCore: false,
+      String docRegexp: null, bool isLiteral: false, List<String> parameterRegexps:
       null, propagatedType: null}) {
     int offset = text.indexOf(target);
     return sendAnalysisGetHover(pathname, offset).then((result) {
@@ -170,8 +125,142 @@
       expect(result.hovers, hasLength(0));
     });
   }
-}
 
-main() {
-  runReflectiveTests(AnalysisGetHoverIntegrationTest);
+  setUp() {
+    return super.setUp().then((_) {
+      pathname = sourcePath('test.dart');
+    });
+  }
+
+  test_getHover() {
+    writeFile(pathname, text);
+    standardAnalysisSetup();
+
+    // Note: analysis.getHover doesn't wait for analysis to complete--it simply
+    // returns the latest results that are available at the time that the
+    // request is made.  So wait for analysis to finish before testing anything.
+    return analysisFinished.then((_) {
+      List<Future> tests = [];
+      tests.add(
+          checkHover(
+              'topLevelVar;',
+              11,
+              ['List', 'topLevelVar'],
+              'top level variable',
+              ['List']));
+      tests.add(
+          checkHover(
+              'func(',
+              4,
+              ['func', 'int', 'param'],
+              'function',
+              ['int', 'void'],
+              docRegexp: 'Documentation for func'));
+      tests.add(
+          checkHover(
+              'int param',
+              3,
+              ['int'],
+              'class',
+              ['int'],
+              isCore: true,
+              docRegexp: '.*'));
+      tests.add(
+          checkHover(
+              'param)',
+              5,
+              ['int', 'param'],
+              'parameter',
+              ['int'],
+              docRegexp: 'Documentation for func'));
+      tests.add(
+          checkHover(
+              'num localVar',
+              3,
+              ['num'],
+              'class',
+              ['num'],
+              isCore: true,
+              docRegexp: '.*'));
+      tests.add(
+          checkHover(
+              'localVar =',
+              8,
+              ['num', 'localVar'],
+              'local variable',
+              ['num'],
+              propagatedType: 'int'));
+      tests.add(
+          checkHover(
+              'topLevelVar.length;',
+              11,
+              ['List', 'topLevelVar'],
+              'top level variable',
+              ['List']));
+      tests.add(
+          checkHover(
+              'length;',
+              6,
+              ['get', 'length', 'int'],
+              'getter',
+              ['int'],
+              isCore: true,
+              docRegexp: '.*'));
+      tests.add(
+          checkHover(
+              'length =',
+              6,
+              ['set', 'length', 'int'],
+              'setter',
+              ['int'],
+              isCore: true,
+              docRegexp: '.*'));
+      tests.add(
+          checkHover(
+              'param;',
+              5,
+              ['int', 'param'],
+              'parameter',
+              ['int'],
+              docRegexp: 'Documentation for func',
+              parameterRegexps: ['.*']));
+      tests.add(
+          checkHover(
+              'add(',
+              3,
+              ['List', 'add'],
+              'method',
+              null,
+              isCore: true,
+              docRegexp: '.*'));
+      tests.add(
+          checkHover(
+              'localVar)',
+              8,
+              ['num', 'localVar'],
+              'local variable',
+              ['num'],
+              parameterRegexps: ['.*'],
+              propagatedType: 'int'));
+      tests.add(
+          checkHover(
+              'func(35',
+              4,
+              ['func', 'int', 'param'],
+              'function',
+              null,
+              docRegexp: 'Documentation for func'));
+      tests.add(
+          checkHover(
+              '35',
+              2,
+              null,
+              null,
+              ['int'],
+              isLiteral: true,
+              parameterRegexps: ['int', 'param']));
+      tests.add(checkNoHover('comment'));
+      return Future.wait(tests);
+    });
+  }
 }
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index 202dc03..ba7bc77 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -10,6 +10,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(AnalysisHighlightsTest);
+}
+
 @ReflectiveTestCase()
 class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest {
   test_highlights() {
@@ -144,7 +148,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(AnalysisHighlightsTest);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/navigation_test.dart b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
index f1873fe..22d4130 100644
--- a/pkg/analysis_server/test/integration/analysis/navigation_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
@@ -10,6 +10,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(AnalysisNavigationTest);
+}
+
 @ReflectiveTestCase()
 class AnalysisNavigationTest extends AbstractAnalysisServerIntegrationTest {
   test_navigation() {
@@ -129,7 +133,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(AnalysisNavigationTest);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 413459b2..826b061 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -10,12 +10,15 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_occurrences() {
     String pathname = sourcePath('test.dart');
-    String text =
-        r'''
+    String text = r'''
 main() {
   int sum = 0;
   for (int i = 0; i < 10; i++) {
@@ -48,8 +51,8 @@
         return null;
       }
       void check(String elementName, Iterable<String> expectedOccurrences) {
-        Set<int> expectedOffsets = expectedOccurrences.map((String substring) =>
-            text.indexOf(substring)).toSet();
+        Set<int> expectedOffsets =
+            expectedOccurrences.map((String substring) => text.indexOf(substring)).toSet();
         Set<int> foundOffsets = findOffsets(elementName);
         expect(foundOffsets, equals(expectedOffsets));
       }
@@ -59,7 +62,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/outline_test.dart b/pkg/analysis_server/test/integration/analysis/outline_test.dart
index 6fd80d7..3597835 100644
--- a/pkg/analysis_server/test/integration/analysis/outline_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/outline_test.dart
@@ -10,12 +10,28 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
+  /**
+   * Verify that the range of source text covered by the given outline objects
+   * is connected (the end of each object in the list corresponds to the start
+   * of the next).
+   */
+  void checkConnected(List<Outline> outlineObjects) {
+    for (int i = 0; i < outlineObjects.length - 1; i++) {
+      expect(
+          outlineObjects[i + 1].offset,
+          equals(outlineObjects[i].offset + outlineObjects[i].length));
+    }
+  }
+
   test_outline() {
     String pathname = sourcePath('test.dart');
-    String text =
-        r'''
+    String text = r'''
 class Class1 {
   int field;
 
@@ -65,20 +81,4 @@
       checkConnected(members);
     });
   }
-
-  /**
-   * Verify that the range of source text covered by the given outline objects
-   * is connected (the end of each object in the list corresponds to the start
-   * of the next).
-   */
-  void checkConnected(List<Outline> outlineObjects) {
-    for (int i = 0; i < outlineObjects.length - 1; i++) {
-      expect(outlineObjects[i + 1].offset, equals(outlineObjects[i].offset
-          + outlineObjects[i].length));
-    }
-  }
-}
-
-main() {
-  runReflectiveTests(Test);
 }
diff --git a/pkg/analysis_server/test/integration/analysis/overrides_test.dart b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
index 9f5212f..05ede74 100644
--- a/pkg/analysis_server/test/integration/analysis/overrides_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
@@ -10,12 +10,15 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_overrides() {
     String pathname = sourcePath('test.dart');
-    String text =
-        r'''
+    String text = r'''
 abstract class Interface1 {
   method0();
   method1();
@@ -69,8 +72,8 @@
         }
         return null;
       }
-      void checkOverrides(String methodName, bool
-          expectedOverridesBase, List<String> expectedOverridesInterfaces) {
+      void checkOverrides(String methodName, bool expectedOverridesBase,
+          List<String> expectedOverridesInterfaces) {
         Override override = findOverride(methodName);
         if (!expectedOverridesBase && expectedOverridesInterfaces.isEmpty) {
           // This method overrides nothing, so it should not appear in the
@@ -98,8 +101,9 @@
             bool wasAdded = actualOverridesInterfaces.add(className);
             expect(wasAdded, isTrue);
           }
-          expect(actualOverridesInterfaces, equals(
-              expectedOverridesInterfaces.toSet()));
+          expect(
+              actualOverridesInterfaces,
+              equals(expectedOverridesInterfaces.toSet()));
         } else {
           expect(interfaceMembers, isNull);
         }
@@ -115,7 +119,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/package_root_test.dart b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
index df26ee9..d2a7800 100644
--- a/pkg/analysis_server/test/integration/analysis/package_root_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
@@ -11,6 +11,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_package_root() {
@@ -35,14 +39,17 @@
     writeFile(mainPath, mainText);
     String normalizedFooBarPath = writeFile(fooBarPath, fooBarText);
     sendServerSetSubscriptions([ServerService.STATUS]);
-    sendAnalysisSetSubscriptions({AnalysisService.NAVIGATION: [mainPath]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.NAVIGATION: [mainPath]
+    });
     List<NavigationRegion> navigationRegions;
     onAnalysisNavigation.listen((AnalysisNavigationParams params) {
       expect(params.file, equals(mainPath));
       navigationRegions = params.regions;
     });
-    sendAnalysisSetAnalysisRoots([projPath], [],
-        packageRoots: {projPath: packagesPath});
+    sendAnalysisSetAnalysisRoots([projPath], [], packageRoots: {
+      projPath: packagesPath
+    });
     return analysisFinished.then((_) {
       // Verify that fooBarPath was properly resolved by checking that f()
       // refers to it.
@@ -61,7 +68,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
index e65f60c..25e8a4c 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
@@ -4,18 +4,21 @@
 
 /**
  * This test verifies that if reanalysis is performed while reanalysis is in
- * progress, no problems occur.  See dartbug.com/21448.
+ * progress, no problems occur.
+ *
+ * See dartbug.com/21448.
  */
 library test.integration.analysis.reanalyze_concurrent;
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
-import 'package:unittest/unittest.dart';
-
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_reanalyze_concurrent() {
@@ -35,30 +38,11 @@
       return onServerStatus.first.then((_) {
         sendAnalysisReanalyze();
         return analysisFinished.then((_) {
-          // Now that reanalysis has finished, no further analysis should occur.
-          onServerStatus.listen((ServerStatusParams data) {
-            if (data.analysis != null) {
-              if (data.analysis.isAnalyzing) {
-                // Most likely what happened is that the first reanalyze
-                // completed before the second reanalyze had a chance to start,
-                // and we are just now starting the second reanalyze.  If this is
-                // the case, then the test isn't testing what it's meant to test
-                // (because we are trying to test what happens when one reanalyze
-                // starts while another is in progress).  In which case we will
-                // need to give the analyzer more work to do.
-                fail('First reanalyze finished before second started.');
-              }
-            }
-          });
-          // Give the server an extra second to make sure it doesn't take any
-          // more actions.
+          // Now that reanalysis has finished, give the server an extra second
+          // to make sure it doesn't crash.
           return new Future.delayed(new Duration(seconds: 1));
         });
       });
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
index 56ee1f9..88c7b80 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
@@ -10,6 +10,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_reanalyze() {
@@ -34,7 +38,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/test_all.dart b/pkg/analysis_server/test/integration/analysis/test_all.dart
index e75dbe0..4ea4c34 100644
--- a/pkg/analysis_server/test/integration/analysis/test_all.dart
+++ b/pkg/analysis_server/test/integration/analysis/test_all.dart
@@ -8,7 +8,8 @@
 
 import 'error_test.dart' as error_test;
 import 'get_errors_after_analysis_test.dart' as get_errors_after_analysis_test;
-import 'get_errors_before_analysis_test.dart' as get_errors_before_analysis_test;
+import 'get_errors_before_analysis_test.dart' as
+    get_errors_before_analysis_test;
 import 'get_hover_test.dart' as get_hover_test;
 import 'highlights_test.dart' as highlights_test;
 import 'navigation_test.dart' as navigation_test;
@@ -18,8 +19,8 @@
 import 'package_root_test.dart' as package_root_test;
 import 'reanalyze_concurrent_test.dart' as reanalyze_concurrent_test;
 import 'reanalyze_test.dart' as reanalyze_test;
-import 'update_content_test.dart' as update_content_test;
 import 'update_content_list_test.dart' as update_content_list_test;
+import 'update_content_test.dart' as update_content_test;
 
 /**
  * Utility for manually running all integration tests.
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
index a4fcd38..7a979c2 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_list_test.dart
@@ -10,6 +10,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_updateContent_list() {
@@ -48,7 +52,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
index 0283306..cca4ec6 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -10,6 +10,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_updateContent() {
@@ -54,7 +58,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/asynchrony_test.dart b/pkg/analysis_server/test/integration/asynchrony_test.dart
index 79eb1b2..0194fac 100644
--- a/pkg/analysis_server/test/integration/asynchrony_test.dart
+++ b/pkg/analysis_server/test/integration/asynchrony_test.dart
@@ -11,6 +11,10 @@
 import '../reflective_tests.dart';
 import 'integration_tests.dart';
 
+main() {
+  runReflectiveTests(AsynchronyIntegrationTest);
+}
+
 /**
  * Verify that the server's input and output streams are asynchronous by
  * attempting to flood its input buffer with commands without listening to
@@ -23,15 +27,15 @@
 @ReflectiveTestCase()
 class AsynchronyIntegrationTest {
   /**
-   * Connection to the analysis server.
-   */
-  final Server server = new Server();
-
-  /**
    * Number of messages to queue up before listening for responses.
    */
   static const MESSAGE_COUNT = 10000;
 
+  /**
+   * Connection to the analysis server.
+   */
+  final Server server = new Server();
+
   Future setUp() {
     return server.start();
   }
@@ -66,7 +70,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(AsynchronyIntegrationTest);
-}
diff --git a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
index c331079..0c28360 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -6,11 +6,15 @@
 
 import 'dart:async';
 
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   fail_test_getSuggestions_string_var() {
@@ -26,8 +30,9 @@
     standardAnalysisSetup();
 
     return analysisFinished.then((_) {
-      return sendCompletionGetSuggestions(pathname, text.indexOf('test.') +
-          'test.'.length).then((result) {
+      return sendCompletionGetSuggestions(
+          pathname,
+          text.indexOf('test.') + 'test.'.length).then((result) {
         // Since the feature doesn't work yet, just pause for a second to
         // collect the output of the analysis server, and then stop the test.
         // TODO(paulberry): finish writing the integration test once the feature
@@ -45,7 +50,3 @@
     // TODO(paulberry): remove this.
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index b6ea93e..a2bd8cc 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -17,6 +17,49 @@
 import 'integration_test_methods.dart';
 import 'protocol_matchers.dart';
 
+const Matcher isBool = const isInstanceOf<bool>('bool');
+
+const Matcher isInt = const isInstanceOf<int>('int');
+
+const Matcher isNotification = const MatchesJsonObject('notification', const {
+  'event': isString
+}, optionalFields: const {
+  'params': isMap
+});
+
+const Matcher isObject = isMap;
+
+final Matcher isResponse = new MatchesJsonObject('response', {
+  'id': isString
+}, optionalFields: {
+  'result': anything,
+  'error': isRequestError
+});
+
+const Matcher isString = const isInstanceOf<String>('String');
+
+Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher);
+
+Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) =>
+    new _MapOf(keyMatcher, valueMatcher);
+
+Matcher isOneOf(List<Matcher> choiceMatchers) => new _OneOf(choiceMatchers);
+
+/**
+ * Type of closures used by LazyMatcher.
+ */
+typedef Matcher MatcherCreator();
+
+/**
+ * Type of closures used by MatchesJsonObject to record field mismatches.
+ */
+typedef Description MismatchDescriber(Description mismatchDescription);
+
+/**
+ * Type of callbacks used to process notifications.
+ */
+typedef void NotificationProcessor(String event, params);
+
 /**
  * Base class for analysis server integration tests.
  */
@@ -61,47 +104,6 @@
   }
 
   /**
-   * Write a source file with the given absolute [pathname] and [contents].
-   *
-   * If the file didn't previously exist, it is created.  If it did, it is
-   * overwritten.
-   *
-   * Parent directories are created as necessary.
-   *
-   * Return a normalized path to the file (with symbolic links resolved).
-   */
-  String writeFile(String pathname, String contents) {
-    new Directory(dirname(pathname)).createSync(recursive: true);
-    File file = new File(pathname);
-    file.writeAsStringSync(contents);
-    return file.resolveSymbolicLinksSync();
-  }
-
-  /**
-   * Convert the given [relativePath] to an absolute path, by interpreting it
-   * relative to [sourceDirectory].  On Windows any forward slashes in
-   * [relativePath] are converted to backslashes.
-   */
-  String sourcePath(String relativePath) {
-    return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
-  }
-
-  /**
-   * Send the server an 'analysis.setAnalysisRoots' command directing it to
-   * analyze [sourceDirectory].  If [subscribeStatus] is true (the default),
-   * then also enable [SERVER_STATUS] notifications so that [analysisFinished]
-   * can be used.
-   */
-  Future standardAnalysisSetup({bool subscribeStatus: true}) {
-    List<Future> futures = <Future>[];
-    if (subscribeStatus) {
-      futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
-    }
-    futures.add(sendAnalysisSetAnalysisRoots([sourceDirectory.path], []));
-    return Future.wait(futures);
-  }
-
-  /**
    * Return a future which will complete when a 'server.status' notification is
    * received from the server with 'analyzing' set to false.
    *
@@ -168,6 +170,30 @@
   }
 
   /**
+   * Convert the given [relativePath] to an absolute path, by interpreting it
+   * relative to [sourceDirectory].  On Windows any forward slashes in
+   * [relativePath] are converted to backslashes.
+   */
+  String sourcePath(String relativePath) {
+    return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
+  }
+
+  /**
+   * Send the server an 'analysis.setAnalysisRoots' command directing it to
+   * analyze [sourceDirectory].  If [subscribeStatus] is true (the default),
+   * then also enable [SERVER_STATUS] notifications so that [analysisFinished]
+   * can be used.
+   */
+  Future standardAnalysisSetup({bool subscribeStatus: true}) {
+    List<Future> futures = <Future>[];
+    if (subscribeStatus) {
+      futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
+    }
+    futures.add(sendAnalysisSetAnalysisRoots([sourceDirectory.path], []));
+    return Future.wait(futures);
+  }
+
+  /**
    * After every test, the server is stopped and [sourceDirectory] is deleted.
    */
   Future tearDown() {
@@ -177,6 +203,23 @@
   }
 
   /**
+   * Write a source file with the given absolute [pathname] and [contents].
+   *
+   * If the file didn't previously exist, it is created.  If it did, it is
+   * overwritten.
+   *
+   * Parent directories are created as necessary.
+   *
+   * Return a normalized path to the file (with symbolic links resolved).
+   */
+  String writeFile(String pathname, String contents) {
+    new Directory(dirname(pathname)).createSync(recursive: true);
+    File file = new File(pathname);
+    file.writeAsStringSync(contents);
+    return file.resolveSymbolicLinksSync();
+  }
+
+  /**
    * If [skipShutdown] is not set, shut down the server.
    */
   Future _shutdownIfNeeded() {
@@ -192,284 +235,6 @@
   }
 }
 
-final Matcher isResponse = new MatchesJsonObject('response', {
-  'id': isString
-}, optionalFields: {
-  'result': anything,
-  'error': isRequestError
-});
-
-const Matcher isNotification = const MatchesJsonObject('notification', const {
-  'event': isString
-}, optionalFields: const {
-  'params': isMap
-});
-
-const Matcher isString = const isInstanceOf<String>('String');
-
-const Matcher isInt = const isInstanceOf<int>('int');
-
-const Matcher isBool = const isInstanceOf<bool>('bool');
-
-const Matcher isObject = isMap;
-
-/**
- * Type of closures used by MatchesJsonObject to record field mismatches.
- */
-typedef Description MismatchDescriber(Description mismatchDescription);
-
-/**
- * Base class for matchers that operate by recursing through the contents of
- * an object.
- */
-abstract class _RecursiveMatcher extends Matcher {
-  const _RecursiveMatcher();
-
-  @override
-  bool matches(item, Map matchState) {
-    List<MismatchDescriber> mismatches = <MismatchDescriber>[];
-    populateMismatches(item, mismatches);
-    if (mismatches.isEmpty) {
-      return true;
-    } else {
-      addStateInfo(matchState, {
-        'mismatches': mismatches
-      });
-      return false;
-    }
-  }
-
-  @override
-  Description describeMismatch(item, Description mismatchDescription,
-      Map matchState, bool verbose) {
-    List<MismatchDescriber> mismatches = matchState['mismatches'];
-    if (mismatches != null) {
-      for (int i = 0; i < mismatches.length; i++) {
-        MismatchDescriber mismatch = mismatches[i];
-        if (i > 0) {
-          if (mismatches.length == 2) {
-            mismatchDescription = mismatchDescription.add(' and ');
-          } else if (i == mismatches.length - 1) {
-            mismatchDescription = mismatchDescription.add(', and ');
-          } else {
-            mismatchDescription = mismatchDescription.add(', ');
-          }
-        }
-        mismatchDescription = mismatch(mismatchDescription);
-      }
-      return mismatchDescription;
-    } else {
-      return super.describeMismatch(
-          item,
-          mismatchDescription,
-          matchState,
-          verbose);
-    }
-  }
-
-  /**
-   * Populate [mismatches] with descriptions of all the ways in which [item]
-   * does not match.
-   */
-  void populateMismatches(item, List<MismatchDescriber> mismatches);
-
-  /**
-   * Create a [MismatchDescriber] describing a mismatch with a simple string.
-   */
-  MismatchDescriber simpleDescription(String description) =>
-      (Description mismatchDescription) {
-    mismatchDescription.add(description);
-  };
-
-  /**
-   * Check the type of a substructure whose value is [item], using [matcher].
-   * If it doesn't match, record a closure in [mismatches] which can describe
-   * the mismatch.  [describeSubstructure] is used to describe which
-   * substructure did not match.
-   */
-  checkSubstructure(item, Matcher matcher, List<MismatchDescriber> mismatches,
-      Description describeSubstructure(Description)) {
-    Map subState = {};
-    if (!matcher.matches(item, subState)) {
-      mismatches.add((Description mismatchDescription) {
-        mismatchDescription = mismatchDescription.add('contains malformed ');
-        mismatchDescription = describeSubstructure(mismatchDescription);
-        mismatchDescription =
-            mismatchDescription.add(' (should be ').addDescriptionOf(matcher);
-        String subDescription = matcher.describeMismatch(
-            item,
-            new StringDescription(),
-            subState,
-            false).toString();
-        if (subDescription.isNotEmpty) {
-          mismatchDescription =
-              mismatchDescription.add('; ').add(subDescription);
-        }
-        return mismatchDescription.add(')');
-      });
-    }
-  }
-}
-
-/**
- * Matcher that matches a String drawn from a limited set.
- */
-class MatchesEnum extends Matcher {
-  /**
-   * Short description of the expected type.
-   */
-  final String description;
-
-  /**
-   * The set of enum values that are allowed.
-   */
-  final List<String> allowedValues;
-
-  const MatchesEnum(this.description, this.allowedValues);
-
-  @override
-  bool matches(item, Map matchState) {
-    return allowedValues.contains(item);
-  }
-
-  @override
-  Description describe(Description description) =>
-      description.add(this.description);
-}
-
-/**
- * Matcher that matches a JSON object, with a given set of required and
- * optional fields, and their associated types (expressed as [Matcher]s).
- */
-class MatchesJsonObject extends _RecursiveMatcher {
-  /**
-   * Short description of the expected type.
-   */
-  final String description;
-
-  /**
-   * Fields that are required to be in the JSON object, and [Matcher]s describing
-   * their expected types.
-   */
-  final Map<String, Matcher> requiredFields;
-
-  /**
-   * Fields that are optional in the JSON object, and [Matcher]s describing
-   * their expected types.
-   */
-  final Map<String, Matcher> optionalFields;
-
-  const MatchesJsonObject(this.description, this.requiredFields,
-      {this.optionalFields});
-
-  @override
-  void populateMismatches(item, List<MismatchDescriber> mismatches) {
-    if (item is! Map) {
-      mismatches.add(simpleDescription('is not a map'));
-      return;
-    }
-    if (requiredFields != null) {
-      requiredFields.forEach((String key, Matcher valueMatcher) {
-        if (!item.containsKey(key)) {
-          mismatches.add(
-              (Description mismatchDescription) =>
-                  mismatchDescription.add(
-                      'is missing field ').addDescriptionOf(
-                          key).add(' (').addDescriptionOf(valueMatcher).add(')'));
-        } else {
-          _checkField(key, item[key], valueMatcher, mismatches);
-        }
-      });
-    }
-    item.forEach((key, value) {
-      if (requiredFields != null && requiredFields.containsKey(key)) {
-        // Already checked this field
-      } else if (optionalFields != null && optionalFields.containsKey(key)) {
-        _checkField(key, value, optionalFields[key], mismatches);
-      } else {
-        mismatches.add(
-            (Description mismatchDescription) =>
-                mismatchDescription.add('has unexpected field ').addDescriptionOf(key));
-      }
-    });
-  }
-
-  @override
-  Description describe(Description description) =>
-      description.add(this.description);
-
-  /**
-   * Check the type of a field called [key], having value [value], using
-   * [valueMatcher].  If it doesn't match, record a closure in [mismatches]
-   * which can describe the mismatch.
-   */
-  void _checkField(String key, value, Matcher valueMatcher,
-      List<MismatchDescriber> mismatches) {
-    checkSubstructure(
-        value,
-        valueMatcher,
-        mismatches,
-        (Description description) => description.add('field ').addDescriptionOf(key));
-  }
-}
-
-/**
- * Matcher that matches a list of objects, each of which satisfies the given
- * matcher.
- */
-class _ListOf extends Matcher {
-  /**
-   * Matcher which every element of the list must satisfy.
-   */
-  final Matcher elementMatcher;
-
-  /**
-   * Iterable matcher which we use to test the contents of the list.
-   */
-  final Matcher iterableMatcher;
-
-  _ListOf(elementMatcher)
-      : elementMatcher = elementMatcher,
-        iterableMatcher = everyElement(elementMatcher);
-
-  @override
-  bool matches(item, Map matchState) {
-    if (item is! List) {
-      return false;
-    }
-    return iterableMatcher.matches(item, matchState);
-  }
-
-  @override
-  Description describe(Description description) =>
-      description.add('List of ').addDescriptionOf(elementMatcher);
-
-  @override
-  Description describeMismatch(item, Description mismatchDescription,
-      Map matchState, bool verbose) {
-    if (item is! List) {
-      return super.describeMismatch(
-          item,
-          mismatchDescription,
-          matchState,
-          verbose);
-    } else {
-      return iterableMatcher.describeMismatch(
-          item,
-          mismatchDescription,
-          matchState,
-          verbose);
-    }
-  }
-}
-
-Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher);
-
-/**
- * Type of closures used by LazyMatcher.
- */
-typedef Matcher MatcherCreator();
-
 /**
  * Wrapper class for Matcher which doesn't create the underlying Matcher object
  * until it is needed.  This is necessary in order to create matchers that can
@@ -524,65 +289,59 @@
 }
 
 /**
- * Matcher that matches a union of different types, each of which is described
- * by a matcher.
+ * Matcher that matches a String drawn from a limited set.
  */
-class _OneOf extends Matcher {
+class MatchesEnum extends Matcher {
   /**
-   * Matchers for the individual choices.
+   * Short description of the expected type.
    */
-  final List<Matcher> choiceMatchers;
+  final String description;
 
-  _OneOf(this.choiceMatchers);
+  /**
+   * The set of enum values that are allowed.
+   */
+  final List<String> allowedValues;
+
+  const MatchesEnum(this.description, this.allowedValues);
+
+  @override
+  Description describe(Description description) =>
+      description.add(this.description);
 
   @override
   bool matches(item, Map matchState) {
-    for (Matcher choiceMatcher in choiceMatchers) {
-      Map subState = {};
-      if (choiceMatcher.matches(item, subState)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  @override
-  Description describe(Description description) {
-    for (int i = 0; i < choiceMatchers.length; i++) {
-      if (i != 0) {
-        if (choiceMatchers.length == 2) {
-          description = description.add(' or ');
-        } else {
-          description = description.add(', ');
-          if (i == choiceMatchers.length - 1) {
-            description = description.add('or ');
-          }
-        }
-      }
-      description = description.addDescriptionOf(choiceMatchers[i]);
-    }
-    return description;
+    return allowedValues.contains(item);
   }
 }
 
-Matcher isOneOf(List<Matcher> choiceMatchers) => new _OneOf(choiceMatchers);
-
 /**
- * Matcher that matches a map of objects, where each key/value pair in the
- * map satisies the given key and value matchers.
+ * Matcher that matches a JSON object, with a given set of required and
+ * optional fields, and their associated types (expressed as [Matcher]s).
  */
-class _MapOf extends _RecursiveMatcher {
+class MatchesJsonObject extends _RecursiveMatcher {
   /**
-   * Matcher which every key in the map must satisfy.
+   * Short description of the expected type.
    */
-  final Matcher keyMatcher;
+  final String description;
 
   /**
-   * Matcher which every value in the map must satisfy.
+   * Fields that are required to be in the JSON object, and [Matcher]s describing
+   * their expected types.
    */
-  final Matcher valueMatcher;
+  final Map<String, Matcher> requiredFields;
 
-  _MapOf(this.keyMatcher, this.valueMatcher);
+  /**
+   * Fields that are optional in the JSON object, and [Matcher]s describing
+   * their expected types.
+   */
+  final Map<String, Matcher> optionalFields;
+
+  const MatchesJsonObject(this.description, this.requiredFields,
+      {this.optionalFields});
+
+  @override
+  Description describe(Description description) =>
+      description.add(this.description);
 
   @override
   void populateMismatches(item, List<MismatchDescriber> mismatches) {
@@ -590,35 +349,47 @@
       mismatches.add(simpleDescription('is not a map'));
       return;
     }
+    if (requiredFields != null) {
+      requiredFields.forEach((String key, Matcher valueMatcher) {
+        if (!item.containsKey(key)) {
+          mismatches.add(
+              (Description mismatchDescription) =>
+                  mismatchDescription.add(
+                      'is missing field ').addDescriptionOf(
+                          key).add(' (').addDescriptionOf(valueMatcher).add(')'));
+        } else {
+          _checkField(key, item[key], valueMatcher, mismatches);
+        }
+      });
+    }
     item.forEach((key, value) {
-      checkSubstructure(
-          key,
-          keyMatcher,
-          mismatches,
-          (Description description) => description.add('key ').addDescriptionOf(key));
-      checkSubstructure(
-          value,
-          valueMatcher,
-          mismatches,
-          (Description description) => description.add('field ').addDescriptionOf(key));
+      if (requiredFields != null && requiredFields.containsKey(key)) {
+        // Already checked this field
+      } else if (optionalFields != null && optionalFields.containsKey(key)) {
+        _checkField(key, value, optionalFields[key], mismatches);
+      } else {
+        mismatches.add(
+            (Description mismatchDescription) =>
+                mismatchDescription.add('has unexpected field ').addDescriptionOf(key));
+      }
     });
   }
 
-  @override
-  Description describe(Description description) =>
-      description.add(
-          'Map from ').addDescriptionOf(
-              keyMatcher).add(' to ').addDescriptionOf(valueMatcher);
+  /**
+   * Check the type of a field called [key], having value [value], using
+   * [valueMatcher].  If it doesn't match, record a closure in [mismatches]
+   * which can describe the mismatch.
+   */
+  void _checkField(String key, value, Matcher valueMatcher,
+      List<MismatchDescriber> mismatches) {
+    checkSubstructure(
+        value,
+        valueMatcher,
+        mismatches,
+        (Description description) => description.add('field ').addDescriptionOf(key));
+  }
 }
 
-Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) =>
-    new _MapOf(keyMatcher, valueMatcher);
-
-/**
- * Type of callbacks used to process notifications.
- */
-typedef void NotificationProcessor(String event, params);
-
 /**
  * Instances of the class [Server] manage a connection to a server process, and
  * facilitate communication to and from the server.
@@ -643,11 +414,6 @@
   int _nextId = 0;
 
   /**
-   * [StreamController] to which notifications will be sent.
-   */
-  final StreamController _notifications = new StreamController();
-
-  /**
    * Messages which have been exchanged with the server; we buffer these
    * up until the test finishes, so that they can be examined in the debugger
    * or printed out in response to a call to [debugStdio].
@@ -671,6 +437,25 @@
   Stopwatch _time = new Stopwatch();
 
   /**
+   * Future that completes when the server process exits.
+   */
+  Future<int> get exitCode => _process.exitCode;
+
+  /**
+   * Print out any messages exchanged with the server.  If some messages have
+   * already been exchanged with the server, they are printed out immediately.
+   */
+  void debugStdio() {
+    if (_debuggingStdio) {
+      return;
+    }
+    _debuggingStdio = true;
+    for (String line in _recordedStdio) {
+      print(line);
+    }
+  }
+
+  /**
    * Find the root directory of the analysis_server package by proceeding
    * upward to the 'test' dir, and then going up one more directory.
    */
@@ -686,42 +471,21 @@
   }
 
   /**
-   * Start the server.  If [debugServer] is `true`, the server will be started
-   * with "--debug", allowing a debugger to be attached. If [profileServer] is
-   * `true`, the server will be started with "--observe" and
-   * "--pause-isolates-on-exit", allowing the observatory to be used.
+   * Return a future that will complete when all commands that have been sent
+   * to the server so far have been flushed to the OS buffer.
    */
-  Future start({bool debugServer: false, bool profileServer: false}) {
-    if (_process != null) {
-      throw new Exception('Process already started');
-    }
-    _time.start();
-    String dartBinary = Platform.executable;
-    String rootDir =
-        findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
-    String serverPath = normalize(join(rootDir, 'bin', 'server.dart'));
-    List<String> arguments = [];
-    if (debugServer) {
-      arguments.add('--debug');
-    }
-    if (profileServer) {
-      arguments.add('--observe');
-      arguments.add('--pause-isolates-on-exit');
-    }
-    if (Platform.packageRoot.isNotEmpty) {
-      arguments.add('--package-root=${Platform.packageRoot}');
-    }
-    arguments.add('--checked');
-    arguments.add(serverPath);
-    return Process.start(dartBinary, arguments).then((Process process) {
-      _process = process;
-      process.exitCode.then((int code) {
-        _recordStdio('TERMINATED WITH EXIT CODE $code');
-        if (code != 0) {
-          _badDataFromServer();
-        }
-      });
-    });
+  Future flushCommands() {
+    return _process.stdin.flush();
+  }
+
+  /**
+   * Stop the server.
+   */
+  Future kill() {
+    debugStdio();
+    _recordStdio('PROCESS FORCIBLY TERMINATED');
+    _process.kill();
+    return _process.exitCode;
   }
 
   /**
@@ -784,21 +548,6 @@
   }
 
   /**
-   * Future that completes when the server process exits.
-   */
-  Future<int> get exitCode => _process.exitCode;
-
-  /**
-   * Stop the server.
-   */
-  Future kill() {
-    debugStdio();
-    _recordStdio('PROCESS FORCIBLY TERMINATED');
-    _process.kill();
-    return _process.exitCode;
-  }
-
-  /**
    * Send a command to the server.  An 'id' will be automatically assigned.
    * The returned [Future] will be completed when the server acknowledges the
    * command with a response.  If the server acknowledges the command with a
@@ -824,25 +573,42 @@
   }
 
   /**
-   * Print out any messages exchanged with the server.  If some messages have
-   * already been exchanged with the server, they are printed out immediately.
+   * Start the server.  If [debugServer] is `true`, the server will be started
+   * with "--debug", allowing a debugger to be attached. If [profileServer] is
+   * `true`, the server will be started with "--observe" and
+   * "--pause-isolates-on-exit", allowing the observatory to be used.
    */
-  void debugStdio() {
-    if (_debuggingStdio) {
-      return;
+  Future start({bool debugServer: false, bool profileServer: false}) {
+    if (_process != null) {
+      throw new Exception('Process already started');
     }
-    _debuggingStdio = true;
-    for (String line in _recordedStdio) {
-      print(line);
+    _time.start();
+    String dartBinary = Platform.executable;
+    String rootDir =
+        findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
+    String serverPath = normalize(join(rootDir, 'bin', 'server.dart'));
+    List<String> arguments = [];
+    if (debugServer) {
+      arguments.add('--debug');
     }
-  }
-
-  /**
-   * Return a future that will complete when all commands that have been sent
-   * to the server so far have been flushed to the OS buffer.
-   */
-  Future flushCommands() {
-    return _process.stdin.flush();
+    if (profileServer) {
+      arguments.add('--observe');
+      arguments.add('--pause-isolates-on-exit');
+    }
+    if (Platform.packageRoot.isNotEmpty) {
+      arguments.add('--package-root=${Platform.packageRoot}');
+    }
+    arguments.add('--checked');
+    arguments.add(serverPath);
+    return Process.start(dartBinary, arguments).then((Process process) {
+      _process = process;
+      process.exitCode.then((int code) {
+        _recordStdio('TERMINATED WITH EXIT CODE $code');
+        if (code != 0) {
+          _badDataFromServer();
+        }
+      });
+    });
   }
 
   /**
@@ -878,3 +644,232 @@
     _recordedStdio.add(line);
   }
 }
+
+/**
+ * Matcher that matches a list of objects, each of which satisfies the given
+ * matcher.
+ */
+class _ListOf extends Matcher {
+  /**
+   * Matcher which every element of the list must satisfy.
+   */
+  final Matcher elementMatcher;
+
+  /**
+   * Iterable matcher which we use to test the contents of the list.
+   */
+  final Matcher iterableMatcher;
+
+  _ListOf(elementMatcher)
+      : elementMatcher = elementMatcher,
+        iterableMatcher = everyElement(elementMatcher);
+
+  @override
+  Description describe(Description description) =>
+      description.add('List of ').addDescriptionOf(elementMatcher);
+
+  @override
+  Description describeMismatch(item, Description mismatchDescription,
+      Map matchState, bool verbose) {
+    if (item is! List) {
+      return super.describeMismatch(
+          item,
+          mismatchDescription,
+          matchState,
+          verbose);
+    } else {
+      return iterableMatcher.describeMismatch(
+          item,
+          mismatchDescription,
+          matchState,
+          verbose);
+    }
+  }
+
+  @override
+  bool matches(item, Map matchState) {
+    if (item is! List) {
+      return false;
+    }
+    return iterableMatcher.matches(item, matchState);
+  }
+}
+
+/**
+ * Matcher that matches a map of objects, where each key/value pair in the
+ * map satisies the given key and value matchers.
+ */
+class _MapOf extends _RecursiveMatcher {
+  /**
+   * Matcher which every key in the map must satisfy.
+   */
+  final Matcher keyMatcher;
+
+  /**
+   * Matcher which every value in the map must satisfy.
+   */
+  final Matcher valueMatcher;
+
+  _MapOf(this.keyMatcher, this.valueMatcher);
+
+  @override
+  Description describe(Description description) =>
+      description.add(
+          'Map from ').addDescriptionOf(
+              keyMatcher).add(' to ').addDescriptionOf(valueMatcher);
+
+  @override
+  void populateMismatches(item, List<MismatchDescriber> mismatches) {
+    if (item is! Map) {
+      mismatches.add(simpleDescription('is not a map'));
+      return;
+    }
+    item.forEach((key, value) {
+      checkSubstructure(
+          key,
+          keyMatcher,
+          mismatches,
+          (Description description) => description.add('key ').addDescriptionOf(key));
+      checkSubstructure(
+          value,
+          valueMatcher,
+          mismatches,
+          (Description description) => description.add('field ').addDescriptionOf(key));
+    });
+  }
+}
+
+/**
+ * Matcher that matches a union of different types, each of which is described
+ * by a matcher.
+ */
+class _OneOf extends Matcher {
+  /**
+   * Matchers for the individual choices.
+   */
+  final List<Matcher> choiceMatchers;
+
+  _OneOf(this.choiceMatchers);
+
+  @override
+  Description describe(Description description) {
+    for (int i = 0; i < choiceMatchers.length; i++) {
+      if (i != 0) {
+        if (choiceMatchers.length == 2) {
+          description = description.add(' or ');
+        } else {
+          description = description.add(', ');
+          if (i == choiceMatchers.length - 1) {
+            description = description.add('or ');
+          }
+        }
+      }
+      description = description.addDescriptionOf(choiceMatchers[i]);
+    }
+    return description;
+  }
+
+  @override
+  bool matches(item, Map matchState) {
+    for (Matcher choiceMatcher in choiceMatchers) {
+      Map subState = {};
+      if (choiceMatcher.matches(item, subState)) {
+        return true;
+      }
+    }
+    return false;
+  }
+}
+
+/**
+ * Base class for matchers that operate by recursing through the contents of
+ * an object.
+ */
+abstract class _RecursiveMatcher extends Matcher {
+  const _RecursiveMatcher();
+
+  /**
+   * Check the type of a substructure whose value is [item], using [matcher].
+   * If it doesn't match, record a closure in [mismatches] which can describe
+   * the mismatch.  [describeSubstructure] is used to describe which
+   * substructure did not match.
+   */
+  checkSubstructure(item, Matcher matcher, List<MismatchDescriber> mismatches,
+      Description describeSubstructure(Description)) {
+    Map subState = {};
+    if (!matcher.matches(item, subState)) {
+      mismatches.add((Description mismatchDescription) {
+        mismatchDescription = mismatchDescription.add('contains malformed ');
+        mismatchDescription = describeSubstructure(mismatchDescription);
+        mismatchDescription =
+            mismatchDescription.add(' (should be ').addDescriptionOf(matcher);
+        String subDescription = matcher.describeMismatch(
+            item,
+            new StringDescription(),
+            subState,
+            false).toString();
+        if (subDescription.isNotEmpty) {
+          mismatchDescription =
+              mismatchDescription.add('; ').add(subDescription);
+        }
+        return mismatchDescription.add(')');
+      });
+    }
+  }
+
+  @override
+  Description describeMismatch(item, Description mismatchDescription,
+      Map matchState, bool verbose) {
+    List<MismatchDescriber> mismatches = matchState['mismatches'];
+    if (mismatches != null) {
+      for (int i = 0; i < mismatches.length; i++) {
+        MismatchDescriber mismatch = mismatches[i];
+        if (i > 0) {
+          if (mismatches.length == 2) {
+            mismatchDescription = mismatchDescription.add(' and ');
+          } else if (i == mismatches.length - 1) {
+            mismatchDescription = mismatchDescription.add(', and ');
+          } else {
+            mismatchDescription = mismatchDescription.add(', ');
+          }
+        }
+        mismatchDescription = mismatch(mismatchDescription);
+      }
+      return mismatchDescription;
+    } else {
+      return super.describeMismatch(
+          item,
+          mismatchDescription,
+          matchState,
+          verbose);
+    }
+  }
+
+  @override
+  bool matches(item, Map matchState) {
+    List<MismatchDescriber> mismatches = <MismatchDescriber>[];
+    populateMismatches(item, mismatches);
+    if (mismatches.isEmpty) {
+      return true;
+    } else {
+      addStateInfo(matchState, {
+        'mismatches': mismatches
+      });
+      return false;
+    }
+  }
+
+  /**
+   * Populate [mismatches] with descriptions of all the ways in which [item]
+   * does not match.
+   */
+  void populateMismatches(item, List<MismatchDescriber> mismatches);
+
+  /**
+   * Create a [MismatchDescriber] describing a mismatch with a simple string.
+   */
+  MismatchDescriber simpleDescription(String description) =>
+      (Description mismatchDescription) {
+    mismatchDescription.add(description);
+  };
+}
diff --git a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
index 7849b75..3b2c087 100644
--- a/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/integration/search/get_type_hierarchy_test.dart
@@ -12,6 +12,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 /**
  * Results of a getTypeHierarchy request, processed for easier testing.
  */
@@ -38,7 +42,7 @@
    */
   HierarchyResults(this.items) {
     pivot = items[0];
-    nameToIndex = <String, int> {};
+    nameToIndex = <String, int>{};
     for (int i = 0; i < items.length; i++) {
       nameToIndex[items[i].classElement.name] = i;
     }
@@ -58,33 +62,27 @@
 }
 
 @ReflectiveTestCase()
-class Test extends AbstractAnalysisServerIntegrationTest
-    {
+class Test extends AbstractAnalysisServerIntegrationTest {
   /**
    * Pathname of the main file to run tests in.
    */
   String pathname;
 
-  test_getTypeHierarchy() {
-    pathname = sourcePath('test.dart');
-    // Write a dummy file which will be overridden by tests using
-    // [sendAnalysisUpdateContent].
-    writeFile(pathname, '// dummy');
-    standardAnalysisSetup();
-
-    // Run all the getTypeHierarchy tests at once so that the server can take
-    // advantage of incremental analysis and the test doesn't time out.
-    List tests = [getTypeHierarchy_classElement, getTypeHierarchy_displayName,
-        getTypeHierarchy_memberElement, getTypeHierarchy_superclass,
-        getTypeHierarchy_interfaces, getTypeHierarchy_mixins,
-        getTypeHierarchy_subclasses, getTypeHierarchy_badTarget,
-        getTypeHierarchy_functionTarget];
-    return Future.forEach(tests, (test) => test());
+  Future getTypeHierarchy_badTarget() {
+    String text = r'''
+main() {
+  if /* target */ (true) {
+    print('Hello');
+  }
+}
+''';
+    return typeHierarchyTest(text).then((HierarchyResults results) {
+      expect(results, isNull);
+    });
   }
 
   Future getTypeHierarchy_classElement() {
-    String text =
-        r'''
+    String text = r'''
 class Base {}
 class Pivot /* target */ extends Base {}
 class Derived extends Pivot {}
@@ -99,8 +97,9 @@
         expect(element.kind, equals(ElementKind.CLASS));
         expect(element.name, equals(name));
         if (name != 'Object') {
-          expect(element.location.offset, equals(text.indexOf(
-              'class $name') + 'class '.length));
+          expect(
+              element.location.offset,
+              equals(text.indexOf('class $name') + 'class '.length));
         }
       }
       checkElement('Object');
@@ -111,8 +110,7 @@
   }
 
   Future getTypeHierarchy_displayName() {
-    String text =
-        r'''
+    String text = r'''
 class Base<T> {}
 class Pivot /* target */ extends Base<int> {}
 ''';
@@ -124,9 +122,39 @@
     });
   }
 
+  Future getTypeHierarchy_functionTarget() {
+    String text = r'''
+main /* target */ () {
+}
+''';
+    return typeHierarchyTest(text).then((HierarchyResults results) {
+      expect(results, isNull);
+    });
+  }
+
+  Future getTypeHierarchy_interfaces() {
+    String text = r'''
+class Interface1 {}
+class Interface2 {}
+class Pivot /* target */ implements Interface1, Interface2 {}
+''';
+    return typeHierarchyTest(text).then((HierarchyResults results) {
+      expect(results.items, hasLength(4));
+      expect(results.pivot.interfaces, hasLength(2));
+      expect(
+          results.pivot.interfaces,
+          contains(results.nameToIndex['Interface1']));
+      expect(
+          results.pivot.interfaces,
+          contains(results.nameToIndex['Interface2']));
+      expect(results.getItem('Object').interfaces, isEmpty);
+      expect(results.getItem('Interface1').interfaces, isEmpty);
+      expect(results.getItem('Interface2').interfaces, isEmpty);
+    });
+  }
+
   Future getTypeHierarchy_memberElement() {
-    String text =
-        r'''
+    String text = r'''
 class Base1 {
   void foo /* base1 */ ();
 }
@@ -141,59 +169,22 @@
     return typeHierarchyTest(text).then((HierarchyResults results) {
       expect(results.items, hasLength(6));
       expect(results.getItem('Object').memberElement, isNull);
-      expect(results.getItem('Base1').memberElement.location.offset,
+      expect(
+          results.getItem('Base1').memberElement.location.offset,
           equals(text.indexOf('foo /* base1 */')));
       expect(results.getItem('Base2').memberElement, isNull);
-      expect(results.getItem('Pivot').memberElement.location.offset,
+      expect(
+          results.getItem('Pivot').memberElement.location.offset,
           equals(text.indexOf('foo /* target */')));
       expect(results.getItem('Derived1').memberElement, isNull);
-      expect(results.getItem('Derived2').memberElement.location.offset,
+      expect(
+          results.getItem('Derived2').memberElement.location.offset,
           equals(text.indexOf('foo /* derived2 */')));
     });
   }
 
-  Future getTypeHierarchy_superclass() {
-    String text =
-        r'''
-class Base1 {}
-class Base2 extends Base1 {}
-class Pivot /* target */ extends Base2 {}
-''';
-    return typeHierarchyTest(text).then((HierarchyResults results) {
-      expect(results.items, hasLength(4));
-      expect(results.getItem('Object').superclass, isNull);
-      expect(results.getItem('Base1').superclass, equals(
-          results.nameToIndex['Object']));
-      expect(results.getItem('Base2').superclass, equals(
-          results.nameToIndex['Base1']));
-      expect(results.getItem('Pivot').superclass, equals(
-          results.nameToIndex['Base2']));
-    });
-  }
-
-  Future getTypeHierarchy_interfaces() {
-    String text =
-        r'''
-class Interface1 {}
-class Interface2 {}
-class Pivot /* target */ implements Interface1, Interface2 {}
-''';
-    return typeHierarchyTest(text).then((HierarchyResults results) {
-      expect(results.items, hasLength(4));
-      expect(results.pivot.interfaces, hasLength(2));
-      expect(results.pivot.interfaces, contains(
-          results.nameToIndex['Interface1']));
-      expect(results.pivot.interfaces, contains(
-          results.nameToIndex['Interface2']));
-      expect(results.getItem('Object').interfaces, isEmpty);
-      expect(results.getItem('Interface1').interfaces, isEmpty);
-      expect(results.getItem('Interface2').interfaces, isEmpty);
-    });
-  }
-
   Future getTypeHierarchy_mixins() {
-    String text =
-        r'''
+    String text = r'''
 class Base {}
 class Mixin1 {}
 class Mixin2 {}
@@ -212,8 +203,7 @@
   }
 
   Future getTypeHierarchy_subclasses() {
-    String text =
-        r'''
+    String text = r'''
 class Base {}
 class Pivot /* target */ extends Base {}
 class Sub1 extends Pivot {}
@@ -223,41 +213,59 @@
     return typeHierarchyTest(text).then((HierarchyResults results) {
       expect(results.items, hasLength(6));
       expect(results.pivot.subclasses, hasLength(2));
-      expect(results.pivot.subclasses, contains(results.nameToIndex['Sub1'])
-          );
-      expect(results.pivot.subclasses, contains(results.nameToIndex['Sub2'])
-          );
+      expect(results.pivot.subclasses, contains(results.nameToIndex['Sub1']));
+      expect(results.pivot.subclasses, contains(results.nameToIndex['Sub2']));
       expect(results.getItem('Object').subclasses, isEmpty);
       expect(results.getItem('Base').subclasses, isEmpty);
       expect(results.getItem('Sub1').subclasses, isEmpty);
-      expect(results.getItem('Sub2').subclasses, equals(
-          [results.nameToIndex['Sub2a']]));
+      expect(
+          results.getItem('Sub2').subclasses,
+          equals([results.nameToIndex['Sub2a']]));
       expect(results.getItem('Sub2a').subclasses, isEmpty);
     });
   }
 
-  Future getTypeHierarchy_badTarget() {
-    String text =
-        r'''
-main() {
-  if /* target */ (true) {
-    print('Hello');
-  }
-}
+  Future getTypeHierarchy_superclass() {
+    String text = r'''
+class Base1 {}
+class Base2 extends Base1 {}
+class Pivot /* target */ extends Base2 {}
 ''';
     return typeHierarchyTest(text).then((HierarchyResults results) {
-      expect(results, isNull);
+      expect(results.items, hasLength(4));
+      expect(results.getItem('Object').superclass, isNull);
+      expect(
+          results.getItem('Base1').superclass,
+          equals(results.nameToIndex['Object']));
+      expect(
+          results.getItem('Base2').superclass,
+          equals(results.nameToIndex['Base1']));
+      expect(
+          results.getItem('Pivot').superclass,
+          equals(results.nameToIndex['Base2']));
     });
   }
 
-  Future getTypeHierarchy_functionTarget() {
-    String text = r'''
-main /* target */ () {
-}
-''';
-    return typeHierarchyTest(text).then((HierarchyResults results) {
-      expect(results, isNull);
-    });
+  test_getTypeHierarchy() {
+    pathname = sourcePath('test.dart');
+    // Write a dummy file which will be overridden by tests using
+    // [sendAnalysisUpdateContent].
+    writeFile(pathname, '// dummy');
+    standardAnalysisSetup();
+
+    // Run all the getTypeHierarchy tests at once so that the server can take
+    // advantage of incremental analysis and the test doesn't time out.
+    List tests = [
+        getTypeHierarchy_classElement,
+        getTypeHierarchy_displayName,
+        getTypeHierarchy_memberElement,
+        getTypeHierarchy_superclass,
+        getTypeHierarchy_interfaces,
+        getTypeHierarchy_mixins,
+        getTypeHierarchy_subclasses,
+        getTypeHierarchy_badTarget,
+        getTypeHierarchy_functionTarget];
+    return Future.forEach(tests, (test) => test());
   }
 
   Future<HierarchyResults> typeHierarchyTest(String text) {
@@ -265,8 +273,8 @@
     sendAnalysisUpdateContent({
       pathname: new AddContentOverlay(text)
     });
-    return analysisFinished.then((_) => sendSearchGetTypeHierarchy(pathname,
-        offset)).then((result) {
+    return analysisFinished.then(
+        (_) => sendSearchGetTypeHierarchy(pathname, offset)).then((result) {
       if (result.hierarchyItems == null) {
         return null;
       } else {
@@ -275,7 +283,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/get_version_test.dart b/pkg/analysis_server/test/integration/server/get_version_test.dart
index 30bfc24..61dcfe5 100644
--- a/pkg/analysis_server/test/integration/server/get_version_test.dart
+++ b/pkg/analysis_server/test/integration/server/get_version_test.dart
@@ -4,18 +4,16 @@
 
 library test.integration.server.get.version;
 
-
 import '../../reflective_tests.dart';
-
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_getVersion() {
     return sendServerGetVersion();
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
index e807eb5..d3d9890 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_invalid_service_test.dart
@@ -4,11 +4,15 @@
 
 library test.integration.server.set.subscriptions.invalid.service;
 
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_setSubscriptions_invalidService() {
@@ -23,7 +27,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
index 9a38061..56be8b5 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
@@ -12,6 +12,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_setSubscriptions() {
@@ -50,7 +54,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/shutdown_test.dart b/pkg/analysis_server/test/integration/server/shutdown_test.dart
index d830f8c..ab556b7 100644
--- a/pkg/analysis_server/test/integration/server/shutdown_test.dart
+++ b/pkg/analysis_server/test/integration/server/shutdown_test.dart
@@ -6,11 +6,15 @@
 
 import 'dart:async';
 
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_shutdown() {
@@ -25,7 +29,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/status_test.dart b/pkg/analysis_server/test/integration/server/status_test.dart
index e2ba825..85c9fb3 100644
--- a/pkg/analysis_server/test/integration/server/status_test.dart
+++ b/pkg/analysis_server/test/integration/server/status_test.dart
@@ -12,6 +12,10 @@
 import '../../reflective_tests.dart';
 import '../integration_tests.dart';
 
+main() {
+  runReflectiveTests(Test);
+}
+
 @ReflectiveTestCase()
 class Test extends AbstractAnalysisServerIntegrationTest {
   test_status() {
@@ -44,7 +48,3 @@
     });
   }
 }
-
-main() {
-  runReflectiveTests(Test);
-}
diff --git a/pkg/analysis_server/test/integration/server/test_all.dart b/pkg/analysis_server/test/integration/server/test_all.dart
index 62d5d55..1eb9384 100644
--- a/pkg/analysis_server/test/integration/server/test_all.dart
+++ b/pkg/analysis_server/test/integration/server/test_all.dart
@@ -7,9 +7,9 @@
 import 'package:unittest/unittest.dart';
 
 import 'get_version_test.dart' as get_version_test;
-import 'set_subscriptions_test.dart' as set_subscriptions_test;
 import 'set_subscriptions_invalid_service_test.dart' as
     set_subscriptions_invalid_service_test;
+import 'set_subscriptions_test.dart' as set_subscriptions_test;
 import 'shutdown_test.dart' as shutdown_test;
 import 'status_test.dart' as status_test;
 
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index c539226..ffca2a3 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -40,6 +40,9 @@
 class bool extends Object {}
 abstract class num implements Comparable<num> {
   bool operator <(num other);
+  bool operator <=(num other);
+  bool operator >(num other);
+  bool operator >=(num other);
   num operator +(num other);
   num operator -(num other);
   num operator *(num other);
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 1bb28d5..003ea4c 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -4,21 +4,20 @@
 
 library mocks;
 
+@MirrorsUsed(targets: 'mocks', override: '*')
+import 'dart:mirrors';
 import 'dart:async';
 import 'dart:io';
 
-@MirrorsUsed(targets: 'mocks', override: '*')
-import 'dart:mirrors';
-
+import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/channel/channel.dart';
+import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart';
+import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analyzer/file_system/file_system.dart' as resource;
 import 'package:analyzer/file_system/memory_file_system.dart' as resource;
-import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
-import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analyzer/source/package_map_provider.dart';
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -43,6 +42,19 @@
 }
 
 /**
+ * A [Matcher] that check that the given [Response] has an expected identifier
+ * and has an error.  The error code may optionally be checked.
+ */
+Matcher isResponseFailure(String id, [RequestErrorCode code]) =>
+    new _IsResponseFailure(id, code);
+
+/**
+ * A [Matcher] that check that the given [Response] has an expected identifier
+ * and no error.
+ */
+Matcher isResponseSuccess(String id) => new _IsResponseSuccess(id);
+
+/**
  * Returns a [Future] that completes after pumping the event queue [times]
  * times. By default, this should pump the event queue enough times to allow
  * any code to run, as long as it's not waiting on some external event.
@@ -68,308 +80,18 @@
   // Future.value or Future() constructors use scheduleMicrotask themselves and
   // would therefore not wait for microtask callbacks that are scheduled after
   // invoking this method.
-  return new Future.delayed(Duration.ZERO,
+  return new Future.delayed(
+      Duration.ZERO,
       () => waitForServerOperationsPerformed(server));
 }
 
-/**
- * A mock [WebSocket] for testing.
- */
-class MockSocket<T> implements WebSocket {
-  StreamController controller = new StreamController();
-  MockSocket twin;
-  Stream stream;
-
-  factory MockSocket.pair() {
-    MockSocket socket1 = new MockSocket();
-    MockSocket socket2 = new MockSocket();
-    socket1.twin = socket2;
-    socket2.twin = socket1;
-    socket1.stream = socket2.controller.stream;
-    socket2.stream = socket1.controller.stream;
-    return socket1;
-  }
-
-  MockSocket();
-
-  void add(T text) => controller.add(text);
-
-  void allowMultipleListeners() {
-    stream = stream.asBroadcastStream();
-  }
-
-  Future close([int code, String reason]) => controller.close()
-      .then((_) => twin.controller.close());
-
-  StreamSubscription<T> listen(void onData(T event),
-                     { Function onError, void onDone(), bool cancelOnError}) =>
-    stream.listen(onData, onError: onError, onDone: onDone,
-        cancelOnError: cancelOnError);
-
-  Stream<T> where(bool test(T)) => stream.where(test);
-
-  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-class NoResponseException implements Exception {
-  /**
-   * The request that was not responded to.
-   */
-  final Request request;
-
-  NoResponseException(this.request);
-
-  String toString() {
-    return "NoResponseException after request ${request.toJson()}";
-  }
-}
-
-/**
- * A mock [ServerCommunicationChannel] for testing [AnalysisServer].
- */
-class MockServerChannel implements ServerCommunicationChannel {
-  StreamController<Request> requestController = new StreamController<Request>();
-  StreamController<Response> responseController = new StreamController<Response>.broadcast();
-  StreamController<Notification> notificationController = new StreamController<Notification>(sync: true);
-
-  List<Response> responsesReceived = [];
-  List<Notification> notificationsReceived = [];
-  bool _closed = false;
-
-  MockServerChannel() {
-  }
-
-  @override
-  void listen(void onRequest(Request request), {Function onError, void onDone()}) {
-    requestController.stream.listen(onRequest, onError: onError, onDone: onDone);
-  }
-
-  @override
-  void sendNotification(Notification notification) {
-    // Don't deliver notifications after the connection is closed.
-    if (_closed) {
-      return;
-    }
-    notificationsReceived.add(notification);
-    // Wrap send notification in future to simulate websocket
-    // TODO(scheglov) ask Dan why and decide what to do
-//    new Future(() => notificationController.add(notification));
-    notificationController.add(notification);
-  }
-
-  /**
-   * Simulate request/response pair.
-   */
-  Future<Response> sendRequest(Request request) {
-    // No further requests should be sent after the connection is closed.
-    if (_closed) {
-      throw new Exception('sendRequest after connection closed');
-    }
-    // Wrap send request in future to simulate websocket
-    new Future(() => requestController.add(request));
-    return waitForResponse(request);
-  }
-
-  @override
-  void sendResponse(Response response) {
-    // Don't deliver responses after the connection is closed.
-    if (_closed) {
-      return;
-    }
-    responsesReceived.add(response);
-    // Wrap send response in future to simulate websocket
-    new Future(() => responseController.add(response));
-  }
-
-  void expectMsgCount({responseCount: 0, notificationCount: 0}) {
-    expect(responsesReceived, hasLength(responseCount));
-    expect(notificationsReceived, hasLength(notificationCount));
-  }
-
-  Future<Response> waitForResponse(Request request) {
-    String id = request.id;
-    pumpEventQueue().then((_) {
-      responseController.addError(new NoResponseException(request));
-    });
-    return responseController.stream.firstWhere((response) {
-      return response.id == id;
-    });
-//    return responseController.stream.firstWhere((response) {
-//      return response.id == id;
-//    });
-  }
-
-  @override
-  void close() {
-    _closed = true;
-  }
-}
-
 typedef void MockServerOperationPerformFunction(AnalysisServer server);
 
-/**
- * A mock [ServerOperation] for testing [AnalysisServer].
- */
-class MockServerOperation implements PerformAnalysisOperation {
-  final ServerOperationPriority priority;
-  final MockServerOperationPerformFunction _perform;
-
-  MockServerOperation(this.priority, this._perform);
-
-  @override
-  void perform(AnalysisServer server) => this._perform(server);
-
-  @override
-  AnalysisContext get context => null;
-
-  @override
-  bool get isContinue => false;
-
-  @override
-  void sendNotices(AnalysisServer server, List<ChangeNotice> notices) {
-  }
-
-  @override
-  void updateIndex(Index index, List<ChangeNotice> notices) {
-  }
-}
-
-
-/**
- * A [Matcher] that check that the given [Response] has an expected identifier
- * and no error.
- */
-Matcher isResponseSuccess(String id) => new _IsResponseSuccess(id);
-
-/**
- * A [Matcher] that check that there are no `error` in a given [Response].
- */
-class _IsResponseSuccess extends Matcher {
-  final String _id;
-
-  _IsResponseSuccess(this._id);
-
-  @override
-  Description describe(Description description) {
-    return description.addDescriptionOf(
-        'response with identifier "$_id" and without error');
-  }
-
-  @override
-  bool matches(item, Map matchState) {
-    Response response = item;
-    return response != null && response.id == _id && response.error == null;
-  }
-
-  @override
-  Description describeMismatch(item, Description mismatchDescription,
-                               Map matchState, bool verbose) {
-    Response response = item;
-    if (response == null) {
-      mismatchDescription.add('is null response');
-    } else {
-      var id = response.id;
-      RequestError error = response.error;
-      mismatchDescription.add('has identifier "$id"');
-      if (error != null) {
-        mismatchDescription.add(' and has error $error');
-      }
-    }
-    return mismatchDescription;
-  }
-}
-
-
-/**
- * A [Matcher] that check that the given [Response] has an expected identifier
- * and has an error.  The error code may optionally be checked.
- */
-Matcher isResponseFailure(String id, [RequestErrorCode code]) =>
-    new _IsResponseFailure(id, code);
-
-/**
- * A [Matcher] that check that there are no `error` in a given [Response].
- */
-class _IsResponseFailure extends Matcher {
-  final String _id;
-  final RequestErrorCode _code;
-
-  _IsResponseFailure(this._id, this._code);
-
-  @override
-  Description describe(Description description) {
-    description = description.add(
-        'response with identifier "$_id" and an error');
-    if (_code != null) {
-      description = description.add(' with code ${this._code.name}');
-    }
-    return description;
-  }
-
-  @override
-  bool matches(item, Map matchState) {
-    Response response = item;
-    if (response.id != _id || response.error == null) {
-      return false;
-    }
-    if (_code != null && response.error.code != _code) {
-      return false;
-    }
-    return true;
-  }
-
-  @override
-  Description describeMismatch(item, Description mismatchDescription,
-                               Map matchState, bool verbose) {
-    Response response = item;
-    var id = response.id;
-    RequestError error = response.error;
-    mismatchDescription.add('has identifier "$id"');
-    if (error == null) {
-      mismatchDescription.add(' and has no error');
-    } else {
-      mismatchDescription.add(' and has error code ${response.error.code.name}');
-    }
-    return mismatchDescription;
-  }
-}
-
-
-/**
- * A mock [PackageMapProvider].
- */
-class MockPackageMapProvider implements PackageMapProvider {
-  /**
-   * Package map that will be returned by the next call to [computePackageMap].
-   */
-  Map<String, List<resource.Folder>> packageMap = <String, List<resource.Folder>>{};
-
-  /**
-   * Package maps that will be returned by the next call to [computePackageMap].
-   */
-  Map<String, Map<String, List<resource.Folder>>> packageMaps = null;
-
-  /**
-   * Dependency list that will be returned by the next call to [computePackageMap].
-   */
-  Set<String> dependencies = new Set<String>();
-
-  @override
-  PackageMapInfo computePackageMap(resource.Folder folder) {
-    if (packageMaps != null) {
-      return new PackageMapInfo(packageMaps[folder.path], dependencies);
-    }
-    return new PackageMapInfo(packageMap, dependencies);
-  }
-}
-
-
 class MockAnalysisContext extends StringTypedMock implements AnalysisContext {
   MockAnalysisContext(String name) : super(name);
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
-
 class MockClassElement extends TypedMock implements ClassElement {
   final ElementKind kind = ElementKind.CLASS;
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@@ -382,7 +104,6 @@
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
-
 class MockConstructorElement extends TypedMock implements ConstructorElement {
   final kind = ElementKind.CONSTRUCTOR;
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@@ -401,7 +122,6 @@
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
-
 class MockFieldElement extends TypedMock implements FieldElement {
   final ElementKind kind = ElementKind.FIELD;
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@@ -458,6 +178,36 @@
 }
 
 
+/**
+ * A mock [PackageMapProvider].
+ */
+class MockPackageMapProvider implements PackageMapProvider {
+  /**
+   * Package map that will be returned by the next call to [computePackageMap].
+   */
+  Map<String, List<resource.Folder>> packageMap = <String,
+      List<resource.Folder>>{};
+
+  /**
+   * Package maps that will be returned by the next call to [computePackageMap].
+   */
+  Map<String, Map<String, List<resource.Folder>>> packageMaps = null;
+
+  /**
+   * Dependency list that will be returned by the next call to [computePackageMap].
+   */
+  Set<String> dependencies = new Set<String>();
+
+  @override
+  PackageMapInfo computePackageMap(resource.Folder folder) {
+    if (packageMaps != null) {
+      return new PackageMapInfo(packageMaps[folder.path], dependencies);
+    }
+    return new PackageMapInfo(packageMap, dependencies);
+  }
+}
+
+
 class MockParameterElement extends TypedMock implements ParameterElement {
   final ElementKind kind = ElementKind.PARAMETER;
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@@ -472,6 +222,163 @@
 }
 
 
+/**
+ * A mock [ServerCommunicationChannel] for testing [AnalysisServer].
+ */
+class MockServerChannel implements ServerCommunicationChannel {
+  StreamController<Request> requestController = new StreamController<Request>();
+  StreamController<Response> responseController =
+      new StreamController<Response>.broadcast();
+  StreamController<Notification> notificationController =
+      new StreamController<Notification>(sync: true);
+
+  List<Response> responsesReceived = [];
+  List<Notification> notificationsReceived = [];
+  bool _closed = false;
+
+  MockServerChannel();
+  @override
+  void close() {
+    _closed = true;
+  }
+
+  void expectMsgCount({responseCount: 0, notificationCount: 0}) {
+    expect(responsesReceived, hasLength(responseCount));
+    expect(notificationsReceived, hasLength(notificationCount));
+  }
+
+  @override
+  void listen(void onRequest(Request request), {Function onError, void
+      onDone()}) {
+    requestController.stream.listen(
+        onRequest,
+        onError: onError,
+        onDone: onDone);
+  }
+
+  @override
+  void sendNotification(Notification notification) {
+    // Don't deliver notifications after the connection is closed.
+    if (_closed) {
+      return;
+    }
+    notificationsReceived.add(notification);
+    // Wrap send notification in future to simulate websocket
+    // TODO(scheglov) ask Dan why and decide what to do
+//    new Future(() => notificationController.add(notification));
+    notificationController.add(notification);
+  }
+
+  /**
+   * Simulate request/response pair.
+   */
+  Future<Response> sendRequest(Request request) {
+    // No further requests should be sent after the connection is closed.
+    if (_closed) {
+      throw new Exception('sendRequest after connection closed');
+    }
+    // Wrap send request in future to simulate websocket
+    new Future(() => requestController.add(request));
+    return waitForResponse(request);
+  }
+
+  @override
+  void sendResponse(Response response) {
+    // Don't deliver responses after the connection is closed.
+    if (_closed) {
+      return;
+    }
+    responsesReceived.add(response);
+    // Wrap send response in future to simulate websocket
+    new Future(() => responseController.add(response));
+  }
+
+  Future<Response> waitForResponse(Request request) {
+    String id = request.id;
+    pumpEventQueue().then((_) {
+      responseController.addError(new NoResponseException(request));
+    });
+    return responseController.stream.firstWhere((response) {
+      return response.id == id;
+    });
+//    return responseController.stream.firstWhere((response) {
+//      return response.id == id;
+//    });
+  }
+}
+
+
+/**
+ * A mock [ServerOperation] for testing [AnalysisServer].
+ */
+class MockServerOperation implements PerformAnalysisOperation {
+  final ServerOperationPriority priority;
+  final MockServerOperationPerformFunction _perform;
+
+  MockServerOperation(this.priority, this._perform);
+
+  @override
+  AnalysisContext get context => null;
+
+  @override
+  bool get isContinue => false;
+
+  @override
+  void perform(AnalysisServer server) => this._perform(server);
+
+  @override
+  void sendNotices(AnalysisServer server, List<ChangeNotice> notices) {
+  }
+
+  @override
+  void updateIndex(Index index, List<ChangeNotice> notices) {
+  }
+}
+
+
+/**
+ * A mock [WebSocket] for testing.
+ */
+class MockSocket<T> implements WebSocket {
+  StreamController controller = new StreamController();
+  MockSocket twin;
+  Stream stream;
+
+  MockSocket();
+
+  factory MockSocket.pair() {
+    MockSocket socket1 = new MockSocket();
+    MockSocket socket2 = new MockSocket();
+    socket1.twin = socket2;
+    socket2.twin = socket1;
+    socket1.stream = socket2.controller.stream;
+    socket2.stream = socket1.controller.stream;
+    return socket1;
+  }
+
+  void add(T text) => controller.add(text);
+
+  void allowMultipleListeners() {
+    stream = stream.asBroadcastStream();
+  }
+
+  Future close([int code, String reason]) =>
+      controller.close().then((_) => twin.controller.close());
+
+  StreamSubscription<T> listen(void onData(T event), {Function onError, void
+      onDone(), bool cancelOnError}) =>
+      stream.listen(
+          onData,
+          onError: onError,
+          onDone: onDone,
+          cancelOnError: cancelOnError);
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+
+  Stream<T> where(bool test(T)) => stream.where(test);
+}
+
+
 class MockSource extends StringTypedMock implements Source {
   MockSource([String name = 'mocked.dart']) : super(name);
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
@@ -492,6 +399,20 @@
 }
 
 
+class NoResponseException implements Exception {
+  /**
+   * The request that was not responded to.
+   */
+  final Request request;
+
+  NoResponseException(this.request);
+
+  String toString() {
+    return "NoResponseException after request ${request.toJson()}";
+  }
+}
+
+
 class StringTypedMock extends TypedMock {
   String _toString;
 
@@ -505,3 +426,91 @@
     return super.toString();
   }
 }
+
+
+/**
+ * A [Matcher] that check that there are no `error` in a given [Response].
+ */
+class _IsResponseFailure extends Matcher {
+  final String _id;
+  final RequestErrorCode _code;
+
+  _IsResponseFailure(this._id, this._code);
+
+  @override
+  Description describe(Description description) {
+    description =
+        description.add('response with identifier "$_id" and an error');
+    if (_code != null) {
+      description = description.add(' with code ${this._code.name}');
+    }
+    return description;
+  }
+
+  @override
+  Description describeMismatch(item, Description mismatchDescription,
+      Map matchState, bool verbose) {
+    Response response = item;
+    var id = response.id;
+    RequestError error = response.error;
+    mismatchDescription.add('has identifier "$id"');
+    if (error == null) {
+      mismatchDescription.add(' and has no error');
+    } else {
+      mismatchDescription.add(
+          ' and has error code ${response.error.code.name}');
+    }
+    return mismatchDescription;
+  }
+
+  @override
+  bool matches(item, Map matchState) {
+    Response response = item;
+    if (response.id != _id || response.error == null) {
+      return false;
+    }
+    if (_code != null && response.error.code != _code) {
+      return false;
+    }
+    return true;
+  }
+}
+
+
+/**
+ * A [Matcher] that check that there are no `error` in a given [Response].
+ */
+class _IsResponseSuccess extends Matcher {
+  final String _id;
+
+  _IsResponseSuccess(this._id);
+
+  @override
+  Description describe(Description description) {
+    return description.addDescriptionOf(
+        'response with identifier "$_id" and without error');
+  }
+
+  @override
+  Description describeMismatch(item, Description mismatchDescription,
+      Map matchState, bool verbose) {
+    Response response = item;
+    if (response == null) {
+      mismatchDescription.add('is null response');
+    } else {
+      var id = response.id;
+      RequestError error = response.error;
+      mismatchDescription.add('has identifier "$id"');
+      if (error != null) {
+        mismatchDescription.add(' and has error $error');
+      }
+    }
+    return mismatchDescription;
+  }
+
+  @override
+  bool matches(item, Map matchState) {
+    Response response = item;
+    return response != null && response.id == _id && response.error == null;
+  }
+}
diff --git a/pkg/analysis_server/test/operation/operation_queue_test.dart b/pkg/analysis_server/test/operation/operation_queue_test.dart
index ed6ab50..66083e7 100644
--- a/pkg/analysis_server/test/operation/operation_queue_test.dart
+++ b/pkg/analysis_server/test/operation/operation_queue_test.dart
@@ -5,8 +5,8 @@
 library test.operation.queue;
 
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation_queue.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:typed_mock/typed_mock.dart';
@@ -112,14 +112,15 @@
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
-class ServerOperationMock extends TypedMock implements ServerOperation {
-  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
 class AnalysisServerMock extends TypedMock implements AnalysisServer {
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
-class ServerContextManagerMock extends TypedMock implements ServerContextManager {
+class ServerContextManagerMock extends TypedMock implements ServerContextManager
+    {
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+class ServerOperationMock extends TypedMock implements ServerOperation {
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
diff --git a/pkg/analysis_server/test/operation/test_all.dart b/pkg/analysis_server/test/operation/test_all.dart
index bada1e4..7df43c4 100644
--- a/pkg/analysis_server/test/operation/test_all.dart
+++ b/pkg/analysis_server/test/operation/test_all.dart
@@ -16,4 +16,4 @@
     operation_queue_test.main();
     operation_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index ca6198d..7b47452 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -274,6 +274,18 @@
     expect(element.flags, Element.FLAG_CONST);
   }
 
+  void test_fromElement_dynamic() {
+    var engineElement = engine.DynamicElementImpl.instance;
+    // create notification Element
+    Element element = newElement_fromEngine(engineElement);
+    expect(element.kind, ElementKind.UNKNOWN);
+    expect(element.name, 'dynamic');
+    expect(element.location, isNull);
+    expect(element.parameters, isNull);
+    expect(element.returnType, isNull);
+    expect(element.flags, 0);
+  }
+
   void test_fromElement_FIELD() {
     engine.Source source = addSource('/test.dart', '''
 class A {
@@ -401,65 +413,8 @@
     expect(element.returnType, isNull);
     expect(element.flags, 0);
   }
-
-  void test_fromElement_dynamic() {
-    var engineElement = engine.DynamicElementImpl.instance;
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.UNKNOWN);
-    expect(element.name, 'dynamic');
-    expect(element.location, isNull);
-    expect(element.parameters, isNull);
-    expect(element.returnType, isNull);
-    expect(element.flags, 0);
-  }
 }
 
-/**
- * Helper class for testing the correspondence between an analysis engine enum
- * and an analysis server API enum.
- */
-class EnumTester<EngineEnum, ApiEnum extends Enum> {
-  /**
-   * Test that the function [convert] properly converts all possible values of
-   * [EngineEnum] to an [ApiEnum] with the same name, with the exceptions noted
-   * in [exceptions].  For each key in [exceptions], if the corresponding value
-   * is null, then we check that converting the given key results in an error.
-   * If the corresponding value is an [ApiEnum], then we check that converting
-   * the given key results in the given value.
-   */
-  void run(ApiEnum convert(EngineEnum value), {Map<EngineEnum,
-      ApiEnum> exceptions: const {}}) {
-    ClassMirror engineClass = reflectClass(EngineEnum);
-    engineClass.staticMembers.forEach((Symbol symbol, MethodMirror method) {
-      if (symbol == #values) {
-        return;
-      }
-      if (!method.isGetter) {
-        return;
-      }
-      String enumName = MirrorSystem.getName(symbol);
-      EngineEnum engineValue = engineClass.getField(symbol).reflectee;
-      expect(engineValue, new isInstanceOf<EngineEnum>());
-      if (exceptions.containsKey(engineValue)) {
-        ApiEnum expectedResult = exceptions[engineValue];
-        if (expectedResult == null) {
-          expect(() {
-            convert(engineValue);
-          }, throws);
-        } else {
-          ApiEnum apiValue = convert(engineValue);
-          expect(apiValue, equals(expectedResult));
-        }
-      } else {
-        ApiEnum apiValue = convert(engineValue);
-        expect(apiValue.name, equals(enumName));
-      }
-    });
-  }
-}
-
-
 @ReflectiveTestCase()
 class EnumTest {
   void test_AnalysisErrorSeverity() {
@@ -511,9 +466,54 @@
     new EnumTester<MatchKind, SearchResultKind>().run(
         newSearchResultKind_fromEngine,
         exceptions: {
-          // TODO(paulberry): do any of the exceptions below constitute bugs?
-          MatchKind.ANGULAR_REFERENCE: SearchResultKind.UNKNOWN,
-          MatchKind.ANGULAR_CLOSING_TAG_REFERENCE: SearchResultKind.UNKNOWN
-        });
+      // TODO(paulberry): do any of the exceptions below constitute bugs?
+      MatchKind.ANGULAR_REFERENCE: SearchResultKind.UNKNOWN,
+      MatchKind.ANGULAR_CLOSING_TAG_REFERENCE: SearchResultKind.UNKNOWN
+    });
+  }
+}
+
+
+/**
+ * Helper class for testing the correspondence between an analysis engine enum
+ * and an analysis server API enum.
+ */
+class EnumTester<EngineEnum, ApiEnum extends Enum> {
+  /**
+   * Test that the function [convert] properly converts all possible values of
+   * [EngineEnum] to an [ApiEnum] with the same name, with the exceptions noted
+   * in [exceptions].  For each key in [exceptions], if the corresponding value
+   * is null, then we check that converting the given key results in an error.
+   * If the corresponding value is an [ApiEnum], then we check that converting
+   * the given key results in the given value.
+   */
+  void run(ApiEnum convert(EngineEnum value), {Map<EngineEnum,
+      ApiEnum> exceptions: const {}}) {
+    ClassMirror engineClass = reflectClass(EngineEnum);
+    engineClass.staticMembers.forEach((Symbol symbol, MethodMirror method) {
+      if (symbol == #values) {
+        return;
+      }
+      if (!method.isGetter) {
+        return;
+      }
+      String enumName = MirrorSystem.getName(symbol);
+      EngineEnum engineValue = engineClass.getField(symbol).reflectee;
+      expect(engineValue, new isInstanceOf<EngineEnum>());
+      if (exceptions.containsKey(engineValue)) {
+        ApiEnum expectedResult = exceptions[engineValue];
+        if (expectedResult == null) {
+          expect(() {
+            convert(engineValue);
+          }, throws);
+        } else {
+          ApiEnum apiValue = convert(engineValue);
+          expect(apiValue, equals(expectedResult));
+        }
+      } else {
+        ApiEnum apiValue = convert(engineValue);
+        expect(apiValue.name, equals(enumName));
+      }
+    });
   }
 }
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index 61d9855..189d871 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -8,9 +8,10 @@
 
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol.dart';
-import 'reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import 'reflective_tests.dart';
+
 
 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>());
 
@@ -73,6 +74,15 @@
     }));
   }
 
+  void test_toJson_noParams() {
+    Notification notification = new Notification('foo');
+    expect(notification.event, equals('foo'));
+    expect(notification.toJson().keys, isNot(contains('params')));
+    expect(notification.toJson(), equals({
+      'event': 'foo'
+    }));
+  }
+
   void test_toJson_withParams() {
     Notification notification = new Notification('foo', {
       'x': 'y'
@@ -88,15 +98,6 @@
       }
     }));
   }
-
-  void test_toJson_noParams() {
-    Notification notification = new Notification('foo');
-    expect(notification.event, equals('foo'));
-    expect(notification.toJson().keys, isNot(contains('params')));
-    expect(notification.toJson(), equals({
-      'event': 'foo'
-    }));
-  }
 }
 
 
@@ -223,7 +224,7 @@
 
   void test_create_unanalyzedPriorityFiles() {
     Response response =
-        new Response.unanalyzedPriorityFiles(new Request('0', ''), 'file list');
+        new Response.unanalyzedPriorityFiles('0', 'file list');
     expect(response.id, equals('0'));
     expect(response.error, isNotNull);
     expect(response.toJson(), equals({
diff --git a/pkg/analysis_server/test/reflective_tests.dart b/pkg/analysis_server/test/reflective_tests.dart
index 202a0be..685bd13 100644
--- a/pkg/analysis_server/test/reflective_tests.dart
+++ b/pkg/analysis_server/test/reflective_tests.dart
@@ -4,24 +4,14 @@
 
 library reflective_tests;
 
-import 'dart:async';
-
 @MirrorsUsed(metaTargets: 'ReflectiveTestCase')
 import 'dart:mirrors';
+import 'dart:async';
 
 import 'package:unittest/unittest.dart';
 
 
 /**
- * A marker annotation used to instruct dart2js to keep reflection information
- * for the annotated classes.
- */
-class ReflectiveTestCase {
-  const ReflectiveTestCase();
-}
-
-
-/**
  * Runs test methods existing in the given [type].
  *
  * Methods with names starting with `test` are run using [test] function.
@@ -67,14 +57,6 @@
 }
 
 
-_runTest(ClassMirror classMirror, Symbol symbol) {
-  InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
-  return _invokeSymbolIfExists(instanceMirror, #setUp).then(
-      (_) => instanceMirror.invoke(symbol, []).reflectee).whenComplete(
-      () => _invokeSymbolIfExists(instanceMirror, #tearDown));
-}
-
-
 Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
   var invocationResult = null;
   try {
@@ -87,3 +69,26 @@
     return new Future.value(invocationResult);
   }
 }
+
+
+_runTest(ClassMirror classMirror, Symbol symbol) {
+  InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
+  return _invokeSymbolIfExists(
+      instanceMirror,
+      #setUp).then(
+          (_) =>
+              instanceMirror.invoke(
+                  symbol,
+                  [
+                      ]).reflectee).whenComplete(
+                          () => _invokeSymbolIfExists(instanceMirror, #tearDown));
+}
+
+
+/**
+ * A marker annotation used to instruct dart2js to keep reflection information
+ * for the annotated classes.
+ */
+class ReflectiveTestCase {
+  const ReflectiveTestCase();
+}
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index 68b4634..d38a7ac 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -7,9 +7,9 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/protocol.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../reflective_tests.dart';
 import 'abstract_search_domain.dart';
 
 
@@ -40,7 +40,8 @@
       Request request =
           new SearchFindMemberDeclarationsParams(name).toRequest('0');
       Response response = handleSuccessfulRequest(request);
-      var result = new SearchFindMemberDeclarationsResult.fromResponse(response);
+      var result =
+          new SearchFindMemberDeclarationsResult.fromResponse(response);
       searchId = result.id;
       results.clear();
       return waitForSearchResults();
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index dbbd978..b9b1ef14 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -7,9 +7,9 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/protocol.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../reflective_tests.dart';
 import 'abstract_search_domain.dart';
 
 
@@ -28,7 +28,8 @@
 
   Future findMemberReferences(String name) {
     return waitForTasksFinished().then((_) {
-      Request request = new SearchFindMemberReferencesParams(name).toRequest('0');
+      Request request =
+          new SearchFindMemberReferencesParams(name).toRequest('0');
       Response response = handleSuccessfulRequest(request);
       searchId = new SearchFindMemberReferencesResult.fromResponse(response).id;
       results.clear();
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index 0277bae..f64b68e 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -6,9 +6,10 @@
 
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/search/test_all.dart b/pkg/analysis_server/test/search/test_all.dart
index 5bc1b7b..9818ebb 100644
--- a/pkg/analysis_server/test/search/test_all.dart
+++ b/pkg/analysis_server/test/search/test_all.dart
@@ -25,4 +25,4 @@
     top_level_declarations_test.main();
     type_hierarchy_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart
index 30885a4..df4929b 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -4,12 +4,13 @@
 
 library test.search.top_level_declarations;
 
+import 'dart:async';
+
 import 'package:analysis_server/src/protocol.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../reflective_tests.dart';
 import 'abstract_search_domain.dart';
-import 'dart:async';
 
 
 main() {
@@ -20,18 +21,6 @@
 
 @ReflectiveTestCase()
 class TopLevelDeclarationsTest extends AbstractSearchDomainTest {
-  Future findTopLevelDeclarations(String pattern) {
-    return waitForTasksFinished().then((_) {
-      Request request = new SearchFindTopLevelDeclarationsParams(
-          pattern).toRequest('0');
-      Response response = handleSuccessfulRequest(request);
-      searchId = new SearchFindTopLevelDeclarationsResult.fromResponse(
-          response).id;
-      results.clear();
-      return waitForSearchResults();
-    });
-  }
-
   void assertHasDeclaration(ElementKind kind, String name) {
     result = findTopLevelResult(kind, name);
     if (result == null) {
@@ -46,6 +35,18 @@
     }
   }
 
+  Future findTopLevelDeclarations(String pattern) {
+    return waitForTasksFinished().then((_) {
+      Request request =
+          new SearchFindTopLevelDeclarationsParams(pattern).toRequest('0');
+      Response response = handleSuccessfulRequest(request);
+      searchId =
+          new SearchFindTopLevelDeclarationsResult.fromResponse(response).id;
+      results.clear();
+      return waitForSearchResults();
+    });
+  }
+
   SearchResult findTopLevelResult(ElementKind kind, String name) {
     for (SearchResult result in results) {
       Element element = result.path[0];
diff --git a/pkg/analysis_server/test/services/completion/arglist_computer_test.dart b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
index beb66ea..9eb0635 100644
--- a/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
@@ -20,8 +20,7 @@
 class ArgListComputerTest extends AbstractCompletionTest {
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new ArgListComputer();
   }
 
@@ -38,7 +37,7 @@
       String bar() => true;
       void main() {expect(^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
     });
   }
@@ -56,7 +55,7 @@
 //      String bar() => true;
 //      void main() {expect(^)}''');
 //    computeFast();
-//    return computeFull(true).then((_) {
+//    return computeFull((bool result) {
 //      assertSuggestArgumentList(['arg'], ['String']);
 //    });
 //  }
@@ -74,7 +73,7 @@
       String bar() => true;
       void main() {expect(^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestArgumentList(['arg'], ['dynamic']);
     });
   }
@@ -92,7 +91,7 @@
         void foo() {expect(^)}}
       String bar() => true;''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
     });
   }
@@ -110,8 +109,8 @@
         void foo() {expect(^)}}
       String bar() => true;''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestArgumentList(['arg', 'blat'], ['dynamic', 'int']);
     });
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/services/completion/combinator_computer_test.dart b/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
index af4fc0f..ffe483e 100644
--- a/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/combinator_computer_test.dart
@@ -20,8 +20,7 @@
 class CombinatorComputerTest extends AbstractCompletionTest {
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new CombinatorComputer();
   }
 
@@ -34,7 +33,7 @@
       class M { var m1; int m2() { } }
       class A extends E implements I with M {a() {^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -59,7 +58,7 @@
       import "/testCD.dart";
       class X {}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestClass(
           'A',
           CompletionRelevance.DEFAULT,
@@ -112,7 +111,7 @@
       import "/testCD.dart";
       class X {}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestClass(
           'A',
           CompletionRelevance.DEFAULT,
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index b230d49..3500955 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -44,6 +44,7 @@
   Index index;
   SearchEngineImpl searchEngine;
   Source source;
+  CompletionCache cache;
   CompletionPerformance perf;
   DartCompletionManager manager;
   MockCompletionComputer computer1;
@@ -63,8 +64,15 @@
     index = createLocalMemoryIndex();
     searchEngine = new SearchEngineImpl(index);
     source = addSource('/does/not/exist.dart', '');
+    cache = null;
     perf = new CompletionPerformance();
-    manager = new DartCompletionManager(context, searchEngine, source, 0, perf);
+    manager = new DartCompletionManager.create(
+        context,
+        searchEngine,
+        source,
+        0,
+        cache,
+        perf);
     suggestion1 = new CompletionSuggestion(
         CompletionSuggestionKind.INVOCATION,
         CompletionRelevance.DEFAULT,
diff --git a/pkg/analysis_server/test/services/completion/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
index f114e33..4a983a2 100644
--- a/pkg/analysis_server/test/services/completion/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
@@ -6,11 +6,12 @@
 
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
-import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../abstract_context.dart';
+import '../../reflective_tests.dart';
+
 main() {
   groupSep = ' | ';
   runReflectiveTests(CompletionManagerTest);
@@ -19,28 +20,33 @@
 @ReflectiveTestCase()
 class CompletionManagerTest extends AbstractContextTest {
   var perf = new CompletionPerformance();
+  var cache = null;
 
   test_dart() {
     Source source = addSource('/does/not/exist.dart', '');
-    var manager = CompletionManager.create(context, source, 0, null, perf);
+    var manager =
+        new CompletionManager.create(context, source, 0, null, cache, perf);
     expect(manager.runtimeType, DartCompletionManager);
   }
 
   test_html() {
     Source source = addSource('/does/not/exist.html', '');
-    var manager = CompletionManager.create(context, source, 0, null, perf);
+    var manager =
+        new CompletionManager.create(context, source, 0, null, cache, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 
   test_null_context() {
     Source source = addSource('/does/not/exist.dart', '');
-    var manager = CompletionManager.create(null, source, 0, null, perf);
+    var manager =
+        new CompletionManager.create(null, source, 0, null, cache, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 
   test_other() {
     Source source = addSource('/does/not/exist.foo', '');
-    var manager = CompletionManager.create(context, source, 0, null, perf);
+    var manager =
+        new CompletionManager.create(context, source, 0, null, cache, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 002c58d..ffe3bcf 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -9,6 +9,7 @@
 import 'package:analysis_server/src/protocol.dart' as protocol show Element,
     ElementKind;
 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/imported_computer.dart';
 import 'package:analysis_server/src/services/completion/invocation_computer.dart';
@@ -24,7 +25,13 @@
 
 import '../../abstract_context.dart';
 
-class AbstractCompletionTest extends AbstractContextTest {
+int suggestionComparator(CompletionSuggestion s1, CompletionSuggestion s2) {
+  String c1 = s1.completion.toLowerCase();
+  String c2 = s2.completion.toLowerCase();
+  return c1.compareTo(c2);
+}
+
+abstract class AbstractCompletionTest extends AbstractContextTest {
   Index index;
   SearchEngineImpl searchEngine;
   DartCompletionComputer computer;
@@ -35,6 +42,7 @@
   AstNode completionNode;
   bool _computeFastCalled = false;
   DartCompletionRequest request;
+  DartCompletionCache cache;
 
   void addResolvedUnit(String file, String code) {
     Source source = addSource(file, code);
@@ -51,8 +59,13 @@
     content = content.substring(0, completionOffset) +
         content.substring(completionOffset + 1);
     testSource = addSource(testFile, content);
-    request =
-        new DartCompletionRequest(context, searchEngine, testSource, completionOffset);
+    cache = new DartCompletionCache(context, testSource);
+    request = new DartCompletionRequest(
+        context,
+        searchEngine,
+        testSource,
+        completionOffset,
+        cache);
   }
 
   void assertNoSuggestions({CompletionSuggestionKind kind: null}) {
@@ -103,7 +116,8 @@
     return cs;
   }
 
-  void assertSuggestArgumentList(List<String> paramNames, List<String> paramTypes) {
+  void assertSuggestArgumentList(List<String> paramNames,
+      List<String> paramTypes) {
     CompletionSuggestionKind csKind = CompletionSuggestionKind.ARGUMENT_LIST;
     CompletionSuggestion cs = getSuggest(csKind: csKind);
     if (cs == null) {
@@ -408,7 +422,7 @@
     return computer.computeFast(request);
   }
 
-  Future<bool> computeFull([bool fullAnalysis = false]) {
+  Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) {
     if (!_computeFastCalled) {
       expect(computeFast(), isFalse);
     }
@@ -455,7 +469,7 @@
     if (!resolved) {
       fail('expected unit to be resolved');
     }
-    return computer.computeFull(request);
+    return computer.computeFull(request).then(assertFunction);
   }
 
   void failedCompletion(String message,
@@ -464,11 +478,7 @@
     if (completions != null) {
       sb.write('\n  found');
       completions.toList()
-          ..sort((CompletionSuggestion s1, CompletionSuggestion s2) {
-            String c1 = s1.completion.toLowerCase();
-            String c2 = s2.completion.toLowerCase();
-            return c1.compareTo(c2);
-          })
+          ..sort(suggestionComparator)
           ..forEach((CompletionSuggestion suggestion) {
             sb.write('\n    ${suggestion.completion} -> $suggestion');
           });
@@ -516,14 +526,25 @@
     super.setUp();
     index = createLocalMemoryIndex();
     searchEngine = new SearchEngineImpl(index);
+    setUpComputer();
   }
+
+  void setUpComputer();
 }
 
 /**
  * Common tests for `ImportedTypeComputerTest`, `InvocationComputerTest`,
  * and `LocalComputerTest`.
  */
-class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
+abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
+
+  /**
+   * Assert that the ImportedComputer uses cached results to produce identical
+   * suggestions to the original set of suggestions.
+   */
+  void assertCachedCompute(_) {
+    // Subclasses override
+  }
 
   CompletionSuggestion assertLocalSuggestMethod(String name,
       String declaringType, String returnType, [CompletionRelevance relevance =
@@ -730,6 +751,12 @@
     }
   }
 
+  Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) {
+    return super.computeFull(
+        assertFunction,
+        fullAnalysis: fullAnalysis).then(assertCachedCompute);
+  }
+
   test_ArgumentList() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
     addSource('/libA.dart', '''
@@ -737,12 +764,12 @@
       bool hasLength(int expected) { }
       void baz() { }''');
     addTestSource('''
-      import '/libA.dart'
+      import '/libA.dart';
       class B { }
       String bar() => true;
       void main() {expect(^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
@@ -768,7 +795,7 @@
       String bar() => true;
       void main() {expect(^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
@@ -794,7 +821,7 @@
       String bar() => true;
       void main() {expect(^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
@@ -820,7 +847,7 @@
         void foo() {expect(^)}}
       String bar() => true;''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
@@ -844,7 +871,7 @@
       String bar() => true;
       void main() {expect(foo: ^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
       assertNotSuggested('main');
@@ -856,7 +883,7 @@
     // VariableDeclarationStatement  Block
     addTestSource('class A {} main() {int a; int ^b = 1;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -866,7 +893,7 @@
     // VariableDeclarationStatement  Block
     addTestSource('class A {} main() {int a; int b = ^}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', 'int');
       assertSuggestLocalFunction('main', null);
       assertSuggestLocalClass('A');
@@ -879,7 +906,7 @@
     // VariableDeclarationStatement  Block
     addTestSource('class A {} main() {int a; int^ b = 1;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalClass('A');
       assertSuggestImportedClass('int');
       assertNotSuggested('a');
@@ -893,7 +920,7 @@
       class A {int x; int y() => 0;}
       main(){A a; await ^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', 'A');
       assertSuggestLocalFunction('main', null);
       assertSuggestLocalClass('A');
@@ -906,7 +933,7 @@
     // VariableDeclarationList  VariableDeclarationStatement
     addTestSource('main() {int a = 1, b = ^ + 2;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', 'int');
       assertSuggestImportedClass('Object');
       assertNotSuggested('b');
@@ -918,7 +945,7 @@
     // VariableDeclarationList  VariableDeclarationStatement
     addTestSource('main() {int a = 1, b = 2 + ^;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', 'int');
       assertSuggestImportedClass('Object');
       assertNotSuggested('b');
@@ -957,7 +984,7 @@
       class X {a() {var f; {var x;} ^ var r;} void b() { }}
       class Z { }''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
 
       assertSuggestLocalClass('X');
       assertSuggestLocalClass('Z');
@@ -1012,7 +1039,7 @@
       import "/testB.dart";
       class A extends E implements I with M {a() {^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedGetter('e1', null);
       assertSuggestImportedGetter('f1', null);
       assertSuggestImportedGetter('i1', 'int');
@@ -1035,7 +1062,7 @@
       class M { var m1; int m2() { } }
       class A extends E implements I with M {a() {^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalGetter('e1', null);
       assertSuggestLocalGetter('f1', null);
       assertSuggestLocalGetter('i1', 'int');
@@ -1059,7 +1086,7 @@
       // but the user is trying to get completions for a non-cascade
       main() {A a; a.^.z}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('b', null);
       assertSuggestInvocationGetter('_c', 'X');
       assertNotSuggested('Object');
@@ -1081,7 +1108,7 @@
       class X{}
       main() {A a; a..^z}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('b', null);
       assertSuggestInvocationGetter('_c', 'X');
       assertNotSuggested('Object');
@@ -1103,7 +1130,7 @@
       class X{}
       main() {A a; a..^ return}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('b', null);
       assertSuggestInvocationGetter('_c', 'X');
       assertNotSuggested('Object');
@@ -1122,7 +1149,7 @@
       class X{}
       main() {A a; a^..b}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNotSuggested('b');
       assertNotSuggested('_c');
       assertSuggestLocalVariable('a', 'A');
@@ -1137,7 +1164,7 @@
     // Block  CatchClause  TryStatement
     addTestSource('class A {a() {try{var x;} on E catch (e) {^}}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestParameter('e', 'E');
       assertSuggestLocalMethod('a', 'A', null);
       assertSuggestImportedClass('Object');
@@ -1149,7 +1176,7 @@
     // Block  CatchClause  TryStatement
     addTestSource('class A {a() {try{var x;} catch (e, s) {^}}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestParameter('e', null);
       assertSuggestParameter('s', 'StackTrace');
       assertSuggestLocalMethod('a', 'A', null);
@@ -1168,7 +1195,7 @@
       class _B {}
       A T;''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       CompletionSuggestion suggestionA =
           assertSuggestLocalClass('A', CompletionRelevance.LOW);
       if (suggestionA != null) {
@@ -1210,7 +1237,7 @@
       import "/testCD.dart";
       class X {}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1237,7 +1264,7 @@
       import "/testCD.dart";
       class X {}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1255,7 +1282,7 @@
       var m;
       main() {new X.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestNamedConstructor('c', 'X');
       assertNotSuggested('F1');
       assertNotSuggested('T1');
@@ -1274,7 +1301,7 @@
       class X {X.c(); X._d(); z() {}}
       main() {new X.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestNamedConstructor('c', 'X');
       assertSuggestNamedConstructor('_d', 'X');
       assertNotSuggested('F1');
@@ -1296,7 +1323,7 @@
       class Clz = Object with Object;
       class C {foo(){O^} void bar() {}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('A');
       assertSuggestImportedFunction('F1', '_B', false);
       assertSuggestLocalClass('C');
@@ -1319,7 +1346,7 @@
       import "/testA.dart";
       class C {a() {C ^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1332,7 +1359,7 @@
       import "/testA.dart";
       class C {A ^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1345,7 +1372,7 @@
       import "/testA.dart";
       class C {var ^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1354,7 +1381,7 @@
     // Block  ForEachStatement
     addTestSource('main(args) {for (int foo in bar) {^}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('foo', 'int');
       assertSuggestImportedClass('Object');
     });
@@ -1364,7 +1391,7 @@
     // Block  ForEachStatement
     addTestSource('main(args) {for (foo in bar) {^}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('foo', null);
       assertSuggestImportedClass('Object');
     });
@@ -1377,7 +1404,7 @@
       void bar() { }
       class A {a(^) { }}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalFunction('foo', null);
       assertSuggestLocalMethod('a', 'A', null);
       assertSuggestLocalClass('A');
@@ -1391,7 +1418,7 @@
     // Block  ForStatement
     addTestSource('main(args) {for (int i; i < 10; ++i) {^}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('i', 'int');
       assertSuggestImportedClass('Object');
     });
@@ -1401,7 +1428,7 @@
     // SimpleIdentifier  ForStatement
     addTestSource('main() {for (int index = 0; i^)}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('index', 'int');
     });
   }
@@ -1410,7 +1437,7 @@
     // SimpleIdentifier  ForStatement
     addTestSource('main() {List a; for (^)}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', 'List');
       assertSuggestImportedClass('Object');
       assertSuggestImportedClass('int');
@@ -1421,7 +1448,7 @@
     // SimpleIdentifier  ForStatement
     addTestSource('main() {for (int index = 0; index < 10; i^)}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('index', 'int');
     });
   }
@@ -1432,7 +1459,7 @@
       void bar() { }
       main() {for (int index = 0; index < 10; ++i^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('index', 'int');
       assertSuggestLocalFunction('main', null);
       assertNotSuggested('bar');
@@ -1445,7 +1472,7 @@
       void bar() { }
       String foo(List args) {x.then((R b) {^});}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       var f = assertSuggestLocalFunction('foo', 'String', false);
       if (f != null) {
         expect(f.element.isPrivate, isFalse);
@@ -1463,7 +1490,7 @@
       class A {int x; int y() => 0;}
       main(){var a; if (^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', null);
       assertSuggestLocalFunction('main', null);
       assertSuggestLocalClass('A');
@@ -1477,7 +1504,7 @@
       import "dart^";
       main() {}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1495,7 +1522,7 @@
       class B {int x;}
       class C {foo(){var f; {var x;} new ^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('Object');
       assertSuggestImportedClass('A');
       assertSuggestLocalClass('B');
@@ -1514,7 +1541,7 @@
     // SimpleIdentifier  InterpolationExpression  StringInterpolation
     addTestSource('main() {String name; print("hello \$^");}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('name', 'String');
       assertSuggestImportedClass('Object');
     });
@@ -1524,7 +1551,7 @@
     // SimpleIdentifier  InterpolationExpression  StringInterpolation
     addTestSource('main() {String name; print("hello \${n^}");}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('name', 'String');
       assertSuggestImportedClass('Object');
     });
@@ -1534,7 +1561,7 @@
     // SimpleIdentifier  PrefixedIdentifier  InterpolationExpression
     addTestSource('main() {String name; print("hello \${name.^}");}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('length', 'int');
       assertNotSuggested('name');
       assertNotSuggested('Object');
@@ -1546,7 +1573,7 @@
     // SimpleIdentifier  PrefixedIdentifier  InterpolationExpression
     addTestSource('main() {String name; print("hello \${nam^e.length}");}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('name', 'String');
       assertSuggestImportedClass('Object');
       assertNotSuggested('length');
@@ -1564,7 +1591,7 @@
       class Y {Y.c(); Y._d(); z() {}}
       main() {var x; if (x is ^) { }}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('X');
       assertSuggestLocalClass('Y');
       assertNotSuggested('x');
@@ -1581,7 +1608,7 @@
       class A {int x; int y() => 0;}
       main(){var a; if (^ is A)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalVariable('a', null);
       assertSuggestLocalFunction('main', null);
       assertSuggestLocalFunction('foo', null);
@@ -1597,7 +1624,7 @@
       class A {int x; int y() => 0;}
       main(){var a; if (a is ^)}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNotSuggested('a');
       assertNotSuggested('main');
       assertSuggestLocalClass('A');
@@ -1609,7 +1636,7 @@
     // SimpleStringLiteral  ExpressionStatement  Block
     addTestSource('class A {a() {"hel^lo"}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1618,7 +1645,7 @@
     // Block  BlockFunctionBody  MethodDeclaration
     addTestSource('class A {@deprecated X get f => 0; Z a() {^} get _g => 1;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       CompletionSuggestion methodA = assertSuggestLocalMethod('a', 'A', 'Z');
       if (methodA != null) {
         expect(methodA.element.isDeprecated, isFalse);
@@ -1642,7 +1669,7 @@
     // Block  BlockFunctionBody  MethodDeclaration
     addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z');
       if (methodA != null) {
         expect(methodA.element.isDeprecated, isFalse);
@@ -1667,7 +1694,7 @@
     // Block  BlockFunctionBody  MethodDeclaration
     addTestSource('class A {@deprecated Z a(X x, _, b, {y: boo}) {^}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       CompletionSuggestion methodA =
           assertSuggestLocalMethod('a', 'A', 'Z', CompletionRelevance.LOW);
       if (methodA != null) {
@@ -1689,7 +1716,7 @@
       void bar() { }
       class A {Z a(X x, [int y=1]) {^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestLocalFunction('foo', null);
       assertSuggestLocalFunction('bar', 'void');
       assertSuggestLocalMethod('a', 'A', 'Z');
@@ -1712,7 +1739,7 @@
         m(X x) {} I _n(X x) {}}
       class X{}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('f', 'X');
       assertSuggestInvocationGetter('_g', null);
       assertNotSuggested('b');
@@ -1753,7 +1780,7 @@
         w() { }}
       main() {A.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('scA', 'String');
       assertSuggestInvocationGetter('scB', 'int');
       assertSuggestInvocationGetter('scI', null);
@@ -1792,7 +1819,7 @@
       import "/testB.dart";
       main() {A a; a.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('sc', 'int');
       assertSuggestInvocationGetter('b', null, isDeprecated: true);
       assertNotSuggested('_c');
@@ -1825,7 +1852,7 @@
         m(X x) {} I _n(X x) {}}
       class X{}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('sc', 'int');
       assertSuggestInvocationGetter('b', null);
       assertSuggestInvocationGetter('_c', 'X');
@@ -1858,7 +1885,7 @@
       class A { }
       main() {b.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationClass('X');
       assertSuggestInvocationClass('Y');
       assertSuggestInvocationTopLevelVar('T1', null);
@@ -1881,7 +1908,7 @@
       import "/testB.dart";
       foo(X x) {x.^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('y', 'M');
       assertNotSuggested('_z');
       assertNotSuggested('==');
@@ -1897,7 +1924,7 @@
       import "/testA.dart";
       class X {foo(){A^.bar}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('A');
       assertSuggestLocalClass('X');
       assertSuggestLocalMethod('foo', 'X', null);
@@ -1910,7 +1937,7 @@
     // PrefixedIdentifier  ExpressionStatement  Block  BlockFunctionBody
     addTestSource('class A {String x; int get foo {x.^}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('isEmpty', 'bool');
       assertSuggestInvocationMethod('compareTo', 'Comparable', 'int');
     });
@@ -1920,7 +1947,7 @@
     // SimpleIdentifier  MethodInvocation  PropertyAccess  ExpressionStatement
     addTestSource('class A {a() {"hello".to^String().length}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('length', 'int');
       assertNotSuggested('A');
       assertNotSuggested('a');
@@ -1933,7 +1960,7 @@
     // SimpleIdentifier  PropertyAccess  ExpressionStatement  Block
     addTestSource('class A {a() {"hello".length.^}}');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestInvocationGetter('isEven', 'bool');
       assertNotSuggested('A');
       assertNotSuggested('a');
@@ -1947,7 +1974,7 @@
     // TopLevelVariableDeclaration
     addTestSource('class A {} B ^');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1957,7 +1984,7 @@
     // TopLevelVariableDeclaration
     addTestSource('class A {} var ^');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1975,7 +2002,7 @@
       class Y {Y.c(); Y._d(); z() {}}
       main() {var ^}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertNoSuggestions();
     });
   }
@@ -1993,7 +2020,7 @@
       class Y {Y.c(); Y._d(); z() {}}
       class C {bar(){var f; {var x;} var e = ^}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('X');
       assertNotSuggested('_B');
       assertSuggestLocalClass('Y');
@@ -2020,7 +2047,7 @@
       class Y {Y.c(); Y._d(); z() {}}
       class C {bar(){var f; {var x;} var e = ^ var g}}''');
     computeFast();
-    return computeFull(true).then((_) {
+    return computeFull((bool result) {
       assertSuggestImportedClass('X');
       assertSuggestImportedFunction('foo1', null);
       assertNotSuggested('bar1');
diff --git a/pkg/analysis_server/test/services/completion/imported_computer_test.dart b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
index 80b2367..0f1ae4d 100644
--- a/pkg/analysis_server/test/services/completion/imported_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
@@ -4,7 +4,11 @@
 
 library test.services.completion.toplevel;
 
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/imported_computer.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../reflective_tests.dart';
@@ -12,15 +16,130 @@
 
 main() {
   groupSep = ' | ';
-  runReflectiveTests(ImportedTypeComputerTest);
+  runReflectiveTests(ImportedComputerTest);
 }
 
 @ReflectiveTestCase()
-class ImportedTypeComputerTest extends AbstractSelectorSuggestionTest {
+class ImportedComputerTest extends AbstractSelectorSuggestionTest {
+
+  void assertCached(String completion) {
+    DartCompletionCache cache = request.cache;
+    if (!isCached(cache.importedTypeSuggestions, completion) &&
+        !isCached(cache.importedVoidReturnSuggestions, completion) &&
+        !isCached(cache.libraryPrefixSuggestions, completion) &&
+        !isCached(cache.otherImportedSuggestions, completion)) {
+      fail('expected $completion to be cached');
+    }
+  }
+
+  /**
+   * Assert that the ImportedComputer uses cached results to produce identical
+   * suggestions to the original set of suggestions.
+   */
+  @override
+  void assertCachedCompute(_) {
+    expect(request.unit.element, isNotNull);
+    List<CompletionSuggestion> oldSuggestions = request.suggestions;
+    /*
+     * Simulate a source change to flush the cached compilation unit
+     */
+    ChangeSet changes = new ChangeSet();
+    changes.addedSource(testSource);
+    context.applyChanges(changes);
+    /*
+     * Calculate a new completion at the same location
+     */
+    setUpComputer();
+    request = new DartCompletionRequest(
+        context,
+        searchEngine,
+        testSource,
+        completionOffset,
+        cache);
+    expect(computeFast(), isTrue);
+    expect(request.unit.element, isNull);
+    List<CompletionSuggestion> newSuggestions = request.suggestions;
+    if (newSuggestions.length == oldSuggestions.length) {
+      if (!oldSuggestions.any(
+          (CompletionSuggestion s) => !newSuggestions.contains(s))) {
+        return;
+      }
+    }
+    StringBuffer sb = new StringBuffer(
+        'suggestions based upon cached results do not match expectations');
+    sb.write('\n  Expected:');
+    oldSuggestions.toList()
+        ..sort(suggestionComparator)
+        ..forEach((CompletionSuggestion suggestion) {
+          sb.write('\n    ${suggestion.completion} -> $suggestion');
+        });
+    sb.write('\n  Actual:');
+    newSuggestions.toList()
+        ..sort(suggestionComparator)
+        ..forEach((CompletionSuggestion suggestion) {
+          sb.write('\n    ${suggestion.completion} -> $suggestion');
+        });
+    fail(sb.toString());
+  }
+
+  void assertNotCached(String completion) {
+    DartCompletionCache cache = request.cache;
+    if (isCached(cache.importedTypeSuggestions, completion) ||
+        isCached(cache.importedVoidReturnSuggestions, completion) ||
+        isCached(cache.libraryPrefixSuggestions, completion) ||
+        isCached(cache.otherImportedSuggestions, completion)) {
+      fail('expected $completion NOT to be cached');
+    }
+  }
+
+  bool isCached(List<CompletionSuggestion> suggestions, String completion) =>
+      suggestions.any((CompletionSuggestion s) => s.completion == completion);
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new ImportedComputer();
   }
+
+  @override
+  test_ArgumentList() {
+    return super.test_ArgumentList().then((_) {
+      expect(request.cache.importKey, "import '/libA.dart';");
+    });
+  }
+
+  @override
+  test_ArgumentList_imported_function() {
+    return super.test_ArgumentList_imported_function().then((_) {
+      expect(request.cache.importKey, "import '/libA.dart';");
+    });
+  }
+
+  @override
+  test_AssignmentExpression_RHS() {
+    return super.test_AssignmentExpression_RHS().then((_) {
+      expect(request.cache.importKey, '');
+    });
+  }
+
+  @override
+  test_Block() {
+    return super.test_Block().then((_) {
+      expect(
+          request.cache.importKey,
+          'import "/testAB.dart";import "/testCD.dart" hide D;import "/testEEF.dart" show EE;import "/testG.dart" as g;');
+      assertCached('A');
+      assertCached('T3');
+    });
+  }
+
+  @override
+  test_Block_inherited_imported() {
+    return super.test_Block_inherited_imported().then((_) {
+      assertCached('E');
+      assertCached('F');
+      assertNotCached('e1');
+      assertNotCached('i2');
+      assertNotCached('m1');
+    });
+  }
 }
diff --git a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
index 7c7d893..97c703d 100644
--- a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
@@ -20,8 +20,7 @@
 class InvocationComputerTest extends AbstractSelectorSuggestionTest {
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new InvocationComputer();
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
index 558fbdf..f6d7fed 100644
--- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
@@ -60,8 +60,7 @@
   }
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new KeywordComputer();
   }
 
diff --git a/pkg/analysis_server/test/services/completion/local_computer_test.dart b/pkg/analysis_server/test/services/completion/local_computer_test.dart
index 7836bb7..17c1f37 100644
--- a/pkg/analysis_server/test/services/completion/local_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_computer_test.dart
@@ -19,8 +19,7 @@
 class LocalComputerTest extends AbstractSelectorSuggestionTest {
 
   @override
-  void setUp() {
-    super.setUp();
+  void setUpComputer() {
     computer = new LocalComputer();
   }
 }
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index c344e0b..e5916c7 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -362,6 +362,23 @@
 ''');
   }
 
+  void test_addTypeAnnotation_local_OK_localType() {
+    _indexTestUnit('''
+class C {}
+C f() => null;
+main() {
+  var x = f();
+}
+''');
+    assertHasAssistAt('x =', AssistKind.ADD_TYPE_ANNOTATION, '''
+class C {}
+C f() => null;
+main() {
+  C x = f();
+}
+''');
+  }
+
   void test_addTypeAnnotation_local_OK_onInitializer() {
     _indexTestUnit('''
 main() {
@@ -989,6 +1006,27 @@
     assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
   }
 
+  void test_exchangeBinaryExpressionArguments_OK_compare() {
+    Map<String, String> operatorMap = {
+      '<': '>=',
+      '<=': '>',
+      '>': '<=',
+      '>=': '<'
+    };
+    operatorMap.forEach((initialOperator, resultOperator) {
+      _indexTestUnit('''
+bool main(int a, int b) {
+  return a $initialOperator b;
+}
+''');
+      assertHasAssistAt(initialOperator, AssistKind.EXCHANGE_OPERANDS, '''
+bool main(int a, int b) {
+  return b $resultOperator a;
+}
+''');
+    });
+  }
+
   void test_exchangeBinaryExpressionArguments_OK_extended_mixOperator_1() {
     _indexTestUnit('''
 main() {
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index 6326f11..c880a09 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -195,16 +195,6 @@
 
 @ReflectiveTestCase()
 class FileEditTest {
-  void test_addAll() {
-    SourceEdit edit1a = new SourceEdit(1, 0, 'a1');
-    SourceEdit edit1b = new SourceEdit(1, 0, 'a2');
-    SourceEdit edit10 = new SourceEdit(10, 1, 'b');
-    SourceEdit edit100 = new SourceEdit(100, 2, 'c');
-    SourceFileEdit fileEdit = new SourceFileEdit('/test.dart', 0);
-    fileEdit.addAll([edit100, edit1a, edit10, edit1b]);
-    expect(fileEdit.edits, [edit100, edit10, edit1b, edit1a]);
-  }
-
   void test_add_sorts() {
     SourceEdit edit1a = new SourceEdit(1, 0, 'a1');
     SourceEdit edit1b = new SourceEdit(1, 0, 'a2');
@@ -218,6 +208,16 @@
     expect(fileEdit.edits, [edit100, edit10, edit1b, edit1a]);
   }
 
+  void test_addAll() {
+    SourceEdit edit1a = new SourceEdit(1, 0, 'a1');
+    SourceEdit edit1b = new SourceEdit(1, 0, 'a2');
+    SourceEdit edit10 = new SourceEdit(10, 1, 'b');
+    SourceEdit edit100 = new SourceEdit(100, 2, 'c');
+    SourceFileEdit fileEdit = new SourceFileEdit('/test.dart', 0);
+    fileEdit.addAll([edit100, edit1a, edit10, edit1b]);
+    expect(fileEdit.edits, [edit100, edit10, edit1b, edit1a]);
+  }
+
   void test_new() {
     SourceFileEdit fileEdit = new SourceFileEdit('/test.dart', 100);
     fileEdit.add(new SourceEdit(1, 2, 'aaa'));
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index e6d1604..625be28 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -233,6 +233,9 @@
   new A.named(1, 2.0);
 }
 ''');
+    _assertLinkedGroup(
+        change.linkedEditGroups[0],
+        ['named(int ', 'named(1']);
   }
 
   void test_createConstructorSuperExplicit() {
@@ -442,6 +445,30 @@
 ''');
   }
 
+  void test_createField_getter_qualified_instance_dynamicType() {
+    _indexTestUnit('''
+class A {
+  B b;
+  void f(Object p) {
+    p == b.test;
+  }
+}
+class B {
+}
+''');
+    assertHasFix(FixKind.CREATE_FIELD, '''
+class A {
+  B b;
+  void f(Object p) {
+    p == b.test;
+  }
+}
+class B {
+  var test;
+}
+''');
+  }
+
   void test_createField_getter_unqualified_instance_asInvocationArgument() {
     _indexTestUnit('''
 class A {
@@ -2304,7 +2331,9 @@
   AnalysisError _findErrorToFix() {
     List<AnalysisError> errors = context.computeErrors(testSource);
     errors.removeWhere((error) {
-      return error.errorCode == HintCode.UNUSED_LOCAL_VARIABLE;
+      return error.errorCode == HintCode.UNUSED_ELEMENT ||
+          error.errorCode == HintCode.UNUSED_FIELD ||
+          error.errorCode == HintCode.UNUSED_LOCAL_VARIABLE;
     });
     if (checkHasSingleError) {
       expect(errors, hasLength(1));
diff --git a/pkg/analysis_server/test/services/correction/levenshtein_test.dart b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
index f204d3b..b810ee6 100644
--- a/pkg/analysis_server/test/services/correction/levenshtein_test.dart
+++ b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
@@ -5,9 +5,10 @@
 library test.services.correction.levenshtein;
 
 import 'package:analysis_server/src/services/correction/levenshtein.dart';
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
@@ -65,4 +66,4 @@
   void test_same_caseInsensitive() {
     expect(levenshtein('test', 'Test', 5, caseSensitive: false), 0);
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/services/correction/sort_members_test.dart b/pkg/analysis_server/test/services/correction/sort_members_test.dart
index 6654be3..1d0a975 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -370,6 +370,20 @@
 ''');
   }
 
+  void test_unitMembers_class_ignoreCase() {
+    _parseTestUnit(r'''
+class C {}
+class a {}
+class B {}
+''');
+    // validate change
+    _assertSort(r'''
+class a {}
+class B {}
+class C {}
+''');
+  }
+
   void test_unitMembers_classTypeAlias() {
     _parseTestUnit(r'''
 class M {}
@@ -386,20 +400,6 @@
 ''');
   }
 
-  void test_unitMembers_class_ignoreCase() {
-    _parseTestUnit(r'''
-class C {}
-class a {}
-class B {}
-''');
-    // validate change
-    _assertSort(r'''
-class a {}
-class B {}
-class C {}
-''');
-  }
-
   void test_unitMembers_directive_hasDirective() {
     _parseTestUnit(r'''
 library lib;
@@ -478,6 +478,29 @@
 ''');
   }
 
+  void test_unitMembers_importsAndDeclarations() {
+    _parseTestUnit(r'''
+import 'dart:a';
+import 'package:b';
+
+main() {
+}
+
+f() => null;
+''');
+    // validate change
+    _assertSort(r'''
+import 'dart:a';
+
+import 'package:b';
+
+f() => null;
+
+main() {
+}
+''');
+  }
+
   void test_unitMembers_mix() {
     _parseTestUnit(r'''
 _mmm() {}
diff --git a/pkg/analysis_server/test/services/correction/source_range_test.dart b/pkg/analysis_server/test/services/correction/source_range_test.dart
index 2e5bad1..cd4a12c 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -5,8 +5,6 @@
 library test.services.correction.source_range;
 
 import 'package:analysis_server/src/services/correction/source_range.dart';
-import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/error.dart';
@@ -14,6 +12,9 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../abstract_single_unit.dart';
+import '../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/services/correction/test_all.dart b/pkg/analysis_server/test/services/correction/test_all.dart
index 197ee67..3f3b03e 100644
--- a/pkg/analysis_server/test/services/correction/test_all.dart
+++ b/pkg/analysis_server/test/services/correction/test_all.dart
@@ -30,4 +30,4 @@
     status_test.main();
     strings_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index 0d1970a..a146312 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -85,208 +85,6 @@
     });
   }
 
-  void test_NameElement_field() {
-    _indexTestUnit('''
-class A {
-  int field;
-}
-main(A a, p) {
-  print(a.field); // r
-  print(p.field); // ur
-  {
-    var field = 42;
-    print(field); // not a member
-  }
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    FieldElement fieldElement = findElement('field');
-    Element nameElement = new NameElement('field');
-    // verify
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(fieldElement, 'field;'));
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.IS_READ_BY,
-        _expectedLocationQ(mainElement, 'field); // r'));
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.IS_READ_BY,
-        _expectedLocationQU(mainElement, 'field); // ur'));
-    _assertNoRecordedRelation(
-        nameElement,
-        IndexConstants.IS_READ_BY,
-        _expectedLocation(mainElement, 'field); // not a member'));
-  }
-
-  void test_NameElement_isDefinedBy_localVariable_inForEach() {
-    _indexTestUnit('''
-class A {
-  main() {
-    for (int test in []) {
-    }
-  }
-}
-''');
-    // prepare elements
-    LocalVariableElement testElement = findElement('test');
-    Element nameElement = new NameElement('test');
-    // verify
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(testElement, 'test in []'));
-  }
-
-  void test_NameElement_method() {
-    _indexTestUnit('''
-class A {
-  method() {}
-}
-main(A a, p) {
-  a.method(); // r
-  p.method(); // ur
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    MethodElement methodElement = findElement('method');
-    Element nameElement = new NameElement('method');
-    // verify
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(methodElement, 'method() {}'));
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, 'method(); // r'));
-    _assertRecordedRelation(
-        nameElement,
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, 'method(); // ur'));
-  }
-
-  void test_NameElement_operator_resolved() {
-    _indexTestUnit('''
-class A {
-  operator +(o) {}
-  operator -(o) {}
-  operator ~() {}
-  operator ==(o) {}
-}
-main(A a) {
-  a + 5;
-  a += 5;
-  a == 5;
-  ++a;
-  --a;
-  ~a;
-  a++;
-  a--;
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    // binary
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '+ 5', length: 1));
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '+= 5', length: 2));
-    _assertRecordedRelation(
-        new NameElement('=='),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '== 5', length: 2));
-    // prefix
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '++a', length: 2));
-    _assertRecordedRelation(
-        new NameElement('-'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '--a', length: 2));
-    _assertRecordedRelation(
-        new NameElement('~'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '~a', length: 1));
-    // postfix
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '++;', length: 2));
-    _assertRecordedRelation(
-        new NameElement('-'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '--;', length: 2));
-  }
-
-
-  void test_NameElement_operator_unresolved() {
-    _indexTestUnit('''
-class A {
-  operator +(o) {}
-  operator -(o) {}
-  operator ~() {}
-  operator ==(o) {}
-}
-main(a) {
-  a + 5;
-  a += 5;
-  a == 5;
-  ++a;
-  --a;
-  ~a;
-  a++;
-  a--;
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    // binary
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '+ 5', length: 1));
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '+= 5', length: 2));
-    _assertRecordedRelation(
-        new NameElement('=='),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '== 5', length: 2));
-    // prefix
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '++a', length: 2));
-    _assertRecordedRelation(
-        new NameElement('-'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '--a', length: 2));
-    _assertRecordedRelation(
-        new NameElement('~'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '~a', length: 1));
-    // postfix
-    _assertRecordedRelation(
-        new NameElement('+'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '++;', length: 2));
-    _assertRecordedRelation(
-        new NameElement('-'),
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '--;', length: 2));
-  }
-
   void test_definesClass() {
     _indexTestUnit('class A {}');
     // prepare elements
@@ -297,16 +95,6 @@
         _expectedLocation(classElement, 'A {}'));
   }
 
-  void test_definesClassEnum() {
-    _indexTestUnit('enum MyEnum {A, B, c}');
-    // prepare elements
-    ClassElement classElement = findElement("MyEnum");
-    // verify
-    _assertDefinesTopLevelElement(
-        IndexConstants.DEFINES,
-        _expectedLocation(classElement, 'MyEnum {'));
-  }
-
   void test_definesClassAlias() {
     _indexTestUnit('''
 class Mix {}
@@ -319,6 +107,16 @@
         _expectedLocation(classElement, 'MyClass ='));
   }
 
+  void test_definesClassEnum() {
+    _indexTestUnit('enum MyEnum {A, B, c}');
+    // prepare elements
+    ClassElement classElement = findElement("MyEnum");
+    // verify
+    _assertDefinesTopLevelElement(
+        IndexConstants.DEFINES,
+        _expectedLocation(classElement, 'MyEnum {'));
+  }
+
   void test_definesFunction() {
     _indexTestUnit('myFunction() {}');
     // prepare elements
@@ -404,6 +202,7 @@
         _expectedLocation(methodElement, 'm() {}'));
   }
 
+
   void test_isDefinedBy_NameElement_operator() {
     _indexTestUnit('''
 class A {
@@ -419,7 +218,6 @@
         _expectedLocation(methodElement, '+(o) {}', length: 1));
   }
 
-
   void test_isExtendedBy_ClassDeclaration() {
     _indexTestUnit('''
 class A {} // 1
@@ -449,7 +247,6 @@
         _expectedLocation(classElementA, 'A {}', length: 0));
   }
 
-
   void test_isExtendedBy_ClassTypeAlias() {
     _indexTestUnit('''
 class A {} // 1
@@ -497,6 +294,7 @@
         _expectedLocation(classElementC, 'B; // 3'));
   }
 
+
   void test_isInvokedBy_FieldElement() {
     _indexTestUnit('''
 class A {
@@ -547,6 +345,7 @@
         _expectedLocation(mainElement, 'foo(); // nq'));
   }
 
+
   void test_isInvokedBy_LocalVariableElement() {
     _indexTestUnit('''
 main() {
@@ -606,21 +405,6 @@
         _expectedLocationQ(mainElement, 'foo();'));
   }
 
-  void test_isInvokedBy_ParameterElement() {
-    _indexTestUnit('''
-main(p()) {
-  p();
-}''');
-    // prepare elements
-    Element mainElement = findElement("main");
-    Element element = findElement("p");
-    // verify
-    _assertRecordedRelation(
-        element,
-        IndexConstants.IS_INVOKED_BY,
-        _expectedLocation(mainElement, 'p();'));
-  }
-
   void test_isInvokedBy_operator_binary() {
     _indexTestUnit('''
 class A {
@@ -700,6 +484,21 @@
         _expectedLocationQ(mainElement, '~a', length: 1));
   }
 
+  void test_isInvokedBy_ParameterElement() {
+    _indexTestUnit('''
+main(p()) {
+  p();
+}''');
+    // prepare elements
+    Element mainElement = findElement("main");
+    Element element = findElement("p");
+    // verify
+    _assertRecordedRelation(
+        element,
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocation(mainElement, 'p();'));
+  }
+
   void test_isMixedInBy_ClassDeclaration() {
     _indexTestUnit('''
 class A {} // 1
@@ -1105,6 +904,33 @@
         _expectedLocation(pElement, 'A p) {'));
   }
 
+  /**
+   * There was a bug in the AST structure, when single [Comment] was cloned and
+   * assigned to both [FieldDeclaration] and [VariableDeclaration].
+   *
+   * This caused duplicate indexing.
+   * Here we test that the problem is fixed one way or another.
+   */
+  void test_isReferencedBy_identifierInComment() {
+    _indexTestUnit('''
+class A {}
+/// [A] text
+var myVariable = null;
+''');
+    // prepare elements
+    Element aElement = findElement('A');
+    Element variableElement = findElement('myVariable');
+    // verify
+    _assertRecordedRelation(
+        aElement,
+        IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(testUnitElement, 'A] text'));
+    _assertNoRecordedRelation(
+        aElement,
+        IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(variableElement, 'A] text'));
+  }
+
   void test_isReferencedBy_ImportElement_noPrefix() {
     addSource('/lib.dart', '''
 library lib;
@@ -1307,6 +1133,24 @@
         _expectedLocation(mainElement, 'L;'));
   }
 
+  void test_isReferencedBy_libraryName() {
+    Source libSource = addSource('/lib.dart', '''
+library lib;
+part 'test.dart';
+''');
+    testCode = 'part of lib;';
+    testSource = addSource('/test.dart', testCode);
+    testUnit = resolveDartUnit(testSource, libSource);
+    testUnitElement = testUnit.element;
+    testLibraryElement = testUnitElement.library;
+    indexDartUnit(store, context, testUnit);
+    // verify
+    _assertRecordedRelation(
+        testLibraryElement,
+        IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(testUnitElement, "lib;"));
+  }
+
   void test_isReferencedBy_MethodElement() {
     _indexTestUnit('''
 class A {
@@ -1411,6 +1255,21 @@
         _expectedLocation(mainElement, 'V); // nq'));
   }
 
+  void test_isReferencedBy_typeInVariableList() {
+    _indexTestUnit('''
+class A {}
+A myVariable = null;
+''');
+    // prepare elements
+    Element classElementA = findElement('A');
+    Element variableElement = findElement('myVariable');
+    // verify
+    _assertRecordedRelation(
+        classElementA,
+        IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(variableElement, 'A myVariable'));
+  }
+
   void test_isReferencedBy_TypeParameterElement() {
     _indexTestUnit('''
 class A<T> {
@@ -1440,66 +1299,6 @@
         _expectedLocation(variableElement, 'T v'));
   }
 
-  /**
-   * There was a bug in the AST structure, when single [Comment] was cloned and
-   * assigned to both [FieldDeclaration] and [VariableDeclaration].
-   *
-   * This caused duplicate indexing.
-   * Here we test that the problem is fixed one way or another.
-   */
-  void test_isReferencedBy_identifierInComment() {
-    _indexTestUnit('''
-class A {}
-/// [A] text
-var myVariable = null;
-''');
-    // prepare elements
-    Element aElement = findElement('A');
-    Element variableElement = findElement('myVariable');
-    // verify
-    _assertRecordedRelation(
-        aElement,
-        IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(testUnitElement, 'A] text'));
-    _assertNoRecordedRelation(
-        aElement,
-        IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(variableElement, 'A] text'));
-  }
-
-  void test_isReferencedBy_libraryName() {
-    Source libSource = addSource('/lib.dart', '''
-library lib;
-part 'test.dart';
-''');
-    testCode = 'part of lib;';
-    testSource = addSource('/test.dart', testCode);
-    testUnit = resolveDartUnit(testSource, libSource);
-    testUnitElement = testUnit.element;
-    testLibraryElement = testUnitElement.library;
-    indexDartUnit(store, context, testUnit);
-    // verify
-    _assertRecordedRelation(
-        testLibraryElement,
-        IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(testUnitElement, "lib;"));
-  }
-
-  void test_isReferencedBy_typeInVariableList() {
-    _indexTestUnit('''
-class A {}
-A myVariable = null;
-''');
-    // prepare elements
-    Element classElementA = findElement('A');
-    Element variableElement = findElement('myVariable');
-    // verify
-    _assertRecordedRelation(
-        classElementA,
-        IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(variableElement, 'A myVariable'));
-  }
-
   void test_isWrittenBy_ParameterElement() {
     _indexTestUnit('''
 main(var p) {
@@ -1531,6 +1330,207 @@
         _expectedLocation(mainElement, 'v = 1'));
   }
 
+  void test_NameElement_field() {
+    _indexTestUnit('''
+class A {
+  int field;
+}
+main(A a, p) {
+  print(a.field); // r
+  print(p.field); // ur
+  {
+    var field = 42;
+    print(field); // not a member
+  }
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    FieldElement fieldElement = findElement('field');
+    Element nameElement = new NameElement('field');
+    // verify
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(fieldElement, 'field;'));
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.IS_READ_BY,
+        _expectedLocationQ(mainElement, 'field); // r'));
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.IS_READ_BY,
+        _expectedLocationQU(mainElement, 'field); // ur'));
+    _assertNoRecordedRelation(
+        nameElement,
+        IndexConstants.IS_READ_BY,
+        _expectedLocation(mainElement, 'field); // not a member'));
+  }
+
+  void test_NameElement_isDefinedBy_localVariable_inForEach() {
+    _indexTestUnit('''
+class A {
+  main() {
+    for (int test in []) {
+    }
+  }
+}
+''');
+    // prepare elements
+    LocalVariableElement testElement = findElement('test');
+    Element nameElement = new NameElement('test');
+    // verify
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(testElement, 'test in []'));
+  }
+
+  void test_NameElement_method() {
+    _indexTestUnit('''
+class A {
+  method() {}
+}
+main(A a, p) {
+  a.method(); // r
+  p.method(); // ur
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    MethodElement methodElement = findElement('method');
+    Element nameElement = new NameElement('method');
+    // verify
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(methodElement, 'method() {}'));
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, 'method(); // r'));
+    _assertRecordedRelation(
+        nameElement,
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, 'method(); // ur'));
+  }
+
+  void test_NameElement_operator_resolved() {
+    _indexTestUnit('''
+class A {
+  operator +(o) {}
+  operator -(o) {}
+  operator ~() {}
+  operator ==(o) {}
+}
+main(A a) {
+  a + 5;
+  a += 5;
+  a == 5;
+  ++a;
+  --a;
+  ~a;
+  a++;
+  a--;
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    // binary
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '+ 5', length: 1));
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '+= 5', length: 2));
+    _assertRecordedRelation(
+        new NameElement('=='),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '== 5', length: 2));
+    // prefix
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '++a', length: 2));
+    _assertRecordedRelation(
+        new NameElement('-'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '--a', length: 2));
+    _assertRecordedRelation(
+        new NameElement('~'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '~a', length: 1));
+    // postfix
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '++;', length: 2));
+    _assertRecordedRelation(
+        new NameElement('-'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '--;', length: 2));
+  }
+
+  void test_NameElement_operator_unresolved() {
+    _indexTestUnit('''
+class A {
+  operator +(o) {}
+  operator -(o) {}
+  operator ~() {}
+  operator ==(o) {}
+}
+main(a) {
+  a + 5;
+  a += 5;
+  a == 5;
+  ++a;
+  --a;
+  ~a;
+  a++;
+  a--;
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    // binary
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '+ 5', length: 1));
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '+= 5', length: 2));
+    _assertRecordedRelation(
+        new NameElement('=='),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '== 5', length: 2));
+    // prefix
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '++a', length: 2));
+    _assertRecordedRelation(
+        new NameElement('-'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '--a', length: 2));
+    _assertRecordedRelation(
+        new NameElement('~'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '~a', length: 1));
+    // postfix
+    _assertRecordedRelation(
+        new NameElement('+'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '++;', length: 2));
+    _assertRecordedRelation(
+        new NameElement('-'),
+        IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '--;', length: 2));
+  }
+
   void test_nameIsInvokedBy() {
     _indexTestUnit('''
 class A {
diff --git a/pkg/analysis_server/test/services/index/local_index_test.dart b/pkg/analysis_server/test/services/index/local_index_test.dart
index b6adb85..6bf1f2a 100644
--- a/pkg/analysis_server/test/services/index/local_index_test.dart
+++ b/pkg/analysis_server/test/services/index/local_index_test.dart
@@ -7,15 +7,15 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
-import '../../abstract_context.dart';
-import '../../reflective_tests.dart';
+import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/html.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../abstract_context.dart';
+import '../../reflective_tests.dart';
 import 'store/single_source_container.dart';
 
 
diff --git a/pkg/analysis_server/test/services/index/store/codec_test.dart b/pkg/analysis_server/test/services/index/store/codec_test.dart
index 50da075..9903b1f 100644
--- a/pkg/analysis_server/test/services/index/store/codec_test.dart
+++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
@@ -6,13 +6,14 @@
 
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/store/codec.dart';
-import '../../../abstract_single_unit.dart';
-import '../../../mocks.dart';
-import '../../../reflective_tests.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../abstract_single_unit.dart';
+import '../../../mocks.dart';
+import '../../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/services/index/store/collection_test.dart b/pkg/analysis_server/test/services/index/store/collection_test.dart
index 9604864..e8ce718 100644
--- a/pkg/analysis_server/test/services/index/store/collection_test.dart
+++ b/pkg/analysis_server/test/services/index/store/collection_test.dart
@@ -5,9 +5,10 @@
 library test.services.src.index.store.collection;
 
 import 'package:analysis_server/src/services/index/store/collection.dart';
-import '../../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/services/index/store/split_store_test.dart b/pkg/analysis_server/test/services/index/store/split_store_test.dart
index 68b7eb3..ba994ac 100644
--- a/pkg/analysis_server/test/services/index/store/split_store_test.dart
+++ b/pkg/analysis_server/test/services/index/store/split_store_test.dart
@@ -10,14 +10,14 @@
 import 'package:analysis_server/src/services/index/store/codec.dart';
 import 'package:analysis_server/src/services/index/store/memory_node_manager.dart';
 import 'package:analysis_server/src/services/index/store/split_store.dart';
-import '../../../mocks.dart';
-import '../../../reflective_tests.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:typed_mock/typed_mock.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../mocks.dart';
+import '../../../reflective_tests.dart';
 import 'mocks.dart';
 import 'single_source_container.dart';
 
@@ -32,15 +32,8 @@
 }
 
 
-void _assertHasLocationQ(List<Location> locations, Element element, int offset,
-    int length) {
-  _assertHasLocation(locations, element, offset, length, isQualified: true);
-}
-
-
 void _assertHasLocation(List<Location> locations, Element element, int offset,
-    int length, {bool isQualified: false,
-      bool isResolved: true}) {
+    int length, {bool isQualified: false, bool isResolved: true}) {
   for (Location location in locations) {
     if ((element == null || location.element == element) &&
         location.offset == offset &&
@@ -56,6 +49,12 @@
 }
 
 
+void _assertHasLocationQ(List<Location> locations, Element element, int offset,
+    int length) {
+  _assertHasLocation(locations, element, offset, length, isQualified: true);
+}
+
+
 @ReflectiveTestCase()
 class _FileNodeManagerTest {
   MockLogger logger = new MockLogger();
@@ -459,12 +458,11 @@
     int relationshipId = 1;
     when(relationshipCodec.encode(relationship)).thenReturn(relationshipId);
     // create RelationKeyData
-    RelationKeyData keyData =
-        new RelationKeyData.forObject(
-            elementCodec,
-            relationshipCodec,
-            element,
-            relationship);
+    RelationKeyData keyData = new RelationKeyData.forObject(
+        elementCodec,
+        relationshipCodec,
+        element,
+        relationship);
     // touch
     keyData.hashCode;
     // equals
diff --git a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
index dbecbe1..f9e2044 100644
--- a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
+++ b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
@@ -7,10 +7,11 @@
 import 'dart:io';
 
 import 'package:analysis_server/src/services/index/store/temporary_folder_file_manager.dart';
-import '../../../reflective_tests.dart';
 import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/services/index/test_all.dart b/pkg/analysis_server/test/services/index/test_all.dart
index 47bae26..ef6face 100644
--- a/pkg/analysis_server/test/services/index/test_all.dart
+++ b/pkg/analysis_server/test/services/index/test_all.dart
@@ -23,4 +23,4 @@
     local_index_test.main();
     store_test_all.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index 6cdb90c..6832e22 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -513,6 +513,38 @@
     });
   }
 
+  test_occurences_differentVariable() {
+    indexTestUnit('''
+main() {
+  {
+    int v = 1;
+    print(v + 1); // marker
+    print(v + 1);
+  }
+  {
+    int v = 2;
+    print(v + 1);
+  }
+}
+''');
+    _createRefactoringWithSuffix('v + 1', '); // marker');
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+main() {
+  {
+    int v = 1;
+    var res = v + 1;
+    print(res); // marker
+    print(res);
+  }
+  {
+    int v = 2;
+    print(v + 1);
+  }
+}
+''');
+  }
+
   test_occurences_disableOccurences() {
     indexTestUnit('''
 int foo() => 42;
@@ -596,38 +628,6 @@
 ''');
   }
 
-  test_occurences_differentVariable() {
-    indexTestUnit('''
-main() {
-  {
-    int v = 1;
-    print(v + 1); // marker
-    print(v + 1);
-  }
-  {
-    int v = 2;
-    print(v + 1);
-  }
-}
-''');
-    _createRefactoringWithSuffix('v + 1', '); // marker');
-    // apply refactoring
-    return _assertSuccessfulRefactoring('''
-main() {
-  {
-    int v = 1;
-    var res = v + 1;
-    print(res); // marker
-    print(res);
-  }
-  {
-    int v = 2;
-    print(v + 1);
-  }
-}
-''');
-  }
-
   test_occurences_useDominator() {
     indexTestUnit('''
 main() {
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index 67e46cc..6ecc3a0 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -2189,6 +2189,126 @@
 ''');
   }
 
+  test_statements_return_multiple_ifElse() {
+    indexTestUnit('''
+num main(bool b) {
+// start
+  if (b) {
+    return 1;
+  } else {
+    return 2.0;
+  }
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+num main(bool b) {
+// start
+  return res(b);
+// end
+}
+
+num res(bool b) {
+  if (b) {
+    return 1;
+  } else {
+    return 2.0;
+  }
+}
+''');
+  }
+
+  test_statements_return_multiple_ifThen() {
+    indexTestUnit('''
+num main(bool b) {
+// start
+  if (b) {
+    return 1;
+  }
+  return 2.0;
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+num main(bool b) {
+// start
+  return res(b);
+// end
+}
+
+num res(bool b) {
+  if (b) {
+    return 1;
+  }
+  return 2.0;
+}
+''');
+  }
+
+  test_statements_return_multiple_ignoreInFunction() {
+    indexTestUnit('''
+int main() {
+// start
+  localFunction() {
+    return 'abc';
+  }
+  return 42;
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+int main() {
+// start
+  return res();
+// end
+}
+
+int res() {
+  localFunction() {
+    return 'abc';
+  }
+  return 42;
+}
+''');
+  }
+
+  test_statements_return_multiple_sameElementDifferentTypeArgs() {
+    indexTestUnit('''
+main(bool b) {
+// start
+  if (b) {
+    return <int>[];
+  } else {
+    return <String>[];
+  }
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+main(bool b) {
+// start
+  return res(b);
+// end
+}
+
+List res(bool b) {
+  if (b) {
+    return <int>[];
+  } else {
+    return <String>[];
+  }
+}
+''');
+  }
+
   test_statements_return_single() {
     indexTestUnit('''
 main() {
diff --git a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
index 5a87e76..62c12a6 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -933,6 +933,40 @@
 ''');
   }
 
+  test_method_this() {
+    indexTestUnit(r'''
+class A {
+  accept(B b) {}
+}
+class B {
+  test(A a) {
+    print(this);
+    a.accept(this);
+  }
+}
+main() {
+  B b = new B();
+  A a = new A();
+  b.test(a);
+}
+''');
+    _createRefactoring('test(A a) {');
+    // validate change
+    return _assertSuccessfulRefactoring(r'''
+class A {
+  accept(B b) {}
+}
+class B {
+}
+main() {
+  B b = new B();
+  A a = new A();
+  print(b);
+  a.accept(b);
+}
+''');
+  }
+
   test_method_unqualifiedUnvocation() {
     indexTestUnit(r'''
 class A {
diff --git a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
index 6a1b53f..dff5cf8 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -25,22 +25,6 @@
   @override
   Refactoring get refactoring => null;
 
-  void test_validateClassName_OK() {
-    assertRefactoringStatusOK(validateClassName("NewName"));
-  }
-
-  void test_validateClassName_OK_leadingDollar() {
-    assertRefactoringStatusOK(validateClassName("\$NewName"));
-  }
-
-  void test_validateClassName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateClassName("_NewName"));
-  }
-
-  void test_validateClassName_OK_middleDollar() {
-    assertRefactoringStatusOK(validateClassName("New\$Name"));
-  }
-
   void test_validateClassName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateClassName("newName"),
@@ -84,6 +68,22 @@
         expectedMessage: "Class name must not be null.");
   }
 
+  void test_validateClassName_OK() {
+    assertRefactoringStatusOK(validateClassName("NewName"));
+  }
+
+  void test_validateClassName_OK_leadingDollar() {
+    assertRefactoringStatusOK(validateClassName("\$NewName"));
+  }
+
+  void test_validateClassName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateClassName("_NewName"));
+  }
+
+  void test_validateClassName_OK_middleDollar() {
+    assertRefactoringStatusOK(validateClassName("New\$Name"));
+  }
+
   void test_validateClassName_trailingBlanks() {
     assertRefactoringStatus(
         validateClassName("NewName "),
@@ -91,14 +91,6 @@
         expectedMessage: "Class name must not start or end with a blank.");
   }
 
-  void test_validateConstructorName_OK() {
-    assertRefactoringStatusOK(validateConstructorName("newName"));
-  }
-
-  void test_validateConstructorName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateConstructorName("_newName"));
-  }
-
   void test_validateConstructorName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateConstructorName("NewName"),
@@ -139,6 +131,14 @@
         expectedMessage: "Constructor name must not be null.");
   }
 
+  void test_validateConstructorName_OK() {
+    assertRefactoringStatusOK(validateConstructorName("newName"));
+  }
+
+  void test_validateConstructorName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateConstructorName("_newName"));
+  }
+
   void test_validateConstructorName_trailingBlanks() {
     assertRefactoringStatus(
         validateConstructorName("newName "),
@@ -146,18 +146,6 @@
         expectedMessage: "Constructor name must not start or end with a blank.");
   }
 
-  void test_validateFieldName_OK() {
-    assertRefactoringStatusOK(validateFieldName("newName"));
-  }
-
-  void test_validateFieldName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateFieldName("_newName"));
-  }
-
-  void test_validateFieldName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateFieldName("new_name"));
-  }
-
   void test_validateFieldName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateFieldName("NewName"),
@@ -201,6 +189,18 @@
         expectedMessage: "Field name must not be null.");
   }
 
+  void test_validateFieldName_OK() {
+    assertRefactoringStatusOK(validateFieldName("newName"));
+  }
+
+  void test_validateFieldName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateFieldName("_newName"));
+  }
+
+  void test_validateFieldName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateFieldName("new_name"));
+  }
+
   void test_validateFieldName_trailingBlanks() {
     assertRefactoringStatus(
         validateFieldName("newName "),
@@ -208,18 +208,6 @@
         expectedMessage: "Field name must not start or end with a blank.");
   }
 
-  void test_validateFunctionName_OK() {
-    assertRefactoringStatusOK(validateFunctionName("newName"));
-  }
-
-  void test_validateFunctionName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateFunctionName("_newName"));
-  }
-
-  void test_validateFunctionName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateFunctionName("new_name"));
-  }
-
   void test_validateFunctionName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateFunctionName("NewName"),
@@ -263,6 +251,18 @@
         expectedMessage: "Function name must not be null.");
   }
 
+  void test_validateFunctionName_OK() {
+    assertRefactoringStatusOK(validateFunctionName("newName"));
+  }
+
+  void test_validateFunctionName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateFunctionName("_newName"));
+  }
+
+  void test_validateFunctionName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateFunctionName("new_name"));
+  }
+
   void test_validateFunctionName_trailingBlanks() {
     assertRefactoringStatus(
         validateFunctionName("newName "),
@@ -270,22 +270,6 @@
         expectedMessage: "Function name must not start or end with a blank.");
   }
 
-  void test_validateFunctionTypeAliasName_OK() {
-    assertRefactoringStatusOK(validateFunctionTypeAliasName("NewName"));
-  }
-
-  void test_validateFunctionTypeAliasName_OK_leadingDollar() {
-    assertRefactoringStatusOK(validateFunctionTypeAliasName("\$NewName"));
-  }
-
-  void test_validateFunctionTypeAliasName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateFunctionTypeAliasName("_NewName"));
-  }
-
-  void test_validateFunctionTypeAliasName_OK_middleDollar() {
-    assertRefactoringStatusOK(validateFunctionTypeAliasName("New\$Name"));
-  }
-
   void test_validateFunctionTypeAliasName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateFunctionTypeAliasName("newName"),
@@ -331,6 +315,22 @@
         expectedMessage: "Function type alias name must not be null.");
   }
 
+  void test_validateFunctionTypeAliasName_OK() {
+    assertRefactoringStatusOK(validateFunctionTypeAliasName("NewName"));
+  }
+
+  void test_validateFunctionTypeAliasName_OK_leadingDollar() {
+    assertRefactoringStatusOK(validateFunctionTypeAliasName("\$NewName"));
+  }
+
+  void test_validateFunctionTypeAliasName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateFunctionTypeAliasName("_NewName"));
+  }
+
+  void test_validateFunctionTypeAliasName_OK_middleDollar() {
+    assertRefactoringStatusOK(validateFunctionTypeAliasName("New\$Name"));
+  }
+
   void test_validateFunctionTypeAliasName_trailingBlanks() {
     assertRefactoringStatus(
         validateFunctionTypeAliasName("NewName "),
@@ -339,18 +339,6 @@
             "Function type alias name must not start or end with a blank.");
   }
 
-  void test_validateImportPrefixName_OK() {
-    assertRefactoringStatusOK(validateImportPrefixName("newName"));
-  }
-
-  void test_validateImportPrefixName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateImportPrefixName("_newName"));
-  }
-
-  void test_validateImportPrefixName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateImportPrefixName("new_name"));
-  }
-
   void test_validateImportPrefixName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateImportPrefixName("NewName"),
@@ -391,6 +379,18 @@
         expectedMessage: "Import prefix name must not be null.");
   }
 
+  void test_validateImportPrefixName_OK() {
+    assertRefactoringStatusOK(validateImportPrefixName("newName"));
+  }
+
+  void test_validateImportPrefixName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateImportPrefixName("_newName"));
+  }
+
+  void test_validateImportPrefixName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateImportPrefixName("new_name"));
+  }
+
   void test_validateImportPrefixName_trailingBlanks() {
     assertRefactoringStatus(
         validateImportPrefixName("newName "),
@@ -398,22 +398,6 @@
         expectedMessage: "Import prefix name must not start or end with a blank.");
   }
 
-  void test_validateLabelName_OK() {
-    assertRefactoringStatusOK(validateLabelName("newName"));
-  }
-
-  void test_validateLabelName_OK_leadingDollar() {
-    assertRefactoringStatusOK(validateLabelName("\$newName"));
-  }
-
-  void test_validateLabelName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateLabelName("_newName"));
-  }
-
-  void test_validateLabelName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateLabelName("new_name"));
-  }
-
   void test_validateLabelName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateLabelName("NewName"),
@@ -457,6 +441,22 @@
         expectedMessage: "Label name must not be null.");
   }
 
+  void test_validateLabelName_OK() {
+    assertRefactoringStatusOK(validateLabelName("newName"));
+  }
+
+  void test_validateLabelName_OK_leadingDollar() {
+    assertRefactoringStatusOK(validateLabelName("\$newName"));
+  }
+
+  void test_validateLabelName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateLabelName("_newName"));
+  }
+
+  void test_validateLabelName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateLabelName("new_name"));
+  }
+
   void test_validateLabelName_trailingBlanks() {
     assertRefactoringStatus(
         validateLabelName("newName "),
@@ -464,14 +464,6 @@
         expectedMessage: "Label name must not start or end with a blank.");
   }
 
-  void test_validateLibraryName_OK_oneIdentifier() {
-    assertRefactoringStatusOK(validateLibraryName("name"));
-  }
-
-  void test_validateLibraryName_OK_severalIdentifiers() {
-    assertRefactoringStatusOK(validateLibraryName("my.library.name"));
-  }
-
   void test_validateLibraryName_blank() {
     assertRefactoringStatus(
         validateLibraryName(""),
@@ -531,6 +523,14 @@
         expectedMessage: "Library name must not be null.");
   }
 
+  void test_validateLibraryName_OK_oneIdentifier() {
+    assertRefactoringStatusOK(validateLibraryName("name"));
+  }
+
+  void test_validateLibraryName_OK_severalIdentifiers() {
+    assertRefactoringStatusOK(validateLibraryName("my.library.name"));
+  }
+
   void test_validateLibraryName_trailingBlanks() {
     assertRefactoringStatus(
         validateLibraryName("my.bad .name"),
@@ -538,18 +538,6 @@
         expectedMessage: "Library name identifier must not start or end with a blank.");
   }
 
-  void test_validateMethodName_OK() {
-    assertRefactoringStatusOK(validateMethodName("newName"));
-  }
-
-  void test_validateMethodName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateMethodName("_newName"));
-  }
-
-  void test_validateMethodName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateMethodName("new_name"));
-  }
-
   void test_validateMethodName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateMethodName("NewName"),
@@ -593,6 +581,18 @@
         expectedMessage: "Method name must not be null.");
   }
 
+  void test_validateMethodName_OK() {
+    assertRefactoringStatusOK(validateMethodName("newName"));
+  }
+
+  void test_validateMethodName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateMethodName("_newName"));
+  }
+
+  void test_validateMethodName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateMethodName("new_name"));
+  }
+
   void test_validateMethodName_trailingBlanks() {
     assertRefactoringStatus(
         validateMethodName("newName "),
@@ -600,18 +600,6 @@
         expectedMessage: "Method name must not start or end with a blank.");
   }
 
-  void test_validateParameterName_OK() {
-    assertRefactoringStatusOK(validateParameterName("newName"));
-  }
-
-  void test_validateParameterName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateParameterName("_newName"));
-  }
-
-  void test_validateParameterName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateParameterName("new_name"));
-  }
-
   void test_validateParameterName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateParameterName("NewName"),
@@ -655,6 +643,18 @@
         expectedMessage: "Parameter name must not be null.");
   }
 
+  void test_validateParameterName_OK() {
+    assertRefactoringStatusOK(validateParameterName("newName"));
+  }
+
+  void test_validateParameterName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateParameterName("_newName"));
+  }
+
+  void test_validateParameterName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateParameterName("new_name"));
+  }
+
   void test_validateParameterName_trailingBlanks() {
     assertRefactoringStatus(
         validateParameterName("newName "),
@@ -662,22 +662,6 @@
         expectedMessage: "Parameter name must not start or end with a blank.");
   }
 
-  void test_validateVariableName_OK() {
-    assertRefactoringStatusOK(validateVariableName("newName"));
-  }
-
-  void test_validateVariableName_OK_leadingDollar() {
-    assertRefactoringStatusOK(validateVariableName("\$newName"));
-  }
-
-  void test_validateVariableName_OK_leadingUnderscore() {
-    assertRefactoringStatusOK(validateVariableName("_newName"));
-  }
-
-  void test_validateVariableName_OK_middleUnderscore() {
-    assertRefactoringStatusOK(validateVariableName("new_name"));
-  }
-
   void test_validateVariableName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateVariableName("NewName"),
@@ -721,6 +705,22 @@
         expectedMessage: "Variable name must not be null.");
   }
 
+  void test_validateVariableName_OK() {
+    assertRefactoringStatusOK(validateVariableName("newName"));
+  }
+
+  void test_validateVariableName_OK_leadingDollar() {
+    assertRefactoringStatusOK(validateVariableName("\$newName"));
+  }
+
+  void test_validateVariableName_OK_leadingUnderscore() {
+    assertRefactoringStatusOK(validateVariableName("_newName"));
+  }
+
+  void test_validateVariableName_OK_middleUnderscore() {
+    assertRefactoringStatusOK(validateVariableName("new_name"));
+  }
+
   void test_validateVariableName_trailingBlanks() {
     assertRefactoringStatus(
         validateVariableName("newName "),
diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
index d7b1626..5bcee17 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
@@ -5,9 +5,9 @@
 library test.services.refactoring.rename_class_member;
 
 import 'package:analysis_server/src/protocol.dart';
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import 'abstract_rename.dart';
 
 
@@ -19,28 +19,6 @@
 
 @ReflectiveTestCase()
 class RenameClassMemberTest extends RenameRefactoringTest {
-  test_checkFinalConditions_OK_noShadow() {
-    indexTestUnit('''
-class A {
-  int newName;
-}
-class B {
-  test() {}
-}
-class C extends A {
-  main() {
-    print(newName);
-  }
-}
-''');
-    createRenameRefactoringAtString('test() {}');
-    // check status
-    refactoring.newName = 'newName';
-    return refactoring.checkFinalConditions().then((status) {
-      assertRefactoringStatusOK(status);
-    });
-  }
-
   test_checkFinalConditions_hasMember_MethodElement() {
     indexTestUnit('''
 class A {
@@ -60,30 +38,17 @@
     });
   }
 
-  test_checkFinalConditions_shadowed_byLocal_OK_qualifiedReference() {
+  test_checkFinalConditions_OK_noShadow() {
     indexTestUnit('''
 class A {
-  test() {}
-  main() {
-    var newName;
-    this.test(); // marker
-  }
+  int newName;
 }
-''');
-    createRenameRefactoringAtString('test() {}');
-    // check status
-    refactoring.newName = 'newName';
-    return refactoring.checkFinalConditions().then((status) {
-      assertRefactoringStatusOK(status);
-    });
-  }
-
-  test_checkFinalConditions_shadowed_byLocal_OK_renamedNotUsed() {
-    indexTestUnit('''
-class A {
+class B {
   test() {}
+}
+class C extends A {
   main() {
-    var newName;
+    print(newName);
   }
 }
 ''');
@@ -143,6 +108,41 @@
     });
   }
 
+  test_checkFinalConditions_shadowed_byLocal_OK_qualifiedReference() {
+    indexTestUnit('''
+class A {
+  test() {}
+  main() {
+    var newName;
+    this.test(); // marker
+  }
+}
+''');
+    createRenameRefactoringAtString('test() {}');
+    // check status
+    refactoring.newName = 'newName';
+    return refactoring.checkFinalConditions().then((status) {
+      assertRefactoringStatusOK(status);
+    });
+  }
+
+  test_checkFinalConditions_shadowed_byLocal_OK_renamedNotUsed() {
+    indexTestUnit('''
+class A {
+  test() {}
+  main() {
+    var newName;
+  }
+}
+''');
+    createRenameRefactoringAtString('test() {}');
+    // check status
+    refactoring.newName = 'newName';
+    return refactoring.checkFinalConditions().then((status) {
+      assertRefactoringStatusOK(status);
+    });
+  }
+
   test_checkFinalConditions_shadowed_byParameter_inSameClass() {
     indexTestUnit('''
 class A {
@@ -189,30 +189,6 @@
     });
   }
 
-  test_checkFinalConditions_shadowsSuper_MethodElement() {
-    indexTestUnit('''
-class A {
-  test() {}
-}
-class B extends A {
-  newName() {} // marker
-  main() {
-    test();
-  }
-}
-''');
-    createRenameRefactoringAtString('test() {}');
-    // check status
-    refactoring.newName = 'newName';
-    return refactoring.checkFinalConditions().then((status) {
-      assertRefactoringStatus(
-          status,
-          RefactoringProblemSeverity.ERROR,
-          expectedMessage: "Renamed method will be shadowed by method 'B.newName'.",
-          expectedContextSearch: 'newName() {} // marker');
-    });
-  }
-
   test_checkFinalConditions_shadowsSuper_inSubClass_FieldElement() {
     indexTestUnit('''
 class A {
@@ -239,6 +215,30 @@
     });
   }
 
+  test_checkFinalConditions_shadowsSuper_MethodElement() {
+    indexTestUnit('''
+class A {
+  test() {}
+}
+class B extends A {
+  newName() {} // marker
+  main() {
+    test();
+  }
+}
+''');
+    createRenameRefactoringAtString('test() {}');
+    // check status
+    refactoring.newName = 'newName';
+    return refactoring.checkFinalConditions().then((status) {
+      assertRefactoringStatus(
+          status,
+          RefactoringProblemSeverity.ERROR,
+          expectedMessage: "Renamed method will be shadowed by method 'B.newName'.",
+          expectedContextSearch: 'newName() {} // marker');
+    });
+  }
+
   test_checkInitialConditions_operator() {
     indexTestUnit('''
 class A {
@@ -409,6 +409,33 @@
 ''');
   }
 
+  test_createChange_FieldElement_fieldFormalParameter_named() {
+    indexTestUnit('''
+class A {
+  final test;
+  A({this.test});
+}
+main() {
+  new A(test: 42);
+}
+''');
+    // configure refactoring
+    createRenameRefactoringAtString('test;');
+    expect(refactoring.refactoringName, 'Rename Field');
+    expect(refactoring.oldName, 'test');
+    refactoring.newName = 'newName';
+    // validate change
+    return assertSuccessfulRefactoring('''
+class A {
+  final newName;
+  A({this.newName});
+}
+main() {
+  new A(newName: 42);
+}
+''');
+  }
+
   test_createChange_FieldElement_invocation() {
     indexTestUnit('''
 typedef F(a);
diff --git a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
index a6d12e1..94682bc 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -5,11 +5,11 @@
 library test.services.refactoring.rename_constructor;
 
 import 'package:analysis_server/src/protocol.dart';
-import '../../reflective_tests.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import 'abstract_rename.dart';
 
 
diff --git a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
index 1d49989..6d10598 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
@@ -5,10 +5,10 @@
 library test.services.refactoring.rename_library;
 
 import 'package:analysis_server/src/protocol.dart';
-import '../../reflective_tests.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import 'abstract_rename.dart';
 
 
diff --git a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
index 9fad28e..226733e 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -128,20 +128,6 @@
     return assertRefactoringConditionsOK();
   }
 
-  test_checkFinalConditions_shadows_OK_namedParameterReference() {
-    indexTestUnit('''
-void f({newName}) {}
-main() {
-  var test = 0;
-  f(newName: test);
-}
-''');
-    createRenameRefactoringAtString('test = 0');
-    // check status
-    refactoring.newName = 'newName';
-    return assertRefactoringFinalConditionsOK();
-  }
-
   test_checkFinalConditions_shadows_classMember() {
     indexTestUnit('''
 class A {
@@ -181,6 +167,20 @@
     return assertRefactoringConditionsOK();
   }
 
+  test_checkFinalConditions_shadows_OK_namedParameterReference() {
+    indexTestUnit('''
+void f({newName}) {}
+main() {
+  var test = 0;
+  f(newName: test);
+}
+''');
+    createRenameRefactoringAtString('test = 0');
+    // check status
+    refactoring.newName = 'newName';
+    return assertRefactoringFinalConditionsOK();
+  }
+
   test_checkFinalConditions_shadows_topLevelFunction() {
     indexTestUnit('''
 newName() {}
diff --git a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
index f78c21a..4356a89 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
@@ -5,9 +5,9 @@
 library test.services.refactoring.rename_unit_member;
 
 import 'package:analysis_server/src/protocol.dart';
-import '../../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../reflective_tests.dart';
 import 'abstract_rename.dart';
 
 
@@ -19,26 +19,6 @@
 
 @ReflectiveTestCase()
 class RenameUnitMemberTest extends RenameRefactoringTest {
-  test_checkFinalConditions_OK_qualifiedSuper_MethodElement() {
-    indexTestUnit('''
-class Test {}
-class A {
-  NewName() {}
-}
-class B extends A {
-  main() {
-    super.NewName(); // super-ref
-  }
-}
-''');
-    createRenameRefactoringAtString('Test {}');
-    // check status
-    refactoring.newName = 'NewName';
-    return refactoring.checkFinalConditions().then((status) {
-      assertRefactoringStatusOK(status);
-    });
-  }
-
   test_checkFinalConditions_hasTopLevel_ClassElement() {
     indexTestUnit('''
 class Test {}
@@ -74,6 +54,26 @@
     });
   }
 
+  test_checkFinalConditions_OK_qualifiedSuper_MethodElement() {
+    indexTestUnit('''
+class Test {}
+class A {
+  NewName() {}
+}
+class B extends A {
+  main() {
+    super.NewName(); // super-ref
+  }
+}
+''');
+    createRenameRefactoringAtString('Test {}');
+    // check status
+    refactoring.newName = 'NewName';
+    return refactoring.checkFinalConditions().then((status) {
+      assertRefactoringStatusOK(status);
+    });
+  }
+
   test_checkFinalConditions_shadowedBy_MethodElement() {
     indexTestUnit('''
 class Test {}
@@ -97,30 +97,6 @@
     });
   }
 
-  test_checkFinalConditions_shadowsInSubClass_MethodElement() {
-    indexTestUnit('''
-class Test {}
-class A {
-  NewName() {}
-}
-class B extends A {
-  main() {
-    NewName(); // super-ref
-  }
-}
-''');
-    createRenameRefactoringAtString('Test {}');
-    // check status
-    refactoring.newName = 'NewName';
-    return refactoring.checkFinalConditions().then((status) {
-      assertRefactoringStatus(
-          status,
-          RefactoringProblemSeverity.ERROR,
-          expectedMessage: "Renamed class will shadow method 'A.NewName'.",
-          expectedContextSearch: 'NewName(); // super-ref');
-    });
-  }
-
   test_checkFinalConditions_shadowsInSubClass_importedLib() {
     indexTestUnit('''
 class Test {}
@@ -172,6 +148,30 @@
     });
   }
 
+  test_checkFinalConditions_shadowsInSubClass_MethodElement() {
+    indexTestUnit('''
+class Test {}
+class A {
+  NewName() {}
+}
+class B extends A {
+  main() {
+    NewName(); // super-ref
+  }
+}
+''');
+    createRenameRefactoringAtString('Test {}');
+    // check status
+    refactoring.newName = 'NewName';
+    return refactoring.checkFinalConditions().then((status) {
+      assertRefactoringStatus(
+          status,
+          RefactoringProblemSeverity.ERROR,
+          expectedMessage: "Renamed class will shadow method 'A.NewName'.",
+          expectedContextSearch: 'NewName(); // super-ref');
+    });
+  }
+
   test_checkFinalConditions_shadowsInSubClass_notImportedLib() {
     indexUnit('/lib.dart', '''
 library my.lib;
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 3c17d86..bc52d0d 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -10,11 +10,12 @@
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:analysis_server/src/services/search/hierarchy.dart';
 import 'package:analysis_server/src/services/search/search_engine_internal.dart';
-import '../../abstract_single_unit.dart';
-import '../../reflective_tests.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../abstract_single_unit.dart';
+import '../../reflective_tests.dart';
+
 
 main() {
   groupSep = ' | ';
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index ce4e6fa..b52f81b 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -367,6 +367,26 @@
     return _verifyReferences(element, expected);
   }
 
+  Future test_searchReferences_LabelElement() {
+    _indexTestUnit('''
+main() {
+label:
+  while (true) {
+    if (true) {
+      break label; // 1
+    }
+    break label; // 2
+  }
+}
+''');
+    LabelElement element = findElement('label');
+    Element mainElement = findElement('main');
+    var expected = [
+        _expectId(mainElement, MatchKind.REFERENCE, 'label; // 1'),
+        _expectId(mainElement, MatchKind.REFERENCE, 'label; // 2')];
+    return _verifyReferences(element, expected);
+  }
+
   Future test_searchReferences_LibraryElement() {
     var codeA = 'part of lib; // A';
     var codeB = 'part of lib; // B';
@@ -416,43 +436,6 @@
     return _verifyReferences(element, expected);
   }
 
-  Future test_searchReferences_LabelElement() {
-    _indexTestUnit('''
-main() {
-label:
-  while (true) {
-    if (true) {
-      break label; // 1
-    }
-    break label; // 2
-  }
-}
-''');
-    LabelElement element = findElement('label');
-    Element mainElement = findElement('main');
-    var expected = [
-        _expectId(mainElement, MatchKind.REFERENCE, 'label; // 1'),
-        _expectId(mainElement, MatchKind.REFERENCE, 'label; // 2')];
-    return _verifyReferences(element, expected);
-  }
-
-  Future test_searchReferences_PrefixElement() {
-    _indexTestUnit('''
-import 'dart:async' as ppp;
-main() {
-  ppp.Future a;
-  ppp.Stream b;
-}
-''');
-    PrefixElement element = findNodeElementAtString('ppp;');
-    Element elementA = findElement('a');
-    Element elementB = findElement('b');
-    var expected = [
-        _expectId(elementA, MatchKind.REFERENCE, 'ppp.Future'),
-        _expectId(elementB, MatchKind.REFERENCE, 'ppp.Stream')];
-    return _verifyReferences(element, expected);
-  }
-
   Future test_searchReferences_MethodElement() {
     _indexTestUnit('''
 class A {
@@ -515,6 +498,23 @@
     return _verifyReferences(element, expected);
   }
 
+  Future test_searchReferences_PrefixElement() {
+    _indexTestUnit('''
+import 'dart:async' as ppp;
+main() {
+  ppp.Future a;
+  ppp.Stream b;
+}
+''');
+    PrefixElement element = findNodeElementAtString('ppp;');
+    Element elementA = findElement('a');
+    Element elementB = findElement('b');
+    var expected = [
+        _expectId(elementA, MatchKind.REFERENCE, 'ppp.Future'),
+        _expectId(elementB, MatchKind.REFERENCE, 'ppp.Stream')];
+    return _verifyReferences(element, expected);
+  }
+
   Future test_searchReferences_PropertyAccessorElement_getter() {
     _indexTestUnit('''
 class A {
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index 081d527..a794e03 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -6,44 +6,35 @@
 
 import 'dart:async';
 
-import 'mocks.dart';
-
+import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:unittest/unittest.dart';
 
+import 'mocks.dart';
+
 main() {
   group('SocketServer', () {
-    test('createAnalysisServer_successful',
+    test(
+        'createAnalysisServer_successful',
         SocketServerTest.createAnalysisServer_successful);
-    test('createAnalysisServer_alreadyStarted',
+    test(
+        'createAnalysisServer_alreadyStarted',
         SocketServerTest.createAnalysisServer_alreadyStarted);
     test('requestHandler_exception', SocketServerTest.requestHandler_exception);
-    test('requestHandler_futureException',
+    test(
+        'requestHandler_futureException',
         SocketServerTest.requestHandler_futureException);
   });
 }
 
 class SocketServerTest {
-  static Future createAnalysisServer_successful() {
-    SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
-    MockServerChannel channel = new MockServerChannel();
-    server.createAnalysisServer(channel);
-    channel.expectMsgCount(notificationCount: 1);
-    expect(channel.notificationsReceived[0].event, SERVER_CONNECTED);
-    return channel.sendRequest(
-        new ServerShutdownParams().toRequest('0')
-    ).then((Response response) {
-      expect(response.id, equals('0'));
-      expect(response.error, isNull);
-      channel.expectMsgCount(responseCount: 1, notificationCount: 1);
-    });
-  }
-
   static void createAnalysisServer_alreadyStarted() {
-    SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
+    SocketServer server = new SocketServer(
+        new AnalysisServerOptions(),
+        DirectoryBasedDartSdk.defaultSdk);
     MockServerChannel channel1 = new MockServerChannel();
     MockServerChannel channel2 = new MockServerChannel();
     server.createAnalysisServer(channel1);
@@ -53,20 +44,40 @@
     channel2.expectMsgCount(responseCount: 1);
     expect(channel2.responsesReceived[0].id, equals(''));
     expect(channel2.responsesReceived[0].error, isNotNull);
-    expect(channel2.responsesReceived[0].error.code, equals(
-        RequestErrorCode.SERVER_ALREADY_STARTED));
-    channel2.sendRequest(new ServerShutdownParams().toRequest('0')).then(
-        (Response response) {
+    expect(
+        channel2.responsesReceived[0].error.code,
+        equals(RequestErrorCode.SERVER_ALREADY_STARTED));
+    channel2.sendRequest(
+        new ServerShutdownParams().toRequest('0')).then((Response response) {
       expect(response.id, equals('0'));
       expect(response.error, isNotNull);
-      expect(response.error.code, equals(
-          RequestErrorCode.SERVER_ALREADY_STARTED));
+      expect(
+          response.error.code,
+          equals(RequestErrorCode.SERVER_ALREADY_STARTED));
       channel2.expectMsgCount(responseCount: 2);
     });
   }
 
+  static Future createAnalysisServer_successful() {
+    SocketServer server = new SocketServer(
+        new AnalysisServerOptions(),
+        DirectoryBasedDartSdk.defaultSdk);
+    MockServerChannel channel = new MockServerChannel();
+    server.createAnalysisServer(channel);
+    channel.expectMsgCount(notificationCount: 1);
+    expect(channel.notificationsReceived[0].event, SERVER_CONNECTED);
+    return channel.sendRequest(
+        new ServerShutdownParams().toRequest('0')).then((Response response) {
+      expect(response.id, equals('0'));
+      expect(response.error, isNull);
+      channel.expectMsgCount(responseCount: 1, notificationCount: 1);
+    });
+  }
+
   static Future requestHandler_exception() {
-    SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
+    SocketServer server = new SocketServer(
+        new AnalysisServerOptions(),
+        DirectoryBasedDartSdk.defaultSdk);
     MockServerChannel channel = new MockServerChannel();
     server.createAnalysisServer(channel);
     channel.expectMsgCount(notificationCount: 1);
@@ -86,7 +97,9 @@
   }
 
   static Future requestHandler_futureException() {
-    SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
+    SocketServer server = new SocketServer(
+        new AnalysisServerOptions(),
+        DirectoryBasedDartSdk.defaultSdk);
     MockServerChannel channel = new MockServerChannel();
     server.createAnalysisServer(channel);
     _MockRequestHandler handler = new _MockRequestHandler(true);
diff --git a/pkg/analysis_server/test/test_all.dart b/pkg/analysis_server/test/test_all.dart
index a865ba9..0a2ff15 100644
--- a/pkg/analysis_server/test/test_all.dart
+++ b/pkg/analysis_server/test/test_all.dart
@@ -42,4 +42,4 @@
     services_all.main();
     socket_server_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/test/timing/completion/completion_simple.dart b/pkg/analysis_server/test/timing/completion/completion_simple.dart
index aa833bb..34197bd 100644
--- a/pkg/analysis_server/test/timing/completion/completion_simple.dart
+++ b/pkg/analysis_server/test/timing/completion/completion_simple.dart
@@ -81,6 +81,16 @@
   }
 
   @override
+  Future perform() {
+    sendAnalysisUpdateContent({
+      mainFilePath: new ChangeContentOverlay(
+          [new SourceEdit(cursorOffset, 0, '.')])
+    });
+    sendCompletionGetSuggestions(mainFilePath, cursorOffset + 1);
+    return completionReceived.future;
+  }
+
+  @override
   Future setUp() {
     completionReceived = new Completer();
     onCompletionResults.listen((_) {
@@ -97,16 +107,6 @@
   }
 
   @override
-  Future perform() {
-    sendAnalysisUpdateContent({
-      mainFilePath: new ChangeContentOverlay(
-          [new SourceEdit(cursorOffset, 0, '.')])
-    });
-    sendCompletionGetSuggestions(mainFilePath, cursorOffset + 1);
-    return completionReceived.future;
-  }
-
-  @override
   Future tearDown() {
     sendAnalysisSetAnalysisRoots([], []);
     return new Future.value();
diff --git a/pkg/analysis_server/test/timing/timing_framework.dart b/pkg/analysis_server/test/timing/timing_framework.dart
index d79b6bd..3b1fdef 100644
--- a/pkg/analysis_server/test/timing/timing_framework.dart
+++ b/pkg/analysis_server/test/timing/timing_framework.dart
@@ -14,220 +14,21 @@
 import '../integration/integration_tests.dart';
 
 /**
- * The abstract class [TimingTest] defines the behavior of objects that measure
- * the time required to perform some sequence of server operations.
- */
-abstract class TimingTest extends IntegrationTestMixin {
-  /**
-   * The connection to the analysis server.
-   */
-  Server server;
-
-  /**
-   * The temporary directory in which source files can be stored.
-   */
-  Directory sourceDirectory;
-
-  /**
-   * A flag indicating whether the teardown process should skip sending a
-   * "server.shutdown" request because the server is known to have already
-   * shutdown.
-   */
-  bool skipShutdown = false;
-
-  /**
-   * The number of times the test will be performed in order to warm up the VM.
-   */
-  static final int DEFAULT_WARMUP_COUNT = 10;
-
-  /**
-   * The number of times the test will be performed in order to compute a time.
-   */
-  static final int DEFAULT_TIMING_COUNT = 10;
-
-  /**
-   * The file suffix used to identify Dart files.
-   */
-  static final String DART_SUFFIX = '.dart';
-
-  /**
-   * The file suffix used to identify HTML files.
-   */
-  static final String HTML_SUFFIX = '.html';
-
-  /**
-   * The amount of time to give the server to respond to a shutdown request
-   * before forcibly terminating it.
-   */
-  static const Duration SHUTDOWN_TIMEOUT = const Duration(seconds: 5);
-
-  /**
-   * Initialize a newly created test.
-   */
-  TimingTest();
-
-  /**
-   * Return the number of iterations that should be performed in order to warm
-   * up the VM.
-   */
-  int get warmupCount => DEFAULT_WARMUP_COUNT;
-
-  /**
-   * Return the number of iterations that should be performed in order to
-   * compute a time.
-   */
-  int get timingCount => DEFAULT_TIMING_COUNT;
-
-  /**
-   * Perform any operations that need to be performed once before any iterations.
-   */
-  Future oneTimeSetUp() {
-    initializeInttestMixin();
-    server = new Server();
-    sourceDirectory = Directory.systemTemp.createTempSync('analysisServer');
-    Completer serverConnected = new Completer();
-    onServerConnected.listen((_) {
-      serverConnected.complete();
-    });
-    skipShutdown = true;
-    return server.start(profileServer: true).then((params) {
-      server.listenToOutput(dispatchNotification);
-      server.exitCode.then((_) {
-        skipShutdown = true;
-      });
-      return serverConnected.future;
-    });
-  }
-
-  /**
-   * Perform any operations that need to be performed before each iteration.
-   */
-  Future setUp();
-
-  /**
-   * Perform any operations that part of a single iteration. It is the execution
-   * of this method that will be measured.
-   */
-  Future perform();
-
-  /**
-   * Perform any operations that need to be performed after each iteration.
-   */
-  Future tearDown();
-
-  /**
-   * Perform any operations that need to be performed once after all iterations.
-   */
-  Future oneTimeTearDown() {
-    return _shutdownIfNeeded().then((_) {
-      sourceDirectory.deleteSync(recursive: true);
-    });
-  }
-
-  /**
-   * Return a future that will complete with a timing result representing the
-   * number of milliseconds required to perform the operation the specified
-   * number of times.
-   */
-  Future<TimingResult> run() {
-    List<int> times = new List<int>();
-    return oneTimeSetUp().then((_) {
-      return _repeat(warmupCount, null).then((_) {
-        return _repeat(timingCount, times).then((_) {
-          return oneTimeTearDown().then((_) {
-            return new Future.value(new TimingResult(times));
-          });
-        });
-      });
-    });
-  }
-
-  /**
-   * Convert the given [relativePath] to an absolute path, by interpreting it
-   * relative to [sourceDirectory].  On Windows any forward slashes in
-   * [relativePath] are converted to backslashes.
-   */
-  String sourcePath(String relativePath) {
-    return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
-  }
-
-  /**
-   * Write a source file with the given absolute [pathname] and [contents].
-   *
-   * If the file didn't previously exist, it is created.  If it did, it is
-   * overwritten.
-   *
-   * Parent directories are created as necessary.
-   */
-  void writeFile(String pathname, String contents) {
-    new Directory(dirname(pathname)).createSync(recursive: true);
-    new File(pathname).writeAsStringSync(contents);
-  }
-
-  /**
-   * Return the number of nanoseconds that have elapsed since the given
-   * [stopwatch] was last stopped.
-   */
-  int _elapsedNanoseconds(Stopwatch stopwatch) {
-    return (stopwatch.elapsedTicks * 1000000000) ~/ stopwatch.frequency;
-  }
-
-  /**
-   * Repeatedly execute this test [count] times, adding timing information to
-   * the given list of [times] if it is non-`null`.
-   */
-  Future _repeat(int count, List<int> times) {
-    Stopwatch stopwatch = new Stopwatch();
-    return setUp().then((_) {
-      stopwatch.start();
-      return perform().then((_) {
-        stopwatch.stop();
-        if (times != null) {
-          times.add(_elapsedNanoseconds(stopwatch));
-        }
-        return tearDown().then((_) {
-          if (count > 0) {
-            return _repeat(count - 1, times);
-          } else {
-            return new Future.value();
-          }
-        });
-      });
-    });
-  }
-
-  /**
-   * Shut the server down unless [skipShutdown] is `true`.
-   */
-  Future _shutdownIfNeeded() {
-    if (skipShutdown) {
-      return new Future.value();
-    }
-    // Give the server a short time to comply with the shutdown request; if it
-    // doesn't exit, then forcibly terminate it.
-    sendServerShutdown();
-    return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
-      return server.kill();
-    });
-  }
-}
-
-/**
  * Instances of the class [TimingResult] represent the timing information
  * gathered while executing a given timing test.
  */
 class TimingResult {
   /**
-   * The amount of time spent executing each test, in nanoseconds.
-   */
-  List<int> times;
-
-  /**
    * The number of nanoseconds in a millisecond.
    */
   static int NANOSECONDS_PER_MILLISECOND = 1000000;
 
   /**
+   * The amount of time spent executing each test, in nanoseconds.
+   */
+  List<int> times;
+
+  /**
    * Initialize a newly created timing result.
    */
   TimingResult(this.times);
@@ -317,3 +118,202 @@
     return convertedValues;
   }
 }
+
+/**
+ * The abstract class [TimingTest] defines the behavior of objects that measure
+ * the time required to perform some sequence of server operations.
+ */
+abstract class TimingTest extends IntegrationTestMixin {
+  /**
+   * The number of times the test will be performed in order to warm up the VM.
+   */
+  static final int DEFAULT_WARMUP_COUNT = 10;
+
+  /**
+   * The number of times the test will be performed in order to compute a time.
+   */
+  static final int DEFAULT_TIMING_COUNT = 10;
+
+  /**
+   * The file suffix used to identify Dart files.
+   */
+  static final String DART_SUFFIX = '.dart';
+
+  /**
+   * The file suffix used to identify HTML files.
+   */
+  static final String HTML_SUFFIX = '.html';
+
+  /**
+   * The amount of time to give the server to respond to a shutdown request
+   * before forcibly terminating it.
+   */
+  static const Duration SHUTDOWN_TIMEOUT = const Duration(seconds: 5);
+
+  /**
+   * The connection to the analysis server.
+   */
+  Server server;
+
+  /**
+   * The temporary directory in which source files can be stored.
+   */
+  Directory sourceDirectory;
+
+  /**
+   * A flag indicating whether the teardown process should skip sending a
+   * "server.shutdown" request because the server is known to have already
+   * shutdown.
+   */
+  bool skipShutdown = false;
+
+  /**
+   * Initialize a newly created test.
+   */
+  TimingTest();
+
+  /**
+   * Return the number of iterations that should be performed in order to
+   * compute a time.
+   */
+  int get timingCount => DEFAULT_TIMING_COUNT;
+
+  /**
+   * Return the number of iterations that should be performed in order to warm
+   * up the VM.
+   */
+  int get warmupCount => DEFAULT_WARMUP_COUNT;
+
+  /**
+   * Perform any operations that need to be performed once before any iterations.
+   */
+  Future oneTimeSetUp() {
+    initializeInttestMixin();
+    server = new Server();
+    sourceDirectory = Directory.systemTemp.createTempSync('analysisServer');
+    Completer serverConnected = new Completer();
+    onServerConnected.listen((_) {
+      serverConnected.complete();
+    });
+    skipShutdown = true;
+    return server.start(/*profileServer: true*/).then((params) {
+      server.listenToOutput(dispatchNotification);
+      server.exitCode.then((_) {
+        skipShutdown = true;
+      });
+      return serverConnected.future;
+    });
+  }
+
+  /**
+   * Perform any operations that need to be performed once after all iterations.
+   */
+  Future oneTimeTearDown() {
+    return _shutdownIfNeeded().then((_) {
+      sourceDirectory.deleteSync(recursive: true);
+    });
+  }
+
+  /**
+   * Perform any operations that part of a single iteration. It is the execution
+   * of this method that will be measured.
+   */
+  Future perform();
+
+  /**
+   * Return a future that will complete with a timing result representing the
+   * number of milliseconds required to perform the operation the specified
+   * number of times.
+   */
+  Future<TimingResult> run() {
+    List<int> times = new List<int>();
+    return oneTimeSetUp().then((_) {
+      return _repeat(warmupCount, null).then((_) {
+        return _repeat(timingCount, times).then((_) {
+          return oneTimeTearDown().then((_) {
+            return new Future.value(new TimingResult(times));
+          });
+        });
+      });
+    });
+  }
+
+  /**
+   * Perform any operations that need to be performed before each iteration.
+   */
+  Future setUp();
+
+  /**
+   * Convert the given [relativePath] to an absolute path, by interpreting it
+   * relative to [sourceDirectory].  On Windows any forward slashes in
+   * [relativePath] are converted to backslashes.
+   */
+  String sourcePath(String relativePath) {
+    return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
+  }
+
+  /**
+   * Perform any operations that need to be performed after each iteration.
+   */
+  Future tearDown();
+
+  /**
+   * Write a source file with the given absolute [pathname] and [contents].
+   *
+   * If the file didn't previously exist, it is created.  If it did, it is
+   * overwritten.
+   *
+   * Parent directories are created as necessary.
+   */
+  void writeFile(String pathname, String contents) {
+    new Directory(dirname(pathname)).createSync(recursive: true);
+    new File(pathname).writeAsStringSync(contents);
+  }
+
+  /**
+   * Return the number of nanoseconds that have elapsed since the given
+   * [stopwatch] was last stopped.
+   */
+  int _elapsedNanoseconds(Stopwatch stopwatch) {
+    return (stopwatch.elapsedTicks * 1000000000) ~/ stopwatch.frequency;
+  }
+
+  /**
+   * Repeatedly execute this test [count] times, adding timing information to
+   * the given list of [times] if it is non-`null`.
+   */
+  Future _repeat(int count, List<int> times) {
+    Stopwatch stopwatch = new Stopwatch();
+    return setUp().then((_) {
+      stopwatch.start();
+      return perform().then((_) {
+        stopwatch.stop();
+        if (times != null) {
+          times.add(_elapsedNanoseconds(stopwatch));
+        }
+        return tearDown().then((_) {
+          if (count > 0) {
+            return _repeat(count - 1, times);
+          } else {
+            return new Future.value();
+          }
+        });
+      });
+    });
+  }
+
+  /**
+   * Shut the server down unless [skipShutdown] is `true`.
+   */
+  Future _shutdownIfNeeded() {
+    if (skipShutdown) {
+      return new Future.value();
+    }
+    // Give the server a short time to comply with the shutdown request; if it
+    // doesn't exit, then forcibly terminate it.
+    sendServerShutdown();
+    return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
+      return server.kill();
+    });
+  }
+}
diff --git a/pkg/analysis_server/tool/spec/api.dart b/pkg/analysis_server/tool/spec/api.dart
index 98a9e71..070437c 100644
--- a/pkg/analysis_server/tool/spec/api.dart
+++ b/pkg/analysis_server/tool/spec/api.dart
@@ -13,20 +13,58 @@
 import 'package:html5lib/dom.dart' as dom;
 
 /**
+ * Toplevel container for the API.
+ */
+class Api extends ApiNode {
+  final String version;
+  final List<Domain> domains;
+  final Types types;
+  final Refactorings refactorings;
+
+  Api(this.version, this.domains, this.types, this.refactorings,
+      dom.Element html)
+      : super(html);
+}
+
+/**
+ * Base class for objects in the API model.
+ */
+class ApiNode {
+  /**
+   * Html element representing this part of the API.
+   */
+  final dom.Element html;
+
+  ApiNode(this.html);
+}
+
+/**
  * Base class for visiting the API definition.
  */
 abstract class ApiVisitor<T> {
-  T visitTypeReference(TypeReference typeReference);
-  T visitTypeUnion(TypeUnion typeUnion);
-  T visitTypeObject(TypeObject typeObject);
-  T visitTypeList(TypeList typeList);
-  T visitTypeMap(TypeMap typeMap);
-  T visitTypeEnum(TypeEnum typeEnum);
-
   /**
    * Dispatch the given [type] to the visitor.
    */
   T visitTypeDecl(TypeDecl type) => type.accept(this);
+  T visitTypeEnum(TypeEnum typeEnum);
+  T visitTypeList(TypeList typeList);
+  T visitTypeMap(TypeMap typeMap);
+  T visitTypeObject(TypeObject typeObject);
+  T visitTypeReference(TypeReference typeReference);
+
+  T visitTypeUnion(TypeUnion typeUnion);
+}
+
+/**
+ * Definition of a single domain.
+ */
+class Domain extends ApiNode {
+  final String name;
+  final List<Request> requests;
+  final List<Notification> notifications;
+
+  Domain(this.name, this.requests, this.notifications, dom.Element html)
+      : super(html);
 }
 
 /**
@@ -40,29 +78,26 @@
 
   HierarchicalApiVisitor(this.api);
 
+  /**
+   * If [type] is a [TypeReference] that is defined in the API, follow the
+   * chain until a non-[TypeReference] is found, if possible.
+   *
+   * If it is not possible (because the chain ends with a [TypeReference] that
+   * is not defined in the API), then that final [TypeReference] is returned.
+   */
+  TypeDecl resolveTypeReferenceChain(TypeDecl type) {
+    while (type is TypeReference && api.types.containsKey(type.typeName)) {
+      type = api.types[(type as TypeReference).typeName].type;
+    }
+    return type;
+  }
+
   void visitApi() {
     api.domains.forEach(visitDomain);
     visitTypes(api.types);
     visitRefactorings(api.refactorings);
   }
 
-  void visitRefactorings(Refactorings refactorings) {
-    refactorings.forEach(visitRefactoring);
-  }
-
-  void visitRefactoring(Refactoring refactoring) {
-    if (refactoring.feedback != null) {
-      visitTypeDecl(refactoring.feedback);
-    }
-    if (refactoring.options != null) {
-      visitTypeDecl(refactoring.options);
-    }
-  }
-
-  void visitTypes(Types types) {
-    types.forEach(visitTypeDefinition);
-  }
-
   void visitDomain(Domain domain) {
     domain.requests.forEach(visitRequest);
     domain.notifications.forEach(visitNotification);
@@ -74,6 +109,19 @@
     }
   }
 
+  void visitRefactoring(Refactoring refactoring) {
+    if (refactoring.feedback != null) {
+      visitTypeDecl(refactoring.feedback);
+    }
+    if (refactoring.options != null) {
+      visitTypeDecl(refactoring.options);
+    }
+  }
+
+  void visitRefactorings(Refactorings refactorings) {
+    refactorings.forEach(visitRefactoring);
+  }
+
   void visitRequest(Request request) {
     if (request.params != null) {
       visitTypeDecl(request.params);
@@ -119,64 +167,63 @@
   void visitTypeReference(TypeReference typeReference) {
   }
 
+  void visitTypes(Types types) {
+    types.forEach(visitTypeDefinition);
+  }
+
   @override
   void visitTypeUnion(TypeUnion typeUnion) {
     typeUnion.choices.forEach(visitTypeDecl);
   }
+}
+
+/**
+ * Description of a request method.
+ */
+class Notification extends ApiNode {
+  /**
+   * Name of the domain enclosing this request.
+   */
+  final String domainName;
 
   /**
-   * If [type] is a [TypeReference] that is defined in the API, follow the
-   * chain until a non-[TypeReference] is found, if possible.
-   *
-   * If it is not possible (because the chain ends with a [TypeReference] that
-   * is not defined in the API), then that final [TypeReference] is returned.
+   * Name of the notification, without the domain prefix.
    */
-  TypeDecl resolveTypeReferenceChain(TypeDecl type) {
-    while (type is TypeReference && api.types.containsKey(type.typeName)) {
-      type = api.types[(type as TypeReference).typeName].type;
+  final String event;
+
+  /**
+   * Type of the object associated with the "params" key in the notification
+   * object, or null if the notification has no parameters.
+   */
+  final TypeObject params;
+
+  Notification(this.domainName, this.event, this.params, dom.Element html)
+      : super(html);
+
+  /**
+   * Get the name of the notification, including the domain prefix.
+   */
+  String get longEvent => '$domainName.$event';
+
+  /**
+   * Get the full type of the notification object, including the common "id"
+   * and "error" fields.
+   */
+  TypeDecl get notificationType {
+    List<TypeObjectField> fields = [
+        new TypeObjectField(
+            'event',
+            new TypeReference('String', null),
+            null,
+            value: '$domainName.$event')];
+    if (params != null) {
+      fields.add(new TypeObjectField('params', params, null));
     }
-    return type;
+    return new TypeObject(fields, null);
   }
 }
 
 /**
- * Base class for objects in the API model.
- */
-class ApiNode {
-  /**
-   * Html element representing this part of the API.
-   */
-  final dom.Element html;
-
-  ApiNode(this.html);
-}
-
-/**
- * Toplevel container for the API.
- */
-class Api extends ApiNode {
-  final String version;
-  final List<Domain> domains;
-  final Types types;
-  final Refactorings refactorings;
-
-  Api(this.version, this.domains, this.types, this.refactorings, dom.Element
-      html) : super(html);
-}
-
-/**
- * A collection of refactoring definitions.
- */
-class Refactorings extends ApiNode with IterableMixin<Refactoring> {
-  final List<Refactoring> refactorings;
-
-  Refactorings(this.refactorings, dom.Element html) : super(html);
-
-  @override
-  Iterator<Refactoring> get iterator => refactorings.iterator;
-}
-
-/**
  * Description of a single refactoring.
  */
 class Refactoring extends ApiNode {
@@ -197,38 +244,20 @@
    */
   final TypeObject options;
 
-  Refactoring(this.kind, this.feedback, this.options, dom.Element html) : super(
-      html);
+  Refactoring(this.kind, this.feedback, this.options, dom.Element html)
+      : super(html);
 }
 
 /**
- * A collection of type definitions.
+ * A collection of refactoring definitions.
  */
-class Types extends ApiNode with IterableMixin<TypeDefinition> {
-  final Map<String, TypeDefinition> types;
+class Refactorings extends ApiNode with IterableMixin<Refactoring> {
+  final List<Refactoring> refactorings;
 
-  Types(this.types, dom.Element html) : super(html);
-
-  bool containsKey(String typeName) => types.containsKey(typeName);
+  Refactorings(this.refactorings, dom.Element html) : super(html);
 
   @override
-  Iterator<TypeDefinition> get iterator => types.values.iterator;
-
-  TypeDefinition operator [](String typeName) => types[typeName];
-
-  Iterable<String> get keys => types.keys;
-}
-
-/**
- * Definition of a single domain.
- */
-class Domain extends ApiNode {
-  final String name;
-  final List<Request> requests;
-  final List<Notification> notifications;
-
-  Domain(this.name, this.requests, this.notifications, dom.Element html) :
-      super(html);
+  Iterator<Refactoring> get iterator => refactorings.iterator;
 }
 
 /**
@@ -257,8 +286,9 @@
    */
   final TypeObject result;
 
-  Request(this.domainName, this.method, this.params, this.result, dom.Element
-      html) : super(html);
+  Request(this.domainName, this.method, this.params, this.result,
+      dom.Element html)
+      : super(html);
 
   /**
    * Get the name of the request, including the domain prefix.
@@ -270,9 +300,13 @@
    * "method" fields.
    */
   TypeDecl get requestType {
-    List<TypeObjectField> fields = [new TypeObjectField('id', new TypeReference(
-        'String', null), null), new TypeObjectField('method', new TypeReference(
-        'String', null), null, value: '$domainName.$method')];
+    List<TypeObjectField> fields = [
+        new TypeObjectField('id', new TypeReference('String', null), null),
+        new TypeObjectField(
+            'method',
+            new TypeReference('String', null),
+            null,
+            value: '$domainName.$method')];
     if (params != null) {
       fields.add(new TypeObjectField('params', params, null));
     }
@@ -299,45 +333,12 @@
 }
 
 /**
- * Description of a request method.
+ * Base class for all possible types.
  */
-class Notification extends ApiNode {
-  /**
-   * Name of the domain enclosing this request.
-   */
-  final String domainName;
+abstract class TypeDecl extends ApiNode {
+  TypeDecl(dom.Element html) : super(html);
 
-  /**
-   * Name of the notification, without the domain prefix.
-   */
-  final String event;
-
-  /**
-   * Type of the object associated with the "params" key in the notification
-   * object, or null if the notification has no parameters.
-   */
-  final TypeObject params;
-
-  Notification(this.domainName, this.event, this.params, dom.Element html) :
-      super(html);
-
-  /**
-   * Get the name of the notification, including the domain prefix.
-   */
-  String get longEvent => '$domainName.$event';
-
-  /**
-   * Get the full type of the notification object, including the common "id"
-   * and "error" fields.
-   */
-  TypeDecl get notificationType {
-    List<TypeObjectField> fields = [new TypeObjectField('event',
-        new TypeReference('String', null), null, value: '$domainName.$event')];
-    if (params != null) {
-      fields.add(new TypeObjectField('params', params, null));
-    }
-    return new TypeObject(fields, null);
-  }
+  accept(ApiVisitor visitor);
 }
 
 /**
@@ -351,44 +352,56 @@
 }
 
 /**
- * Base class for all possible types.
+ * Type of an enum.  We represent enums in JSON as strings, so this type
+ * declaration simply lists the allowed values.
  */
-abstract class TypeDecl extends ApiNode {
-  TypeDecl(dom.Element html) : super(html);
+class TypeEnum extends TypeDecl {
+  final List<TypeEnumValue> values;
 
-  accept(ApiVisitor visitor);
+  TypeEnum(this.values, dom.Element html) : super(html);
+
+  accept(ApiVisitor visitor) => visitor.visitTypeEnum(this);
 }
 
 /**
- * A reference to a type which is either defined elsewhere in the API or which
- * is built-in ([String], [bool], or [int]).
+ * Description of a single allowed value for an enum.
  */
-class TypeReference extends TypeDecl {
-  final String typeName;
+class TypeEnumValue extends ApiNode {
+  final String value;
 
-  TypeReference(this.typeName, dom.Element html) : super(html) {
-    if (typeName.isEmpty) {
-      throw new Exception('Empty type name');
-    }
-  }
-
-  accept(ApiVisitor visitor) => visitor.visitTypeReference(this);
+  TypeEnumValue(this.value, dom.Element html) : super(html);
 }
 
 /**
- * Type which represents a union among multiple choices.
+ * Type of a JSON list.
  */
-class TypeUnion extends TypeDecl {
-  final List<TypeDecl> choices;
+class TypeList extends TypeDecl {
+  final TypeDecl itemType;
+
+  TypeList(this.itemType, dom.Element html) : super(html);
+
+  accept(ApiVisitor visitor) => visitor.visitTypeList(this);
+}
+
+/**
+ * Type of a JSON map.
+ */
+class TypeMap extends TypeDecl {
+  /**
+   * Type of map keys.  Note that since JSON map keys must always be strings,
+   * this must either be a [TypeReference] for [String], or a [TypeReference]
+   * to a type which is defined in the API as an enum or a synonym for [String].
+   */
+  final TypeReference keyType;
 
   /**
-   * The field that is used to disambiguate this union
+   * Type of map values.
    */
-  final String field;
+  final TypeDecl valueType;
 
-  TypeUnion(this.choices, this.field, dom.Element html) : super(html);
+  TypeMap(this.keyType, this.valueType, dom.Element html) : super(html);
 
-  accept(ApiVisitor visitor) => visitor.visitTypeUnion(this);
+  accept(ApiVisitor visitor) => visitor.visitTypeMap(this);
 }
 
 /**
@@ -427,59 +440,57 @@
    */
   final Object value;
 
-  TypeObjectField(this.name, this.type, dom.Element html, {this.optional:
-      false, this.value}) : super(html);
+  TypeObjectField(this.name, this.type, dom.Element html, {this.optional: false,
+      this.value})
+      : super(html);
 }
 
 /**
- * Type of a JSON list.
+ * A reference to a type which is either defined elsewhere in the API or which
+ * is built-in ([String], [bool], or [int]).
  */
-class TypeList extends TypeDecl {
-  final TypeDecl itemType;
+class TypeReference extends TypeDecl {
+  final String typeName;
 
-  TypeList(this.itemType, dom.Element html) : super(html);
+  TypeReference(this.typeName, dom.Element html) : super(html) {
+    if (typeName.isEmpty) {
+      throw new Exception('Empty type name');
+    }
+  }
 
-  accept(ApiVisitor visitor) => visitor.visitTypeList(this);
+  accept(ApiVisitor visitor) => visitor.visitTypeReference(this);
 }
 
 /**
- * Type of a JSON map.
+ * A collection of type definitions.
  */
-class TypeMap extends TypeDecl {
-  /**
-   * Type of map keys.  Note that since JSON map keys must always be strings,
-   * this must either be a [TypeReference] for [String], or a [TypeReference]
-   * to a type which is defined in the API as an enum or a synonym for [String].
-   */
-  final TypeReference keyType;
+class Types extends ApiNode with IterableMixin<TypeDefinition> {
+  final Map<String, TypeDefinition> types;
+
+  Types(this.types, dom.Element html) : super(html);
+
+  @override
+  Iterator<TypeDefinition> get iterator => types.values.iterator;
+
+  Iterable<String> get keys => types.keys;
+
+  TypeDefinition operator [](String typeName) => types[typeName];
+
+  bool containsKey(String typeName) => types.containsKey(typeName);
+}
+
+/**
+ * Type which represents a union among multiple choices.
+ */
+class TypeUnion extends TypeDecl {
+  final List<TypeDecl> choices;
 
   /**
-   * Type of map values.
+   * The field that is used to disambiguate this union
    */
-  final TypeDecl valueType;
+  final String field;
 
-  TypeMap(this.keyType, this.valueType, dom.Element html) : super(html);
+  TypeUnion(this.choices, this.field, dom.Element html) : super(html);
 
-  accept(ApiVisitor visitor) => visitor.visitTypeMap(this);
-}
-
-/**
- * Type of an enum.  We represent enums in JSON as strings, so this type
- * declaration simply lists the allowed values.
- */
-class TypeEnum extends TypeDecl {
-  final List<TypeEnumValue> values;
-
-  TypeEnum(this.values, dom.Element html) : super(html);
-
-  accept(ApiVisitor visitor) => visitor.visitTypeEnum(this);
-}
-
-/**
- * Description of a single allowed value for an enum.
- */
-class TypeEnumValue extends ApiNode {
-  final String value;
-
-  TypeEnumValue(this.value, dom.Element html) : super(html);
+  accept(ApiVisitor visitor) => visitor.visitTypeUnion(this);
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
index 0e0dd20..e491f69 100644
--- a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
+++ b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
@@ -11,9 +11,27 @@
 import 'codegen_java.dart';
 import 'codegen_tools.dart';
 
+final GeneratedFile target = javaGeneratedFile(
+    '../../../../editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java',
+    (Api api) => new CodegenAnalysisServer(api));
+
+/**
+ * Translate spec_input.html into AnalysisServer.java.
+ */
+main() {
+  target.generate();
+}
+
 class CodegenAnalysisServer extends CodegenJavaVisitor {
   CodegenAnalysisServer(Api api) : super(api);
 
+  /**
+   * Get the name of the consumer class for responses to this request.
+   */
+  String consumerName(Request request) {
+    return camelJoin([request.method, 'consumer'], doCapitalize: true);
+  }
+
   @override
   void visitApi() {
     outputHeader(javaStyle: true);
@@ -24,27 +42,23 @@
     writeln('import java.util.List;');
     writeln('import java.util.Map;');
     writeln();
-    writeln(
-        '''/**
+    writeln('''/**
  * The interface {@code AnalysisServer} defines the behavior of objects that interface to an
  * analysis server.
  * 
  * @coverage dart.server
- */'''
-        );
+ */''');
     makeClass('public interface AnalysisServer', () {
       //
       // addAnalysisServerListener(..)
       //
       publicMethod('addAnalysisServerListener', () {
-        writeln(
-            '''/**
+        writeln('''/**
  * Add the given listener to the list of listeners that will receive notification when new
  * analysis results become available.
  * 
  * @param listener the listener to be added
- */'''
-            );
+ */''');
         writeln(
             'public void addAnalysisServerListener(AnalysisServerListener listener);');
       });
@@ -53,14 +67,12 @@
       // removeAnalysisServerListener(..)
       //
       publicMethod('removeAnalysisServerListener', () {
-        writeln(
-            '''/**
+        writeln('''/**
  * Remove the given listener from the list of listeners that will receive notification when new
    * analysis results become available.
  * 
  * @param listener the listener to be removed
- */'''
-            );
+ */''');
         writeln(
             'public void removeAnalysisServerListener(AnalysisServerListener listener);');
       });
@@ -69,11 +81,9 @@
       // start(..)
       //
       publicMethod('start', () {
-        writeln(
-            '''/**
+        writeln('''/**
  * Start the analysis server.
- */'''
-            );
+ */''');
         writeln('public void start() throws Exception;');
       });
       super.visitApi();
@@ -103,22 +113,4 @@
       writeln(');');
     });
   }
-
-  /**
-   * Get the name of the consumer class for responses to this request.
-   */
-  String consumerName(Request request) {
-    return camelJoin([request.method, 'consumer'], doCapitalize: true);
-  }
-}
-
-final GeneratedFile target = javaGeneratedFile(
-    '../../../../editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java',
-    (Api api) => new CodegenAnalysisServer(api));
-
-/**
- * Translate spec_input.html into AnalysisServer.java.
- */
-main() {
-  target.generate();
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_dart.dart b/pkg/analysis_server/tool/spec/codegen_dart.dart
index efa1d38..33d66e4 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart.dart
@@ -48,4 +48,4 @@
       throw new Exception("Can't convert to a dart type");
     }
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index 7bacc23..2fc8d73e 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -6,6 +6,8 @@
 
 import 'dart:convert';
 
+import 'package:html5lib/dom.dart' as dom;
+
 import 'api.dart';
 import 'codegen_dart.dart';
 import 'codegen_tools.dart';
@@ -13,158 +15,6 @@
 import 'implied_types.dart';
 import 'to_html.dart';
 
-import 'package:html5lib/dom.dart' as dom;
-
-/**
- * Container for code that can be used to translate a data type from JSON.
- */
-abstract class FromJsonCode {
-  /**
-   * True if the data type is already in JSON form, so the translation is the
-   * identity function.
-   */
-  bool get isIdentity;
-
-  /**
-   * Get the translation code in the form of a closure.
-   */
-  String get asClosure;
-
-  /**
-   * Get the translation code in the form of a code snippet, where [jsonPath]
-   * is the variable holding the JSON path, and [json] is the variable holding
-   * the raw JSON.
-   */
-  String asSnippet(String jsonPath, String json);
-}
-
-/**
- * Representation of FromJsonCode for a function defined elsewhere.
- */
-class FromJsonFunction extends FromJsonCode {
-  final String asClosure;
-
-  FromJsonFunction(this.asClosure);
-
-  @override
-  bool get isIdentity => false;
-
-  @override
-  String asSnippet(String jsonPath, String json) =>
-      '$asClosure($jsonPath, $json)';
-}
-
-typedef String FromJsonSnippetCallback(String jsonPath, String json);
-
-/**
- * Representation of FromJsonCode for a snippet of inline code.
- */
-class FromJsonSnippet extends FromJsonCode {
-  /**
-   * Callback that can be used to generate the code snippet, once the names
-   * of the [jsonPath] and [json] variables are known.
-   */
-  final FromJsonSnippetCallback callback;
-
-  FromJsonSnippet(this.callback);
-
-  @override
-  bool get isIdentity => false;
-
-  @override
-  String get asClosure =>
-      '(String jsonPath, Object json) => ${callback('jsonPath', 'json')}';
-
-  @override
-  String asSnippet(String jsonPath, String json) => callback(jsonPath, json);
-}
-
-/**
- * Representation of FromJsonCode for the identity transformation.
- */
-class FromJsonIdentity extends FromJsonSnippet {
-  FromJsonIdentity() : super((String jsonPath, String json) => json);
-
-  @override
-  bool get isIdentity => true;
-}
-
-/**
- * Container for code that can be used to translate a data type to JSON.
- */
-abstract class ToJsonCode {
-  /**
-   * True if the data type is already in JSON form, so the translation is the
-   * identity function.
-   */
-  bool get isIdentity;
-
-  /**
-   * Get the translation code in the form of a closure.
-   */
-  String get asClosure;
-
-  /**
-   * Get the translation code in the form of a code snippet, where [value]
-   * is the variable holding the object to be translated.
-   */
-  String asSnippet(String value);
-}
-
-/**
- * Representation of ToJsonCode for a function defined elsewhere.
- */
-class ToJsonFunction extends ToJsonCode {
-  final String asClosure;
-
-  ToJsonFunction(this.asClosure);
-
-  @override
-  bool get isIdentity => false;
-
-  @override
-  String asSnippet(String value) => '$asClosure($value)';
-}
-
-typedef String ToJsonSnippetCallback(String value);
-
-/**
- * Representation of ToJsonCode for a snippet of inline code.
- */
-class ToJsonSnippet extends ToJsonCode {
-  /**
-   * Callback that can be used to generate the code snippet, once the name
-   * of the [value] variable is known.
-   */
-  final ToJsonSnippetCallback callback;
-
-  /**
-   * Dart type of the [value] variable.
-   */
-  final String type;
-
-  ToJsonSnippet(this.type, this.callback);
-
-  @override
-  bool get isIdentity => false;
-
-  @override
-  String get asClosure => '($type value) => ${callback('value')}';
-
-  @override
-  String asSnippet(String value) => callback(value);
-}
-
-/**
- * Representation of FromJsonCode for the identity transformation.
- */
-class ToJsonIdentity extends ToJsonSnippet {
-  ToJsonIdentity(String type) : super(type, (String value) => value);
-
-  @override
-  bool get isIdentity => true;
-}
-
 /**
  * Special flags that need to be inserted into the declaration of the Element
  * class.
@@ -178,11 +28,28 @@
   'deprecated': '0x20'
 };
 
+final GeneratedFile target =
+    new GeneratedFile('../../lib/src/generated_protocol.dart', () {
+  CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi());
+  return visitor.collectCode(visitor.visitApi);
+});
+
+/**
+ * Translate spec_input.html into protocol_matchers.dart.
+ */
+main() {
+  target.generate();
+}
+
 /**
  * Callback type used to represent arbitrary code generation.
  */
 typedef void CodegenCallback();
 
+typedef String FromJsonSnippetCallback(String jsonPath, String json);
+
+typedef String ToJsonSnippetCallback(String value);
+
 /**
  * Visitor which produces Dart code representing the API.
  */
@@ -216,12 +83,30 @@
         toHtmlVisitor = new ToHtmlVisitor(api),
         impliedTypes = computeImpliedTypes(api);
 
-  @override
-  visitApi() {
-    outputHeader();
-    writeln();
-    writeln('part of protocol;');
-    emitClasses();
+  /**
+   * Compute the code necessary to compare two objects for equality.
+   */
+  String compareEqualsCode(TypeDecl type, String thisVar, String otherVar) {
+    TypeDecl resolvedType = resolveTypeReferenceChain(type);
+    if (resolvedType is TypeReference ||
+        resolvedType is TypeEnum ||
+        resolvedType is TypeObject ||
+        resolvedType is TypeUnion) {
+      return '$thisVar == $otherVar';
+    } else if (resolvedType is TypeList) {
+      String itemTypeName = dartType(resolvedType.itemType);
+      String subComparison = compareEqualsCode(resolvedType.itemType, 'a', 'b');
+      String closure = '($itemTypeName a, $itemTypeName b) => $subComparison';
+      return '_listEqual($thisVar, $otherVar, $closure)';
+    } else if (resolvedType is TypeMap) {
+      String valueTypeName = dartType(resolvedType.valueType);
+      String subComparison =
+          compareEqualsCode(resolvedType.valueType, 'a', 'b');
+      String closure = '($valueTypeName a, $valueTypeName b) => $subComparison';
+      return '_mapEqual($thisVar, $otherVar, $closure)';
+    }
+    throw new Exception(
+        "Don't know how to compare for equality: $resolvedType");
   }
 
   /**
@@ -244,6 +129,77 @@
   }
 
   /**
+   * Emit a convenience constructor for decoding a piece of protocol, if
+   * appropriate.  Return true if a constructor was emitted.
+   */
+  bool emitConvenienceConstructor(String className, ImpliedType impliedType) {
+    // The type of object from which this piece of protocol should be decoded.
+    String inputType;
+    // The name of the input object.
+    String inputName;
+    // The field within the input object to decode.
+    String fieldName;
+    // Constructor call to create the JsonDecoder object.
+    String makeDecoder;
+    // Name of the constructor to create.
+    String constructorName;
+    // Extra arguments for the constructor.
+    List<String> extraArgs = <String>[];
+    switch (impliedType.kind) {
+      case 'requestParams':
+        inputType = 'Request';
+        inputName = 'request';
+        fieldName = '_params';
+        makeDecoder = 'new RequestDecoder(request)';
+        constructorName = 'fromRequest';
+        break;
+      case 'requestResult':
+        inputType = 'Response';
+        inputName = 'response';
+        fieldName = '_result';
+        makeDecoder =
+            'new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id))';
+        constructorName = 'fromResponse';
+        break;
+      case 'notificationParams':
+        inputType = 'Notification';
+        inputName = 'notification';
+        fieldName = '_params';
+        makeDecoder = 'new ResponseDecoder(null)';
+        constructorName = 'fromNotification';
+        break;
+      case 'refactoringOptions':
+        inputType = 'EditGetRefactoringParams';
+        inputName = 'refactoringParams';
+        fieldName = 'options';
+        makeDecoder = 'new RequestDecoder(request)';
+        constructorName = 'fromRefactoringParams';
+        extraArgs.add('Request request');
+        break;
+      default:
+        return false;
+    }
+    List<String> args = ['$inputType $inputName'];
+    args.addAll(extraArgs);
+    writeln('factory $className.$constructorName(${args.join(', ')}) {');
+    indent(() {
+      String fieldNameString =
+          literalString(fieldName.replaceFirst(new RegExp('^_'), ''));
+      if (className == 'EditGetRefactoringParams') {
+        writeln('var params = new $className.fromJson(');
+        writeln('    $makeDecoder, $fieldNameString, $inputName.$fieldName);');
+        writeln('REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind;');
+        writeln('return params;');
+      } else {
+        writeln('return new $className.fromJson(');
+        writeln('    $makeDecoder, $fieldNameString, $inputName.$fieldName);');
+      }
+    });
+    writeln('}');
+    return true;
+  }
+
+  /**
    * Emit a class representing an data structure that doesn't exist in the
    * protocol because it is empty (e.g. the "params" object for a request that
    * doesn't have any parameters).
@@ -273,6 +229,108 @@
   }
 
   /**
+   * Emit a class to encapsulate an enum.
+   */
+  void emitEnumClass(String className, TypeEnum type, ImpliedType impliedType) {
+    docComment(toHtmlVisitor.collectHtml(() {
+      toHtmlVisitor.p(() {
+        toHtmlVisitor.write(impliedType.humanReadableName);
+      });
+      if (impliedType.type != null) {
+        toHtmlVisitor.showType(null, impliedType.type);
+      }
+    }));
+    writeln('class $className implements Enum {');
+    indent(() {
+      if (emitSpecialStaticMembers(className)) {
+        writeln();
+      }
+      for (TypeEnumValue value in type.values) {
+        docComment(toHtmlVisitor.collectHtml(() {
+          toHtmlVisitor.translateHtml(value.html);
+        }));
+        String valueString = literalString(value.value);
+        writeln(
+            'static const ${value.value} = const $className._($valueString);');
+        writeln();
+      }
+      writeln('final String name;');
+      writeln();
+      writeln('const $className._(this.name);');
+      writeln();
+      emitEnumClassConstructor(className, type);
+      writeln();
+      emitEnumFromJsonConstructor(className, type, impliedType);
+      writeln();
+      if (emitSpecialConstructors(className)) {
+        writeln();
+      }
+      if (emitSpecialGetters(className)) {
+        writeln();
+      }
+      if (emitSpecialMethods(className)) {
+        writeln();
+      }
+      writeln('@override');
+      writeln('String toString() => "$className.\$name";');
+      writeln();
+      writeln('String toJson() => name;');
+    });
+    writeln('}');
+  }
+
+  /**
+   * Emit the constructor for an enum class.
+   */
+  void emitEnumClassConstructor(String className, TypeEnum type) {
+    writeln('factory $className(String name) {');
+    indent(() {
+      writeln('switch (name) {');
+      indent(() {
+        for (TypeEnumValue value in type.values) {
+          String valueString = literalString(value.value);
+          writeln('case $valueString:');
+          indent(() {
+            writeln('return ${value.value};');
+          });
+        }
+      });
+      writeln('}');
+      writeln(r"throw new Exception('Illegal enum value: $name');");
+    });
+    writeln('}');
+  }
+
+  /**
+   * Emit the method for decoding an enum from JSON.
+   */
+  void emitEnumFromJsonConstructor(String className, TypeEnum type,
+      ImpliedType impliedType) {
+    writeln(
+        'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {');
+    indent(() {
+      writeln('if (json is String) {');
+      indent(() {
+        writeln('try {');
+        indent(() {
+          writeln('return new $className(json);');
+        });
+        writeln('} catch(_) {');
+        indent(() {
+          writeln('// Fall through');
+        });
+        writeln('}');
+      });
+      writeln('}');
+      String humanReadableNameString =
+          literalString(impliedType.humanReadableName);
+      writeln(
+          'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString);');
+    });
+    writeln('}');
+  }
+
+  /**
    * Emit the class to encapsulate an object type.
    */
   void emitObjectClass(String className, TypeObject type,
@@ -345,46 +403,208 @@
   }
 
   /**
-   * If the class named [className] requires special static members, emit them
-   * and return true.
+   * Emit the constructor for an object class.
    */
-  bool emitSpecialStaticMembers(String className) {
-    switch (className) {
-      case 'Element':
-        List<String> makeFlagsArgs = <String>[];
-        List<String> makeFlagsStatements = <String>[];
-        specialElementFlags.forEach((String name, String value) {
-          String flag = 'FLAG_${name.toUpperCase()}';
-          String camelName = camelJoin(['is', name]);
-          writeln('static const int $flag = $value;');
-          makeFlagsArgs.add('$camelName: false');
-          makeFlagsStatements.add('if ($camelName) flags |= $flag;');
-        });
-        writeln();
-        writeln('static int makeFlags({${makeFlagsArgs.join(', ')}}) {');
-        indent(() {
-          writeln('int flags = 0;');
-          for (String statement in makeFlagsStatements) {
-            writeln(statement);
+  void emitObjectConstructor(TypeObject type, String className) {
+    List<String> args = <String>[];
+    List<String> optionalArgs = <String>[];
+    List<CodegenCallback> extraInitCode = <CodegenCallback>[];
+    for (TypeObjectField field in type.fields) {
+      if (field.value != null) {
+        continue;
+      }
+      String arg = 'this.${field.name}';
+      if (isOptionalConstructorArg(className, field)) {
+        optionalArgs.add(arg);
+        if (!field.optional) {
+          // Optional constructor arg, but non-optional field.  If no arg is
+          // given, the constructor should populate with the empty list.
+          TypeDecl fieldType = field.type;
+          if (fieldType is TypeList) {
+            extraInitCode.add(() {
+              writeln('if (${field.name} == null) {');
+              indent(() {
+                writeln('${field.name} = <${dartType(fieldType.itemType)}>[];');
+              });
+              writeln('}');
+            });
+          } else {
+            throw new Exception(
+                "Don't know how to create default field value.");
           }
-          writeln('return flags;');
-        });
-        writeln('}');
-        return true;
-      case 'SourceEdit':
-        docComment(
-            [
-                new dom.Text(
-                    'Get the result of applying a set of ' +
-                        '[edits] to the given [code].  Edits are applied in the order ' +
-                        'they appear in [edits].')]);
-        writeln(
-            'static String applySequence(String code, Iterable<SourceEdit> edits) =>');
-        writeln('    _applySequence(code, edits);');
-        return true;
-      default:
-        return false;
+        }
+      } else {
+        args.add(arg);
+      }
     }
+    if (optionalArgs.isNotEmpty) {
+      args.add('{${optionalArgs.join(', ')}}');
+    }
+    write('$className(${args.join(', ')})');
+    if (extraInitCode.isEmpty) {
+      writeln(';');
+    } else {
+      writeln(' {');
+      indent(() {
+        for (CodegenCallback callback in extraInitCode) {
+          callback();
+        }
+      });
+      writeln('}');
+    }
+  }
+
+  /**
+   * Emit the operator== code for an object class.
+   */
+  void emitObjectEqualsMember(TypeObject type, String className) {
+    writeln('@override');
+    writeln('bool operator==(other) {');
+    indent(() {
+      writeln('if (other is $className) {');
+      indent(() {
+        var comparisons = <String>[];
+        if (type != null) {
+          for (TypeObjectField field in type.fields) {
+            if (field.value != null) {
+              continue;
+            }
+            comparisons.add(
+                compareEqualsCode(field.type, field.name, 'other.${field.name}'));
+          }
+        }
+        if (comparisons.isEmpty) {
+          writeln('return true;');
+        } else {
+          String concatenated = comparisons.join(' &&\n    ');
+          writeln('return $concatenated;');
+        }
+      });
+      writeln('}');
+      writeln('return false;');
+    });
+    writeln('}');
+  }
+
+  /**
+   * Emit the method for decoding an object from JSON.
+   */
+  void emitObjectFromJsonConstructor(String className, TypeObject type,
+      ImpliedType impliedType) {
+    String humanReadableNameString =
+        literalString(impliedType.humanReadableName);
+    if (className == 'RefactoringFeedback') {
+      writeln(
+          'factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, '
+              'String jsonPath, Object json, Map responseJson) {');
+      indent(() {
+        writeln(
+            'return _refactoringFeedbackFromJson(jsonDecoder, jsonPath, '
+                'json, responseJson);');
+      });
+      writeln('}');
+      return;
+    }
+    if (className == 'RefactoringOptions') {
+      writeln(
+          'factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, '
+              'String jsonPath, Object json, RefactoringKind kind) {');
+      indent(() {
+        writeln(
+            'return _refactoringOptionsFromJson(jsonDecoder, jsonPath, ' 'json, kind);');
+      });
+      writeln('}');
+      return;
+    }
+    writeln(
+        'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {');
+    indent(() {
+      writeln('if (json == null) {');
+      indent(() {
+        writeln('json = {};');
+      });
+      writeln('}');
+      writeln('if (json is Map) {');
+      indent(() {
+        List<String> args = <String>[];
+        List<String> optionalArgs = <String>[];
+        for (TypeObjectField field in type.fields) {
+          String fieldNameString = literalString(field.name);
+          String fieldAccessor = 'json[$fieldNameString]';
+          String jsonPath = 'jsonPath + ${literalString('.${field.name}')}';
+          if (field.value != null) {
+            String valueString = literalString(field.value);
+            writeln('if ($fieldAccessor != $valueString) {');
+            indent(() {
+              writeln(
+                  'throw jsonDecoder.mismatch(jsonPath, "equal " + $valueString);');
+            });
+            writeln('}');
+            continue;
+          }
+          if (isOptionalConstructorArg(className, field)) {
+            optionalArgs.add('${field.name}: ${field.name}');
+          } else {
+            args.add(field.name);
+          }
+          TypeDecl fieldType = field.type;
+          String fieldDartType = dartType(fieldType);
+          writeln('$fieldDartType ${field.name};');
+          writeln('if (json.containsKey($fieldNameString)) {');
+          indent(() {
+            String fromJson =
+                fromJsonCode(fieldType).asSnippet(jsonPath, fieldAccessor);
+            writeln('${field.name} = $fromJson;');
+          });
+          write('}');
+          if (!field.optional) {
+            writeln(' else {');
+            indent(() {
+              writeln(
+                  "throw jsonDecoder.missingKey(jsonPath, $fieldNameString);");
+            });
+            writeln('}');
+          } else {
+            writeln();
+          }
+        }
+        args.addAll(optionalArgs);
+        writeln('return new $className(${args.join(', ')});');
+      });
+      writeln('} else {');
+      indent(() {
+        writeln(
+            'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString);');
+      });
+      writeln('}');
+    });
+    writeln('}');
+  }
+
+  /**
+   * Emit the hashCode getter for an object class.
+   */
+  void emitObjectHashCode(TypeObject type, String className) {
+    writeln('@override');
+    writeln('int get hashCode {');
+    indent(() {
+      if (type == null) {
+        writeln('return ${className.hashCode};');
+      } else {
+        writeln('int hash = 0;');
+        for (TypeObjectField field in type.fields) {
+          String valueToCombine;
+          if (field.value != null) {
+            valueToCombine = field.value.hashCode.toString();
+          } else {
+            valueToCombine = '${field.name}.hashCode';
+          }
+          writeln('hash = _JenkinsSmiHash.combine(hash, $valueToCombine);');
+        }
+        writeln('return _JenkinsSmiHash.finish(hash);');
+      }
+    });
+    writeln('}');
   }
 
   /**
@@ -500,69 +720,46 @@
   }
 
   /**
-   * Emit the constructor for an object class.
+   * If the class named [className] requires special static members, emit them
+   * and return true.
    */
-  void emitObjectConstructor(TypeObject type, String className) {
-    List<String> args = <String>[];
-    List<String> optionalArgs = <String>[];
-    List<CodegenCallback> extraInitCode = <CodegenCallback>[];
-    for (TypeObjectField field in type.fields) {
-      if (field.value != null) {
-        continue;
-      }
-      String arg = 'this.${field.name}';
-      if (isOptionalConstructorArg(className, field)) {
-        optionalArgs.add(arg);
-        if (!field.optional) {
-          // Optional constructor arg, but non-optional field.  If no arg is
-          // given, the constructor should populate with the empty list.
-          TypeDecl fieldType = field.type;
-          if (fieldType is TypeList) {
-            extraInitCode.add(() {
-              writeln('if (${field.name} == null) {');
-              indent(() {
-                writeln('${field.name} = <${dartType(fieldType.itemType)}>[];');
-              });
-              writeln('}');
-            });
-          } else {
-            throw new Exception(
-                "Don't know how to create default field value.");
+  bool emitSpecialStaticMembers(String className) {
+    switch (className) {
+      case 'Element':
+        List<String> makeFlagsArgs = <String>[];
+        List<String> makeFlagsStatements = <String>[];
+        specialElementFlags.forEach((String name, String value) {
+          String flag = 'FLAG_${name.toUpperCase()}';
+          String camelName = camelJoin(['is', name]);
+          writeln('static const int $flag = $value;');
+          makeFlagsArgs.add('$camelName: false');
+          makeFlagsStatements.add('if ($camelName) flags |= $flag;');
+        });
+        writeln();
+        writeln('static int makeFlags({${makeFlagsArgs.join(', ')}}) {');
+        indent(() {
+          writeln('int flags = 0;');
+          for (String statement in makeFlagsStatements) {
+            writeln(statement);
           }
-        }
-      } else {
-        args.add(arg);
-      }
+          writeln('return flags;');
+        });
+        writeln('}');
+        return true;
+      case 'SourceEdit':
+        docComment(
+            [
+                new dom.Text(
+                    'Get the result of applying a set of ' +
+                        '[edits] to the given [code].  Edits are applied in the order ' +
+                        'they appear in [edits].')]);
+        writeln(
+            'static String applySequence(String code, Iterable<SourceEdit> edits) =>');
+        writeln('    _applySequence(code, edits);');
+        return true;
+      default:
+        return false;
     }
-    if (optionalArgs.isNotEmpty) {
-      args.add('{${optionalArgs.join(', ')}}');
-    }
-    write('$className(${args.join(', ')})');
-    if (extraInitCode.isEmpty) {
-      writeln(';');
-    } else {
-      writeln(' {');
-      indent(() {
-        for (CodegenCallback callback in extraInitCode) {
-          callback();
-        }
-      });
-      writeln('}');
-    }
-  }
-
-  /**
-   * True if the constructor argument for the given field should be optional.
-   */
-  bool isOptionalConstructorArg(String className, TypeObjectField field) {
-    if (field.optional) {
-      return true;
-    }
-    List<String> forceOptional = _optionalConstructorArguments[className];
-    if (forceOptional != null && forceOptional.contains(field.name)) {
-      return true;
-    }
-    return false;
   }
 
   /**
@@ -596,6 +793,25 @@
   }
 
   /**
+   * Emit the toNotification() code for a class, if appropriate.  Returns true
+   * if code was emitted.
+   */
+  bool emitToNotificationMember(ImpliedType impliedType) {
+    if (impliedType.kind == 'notificationParams') {
+      writeln('Notification toNotification() {');
+      indent(() {
+        String eventString =
+            literalString((impliedType.apiNode as Notification).longEvent);
+        String jsonPart = impliedType.type != null ? 'toJson()' : 'null';
+        writeln('return new Notification($eventString, $jsonPart);');
+      });
+      writeln('}');
+      return true;
+    }
+    return false;
+  }
+
+  /**
    * Emit the toRequest() code for a class, if appropriate.  Returns true if
    * code was emitted.
    */
@@ -632,364 +848,6 @@
   }
 
   /**
-   * Emit the toNotification() code for a class, if appropriate.  Returns true
-   * if code was emitted.
-   */
-  bool emitToNotificationMember(ImpliedType impliedType) {
-    if (impliedType.kind == 'notificationParams') {
-      writeln('Notification toNotification() {');
-      indent(() {
-        String eventString =
-            literalString((impliedType.apiNode as Notification).longEvent);
-        String jsonPart = impliedType.type != null ? 'toJson()' : 'null';
-        writeln('return new Notification($eventString, $jsonPart);');
-      });
-      writeln('}');
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * Emit the operator== code for an object class.
-   */
-  void emitObjectEqualsMember(TypeObject type, String className) {
-    writeln('@override');
-    writeln('bool operator==(other) {');
-    indent(() {
-      writeln('if (other is $className) {');
-      indent(() {
-        var comparisons = <String>[];
-        if (type != null) {
-          for (TypeObjectField field in type.fields) {
-            if (field.value != null) {
-              continue;
-            }
-            comparisons.add(
-                compareEqualsCode(field.type, field.name, 'other.${field.name}'));
-          }
-        }
-        if (comparisons.isEmpty) {
-          writeln('return true;');
-        } else {
-          String concatenated = comparisons.join(' &&\n    ');
-          writeln('return $concatenated;');
-        }
-      });
-      writeln('}');
-      writeln('return false;');
-    });
-    writeln('}');
-  }
-
-  /**
-   * Emit the hashCode getter for an object class.
-   */
-  void emitObjectHashCode(TypeObject type, String className) {
-    writeln('@override');
-    writeln('int get hashCode {');
-    indent(() {
-      if (type == null) {
-        writeln('return ${className.hashCode};');
-      } else {
-        writeln('int hash = 0;');
-        for (TypeObjectField field in type.fields) {
-          String valueToCombine;
-          if (field.value != null) {
-            valueToCombine = field.value.hashCode.toString();
-          } else {
-            valueToCombine = '${field.name}.hashCode';
-          }
-          writeln('hash = _JenkinsSmiHash.combine(hash, $valueToCombine);');
-        }
-        writeln('return _JenkinsSmiHash.finish(hash);');
-      }
-    });
-    writeln('}');
-  }
-
-  /**
-   * Emit a class to encapsulate an enum.
-   */
-  void emitEnumClass(String className, TypeEnum type, ImpliedType impliedType) {
-    docComment(toHtmlVisitor.collectHtml(() {
-      toHtmlVisitor.p(() {
-        toHtmlVisitor.write(impliedType.humanReadableName);
-      });
-      if (impliedType.type != null) {
-        toHtmlVisitor.showType(null, impliedType.type);
-      }
-    }));
-    writeln('class $className implements Enum {');
-    indent(() {
-      if (emitSpecialStaticMembers(className)) {
-        writeln();
-      }
-      for (TypeEnumValue value in type.values) {
-        docComment(toHtmlVisitor.collectHtml(() {
-          toHtmlVisitor.translateHtml(value.html);
-        }));
-        String valueString = literalString(value.value);
-        writeln(
-            'static const ${value.value} = const $className._($valueString);');
-        writeln();
-      }
-      writeln('final String name;');
-      writeln();
-      writeln('const $className._(this.name);');
-      writeln();
-      emitEnumClassConstructor(className, type);
-      writeln();
-      emitEnumFromJsonConstructor(className, type, impliedType);
-      writeln();
-      if (emitSpecialConstructors(className)) {
-        writeln();
-      }
-      if (emitSpecialGetters(className)) {
-        writeln();
-      }
-      if (emitSpecialMethods(className)) {
-        writeln();
-      }
-      writeln('@override');
-      writeln('String toString() => "$className.\$name";');
-      writeln();
-      writeln('String toJson() => name;');
-    });
-    writeln('}');
-  }
-
-  /**
-   * Emit the constructor for an enum class.
-   */
-  void emitEnumClassConstructor(String className, TypeEnum type) {
-    writeln('factory $className(String name) {');
-    indent(() {
-      writeln('switch (name) {');
-      indent(() {
-        for (TypeEnumValue value in type.values) {
-          String valueString = literalString(value.value);
-          writeln('case $valueString:');
-          indent(() {
-            writeln('return ${value.value};');
-          });
-        }
-      });
-      writeln('}');
-      writeln(r"throw new Exception('Illegal enum value: $name');");
-    });
-    writeln('}');
-  }
-
-  /**
-   * Compute the code necessary to convert [type] to JSON.
-   */
-  ToJsonCode toJsonCode(TypeDecl type) {
-    TypeDecl resolvedType = resolveTypeReferenceChain(type);
-    if (resolvedType is TypeReference) {
-      return new ToJsonIdentity(dartType(type));
-    } else if (resolvedType is TypeList) {
-      ToJsonCode itemCode = toJsonCode(resolvedType.itemType);
-      if (itemCode.isIdentity) {
-        return new ToJsonIdentity(dartType(type));
-      } else {
-        return new ToJsonSnippet(
-            dartType(type),
-            (String value) => '$value.map(${itemCode.asClosure}).toList()');
-      }
-    } else if (resolvedType is TypeMap) {
-      ToJsonCode keyCode;
-      if (dartType(resolvedType.keyType) != 'String') {
-        keyCode = toJsonCode(resolvedType.keyType);
-      } else {
-        keyCode = new ToJsonIdentity(dartType(resolvedType.keyType));
-      }
-      ToJsonCode valueCode = toJsonCode(resolvedType.valueType);
-      if (keyCode.isIdentity && valueCode.isIdentity) {
-        return new ToJsonIdentity(dartType(resolvedType));
-      } else {
-        return new ToJsonSnippet(dartType(type), (String value) {
-          StringBuffer result = new StringBuffer();
-          result.write('mapMap($value');
-          if (!keyCode.isIdentity) {
-            result.write(', keyCallback: ${keyCode.asClosure}');
-          }
-          if (!valueCode.isIdentity) {
-            result.write(', valueCallback: ${valueCode.asClosure}');
-          }
-          result.write(')');
-          return result.toString();
-        });
-      }
-    } else if (resolvedType is TypeUnion) {
-      for (TypeDecl choice in resolvedType.choices) {
-        if (resolveTypeReferenceChain(choice) is! TypeObject) {
-          throw new Exception('Union types must be unions of objects');
-        }
-      }
-      return new ToJsonSnippet(
-          dartType(type),
-          (String value) => '$value.toJson()');
-    } else if (resolvedType is TypeObject || resolvedType is TypeEnum) {
-      return new ToJsonSnippet(
-          dartType(type),
-          (String value) => '$value.toJson()');
-    } else {
-      throw new Exception("Can't convert $resolvedType from JSON");
-    }
-  }
-
-  /**
-   * Compute the code necessary to compare two objects for equality.
-   */
-  String compareEqualsCode(TypeDecl type, String thisVar, String otherVar) {
-    TypeDecl resolvedType = resolveTypeReferenceChain(type);
-    if (resolvedType is TypeReference ||
-        resolvedType is TypeEnum ||
-        resolvedType is TypeObject ||
-        resolvedType is TypeUnion) {
-      return '$thisVar == $otherVar';
-    } else if (resolvedType is TypeList) {
-      String itemTypeName = dartType(resolvedType.itemType);
-      String subComparison = compareEqualsCode(resolvedType.itemType, 'a', 'b');
-      String closure = '($itemTypeName a, $itemTypeName b) => $subComparison';
-      return '_listEqual($thisVar, $otherVar, $closure)';
-    } else if (resolvedType is TypeMap) {
-      String valueTypeName = dartType(resolvedType.valueType);
-      String subComparison =
-          compareEqualsCode(resolvedType.valueType, 'a', 'b');
-      String closure = '($valueTypeName a, $valueTypeName b) => $subComparison';
-      return '_mapEqual($thisVar, $otherVar, $closure)';
-    }
-    throw new Exception(
-        "Don't know how to compare for equality: $resolvedType");
-  }
-
-  /**
-   * Emit the method for decoding an object from JSON.
-   */
-  void emitObjectFromJsonConstructor(String className, TypeObject type,
-      ImpliedType impliedType) {
-    String humanReadableNameString =
-        literalString(impliedType.humanReadableName);
-    if (className == 'RefactoringFeedback') {
-      writeln(
-          'factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, '
-              'String jsonPath, Object json, Map responseJson) {');
-      indent(() {
-        writeln(
-            'return _refactoringFeedbackFromJson(jsonDecoder, jsonPath, '
-                'json, responseJson);');
-      });
-      writeln('}');
-      return;
-    }
-    if (className == 'RefactoringOptions') {
-      writeln(
-          'factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, '
-              'String jsonPath, Object json, RefactoringKind kind) {');
-      indent(() {
-        writeln(
-            'return _refactoringOptionsFromJson(jsonDecoder, jsonPath, ' 'json, kind);');
-      });
-      writeln('}');
-      return;
-    }
-    writeln(
-        'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {');
-    indent(() {
-      writeln('if (json == null) {');
-      indent(() {
-        writeln('json = {};');
-      });
-      writeln('}');
-      writeln('if (json is Map) {');
-      indent(() {
-        List<String> args = <String>[];
-        List<String> optionalArgs = <String>[];
-        for (TypeObjectField field in type.fields) {
-          String fieldNameString = literalString(field.name);
-          String fieldAccessor = 'json[$fieldNameString]';
-          String jsonPath = 'jsonPath + ${literalString('.${field.name}')}';
-          if (field.value != null) {
-            String valueString = literalString(field.value);
-            writeln('if ($fieldAccessor != $valueString) {');
-            indent(() {
-              writeln(
-                  'throw jsonDecoder.mismatch(jsonPath, "equal " + $valueString);');
-            });
-            writeln('}');
-            continue;
-          }
-          if (isOptionalConstructorArg(className, field)) {
-            optionalArgs.add('${field.name}: ${field.name}');
-          } else {
-            args.add(field.name);
-          }
-          TypeDecl fieldType = field.type;
-          String fieldDartType = dartType(fieldType);
-          writeln('$fieldDartType ${field.name};');
-          writeln('if (json.containsKey($fieldNameString)) {');
-          indent(() {
-            String fromJson =
-                fromJsonCode(fieldType).asSnippet(jsonPath, fieldAccessor);
-            writeln('${field.name} = $fromJson;');
-          });
-          write('}');
-          if (!field.optional) {
-            writeln(' else {');
-            indent(() {
-              writeln(
-                  "throw jsonDecoder.missingKey(jsonPath, $fieldNameString);");
-            });
-            writeln('}');
-          } else {
-            writeln();
-          }
-        }
-        args.addAll(optionalArgs);
-        writeln('return new $className(${args.join(', ')});');
-      });
-      writeln('} else {');
-      indent(() {
-        writeln(
-            'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString);');
-      });
-      writeln('}');
-    });
-    writeln('}');
-  }
-
-  /**
-   * Emit the method for decoding an enum from JSON.
-   */
-  void emitEnumFromJsonConstructor(String className, TypeEnum type,
-      ImpliedType impliedType) {
-    writeln(
-        'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {');
-    indent(() {
-      writeln('if (json is String) {');
-      indent(() {
-        writeln('try {');
-        indent(() {
-          writeln('return new $className(json);');
-        });
-        writeln('} catch(_) {');
-        indent(() {
-          writeln('// Fall through');
-        });
-        writeln('}');
-      });
-      writeln('}');
-      String humanReadableNameString =
-          literalString(impliedType.humanReadableName);
-      writeln(
-          'throw jsonDecoder.mismatch(jsonPath, $humanReadableNameString);');
-    });
-    writeln('}');
-  }
-
-  /**
    * Compute the code necessary to translate [type] from JSON.
    */
   FromJsonCode fromJsonCode(TypeDecl type) {
@@ -1090,74 +948,17 @@
   }
 
   /**
-   * Emit a convenience constructor for decoding a piece of protocol, if
-   * appropriate.  Return true if a constructor was emitted.
+   * True if the constructor argument for the given field should be optional.
    */
-  bool emitConvenienceConstructor(String className, ImpliedType impliedType) {
-    // The type of object from which this piece of protocol should be decoded.
-    String inputType;
-    // The name of the input object.
-    String inputName;
-    // The field within the input object to decode.
-    String fieldName;
-    // Constructor call to create the JsonDecoder object.
-    String makeDecoder;
-    // Name of the constructor to create.
-    String constructorName;
-    // Extra arguments for the constructor.
-    List<String> extraArgs = <String>[];
-    switch (impliedType.kind) {
-      case 'requestParams':
-        inputType = 'Request';
-        inputName = 'request';
-        fieldName = '_params';
-        makeDecoder = 'new RequestDecoder(request)';
-        constructorName = 'fromRequest';
-        break;
-      case 'requestResult':
-        inputType = 'Response';
-        inputName = 'response';
-        fieldName = '_result';
-        makeDecoder =
-            'new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id))';
-        constructorName = 'fromResponse';
-        break;
-      case 'notificationParams':
-        inputType = 'Notification';
-        inputName = 'notification';
-        fieldName = '_params';
-        makeDecoder = 'new ResponseDecoder(null)';
-        constructorName = 'fromNotification';
-        break;
-      case 'refactoringOptions':
-        inputType = 'EditGetRefactoringParams';
-        inputName = 'refactoringParams';
-        fieldName = 'options';
-        makeDecoder = 'new RequestDecoder(request)';
-        constructorName = 'fromRefactoringParams';
-        extraArgs.add('Request request');
-        break;
-      default:
-        return false;
+  bool isOptionalConstructorArg(String className, TypeObjectField field) {
+    if (field.optional) {
+      return true;
     }
-    List<String> args = ['$inputType $inputName'];
-    args.addAll(extraArgs);
-    writeln('factory $className.$constructorName(${args.join(', ')}) {');
-    indent(() {
-      String fieldNameString =
-          literalString(fieldName.replaceFirst(new RegExp('^_'), ''));
-      if (className == 'EditGetRefactoringParams') {
-        writeln('var params = new $className.fromJson(');
-        writeln('    $makeDecoder, $fieldNameString, $inputName.$fieldName);');
-        writeln('REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind;');
-        writeln('return params;');
-      } else {
-        writeln('return new $className.fromJson(');
-        writeln('    $makeDecoder, $fieldNameString, $inputName.$fieldName);');
-      }
-    });
-    writeln('}');
-    return true;
+    List<String> forceOptional = _optionalConstructorArguments[className];
+    if (forceOptional != null && forceOptional.contains(field.name)) {
+      return true;
+    }
+    return false;
   }
 
   /**
@@ -1166,17 +967,216 @@
   String literalString(String s) {
     return JSON.encode(s);
   }
+
+  /**
+   * Compute the code necessary to convert [type] to JSON.
+   */
+  ToJsonCode toJsonCode(TypeDecl type) {
+    TypeDecl resolvedType = resolveTypeReferenceChain(type);
+    if (resolvedType is TypeReference) {
+      return new ToJsonIdentity(dartType(type));
+    } else if (resolvedType is TypeList) {
+      ToJsonCode itemCode = toJsonCode(resolvedType.itemType);
+      if (itemCode.isIdentity) {
+        return new ToJsonIdentity(dartType(type));
+      } else {
+        return new ToJsonSnippet(
+            dartType(type),
+            (String value) => '$value.map(${itemCode.asClosure}).toList()');
+      }
+    } else if (resolvedType is TypeMap) {
+      ToJsonCode keyCode;
+      if (dartType(resolvedType.keyType) != 'String') {
+        keyCode = toJsonCode(resolvedType.keyType);
+      } else {
+        keyCode = new ToJsonIdentity(dartType(resolvedType.keyType));
+      }
+      ToJsonCode valueCode = toJsonCode(resolvedType.valueType);
+      if (keyCode.isIdentity && valueCode.isIdentity) {
+        return new ToJsonIdentity(dartType(resolvedType));
+      } else {
+        return new ToJsonSnippet(dartType(type), (String value) {
+          StringBuffer result = new StringBuffer();
+          result.write('mapMap($value');
+          if (!keyCode.isIdentity) {
+            result.write(', keyCallback: ${keyCode.asClosure}');
+          }
+          if (!valueCode.isIdentity) {
+            result.write(', valueCallback: ${valueCode.asClosure}');
+          }
+          result.write(')');
+          return result.toString();
+        });
+      }
+    } else if (resolvedType is TypeUnion) {
+      for (TypeDecl choice in resolvedType.choices) {
+        if (resolveTypeReferenceChain(choice) is! TypeObject) {
+          throw new Exception('Union types must be unions of objects');
+        }
+      }
+      return new ToJsonSnippet(
+          dartType(type),
+          (String value) => '$value.toJson()');
+    } else if (resolvedType is TypeObject || resolvedType is TypeEnum) {
+      return new ToJsonSnippet(
+          dartType(type),
+          (String value) => '$value.toJson()');
+    } else {
+      throw new Exception("Can't convert $resolvedType from JSON");
+    }
+  }
+
+  @override
+  visitApi() {
+    outputHeader();
+    writeln();
+    writeln('part of protocol;');
+    emitClasses();
+  }
 }
 
-final GeneratedFile target =
-    new GeneratedFile('../../lib/src/generated_protocol.dart', () {
-  CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi());
-  return visitor.collectCode(visitor.visitApi);
-});
+/**
+ * Container for code that can be used to translate a data type from JSON.
+ */
+abstract class FromJsonCode {
+  /**
+   * Get the translation code in the form of a closure.
+   */
+  String get asClosure;
+
+  /**
+   * True if the data type is already in JSON form, so the translation is the
+   * identity function.
+   */
+  bool get isIdentity;
+
+  /**
+   * Get the translation code in the form of a code snippet, where [jsonPath]
+   * is the variable holding the JSON path, and [json] is the variable holding
+   * the raw JSON.
+   */
+  String asSnippet(String jsonPath, String json);
+}
 
 /**
- * Translate spec_input.html into protocol_matchers.dart.
+ * Representation of FromJsonCode for a function defined elsewhere.
  */
-main() {
-  target.generate();
+class FromJsonFunction extends FromJsonCode {
+  final String asClosure;
+
+  FromJsonFunction(this.asClosure);
+
+  @override
+  bool get isIdentity => false;
+
+  @override
+  String asSnippet(String jsonPath, String json) =>
+      '$asClosure($jsonPath, $json)';
+}
+
+/**
+ * Representation of FromJsonCode for the identity transformation.
+ */
+class FromJsonIdentity extends FromJsonSnippet {
+  FromJsonIdentity() : super((String jsonPath, String json) => json);
+
+  @override
+  bool get isIdentity => true;
+}
+
+/**
+ * Representation of FromJsonCode for a snippet of inline code.
+ */
+class FromJsonSnippet extends FromJsonCode {
+  /**
+   * Callback that can be used to generate the code snippet, once the names
+   * of the [jsonPath] and [json] variables are known.
+   */
+  final FromJsonSnippetCallback callback;
+
+  FromJsonSnippet(this.callback);
+
+  @override
+  String get asClosure =>
+      '(String jsonPath, Object json) => ${callback('jsonPath', 'json')}';
+
+  @override
+  bool get isIdentity => false;
+
+  @override
+  String asSnippet(String jsonPath, String json) => callback(jsonPath, json);
+}
+
+/**
+ * Container for code that can be used to translate a data type to JSON.
+ */
+abstract class ToJsonCode {
+  /**
+   * Get the translation code in the form of a closure.
+   */
+  String get asClosure;
+
+  /**
+   * True if the data type is already in JSON form, so the translation is the
+   * identity function.
+   */
+  bool get isIdentity;
+
+  /**
+   * Get the translation code in the form of a code snippet, where [value]
+   * is the variable holding the object to be translated.
+   */
+  String asSnippet(String value);
+}
+
+/**
+ * Representation of ToJsonCode for a function defined elsewhere.
+ */
+class ToJsonFunction extends ToJsonCode {
+  final String asClosure;
+
+  ToJsonFunction(this.asClosure);
+
+  @override
+  bool get isIdentity => false;
+
+  @override
+  String asSnippet(String value) => '$asClosure($value)';
+}
+
+/**
+ * Representation of FromJsonCode for the identity transformation.
+ */
+class ToJsonIdentity extends ToJsonSnippet {
+  ToJsonIdentity(String type) : super(type, (String value) => value);
+
+  @override
+  bool get isIdentity => true;
+}
+
+/**
+ * Representation of ToJsonCode for a snippet of inline code.
+ */
+class ToJsonSnippet extends ToJsonCode {
+  /**
+   * Callback that can be used to generate the code snippet, once the name
+   * of the [value] variable is known.
+   */
+  final ToJsonSnippetCallback callback;
+
+  /**
+   * Dart type of the [value] variable.
+   */
+  final String type;
+
+  ToJsonSnippet(this.type, this.callback);
+
+  @override
+  String get asClosure => '($type value) => ${callback('value')}';
+
+  @override
+  bool get isIdentity => false;
+
+  @override
+  String asSnippet(String value) => callback(value);
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
index 720c856..aee1765 100644
--- a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
+++ b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
@@ -15,6 +15,20 @@
 import 'from_html.dart';
 import 'to_html.dart';
 
+final GeneratedFile target =
+    new GeneratedFile('../../test/integration/integration_test_methods.dart', () {
+  CodegenInttestMethodsVisitor visitor =
+      new CodegenInttestMethodsVisitor(readApi());
+  return visitor.collectCode(visitor.visitApi);
+});
+
+/**
+ * Translate spec_input.html into protocol_matchers.dart.
+ */
+main() {
+  target.generate();
+}
+
 /**
  * Visitor that generates the code for integration_test_methods.dart
  */
@@ -40,6 +54,45 @@
       : super(api),
         toHtmlVisitor = new ToHtmlVisitor(api);
 
+  /**
+   * Generate a function argument for the given parameter field.
+   */
+  String formatArgument(TypeObjectField field) =>
+      '${dartType(field.type)} ${field.name}';
+
+  /**
+   * Figure out the appropriate Dart type for data having the given API
+   * protocol [type].
+   */
+  String jsonType(TypeDecl type) {
+    type = resolveTypeReferenceChain(type);
+    if (type is TypeEnum) {
+      return 'String';
+    } else if (type is TypeList) {
+      return 'List<${jsonType(type.itemType)}>';
+    } else if (type is TypeMap) {
+      return 'Map<String, ${jsonType(type.valueType)}>';
+    } else if (type is TypeObject) {
+      return 'Map<String, dynamic>';
+    } else if (type is TypeReference) {
+      switch (type.typeName) {
+        case 'String':
+        case 'int':
+        case 'bool':
+          // These types correspond exactly to Dart types
+          return type.typeName;
+        case 'object':
+          return 'Map<String, dynamic>';
+        default:
+          throw new Exception(type.typeName);
+      }
+    } else if (type is TypeUnion) {
+      return 'Object';
+    } else {
+      throw new Exception('Unexpected kind of TypeDecl');
+    }
+  }
+
   @override
   visitApi() {
     outputHeader();
@@ -104,7 +157,9 @@
   visitNotification(Notification notification) {
     String streamName =
         camelJoin(['on', notification.domainName, notification.event]);
-    String className = camelJoin([notification.domainName, notification.event, 'params'], doCapitalize: true);
+    String className = camelJoin(
+        [notification.domainName, notification.event, 'params'],
+        doCapitalize: true);
     writeln();
     docComment(toHtmlVisitor.collectHtml(() {
       toHtmlVisitor.translateHtml(notification.html);
@@ -130,7 +185,8 @@
         if (notification.params == null) {
           constructorCall = 'new $className()';
         } else {
-          constructorCall = "new $className.fromJson(decoder, 'params', params)";
+          constructorCall =
+              "new $className.fromJson(decoder, 'params', params)";
         }
         writeln('_$streamName.add($constructorCall);');
         writeln('break;');
@@ -210,57 +266,4 @@
     });
     writeln('}');
   }
-
-  /**
-   * Generate a function argument for the given parameter field.
-   */
-  String formatArgument(TypeObjectField field) =>
-      '${dartType(field.type)} ${field.name}';
-
-  /**
-   * Figure out the appropriate Dart type for data having the given API
-   * protocol [type].
-   */
-  String jsonType(TypeDecl type) {
-    type = resolveTypeReferenceChain(type);
-    if (type is TypeEnum) {
-      return 'String';
-    } else if (type is TypeList) {
-      return 'List<${jsonType(type.itemType)}>';
-    } else if (type is TypeMap) {
-      return 'Map<String, ${jsonType(type.valueType)}>';
-    } else if (type is TypeObject) {
-      return 'Map<String, dynamic>';
-    } else if (type is TypeReference) {
-      switch (type.typeName) {
-        case 'String':
-        case 'int':
-        case 'bool':
-          // These types correspond exactly to Dart types
-          return type.typeName;
-        case 'object':
-          return 'Map<String, dynamic>';
-        default:
-          throw new Exception(type.typeName);
-      }
-    } else if (type is TypeUnion) {
-      return 'Object';
-    } else {
-      throw new Exception('Unexpected kind of TypeDecl');
-    }
-  }
-}
-
-final GeneratedFile target =
-    new GeneratedFile('../../test/integration/integration_test_methods.dart', () {
-  CodegenInttestMethodsVisitor visitor =
-      new CodegenInttestMethodsVisitor(readApi());
-  return visitor.collectCode(visitor.visitApi);
-});
-
-/**
- * Translate spec_input.html into protocol_matchers.dart.
- */
-main() {
-  target.generate();
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_java.dart b/pkg/analysis_server/tool/spec/codegen_java.dart
index bec7dd6..a8d9200 100644
--- a/pkg/analysis_server/tool/spec/codegen_java.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java.dart
@@ -8,17 +8,37 @@
 library CodegenJava;
 
 import 'package:html5lib/dom.dart' as dom;
+
 import 'api.dart';
 import 'codegen_tools.dart';
 import 'from_html.dart';
 import 'to_html.dart';
 
 /**
+ * Create a [GeneratedFile] that creates Java code and outputs it to [path].
+ * [path] uses Posix-style path separators regardless of the OS.
+ */
+GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor
+    createVisitor(Api api)) {
+  return new GeneratedFile(path, () {
+    CodegenJavaVisitor visitor = createVisitor(readApi());
+    return visitor.collectCode(visitor.visitApi);
+  });
+}
+
+/**
+ * Iterate through the values in [map] in the order of increasing keys.
+ */
+Iterable<String> _valuesSortedByKey(Map<String, String> map) {
+  List<String> keys = map.keys.toList();
+  keys.sort();
+  return keys.map((String key) => map[key]);
+}
+
+/**
  * Common code for all Java code generation.
  */
 class CodegenJavaVisitor extends HierarchicalApiVisitor with CodeGenerator {
-  _CodegenJavaState _state;
-
   /**
    * Variable names which must be changed in order to avoid conflict with
    * reserved words in Java.
@@ -40,6 +60,8 @@
     'Override': 'OverrideMember',
   };
 
+  _CodegenJavaState _state;
+
   /**
    * Visitor used to produce doc comments.
    */
@@ -50,27 +72,6 @@
         toHtmlVisitor = new ToHtmlVisitor(api);
 
   /**
-   * Convenience method for subclasses for calling docComment.
-   */
-  void javadocComment(List<dom.Node> docs) {
-    docComment(docs, width: 99, javadocStyle: true);
-  }
-
-  /**
-   * Create a public field, using [callback] to create its contents.
-   */
-  void publicField(String fieldName, void callback()) {
-    _state.publicFields[fieldName] = collectCode(callback);
-  }
-
-  /**
-   * Create a private field, using [callback] to create its contents.
-   */
-  void privateField(String fieldName, void callback()) {
-    _state.privateFields[fieldName] = collectCode(callback);
-  }
-
-  /**
    * Create a constructor, using [callback] to create its contents.
    */
   void constructor(String name, void callback()) {
@@ -78,17 +79,114 @@
   }
 
   /**
-   * Create a private method, using [callback] to create its contents.
+   * Return true iff the passed [TypeDecl] will represent an array in Java.
    */
-  void privateMethod(String methodName, void callback()) {
-    _state.privateMethods[methodName] = collectCode(callback);
+  bool isArray(TypeDecl type) {
+    return type is TypeList && isPrimitive(type.itemType);
   }
 
   /**
-   * Create a public method, using [callback] to create its contents.
+   * Return true iff the passed [TypeDecl] is a type declared in the spec_input.
    */
-  void publicMethod(String methodName, void callback()) {
-    _state.publicMethods[methodName] = collectCode(callback);
+  bool isDeclaredInSpec(TypeDecl type) {
+//    TypeReference resolvedType = super.resolveTypeReferenceChain(type);
+//    if(resolvedType is TypeObject) {
+//      return truye;
+//    }
+    if (type is TypeReference) {
+      return api.types.containsKey(type.typeName) && javaType(type) != 'String';
+    }
+    return false;
+  }
+
+  /**
+   * Return true iff the passed [TypeDecl] will represent an array in Java.
+   */
+  bool isList(TypeDecl type) {
+    return type is TypeList && !isPrimitive(type.itemType);
+  }
+
+  /**
+   * Return true iff the passed [TypeDecl] will represent a Map in type.
+   */
+  bool isMap(TypeDecl type) {
+    return type is TypeMap;
+  }
+
+  /**
+   * Return true iff the passed [TypeDecl] will be represented as Object in Java.
+   */
+  bool isObject(TypeDecl type) {
+    String typeStr = javaType(type);
+    return typeStr == 'Object';
+  }
+
+  /**
+   * Return true iff the passed [TypeDecl] will represent a primitive Java type.
+   */
+  bool isPrimitive(TypeDecl type) {
+    if (type is TypeReference) {
+      String typeStr = javaType(type);
+      return typeStr == 'boolean' || typeStr == 'int' || typeStr == 'long';
+    }
+    return false;
+  }
+
+  /**
+   * Convenience method for subclasses for calling docComment.
+   */
+  void javadocComment(List<dom.Node> docs) {
+    docComment(docs, width: 99, javadocStyle: true);
+  }
+
+  /**
+   * Return a Java type for the given [TypeObjectField].
+   */
+  String javaFieldType(TypeObjectField field) {
+    return javaType(field.type, field.optional);
+  }
+
+  /**
+   * Return a suitable representation of [name] as the name of a Java variable.
+   */
+  String javaName(String name) {
+    if (_variableRenames.containsKey(name)) {
+      return _variableRenames[name];
+    }
+    return name;
+  }
+
+  /**
+   * Convert the given [TypeDecl] to a Java type.
+   */
+  String javaType(TypeDecl type, [bool optional = false]) {
+    if (type is TypeReference) {
+      TypeReference resolvedType = resolveTypeReferenceChain(type);
+      String typeName = resolvedType.typeName;
+      if (_typeRenames.containsKey(typeName)) {
+        typeName = _typeRenames[typeName];
+        if (optional) {
+          if (typeName == 'boolean') {
+            typeName = 'Boolean';
+          } else if (typeName == 'int') {
+            typeName = 'Integer';
+          }
+        }
+      }
+      return typeName;
+    } else if (type is TypeList) {
+      if (isPrimitive(type.itemType)) {
+        return '${javaType(type.itemType)}[]';
+      } else {
+        return 'List<${javaType(type.itemType)}>';
+      }
+    } else if (type is TypeMap) {
+      return 'Map<${javaType(type.keyType)}, ${javaType(type.valueType)}>';
+    } else if (type is TypeUnion) {
+      return 'Object';
+    } else {
+      throw new Exception("Can't make type buildable");
+    }
   }
 
   /**
@@ -136,107 +234,31 @@
   }
 
   /**
-   * Return a Java type for the given [TypeObjectField].
+   * Create a private field, using [callback] to create its contents.
    */
-  String javaFieldType(TypeObjectField field) {
-    return javaType(field.type, field.optional);
+  void privateField(String fieldName, void callback()) {
+    _state.privateFields[fieldName] = collectCode(callback);
   }
 
   /**
-   * Convert the given [TypeDecl] to a Java type.
+   * Create a private method, using [callback] to create its contents.
    */
-  String javaType(TypeDecl type, [bool optional = false]) {
-    if (type is TypeReference) {
-      TypeReference resolvedType = resolveTypeReferenceChain(type);
-      String typeName = resolvedType.typeName;
-      if (_typeRenames.containsKey(typeName)) {
-        typeName = _typeRenames[typeName];
-        if (optional) {
-          if (typeName == 'boolean') {
-            typeName = 'Boolean';
-          } else if (typeName == 'int') {
-            typeName = 'Integer';
-          }
-        }
-      }
-      return typeName;
-    } else if (type is TypeList) {
-      if (isPrimitive(type.itemType)) {
-        return '${javaType(type.itemType)}[]';
-      } else {
-        return 'List<${javaType(type.itemType)}>';
-      }
-    } else if (type is TypeMap) {
-      return 'Map<${javaType(type.keyType)}, ${javaType(type.valueType)}>';
-    } else if (type is TypeUnion) {
-      return 'Object';
-    } else {
-      throw new Exception("Can't make type buildable");
-    }
+  void privateMethod(String methodName, void callback()) {
+    _state.privateMethods[methodName] = collectCode(callback);
   }
 
   /**
-   * Return true iff the passed [TypeDecl] will represent a primitive Java type.
+   * Create a public field, using [callback] to create its contents.
    */
-  bool isPrimitive(TypeDecl type) {
-    if (type is TypeReference) {
-      String typeStr = javaType(type);
-      return typeStr == 'boolean' || typeStr == 'int' || typeStr == 'long';
-    }
-    return false;
+  void publicField(String fieldName, void callback()) {
+    _state.publicFields[fieldName] = collectCode(callback);
   }
 
   /**
-   * Return true iff the passed [TypeDecl] is a type declared in the spec_input.
+   * Create a public method, using [callback] to create its contents.
    */
-  bool isDeclaredInSpec(TypeDecl type) {
-//    TypeReference resolvedType = super.resolveTypeReferenceChain(type);
-//    if(resolvedType is TypeObject) {
-//      return truye;
-//    }
-    if (type is TypeReference) {
-      return api.types.containsKey(type.typeName) && javaType(type) != 'String';
-    }
-    return false;
-  }
-
-  /**
-   * Return true iff the passed [TypeDecl] will be represented as Object in Java.
-   */
-  bool isObject(TypeDecl type) {
-    String typeStr = javaType(type);
-    return typeStr == 'Object';
-  }
-
-  /**
-   * Return true iff the passed [TypeDecl] will represent an array in Java.
-   */
-  bool isList(TypeDecl type) {
-    return type is TypeList && !isPrimitive(type.itemType);
-  }
-
-  /**
-   * Return true iff the passed [TypeDecl] will represent an array in Java.
-   */
-  bool isArray(TypeDecl type) {
-    return type is TypeList && isPrimitive(type.itemType);
-  }
-
-  /**
-   * Return true iff the passed [TypeDecl] will represent a Map in type.
-   */
-  bool isMap(TypeDecl type) {
-    return type is TypeMap;
-  }
-
-  /**
-   * Return a suitable representation of [name] as the name of a Java variable.
-   */
-  String javaName(String name) {
-    if (_variableRenames.containsKey(name)) {
-      return _variableRenames[name];
-    }
-    return name;
+  void publicMethod(String methodName, void callback()) {
+    _state.publicMethods[methodName] = collectCode(callback);
   }
 
   @override
@@ -250,15 +272,6 @@
 }
 
 /**
- * Iterate through the values in [map] in the order of increasing keys.
- */
-Iterable<String> _valuesSortedByKey(Map<String, String> map) {
-  List<String> keys = map.keys.toList();
-  keys.sort();
-  return keys.map((String key) => map[key]);
-}
-
-/**
  * State used by [CodegenJavaVisitor].
  */
 class _CodegenJavaState {
@@ -287,15 +300,3 @@
    */
   Map<String, String> constructors = <String, String>{};
 }
-
-/**
- * Create a [GeneratedFile] that creates Java code and outputs it to [path].
- * [path] uses Posix-style path separators regardless of the OS.
- */
-GeneratedFile javaGeneratedFile(String path, CodegenJavaVisitor
-    createVisitor(Api api)) {
-  return new GeneratedFile(path, () {
-    CodegenJavaVisitor visitor = createVisitor(readApi());
-    return visitor.collectCode(visitor.visitApi);
-  });
-}
diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart
index ea003cb..e459087 100644
--- a/pkg/analysis_server/tool/spec/codegen_java_types.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart
@@ -15,12 +15,64 @@
 import 'from_html.dart';
 import 'implied_types.dart';
 
-/**
- * Type references in the spec that are named something else in Java.
- */
-const Map<String, String> _typeRenames = const {
-  'Override': 'OverrideMember',
-};
+final String pathToGenTypes =
+    '../../../../editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/';
+
+final GeneratedDirectory targetDir = new GeneratedDirectory(pathToGenTypes, () {
+  Api api = readApi();
+  Map<String, ImpliedType> impliedTypes = computeImpliedTypes(api);
+  Map<String, FileContentsComputer> map =
+      new Map<String, FileContentsComputer>();
+  for (ImpliedType impliedType in impliedTypes.values) {
+    String typeNameInSpec = capitalize(impliedType.camelName);
+    bool isRefactoringFeedback = impliedType.kind == 'refactoringFeedback';
+    bool isRefactoringOption = impliedType.kind == 'refactoringOptions';
+    if (impliedType.kind == 'typeDefinition' ||
+        isRefactoringFeedback ||
+        isRefactoringOption) {
+      TypeDecl type = impliedType.type;
+      if (type is TypeObject || type is TypeEnum) {
+        // This is for situations such as 'Override' where the name in the spec
+        // doesn't match the java object that we generate:
+        String typeNameInJava = typeNameInSpec;
+        if (_typeRenames.containsKey(typeNameInSpec)) {
+          typeNameInJava = _typeRenames[typeNameInSpec];
+        }
+        map['${typeNameInJava}.java'] = () {
+          String superclassName = null;
+          if (isRefactoringFeedback) {
+            superclassName = 'RefactoringFeedback';
+          }
+          if (isRefactoringOption) {
+            superclassName = 'RefactoringOptions';
+          }
+          // configure accessors
+          bool generateGetters = true;
+          bool generateSetters = false;
+          if (isRefactoringOption ||
+              typeNameInSpec == 'RefactoringMethodParameter') {
+            generateSetters = true;
+          }
+          // create the visitor
+          CodegenJavaType visitor = new CodegenJavaType(
+              api,
+              typeNameInJava,
+              superclassName,
+              generateGetters,
+              generateSetters);
+          return visitor.collectCode(() {
+            dom.Element doc = type.html;
+            if (impliedType.apiNode is TypeDefinition) {
+              doc = (impliedType.apiNode as TypeDefinition).html;
+            }
+            visitor.emitType(type, doc);
+          });
+        };
+      }
+    }
+  }
+  return map;
+});
 
 /**
  * A map between the field names and values for the Element object such as:
@@ -52,6 +104,20 @@
   'isTopLevelOrStatic': 'TOP_LEVEL_STATIC',
 };
 
+/**
+ * Type references in the spec that are named something else in Java.
+ */
+const Map<String, String> _typeRenames = const {
+  'Override': 'OverrideMember',
+};
+
+/**
+ * Translate spec_input.html into AnalysisServer.java.
+ */
+main() {
+  targetDir.generate();
+}
+
 class CodegenJavaType extends CodegenJavaVisitor {
   final String className;
   final String superclassName;
@@ -62,6 +128,13 @@
       this.generateGetters, this.generateSetters)
       : super(api);
 
+  /**
+   * Get the name of the consumer class for responses to this request.
+   */
+  String consumerName(Request request) {
+    return camelJoin([request.method, 'consumer'], doCapitalize: true);
+  }
+
   void emitType(TypeDecl type, dom.Element html) {
     outputHeader(javaStyle: true);
     writeln('package com.google.dart.server.generated.types;');
@@ -73,6 +146,140 @@
     }
   }
 
+  String _getAsTypeMethodName(TypeDecl typeDecl) {
+    String name = javaType(typeDecl, true);
+    if (name == 'String') {
+      return 'getAsString';
+    } else if (name == 'boolean' || name == 'Boolean') {
+      return 'getAsBoolean';
+    } else if (name == 'int' || name == 'Integer') {
+      return 'getAsInt';
+    } else if (name == 'long' || name == 'Long') {
+      return 'getAsLong';
+    } else if (name.startsWith('List')) {
+      return 'getAsJsonArray';
+    } else {
+      // TODO (jwren) cleanup
+      return 'getAsJsonArray';
+    }
+  }
+
+  String _getEqualsLogicForField(TypeObjectField field, String other) {
+    String name = javaName(field.name);
+    if (isPrimitive(field.type) && !field.optional) {
+      return '${other}.${name} == ${name}';
+    } else if (isArray(field.type)) {
+      return 'Arrays.equals(other.${name}, ${name})';
+    } else {
+      return 'ObjectUtilities.equals(${other}.${name}, ${name})';
+    }
+  }
+
+  /**
+   * For some [TypeObjectField] return the [String] source for the field value
+   * for the toString generation.
+   */
+  String _getToStringForField(TypeObjectField field) {
+    String name = javaName(field.name);
+    if (isArray(field.type) || isList(field.type)) {
+      return 'StringUtils.join(${name}, ", ")';
+    } else {
+      return name;
+    }
+  }
+
+  bool _isTypeFieldInUpdateContentUnionType(String className,
+      String fieldName) {
+    if ((className == 'AddContentOverlay' ||
+        className == 'ChangeContentOverlay' ||
+        className == 'RemoveContentOverlay') &&
+        fieldName == 'type') {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * This method writes extra fields and methods to the Element type.
+   */
+  void _writeExtraContentInElementType() {
+    //
+    // Extra fields on the Element type such as:
+    // private static final int ABSTRACT = 0x01;
+    //
+    _extraFieldsOnElement.forEach((String name, String value) {
+      publicField(javaName(name), () {
+        writeln('private static final int ${name} = ${value};');
+      });
+    });
+
+    //
+    // Extra methods for the Element type such as:
+    // public boolean isFinal() {
+    //   return (flags & FINAL) != 0;
+    // }
+    //
+    _extraMethodsOnElement.forEach((String methodName, String fieldName) {
+      publicMethod(methodName, () {
+        writeln('public boolean ${methodName}() {');
+        writeln('  return (flags & ${fieldName}) != 0;');
+        writeln('}');
+      });
+    });
+  }
+
+  /**
+   * For some [TypeObjectField] write out the source that adds the field
+   * information to the 'jsonObject'.
+   */
+  void _writeOutJsonObjectAddStatement(TypeObjectField field) {
+    String name = javaName(field.name);
+    if (isDeclaredInSpec(field.type)) {
+      writeln('jsonObject.add("${name}", ${name}.toJson());');
+    } else if (field.type is TypeList) {
+      TypeDecl listItemType = (field.type as TypeList).itemType;
+      String jsonArrayName = 'jsonArray${capitalize(name)}';
+      writeln('JsonArray ${jsonArrayName} = new JsonArray();');
+      writeln('for (${javaType(listItemType)} elt : ${name}) {');
+      indent(() {
+        if (isDeclaredInSpec(listItemType)) {
+          writeln('${jsonArrayName}.add(elt.toJson());');
+        } else {
+          writeln('${jsonArrayName}.add(new JsonPrimitive(elt));');
+        }
+      });
+      writeln('}');
+      writeln('jsonObject.add("${name}", ${jsonArrayName});');
+    } else {
+      writeln('jsonObject.addProperty("${name}", ${name});');
+    }
+  }
+
+  void _writeTypeEnum(TypeDecl type, dom.Element html) {
+    javadocComment(toHtmlVisitor.collectHtml(() {
+      toHtmlVisitor.translateHtml(html);
+      toHtmlVisitor.br();
+      toHtmlVisitor.write('@coverage dart.server.generated.types');
+    }));
+    makeClass('public class ${className}', () {
+      TypeEnum typeEnum = type as TypeEnum;
+      List<TypeEnumValue> values = typeEnum.values;
+      //
+      // enum fields
+      //
+      for (TypeEnumValue value in values) {
+        privateField(javaName(value.value), () {
+          javadocComment(toHtmlVisitor.collectHtml(() {
+            toHtmlVisitor.translateHtml(value.html);
+          }));
+          writeln(
+              'public static final String ${value.value} = \"${value.value}\";');
+        });
+      }
+    });
+  }
+
   void _writeTypeObject(TypeDecl type, dom.Element html) {
     writeln('import java.util.Arrays;');
     writeln('import java.util.List;');
@@ -512,211 +719,4 @@
 
     });
   }
-
-  void _writeTypeEnum(TypeDecl type, dom.Element html) {
-    javadocComment(toHtmlVisitor.collectHtml(() {
-      toHtmlVisitor.translateHtml(html);
-      toHtmlVisitor.br();
-      toHtmlVisitor.write('@coverage dart.server.generated.types');
-    }));
-    makeClass('public class ${className}', () {
-      TypeEnum typeEnum = type as TypeEnum;
-      List<TypeEnumValue> values = typeEnum.values;
-      //
-      // enum fields
-      //
-      for (TypeEnumValue value in values) {
-        privateField(javaName(value.value), () {
-          javadocComment(toHtmlVisitor.collectHtml(() {
-            toHtmlVisitor.translateHtml(value.html);
-          }));
-          writeln(
-              'public static final String ${value.value} = \"${value.value}\";');
-        });
-      }
-    });
-  }
-
-  /**
-   * This method writes extra fields and methods to the Element type.
-   */
-  void _writeExtraContentInElementType() {
-    //
-    // Extra fields on the Element type such as:
-    // private static final int ABSTRACT = 0x01;
-    //
-    _extraFieldsOnElement.forEach((String name, String value) {
-      publicField(javaName(name), () {
-        writeln('private static final int ${name} = ${value};');
-      });
-    });
-
-    //
-    // Extra methods for the Element type such as:
-    // public boolean isFinal() {
-    //   return (flags & FINAL) != 0;
-    // }
-    //
-    _extraMethodsOnElement.forEach((String methodName, String fieldName) {
-      publicMethod(methodName, () {
-        writeln('public boolean ${methodName}() {');
-        writeln('  return (flags & ${fieldName}) != 0;');
-        writeln('}');
-      });
-    });
-  }
-
-  String _getEqualsLogicForField(TypeObjectField field, String other) {
-    String name = javaName(field.name);
-    if (isPrimitive(field.type) && !field.optional) {
-      return '${other}.${name} == ${name}';
-    } else if (isArray(field.type)) {
-      return 'Arrays.equals(other.${name}, ${name})';
-    } else {
-      return 'ObjectUtilities.equals(${other}.${name}, ${name})';
-    }
-  }
-
-  bool _isTypeFieldInUpdateContentUnionType(String className,
-      String fieldName) {
-    if ((className == 'AddContentOverlay' ||
-        className == 'ChangeContentOverlay' ||
-        className == 'RemoveContentOverlay') &&
-        fieldName == 'type') {
-      return true;
-    } else {
-      return false;
-    }
-  }
-
-  String _getAsTypeMethodName(TypeDecl typeDecl) {
-    String name = javaType(typeDecl, true);
-    if (name == 'String') {
-      return 'getAsString';
-    } else if (name == 'boolean' || name == 'Boolean') {
-      return 'getAsBoolean';
-    } else if (name == 'int' || name == 'Integer') {
-      return 'getAsInt';
-    } else if (name == 'long' || name == 'Long') {
-      return 'getAsLong';
-    } else if (name.startsWith('List')) {
-      return 'getAsJsonArray';
-    } else {
-      // TODO (jwren) cleanup
-      return 'getAsJsonArray';
-    }
-  }
-
-  /**
-   * For some [TypeObjectField] return the [String] source for the field value
-   * for the toString generation.
-   */
-  String _getToStringForField(TypeObjectField field) {
-    String name = javaName(field.name);
-    if (isArray(field.type) || isList(field.type)) {
-      return 'StringUtils.join(${name}, ", ")';
-    } else {
-      return name;
-    }
-  }
-
-  /**
-   * For some [TypeObjectField] write out the source that adds the field
-   * information to the 'jsonObject'.
-   */
-  void _writeOutJsonObjectAddStatement(TypeObjectField field) {
-    String name = javaName(field.name);
-    if (isDeclaredInSpec(field.type)) {
-      writeln('jsonObject.add("${name}", ${name}.toJson());');
-    } else if (field.type is TypeList) {
-      TypeDecl listItemType = (field.type as TypeList).itemType;
-      String jsonArrayName = 'jsonArray${capitalize(name)}';
-      writeln('JsonArray ${jsonArrayName} = new JsonArray();');
-      writeln('for (${javaType(listItemType)} elt : ${name}) {');
-      indent(() {
-        if (isDeclaredInSpec(listItemType)) {
-          writeln('${jsonArrayName}.add(elt.toJson());');
-        } else {
-          writeln('${jsonArrayName}.add(new JsonPrimitive(elt));');
-        }
-      });
-      writeln('}');
-      writeln('jsonObject.add("${name}", ${jsonArrayName});');
-    } else {
-      writeln('jsonObject.addProperty("${name}", ${name});');
-    }
-  }
-
-  /**
-   * Get the name of the consumer class for responses to this request.
-   */
-  String consumerName(Request request) {
-    return camelJoin([request.method, 'consumer'], doCapitalize: true);
-  }
-}
-
-final String pathToGenTypes =
-    '../../../../editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/';
-
-final GeneratedDirectory targetDir = new GeneratedDirectory(pathToGenTypes, () {
-  Api api = readApi();
-  Map<String, ImpliedType> impliedTypes = computeImpliedTypes(api);
-  Map<String, FileContentsComputer> map =
-      new Map<String, FileContentsComputer>();
-  for (ImpliedType impliedType in impliedTypes.values) {
-    String typeNameInSpec = capitalize(impliedType.camelName);
-    bool isRefactoringFeedback = impliedType.kind == 'refactoringFeedback';
-    bool isRefactoringOption = impliedType.kind == 'refactoringOptions';
-    if (impliedType.kind == 'typeDefinition' ||
-        isRefactoringFeedback ||
-        isRefactoringOption) {
-      TypeDecl type = impliedType.type;
-      if (type is TypeObject || type is TypeEnum) {
-        // This is for situations such as 'Override' where the name in the spec
-        // doesn't match the java object that we generate:
-        String typeNameInJava = typeNameInSpec;
-        if (_typeRenames.containsKey(typeNameInSpec)) {
-          typeNameInJava = _typeRenames[typeNameInSpec];
-        }
-        map['${typeNameInJava}.java'] = () {
-          String superclassName = null;
-          if (isRefactoringFeedback) {
-            superclassName = 'RefactoringFeedback';
-          }
-          if (isRefactoringOption) {
-            superclassName = 'RefactoringOptions';
-          }
-          // configure accessors
-          bool generateGetters = true;
-          bool generateSetters = false;
-          if (isRefactoringOption ||
-              typeNameInSpec == 'RefactoringMethodParameter') {
-            generateSetters = true;
-          }
-          // create the visitor
-          CodegenJavaType visitor = new CodegenJavaType(
-              api,
-              typeNameInJava,
-              superclassName,
-              generateGetters,
-              generateSetters);
-          return visitor.collectCode(() {
-            dom.Element doc = type.html;
-            if (impliedType.apiNode is TypeDefinition) {
-              doc = (impliedType.apiNode as TypeDefinition).html;
-            }
-            visitor.emitType(type, doc);
-          });
-        };
-      }
-    }
-  }
-  return map;
-});
-
-/**
- * Translate spec_input.html into AnalysisServer.java.
- */
-main() {
-  targetDir.generate();
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart
index 02261da..30a6e14 100644
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart
@@ -15,6 +15,19 @@
 import 'implied_types.dart';
 import 'to_html.dart';
 
+final GeneratedFile target =
+    new GeneratedFile('../../test/integration/protocol_matchers.dart', () {
+  CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi());
+  return visitor.collectCode(visitor.visitApi);
+});
+
+/**
+ * Translate spec_input.html into protocol_matchers.dart.
+ */
+main() {
+  target.generate();
+}
+
 class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator {
   /**
    * Visitor used to produce doc comments.
@@ -56,6 +69,36 @@
     writeln();
   }
 
+  /**
+   * Generate a map describing the given set of fields, for use as the
+   * 'requiredFields' or 'optionalFields' argument to the [MatchesJsonObject]
+   * constructor.
+   */
+  void outputObjectFields(Iterable<TypeObjectField> fields) {
+    if (fields.isEmpty) {
+      write('null');
+      return;
+    }
+    writeln('{');
+    indent(() {
+      bool commaNeeded = false;
+      for (TypeObjectField field in fields) {
+        if (commaNeeded) {
+          writeln(',');
+        }
+        write('${JSON.encode(field.name)}: ');
+        if (field.value != null) {
+          write('equals(${JSON.encode(field.value)})');
+        } else {
+          visitTypeDecl(field.type);
+        }
+        commaNeeded = true;
+      }
+      writeln();
+    });
+    write('}');
+  }
+
   @override
   visitApi() {
     outputHeader();
@@ -113,11 +156,11 @@
     writeln('new LazyMatcher(() => new MatchesJsonObject(');
     indent(() {
       write('${JSON.encode(context)}, ');
-      Iterable<TypeObjectField> requiredFields = typeObject.fields.where(
-          (TypeObjectField field) => !field.optional);
+      Iterable<TypeObjectField> requiredFields =
+          typeObject.fields.where((TypeObjectField field) => !field.optional);
       outputObjectFields(requiredFields);
-      List<TypeObjectField> optionalFields = typeObject.fields.where(
-          (TypeObjectField field) => field.optional).toList();
+      List<TypeObjectField> optionalFields =
+          typeObject.fields.where((TypeObjectField field) => field.optional).toList();
       if (optionalFields.isNotEmpty) {
         write(', optionalFields: ');
         outputObjectFields(optionalFields);
@@ -126,36 +169,6 @@
     write('))');
   }
 
-  /**
-   * Generate a map describing the given set of fields, for use as the
-   * 'requiredFields' or 'optionalFields' argument to the [MatchesJsonObject]
-   * constructor.
-   */
-  void outputObjectFields(Iterable<TypeObjectField> fields) {
-    if (fields.isEmpty) {
-      write('null');
-      return;
-    }
-    writeln('{');
-    indent(() {
-      bool commaNeeded = false;
-      for (TypeObjectField field in fields) {
-        if (commaNeeded) {
-          writeln(',');
-        }
-        write('${JSON.encode(field.name)}: ');
-        if (field.value != null) {
-          write('equals(${JSON.encode(field.value)})');
-        } else {
-          visitTypeDecl(field.type);
-        }
-        commaNeeded = true;
-      }
-      writeln();
-    });
-    write('}');
-  }
-
   @override
   void visitTypeReference(TypeReference typeReference) {
     String typeName = typeReference.typeName;
@@ -179,16 +192,3 @@
     write('])');
   }
 }
-
-final GeneratedFile target = new GeneratedFile(
-    '../../test/integration/protocol_matchers.dart', () {
-  CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi());
-  return visitor.collectCode(visitor.visitApi);
-});
-
-/**
- * Translate spec_input.html into protocol_matchers.dart.
- */
-main() {
-  target.generate();
-}
diff --git a/pkg/analysis_server/tool/spec/codegen_tools.dart b/pkg/analysis_server/tool/spec/codegen_tools.dart
index f97c8bb..922b482 100644
--- a/pkg/analysis_server/tool/spec/codegen_tools.dart
+++ b/pkg/analysis_server/tool/spec/codegen_tools.dart
@@ -12,8 +12,10 @@
 import 'package:html5lib/dom.dart' as dom;
 import 'package:path/path.dart';
 
-import 'text_formatter.dart';
 import 'html_tools.dart';
+import 'text_formatter.dart';
+
+final RegExp trailingWhitespaceRegExp = new RegExp(r' +$', multiLine: true);
 
 /**
  * Join the given strings using camelCase.  If [doCapitalize] is true, the first
@@ -38,7 +40,15 @@
   return string[0].toUpperCase() + string.substring(1);
 }
 
-final RegExp trailingWhitespaceRegExp = new RegExp(r' +$', multiLine: true);
+/**
+ * Type of functions used to compute the contents of a set of generated files.
+ */
+typedef Map<String, FileContentsComputer> DirectoryContentsComputer();
+
+/**
+ * Type of functions used to compute the contents of a generated file.
+ */
+typedef String FileContentsComputer();
 
 /**
  * Mixin class for generating code.
@@ -47,6 +57,11 @@
   _CodeGeneratorState _state;
 
   /**
+   * Measure the width of the current indentation level.
+   */
+  int get indentWidth => _state.nextIndent.length;
+
+  /**
    * Execute [callback], collecting any code that is output using [write]
    * or [writeln], and return the result as a string.
    */
@@ -62,17 +77,21 @@
   }
 
   /**
-   * Output text without ending the current line.
+   * Generate a doc comment based on the HTML in [docs].
+   *
+   * If [javadocStyle] is true, then the output is compatable with Javadoc,
+   * which understands certain HTML constructs.
    */
-  void write(Object obj) {
-    _state.write(obj.toString());
-  }
-
-  /**
-   * Output text, ending the current line.
-   */
-  void writeln([Object obj = '']) {
-    _state.write('$obj\n');
+  void docComment(List<dom.Node> docs, {int width: 79, bool javadocStyle:
+      false}) {
+    if (containsOnlyWhitespace(docs)) {
+      return;
+    }
+    writeln('/**');
+    indentBy(' * ', () {
+      write(nodesToText(docs, width - _state.indent.length, javadocStyle));
+    });
+    writeln(' */');
   }
 
   /**
@@ -105,29 +124,6 @@
     }
   }
 
-  /**
-   * Measure the width of the current indentation level.
-   */
-  int get indentWidth => _state.nextIndent.length;
-
-  /**
-   * Generate a doc comment based on the HTML in [docs].
-   *
-   * If [javadocStyle] is true, then the output is compatable with Javadoc,
-   * which understands certain HTML constructs.
-   */
-  void docComment(List<dom.Node> docs, {int width: 79, bool javadocStyle:
-      false}) {
-    if (containsOnlyWhitespace(docs)) {
-      return;
-    }
-    writeln('/**');
-    indentBy(' * ', () {
-      write(nodesToText(docs, width - _state.indent.length, javadocStyle));
-    });
-    writeln(' */');
-  }
-
   void outputHeader({bool javaStyle: false}) {
     String header;
     if (javaStyle) {
@@ -161,77 +157,6 @@
     }
     writeln(header.trim());
   }
-}
-
-/**
- * State used by [CodeGenerator].
- */
-class _CodeGeneratorState {
-  StringBuffer buffer = new StringBuffer();
-  String nextIndent = '';
-  String indent = '';
-  bool indentNeeded = true;
-
-  void write(String text) {
-    List<String> lines = text.split('\n');
-    for (int i = 0; i < lines.length; i++) {
-      if (i == lines.length - 1 && lines[i].isEmpty) {
-        break;
-      }
-      if (indentNeeded) {
-        buffer.write(nextIndent);
-        nextIndent = indent;
-      }
-      indentNeeded = false;
-      buffer.write(lines[i]);
-      if (i != lines.length - 1) {
-        buffer.writeln();
-        indentNeeded = true;
-      }
-    }
-  }
-}
-
-/**
- * Mixin class for generating HTML representations of code that are suitable
- * for enclosing inside a <pre> element.
- */
-abstract class HtmlCodeGenerator {
-  _HtmlCodeGeneratorState _state;
-
-  /**
-   * Execute [callback], collecting any code that is output using [write],
-   * [writeln], [add], or [addAll], and return the result as a list of DOM
-   * nodes.
-   */
-  List<dom.Node> collectHtml(void callback()) {
-    _HtmlCodeGeneratorState oldState = _state;
-    try {
-      _state = new _HtmlCodeGeneratorState();
-      if (callback != null) {
-        callback();
-      }
-      return _state.buffer;
-    } finally {
-      _state = oldState;
-    }
-  }
-
-  /**
-   * Add the given [node] to the HTML output.
-   */
-  void add(dom.Node node) {
-    _state.add(node);
-  }
-
-  /**
-   * Add the given [nodes] to the HTML output.
-   */
-  void addAll(Iterable<dom.Node> nodes) {
-    for (dom.Node node in nodes) {
-      _state.add(node);
-    }
-  }
 
   /**
    * Output text without ending the current line.
@@ -246,74 +171,8 @@
   void writeln([Object obj = '']) {
     _state.write('$obj\n');
   }
-
-  /**
-   * Execute [callback], indenting any code it outputs by two spaces.
-   */
-  void indent(void callback()) {
-    String oldIndent = _state.indent;
-    try {
-      _state.indent += '  ';
-      callback();
-    } finally {
-      _state.indent = oldIndent;
-    }
-  }
-
-  /**
-   * Execute [callback], wrapping its output in an element with the given
-   * [name] and [attributes].
-   */
-  void element(String name, Map<String, String> attributes, [void callback()]) {
-    add(makeElement(name, attributes, collectHtml(callback)));
-  }
 }
 
-/**
- * State used by [HtmlCodeGenerator].
- */
-class _HtmlCodeGeneratorState {
-  List<dom.Node> buffer = <dom.Node>[];
-  String indent = '';
-  bool indentNeeded = true;
-
-  void add(dom.Node node) {
-    if (node is dom.Text) {
-      write(node.text);
-    } else {
-      buffer.add(node);
-    }
-  }
-
-  void write(String text) {
-    if (text.isEmpty) {
-      return;
-    }
-    if (indentNeeded) {
-      buffer.add(new dom.Text(indent));
-    }
-    List<String> lines = text.split('\n');
-    if (lines.last.isEmpty) {
-      lines.removeLast();
-      buffer.add(new dom.Text(lines.join('\n$indent') + '\n'));
-      indentNeeded = true;
-    } else {
-      buffer.add(new dom.Text(lines.join('\n$indent')));
-      indentNeeded = false;
-    }
-  }
-}
-
-/**
- * Type of functions used to compute the contents of a generated file.
- */
-typedef String FileContentsComputer();
-
-/**
- * Type of functions used to compute the contents of a set of generated files.
- */
-typedef Map<String, FileContentsComputer> DirectoryContentsComputer();
-
 abstract class GeneratedContent {
   FileSystemEntity get outputFile;
   bool check();
@@ -321,6 +180,95 @@
 }
 
 /**
+ * Class representing a single output directory (either generated code or
+ * generated HTML). No other content should exisit in the directory.
+ */
+class GeneratedDirectory extends GeneratedContent {
+
+  /**
+   * The path to the directory that will have the generated content.
+   */
+  final String outputDirPath;
+
+  /**
+   * Callback function which computes the directory contents.
+   */
+  final DirectoryContentsComputer directoryContentsComputer;
+
+  GeneratedDirectory(this.outputDirPath, this.directoryContentsComputer);
+
+  /**
+   * Get a Directory object representing the output directory.
+   */
+  Directory get outputFile =>
+      new Directory(joinAll(posix.split(outputDirPath)));
+
+  /**
+   * Check whether the directory has the correct contents, and return true if it
+   * does.
+   */
+  @override
+  bool check() {
+    Map<String, FileContentsComputer> map = directoryContentsComputer();
+    try {
+      map.forEach((String file, FileContentsComputer fileContentsComputer) {
+        String expectedContents = fileContentsComputer();
+        File outputFile =
+            new File(joinAll(posix.split(posix.join(outputDirPath, file))));
+        if (expectedContents != outputFile.readAsStringSync()) {
+          return false;
+        }
+      });
+      int nonHiddenFileCount = 0;
+      outputFile.listSync(
+          recursive: false,
+          followLinks: false).forEach((FileSystemEntity fileSystemEntity) {
+        if (fileSystemEntity is File &&
+            !basename(fileSystemEntity.path).startsWith('.')) {
+          nonHiddenFileCount++;
+        }
+      });
+      if (nonHiddenFileCount != map.length) {
+        // The number of files generated doesn't match the number we expected to
+        // generate.
+        return false;
+      }
+    } catch (e) {
+      // There was a problem reading the file (most likely because it didn't
+      // exist).  Treat that the same as if the file doesn't have the expected
+      // contents.
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Replace the directory with the correct contents.  [spec] is the "tool/spec"
+   * directory.  If [spec] is unspecified, it is assumed to be the directory
+   * containing Platform.executable.
+   */
+  @override
+  void generate() {
+    try {
+      // delete the contents of the directory (and the directory itself)
+      outputFile.deleteSync(recursive: true);
+    } catch (e) {
+      // Error caught while trying to delete the directory, this can happen if
+      // it didn't yet exist.
+    }
+    // re-create the empty directory
+    outputFile.createSync(recursive: true);
+
+    // generate all of the files in the directory
+    Map<String, FileContentsComputer> map = directoryContentsComputer();
+    map.forEach((String file, FileContentsComputer fileContentsComputer) {
+      File outputFile = new File(joinAll(posix.split(outputDirPath + file)));
+      outputFile.writeAsStringSync(fileContentsComputer());
+    });
+  }
+}
+
+/**
  * Class representing a single output file (either generated code or generated
  * HTML).
  */
@@ -372,89 +320,142 @@
 }
 
 /**
- * Class representing a single output directory (either generated code or
- * generated HTML). No other content should exisit in the directory.
+ * Mixin class for generating HTML representations of code that are suitable
+ * for enclosing inside a <pre> element.
  */
-class GeneratedDirectory extends GeneratedContent {
+abstract class HtmlCodeGenerator {
+  _HtmlCodeGeneratorState _state;
 
   /**
-   * The path to the directory that will have the generated content.
+   * Add the given [node] to the HTML output.
    */
-  final String outputDirPath;
-
-  /**
-   * Callback function which computes the directory contents.
-   */
-  final DirectoryContentsComputer directoryContentsComputer;
-
-  GeneratedDirectory(this.outputDirPath, this.directoryContentsComputer);
-
-  /**
-   * Get a Directory object representing the output directory.
-   */
-  Directory get outputFile =>
-      new Directory(joinAll(posix.split(outputDirPath)));
-
-  /**
-   * Check whether the directory has the correct contents, and return true if it
-   * does.
-   */
-  @override
-  bool check() {
-    Map<String, FileContentsComputer> map = directoryContentsComputer();
-    try {
-      map.forEach((String file, FileContentsComputer fileContentsComputer) {
-        String expectedContents = fileContentsComputer();
-        File outputFile =
-            new File(joinAll(posix.split(posix.join(outputDirPath, file))));
-        if (expectedContents != outputFile.readAsStringSync()) {
-          return false;
-        }
-      });
-      int nonHiddenFileCount = 0;
-      outputFile.listSync(
-          recursive: false,
-          followLinks: false).forEach((FileSystemEntity fileSystemEntity) {
-         if(fileSystemEntity is File && !basename(fileSystemEntity.path).startsWith('.')) {
-           nonHiddenFileCount++;
-         }
-      });
-      if (nonHiddenFileCount != map.length) {
-        // The number of files generated doesn't match the number we expected to
-        // generate.
-        return false;
-      }
-    } catch (e) {
-      // There was a problem reading the file (most likely because it didn't
-      // exist).  Treat that the same as if the file doesn't have the expected
-      // contents.
-      return false;
-    }
-    return true;
+  void add(dom.Node node) {
+    _state.add(node);
   }
 
   /**
-   * Replace the directory with the correct contents.  [spec] is the "tool/spec"
-   * directory.  If [spec] is unspecified, it is assumed to be the directory
-   * containing Platform.executable.
+   * Add the given [nodes] to the HTML output.
    */
-  @override
-  void generate() {
-    try {
-      // delete the contents of the directory (and the directory itself)
-      outputFile.deleteSync(recursive: true);
-    } catch (e) {
-      // Error caught while trying to delete the directory, this can happen if
-      // it didn't yet exist.
+  void addAll(Iterable<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      _state.add(node);
     }
-    // re-create the empty directory
-    outputFile.createSync(recursive: true);
+  }
 
-    // generate all of the files in the directory
-    Map<String, FileContentsComputer> map = directoryContentsComputer();
-    map.forEach((String file, FileContentsComputer fileContentsComputer) {
-      File outputFile = new File(joinAll(posix.split(outputDirPath + file)));
-      outputFile.writeAsStringSync(fileContentsComputer());
-    });
+  /**
+   * Execute [callback], collecting any code that is output using [write],
+   * [writeln], [add], or [addAll], and return the result as a list of DOM
+   * nodes.
+   */
+  List<dom.Node> collectHtml(void callback()) {
+    _HtmlCodeGeneratorState oldState = _state;
+    try {
+      _state = new _HtmlCodeGeneratorState();
+      if (callback != null) {
+        callback();
+      }
+      return _state.buffer;
+    } finally {
+      _state = oldState;
+    }
+  }
+
+  /**
+   * Execute [callback], wrapping its output in an element with the given
+   * [name] and [attributes].
+   */
+  void element(String name, Map<String, String> attributes, [void callback()]) {
+    add(makeElement(name, attributes, collectHtml(callback)));
+  }
+
+  /**
+   * Execute [callback], indenting any code it outputs by two spaces.
+   */
+  void indent(void callback()) {
+    String oldIndent = _state.indent;
+    try {
+      _state.indent += '  ';
+      callback();
+    } finally {
+      _state.indent = oldIndent;
+    }
+  }
+
+  /**
+   * Output text without ending the current line.
+   */
+  void write(Object obj) {
+    _state.write(obj.toString());
+  }
+
+  /**
+   * Output text, ending the current line.
+   */
+  void writeln([Object obj = '']) {
+    _state.write('$obj\n');
+  }
+}
+
+/**
+ * State used by [CodeGenerator].
+ */
+class _CodeGeneratorState {
+  StringBuffer buffer = new StringBuffer();
+  String nextIndent = '';
+  String indent = '';
+  bool indentNeeded = true;
+
+  void write(String text) {
+    List<String> lines = text.split('\n');
+    for (int i = 0; i < lines.length; i++) {
+      if (i == lines.length - 1 && lines[i].isEmpty) {
+        break;
+      }
+      if (indentNeeded) {
+        buffer.write(nextIndent);
+        nextIndent = indent;
+      }
+      indentNeeded = false;
+      buffer.write(lines[i]);
+      if (i != lines.length - 1) {
+        buffer.writeln();
+        indentNeeded = true;
+      }
+    }
+  }
+}
+
+/**
+ * State used by [HtmlCodeGenerator].
+ */
+class _HtmlCodeGeneratorState {
+  List<dom.Node> buffer = <dom.Node>[];
+  String indent = '';
+  bool indentNeeded = true;
+
+  void add(dom.Node node) {
+    if (node is dom.Text) {
+      write(node.text);
+    } else {
+      buffer.add(node);
+    }
+  }
+
+  void write(String text) {
+    if (text.isEmpty) {
+      return;
+    }
+    if (indentNeeded) {
+      buffer.add(new dom.Text(indent));
+    }
+    List<String> lines = text.split('\n');
+    if (lines.last.isEmpty) {
+      lines.removeLast();
+      buffer.add(new dom.Text(lines.join('\n$indent') + '\n'));
+      indentNeeded = true;
+    } else {
+      buffer.add(new dom.Text(lines.join('\n$indent')));
+      indentNeeded = false;
+    }
   }
 }
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index ed3c287..5b27e17 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -15,83 +15,29 @@
 import 'api.dart';
 import 'html_tools.dart';
 
-/**
- * Check that the given [element] has the given [expectedName].
- */
-void checkName(dom.Element element, String expectedName, [String context]) {
-  if (element.localName != expectedName) {
-    if (context == null) {
-      context = element.localName;
-    }
-    throw new Exception(
-        '$context: Expected $expectedName, found ${element.localName}');
-  }
-}
-
-/**
- * Check that the given [element] has all of the attributes in
- * [requiredAttributes], possibly some of the attributes in
- * [optionalAttributes], and no others.
- */
-void checkAttributes(dom.Element element, List<String>
-    requiredAttributes, String context, {List<String> optionalAttributes: const []})
-    {
-  Set<String> attributesFound = new Set<String>();
-  element.attributes.forEach((String name, String value) {
-    if (!requiredAttributes.contains(name) && !optionalAttributes.contains(name
-        )) {
-      throw new Exception(
-          '$context: Unexpected attribute in ${element.localName}: $name');
-    }
-    attributesFound.add(name);
-  });
-  for (String expectedAttribute in requiredAttributes) {
-    if (!attributesFound.contains(expectedAttribute)) {
-      throw new Exception(
-          '$context: ${element.localName} must contain attribute ${expectedAttribute}');
-    }
-  }
-}
-
-const List<String> specialElements = const ['domain', 'feedback', 'object',
-    'refactorings', 'refactoring', 'type', 'types', 'request', 'notification',
-    'params', 'result', 'field', 'list', 'map', 'enum', 'key', 'value', 'options',
-    'ref', 'code', 'version', 'union'];
-
-typedef void ElementProcessor(dom.Element element);
-typedef void TextProcessor(dom.Text text);
-
-void recurse(dom.Element parent, String context, Map<String, ElementProcessor>
-    elementProcessors) {
-  for (String key in elementProcessors.keys) {
-    if (!specialElements.contains(key)) {
-      throw new Exception('$context: $key is not a special element');
-    }
-  }
-  for (dom.Node node in parent.nodes) {
-    if (node is dom.Element) {
-      if (elementProcessors.containsKey(node.localName)) {
-        elementProcessors[node.localName](node);
-      } else if (specialElements.contains(node.localName)) {
-        throw new Exception('$context: Unexpected use of <${node.localName}');
-      } else {
-        recurse(node, context, elementProcessors);
-      }
-    }
-  }
-}
-
-dom.Element getAncestor(dom.Element html, String name, String context) {
-  dom.Element ancestor = html.parent;
-  while (ancestor != null) {
-    if (ancestor.localName == name) {
-      return ancestor;
-    }
-    ancestor = ancestor.parent;
-  }
-  throw new Exception(
-      '$context: <${html.localName}> must be nested within <$name>');
-}
+const List<String> specialElements = const [
+    'domain',
+    'feedback',
+    'object',
+    'refactorings',
+    'refactoring',
+    'type',
+    'types',
+    'request',
+    'notification',
+    'params',
+    'result',
+    'field',
+    'list',
+    'map',
+    'enum',
+    'key',
+    'value',
+    'options',
+    'ref',
+    'code',
+    'version',
+    'union'];
 
 /**
  * Create an [Api] object from an HTML representation such as:
@@ -136,97 +82,42 @@
 }
 
 /**
- * Create a [Refactorings] object from an HTML representation such as:
- *
- * <refactorings>
- *   <refactoring kind="...">...</refactoring> <!-- zero or more -->
- * </refactorings>
+ * Check that the given [element] has all of the attributes in
+ * [requiredAttributes], possibly some of the attributes in
+ * [optionalAttributes], and no others.
  */
-Refactorings refactoringsFromHtml(dom.Element html) {
-  checkName(html, 'refactorings');
-  String context = 'refactorings';
-  checkAttributes(html, [], context);
-  List<Refactoring> refactorings = <Refactoring>[];
-  recurse(html, context, {
-    'refactoring': (dom.Element child) {
-      refactorings.add(refactoringFromHtml(child));
+void checkAttributes(dom.Element element, List<String> requiredAttributes,
+    String context, {List<String> optionalAttributes: const [
+    ]}) {
+  Set<String> attributesFound = new Set<String>();
+  element.attributes.forEach((String name, String value) {
+    if (!requiredAttributes.contains(name) &&
+        !optionalAttributes.contains(name)) {
+      throw new Exception(
+          '$context: Unexpected attribute in ${element.localName}: $name');
     }
+    attributesFound.add(name);
   });
-  return new Refactorings(refactorings, html);
+  for (String expectedAttribute in requiredAttributes) {
+    if (!attributesFound.contains(expectedAttribute)) {
+      throw new Exception(
+          '$context: ${element.localName} must contain attribute ${expectedAttribute}');
+    }
+  }
 }
 
 /**
- * Create a [Refactoring] object from an HTML representation such as:
- *
- * <refactoring kind="refactoringKind">
- *   <feedback>...</feedback> <!-- optional -->
- *   <options>...</options> <!-- optional -->
- * </refactoring>
- *
- * <feedback> and <options> have the same form as <object>, as described in
- * [typeDeclFromHtml].
- *
- * Child elements can occur in any order.
+ * Check that the given [element] has the given [expectedName].
  */
-Refactoring refactoringFromHtml(dom.Element html) {
-  checkName(html, 'refactoring');
-  String kind = html.attributes['kind'];
-  String context = kind != null ? kind : 'refactoring';
-  checkAttributes(html, ['kind'], context);
-  TypeDecl feedback;
-  TypeDecl options;
-  recurse(html, context, {
-    'feedback': (dom.Element child) {
-      feedback = typeObjectFromHtml(child, '$context.feedback');
-    },
-    'options': (dom.Element child) {
-      options = typeObjectFromHtml(child, '$context.options');
+void checkName(dom.Element element, String expectedName, [String context]) {
+  if (element.localName != expectedName) {
+    if (context == null) {
+      context = element.localName;
     }
-  });
-  return new Refactoring(kind, feedback, options, html);
+    throw new Exception(
+        '$context: Expected $expectedName, found ${element.localName}');
+  }
 }
-
-/**
- * Create a [Types] object from an HTML representation such as:
- *
- * <types>
- *   <type name="...">...</type> <!-- zero or more -->
- * </types>
- */
-Types typesFromHtml(dom.Element html) {
-  checkName(html, 'types');
-  String context = 'types';
-  checkAttributes(html, [], context);
-  Map<String, TypeDefinition> types = <String, TypeDefinition> {};
-  recurse(html, context, {
-    'type': (dom.Element child) {
-      TypeDefinition typeDefinition = typeDefinitionFromHtml(child);
-      types[typeDefinition.name] = typeDefinition;
-    }
-  });
-  return new Types(types, html);
-}
-
-/**
- * Create a [TypeDefinition] object from an HTML representation such as:
- *
- * <type name="typeName">
- *   TYPE
- * </type>
- *
- * Where TYPE is any HTML that can be parsed by [typeDeclFromHtml].
- *
- * Child elements can occur in any order.
- */
-TypeDefinition typeDefinitionFromHtml(dom.Element html) {
-  checkName(html, 'type');
-  String name = html.attributes['name'];
-  String context = name != null ? name : 'type';
-  checkAttributes(html, ['name'], context);
-  TypeDecl type = processContentsAsType(html, context);
-  return new TypeDefinition(name, type, html);
-}
-
 /**
  * Create a [Domain] object from an HTML representation such as:
  *
@@ -255,38 +146,16 @@
   return new Domain(name, requests, notifications, html);
 }
 
-/**
- * Create a [Request] object from an HTML representation such as:
- *
- * <request method="methodName">
- *   <params>...</params> <!-- optional -->
- *   <result>...</result> <!-- optional -->
- * </request>
- *
- * Note that the method name should not include the domain name.
- *
- * <params> and <result> have the same form as <object>, as described in
- * [typeDeclFromHtml].
- *
- * Child elements can occur in any order.
- */
-Request requestFromHtml(dom.Element html, String context) {
-  String domainName = getAncestor(html, 'domain', context).attributes['name'];
-  checkName(html, 'request', context);
-  String method = html.attributes['method'];
-  context = '$context.${method != null ? method : 'method'}';
-  checkAttributes(html, ['method'], context);
-  TypeDecl params;
-  TypeDecl result;
-  recurse(html, context, {
-    'params': (dom.Element child) {
-      params = typeObjectFromHtml(child, '$context.params');
-    },
-    'result': (dom.Element child) {
-      result = typeObjectFromHtml(child, '$context.result');
+dom.Element getAncestor(dom.Element html, String name, String context) {
+  dom.Element ancestor = html.parent;
+  while (ancestor != null) {
+    if (ancestor.localName == name) {
+      return ancestor;
     }
-  });
-  return new Request(domainName, method, params, result, html);
+    ancestor = ancestor.parent;
+  }
+  throw new Exception(
+      '$context: <${html.localName}> must be nested within <$name>');
 }
 
 /**
@@ -316,6 +185,7 @@
   });
   return new Notification(domainName, event, params, html);
 }
+
 /**
  * Create a single of [TypeDecl] corresponding to the type defined inside the
  * given HTML element.
@@ -403,14 +273,148 @@
     'union': (dom.Element child) {
       checkAttributes(child, ['field'], context);
       String field = child.attributes['field'];
-      types.add(new TypeUnion(processContentsAsTypes(child, context), field,
-          child));
+      types.add(
+          new TypeUnion(processContentsAsTypes(child, context), field, child));
     }
   });
   return types;
 }
 
 /**
+ * Read the API description from the file 'spec_input.html'.
+ */
+Api readApi() {
+  File htmlFile = new File('spec_input.html');
+  String htmlContents = htmlFile.readAsStringSync();
+  dom.Document document = parser.parse(htmlContents);
+  return apiFromHtml(document.firstChild);
+}
+
+void recurse(dom.Element parent, String context, Map<String,
+    ElementProcessor> elementProcessors) {
+  for (String key in elementProcessors.keys) {
+    if (!specialElements.contains(key)) {
+      throw new Exception('$context: $key is not a special element');
+    }
+  }
+  for (dom.Node node in parent.nodes) {
+    if (node is dom.Element) {
+      if (elementProcessors.containsKey(node.localName)) {
+        elementProcessors[node.localName](node);
+      } else if (specialElements.contains(node.localName)) {
+        throw new Exception('$context: Unexpected use of <${node.localName}');
+      } else {
+        recurse(node, context, elementProcessors);
+      }
+    }
+  }
+}
+
+/**
+ * Create a [Refactoring] object from an HTML representation such as:
+ *
+ * <refactoring kind="refactoringKind">
+ *   <feedback>...</feedback> <!-- optional -->
+ *   <options>...</options> <!-- optional -->
+ * </refactoring>
+ *
+ * <feedback> and <options> have the same form as <object>, as described in
+ * [typeDeclFromHtml].
+ *
+ * Child elements can occur in any order.
+ */
+Refactoring refactoringFromHtml(dom.Element html) {
+  checkName(html, 'refactoring');
+  String kind = html.attributes['kind'];
+  String context = kind != null ? kind : 'refactoring';
+  checkAttributes(html, ['kind'], context);
+  TypeDecl feedback;
+  TypeDecl options;
+  recurse(html, context, {
+    'feedback': (dom.Element child) {
+      feedback = typeObjectFromHtml(child, '$context.feedback');
+    },
+    'options': (dom.Element child) {
+      options = typeObjectFromHtml(child, '$context.options');
+    }
+  });
+  return new Refactoring(kind, feedback, options, html);
+}
+
+/**
+ * Create a [Refactorings] object from an HTML representation such as:
+ *
+ * <refactorings>
+ *   <refactoring kind="...">...</refactoring> <!-- zero or more -->
+ * </refactorings>
+ */
+Refactorings refactoringsFromHtml(dom.Element html) {
+  checkName(html, 'refactorings');
+  String context = 'refactorings';
+  checkAttributes(html, [], context);
+  List<Refactoring> refactorings = <Refactoring>[];
+  recurse(html, context, {
+    'refactoring': (dom.Element child) {
+      refactorings.add(refactoringFromHtml(child));
+    }
+  });
+  return new Refactorings(refactorings, html);
+}
+
+/**
+ * Create a [Request] object from an HTML representation such as:
+ *
+ * <request method="methodName">
+ *   <params>...</params> <!-- optional -->
+ *   <result>...</result> <!-- optional -->
+ * </request>
+ *
+ * Note that the method name should not include the domain name.
+ *
+ * <params> and <result> have the same form as <object>, as described in
+ * [typeDeclFromHtml].
+ *
+ * Child elements can occur in any order.
+ */
+Request requestFromHtml(dom.Element html, String context) {
+  String domainName = getAncestor(html, 'domain', context).attributes['name'];
+  checkName(html, 'request', context);
+  String method = html.attributes['method'];
+  context = '$context.${method != null ? method : 'method'}';
+  checkAttributes(html, ['method'], context);
+  TypeDecl params;
+  TypeDecl result;
+  recurse(html, context, {
+    'params': (dom.Element child) {
+      params = typeObjectFromHtml(child, '$context.params');
+    },
+    'result': (dom.Element child) {
+      result = typeObjectFromHtml(child, '$context.result');
+    }
+  });
+  return new Request(domainName, method, params, result, html);
+}
+
+/**
+ * Create a [TypeDefinition] object from an HTML representation such as:
+ *
+ * <type name="typeName">
+ *   TYPE
+ * </type>
+ *
+ * Where TYPE is any HTML that can be parsed by [typeDeclFromHtml].
+ *
+ * Child elements can occur in any order.
+ */
+TypeDefinition typeDefinitionFromHtml(dom.Element html) {
+  checkName(html, 'type');
+  String name = html.attributes['name'];
+  String context = name != null ? name : 'type';
+  checkAttributes(html, ['name'], context);
+  TypeDecl type = processContentsAsType(html, context);
+  return new TypeDefinition(name, type, html);
+}
+/**
  * Create a [TypeEnum] from an HTML description.
  */
 TypeEnum typeEnumFromHtml(dom.Element html, String context) {
@@ -453,20 +457,6 @@
 }
 
 /**
- * Create a [TypeObject] from an HTML description.
- */
-TypeObject typeObjectFromHtml(dom.Element html, String context) {
-  checkAttributes(html, [], context);
-  List<TypeObjectField> fields = <TypeObjectField>[];
-  recurse(html, context, {
-    'field': (dom.Element child) {
-      fields.add(typeObjectFieldFromHtml(child, context));
-    }
-  });
-  return new TypeObject(fields, html);
-}
-
-/**
  * Create a [TypeObjectField] from an HTML description such as:
  *
  * <field name="fieldName">
@@ -485,8 +475,11 @@
   checkName(html, 'field', context);
   String name = html.attributes['name'];
   context = '$context.${name != null ? name : 'field'}';
-  checkAttributes(html, ['name'], context, optionalAttributes: ['optional',
-      'value']);
+  checkAttributes(
+      html,
+      ['name'],
+      context,
+      optionalAttributes: ['optional', 'value']);
   bool optional = false;
   String optionalString = html.attributes['optional'];
   if (optionalString != null) {
@@ -504,16 +497,49 @@
   }
   String value = html.attributes['value'];
   TypeDecl type = processContentsAsType(html, context);
-  return new TypeObjectField(name, type, html, optional: optional, value: value
-      );
+  return new TypeObjectField(
+      name,
+      type,
+      html,
+      optional: optional,
+      value: value);
 }
 
 /**
- * Read the API description from the file 'spec_input.html'.
+ * Create a [TypeObject] from an HTML description.
  */
-Api readApi() {
-  File htmlFile = new File('spec_input.html');
-  String htmlContents = htmlFile.readAsStringSync();
-  dom.Document document = parser.parse(htmlContents);
-  return apiFromHtml(document.firstChild);
+TypeObject typeObjectFromHtml(dom.Element html, String context) {
+  checkAttributes(html, [], context);
+  List<TypeObjectField> fields = <TypeObjectField>[];
+  recurse(html, context, {
+    'field': (dom.Element child) {
+      fields.add(typeObjectFieldFromHtml(child, context));
+    }
+  });
+  return new TypeObject(fields, html);
 }
+
+/**
+ * Create a [Types] object from an HTML representation such as:
+ *
+ * <types>
+ *   <type name="...">...</type> <!-- zero or more -->
+ * </types>
+ */
+Types typesFromHtml(dom.Element html) {
+  checkName(html, 'types');
+  String context = 'types';
+  checkAttributes(html, [], context);
+  Map<String, TypeDefinition> types = <String, TypeDefinition>{};
+  recurse(html, context, {
+    'type': (dom.Element child) {
+      TypeDefinition typeDefinition = typeDefinitionFromHtml(child);
+      types[typeDefinition.name] = typeDefinition;
+    }
+  });
+  return new Types(types, html);
+}
+
+typedef void ElementProcessor(dom.Element element);
+
+typedef void TextProcessor(dom.Text text);
diff --git a/pkg/analysis_server/tool/spec/generate_all.dart b/pkg/analysis_server/tool/spec/generate_all.dart
index 4a6c62a..00489bd 100644
--- a/pkg/analysis_server/tool/spec/generate_all.dart
+++ b/pkg/analysis_server/tool/spec/generate_all.dart
@@ -8,12 +8,12 @@
 
 import 'package:path/path.dart';
 
-import 'codegen_tools.dart';
 import 'codegen_analysis_server.dart' as codegen_analysis_server;
 import 'codegen_dart_protocol.dart' as codegen_dart_protocol;
-import 'codegen_java_types.dart' as codegen_java_types;
 import 'codegen_inttest_methods.dart' as codegen_inttest_methods;
+import 'codegen_java_types.dart' as codegen_java_types;
 import 'codegen_matchers.dart' as codegen_matchers;
+import 'codegen_tools.dart';
 import 'to_html.dart' as to_html;
 
 /**
diff --git a/pkg/analysis_server/tool/spec/html_tools.dart b/pkg/analysis_server/tool/spec/html_tools.dart
index 7ec6ffb..0305715 100644
--- a/pkg/analysis_server/tool/spec/html_tools.dart
+++ b/pkg/analysis_server/tool/spec/html_tools.dart
@@ -12,20 +12,19 @@
 /**
  * Make a deep copy of the given HTML nodes.
  */
-List<dom.Node> cloneHtmlNodes(List<dom.Node> nodes) => nodes.map((dom.Node node)
-    => node.clone(true)).toList();
+List<dom.Node> cloneHtmlNodes(List<dom.Node> nodes) =>
+    nodes.map((dom.Node node) => node.clone(true)).toList();
 
 /**
- * Create an HTML element with the given name, attributes, and child nodes.
+ * Return true if the given iterable contains only whitespace text nodes.
  */
-dom.Element makeElement(String name, Map<dynamic, String>
-    attributes, List<dom.Node> children) {
-  dom.Element result = new dom.Element.tag(name);
-  result.attributes.addAll(attributes);
-  for (dom.Node child in children) {
-    result.append(child);
+bool containsOnlyWhitespace(Iterable<dom.Node> nodes) {
+  for (dom.Node node in nodes) {
+    if (!isWhitespaceNode(node)) {
+      return false;
+    }
   }
-  return result;
+  return true;
 }
 
 /**
@@ -61,15 +60,16 @@
 }
 
 /**
- * Return true if the given iterable contains only whitespace text nodes.
+ * Create an HTML element with the given name, attributes, and child nodes.
  */
-bool containsOnlyWhitespace(Iterable<dom.Node> nodes) {
-  for (dom.Node node in nodes) {
-    if (!isWhitespaceNode(node)) {
-      return false;
-    }
+dom.Element makeElement(String name, Map<dynamic, String> attributes,
+    List<dom.Node> children) {
+  dom.Element result = new dom.Element.tag(name);
+  result.attributes.addAll(attributes);
+  for (dom.Node child in children) {
+    result.append(child);
   }
-  return true;
+  return result;
 }
 
 /**
@@ -79,6 +79,22 @@
   List<dom.Node> _html;
 
   /**
+   * Add the given [node] to the HTML output.
+   */
+  void add(dom.Node node) {
+    _html.add(node);
+  }
+
+  /**
+   * Add the given [nodes] to the HTML output.
+   */
+  void addAll(Iterable<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      add(node);
+    }
+  }
+
+  /**
    * Execute [callback], collecting any code that is output using [write],
    * [writeln], [add], or [addAll], and return the result as a list of HTML
    * nodes.
@@ -97,19 +113,12 @@
   }
 
   /**
-   * Add the given [node] to the HTML output.
+   * Execute [callback], wrapping its output in an element with the given
+   * [name] and [attributes].
    */
-  void add(dom.Node node) {
-    _html.add(node);
-  }
-
-  /**
-   * Add the given [nodes] to the HTML output.
-   */
-  void addAll(Iterable<dom.Node> nodes) {
-    for (dom.Node node in nodes) {
-      add(node);
-    }
+  void element(String name, Map<dynamic, String> attributes, [void
+      callback()]) {
+    add(makeElement(name, attributes, collectHtml(callback)));
   }
 
   /**
@@ -125,12 +134,4 @@
   void writeln([Object obj = '']) {
     write('$obj\n');
   }
-
-  /**
-   * Execute [callback], wrapping its output in an element with the given
-   * [name] and [attributes].
-   */
-  void element(String name, Map<dynamic, String> attributes, [void callback()]) {
-    add(makeElement(name, attributes, collectHtml(callback)));
-  }
 }
diff --git a/pkg/analysis_server/tool/spec/implied_types.dart b/pkg/analysis_server/tool/spec/implied_types.dart
index 46abf23..b3ab8c6 100644
--- a/pkg/analysis_server/tool/spec/implied_types.dart
+++ b/pkg/analysis_server/tool/spec/implied_types.dart
@@ -10,6 +10,12 @@
 import 'api.dart';
 import 'codegen_tools.dart';
 
+Map<String, ImpliedType> computeImpliedTypes(Api api) {
+  _ImpliedTypesVisitor visitor = new _ImpliedTypesVisitor(api);
+  visitor.visitApi();
+  return visitor.impliedTypes;
+}
+
 class ImpliedType {
   final String camelName;
   final String humanReadableName;
@@ -31,22 +37,17 @@
    */
   final ApiNode apiNode;
 
-  ImpliedType(this.camelName, this.humanReadableName, this.type, this.kind, this.apiNode);
-}
-
-Map<String, ImpliedType> computeImpliedTypes(Api api) {
-  _ImpliedTypesVisitor visitor = new _ImpliedTypesVisitor(api);
-  visitor.visitApi();
-  return visitor.impliedTypes;
+  ImpliedType(this.camelName, this.humanReadableName, this.type, this.kind,
+      this.apiNode);
 }
 
 class _ImpliedTypesVisitor extends HierarchicalApiVisitor {
-  Map<String, ImpliedType> impliedTypes = <String, ImpliedType> {};
+  Map<String, ImpliedType> impliedTypes = <String, ImpliedType>{};
 
   _ImpliedTypesVisitor(Api api) : super(api);
 
-  void storeType(String name, String nameSuffix, TypeDecl type, String
-      kind, ApiNode apiNode) {
+  void storeType(String name, String nameSuffix, TypeDecl type, String kind,
+      ApiNode apiNode) {
     String humanReadableName = name;
     List<String> camelNameParts = name.split('.');
     if (nameSuffix != null) {
@@ -54,36 +55,60 @@
       camelNameParts.add(nameSuffix);
     }
     String camelName = camelJoin(camelNameParts);
-    impliedTypes[camelName] = new ImpliedType(camelName, humanReadableName,
-        type, kind, apiNode);
+    impliedTypes[camelName] =
+        new ImpliedType(camelName, humanReadableName, type, kind, apiNode);
   }
 
   @override
   visitNotification(Notification notification) {
-    storeType(notification.longEvent, 'params', notification.params,
-        'notificationParams', notification);
-  }
-
-  @override
-  visitRequest(Request request) {
-    storeType(request.longMethod, 'params', request.params, 'requestParams',
-        request);
-    storeType(request.longMethod, 'result', request.result, 'requestResult',
-        request);
+    storeType(
+        notification.longEvent,
+        'params',
+        notification.params,
+        'notificationParams',
+        notification);
   }
 
   @override
   visitRefactoring(Refactoring refactoring) {
     String camelKind = camelJoin(refactoring.kind.toLowerCase().split('_'));
-    storeType(camelKind, 'feedback', refactoring.feedback,
-        'refactoringFeedback', refactoring);
-    storeType(camelKind, 'options', refactoring.options, 'refactoringOptions',
+    storeType(
+        camelKind,
+        'feedback',
+        refactoring.feedback,
+        'refactoringFeedback',
+        refactoring);
+    storeType(
+        camelKind,
+        'options',
+        refactoring.options,
+        'refactoringOptions',
         refactoring);
   }
 
   @override
+  visitRequest(Request request) {
+    storeType(
+        request.longMethod,
+        'params',
+        request.params,
+        'requestParams',
+        request);
+    storeType(
+        request.longMethod,
+        'result',
+        request.result,
+        'requestResult',
+        request);
+  }
+
+  @override
   visitTypeDefinition(TypeDefinition typeDefinition) {
-    storeType(typeDefinition.name, null, typeDefinition.type, 'typeDefinition',
+    storeType(
+        typeDefinition.name,
+        null,
+        typeDefinition.type,
+        'typeDefinition',
         typeDefinition);
   }
 
diff --git a/pkg/analysis_server/tool/spec/text_formatter.dart b/pkg/analysis_server/tool/spec/text_formatter.dart
index e5f33a2..a811d68 100644
--- a/pkg/analysis_server/tool/spec/text_formatter.dart
+++ b/pkg/analysis_server/tool/spec/text_formatter.dart
@@ -11,6 +11,8 @@
 
 import 'codegen_tools.dart';
 
+final RegExp whitespace = new RegExp(r'\s');
+
 /**
  * Convert the HTML in [desc] into text, word wrapping at width [width].
  *
@@ -25,8 +27,6 @@
   });
 }
 
-final RegExp whitespace = new RegExp(r'\s');
-
 /**
  * Engine that transforms HTML to text.  The input HTML is processed one
  * character at a time, gathering characters into words and words into lines.
@@ -71,23 +71,6 @@
   _TextFormatter(this.width, this.javadocStyle);
 
   /**
-   * Escape the given character for HTML.
-   */
-  String escape(String char) {
-    if (javadocStyle) {
-      switch (char) {
-        case '<':
-          return '&lt;';
-        case '>':
-          return '&gt;';
-        case '&':
-          return '&amp;';
-      }
-    }
-    return char;
-  }
-
-  /**
    * Process an HTML node.
    */
   void add(dom.Node node) {
@@ -191,34 +174,29 @@
   }
 
   /**
-   * Insert vertical space if necessary.
+   * Process a list of HTML nodes.
    */
-  void resolveVerticalSpace() {
-    if (verticalSpaceNeeded) {
-      writeln();
-      verticalSpaceNeeded = false;
+  void addAll(List<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      add(node);
     }
   }
 
   /**
-   * Terminate the current word, if a word is in progress.
+   * Escape the given character for HTML.
    */
-  void wordBreak() {
-    if (word.isNotEmpty) {
-      atStart = false;
-      if (line.isNotEmpty) {
-        if (indentWidth + line.length + 1 + word.length <= width)
-            {
-          line += ' $word';
-        } else {
-          writeln(line);
-          line = word;
-        }
-      } else {
-        line = word;
+  String escape(String char) {
+    if (javadocStyle) {
+      switch (char) {
+        case '<':
+          return '&lt;';
+        case '>':
+          return '&gt;';
+        case '&':
+          return '&amp;';
       }
-      word = '';
     }
+    return char;
   }
 
   /**
@@ -236,11 +214,32 @@
   }
 
   /**
-   * Process a list of HTML nodes.
+   * Insert vertical space if necessary.
    */
-  void addAll(List<dom.Node> nodes) {
-    for (dom.Node node in nodes) {
-      add(node);
+  void resolveVerticalSpace() {
+    if (verticalSpaceNeeded) {
+      writeln();
+      verticalSpaceNeeded = false;
+    }
+  }
+
+  /**
+   * Terminate the current word, if a word is in progress.
+   */
+  void wordBreak() {
+    if (word.isNotEmpty) {
+      atStart = false;
+      if (line.isNotEmpty) {
+        if (indentWidth + line.length + 1 + word.length <= width) {
+          line += ' $word';
+        } else {
+          writeln(line);
+          line = word;
+        }
+      } else {
+        line = word;
+      }
+      word = '';
     }
   }
 }
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index 8e8a892..ed3827c 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -63,35 +63,61 @@
 }
 '''.trim();
 
+final GeneratedFile target = new GeneratedFile('../../doc/api.html', () {
+  ToHtmlVisitor visitor = new ToHtmlVisitor(readApi());
+  dom.Document document = new dom.Document();
+  for (dom.Node node in visitor.collectHtml(visitor.visitApi)) {
+    document.append(node);
+  }
+  return document.outerHtml;
+});
+
+/**
+ * Translate spec_input.html into api.html.
+ */
+main() {
+  target.generate();
+}
+
+/**
+ * Visitor that records the mapping from HTML elements to various kinds of API
+ * nodes.
+ */
+class ApiMappings extends HierarchicalApiVisitor {
+  Map<dom.Element, Domain> domains = <dom.Element, Domain>{};
+
+  ApiMappings(Api api) : super(api);
+
+  @override
+  void visitDomain(Domain domain) {
+    domains[domain.html] = domain;
+  }
+}
+
 /**
  * Helper methods for creating HTML elements.
  */
 abstract class HtmlMixin {
-  void element(String name, Map<dynamic, String> attributes, [void callback()]);
-
   void anchor(String id, void callback()) {
     element('a', {
       'name': id
     }, callback);
   }
-  void link(String id, void callback()) {
-    element('a', {
-      'href': '#$id'
-    }, callback);
-  }
+
   void b(void callback()) => element('b', {}, callback);
+  void body(void callback()) => element('body', {}, callback);
   void box(void callback()) {
     element('div', {
       'class': 'box'
     }, callback);
   }
   void br() => element('br', {});
-  void body(void callback()) => element('body', {}, callback);
   void dd(void callback()) => element('dd', {}, callback);
   void dl(void callback()) => element('dl', {}, callback);
   void dt(String cls, void callback()) => element('dt', {
     'class': cls
   }, callback);
+  void element(String name, Map<dynamic, String> attributes, [void callback()]);
   void gray(void callback()) => element('span', {
     'style': 'color:#999999'
   }, callback);
@@ -112,6 +138,11 @@
   void head(void callback()) => element('head', {}, callback);
   void html(void callback()) => element('html', {}, callback);
   void i(void callback()) => element('i', {}, callback);
+  void link(String id, void callback()) {
+    element('a', {
+      'href': '#$id'
+    }, callback);
+  }
   void p(void callback()) => element('p', {}, callback);
   void pre(void callback()) => element('pre', {}, callback);
   void title(void callback()) => element('title', {}, callback);
@@ -119,6 +150,329 @@
 }
 
 /**
+ * Visitor that generates HTML documentation of the API.
+ */
+class ToHtmlVisitor extends HierarchicalApiVisitor with HtmlMixin, HtmlGenerator
+    {
+  /**
+   * Set of types defined in the API.
+   */
+  Set<String> definedTypes = new Set<String>();
+
+  /**
+   * Mappings from HTML elements to API nodes.
+   */
+  ApiMappings apiMappings;
+
+  ToHtmlVisitor(Api api)
+      : super(api),
+        apiMappings = new ApiMappings(api) {
+    apiMappings.visitApi();
+  }
+
+  /**
+   * Describe the payload of request, response, notification, refactoring
+   * feedback, or refactoring options.
+   *
+   * If [force] is true, then a section is inserted even if the payload is
+   * null.
+   */
+  void describePayload(TypeObject subType, String name, {bool force: false}) {
+    if (force || subType != null) {
+      h4(() {
+        write(name);
+      });
+      if (subType == null) {
+        p(() {
+          write('none');
+        });
+      } else {
+        visitTypeDecl(subType);
+      }
+    }
+  }
+
+  void javadocParams(TypeObject typeObject) {
+    if (typeObject != null) {
+      for (TypeObjectField field in typeObject.fields) {
+        hangingIndent(() {
+          write('@param ${field.name} ');
+          translateHtml(field.html, squashParagraphs: true);
+        });
+      }
+    }
+  }
+
+  /**
+   * Generate a description of [type] using [TypeVisitor].
+   *
+   * If [shortDesc] is non-null, the output is prefixed with this string
+   * and a colon.
+   *
+   * If [typeForBolding] is supplied, then fields in this type are shown in
+   * boldface.
+   */
+  void showType(String shortDesc, TypeDecl type, [TypeObject typeForBolding]) {
+    Set<String> fieldsToBold = new Set<String>();
+    if (typeForBolding != null) {
+      for (TypeObjectField field in typeForBolding.fields) {
+        fieldsToBold.add(field.name);
+      }
+    }
+    pre(() {
+      if (shortDesc != null) {
+        write('$shortDesc: ');
+      }
+      TypeVisitor typeVisitor =
+          new TypeVisitor(api, fieldsToBold: fieldsToBold);
+      addAll(typeVisitor.collectHtml(() {
+        typeVisitor.visitTypeDecl(type);
+      }));
+    });
+  }
+
+  /**
+   * Copy the contents of the given HTML element, translating the special
+   * elements that define the API appropriately.
+   */
+  void translateHtml(dom.Element html, {bool squashParagraphs: false}) {
+    for (dom.Node node in html.nodes) {
+      if (node is dom.Element) {
+        if (squashParagraphs && node.localName == 'p') {
+          translateHtml(node, squashParagraphs: squashParagraphs);
+          continue;
+        }
+        switch (node.localName) {
+          case 'api':
+            translateHtml(node, squashParagraphs: squashParagraphs);
+            break;
+          case 'domain':
+            visitDomain(apiMappings.domains[node]);
+            break;
+          case 'head':
+            head(() {
+              translateHtml(node, squashParagraphs: squashParagraphs);
+              element('style', {}, () {
+                writeln(stylesheet);
+              });
+            });
+            break;
+          case 'refactorings':
+            visitRefactorings(api.refactorings);
+            break;
+          case 'types':
+            visitTypes(api.types);
+            break;
+          case 'version':
+            translateHtml(node, squashParagraphs: squashParagraphs);
+            break;
+          default:
+            if (!specialElements.contains(node.localName)) {
+              element(node.localName, node.attributes, () {
+                translateHtml(node, squashParagraphs: squashParagraphs);
+              });
+            }
+        }
+      } else if (node is dom.Text) {
+        String text = node.text;
+        write(text);
+      }
+    }
+  }
+
+  @override
+  void visitApi() {
+    definedTypes = api.types.keys.toSet();
+
+    html(() {
+      translateHtml(api.html);
+    });
+  }
+
+  @override
+  void visitDomain(Domain domain) {
+    h2('domain', () {
+      anchor('domain_${domain.name}', () {
+        write('Domain: ${domain.name}');
+      });
+    });
+    translateHtml(domain.html);
+    if (domain.requests.isNotEmpty) {
+      h3(() {
+        write('Requests');
+      });
+      dl(() {
+        domain.requests.forEach(visitRequest);
+      });
+    }
+    if (domain.notifications.isNotEmpty) {
+      h3(() {
+        write('Notifications');
+      });
+      dl(() {
+        domain.notifications.forEach(visitNotification);
+      });
+    }
+  }
+
+  @override
+  void visitNotification(Notification notification) {
+    dt('notification', () {
+      write(notification.longEvent);
+    });
+    dd(() {
+      box(() {
+        showType(
+            'notification',
+            notification.notificationType,
+            notification.params);
+      });
+      translateHtml(notification.html);
+      describePayload(notification.params, 'Parameters');
+    });
+  }
+
+  @override visitRefactoring(Refactoring refactoring) {
+    dt('refactoring', () {
+      write(refactoring.kind);
+    });
+    dd(() {
+      translateHtml(refactoring.html);
+      describePayload(refactoring.feedback, 'Feedback', force: true);
+      describePayload(refactoring.options, 'Options', force: true);
+    });
+  }
+
+  @override
+  void visitRefactorings(Refactorings refactorings) {
+    translateHtml(refactorings.html);
+    dl(() {
+      super.visitRefactorings(refactorings);
+    });
+  }
+
+  @override
+  void visitRequest(Request request) {
+    dt('request', () {
+      write(request.longMethod);
+    });
+    dd(() {
+      box(() {
+        showType('request', request.requestType, request.params);
+        br();
+        showType('response', request.responseType, request.result);
+      });
+      translateHtml(request.html);
+      describePayload(request.params, 'Parameters');
+      describePayload(request.result, 'Returns');
+    });
+  }
+
+  @override
+  void visitTypeDefinition(TypeDefinition typeDefinition) {
+    dt('typeDefinition', () {
+      anchor('type_${typeDefinition.name}', () {
+        write('${typeDefinition.name}: ');
+        TypeVisitor typeVisitor = new TypeVisitor(api, short: true);
+        addAll(typeVisitor.collectHtml(() {
+          typeVisitor.visitTypeDecl(typeDefinition.type);
+        }));
+      });
+    });
+    dd(() {
+      translateHtml(typeDefinition.html);
+      visitTypeDecl(typeDefinition.type);
+    });
+  }
+
+  @override
+  void visitTypeEnum(TypeEnum typeEnum) {
+    dl(() {
+      super.visitTypeEnum(typeEnum);
+    });
+  }
+
+  @override
+  void visitTypeEnumValue(TypeEnumValue typeEnumValue) {
+    bool isDocumented = false;
+    for (dom.Node node in typeEnumValue.html.nodes) {
+      if ((node is dom.Element && node.localName != 'code') ||
+          (node is dom.Text && node.text.trim().isNotEmpty)) {
+        isDocumented = true;
+        break;
+      }
+    }
+    dt('value', () {
+      write(typeEnumValue.value);
+    });
+    if (isDocumented) {
+      dd(() {
+        translateHtml(typeEnumValue.html);
+      });
+    }
+  }
+
+  @override
+  void visitTypeList(TypeList typeList) {
+    visitTypeDecl(typeList.itemType);
+  }
+
+  @override
+  void visitTypeMap(TypeMap typeMap) {
+    visitTypeDecl(typeMap.valueType);
+  }
+
+  @override
+  void visitTypeObject(TypeObject typeObject) {
+    dl(() {
+      super.visitTypeObject(typeObject);
+    });
+  }
+
+  @override
+  void visitTypeObjectField(TypeObjectField typeObjectField) {
+    dt('field', () {
+      b(() {
+        i(() {
+          write(typeObjectField.name);
+          if (typeObjectField.value != null) {
+            write(' = ${JSON.encode(typeObjectField.value)}');
+          } else {
+            write(' ( ');
+            if (typeObjectField.optional) {
+              gray(() {
+                write('optional');
+              });
+              write(' ');
+            }
+            TypeVisitor typeVisitor = new TypeVisitor(api, short: true);
+            addAll(typeVisitor.collectHtml(() {
+              typeVisitor.visitTypeDecl(typeObjectField.type);
+            }));
+            write(' )');
+          }
+        });
+      });
+    });
+    dd(() {
+      translateHtml(typeObjectField.html);
+    });
+  }
+
+  @override
+  void visitTypeReference(TypeReference typeReference) {
+  }
+
+  @override
+  void visitTypes(Types types) {
+    translateHtml(types.html);
+    dl(() {
+      super.visitTypes(types);
+    });
+  }
+}
+
+/**
  * Visitor that generates a compact representation of a type, such as:
  *
  * {
@@ -129,7 +483,8 @@
  *   }
  * }
  */
-class TypeVisitor extends HierarchicalApiVisitor with HtmlMixin, HtmlCodeGenerator {
+class TypeVisitor extends HierarchicalApiVisitor with HtmlMixin,
+    HtmlCodeGenerator {
   /**
    * Set of fields which should be shown in boldface, or null if no field
    * should be shown in boldface.
@@ -234,351 +589,3 @@
     }
   }
 }
-
-/**
- * Visitor that records the mapping from HTML elements to various kinds of API
- * nodes.
- */
-class ApiMappings extends HierarchicalApiVisitor {
-  ApiMappings(Api api) : super(api);
-
-  Map<dom.Element, Domain> domains = <dom.Element, Domain>{};
-
-  @override
-  void visitDomain(Domain domain) {
-    domains[domain.html] = domain;
-  }
-}
-
-/**
- * Visitor that generates HTML documentation of the API.
- */
-class ToHtmlVisitor extends HierarchicalApiVisitor with HtmlMixin, HtmlGenerator {
-  /**
-   * Set of types defined in the API.
-   */
-  Set<String> definedTypes = new Set<String>();
-
-  /**
-   * Mappings from HTML elements to API nodes.
-   */
-  ApiMappings apiMappings;
-
-  ToHtmlVisitor(Api api)
-      : super(api),
-        apiMappings = new ApiMappings(api) {
-    apiMappings.visitApi();
-  }
-
-  @override
-  void visitApi() {
-    definedTypes = api.types.keys.toSet();
-
-    html(() {
-      translateHtml(api.html);
-    });
-  }
-
-  @override
-  void visitRefactorings(Refactorings refactorings) {
-    translateHtml(refactorings.html);
-    dl(() {
-      super.visitRefactorings(refactorings);
-    });
-  }
-
-  @override visitRefactoring(Refactoring refactoring) {
-    dt('refactoring', () {
-      write(refactoring.kind);
-    });
-    dd(() {
-      translateHtml(refactoring.html);
-      describePayload(refactoring.feedback, 'Feedback', force: true);
-      describePayload(refactoring.options, 'Options', force: true);
-    });
-  }
-
-  @override
-  void visitTypes(Types types) {
-    translateHtml(types.html);
-    dl(() {
-      super.visitTypes(types);
-    });
-  }
-
-  @override
-  void visitDomain(Domain domain) {
-    h2('domain', () {
-      anchor('domain_${domain.name}', () {
-        write('Domain: ${domain.name}');
-      });
-    });
-    translateHtml(domain.html);
-    if (domain.requests.isNotEmpty) {
-      h3(() {
-        write('Requests');
-      });
-      dl(() {
-        domain.requests.forEach(visitRequest);
-      });
-    }
-    if (domain.notifications.isNotEmpty) {
-      h3(() {
-        write('Notifications');
-      });
-      dl(() {
-        domain.notifications.forEach(visitNotification);
-      });
-    }
-  }
-
-  @override
-  void visitNotification(Notification notification) {
-    dt('notification', () {
-      write(notification.longEvent);
-    });
-    dd(() {
-      box(() {
-        showType('notification', notification.notificationType, notification.params);
-      });
-      translateHtml(notification.html);
-      describePayload(notification.params, 'Parameters');
-    });
-  }
-
-  /**
-   * Copy the contents of the given HTML element, translating the special
-   * elements that define the API appropriately.
-   */
-  void translateHtml(dom.Element html, {bool squashParagraphs: false}) {
-    for (dom.Node node in html.nodes) {
-      if (node is dom.Element) {
-        if (squashParagraphs && node.localName == 'p') {
-          translateHtml(node, squashParagraphs: squashParagraphs);
-          continue;
-        }
-        switch (node.localName) {
-          case 'api':
-            translateHtml(node, squashParagraphs: squashParagraphs);
-            break;
-          case 'domain':
-            visitDomain(apiMappings.domains[node]);
-            break;
-          case 'head':
-            head(() {
-              translateHtml(node, squashParagraphs: squashParagraphs);
-              element('style', {}, () {
-                writeln(stylesheet);
-              });
-            });
-            break;
-          case 'refactorings':
-            visitRefactorings(api.refactorings);
-            break;
-          case 'types':
-            visitTypes(api.types);
-            break;
-          case 'version':
-            translateHtml(node, squashParagraphs: squashParagraphs);
-            break;
-          default:
-            if (!specialElements.contains(node.localName)) {
-              element(node.localName, node.attributes, () {
-                translateHtml(node, squashParagraphs: squashParagraphs);
-              });
-            }
-        }
-      } else if (node is dom.Text) {
-        String text = node.text;
-        write(text);
-      }
-    }
-  }
-
-  /**
-   * Generate a description of [type] using [TypeVisitor].
-   *
-   * If [shortDesc] is non-null, the output is prefixed with this string
-   * and a colon.
-   *
-   * If [typeForBolding] is supplied, then fields in this type are shown in
-   * boldface.
-   */
-  void showType(String shortDesc, TypeDecl type, [TypeObject typeForBolding]) {
-    Set<String> fieldsToBold = new Set<String>();
-    if (typeForBolding != null) {
-      for (TypeObjectField field in typeForBolding.fields) {
-        fieldsToBold.add(field.name);
-      }
-    }
-    pre(() {
-      if (shortDesc != null) {
-        write('$shortDesc: ');
-      }
-      TypeVisitor typeVisitor = new TypeVisitor(api, fieldsToBold: fieldsToBold);
-      addAll(typeVisitor.collectHtml(() {
-        typeVisitor.visitTypeDecl(type);
-      }));
-    });
-  }
-
-  /**
-   * Describe the payload of request, response, notification, refactoring
-   * feedback, or refactoring options.
-   *
-   * If [force] is true, then a section is inserted even if the payload is
-   * null.
-   */
-  void describePayload(TypeObject subType, String name, {bool force: false}) {
-    if (force || subType != null) {
-      h4(() {
-        write(name);
-      });
-      if (subType == null) {
-        p(() {
-          write('none');
-        });
-      } else {
-        visitTypeDecl(subType);
-      }
-    }
-  }
-
-  void javadocParams(TypeObject typeObject) {
-    if (typeObject != null) {
-      for (TypeObjectField field in typeObject.fields) {
-        hangingIndent(() {
-          write('@param ${field.name} ');
-          translateHtml(field.html, squashParagraphs: true);
-        });
-      }
-    }
-  }
-
-  @override
-  void visitRequest(Request request) {
-    dt('request', () {
-      write(request.longMethod);
-    });
-    dd(() {
-      box(() {
-        showType('request', request.requestType, request.params);
-        br();
-        showType('response', request.responseType, request.result);
-      });
-      translateHtml(request.html);
-      describePayload(request.params, 'Parameters');
-      describePayload(request.result, 'Returns');
-    });
-  }
-
-  @override
-  void visitTypeDefinition(TypeDefinition typeDefinition) {
-    dt('typeDefinition', () {
-      anchor('type_${typeDefinition.name}', () {
-        write('${typeDefinition.name}: ');
-        TypeVisitor typeVisitor = new TypeVisitor(api, short: true);
-        addAll(typeVisitor.collectHtml(() {
-          typeVisitor.visitTypeDecl(typeDefinition.type);
-        }));
-      });
-    });
-    dd(() {
-      translateHtml(typeDefinition.html);
-      visitTypeDecl(typeDefinition.type);
-    });
-  }
-
-  @override
-  void visitTypeEnum(TypeEnum typeEnum) {
-    dl(() {
-      super.visitTypeEnum(typeEnum);
-    });
-  }
-
-  @override
-  void visitTypeEnumValue(TypeEnumValue typeEnumValue) {
-    bool isDocumented = false;
-    for (dom.Node node in typeEnumValue.html.nodes) {
-      if ((node is dom.Element && node.localName != 'code') || (node is dom.Text && node.text.trim().isNotEmpty)) {
-        isDocumented = true;
-        break;
-      }
-    }
-    dt('value', () {
-      write(typeEnumValue.value);
-    });
-    if (isDocumented) {
-      dd(() {
-        translateHtml(typeEnumValue.html);
-      });
-    }
-  }
-
-  @override
-  void visitTypeList(TypeList typeList) {
-    visitTypeDecl(typeList.itemType);
-  }
-
-  @override
-  void visitTypeMap(TypeMap typeMap) {
-    visitTypeDecl(typeMap.valueType);
-  }
-
-  @override
-  void visitTypeObject(TypeObject typeObject) {
-    dl(() {
-      super.visitTypeObject(typeObject);
-    });
-  }
-
-  @override
-  void visitTypeObjectField(TypeObjectField typeObjectField) {
-    dt('field', () {
-      b(() {
-        i(() {
-          write(typeObjectField.name);
-          if (typeObjectField.value != null) {
-            write(' = ${JSON.encode(typeObjectField.value)}');
-          } else {
-            write(' ( ');
-            if (typeObjectField.optional) {
-              gray(() {
-                write('optional');
-              });
-              write(' ');
-            }
-            TypeVisitor typeVisitor = new TypeVisitor(api, short: true);
-            addAll(typeVisitor.collectHtml(() {
-              typeVisitor.visitTypeDecl(typeObjectField.type);
-            }));
-            write(' )');
-          }
-        });
-      });
-    });
-    dd(() {
-      translateHtml(typeObjectField.html);
-    });
-  }
-
-  @override
-  void visitTypeReference(TypeReference typeReference) {
-  }
-}
-
-final GeneratedFile target = new GeneratedFile('../../doc/api.html', () {
-  ToHtmlVisitor visitor = new ToHtmlVisitor(readApi());
-  dom.Document document = new dom.Document();
-  for (dom.Node node in visitor.collectHtml(visitor.visitApi)) {
-    document.append(node);
-  }
-  return document.outerHtml;
-});
-
-/**
- * Translate spec_input.html into api.html.
- */
-main() {
-  target.generate();
-}
diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart
index bf1ce78..c40fdf7 100644
--- a/pkg/analyzer/bin/analyzer.dart
+++ b/pkg/analyzer/bin/analyzer.dart
@@ -1,5 +1,4 @@
 #!/usr/bin/env dart
-
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -11,13 +10,13 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analyzer/options.dart';
 import 'package:analyzer/src/analyzer_impl.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/interner.dart';
 import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
 import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/options.dart';
 
 void main(List<String> args) {
   StringUtilities.INTERNER = new MappedInterner();
@@ -104,14 +103,14 @@
     int totalTests = 0;
     ErrorSeverity batchResult = ErrorSeverity.NONE;
     // read line from stdin
-    Stream cmdLine = stdin
-        .transform(UTF8.decoder)
-        .transform(new LineSplitter());
+    Stream cmdLine =
+        stdin.transform(UTF8.decoder).transform(new LineSplitter());
     cmdLine.listen((String line) {
       // may be finish
       if (line.isEmpty) {
         var time = stopwatch.elapsedMilliseconds;
-        stdout.writeln('>>> BATCH END (${totalTests - testsFailed}/$totalTests) ${time}ms');
+        stdout.writeln(
+            '>>> BATCH END (${totalTests - testsFailed}/$totalTests) ${time}ms');
         exitCode = batchResult.ordinal;
       }
       // prepare aruments
@@ -136,7 +135,8 @@
         // Write stderr end token and flush.
         stderr.writeln('>>> EOF STDERR');
         String resultPassString = resultPass ? 'PASS' : 'FAIL';
-        stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMilliseconds}ms');
+        stdout.writeln(
+            '>>> TEST $resultPassString ${stopwatch.elapsedMilliseconds}ms');
       } catch (e, stackTrace) {
         stderr.writeln(e);
         stderr.writeln(stackTrace);
diff --git a/pkg/analyzer/bin/coverage.dart b/pkg/analyzer/bin/coverage.dart
index 32194c6..6fbc0d1 100644
--- a/pkg/analyzer/bin/coverage.dart
+++ b/pkg/analyzer/bin/coverage.dart
@@ -6,10 +6,27 @@
 
 import 'dart:io';
 
+import 'package:analyzer/src/services/runtime/coverage/coverage_impl.dart';
+import 'package:analyzer/src/services/runtime/log.dart' as log;
 import 'package:args/args.dart';
 
-import 'package:analyzer/src/services/runtime/log.dart' as log;
-import 'package:analyzer/src/services/runtime/coverage/coverage_impl.dart';
+
+/// General error code.
+const ERROR = 1;
+
+
+final ArgParser _argParser = new ArgParser()
+    ..addFlag('help', negatable: false, help: 'Print this usage information.')
+    ..addOption(
+        'level',
+        help: 'The level of the coverage.',
+        allowed: ['method', 'block', 'statement'],
+        defaultsTo: 'statement')
+    ..addOption('out', help: 'The output file with statistics.')
+    ..addOption(
+        'port',
+        help: 'The port to run server on, if 0 select any.',
+        defaultsTo: '0');
 
 
 main(args) {
@@ -63,27 +80,9 @@
 }
 
 
-final ArgParser _argParser = new ArgParser()
-    ..addFlag('help', negatable: false, help: 'Print this usage information.')
-    ..addOption(
-        'level',
-        help: 'The level of the coverage.',
-        allowed: ['method', 'block', 'statement'],
-        defaultsTo: 'statement')
-    ..addOption('out', help: 'The output file with statistics.')
-    ..addOption(
-        'port',
-        help: 'The port to run server on, if 0 select any.',
-        defaultsTo: '0');
-
-
 printUsage([var description = 'Code coverage tool for Dart.']) {
   var usage = _argParser.usage;
   print('$description\n');
   print('Usage: coverage [options] <script>\n');
   print('$usage\n');
 }
-
-
-/// General error code.
-const ERROR = 1;
diff --git a/pkg/analyzer/bin/formatter.dart b/pkg/analyzer/bin/formatter.dart
index bfb03b5..3c9b707 100755
--- a/pkg/analyzer/bin/formatter.dart
+++ b/pkg/analyzer/bin/formatter.dart
@@ -1,5 +1,4 @@
 #!/usr/bin/env dart
-
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -76,8 +75,8 @@
   }
   int spacesPerIndent = _toInt(indentOption);
   if (spacesPerIndent == null) {
-    throw new FormatterException('Indentation is specified as an Integer or '
-        'the value "tab".');
+    throw new FormatterException(
+        'Indentation is specified as an Integer or ' 'the value "tab".');
   }
   return spacesPerIndent;
 }
@@ -86,8 +85,8 @@
 bool _parseTabsForIndent(String indentOption) => indentOption == 'tab';
 
 CodeKind _parseKind(kindOption) {
-  switch(kindOption) {
-    case 'stmt' :
+  switch (kindOption) {
+    case 'stmt':
       return CodeKind.STATEMENT;
     default:
       return CodeKind.COMPILATION_UNIT;
@@ -101,8 +100,8 @@
     if (val == 'INF' || val == 'INFINITY') {
       length = -1;
     } else {
-      throw new FormatterException('Line length is specified as an Integer or '
-          'the value "Inf".');
+      throw new FormatterException(
+          'Line length is specified as an Integer or ' 'the value "Inf".');
     }
   }
   return length;
@@ -110,7 +109,7 @@
 
 
 Selection _parseSelection(String selectionOption) {
-  if(selectionOption == null) return null;
+  if (selectionOption == null) return null;
 
   var units = selectionOption.split(',');
   if (units.length == 2) {
@@ -120,8 +119,8 @@
       return new Selection(offset, length);
     }
   }
-  throw new FormatterException('Selections are specified as integer pairs '
-                               '(e.g., "(offset, length)".');
+  throw new FormatterException(
+      'Selections are specified as integer pairs ' '(e.g., "(offset, length)".');
 }
 
 int _toInt(str) => int.parse(str, onError: (_) => null);
@@ -144,8 +143,9 @@
   }
 }
 
-_formatDirectory(dir) => dir.listSync(followLinks: FOLLOW_LINKS)
-    .forEach((resource) => _formatResource(resource));
+_formatDirectory(dir) =>
+    dir.listSync(
+        followLinks: FOLLOW_LINKS).forEach((resource) => _formatResource(resource));
 
 _formatFile(file) {
   if (_isDartFile(file)) {
@@ -176,37 +176,62 @@
 
 _formatStdin(kind) {
   var input = new StringBuffer();
-  stdin.transform(new Utf8Decoder())
-      .listen((data) => input.write(data),
-        onError: (error) => _log('Error reading from stdin'),
-        onDone: () => print(_format(input.toString(), kind)));
+  stdin.transform(
+      new Utf8Decoder()).listen(
+          (data) => input.write(data),
+          onError: (error) => _log('Error reading from stdin'),
+          onDone: () => print(_format(input.toString(), kind)));
 }
 
 /// Initialize the arg parser instance.
 ArgParser _initArgParser() {
   // NOTE: these flags are placeholders only!
   var parser = new ArgParser();
-  parser.addFlag(WRITE_FLAG, abbr: 'w', negatable: false,
+  parser.addFlag(
+      WRITE_FLAG,
+      abbr: 'w',
+      negatable: false,
       help: 'Write reformatted sources to files (overwriting contents).  '
-            'Do not print reformatted sources to standard output.');
-  parser.addFlag(TRANSFORM_FLAG, abbr: 't', negatable: false,
+          'Do not print reformatted sources to standard output.');
+  parser.addFlag(
+      TRANSFORM_FLAG,
+      abbr: 't',
+      negatable: false,
       help: 'Perform code transformations.');
-  parser.addOption(MAX_LINE_FLAG, abbr: 'l', defaultsTo: '80',
+  parser.addOption(
+      MAX_LINE_FLAG,
+      abbr: 'l',
+      defaultsTo: '80',
       help: 'Wrap lines longer than this length. '
-            'To never wrap, specify "Infinity" or "Inf" for short.');
-  parser.addOption(INDENT_FLAG, abbr: 'i', defaultsTo: '2',
+          'To never wrap, specify "Infinity" or "Inf" for short.');
+  parser.addOption(
+      INDENT_FLAG,
+      abbr: 'i',
+      defaultsTo: '2',
       help: 'Specify number of spaces per indentation. '
-            'To indent using tabs, specify "--$INDENT_FLAG tab".'
-            '--- [PROVISIONAL API].', hide: true);
-  parser.addOption(KIND_FLAG, abbr: 'k', defaultsTo: 'cu',
-      help: 'Specify source snippet kind ("stmt" or "cu") '
-            '--- [PROVISIONAL API].', hide: true);
-  parser.addOption(SELECTION_FLAG, abbr: 's',
+          'To indent using tabs, specify "--$INDENT_FLAG tab".' '--- [PROVISIONAL API].',
+      hide: true);
+  parser.addOption(
+      KIND_FLAG,
+      abbr: 'k',
+      defaultsTo: 'cu',
+      help: 'Specify source snippet kind ("stmt" or "cu") ' '--- [PROVISIONAL API].',
+      hide: true);
+  parser.addOption(
+      SELECTION_FLAG,
+      abbr: 's',
       help: 'Specify selection information as an offset,length pair '
-            '(e.g., -s "0,4").', hide: true);
-  parser.addFlag(MACHINE_FLAG, abbr: 'm', negatable: false,
+          '(e.g., -s "0,4").',
+      hide: true);
+  parser.addFlag(
+      MACHINE_FLAG,
+      abbr: 'm',
+      negatable: false,
       help: 'Produce output in a format suitable for parsing.');
-  parser.addFlag(HELP_FLAG, abbr: 'h', negatable: false,
+  parser.addFlag(
+      HELP_FLAG,
+      abbr: 'h',
+      negatable: false,
       help: 'Print this usage information.');
   return parser;
 }
@@ -215,25 +240,26 @@
 /// Displays usage information.
 _printUsage() {
   var buffer = new StringBuffer();
-  buffer..write('$BINARY_NAME formats Dart programs.')
-        ..write('\n\n')
-        ..write('Without an explicit path, $BINARY_NAME processes the standard '
-                'input.  Given a file, it operates on that file; given a '
-                'directory, it operates on all .dart files in that directory, '
-                'recursively. (Files starting with a period are ignored.) By '
-                'default, $BINARY_NAME prints the reformatted sources to '
-                'standard output.')
-        ..write('\n\n')
-        ..write('Usage: $BINARY_NAME [flags] [path...]\n\n')
-        ..write('Supported flags are:\n')
-        ..write('${argParser.usage}\n\n');
+  buffer
+      ..write('$BINARY_NAME formats Dart programs.')
+      ..write('\n\n')
+      ..write(
+          'Without an explicit path, $BINARY_NAME processes the standard '
+              'input.  Given a file, it operates on that file; given a '
+              'directory, it operates on all .dart files in that directory, '
+              'recursively. (Files starting with a period are ignored.) By '
+              'default, $BINARY_NAME prints the reformatted sources to ' 'standard output.')
+      ..write('\n\n')
+      ..write('Usage: $BINARY_NAME [flags] [path...]\n\n')
+      ..write('Supported flags are:\n')
+      ..write('${argParser.usage}\n\n');
   _log(buffer.toString());
 }
 
 /// Format this [src], treating it as the given snippet [kind].
 String _format(src, kind) {
-  var formatResult = new CodeFormatter(formatterSettings).format(
-      kind, src, selection: selection);
+  var formatResult =
+      new CodeFormatter(formatterSettings).format(kind, src, selection: selection);
   if (machineFormat) {
     if (formatResult.selection == null) {
       formatResult.selection = defaultSelection;
@@ -243,17 +269,17 @@
   return formatResult.source;
 }
 
-_toJson(formatResult) =>
-    // Actual JSON format TBD
-    JSON.encode({'source': formatResult.source,
-                 'selection': {
-                     'offset': formatResult.selection.offset,
-                     'length': formatResult.selection.length
-                  }
-    });
+_toJson(formatResult) => // Actual JSON format TBD
+JSON.encode({
+  'source': formatResult.source,
+  'selection': {
+    'offset': formatResult.selection.offset,
+    'length': formatResult.selection.length
+  }
+});
 
 /// Log the given [msg].
 _log(String msg) {
   //TODO(pquitslund): add proper log support
   print(msg);
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/example/parser_driver.dart b/pkg/analyzer/example/parser_driver.dart
index 2bbd669..c4d585d 100644
--- a/pkg/analyzer/example/parser_driver.dart
+++ b/pkg/analyzer/example/parser_driver.dart
@@ -1,5 +1,4 @@
 #!/usr/bin/env dart
-
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -44,12 +43,6 @@
   }
 }
 
-class _ErrorCollector extends AnalysisErrorListener {
-  List<AnalysisError> errors;
-  _ErrorCollector() : errors = new List<AnalysisError>();
-  onError(error) => errors.add(error);
-}
-
 class _ASTVisitor extends GeneralizingAstVisitor {
   visitNode(AstNode node) {
     print('${node.runtimeType} : <"$node">');
@@ -57,3 +50,8 @@
   }
 }
 
+class _ErrorCollector extends AnalysisErrorListener {
+  List<AnalysisError> errors;
+  _ErrorCollector() : errors = new List<AnalysisError>();
+  onError(error) => errors.add(error);
+}
diff --git a/pkg/analyzer/example/resolver_driver.dart b/pkg/analyzer/example/resolver_driver.dart
index 08e4065..0992b76 100644
--- a/pkg/analyzer/example/resolver_driver.dart
+++ b/pkg/analyzer/example/resolver_driver.dart
@@ -1,18 +1,17 @@
 #!/usr/bin/env dart
-
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:analyzer/src/generated/source_io.dart';
+import 'dart:io';
+
 import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
-import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-
-import 'dart:io';
+import 'package:analyzer/src/generated/java_io.dart';
+import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
+import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
+import 'package:analyzer/src/generated/source_io.dart';
 
 main(List<String> args) {
   print('working dir ${new File('.').resolveSymbolicLinksSync()}');
@@ -26,7 +25,8 @@
   DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
 
   AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
-  context.sourceFactory = new SourceFactory([new DartUriResolver(sdk), new FileUriResolver()]);
+  context.sourceFactory =
+      new SourceFactory([new DartUriResolver(sdk), new FileUriResolver()]);
   Source source = new FileBasedSource.con1(new JavaFile(args[1]));
   //
   ChangeSet changeSet = new ChangeSet();
@@ -35,7 +35,8 @@
   LibraryElement libElement = context.computeLibraryElement(source);
   print("libElement: $libElement");
 
-  CompilationUnit resolvedUnit = context.resolveCompilationUnit(source, libElement);
+  CompilationUnit resolvedUnit =
+      context.resolveCompilationUnit(source, libElement);
   var visitor = new _ASTVisitor();
   resolvedUnit.accept(visitor);
 }
@@ -49,7 +50,8 @@
         text += " element: ${element.runtimeType}";
         LibraryElement library = element.library;
         if (library != null) {
-          text += " from ${element.library.definingCompilationUnit.source.fullName}";
+          text +=
+              " from ${element.library.definingCompilationUnit.source.fullName}";
         }
       }
     }
@@ -57,4 +59,3 @@
     return super.visitNode(node);
   }
 }
-
diff --git a/pkg/analyzer/example/scanner_driver.dart b/pkg/analyzer/example/scanner_driver.dart
index 8eccee9..5c150e1 100644
--- a/pkg/analyzer/example/scanner_driver.dart
+++ b/pkg/analyzer/example/scanner_driver.dart
@@ -1,5 +1,4 @@
 #!/usr/bin/env dart
-
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
diff --git a/pkg/analyzer/lib/analyzer.dart b/pkg/analyzer/lib/analyzer.dart
index dc0b647..2f52d8a3 100644
--- a/pkg/analyzer/lib/analyzer.dart
+++ b/pkg/analyzer/lib/analyzer.dart
@@ -21,6 +21,30 @@
 export 'src/generated/error.dart';
 export 'src/generated/utilities_dart.dart';
 
+/// Parses a string of Dart code into an AST.
+///
+/// If [name] is passed, it's used in error messages as the name of the code
+/// being parsed.
+///
+/// Throws an [AnalyzerErrorGroup] if any errors occurred, unless
+/// [suppressErrors] is `true`, in which case any errors are discarded.
+CompilationUnit parseCompilationUnit(String contents, {String name,
+    bool suppressErrors: false}) {
+  if (name == null) name = '<unknown source>';
+  var source = new StringSource(contents, name);
+  var errorCollector = new _ErrorCollector();
+  var reader = new CharSequenceReader(contents);
+  var scanner = new Scanner(source, reader, errorCollector);
+  var token = scanner.tokenize();
+  var parser = new Parser(source, errorCollector);
+  var unit = parser.parseCompilationUnit(token);
+  unit.lineInfo = new LineInfo(scanner.lineStarts);
+
+  if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
+
+  return unit;
+}
+
 /// Parses a Dart file into an AST.
 CompilationUnit parseDartFile(String path) {
   String contents = new File(path).readAsStringSync();
@@ -48,30 +72,6 @@
   return unit;
 }
 
-/// Parses a string of Dart code into an AST.
-///
-/// If [name] is passed, it's used in error messages as the name of the code
-/// being parsed.
-///
-/// Throws an [AnalyzerErrorGroup] if any errors occurred, unless
-/// [suppressErrors] is `true`, in which case any errors are discarded.
-CompilationUnit parseCompilationUnit(String contents,
-    {String name, bool suppressErrors: false}) {
-  if (name == null) name = '<unknown source>';
-  var source = new StringSource(contents, name);
-  var errorCollector = new _ErrorCollector();
-  var reader = new CharSequenceReader(contents);
-  var scanner = new Scanner(source, reader, errorCollector);
-  var token = scanner.tokenize();
-  var parser = new Parser(source, errorCollector);
-  var unit = parser.parseCompilationUnit(token);
-  unit.lineInfo = new LineInfo(scanner.lineStarts);
-
-  if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
-
-  return unit;
-}
-
 /// Parses the script tag and directives in a string of Dart code into an AST.
 ///
 /// Stops parsing when the first non-directive is encountered. The rest of the
@@ -82,8 +82,8 @@
 ///
 /// Throws an [AnalyzerErrorGroup] if any errors occurred, unless
 /// [suppressErrors] is `true`, in which case any errors are discarded.
-CompilationUnit parseDirectives(String contents,
-    {String name, bool suppressErrors: false}) {
+CompilationUnit parseDirectives(String contents, {String name,
+    bool suppressErrors: false}) {
   if (name == null) name = '<unknown source>';
   var source = new StringSource(contents, name);
   var errorCollector = new _ErrorCollector();
@@ -108,14 +108,14 @@
 class _ErrorCollector extends AnalysisErrorListener {
   final _errors = <AnalysisError>[];
 
-  /// Whether any errors where collected.
-  bool get hasErrors => !_errors.isEmpty;
+  _ErrorCollector();
 
   /// The group of errors collected.
   AnalyzerErrorGroup get group =>
-    new AnalyzerErrorGroup.fromAnalysisErrors(_errors);
+      new AnalyzerErrorGroup.fromAnalysisErrors(_errors);
 
-  _ErrorCollector();
+  /// Whether any errors where collected.
+  bool get hasErrors => !_errors.isEmpty;
 
   void onError(AnalysisError error) => _errors.add(error);
 }
diff --git a/pkg/analyzer/lib/file_system/file_system.dart b/pkg/analyzer/lib/file_system/file_system.dart
index c2fb88f..a6580f5 100644
--- a/pkg/analyzer/lib/file_system/file_system.dart
+++ b/pkg/analyzer/lib/file_system/file_system.dart
@@ -139,8 +139,8 @@
     if (!_isFileUri(uri)) {
       return null;
     }
-    Resource resource = _provider.getResource(_provider.pathContext.fromUri(uri)
-        );
+    Resource resource =
+        _provider.getResource(_provider.pathContext.fromUri(uri));
     if (resource is File) {
       return resource.createSource(uri);
     }
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 93fe125..8c3edc2 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -153,9 +153,8 @@
  * non-existent file.
  */
 class _MemoryDummyLink extends _MemoryResource implements File {
-  _MemoryDummyLink(MemoryResourceProvider provider, String path) : super(
-      provider,
-      path);
+  _MemoryDummyLink(MemoryResourceProvider provider, String path)
+      : super(provider, path);
 
   @override
   bool get exists => false;
@@ -182,9 +181,8 @@
  * An in-memory implementation of [File].
  */
 class _MemoryFile extends _MemoryResource implements File {
-  _MemoryFile(MemoryResourceProvider provider, String path) : super(
-      provider,
-      path);
+  _MemoryFile(MemoryResourceProvider provider, String path)
+      : super(provider, path);
 
   String get _content {
     String content = _provider._pathToContent[path];
@@ -284,9 +282,8 @@
  * An in-memory implementation of [Folder].
  */
 class _MemoryFolder extends _MemoryResource implements Folder {
-  _MemoryFolder(MemoryResourceProvider provider, String path) : super(
-      provider,
-      path);
+  _MemoryFolder(MemoryResourceProvider provider, String path)
+      : super(provider, path);
   @override
   Stream<WatchEvent> get changes {
     StreamController<WatchEvent> streamController =
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index 17c51e6..431e92c 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -53,7 +53,8 @@
       home = io.Platform.environment['HOME'];
     }
     if (home != null && io.FileSystemEntity.isDirectorySync(home)) {
-      io.Directory directory = new io.Directory(join(home, SERVER_DIR, pluginId));
+      io.Directory directory =
+          new io.Directory(join(home, SERVER_DIR, pluginId));
       directory.createSync(recursive: true);
       return new _PhysicalFolder(directory);
     }
diff --git a/pkg/analyzer/lib/formatter.dart b/pkg/analyzer/lib/formatter.dart
index 5139cde..9c177ea 100644
--- a/pkg/analyzer/lib/formatter.dart
+++ b/pkg/analyzer/lib/formatter.dart
@@ -4,5 +4,5 @@
 
 library formatter;
 
-export 'package:analyzer/src/services/formatter_impl.dart'
-  show CodeFormatter, FormatterOptions, FormattedSource, CodeKind;
\ No newline at end of file
+export 'package:analyzer/src/services/formatter_impl.dart' show CodeFormatter,
+    FormatterOptions, FormattedSource, CodeKind;
diff --git a/pkg/analyzer/lib/options.dart b/pkg/analyzer/lib/options.dart
index 4833c3c..7dd0c17 100644
--- a/pkg/analyzer/lib/options.dart
+++ b/pkg/analyzer/lib/options.dart
@@ -74,25 +74,27 @@
   /**
    * Initialize options from the given parsed [args].
    */
-  CommandLineOptions._fromArgs(ArgResults args, Map<String, String> definedVariables)
-    : dartSdkPath = args['dart-sdk'],
-      this.definedVariables = definedVariables,
-      disableHints = args['no-hints'],
-      displayVersion = args['version'],
-      enableAsync = args['enable-async'],
-      enableEnum = args['enable-enum'],
-      enableTypeChecks = args['enable_type_checks'],
-      ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'],
-      log = args['log'],
-      machineFormat = args['machine'] || args['format'] == 'machine',
-      packageRootPath = args['package-root'],
-      perf = args['perf'],
-      shouldBatch = args['batch'],
-      showPackageWarnings = args['show-package-warnings'] || args['package-warnings'],
-      showSdkWarnings = args['show-sdk-warnings'] || args['warnings'],
-      sourceFiles = args.rest,
-      warmPerf = args['warm-perf'],
-      warningsAreFatal = args['fatal-warnings'];
+  CommandLineOptions._fromArgs(ArgResults args, Map<String,
+      String> definedVariables)
+      : dartSdkPath = args['dart-sdk'],
+        this.definedVariables = definedVariables,
+        disableHints = args['no-hints'],
+        displayVersion = args['version'],
+        enableAsync = args['enable-async'],
+        enableEnum = args['enable-enum'],
+        enableTypeChecks = args['enable_type_checks'],
+        ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'],
+        log = args['log'],
+        machineFormat = args['machine'] || args['format'] == 'machine',
+        packageRootPath = args['package-root'],
+        perf = args['perf'],
+        shouldBatch = args['batch'],
+        showPackageWarnings = args['show-package-warnings'] ||
+          args['package-warnings'],
+        showSdkWarnings = args['show-sdk-warnings'] || args['warnings'],
+        sourceFiles = args.rest,
+        warmPerf = args['warm-perf'],
+        warningsAreFatal = args['fatal-warnings'];
 
   /**
    * Parse [args] into [CommandLineOptions] describing the specified
@@ -118,64 +120,131 @@
     return options;
   }
 
+  static String _getVersion() {
+    try {
+      // This is relative to bin/snapshot, so ../..
+      String versionPath =
+          Platform.script.resolve('../../version').toFilePath();
+      File versionFile = new File(versionPath);
+      return versionFile.readAsStringSync().trim();
+    } catch (_) {
+      // This happens when the script is not running in the context of an SDK.
+      return "<unknown>";
+    }
+  }
+
   static CommandLineOptions _parse(List<String> args) {
     args = args.expand((String arg) => arg.split('=')).toList();
     var parser = new _CommandLineParser()
-      ..addFlag('batch', abbr: 'b', help: 'Run in batch mode',
-          defaultsTo: false, negatable: false)
-      ..addOption('dart-sdk', help: 'The path to the Dart SDK')
-      ..addOption('package-root', abbr: 'p',
-          help: 'The path to the package root. The flag package-root is deprecated. Remove to use package information computed by pub.')
-      ..addOption('format',
-          help: 'Specifies the format in which errors are displayed')
-      ..addFlag('machine',
-          help: 'Print errors in a format suitable for parsing (deprecated)',
-          defaultsTo: false, negatable: false)
-      ..addFlag('version', help: 'Print the analyzer version',
-          defaultsTo: false, negatable: false)
-      ..addFlag('no-hints', help: 'Do not show hint results',
-          defaultsTo: false, negatable: false)
-      ..addFlag('ignore-unrecognized-flags',
-          help: 'Ignore unrecognized command line flags',
-          defaultsTo: false, negatable: false)
-      ..addFlag('fatal-warnings', help: 'Treat non-type warnings as fatal',
-          defaultsTo: false, negatable: false)
-      ..addFlag('package-warnings',
-          help: 'Show warnings from package: imports',
-          defaultsTo: false, negatable: false)
-      ..addFlag('show-package-warnings',
-          help: 'Show warnings from package: imports (deprecated)',
-          defaultsTo: false, negatable: false)
-      ..addFlag('perf',
-          help: 'Show performance statistics',
-          defaultsTo: false, negatable: false)
-      ..addFlag('warnings', help: 'Show warnings from SDK imports',
-          defaultsTo: false, negatable: false)
-      ..addFlag('show-sdk-warnings', help: 'Show warnings from SDK imports (deprecated)',
-          defaultsTo: false, negatable: false)
-      ..addFlag('help', abbr: 'h', help: 'Display this help message',
-          defaultsTo: false, negatable: false)
-      //
-      // Hidden flags.
-      //
-      ..addFlag('enable-async',
-          help: 'Enable support for the proposed async feature',
-          defaultsTo: false, negatable: false, hide: true)
-      ..addFlag('enable-enum',
-          help: 'Enable support for the proposed enum feature',
-          defaultsTo: false, negatable: false, hide: true)
-      ..addFlag('log', help: 'Log additional messages and exceptions',
-          defaultsTo: false, negatable: false, hide: true)
-      ..addFlag('warm-perf',
-          help: 'Show both cold and warm performance statistics',
-          defaultsTo: false, negatable: false, hide: true)
-      ..addFlag('enable_type_checks',
-          help: 'Check types in constant evaluation',
-          defaultsTo: false, negatable: false, hide: true);
+        ..addFlag(
+            'batch',
+            abbr: 'b',
+            help: 'Run in batch mode',
+            defaultsTo: false,
+            negatable: false)
+        ..addOption('dart-sdk', help: 'The path to the Dart SDK')
+        ..addOption(
+            'package-root',
+            abbr: 'p',
+            help:
+                'The path to the package root. The flag package-root is deprecated. Remove to use package information computed by pub.')
+        ..addOption(
+            'format',
+            help: 'Specifies the format in which errors are displayed')
+        ..addFlag(
+            'machine',
+            help: 'Print errors in a format suitable for parsing (deprecated)',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'version',
+            help: 'Print the analyzer version',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'no-hints',
+            help: 'Do not show hint results',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'ignore-unrecognized-flags',
+            help: 'Ignore unrecognized command line flags',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'fatal-warnings',
+            help: 'Treat non-type warnings as fatal',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'package-warnings',
+            help: 'Show warnings from package: imports',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'show-package-warnings',
+            help: 'Show warnings from package: imports (deprecated)',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'perf',
+            help: 'Show performance statistics',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'warnings',
+            help: 'Show warnings from SDK imports',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'show-sdk-warnings',
+            help: 'Show warnings from SDK imports (deprecated)',
+            defaultsTo: false,
+            negatable: false)
+        ..addFlag(
+            'help',
+            abbr: 'h',
+            help: 'Display this help message',
+            defaultsTo: false,
+            negatable: false)
+        //
+        // Hidden flags.
+        //
+        ..addFlag(
+            'enable-async',
+            help: 'Enable support for the proposed async feature',
+            defaultsTo: false,
+            negatable: false,
+            hide: true)
+        ..addFlag(
+            'enable-enum',
+            help: 'Enable support for the proposed enum feature',
+            defaultsTo: false,
+            negatable: false,
+            hide: true)
+        ..addFlag(
+            'log',
+            help: 'Log additional messages and exceptions',
+            defaultsTo: false,
+            negatable: false,
+            hide: true)
+        ..addFlag(
+            'warm-perf',
+            help: 'Show both cold and warm performance statistics',
+            defaultsTo: false,
+            negatable: false,
+            hide: true)
+        ..addFlag(
+            'enable_type_checks',
+            help: 'Check types in constant evaluation',
+            defaultsTo: false,
+            negatable: false,
+            hide: true);
 
     try {
       // TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=11061
-      args = args.map((String arg) => arg == '-batch' ? '--batch' : arg).toList();
+      args =
+          args.map((String arg) => arg == '-batch' ? '--batch' : arg).toList();
       Map<String, String> definedVariables = <String, String>{};
       var results = parser.parse(args, definedVariables);
       // help requests
@@ -214,19 +283,6 @@
     print('');
     print('For more information, see http://www.dartlang.org/tools/analyzer.');
   }
-
-  static String _getVersion() {
-    try {
-      // This is relative to bin/snapshot, so ../..
-      String versionPath =
-          Platform.script.resolve('../../version').toFilePath();
-      File versionFile = new File(versionPath);
-      return versionFile.readAsStringSync().trim();
-    } catch (_) {
-      // This happens when the script is not running in the context of an SDK.
-      return "<unknown>";
-    }
-  }
 }
 
 /**
@@ -242,8 +298,8 @@
 
   /** Creates a new command line parser */
   _CommandLineParser()
-    : _knownFlags = <String>[],
-      _parser = new ArgParser(allowTrailingOptions: true);
+      : _knownFlags = <String>[],
+        _parser = new ArgParser(allowTrailingOptions: true);
 
 
   /**
@@ -254,8 +310,14 @@
   void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
       bool negatable: true, void callback(bool value), bool hide: false}) {
     _knownFlags.add(name);
-    _parser.addFlag(name, abbr: abbr, help: help, defaultsTo: defaultsTo,
-        negatable: negatable, callback: callback, hide: hide);
+    _parser.addFlag(
+        name,
+        abbr: abbr,
+        help: help,
+        defaultsTo: defaultsTo,
+        negatable: negatable,
+        callback: callback,
+        hide: hide);
   }
 
   /**
@@ -264,11 +326,17 @@
    * See [ArgParser.addOption()].
    */
   void addOption(String name, {String abbr, String help, List<String> allowed,
-      Map<String, String> allowedHelp, String defaultsTo,
-      void callback(value), bool allowMultiple: false}) {
+      Map<String, String> allowedHelp, String defaultsTo, void callback(value),
+      bool allowMultiple: false}) {
     _knownFlags.add(name);
-    _parser.addOption(name, abbr: abbr, help: help, allowed: allowed,
-        allowedHelp: allowedHelp, defaultsTo: defaultsTo, callback: callback,
+    _parser.addOption(
+        name,
+        abbr: abbr,
+        help: help,
+        allowed: allowed,
+        allowedHelp: allowedHelp,
+        defaultsTo: defaultsTo,
+        callback: callback,
         allowMultiple: allowMultiple);
   }
 
@@ -287,9 +355,11 @@
    *
    * See [ArgParser].
    */
-  ArgResults parse(List<String> args, Map<String, String> definedVariables) => _parser.parse(_filterUnknowns(parseDefinedVariables(args, definedVariables)));
+  ArgResults parse(List<String> args, Map<String, String> definedVariables) =>
+      _parser.parse(_filterUnknowns(parseDefinedVariables(args, definedVariables)));
 
-  List<String> parseDefinedVariables(List<String> args, Map<String, String> definedVariables) {
+  List<String> parseDefinedVariables(List<String> args, Map<String,
+      String> definedVariables) {
     int count = args.length;
     List<String> remainingArgs = <String>[];
     for (int i = 0; i < count; i++) {
@@ -313,14 +383,14 @@
     if (!args.contains('--ignore-unrecognized-flags')) {
       return args;
     }
-
-    //TODO(pquitslund): replace w/ the following once library skew issues are sorted out
+    //TODO(pquitslund): replace w/ the following once library skew issues are
+    // sorted out
     //return args.where((arg) => !arg.startsWith('--') ||
     //  _knownFlags.contains(arg.substring(2)));
 
     // Filter all unrecognized flags and options.
     var filtered = <String>[];
-    for (var i=0; i < args.length; ++i) {
+    for (var i = 0; i < args.length; ++i) {
       var arg = args[i];
       if (arg.startsWith('--') && arg.length > 2) {
         if (!_knownFlags.contains(arg.substring(2))) {
diff --git a/pkg/analyzer/lib/source/pub_package_map_provider.dart b/pkg/analyzer/lib/source/pub_package_map_provider.dart
index bb49716..c0d3431 100644
--- a/pkg/analyzer/lib/source/pub_package_map_provider.dart
+++ b/pkg/analyzer/lib/source/pub_package_map_provider.dart
@@ -48,12 +48,14 @@
     io.ProcessResult result;
     try {
       result = io.Process.runSync(
-          executable, [PUB_LIST_COMMAND], workingDirectory: folder.path);
+          executable,
+          [PUB_LIST_COMMAND],
+          workingDirectory: folder.path);
     } on io.ProcessException catch (exception, stackTrace) {
       AnalysisEngine.instance.logger.logInformation(
           "Error running pub $PUB_LIST_COMMAND\n$exception\n$stackTrace");
     }
-    if (result.exitCode != 0) {
+    if (result == null || result.exitCode != 0) {
       AnalysisEngine.instance.logger.logInformation(
           "pub $PUB_LIST_COMMAND failed: exit code ${result.exitCode}");
       return _error(folder);
@@ -131,4 +133,4 @@
     List<String> dependencies = <String>[join(folder.path, PUBSPEC_LOCK_NAME)];
     return new PackageMapInfo(null, dependencies.toSet());
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index 25bac6e..879a7d9 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -5,59 +5,44 @@
 library analyzer_impl;
 
 import 'dart:async';
+import 'dart:collection';
 import 'dart:io';
 
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/source/package_map_provider.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/source/pub_package_map_provider.dart';
+import 'package:analyzer/src/error_formatter.dart';
+import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
+import 'package:analyzer/src/generated/java_engine.dart';
+
+import '../options.dart';
 import 'generated/constant.dart';
-import 'generated/engine.dart';
 import 'generated/element.dart';
+import 'generated/engine.dart';
 import 'generated/error.dart';
 import 'generated/java_io.dart';
 import 'generated/sdk_io.dart';
 import 'generated/source_io.dart';
-import '../options.dart';
 
-import 'dart:collection';
-
-import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
-import 'package:analyzer/src/error_formatter.dart';
-import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/source/package_map_resolver.dart';
-import 'package:analyzer/source/package_map_provider.dart';
-import 'package:analyzer/source/pub_package_map_provider.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
+DirectoryBasedDartSdk sdk;
 
 /**
  * The maximum number of sources for which AST structures should be kept in the cache.
  */
 const int _MAX_CACHE_SIZE = 512;
 
-DirectoryBasedDartSdk sdk;
-
 /// Analyzes single library [File].
 class AnalyzerImpl {
-  /**
-   * Compute the severity of the error; however, if
-   * [enableTypeChecks] is false, then de-escalate checked-mode compile time
-   * errors to a severity of [ErrorSeverity.INFO].
-   */
-  static ErrorSeverity computeSeverity(
-      AnalysisError error, bool enableTypeChecks) {
-    if (!enableTypeChecks
-        && error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) {
-      return ErrorSeverity.INFO;
-    }
-    return error.errorCode.errorSeverity;
-  }
-
   final String sourcePath;
+
   final CommandLineOptions options;
   final int startTime;
-
   ContentCache contentCache = new ContentCache();
+
   SourceFactory sourceFactory;
   AnalysisContext context;
   Source librarySource;
-
   /// All [Source]s references by the analyzed library.
   final Set<Source> sources = new Set<Source>();
 
@@ -75,187 +60,6 @@
     }
   }
 
-  /**
-   * Treats the [sourcePath] as the top level library and analyzes it using a
-   * synchronous algorithm over the analysis engine. If [printMode] is `0`,
-   * then no error or performance information is printed. If [printMode] is `1`,
-   * then both will be printed. If [printMode] is `2`, then only performance
-   * information will be printed, and it will be marked as being for a cold VM.
-   */
-  ErrorSeverity analyzeSync({int printMode: 1}) {
-    setupForAnalysis();
-    return _analyzeSync(printMode);
-  }
-
-  /**
-   * Treats the [sourcePath] as the top level library and analyzes it using a
-   * asynchronous algorithm over the analysis engine.
-   */
-  void analyzeAsync() {
-    setupForAnalysis();
-    _analyzeAsync();
-  }
-
-  /**
-   * Setup local fields such as the analysis context for analysis.
-   */
-  void setupForAnalysis() {
-    sources.clear();
-    errorInfos.clear();
-    if (sourcePath == null) {
-      throw new ArgumentError("sourcePath cannot be null");
-    }
-    JavaFile sourceFile = new JavaFile(sourcePath);
-    Uri uri = getUri(sourceFile);
-    librarySource = new FileBasedSource.con2(uri, sourceFile);
-
-    // prepare context
-    prepareAnalysisContext(sourceFile, librarySource);
-  }
-
-  /**
-   * Convert [sourcePath] into an absolute path.
-   */
-  static String _normalizeSourcePath(String sourcePath) {
-    return new File(sourcePath).absolute.path;
-  }
-
-  /// The sync version of analysis.
-  ErrorSeverity _analyzeSync(int printMode) {
-    // don't try to analyze parts
-    if (context.computeKindOf(librarySource) == SourceKind.PART) {
-      print("Only libraries can be analyzed.");
-      print("$sourcePath is a part and can not be analyzed.");
-      return ErrorSeverity.ERROR;
-    }
-    // resolve library
-    var libraryElement = context.computeLibraryElement(librarySource);
-    // prepare source and errors
-    prepareSources(libraryElement);
-    prepareErrors();
-
-    // print errors and performance numbers
-    if (printMode == 1) {
-      _printErrorsAndPerf();
-    } else if (printMode == 2) {
-      _printColdPerf();
-    }
-
-    // compute max severity and set exitCode
-    ErrorSeverity status = maxErrorSeverity;
-    if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
-      status = ErrorSeverity.ERROR;
-    }
-    return status;
-  }
-
-  /// The async version of the analysis
-  void _analyzeAsync() {
-    new Future(context.performAnalysisTask).then((AnalysisResult result) {
-      List<ChangeNotice> notices = result.changeNotices;
-      if (result.hasMoreWork) {
-        // There is more work, record the set of sources, and then call self
-        // again to perform next task
-        for (ChangeNotice notice in notices) {
-          sources.add(notice.source);
-          sourceErrorsMap[notice.source] = notice;
-        }
-        return _analyzeAsync();
-      }
-      //
-      // There are not any more tasks, set error code and print performance
-      // numbers.
-      //
-      // prepare errors
-      sourceErrorsMap.forEach((k, v) {
-        errorInfos.add(sourceErrorsMap[k]);
-      });
-
-      // print errors and performance numbers
-      _printErrorsAndPerf();
-
-      // compute max severity and set exitCode
-      ErrorSeverity status = maxErrorSeverity;
-      if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
-        status = ErrorSeverity.ERROR;
-      }
-      exitCode = status.ordinal;
-    }).catchError((ex, st) {
-      AnalysisEngine.instance.logger.logError("$ex\n$st");
-    });
-  }
-
-  bool _isDesiredError(AnalysisError error) {
-    if (error.errorCode.type == ErrorType.TODO) {
-      return false;
-    }
-    if (computeSeverity(error, options.enableTypeChecks) == ErrorSeverity.INFO
-        && options.disableHints) {
-      return false;
-    }
-    return true;
-  }
-
-  _printErrorsAndPerf() {
-    // The following is a hack. We currently print out to stderr to ensure that
-    // when in batch mode we print to stderr, this is because the prints from
-    // batch are made to stderr. The reason that options.shouldBatch isn't used
-    // is because when the argument flags are constructed in BatchRunner and
-    // passed in from batch mode which removes the batch flag to prevent the
-    // "cannot have the batch flag and source file" error message.
-    IOSink sink = options.machineFormat ? stderr : stdout;
-
-    // print errors
-    ErrorFormatter formatter = new ErrorFormatter(sink, options, _isDesiredError);
-    formatter.formatErrors(errorInfos);
-
-    // print performance numbers
-    if (options.perf || options.warmPerf) {
-      int totalTime = JavaSystem.currentTimeMillis() - startTime;
-      int ioTime = PerformanceStatistics.io.result;
-      int scanTime = PerformanceStatistics.scan.result;
-      int parseTime = PerformanceStatistics.parse.result;
-      int resolveTime = PerformanceStatistics.resolve.result;
-      int errorsTime = PerformanceStatistics.errors.result;
-      int hintsTime = PerformanceStatistics.hints.result;
-      int angularTime = PerformanceStatistics.angular.result;
-      stdout.writeln("io:$ioTime");
-      stdout.writeln("scan:$scanTime");
-      stdout.writeln("parse:$parseTime");
-      stdout.writeln("resolve:$resolveTime");
-      stdout.writeln("errors:$errorsTime");
-      stdout.writeln("hints:$hintsTime");
-      stdout.writeln("angular:$angularTime");
-      stdout.writeln("other:${totalTime
-          - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
-          + angularTime)}");
-      stdout.writeln("total:$totalTime");
-    }
-  }
-
-  _printColdPerf() {
-    // print cold VM performance numbers
-    int totalTime = JavaSystem.currentTimeMillis() - startTime;
-    int ioTime = PerformanceStatistics.io.result;
-    int scanTime = PerformanceStatistics.scan.result;
-    int parseTime = PerformanceStatistics.parse.result;
-    int resolveTime = PerformanceStatistics.resolve.result;
-    int errorsTime = PerformanceStatistics.errors.result;
-    int hintsTime = PerformanceStatistics.hints.result;
-    int angularTime = PerformanceStatistics.angular.result;
-    stdout.writeln("io-cold:$ioTime");
-    stdout.writeln("scan-cold:$scanTime");
-    stdout.writeln("parse-cold:$parseTime");
-    stdout.writeln("resolve-cold:$resolveTime");
-    stdout.writeln("errors-cold:$errorsTime");
-    stdout.writeln("hints-cold:$hintsTime");
-    stdout.writeln("angular-cold:$angularTime");
-    stdout.writeln("other-cold:${totalTime
-        - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
-        + angularTime)}");
-    stdout.writeln("total-cold:$totalTime");
-  }
-
   /// Returns the maximal [ErrorSeverity] of the recorded errors.
   ErrorSeverity get maxErrorSeverity {
     var status = ErrorSeverity.NONE;
@@ -271,6 +75,67 @@
     return status;
   }
 
+  void addCompilationUnitSource(CompilationUnitElement unit,
+      Set<LibraryElement> libraries, Set<CompilationUnitElement> units) {
+    if (unit == null || units.contains(unit)) {
+      return;
+    }
+    units.add(unit);
+    sources.add(unit.source);
+  }
+
+  void addLibrarySources(LibraryElement library, Set<LibraryElement> libraries,
+      Set<CompilationUnitElement> units) {
+    if (library == null || !libraries.add(library)) {
+      return;
+    }
+    // may be skip library
+    {
+      UriKind uriKind = library.source.uriKind;
+      // Optionally skip package: libraries.
+      if (!options.showPackageWarnings && uriKind == UriKind.PACKAGE_URI) {
+        return;
+      }
+      // Optionally skip SDK libraries.
+      if (!options.showSdkWarnings && uriKind == UriKind.DART_URI) {
+        return;
+      }
+    }
+    // add compilation units
+    addCompilationUnitSource(library.definingCompilationUnit, libraries, units);
+    for (CompilationUnitElement child in library.parts) {
+      addCompilationUnitSource(child, libraries, units);
+    }
+    // add referenced libraries
+    for (LibraryElement child in library.importedLibraries) {
+      addLibrarySources(child, libraries, units);
+    }
+    for (LibraryElement child in library.exportedLibraries) {
+      addLibrarySources(child, libraries, units);
+    }
+  }
+
+  /**
+   * Treats the [sourcePath] as the top level library and analyzes it using a
+   * asynchronous algorithm over the analysis engine.
+   */
+  void analyzeAsync() {
+    setupForAnalysis();
+    _analyzeAsync();
+  }
+
+  /**
+   * Treats the [sourcePath] as the top level library and analyzes it using a
+   * synchronous algorithm over the analysis engine. If [printMode] is `0`,
+   * then no error or performance information is printed. If [printMode] is `1`,
+   * then both will be printed. If [printMode] is `2`, then only performance
+   * information will be printed, and it will be marked as being for a cold VM.
+   */
+  ErrorSeverity analyzeSync({int printMode: 1}) {
+    setupForAnalysis();
+    return _analyzeSync(printMode);
+  }
+
   void prepareAnalysisContext(JavaFile sourceFile, Source source) {
     List<UriResolver> resolvers = [
         new DartUriResolver(sdk),
@@ -319,43 +184,12 @@
     context.applyChanges(changeSet);
   }
 
-  void addCompilationUnitSource(CompilationUnitElement unit,
-      Set<LibraryElement> libraries, Set<CompilationUnitElement> units) {
-    if (unit == null || units.contains(unit)) {
-      return;
-    }
-    units.add(unit);
-    sources.add(unit.source);
-  }
-
-  void addLibrarySources(LibraryElement library, Set<LibraryElement> libraries,
-      Set<CompilationUnitElement> units) {
-    if (library == null || !libraries.add(library)) {
-      return;
-    }
-    // may be skip library
-    {
-      UriKind uriKind = library.source.uriKind;
-      // Optionally skip package: libraries.
-      if (!options.showPackageWarnings && uriKind == UriKind.PACKAGE_URI) {
-        return;
-      }
-      // Optionally skip SDK libraries.
-      if (!options.showSdkWarnings && uriKind == UriKind.DART_URI) {
-        return;
-      }
-    }
-    // add compilation units
-    addCompilationUnitSource(library.definingCompilationUnit, libraries, units);
-    for (CompilationUnitElement child in library.parts) {
-      addCompilationUnitSource(child, libraries, units);
-    }
-    // add referenced libraries
-    for (LibraryElement child in library.importedLibraries) {
-      addLibrarySources(child, libraries, units);
-    }
-    for (LibraryElement child in library.exportedLibraries) {
-      addLibrarySources(child, libraries, units);
+  /// Fills [errorInfos] using [sources].
+  void prepareErrors() {
+    for (Source source in sources) {
+      context.computeErrors(source);
+      var sourceErrors = context.getErrors(source);
+      errorInfos.add(sourceErrors);
     }
   }
 
@@ -366,13 +200,173 @@
     addLibrarySources(library, libraries, units);
   }
 
-  /// Fills [errorInfos] using [sources].
-  void prepareErrors() {
-    for (Source source in sources) {
-      context.computeErrors(source);
-      var sourceErrors = context.getErrors(source);
-      errorInfos.add(sourceErrors);
+  /**
+   * Setup local fields such as the analysis context for analysis.
+   */
+  void setupForAnalysis() {
+    sources.clear();
+    errorInfos.clear();
+    if (sourcePath == null) {
+      throw new ArgumentError("sourcePath cannot be null");
     }
+    JavaFile sourceFile = new JavaFile(sourcePath);
+    Uri uri = getUri(sourceFile);
+    librarySource = new FileBasedSource.con2(uri, sourceFile);
+
+    // prepare context
+    prepareAnalysisContext(sourceFile, librarySource);
+  }
+
+  /// The async version of the analysis
+  void _analyzeAsync() {
+    new Future(context.performAnalysisTask).then((AnalysisResult result) {
+      List<ChangeNotice> notices = result.changeNotices;
+      if (result.hasMoreWork) {
+        // There is more work, record the set of sources, and then call self
+        // again to perform next task
+        for (ChangeNotice notice in notices) {
+          sources.add(notice.source);
+          sourceErrorsMap[notice.source] = notice;
+        }
+        return _analyzeAsync();
+      }
+      //
+      // There are not any more tasks, set error code and print performance
+      // numbers.
+      //
+      // prepare errors
+      sourceErrorsMap.forEach((k, v) {
+        errorInfos.add(sourceErrorsMap[k]);
+      });
+
+      // print errors and performance numbers
+      _printErrorsAndPerf();
+
+      // compute max severity and set exitCode
+      ErrorSeverity status = maxErrorSeverity;
+      if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
+        status = ErrorSeverity.ERROR;
+      }
+      exitCode = status.ordinal;
+    }).catchError((ex, st) {
+      AnalysisEngine.instance.logger.logError("$ex\n$st");
+    });
+  }
+
+  /// The sync version of analysis.
+  ErrorSeverity _analyzeSync(int printMode) {
+    // don't try to analyze parts
+    if (context.computeKindOf(librarySource) == SourceKind.PART) {
+      print("Only libraries can be analyzed.");
+      print("$sourcePath is a part and can not be analyzed.");
+      return ErrorSeverity.ERROR;
+    }
+    // resolve library
+    var libraryElement = context.computeLibraryElement(librarySource);
+    // prepare source and errors
+    prepareSources(libraryElement);
+    prepareErrors();
+
+    // print errors and performance numbers
+    if (printMode == 1) {
+      _printErrorsAndPerf();
+    } else if (printMode == 2) {
+      _printColdPerf();
+    }
+
+    // compute max severity and set exitCode
+    ErrorSeverity status = maxErrorSeverity;
+    if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
+      status = ErrorSeverity.ERROR;
+    }
+    return status;
+  }
+
+  bool _isDesiredError(AnalysisError error) {
+    if (error.errorCode.type == ErrorType.TODO) {
+      return false;
+    }
+    if (computeSeverity(error, options.enableTypeChecks) ==
+        ErrorSeverity.INFO &&
+        options.disableHints) {
+      return false;
+    }
+    return true;
+  }
+
+  _printColdPerf() {
+    // print cold VM performance numbers
+    int totalTime = JavaSystem.currentTimeMillis() - startTime;
+    int ioTime = PerformanceStatistics.io.result;
+    int scanTime = PerformanceStatistics.scan.result;
+    int parseTime = PerformanceStatistics.parse.result;
+    int resolveTime = PerformanceStatistics.resolve.result;
+    int errorsTime = PerformanceStatistics.errors.result;
+    int hintsTime = PerformanceStatistics.hints.result;
+    int angularTime = PerformanceStatistics.angular.result;
+    stdout.writeln("io-cold:$ioTime");
+    stdout.writeln("scan-cold:$scanTime");
+    stdout.writeln("parse-cold:$parseTime");
+    stdout.writeln("resolve-cold:$resolveTime");
+    stdout.writeln("errors-cold:$errorsTime");
+    stdout.writeln("hints-cold:$hintsTime");
+    stdout.writeln("angular-cold:$angularTime");
+    stdout.writeln("other-cold:${totalTime
+        - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
+        + angularTime)}");
+    stdout.writeln("total-cold:$totalTime");
+  }
+
+  _printErrorsAndPerf() {
+    // The following is a hack. We currently print out to stderr to ensure that
+    // when in batch mode we print to stderr, this is because the prints from
+    // batch are made to stderr. The reason that options.shouldBatch isn't used
+    // is because when the argument flags are constructed in BatchRunner and
+    // passed in from batch mode which removes the batch flag to prevent the
+    // "cannot have the batch flag and source file" error message.
+    IOSink sink = options.machineFormat ? stderr : stdout;
+
+    // print errors
+    ErrorFormatter formatter =
+        new ErrorFormatter(sink, options, _isDesiredError);
+    formatter.formatErrors(errorInfos);
+
+    // print performance numbers
+    if (options.perf || options.warmPerf) {
+      int totalTime = JavaSystem.currentTimeMillis() - startTime;
+      int ioTime = PerformanceStatistics.io.result;
+      int scanTime = PerformanceStatistics.scan.result;
+      int parseTime = PerformanceStatistics.parse.result;
+      int resolveTime = PerformanceStatistics.resolve.result;
+      int errorsTime = PerformanceStatistics.errors.result;
+      int hintsTime = PerformanceStatistics.hints.result;
+      int angularTime = PerformanceStatistics.angular.result;
+      stdout.writeln("io:$ioTime");
+      stdout.writeln("scan:$scanTime");
+      stdout.writeln("parse:$parseTime");
+      stdout.writeln("resolve:$resolveTime");
+      stdout.writeln("errors:$errorsTime");
+      stdout.writeln("hints:$hintsTime");
+      stdout.writeln("angular:$angularTime");
+      stdout.writeln("other:${totalTime
+          - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
+          + angularTime)}");
+      stdout.writeln("total:$totalTime");
+    }
+  }
+
+  /**
+   * Compute the severity of the error; however, if
+   * [enableTypeChecks] is false, then de-escalate checked-mode compile time
+   * errors to a severity of [ErrorSeverity.INFO].
+   */
+  static ErrorSeverity computeSeverity(AnalysisError error,
+      bool enableTypeChecks) {
+    if (!enableTypeChecks &&
+        error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) {
+      return ErrorSeverity.INFO;
+    }
+    return error.errorCode.errorSeverity;
   }
 
   static JavaFile getPackageDirectoryFor(JavaFile sourceFile) {
@@ -408,6 +402,13 @@
     // some generic file
     return file.toURI();
   }
+
+  /**
+   * Convert [sourcePath] into an absolute path.
+   */
+  static String _normalizeSourcePath(String sourcePath) {
+    return new File(sourcePath).absolute.path;
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/error.dart b/pkg/analyzer/lib/src/error.dart
index b138e41..60f5cf0 100644
--- a/pkg/analyzer/lib/src/error.dart
+++ b/pkg/analyzer/lib/src/error.dart
@@ -6,32 +6,11 @@
 import 'dart:collection';
 
 import 'generated/error.dart';
-import 'generated/source.dart';
 
 /// The maximum line length when printing extracted source code when converting
 /// an [AnalyzerError] to a string.
 final _MAX_ERROR_LINE_LENGTH = 120;
 
-/// An error class that collects multiple [AnalyzerError]s that are emitted
-/// during a single analysis.
-class AnalyzerErrorGroup implements Exception {
-  /// The errors in this collection.
-  List<AnalyzerError> get errors =>
-    new UnmodifiableListView<AnalyzerError>(_errors);
-  final List<AnalyzerError> _errors;
-
-  AnalyzerErrorGroup(Iterable<AnalyzerError> errors)
-      : _errors = errors.toList();
-
-  /// Creates an [AnalyzerErrorGroup] from a list of lower-level
-  /// [AnalysisError]s.
-  AnalyzerErrorGroup.fromAnalysisErrors(Iterable<AnalysisError> errors)
-      : this(errors.map((e) => new AnalyzerError(e)));
-
-  String get message => toString();
-  String toString() => errors.join("\n");
-}
-
 /// A wrapper around [AnalysisError] that provides a more user-friendly string
 /// representation.
 class AnalyzerError implements Exception {
@@ -93,12 +72,22 @@
   }
 }
 
-// A content receiver that collects all the content into a string.
-class _ContentReceiver implements Source_ContentReceiver {
-  final _buffer = new StringBuffer();
+/// An error class that collects multiple [AnalyzerError]s that are emitted
+/// during a single analysis.
+class AnalyzerErrorGroup implements Exception {
+  final List<AnalyzerError> _errors;
+  AnalyzerErrorGroup(Iterable<AnalyzerError> errors)
+      : _errors = errors.toList();
 
-  String get result => _buffer.toString();
+  /// Creates an [AnalyzerErrorGroup] from a list of lower-level
+  /// [AnalysisError]s.
+  AnalyzerErrorGroup.fromAnalysisErrors(Iterable<AnalysisError> errors)
+      : this(errors.map((e) => new AnalyzerError(e)));
 
-  void accept(String contents, _) =>
-    _buffer.write(contents.substring(0, contents.length));
+  /// The errors in this collection.
+  List<AnalyzerError> get errors =>
+      new UnmodifiableListView<AnalyzerError>(_errors);
+
+  String get message => toString();
+  String toString() => errors.join("\n");
 }
diff --git a/pkg/analyzer/lib/src/error_formatter.dart b/pkg/analyzer/lib/src/error_formatter.dart
index d9e6a28..fad6112 100644
--- a/pkg/analyzer/lib/src/error_formatter.dart
+++ b/pkg/analyzer/lib/src/error_formatter.dart
@@ -4,18 +4,19 @@
 
 library error_formatter;
 
+import 'package:analyzer/src/analyzer_impl.dart';
+
+import '../options.dart';
 import 'generated/engine.dart';
 import 'generated/error.dart';
 import 'generated/source_io.dart';
-import '../options.dart';
-import 'package:analyzer/src/analyzer_impl.dart';
-
-/// Returns `true` if [AnalysisError] should be printed.
-typedef bool _ErrorFilter(AnalysisError error);
 
 /// Allows any [AnalysisError].
 bool _anyError(AnalysisError error) => true;
 
+/// Returns `true` if [AnalysisError] should be printed.
+typedef bool _ErrorFilter(AnalysisError error);
+
 /**
  * Helper for formatting [AnalysisError]s.
  * The two format options are a user consumable format and a machine consumable format.
@@ -27,6 +28,45 @@
 
   ErrorFormatter(this.out, this.options, [this.errorFilter = _anyError]);
 
+  void formatError(Map<AnalysisError, LineInfo> errorToLine,
+      AnalysisError error) {
+    Source source = error.source;
+    LineInfo_Location location = errorToLine[error].getLocation(error.offset);
+    int length = error.length;
+    ErrorSeverity severity =
+        AnalyzerImpl.computeSeverity(error, options.enableTypeChecks);
+    if (options.machineFormat) {
+      if (severity == ErrorSeverity.WARNING && options.warningsAreFatal) {
+        severity = ErrorSeverity.ERROR;
+      }
+      out.write(severity);
+      out.write('|');
+      out.write(error.errorCode.type);
+      out.write('|');
+      out.write(error.errorCode.name);
+      out.write('|');
+      out.write(escapePipe(source.fullName));
+      out.write('|');
+      out.write(location.lineNumber);
+      out.write('|');
+      out.write(location.columnNumber);
+      out.write('|');
+      out.write(length);
+      out.write('|');
+      out.write(escapePipe(error.message));
+    } else {
+      String errorType = severity.displayName;
+      if (error.errorCode.type == ErrorType.HINT) {
+        errorType = error.errorCode.type.displayName;
+      }
+      // [warning] 'foo' is not a... (/Users/.../tmp/foo.dart, line 1, col 2)
+      out.write('[$errorType] ${error.message} ');
+      out.write('(${source.fullName}');
+      out.write(', line ${location.lineNumber}, col ${location.columnNumber})');
+    }
+    out.writeln();
+  }
+
   void formatErrors(List<AnalysisErrorInfo> errorInfos) {
     var errors = new List<AnalysisError>();
     var errorToLine = new Map<AnalysisError, LineInfo>();
@@ -41,16 +81,18 @@
     // sort errors
     errors.sort((AnalysisError error1, AnalysisError error2) {
       // severity
-      ErrorSeverity severity1 = AnalyzerImpl.computeSeverity(
-          error1, options.enableTypeChecks);
-      ErrorSeverity severity2 = AnalyzerImpl.computeSeverity(
-          error2, options.enableTypeChecks);
+      ErrorSeverity severity1 =
+          AnalyzerImpl.computeSeverity(error1, options.enableTypeChecks);
+      ErrorSeverity severity2 =
+          AnalyzerImpl.computeSeverity(error2, options.enableTypeChecks);
       int compare = severity2.compareTo(severity1);
       if (compare != 0) {
         return compare;
       }
       // path
-      compare = Comparable.compare(error1.source.fullName.toLowerCase(), error2.source.fullName.toLowerCase());
+      compare = Comparable.compare(
+          error1.source.fullName.toLowerCase(),
+          error2.source.fullName.toLowerCase());
       if (compare != 0) {
         return compare;
       }
@@ -62,8 +104,8 @@
     int warnCount = 0;
     int hintCount = 0;
     for (AnalysisError error in errors) {
-      ErrorSeverity severity = AnalyzerImpl.computeSeverity(
-          error, options.enableTypeChecks);
+      ErrorSeverity severity =
+          AnalyzerImpl.computeSeverity(error, options.enableTypeChecks);
       if (severity == ErrorSeverity.ERROR) {
         errorCount++;
       } else if (severity == ErrorSeverity.WARNING) {
@@ -121,44 +163,6 @@
     }
   }
 
-  void formatError(Map<AnalysisError, LineInfo> errorToLine, AnalysisError error) {
-    Source source = error.source;
-    LineInfo_Location location = errorToLine[error].getLocation(error.offset);
-    int length = error.length;
-    ErrorSeverity severity = AnalyzerImpl.computeSeverity(
-        error, options.enableTypeChecks);
-    if (options.machineFormat) {
-      if (severity == ErrorSeverity.WARNING && options.warningsAreFatal) {
-        severity = ErrorSeverity.ERROR;
-      }
-      out.write(severity);
-      out.write('|');
-      out.write(error.errorCode.type);
-      out.write('|');
-      out.write(error.errorCode.name);
-      out.write('|');
-      out.write(escapePipe(source.fullName));
-      out.write('|');
-      out.write(location.lineNumber);
-      out.write('|');
-      out.write(location.columnNumber);
-      out.write('|');
-      out.write(length);
-      out.write('|');
-      out.write(escapePipe(error.message));
-    } else {
-      String errorType = severity.displayName;
-      if (error.errorCode.type == ErrorType.HINT) {
-        errorType = error.errorCode.type.displayName;
-      }
-      // [warning] 'foo' is not a... (/Users/.../tmp/foo.dart, line 1, col 2)
-      out.write('[$errorType] ${error.message} ');
-      out.write('(${source.fullName}');
-      out.write(', line ${location.lineNumber}, col ${location.columnNumber})');
-    }
-    out.writeln();
-  }
-
   static String escapePipe(String input) {
     var result = new StringBuffer();
     for (var c in input.codeUnits) {
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index 790a9dc..e31da9b 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -8,16 +8,17 @@
 library engine.ast;
 
 import 'dart:collection';
+
+import 'constant.dart';
+import 'element.dart';
+import 'engine.dart' show AnalysisEngine;
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'source.dart' show LineInfo, Source;
-import 'scanner.dart';
-import 'engine.dart' show AnalysisEngine;
-import 'utilities_dart.dart';
-import 'utilities_collection.dart' show TokenMap;
-import 'element.dart';
-import 'constant.dart';
 import 'parser.dart';
+import 'scanner.dart';
+import 'source.dart' show LineInfo, Source;
+import 'utilities_collection.dart' show TokenMap;
+import 'utilities_dart.dart';
 
 /**
  * Instances of the class `AdjacentStrings` represents two or more string literals that are
@@ -43,14 +44,10 @@
    * @param strings the strings that are implicitly concatenated
    */
   AdjacentStrings(List<StringLiteral> strings) {
-    this._strings = new NodeList<StringLiteral>(this);
-    this._strings.addAll(strings);
+    _strings = new NodeList<StringLiteral>(this, strings);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this);
-
-  @override
   Token get beginToken => _strings.beginToken;
 
   @override
@@ -64,9 +61,7 @@
   NodeList<StringLiteral> get strings => _strings;
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    _strings.accept(visitor);
-  }
+  accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this);
 
   @override
   void appendStringValue(StringBuffer buffer) {
@@ -74,6 +69,11 @@
       stringLiteral.appendStringValue(buffer);
     }
   }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _strings.accept(visitor);
+  }
 }
 
 /**
@@ -99,9 +99,8 @@
    * @param metadata the annotations associated with this node
    */
   AnnotatedNode(Comment comment, List<Annotation> metadata) {
-    this._metadata = new NodeList<Annotation>(this);
-    this._comment = becomeParentOf(comment);
-    this._metadata.addAll(metadata);
+    _comment = becomeParentOf(comment);
+    _metadata = new NodeList<Annotation>(this, metadata);
   }
 
   @override
@@ -109,9 +108,8 @@
     if (_comment == null) {
       if (_metadata.isEmpty) {
         return firstTokenAfterCommentAndMetadata;
-      } else {
-        return _metadata.beginToken;
       }
+      return _metadata.beginToken;
     } else if (_metadata.isEmpty) {
       return _comment.beginToken;
     }
@@ -132,6 +130,22 @@
   Comment get documentationComment => _comment;
 
   /**
+   * Set the documentation comment associated with this node to the given comment.
+   *
+   * @param comment the documentation comment to be associated with this node
+   */
+  void set documentationComment(Comment comment) {
+    _comment = becomeParentOf(comment);
+  }
+
+  /**
+   * Return the first token following the comment and metadata.
+   *
+   * @return the first token following the comment and metadata
+   */
+  Token get firstTokenAfterCommentAndMetadata;
+
+  /**
    * Return the annotations associated with this node.
    *
    * @return the annotations associated with this node
@@ -139,22 +153,27 @@
   NodeList<Annotation> get metadata => _metadata;
 
   /**
-   * Set the documentation comment associated with this node to the given comment.
-   *
-   * @param comment the documentation comment to be associated with this node
-   */
-  void set documentationComment(Comment comment) {
-    this._comment = becomeParentOf(comment);
-  }
-
-  /**
    * Set the metadata associated with this node to the given metadata.
    *
    * @param metadata the metadata to be associated with this node
    */
   void set metadata(List<Annotation> metadata) {
-    this._metadata.clear();
-    this._metadata.addAll(metadata);
+    _metadata.clear();
+    _metadata.addAll(metadata);
+  }
+
+  /**
+   * Return an array containing the comment and annotations associated with this node, sorted in
+   * lexical order.
+   *
+   * @return the comment and annotations associated with this node in the order in which they
+   *         appeared in the original source
+   */
+  List<AstNode> get sortedCommentAndAnnotations {
+    return <AstNode>[]
+        ..add(_comment)
+        ..addAll(_metadata)
+        ..sort(AstNode.LEXICAL_ORDER);
   }
 
   @override
@@ -170,13 +189,6 @@
   }
 
   /**
-   * Return the first token following the comment and metadata.
-   *
-   * @return the first token following the comment and metadata
-   */
-  Token get firstTokenAfterCommentAndMetadata;
-
-  /**
    * Return `true` if the comment is lexically before any annotations.
    *
    * @return `true` if the comment is lexically before any annotations
@@ -188,20 +200,6 @@
     Annotation firstAnnotation = _metadata[0];
     return _comment.offset < firstAnnotation.offset;
   }
-
-  /**
-   * Return an array containing the comment and annotations associated with this node, sorted in
-   * lexical order.
-   *
-   * @return the comment and annotations associated with this node in the order in which they
-   *         appeared in the original source
-   */
-  List<AstNode> get sortedCommentAndAnnotations {
-    return <AstNode>[]
-      ..add(_comment)
-      ..addAll(_metadata)
-      ..sort(AstNode.LEXICAL_ORDER);
-  }
 }
 
 /**
@@ -270,15 +268,13 @@
    * @param arguments the arguments to the constructor being invoked, or `null` if this
    *          annotation is not the invocation of a constructor
    */
-  Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constructorName, ArgumentList arguments) {
-    this._name = becomeParentOf(name);
-    this._constructorName = becomeParentOf(constructorName);
-    this._arguments = becomeParentOf(arguments);
+  Annotation(this.atSign, Identifier name, this.period,
+      SimpleIdentifier constructorName, ArgumentList arguments) {
+    _name = becomeParentOf(name);
+    _constructorName = becomeParentOf(constructorName);
+    _arguments = becomeParentOf(arguments);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitAnnotation(this);
-
   /**
    * Return the arguments to the constructor being invoked, or `null` if this annotation is
    * not the invocation of a constructor.
@@ -287,6 +283,15 @@
    */
   ArgumentList get arguments => _arguments;
 
+  /**
+   * Set the arguments to the constructor being invoked to the given arguments.
+   *
+   * @param arguments the arguments to the constructor being invoked
+   */
+  void set arguments(ArgumentList arguments) {
+    _arguments = becomeParentOf(arguments);
+  }
+
   @override
   Token get beginToken => atSign;
 
@@ -299,6 +304,15 @@
   SimpleIdentifier get constructorName => _constructorName;
 
   /**
+   * Set the name of the constructor being invoked to the given name.
+   *
+   * @param constructorName the name of the constructor being invoked
+   */
+  void set constructorName(SimpleIdentifier constructorName) {
+    _constructorName = becomeParentOf(constructorName);
+  }
+
+  /**
    * Return the element associated with this annotation, or `null` if the AST structure has
    * not been resolved or if this annotation could not be resolved.
    *
@@ -307,13 +321,21 @@
   Element get element {
     if (_element != null) {
       return _element;
-    }
-    if (_name != null) {
+    } else if (_name != null) {
       return _name.staticElement;
     }
     return null;
   }
 
+  /**
+   * Set the element associated with this annotation based.
+   *
+   * @param element the element to be associated with this identifier
+   */
+  void set element(Element element) {
+    _element = element;
+  }
+
   @override
   Token get endToken {
     if (_arguments != null) {
@@ -333,43 +355,19 @@
   Identifier get name => _name;
 
   /**
-   * Set the arguments to the constructor being invoked to the given arguments.
-   *
-   * @param arguments the arguments to the constructor being invoked
-   */
-  void set arguments(ArgumentList arguments) {
-    this._arguments = becomeParentOf(arguments);
-  }
-
-  /**
-   * Set the name of the constructor being invoked to the given name.
-   *
-   * @param constructorName the name of the constructor being invoked
-   */
-  void set constructorName(SimpleIdentifier constructorName) {
-    this._constructorName = becomeParentOf(constructorName);
-  }
-
-  /**
-   * Set the element associated with this annotation based.
-   *
-   * @param element the element to be associated with this identifier
-   */
-  void set element(Element element) {
-    this._element = element;
-  }
-
-  /**
    * Set the name of the class defining the constructor that is being invoked or the name of the
    * field that is being referenced to the given name.
    *
    * @param name the name of the constructor being invoked or the name of the field being referenced
    */
   void set name(Identifier name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitAnnotation(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_constructorName, visitor);
@@ -394,7 +392,7 @@
   /**
    * The left parenthesis.
    */
-  Token _leftParenthesis;
+  Token leftParenthesis;
 
   /**
    * The expressions producing the values of the arguments.
@@ -404,7 +402,7 @@
   /**
    * The right parenthesis.
    */
-  Token _rightParenthesis;
+  Token rightParenthesis;
 
   /**
    * An array containing the elements representing the parameters corresponding to each of the
@@ -431,16 +429,11 @@
    * @param arguments the expressions producing the values of the arguments
    * @param rightParenthesis the right parenthesis
    */
-  ArgumentList(Token leftParenthesis, List<Expression> arguments, Token rightParenthesis) {
-    this._arguments = new NodeList<Expression>(this);
-    this._leftParenthesis = leftParenthesis;
-    this._arguments.addAll(arguments);
-    this._rightParenthesis = rightParenthesis;
+  ArgumentList(this.leftParenthesis, List<Expression> arguments,
+      this.rightParenthesis) {
+    _arguments = new NodeList<Expression>(this, arguments);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitArgumentList(this);
-
   /**
    * Return the expressions producing the values of the arguments. Although the language requires
    * that positional arguments appear before named arguments, this class allows them to be
@@ -451,24 +444,7 @@
   NodeList<Expression> get arguments => _arguments;
 
   @override
-  Token get beginToken => _leftParenthesis;
-
-  @override
-  Token get endToken => _rightParenthesis;
-
-  /**
-   * Return the left parenthesis.
-   *
-   * @return the left parenthesis
-   */
-  Token get leftParenthesis => _leftParenthesis;
-
-  /**
-   * Return the right parenthesis.
-   *
-   * @return the right parenthesis
-   */
-  Token get rightParenthesis => _rightParenthesis;
+  Token get beginToken => leftParenthesis;
 
   /**
    * Set the parameter elements corresponding to each of the arguments in this list to the given
@@ -478,9 +454,11 @@
    *
    * @param parameters the parameter elements corresponding to the arguments
    */
-  void set correspondingPropagatedParameters(List<ParameterElement> parameters) {
+  void set
+      correspondingPropagatedParameters(List<ParameterElement> parameters) {
     if (parameters.length != _arguments.length) {
-      throw new IllegalArgumentException("Expected ${_arguments.length} parameters, not ${parameters.length}");
+      throw new IllegalArgumentException(
+          "Expected ${_arguments.length} parameters, not ${parameters.length}");
     }
     _correspondingPropagatedParameters = parameters;
   }
@@ -495,33 +473,17 @@
    */
   void set correspondingStaticParameters(List<ParameterElement> parameters) {
     if (parameters.length != _arguments.length) {
-      throw new IllegalArgumentException("Expected ${_arguments.length} parameters, not ${parameters.length}");
+      throw new IllegalArgumentException(
+          "Expected ${_arguments.length} parameters, not ${parameters.length}");
     }
     _correspondingStaticParameters = parameters;
   }
 
-  /**
-   * Set the left parenthesis to the given token.
-   *
-   * @param parenthesis the left parenthesis
-   */
-  void set leftParenthesis(Token parenthesis) {
-    _leftParenthesis = parenthesis;
-  }
-
-  /**
-   * Set the right parenthesis to the given token.
-   *
-   * @param parenthesis the right parenthesis
-   */
-  void set rightParenthesis(Token parenthesis) {
-    _rightParenthesis = parenthesis;
-  }
+  @override
+  Token get endToken => rightParenthesis;
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    _arguments.accept(visitor);
-  }
+  accept(AstVisitor visitor) => visitor.visitArgumentList(this);
 
   /**
    * If the given expression is a child of this list, and the AST structure has been resolved, and
@@ -538,8 +500,8 @@
    */
   ParameterElement getPropagatedParameterElementFor(Expression expression) {
     if (_correspondingPropagatedParameters == null) {
-      // Either the AST structure has not been resolved or the invocation of which this list is a
-      // part could not be resolved.
+      // Either the AST structure has not been resolved or the invocation
+      // of which this list is a part could not be resolved.
       return null;
     }
     int index = _arguments.indexOf(expression);
@@ -565,8 +527,8 @@
    */
   ParameterElement getStaticParameterElementFor(Expression expression) {
     if (_correspondingStaticParameters == null) {
-      // Either the AST structure has not been resolved or the invocation of which this list is a
-      // part could not be resolved.
+      // Either the AST structure has not been resolved or the invocation
+      // of which this list is a part could not be resolved.
       return null;
     }
     int index = _arguments.indexOf(expression);
@@ -576,6 +538,11 @@
     }
     return _correspondingStaticParameters[index];
   }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _arguments.accept(visitor);
+  }
 }
 
 /**
@@ -606,19 +573,15 @@
    * Initialize a newly created as expression.
    *
    * @param expression the expression used to compute the value being cast
-   * @param isOperator the is operator
+   * @param asOperator the as operator
    * @param type the name of the type being cast to
    */
-  AsExpression(Expression expression, Token isOperator, TypeName type) {
-    this._expression = becomeParentOf(expression);
-    this.asOperator = isOperator;
-    this._type = becomeParentOf(type);
+  AsExpression(Expression expression, this.asOperator, TypeName type) {
+    _expression = becomeParentOf(expression);
+    _type = becomeParentOf(type);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitAsExpression(this);
-
-  @override
   Token get beginToken => _expression.beginToken;
 
   @override
@@ -631,6 +594,15 @@
    */
   Expression get expression => _expression;
 
+  /**
+   * Set the expression used to compute the value being cast to the given expression.
+   *
+   * @param expression the expression used to compute the value being cast
+   */
+  void set expression(Expression expression) {
+    _expression = becomeParentOf(expression);
+  }
+
   @override
   int get precedence => 7;
 
@@ -642,24 +614,18 @@
   TypeName get type => _type;
 
   /**
-   * Set the expression used to compute the value being cast to the given expression.
-   *
-   * @param expression the expression used to compute the value being cast
-   */
-  void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
-  }
-
-  /**
    * Set the name of the type being cast to to the given name.
    *
    * @param name the name of the type being cast to
    */
   void set type(TypeName name) {
-    this._type = becomeParentOf(name);
+    _type = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitAsExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
     safelyVisitChild(_type, visitor);
@@ -709,14 +675,12 @@
    * @param rightParenthesis the right parenthesis
    * @param semicolon the semicolon terminating the statement
    */
-  AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, this.semicolon) {
-    this._condition = becomeParentOf(condition);
+  AssertStatement(this.keyword, this.leftParenthesis, Expression condition,
+      this.rightParenthesis, this.semicolon) {
+    _condition = becomeParentOf(condition);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   /**
@@ -726,19 +690,22 @@
    */
   Expression get condition => _condition;
 
-  @override
-  Token get endToken => semicolon;
-
   /**
    * Set the condition that is being asserted to be `true` to the given expression.
    *
    * @param the condition that is being asserted to be `true`
    */
   void set condition(Expression condition) {
-    this._condition = becomeParentOf(condition);
+    _condition = becomeParentOf(condition);
   }
 
   @override
+  Token get endToken => semicolon;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_condition, visitor);
   }
@@ -773,14 +740,14 @@
    * `null` if the AST structure has not been resolved, if the operator is not a compound
    * operator, or if the operator could not be resolved.
    */
-  MethodElement _staticElement;
+  MethodElement staticElement;
 
   /**
    * The element associated with the operator based on the propagated type of the left-hand-side, or
    * `null` if the AST structure has not been resolved, if the operator is not a compound
    * operator, or if the operator could not be resolved.
    */
-  MethodElement _propagatedElement;
+  MethodElement propagatedElement;
 
   /**
    * Initialize a newly created assignment expression.
@@ -789,7 +756,8 @@
    * @param operator the assignment operator being applied
    * @param rightHandSide the expression used to compute the right hand side
    */
-  AssignmentExpression(Expression leftHandSide, this.operator, Expression rightHandSide) {
+  AssignmentExpression(Expression leftHandSide, this.operator,
+      Expression rightHandSide) {
     if (leftHandSide == null || rightHandSide == null) {
       String message;
       if (leftHandSide == null) {
@@ -805,14 +773,11 @@
           message,
           new CaughtException(new AnalysisException(message), null));
     }
-    this._leftHandSide = becomeParentOf(leftHandSide);
-    this._rightHandSide = becomeParentOf(rightHandSide);
+    _leftHandSide = becomeParentOf(leftHandSide);
+    _rightHandSide = becomeParentOf(rightHandSide);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
-
-  @override
   Token get beginToken => _leftHandSide.beginToken;
 
   /**
@@ -841,36 +806,6 @@
    */
   Expression get leftHandSide => _leftHandSide;
 
-  @override
-  int get precedence => 1;
-
-  /**
-   * Return the element associated with the operator based on the propagated type of the
-   * left-hand-side, or `null` if the AST structure has not been resolved, if the operator is
-   * not a compound operator, or if the operator could not be resolved. One example of the latter
-   * case is an operator that is not defined for the type of the left-hand operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get propagatedElement => _propagatedElement;
-
-  /**
-   * Return the expression used to compute the right hand side.
-   *
-   * @return the expression used to compute the right hand side
-   */
-  Expression get rightHandSide => _rightHandSide;
-
-  /**
-   * Return the element associated with the operator based on the static type of the left-hand-side,
-   * or `null` if the AST structure has not been resolved, if the operator is not a compound
-   * operator, or if the operator could not be resolved. One example of the latter case is an
-   * operator that is not defined for the type of the left-hand operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get staticElement => _staticElement;
-
   /**
    * Return the expression used to compute the left hand side.
    *
@@ -880,40 +815,8 @@
     _leftHandSide = becomeParentOf(expression);
   }
 
-  /**
-   * Set the element associated with the operator based on the propagated type of the left-hand-side
-   * to the given element.
-   *
-   * @param element the element to be associated with the operator
-   */
-  void set propagatedElement(MethodElement element) {
-    _propagatedElement = element;
-  }
-
-  /**
-   * Set the expression used to compute the left hand side to the given expression.
-   *
-   * @param expression the expression used to compute the left hand side
-   */
-  void set rightHandSide(Expression expression) {
-    _rightHandSide = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the element associated with the operator based on the static type of the left-hand-side to
-   * the given element.
-   *
-   * @param element the static element to be associated with the operator
-   */
-  void set staticElement(MethodElement element) {
-    _staticElement = element;
-  }
-
   @override
-  void visitChildren(AstVisitor visitor) {
-    safelyVisitChild(_leftHandSide, visitor);
-    safelyVisitChild(_rightHandSide, visitor);
-  }
+  int get precedence => 1;
 
   /**
    * If the AST structure has been resolved, and the function being invoked is known based on
@@ -927,8 +830,8 @@
    */
   ParameterElement get propagatedParameterElementForRightHandSide {
     ExecutableElement executableElement = null;
-    if (_propagatedElement != null) {
-      executableElement = _propagatedElement;
+    if (propagatedElement != null) {
+      executableElement = propagatedElement;
     } else {
       if (_leftHandSide is Identifier) {
         Identifier identifier = _leftHandSide as Identifier;
@@ -938,7 +841,8 @@
         }
       }
       if (_leftHandSide is PropertyAccess) {
-        SimpleIdentifier identifier = (_leftHandSide as PropertyAccess).propertyName;
+        SimpleIdentifier identifier =
+            (_leftHandSide as PropertyAccess).propertyName;
         Element leftElement = identifier.propagatedElement;
         if (leftElement is ExecutableElement) {
           executableElement = leftElement;
@@ -956,6 +860,22 @@
   }
 
   /**
+   * Return the expression used to compute the right hand side.
+   *
+   * @return the expression used to compute the right hand side
+   */
+  Expression get rightHandSide => _rightHandSide;
+
+  /**
+   * Set the expression used to compute the left hand side to the given expression.
+   *
+   * @param expression the expression used to compute the left hand side
+   */
+  void set rightHandSide(Expression expression) {
+    _rightHandSide = becomeParentOf(expression);
+  }
+
+  /**
    * If the AST structure has been resolved, and the function being invoked is known based on static
    * type information, then return the parameter element representing the parameter to which the
    * value of the right operand will be bound. Otherwise, return `null`.
@@ -967,8 +887,8 @@
    */
   ParameterElement get staticParameterElementForRightHandSide {
     ExecutableElement executableElement = null;
-    if (_staticElement != null) {
-      executableElement = _staticElement;
+    if (staticElement != null) {
+      executableElement = staticElement;
     } else {
       if (_leftHandSide is Identifier) {
         Element leftElement = (_leftHandSide as Identifier).staticElement;
@@ -977,7 +897,8 @@
         }
       }
       if (_leftHandSide is PropertyAccess) {
-        Element leftElement = (_leftHandSide as PropertyAccess).propertyName.staticElement;
+        Element leftElement =
+            (_leftHandSide as PropertyAccess).propertyName.staticElement;
         if (leftElement is ExecutableElement) {
           executableElement = leftElement;
         }
@@ -992,6 +913,15 @@
     }
     return parameters[0];
   }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    safelyVisitChild(_leftHandSide, visitor);
+    safelyVisitChild(_rightHandSide, visitor);
+  }
 }
 
 /**
@@ -1057,12 +987,12 @@
   }
 
   @override
-  AdjacentStrings visitAdjacentStrings(AdjacentStrings node)
-      => new AdjacentStrings(cloneNodeList(node.strings));
+  AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
+      new AdjacentStrings(cloneNodeList(node.strings));
 
   @override
-  Annotation visitAnnotation(Annotation node)
-      => new Annotation(
+  Annotation visitAnnotation(Annotation node) =>
+      new Annotation(
           cloneToken(node.atSign),
           cloneNode(node.name),
           cloneToken(node.period),
@@ -1070,22 +1000,22 @@
           cloneNode(node.arguments));
 
   @override
-  ArgumentList visitArgumentList(ArgumentList node)
-      => new ArgumentList(
+  ArgumentList visitArgumentList(ArgumentList node) =>
+      new ArgumentList(
           cloneToken(node.leftParenthesis),
           cloneNodeList(node.arguments),
           cloneToken(node.rightParenthesis));
 
   @override
-  AsExpression visitAsExpression(AsExpression node)
-      => new AsExpression(
+  AsExpression visitAsExpression(AsExpression node) =>
+      new AsExpression(
           cloneNode(node.expression),
           cloneToken(node.asOperator),
           cloneNode(node.type));
 
   @override
-  AstNode visitAssertStatement(AssertStatement node)
-      => new AssertStatement(
+  AstNode visitAssertStatement(AssertStatement node) =>
+      new AssertStatement(
           cloneToken(node.keyword),
           cloneToken(node.leftParenthesis),
           cloneNode(node.condition),
@@ -1093,59 +1023,57 @@
           cloneToken(node.semicolon));
 
   @override
-  AssignmentExpression visitAssignmentExpression(AssignmentExpression node)
-      => new AssignmentExpression(
+  AssignmentExpression visitAssignmentExpression(AssignmentExpression node) =>
+      new AssignmentExpression(
           cloneNode(node.leftHandSide),
           cloneToken(node.operator),
           cloneNode(node.rightHandSide));
 
   @override
-  AwaitExpression visitAwaitExpression(AwaitExpression node)
-      => new AwaitExpression(
-          cloneToken(node.awaitKeyword),
-          cloneNode(node.expression));
+  AwaitExpression visitAwaitExpression(AwaitExpression node) =>
+      new AwaitExpression(cloneToken(node.awaitKeyword), cloneNode(node.expression));
 
   @override
-  BinaryExpression visitBinaryExpression(BinaryExpression node)
-      => new BinaryExpression(
+  BinaryExpression visitBinaryExpression(BinaryExpression node) =>
+      new BinaryExpression(
           cloneNode(node.leftOperand),
           cloneToken(node.operator),
           cloneNode(node.rightOperand));
 
   @override
-  Block visitBlock(Block node)
-      => new Block(
+  Block visitBlock(Block node) =>
+      new Block(
           cloneToken(node.leftBracket),
           cloneNodeList(node.statements),
           cloneToken(node.rightBracket));
 
   @override
-  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node)
-      => new BlockFunctionBody(
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
+      new BlockFunctionBody(
           cloneToken(node.keyword),
           cloneToken(node.star),
           cloneNode(node.block));
 
   @override
-  BooleanLiteral visitBooleanLiteral(BooleanLiteral node)
-      => new BooleanLiteral(cloneToken(node.literal), node.value);
+  BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
+      new BooleanLiteral(cloneToken(node.literal), node.value);
 
   @override
-  BreakStatement visitBreakStatement(BreakStatement node)
-      => new BreakStatement(
+  BreakStatement visitBreakStatement(BreakStatement node) =>
+      new BreakStatement(
           cloneToken(node.keyword),
           cloneNode(node.label),
           cloneToken(node.semicolon));
 
   @override
-  CascadeExpression visitCascadeExpression(CascadeExpression node)
-      => new CascadeExpression(
+  CascadeExpression visitCascadeExpression(CascadeExpression node) =>
+      new CascadeExpression(
           cloneNode(node.target),
           cloneNodeList(node.cascadeSections));
 
   @override
-  CatchClause visitCatchClause(CatchClause node)
-      => new CatchClause(
+  CatchClause visitCatchClause(CatchClause node) =>
+      new CatchClause(
           cloneToken(node.onKeyword),
           cloneNode(node.exceptionType),
           cloneToken(node.catchKeyword),
@@ -1176,8 +1104,8 @@
   }
 
   @override
-  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node)
-      => new ClassTypeAlias(
+  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) =>
+      new ClassTypeAlias(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1203,10 +1131,8 @@
   }
 
   @override
-  CommentReference visitCommentReference(CommentReference node)
-      => new CommentReference(
-          cloneToken(node.newKeyword),
-          cloneNode(node.identifier));
+  CommentReference visitCommentReference(CommentReference node) =>
+      new CommentReference(cloneToken(node.newKeyword), cloneNode(node.identifier));
 
   @override
   CompilationUnit visitCompilationUnit(CompilationUnit node) {
@@ -1221,8 +1147,9 @@
   }
 
   @override
-  ConditionalExpression visitConditionalExpression(ConditionalExpression node)
-      => new ConditionalExpression(
+  ConditionalExpression
+      visitConditionalExpression(ConditionalExpression node) =>
+      new ConditionalExpression(
           cloneNode(node.condition),
           cloneToken(node.question),
           cloneNode(node.thenExpression),
@@ -1230,8 +1157,9 @@
           cloneNode(node.elseExpression));
 
   @override
-  ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node)
-      => new ConstructorDeclaration(
+  ConstructorDeclaration
+      visitConstructorDeclaration(ConstructorDeclaration node) =>
+      new ConstructorDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.externalKeyword),
@@ -1247,8 +1175,9 @@
           cloneNode(node.body));
 
   @override
-  ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node)
-      => new ConstructorFieldInitializer(
+  ConstructorFieldInitializer
+      visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
+      new ConstructorFieldInitializer(
           cloneToken(node.keyword),
           cloneToken(node.period),
           cloneNode(node.fieldName),
@@ -1256,22 +1185,22 @@
           cloneNode(node.expression));
 
   @override
-  ConstructorName visitConstructorName(ConstructorName node)
-      => new ConstructorName(
+  ConstructorName visitConstructorName(ConstructorName node) =>
+      new ConstructorName(
           cloneNode(node.type),
           cloneToken(node.period),
           cloneNode(node.name));
 
   @override
-  ContinueStatement visitContinueStatement(ContinueStatement node)
-      => new ContinueStatement(
+  ContinueStatement visitContinueStatement(ContinueStatement node) =>
+      new ContinueStatement(
           cloneToken(node.keyword),
           cloneNode(node.label),
           cloneToken(node.semicolon));
 
   @override
-  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node)
-      => new DeclaredIdentifier(
+  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
+      new DeclaredIdentifier(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1279,16 +1208,17 @@
           cloneNode(node.identifier));
 
   @override
-  DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node)
-      => new DefaultFormalParameter(
+  DefaultFormalParameter
+      visitDefaultFormalParameter(DefaultFormalParameter node) =>
+      new DefaultFormalParameter(
           cloneNode(node.parameter),
           node.kind,
           cloneToken(node.separator),
           cloneNode(node.defaultValue));
 
   @override
-  DoStatement visitDoStatement(DoStatement node)
-      => new DoStatement(
+  DoStatement visitDoStatement(DoStatement node) =>
+      new DoStatement(
           cloneToken(node.doKeyword),
           cloneNode(node.body),
           cloneToken(node.whileKeyword),
@@ -1298,27 +1228,27 @@
           cloneToken(node.semicolon));
 
   @override
-  DoubleLiteral visitDoubleLiteral(DoubleLiteral node)
-      => new DoubleLiteral(cloneToken(node.literal), node.value);
+  DoubleLiteral visitDoubleLiteral(DoubleLiteral node) =>
+      new DoubleLiteral(cloneToken(node.literal), node.value);
 
   @override
-  EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node)
-      => new EmptyFunctionBody(cloneToken(node.semicolon));
+  EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
+      new EmptyFunctionBody(cloneToken(node.semicolon));
 
   @override
-  EmptyStatement visitEmptyStatement(EmptyStatement node)
-      => new EmptyStatement(cloneToken(node.semicolon));
+  EmptyStatement visitEmptyStatement(EmptyStatement node) =>
+      new EmptyStatement(cloneToken(node.semicolon));
 
   @override
-  AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node)
-      => new EnumConstantDeclaration(
+  AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
+      new EnumConstantDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneNode(node.name));
 
   @override
-  EnumDeclaration visitEnumDeclaration(EnumDeclaration node)
-      => new EnumDeclaration(
+  EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
+      new EnumDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1342,28 +1272,25 @@
   }
 
   @override
-  ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node)
-      => new ExpressionFunctionBody(
+  ExpressionFunctionBody
+      visitExpressionFunctionBody(ExpressionFunctionBody node) =>
+      new ExpressionFunctionBody(
           cloneToken(node.keyword),
           cloneToken(node.functionDefinition),
           cloneNode(node.expression),
           cloneToken(node.semicolon));
 
   @override
-  ExpressionStatement visitExpressionStatement(ExpressionStatement node)
-      => new ExpressionStatement(
-          cloneNode(node.expression),
-          cloneToken(node.semicolon));
+  ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
+      new ExpressionStatement(cloneNode(node.expression), cloneToken(node.semicolon));
 
   @override
-  ExtendsClause visitExtendsClause(ExtendsClause node)
-      => new ExtendsClause(
-          cloneToken(node.keyword),
-          cloneNode(node.superclass));
+  ExtendsClause visitExtendsClause(ExtendsClause node) =>
+      new ExtendsClause(cloneToken(node.keyword), cloneNode(node.superclass));
 
   @override
-  FieldDeclaration visitFieldDeclaration(FieldDeclaration node)
-      => new FieldDeclaration(
+  FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
+      new FieldDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.staticKeyword),
@@ -1371,8 +1298,8 @@
           cloneToken(node.semicolon));
 
   @override
-  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node)
-      => new FieldFormalParameter(
+  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
+      new FieldFormalParameter(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1408,8 +1335,8 @@
   }
 
   @override
-  FormalParameterList visitFormalParameterList(FormalParameterList node)
-      => new FormalParameterList(
+  FormalParameterList visitFormalParameterList(FormalParameterList node) =>
+      new FormalParameterList(
           cloneToken(node.leftParenthesis),
           cloneNodeList(node.parameters),
           cloneToken(node.leftDelimiter),
@@ -1417,8 +1344,8 @@
           cloneToken(node.rightParenthesis));
 
   @override
-  ForStatement visitForStatement(ForStatement node)
-      => new ForStatement(
+  ForStatement visitForStatement(ForStatement node) =>
+      new ForStatement(
           cloneToken(node.forKeyword),
           cloneToken(node.leftParenthesis),
           cloneNode(node.variables),
@@ -1431,8 +1358,8 @@
           cloneNode(node.body));
 
   @override
-  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node)
-      => new FunctionDeclaration(
+  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
+      new FunctionDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.externalKeyword),
@@ -1442,24 +1369,24 @@
           cloneNode(node.functionExpression));
 
   @override
-  FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node)
-      => new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
+  FunctionDeclarationStatement
+      visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
 
   @override
-  FunctionExpression visitFunctionExpression(FunctionExpression node)
-      => new FunctionExpression(
-          cloneNode(node.parameters),
-          cloneNode(node.body));
+  FunctionExpression visitFunctionExpression(FunctionExpression node) =>
+      new FunctionExpression(cloneNode(node.parameters), cloneNode(node.body));
 
   @override
-  FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node)
-      => new FunctionExpressionInvocation(
+  FunctionExpressionInvocation
+      visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
+      new FunctionExpressionInvocation(
           cloneNode(node.function),
           cloneNode(node.argumentList));
 
   @override
-  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node)
-      => new FunctionTypeAlias(
+  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
+      new FunctionTypeAlias(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1470,8 +1397,9 @@
           cloneToken(node.semicolon));
 
   @override
-  FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node)
-      => new FunctionTypedFormalParameter(
+  FunctionTypedFormalParameter
+      visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
+      new FunctionTypedFormalParameter(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneNode(node.returnType),
@@ -1479,14 +1407,12 @@
           cloneNode(node.parameters));
 
   @override
-  HideCombinator visitHideCombinator(HideCombinator node)
-      => new HideCombinator(
-          cloneToken(node.keyword),
-          cloneNodeList(node.hiddenNames));
+  HideCombinator visitHideCombinator(HideCombinator node) =>
+      new HideCombinator(cloneToken(node.keyword), cloneNodeList(node.hiddenNames));
 
   @override
-  IfStatement visitIfStatement(IfStatement node)
-      => new IfStatement(
+  IfStatement visitIfStatement(IfStatement node) =>
+      new IfStatement(
           cloneToken(node.ifKeyword),
           cloneToken(node.leftParenthesis),
           cloneNode(node.condition),
@@ -1496,10 +1422,8 @@
           cloneNode(node.elseStatement));
 
   @override
-  ImplementsClause visitImplementsClause(ImplementsClause node)
-      => new ImplementsClause(
-          cloneToken(node.keyword),
-          cloneNodeList(node.interfaces));
+  ImplementsClause visitImplementsClause(ImplementsClause node) =>
+      new ImplementsClause(cloneToken(node.keyword), cloneNodeList(node.interfaces));
 
   @override
   ImportDirective visitImportDirective(ImportDirective node) {
@@ -1537,48 +1461,48 @@
   }
 
   @override
-  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node)
-      => new InstanceCreationExpression(
+  InstanceCreationExpression
+      visitInstanceCreationExpression(InstanceCreationExpression node) =>
+      new InstanceCreationExpression(
           cloneToken(node.keyword),
           cloneNode(node.constructorName),
           cloneNode(node.argumentList));
 
   @override
-  IntegerLiteral visitIntegerLiteral(IntegerLiteral node)
-      => new IntegerLiteral(cloneToken(node.literal), node.value);
+  IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
+      new IntegerLiteral(cloneToken(node.literal), node.value);
 
   @override
-  InterpolationExpression visitInterpolationExpression(InterpolationExpression node)
-      => new InterpolationExpression(
+  InterpolationExpression
+      visitInterpolationExpression(InterpolationExpression node) =>
+      new InterpolationExpression(
           cloneToken(node.leftBracket),
           cloneNode(node.expression),
           cloneToken(node.rightBracket));
 
   @override
-  InterpolationString visitInterpolationString(InterpolationString node)
-      => new InterpolationString(cloneToken(node.contents), node.value);
+  InterpolationString visitInterpolationString(InterpolationString node) =>
+      new InterpolationString(cloneToken(node.contents), node.value);
 
   @override
-  IsExpression visitIsExpression(IsExpression node)
-      => new IsExpression(
+  IsExpression visitIsExpression(IsExpression node) =>
+      new IsExpression(
           cloneNode(node.expression),
           cloneToken(node.isOperator),
           cloneToken(node.notOperator),
           cloneNode(node.type));
 
   @override
-  Label visitLabel(Label node)
-      => new Label(cloneNode(node.label), cloneToken(node.colon));
+  Label visitLabel(Label node) =>
+      new Label(cloneNode(node.label), cloneToken(node.colon));
 
   @override
-  LabeledStatement visitLabeledStatement(LabeledStatement node)
-      => new LabeledStatement(
-          cloneNodeList(node.labels),
-          cloneNode(node.statement));
+  LabeledStatement visitLabeledStatement(LabeledStatement node) =>
+      new LabeledStatement(cloneNodeList(node.labels), cloneNode(node.statement));
 
   @override
-  LibraryDirective visitLibraryDirective(LibraryDirective node)
-      => new LibraryDirective(
+  LibraryDirective visitLibraryDirective(LibraryDirective node) =>
+      new LibraryDirective(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.libraryToken),
@@ -1586,12 +1510,12 @@
           cloneToken(node.semicolon));
 
   @override
-  LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node)
-      => new LibraryIdentifier(cloneNodeList(node.components));
+  LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
+      new LibraryIdentifier(cloneNodeList(node.components));
 
   @override
-  ListLiteral visitListLiteral(ListLiteral node)
-      => new ListLiteral(
+  ListLiteral visitListLiteral(ListLiteral node) =>
+      new ListLiteral(
           cloneToken(node.constKeyword),
           cloneNode(node.typeArguments),
           cloneToken(node.leftBracket),
@@ -1599,8 +1523,8 @@
           cloneToken(node.rightBracket));
 
   @override
-  MapLiteral visitMapLiteral(MapLiteral node)
-      => new MapLiteral(
+  MapLiteral visitMapLiteral(MapLiteral node) =>
+      new MapLiteral(
           cloneToken(node.constKeyword),
           cloneNode(node.typeArguments),
           cloneToken(node.leftBracket),
@@ -1608,15 +1532,15 @@
           cloneToken(node.rightBracket));
 
   @override
-  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node)
-      => new MapLiteralEntry(
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
+      new MapLiteralEntry(
           cloneNode(node.key),
           cloneToken(node.separator),
           cloneNode(node.value));
 
   @override
-  MethodDeclaration visitMethodDeclaration(MethodDeclaration node)
-      => new MethodDeclaration(
+  MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
+      new MethodDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.externalKeyword),
@@ -1629,35 +1553,36 @@
           cloneNode(node.body));
 
   @override
-  MethodInvocation visitMethodInvocation(MethodInvocation node)
-      => new MethodInvocation(
+  MethodInvocation visitMethodInvocation(MethodInvocation node) =>
+      new MethodInvocation(
           cloneNode(node.target),
           cloneToken(node.period),
           cloneNode(node.methodName),
           cloneNode(node.argumentList));
 
   @override
-  NamedExpression visitNamedExpression(NamedExpression node)
-      => new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
+  NamedExpression visitNamedExpression(NamedExpression node) =>
+      new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
 
   @override
-  AstNode visitNativeClause(NativeClause node)
-      => new NativeClause(cloneToken(node.keyword), cloneNode(node.name));
+  AstNode visitNativeClause(NativeClause node) =>
+      new NativeClause(cloneToken(node.keyword), cloneNode(node.name));
 
   @override
-  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node)
-      => new NativeFunctionBody(
+  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
+      new NativeFunctionBody(
           cloneToken(node.nativeToken),
           cloneNode(node.stringLiteral),
           cloneToken(node.semicolon));
 
   @override
-  NullLiteral visitNullLiteral(NullLiteral node)
-      => new NullLiteral(cloneToken(node.literal));
+  NullLiteral visitNullLiteral(NullLiteral node) =>
+      new NullLiteral(cloneToken(node.literal));
 
   @override
-  ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node)
-      => new ParenthesizedExpression(
+  ParenthesizedExpression
+      visitParenthesizedExpression(ParenthesizedExpression node) =>
+      new ParenthesizedExpression(
           cloneToken(node.leftParenthesis),
           cloneNode(node.expression),
           cloneToken(node.rightParenthesis));
@@ -1676,8 +1601,8 @@
   }
 
   @override
-  PartOfDirective visitPartOfDirective(PartOfDirective node)
-      => new PartOfDirective(
+  PartOfDirective visitPartOfDirective(PartOfDirective node) =>
+      new PartOfDirective(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.partToken),
@@ -1686,63 +1611,59 @@
           cloneToken(node.semicolon));
 
   @override
-  PostfixExpression visitPostfixExpression(PostfixExpression node)
-      => new PostfixExpression(
-          cloneNode(node.operand),
-          cloneToken(node.operator));
+  PostfixExpression visitPostfixExpression(PostfixExpression node) =>
+      new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator));
 
   @override
-  PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node)
-      => new PrefixedIdentifier(
+  PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) =>
+      new PrefixedIdentifier(
           cloneNode(node.prefix),
           cloneToken(node.period),
           cloneNode(node.identifier));
 
   @override
-  PrefixExpression visitPrefixExpression(PrefixExpression node)
-      => new PrefixExpression(
-          cloneToken(node.operator),
-          cloneNode(node.operand));
+  PrefixExpression visitPrefixExpression(PrefixExpression node) =>
+      new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand));
 
   @override
-  PropertyAccess visitPropertyAccess(PropertyAccess node)
-      => new PropertyAccess(
+  PropertyAccess visitPropertyAccess(PropertyAccess node) =>
+      new PropertyAccess(
           cloneNode(node.target),
           cloneToken(node.operator),
           cloneNode(node.propertyName));
 
   @override
-  RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
-      => new RedirectingConstructorInvocation(
+  RedirectingConstructorInvocation
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
+      new RedirectingConstructorInvocation(
           cloneToken(node.keyword),
           cloneToken(node.period),
           cloneNode(node.constructorName),
           cloneNode(node.argumentList));
 
   @override
-  RethrowExpression visitRethrowExpression(RethrowExpression node)
-      => new RethrowExpression(cloneToken(node.keyword));
+  RethrowExpression visitRethrowExpression(RethrowExpression node) =>
+      new RethrowExpression(cloneToken(node.keyword));
 
   @override
-  ReturnStatement visitReturnStatement(ReturnStatement node)
-      => new ReturnStatement(
+  ReturnStatement visitReturnStatement(ReturnStatement node) =>
+      new ReturnStatement(
           cloneToken(node.keyword),
           cloneNode(node.expression),
           cloneToken(node.semicolon));
 
   @override
-  ScriptTag visitScriptTag(ScriptTag node)
-      => new ScriptTag(cloneToken(node.scriptTag));
+  ScriptTag visitScriptTag(ScriptTag node) =>
+      new ScriptTag(cloneToken(node.scriptTag));
 
   @override
-  ShowCombinator visitShowCombinator(ShowCombinator node)
-      => new ShowCombinator(
-          cloneToken(node.keyword),
-          cloneNodeList(node.shownNames));
+  ShowCombinator visitShowCombinator(ShowCombinator node) =>
+      new ShowCombinator(cloneToken(node.keyword), cloneNodeList(node.shownNames));
 
   @override
-  SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node)
-      => new SimpleFormalParameter(
+  SimpleFormalParameter
+      visitSimpleFormalParameter(SimpleFormalParameter node) =>
+      new SimpleFormalParameter(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1750,32 +1671,33 @@
           cloneNode(node.identifier));
 
   @override
-  SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node)
-      => new SimpleIdentifier(cloneToken(node.token));
+  SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
+      new SimpleIdentifier(cloneToken(node.token));
 
   @override
-  SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node)
-      => new SimpleStringLiteral(cloneToken(node.literal), node.value);
+  SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) =>
+      new SimpleStringLiteral(cloneToken(node.literal), node.value);
 
   @override
-  StringInterpolation visitStringInterpolation(StringInterpolation node)
-      => new StringInterpolation(cloneNodeList(node.elements));
+  StringInterpolation visitStringInterpolation(StringInterpolation node) =>
+      new StringInterpolation(cloneNodeList(node.elements));
 
   @override
-  SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node)
-      => new SuperConstructorInvocation(
+  SuperConstructorInvocation
+      visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
+      new SuperConstructorInvocation(
           cloneToken(node.keyword),
           cloneToken(node.period),
           cloneNode(node.constructorName),
           cloneNode(node.argumentList));
 
   @override
-  SuperExpression visitSuperExpression(SuperExpression node)
-      => new SuperExpression(cloneToken(node.keyword));
+  SuperExpression visitSuperExpression(SuperExpression node) =>
+      new SuperExpression(cloneToken(node.keyword));
 
   @override
-  SwitchCase visitSwitchCase(SwitchCase node)
-      => new SwitchCase(
+  SwitchCase visitSwitchCase(SwitchCase node) =>
+      new SwitchCase(
           cloneNodeList(node.labels),
           cloneToken(node.keyword),
           cloneNode(node.expression),
@@ -1783,16 +1705,16 @@
           cloneNodeList(node.statements));
 
   @override
-  SwitchDefault visitSwitchDefault(SwitchDefault node)
-      => new SwitchDefault(
+  SwitchDefault visitSwitchDefault(SwitchDefault node) =>
+      new SwitchDefault(
           cloneNodeList(node.labels),
           cloneToken(node.keyword),
           cloneToken(node.colon),
           cloneNodeList(node.statements));
 
   @override
-  SwitchStatement visitSwitchStatement(SwitchStatement node)
-      => new SwitchStatement(
+  SwitchStatement visitSwitchStatement(SwitchStatement node) =>
+      new SwitchStatement(
           cloneToken(node.keyword),
           cloneToken(node.leftParenthesis),
           cloneNode(node.expression),
@@ -1802,32 +1724,29 @@
           cloneToken(node.rightBracket));
 
   @override
-  SymbolLiteral visitSymbolLiteral(SymbolLiteral node)
-      => new SymbolLiteral(
-          cloneToken(node.poundSign),
-          cloneTokenList(node.components));
+  SymbolLiteral visitSymbolLiteral(SymbolLiteral node) =>
+      new SymbolLiteral(cloneToken(node.poundSign), cloneTokenList(node.components));
 
   @override
-  ThisExpression visitThisExpression(ThisExpression node)
-      => new ThisExpression(cloneToken(node.keyword));
+  ThisExpression visitThisExpression(ThisExpression node) =>
+      new ThisExpression(cloneToken(node.keyword));
 
   @override
-  ThrowExpression visitThrowExpression(ThrowExpression node)
-      => new ThrowExpression(
-          cloneToken(node.keyword),
-          cloneNode(node.expression));
+  ThrowExpression visitThrowExpression(ThrowExpression node) =>
+      new ThrowExpression(cloneToken(node.keyword), cloneNode(node.expression));
 
   @override
-  TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node)
-      => new TopLevelVariableDeclaration(
+  TopLevelVariableDeclaration
+      visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
+      new TopLevelVariableDeclaration(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneNode(node.variables),
           cloneToken(node.semicolon));
 
   @override
-  TryStatement visitTryStatement(TryStatement node)
-      => new TryStatement(
+  TryStatement visitTryStatement(TryStatement node) =>
+      new TryStatement(
           cloneToken(node.tryKeyword),
           cloneNode(node.body),
           cloneNodeList(node.catchClauses),
@@ -1835,19 +1754,19 @@
           cloneNode(node.finallyBlock));
 
   @override
-  TypeArgumentList visitTypeArgumentList(TypeArgumentList node)
-      => new TypeArgumentList(
+  TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
+      new TypeArgumentList(
           cloneToken(node.leftBracket),
           cloneNodeList(node.arguments),
           cloneToken(node.rightBracket));
 
   @override
-  TypeName visitTypeName(TypeName node)
-      => new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
+  TypeName visitTypeName(TypeName node) =>
+      new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
 
   @override
-  TypeParameter visitTypeParameter(TypeParameter node)
-      => new TypeParameter(
+  TypeParameter visitTypeParameter(TypeParameter node) =>
+      new TypeParameter(
           cloneNode(node.documentationComment),
           cloneNodeList(node.metadata),
           cloneNode(node.name),
@@ -1855,15 +1774,15 @@
           cloneNode(node.bound));
 
   @override
-  TypeParameterList visitTypeParameterList(TypeParameterList node)
-      => new TypeParameterList(
+  TypeParameterList visitTypeParameterList(TypeParameterList node) =>
+      new TypeParameterList(
           cloneToken(node.leftBracket),
           cloneNodeList(node.typeParameters),
           cloneToken(node.rightBracket));
 
   @override
-  VariableDeclaration visitVariableDeclaration(VariableDeclaration node)
-      => new VariableDeclaration(
+  VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
+      new VariableDeclaration(
           null,
           cloneNodeList(node.metadata),
           cloneNode(node.name),
@@ -1871,8 +1790,9 @@
           cloneNode(node.initializer));
 
   @override
-  VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node)
-      => new VariableDeclarationList(
+  VariableDeclarationList
+      visitVariableDeclarationList(VariableDeclarationList node) =>
+      new VariableDeclarationList(
           null,
           cloneNodeList(node.metadata),
           cloneToken(node.keyword),
@@ -1880,14 +1800,15 @@
           cloneNodeList(node.variables));
 
   @override
-  VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node)
-      => new VariableDeclarationStatement(
+  VariableDeclarationStatement
+      visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
+      new VariableDeclarationStatement(
           cloneNode(node.variables),
           cloneToken(node.semicolon));
 
   @override
-  WhileStatement visitWhileStatement(WhileStatement node)
-      => new WhileStatement(
+  WhileStatement visitWhileStatement(WhileStatement node) =>
+      new WhileStatement(
           cloneToken(node.keyword),
           cloneToken(node.leftParenthesis),
           cloneNode(node.condition),
@@ -1895,14 +1816,12 @@
           cloneNode(node.body));
 
   @override
-  WithClause visitWithClause(WithClause node)
-      => new WithClause(
-          cloneToken(node.withKeyword),
-          cloneNodeList(node.mixinTypes));
+  WithClause visitWithClause(WithClause node) =>
+      new WithClause(cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes));
 
   @override
-  YieldStatement visitYieldStatement(YieldStatement node)
-      => new YieldStatement(
+  YieldStatement visitYieldStatement(YieldStatement node) =>
+      new YieldStatement(
           cloneToken(node.yieldKeyword),
           cloneToken(node.star),
           cloneNode(node.expression),
@@ -1915,653 +1834,1027 @@
  */
 class AstComparator implements AstVisitor<bool> {
   /**
-   * Return `true` if the [first] node and the [second] node are equal.
-   */
-  static bool equalNodes(AstNode first, AstNode second) {
-    AstComparator comparator = new AstComparator();
-    return comparator.isEqualNodes(first, second);
-  }
-
-  /**
    * The AST node with which the node being visited is to be compared. This is only valid at the
    * beginning of each visit method (until [isEqualNodes] is invoked).
    */
   AstNode _other;
 
+  /**
+   * Return `true` if the [first] node and the [second] node have the same
+   * structure.
+   *
+   * *Note:* This method is only visible for testing purposes and should not be
+   * used by clients.
+   */
+  bool isEqualNodes(AstNode first, AstNode second) {
+    if (first == null) {
+      return second == null;
+    } else if (second == null) {
+      return false;
+    } else if (first.runtimeType != second.runtimeType) {
+      return false;
+    }
+    _other = second;
+    return first.accept(this);
+  }
+
+  /**
+   * Return `true` if the [first] token and the [second] token have the same
+   * structure.
+   *
+   * *Note:* This method is only visible for testing purposes and should not be
+   * used by clients.
+   */
+  bool isEqualTokens(Token first, Token second) {
+    if (first == null) {
+      return second == null;
+    } else if (second == null) {
+      return false;
+    } else if (identical(first, second)) {
+      return true;
+    }
+    return first.offset == second.offset &&
+        first.length == second.length &&
+        first.lexeme == second.lexeme;
+  }
+
   @override
   bool visitAdjacentStrings(AdjacentStrings node) {
-    AdjacentStrings other = this._other as AdjacentStrings;
+    AdjacentStrings other = _other as AdjacentStrings;
     return _isEqualNodeLists(node.strings, other.strings);
   }
 
   @override
   bool visitAnnotation(Annotation node) {
-    Annotation other = this._other as Annotation;
-    return isEqualTokens(node.atSign, other.atSign) && isEqualNodes(node.name, other.name) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.arguments, other.arguments);
+    Annotation other = _other as Annotation;
+    return isEqualTokens(node.atSign, other.atSign) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.constructorName, other.constructorName) &&
+        isEqualNodes(node.arguments, other.arguments);
   }
 
   @override
   bool visitArgumentList(ArgumentList node) {
-    ArgumentList other = this._other as ArgumentList;
-    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
+    ArgumentList other = _other as ArgumentList;
+    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        _isEqualNodeLists(node.arguments, other.arguments) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis);
   }
 
   @override
   bool visitAsExpression(AsExpression node) {
-    AsExpression other = this._other as AsExpression;
-    return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.asOperator, other.asOperator) && isEqualNodes(node.type, other.type);
+    AsExpression other = _other as AsExpression;
+    return isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.asOperator, other.asOperator) &&
+        isEqualNodes(node.type, other.type);
   }
 
   @override
   bool visitAssertStatement(AssertStatement node) {
-    AssertStatement other = this._other as AssertStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.semicolon, other.semicolon);
+    AssertStatement other = _other as AssertStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitAssignmentExpression(AssignmentExpression node) {
-    AssignmentExpression other = this._other as AssignmentExpression;
-    return isEqualNodes(node.leftHandSide, other.leftHandSide) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.rightHandSide, other.rightHandSide);
+    AssignmentExpression other = _other as AssignmentExpression;
+    return isEqualNodes(node.leftHandSide, other.leftHandSide) &&
+        isEqualTokens(node.operator, other.operator) &&
+        isEqualNodes(node.rightHandSide, other.rightHandSide);
   }
 
   @override
   bool visitAwaitExpression(AwaitExpression node) {
-    AwaitExpression other = this._other as AwaitExpression;
-    return isEqualTokens(node.awaitKeyword, other.awaitKeyword) && isEqualNodes(node.expression, other.expression);
+    AwaitExpression other = _other as AwaitExpression;
+    return isEqualTokens(node.awaitKeyword, other.awaitKeyword) &&
+        isEqualNodes(node.expression, other.expression);
   }
 
   @override
   bool visitBinaryExpression(BinaryExpression node) {
-    BinaryExpression other = this._other as BinaryExpression;
-    return isEqualNodes(node.leftOperand, other.leftOperand) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.rightOperand, other.rightOperand);
+    BinaryExpression other = _other as BinaryExpression;
+    return isEqualNodes(node.leftOperand, other.leftOperand) &&
+        isEqualTokens(node.operator, other.operator) &&
+        isEqualNodes(node.rightOperand, other.rightOperand);
   }
 
   @override
   bool visitBlock(Block node) {
-    Block other = this._other as Block;
-    return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.statements, other.statements) && isEqualTokens(node.rightBracket, other.rightBracket);
+    Block other = _other as Block;
+    return isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.statements, other.statements) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitBlockFunctionBody(BlockFunctionBody node) {
-    BlockFunctionBody other = this._other as BlockFunctionBody;
+    BlockFunctionBody other = _other as BlockFunctionBody;
     return isEqualNodes(node.block, other.block);
   }
 
   @override
   bool visitBooleanLiteral(BooleanLiteral node) {
-    BooleanLiteral other = this._other as BooleanLiteral;
-    return isEqualTokens(node.literal, other.literal) && node.value == other.value;
+    BooleanLiteral other = _other as BooleanLiteral;
+    return isEqualTokens(node.literal, other.literal) &&
+        node.value == other.value;
   }
 
   @override
   bool visitBreakStatement(BreakStatement node) {
-    BreakStatement other = this._other as BreakStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label, other.label) && isEqualTokens(node.semicolon, other.semicolon);
+    BreakStatement other = _other as BreakStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.label, other.label) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitCascadeExpression(CascadeExpression node) {
-    CascadeExpression other = this._other as CascadeExpression;
-    return isEqualNodes(node.target, other.target) && _isEqualNodeLists(node.cascadeSections, other.cascadeSections);
+    CascadeExpression other = _other as CascadeExpression;
+    return isEqualNodes(node.target, other.target) &&
+        _isEqualNodeLists(node.cascadeSections, other.cascadeSections);
   }
 
   @override
   bool visitCatchClause(CatchClause node) {
-    CatchClause other = this._other as CatchClause;
-    return isEqualTokens(node.onKeyword, other.onKeyword) && isEqualNodes(node.exceptionType, other.exceptionType) && isEqualTokens(node.catchKeyword, other.catchKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.exceptionParameter, other.exceptionParameter) && isEqualTokens(node.comma, other.comma) && isEqualNodes(node.stackTraceParameter, other.stackTraceParameter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
+    CatchClause other = _other as CatchClause;
+    return isEqualTokens(node.onKeyword, other.onKeyword) &&
+        isEqualNodes(node.exceptionType, other.exceptionType) &&
+        isEqualTokens(node.catchKeyword, other.catchKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.exceptionParameter, other.exceptionParameter) &&
+        isEqualTokens(node.comma, other.comma) &&
+        isEqualNodes(node.stackTraceParameter, other.stackTraceParameter) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitClassDeclaration(ClassDeclaration node) {
-    ClassDeclaration other = this._other as ClassDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualTokens(node.classKeyword, other.classKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualNodes(node.extendsClause, other.extendsClause) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket);
+    ClassDeclaration other = _other as ClassDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.abstractKeyword, other.abstractKeyword) &&
+        isEqualTokens(node.classKeyword, other.classKeyword) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.typeParameters, other.typeParameters) &&
+        isEqualNodes(node.extendsClause, other.extendsClause) &&
+        isEqualNodes(node.withClause, other.withClause) &&
+        isEqualNodes(node.implementsClause, other.implementsClause) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.members, other.members) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitClassTypeAlias(ClassTypeAlias node) {
-    ClassTypeAlias other = this._other as ClassTypeAlias;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualTokens(node.equals, other.equals) && isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualNodes(node.superclass, other.superclass) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualTokens(node.semicolon, other.semicolon);
+    ClassTypeAlias other = _other as ClassTypeAlias;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.typeParameters, other.typeParameters) &&
+        isEqualTokens(node.equals, other.equals) &&
+        isEqualTokens(node.abstractKeyword, other.abstractKeyword) &&
+        isEqualNodes(node.superclass, other.superclass) &&
+        isEqualNodes(node.withClause, other.withClause) &&
+        isEqualNodes(node.implementsClause, other.implementsClause) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitComment(Comment node) {
-    Comment other = this._other as Comment;
+    Comment other = _other as Comment;
     return _isEqualNodeLists(node.references, other.references);
   }
 
   @override
   bool visitCommentReference(CommentReference node) {
-    CommentReference other = this._other as CommentReference;
-    return isEqualTokens(node.newKeyword, other.newKeyword) && isEqualNodes(node.identifier, other.identifier);
+    CommentReference other = _other as CommentReference;
+    return isEqualTokens(node.newKeyword, other.newKeyword) &&
+        isEqualNodes(node.identifier, other.identifier);
   }
 
   @override
   bool visitCompilationUnit(CompilationUnit node) {
-    CompilationUnit other = this._other as CompilationUnit;
-    return isEqualTokens(node.beginToken, other.beginToken) && isEqualNodes(node.scriptTag, other.scriptTag) && _isEqualNodeLists(node.directives, other.directives) && _isEqualNodeLists(node.declarations, other.declarations) && isEqualTokens(node.endToken, other.endToken);
+    CompilationUnit other = _other as CompilationUnit;
+    return isEqualTokens(node.beginToken, other.beginToken) &&
+        isEqualNodes(node.scriptTag, other.scriptTag) &&
+        _isEqualNodeLists(node.directives, other.directives) &&
+        _isEqualNodeLists(node.declarations, other.declarations) &&
+        isEqualTokens(node.endToken, other.endToken);
   }
 
   @override
   bool visitConditionalExpression(ConditionalExpression node) {
-    ConditionalExpression other = this._other as ConditionalExpression;
-    return isEqualNodes(node.condition, other.condition) && isEqualTokens(node.question, other.question) && isEqualNodes(node.thenExpression, other.thenExpression) && isEqualTokens(node.colon, other.colon) && isEqualNodes(node.elseExpression, other.elseExpression);
+    ConditionalExpression other = _other as ConditionalExpression;
+    return isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.question, other.question) &&
+        isEqualNodes(node.thenExpression, other.thenExpression) &&
+        isEqualTokens(node.colon, other.colon) &&
+        isEqualNodes(node.elseExpression, other.elseExpression);
   }
 
   @override
   bool visitConstructorDeclaration(ConstructorDeclaration node) {
-    ConstructorDeclaration other = this._other as ConstructorDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualTokens(node.constKeyword, other.constKeyword) && isEqualTokens(node.factoryKeyword, other.factoryKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.period, other.period) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.separator, other.separator) && _isEqualNodeLists(node.initializers, other.initializers) && isEqualNodes(node.redirectedConstructor, other.redirectedConstructor) && isEqualNodes(node.body, other.body);
+    ConstructorDeclaration other = _other as ConstructorDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.externalKeyword, other.externalKeyword) &&
+        isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualTokens(node.factoryKeyword, other.factoryKeyword) &&
+        isEqualNodes(node.returnType, other.returnType) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.parameters, other.parameters) &&
+        isEqualTokens(node.separator, other.separator) &&
+        _isEqualNodeLists(node.initializers, other.initializers) &&
+        isEqualNodes(node.redirectedConstructor, other.redirectedConstructor) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    ConstructorFieldInitializer other = this._other as ConstructorFieldInitializer;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.fieldName, other.fieldName) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.expression, other.expression);
+    ConstructorFieldInitializer other = _other as ConstructorFieldInitializer;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.fieldName, other.fieldName) &&
+        isEqualTokens(node.equals, other.equals) &&
+        isEqualNodes(node.expression, other.expression);
   }
 
   @override
   bool visitConstructorName(ConstructorName node) {
-    ConstructorName other = this._other as ConstructorName;
-    return isEqualNodes(node.type, other.type) && isEqualTokens(node.period, other.period) && isEqualNodes(node.name, other.name);
+    ConstructorName other = _other as ConstructorName;
+    return isEqualNodes(node.type, other.type) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.name, other.name);
   }
 
   @override
   bool visitContinueStatement(ContinueStatement node) {
-    ContinueStatement other = this._other as ContinueStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label, other.label) && isEqualTokens(node.semicolon, other.semicolon);
+    ContinueStatement other = _other as ContinueStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.label, other.label) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitDeclaredIdentifier(DeclaredIdentifier node) {
-    DeclaredIdentifier other = this._other as DeclaredIdentifier;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.identifier, other.identifier);
+    DeclaredIdentifier other = _other as DeclaredIdentifier;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.type, other.type) &&
+        isEqualNodes(node.identifier, other.identifier);
   }
 
   @override
   bool visitDefaultFormalParameter(DefaultFormalParameter node) {
-    DefaultFormalParameter other = this._other as DefaultFormalParameter;
-    return isEqualNodes(node.parameter, other.parameter) && node.kind == other.kind && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.defaultValue, other.defaultValue);
+    DefaultFormalParameter other = _other as DefaultFormalParameter;
+    return isEqualNodes(node.parameter, other.parameter) &&
+        node.kind == other.kind &&
+        isEqualTokens(node.separator, other.separator) &&
+        isEqualNodes(node.defaultValue, other.defaultValue);
   }
 
   @override
   bool visitDoStatement(DoStatement node) {
-    DoStatement other = this._other as DoStatement;
-    return isEqualTokens(node.doKeyword, other.doKeyword) && isEqualNodes(node.body, other.body) && isEqualTokens(node.whileKeyword, other.whileKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.semicolon, other.semicolon);
+    DoStatement other = _other as DoStatement;
+    return isEqualTokens(node.doKeyword, other.doKeyword) &&
+        isEqualNodes(node.body, other.body) &&
+        isEqualTokens(node.whileKeyword, other.whileKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitDoubleLiteral(DoubleLiteral node) {
-    DoubleLiteral other = this._other as DoubleLiteral;
-    return isEqualTokens(node.literal, other.literal) && node.value == other.value;
+    DoubleLiteral other = _other as DoubleLiteral;
+    return isEqualTokens(node.literal, other.literal) &&
+        node.value == other.value;
   }
 
   @override
   bool visitEmptyFunctionBody(EmptyFunctionBody node) {
-    EmptyFunctionBody other = this._other as EmptyFunctionBody;
+    EmptyFunctionBody other = _other as EmptyFunctionBody;
     return isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitEmptyStatement(EmptyStatement node) {
-    EmptyStatement other = this._other as EmptyStatement;
+    EmptyStatement other = _other as EmptyStatement;
     return isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitEnumConstantDeclaration(EnumConstantDeclaration node) {
-    EnumConstantDeclaration other = this._other as EnumConstantDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name);
+    EnumConstantDeclaration other = _other as EnumConstantDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualNodes(node.name, other.name);
   }
 
   @override
   bool visitEnumDeclaration(EnumDeclaration node) {
-    EnumDeclaration other = this._other as EnumDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.constants, other.constants) && isEqualTokens(node.rightBracket, other.rightBracket);
+    EnumDeclaration other = _other as EnumDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.constants, other.constants) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitExportDirective(ExportDirective node) {
-    ExportDirective other = this._other as ExportDirective;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && _isEqualNodeLists(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon);
+    ExportDirective other = _other as ExportDirective;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.uri, other.uri) &&
+        _isEqualNodeLists(node.combinators, other.combinators) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    ExpressionFunctionBody other = this._other as ExpressionFunctionBody;
-    return isEqualTokens(node.functionDefinition, other.functionDefinition) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
+    ExpressionFunctionBody other = _other as ExpressionFunctionBody;
+    return isEqualTokens(node.functionDefinition, other.functionDefinition) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitExpressionStatement(ExpressionStatement node) {
-    ExpressionStatement other = this._other as ExpressionStatement;
-    return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
+    ExpressionStatement other = _other as ExpressionStatement;
+    return isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitExtendsClause(ExtendsClause node) {
-    ExtendsClause other = this._other as ExtendsClause;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.superclass, other.superclass);
+    ExtendsClause other = _other as ExtendsClause;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.superclass, other.superclass);
   }
 
   @override
   bool visitFieldDeclaration(FieldDeclaration node) {
-    FieldDeclaration other = this._other as FieldDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.staticKeyword, other.staticKeyword) && isEqualNodes(node.fields, other.fields) && isEqualTokens(node.semicolon, other.semicolon);
+    FieldDeclaration other = _other as FieldDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.staticKeyword, other.staticKeyword) &&
+        isEqualNodes(node.fields, other.fields) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitFieldFormalParameter(FieldFormalParameter node) {
-    FieldFormalParameter other = this._other as FieldFormalParameter;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualTokens(node.thisToken, other.thisToken) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
+    FieldFormalParameter other = _other as FieldFormalParameter;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.type, other.type) &&
+        isEqualTokens(node.thisToken, other.thisToken) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.identifier, other.identifier);
   }
 
   @override
   bool visitForEachStatement(ForEachStatement node) {
-    ForEachStatement other = this._other as ForEachStatement;
-    return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.loopVariable, other.loopVariable) && isEqualTokens(node.inKeyword, other.inKeyword) && isEqualNodes(node.iterable, other.iterable) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
+    ForEachStatement other = _other as ForEachStatement;
+    return isEqualTokens(node.forKeyword, other.forKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.loopVariable, other.loopVariable) &&
+        isEqualTokens(node.inKeyword, other.inKeyword) &&
+        isEqualNodes(node.iterable, other.iterable) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitFormalParameterList(FormalParameterList node) {
-    FormalParameterList other = this._other as FormalParameterList;
-    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodeLists(node.parameters, other.parameters) && isEqualTokens(node.leftDelimiter, other.leftDelimiter) && isEqualTokens(node.rightDelimiter, other.rightDelimiter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
+    FormalParameterList other = _other as FormalParameterList;
+    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        _isEqualNodeLists(node.parameters, other.parameters) &&
+        isEqualTokens(node.leftDelimiter, other.leftDelimiter) &&
+        isEqualTokens(node.rightDelimiter, other.rightDelimiter) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis);
   }
 
   @override
   bool visitForStatement(ForStatement node) {
-    ForStatement other = this._other as ForStatement;
-    return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.variables, other.variables) && isEqualNodes(node.initialization, other.initialization) && isEqualTokens(node.leftSeparator, other.leftSeparator) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightSeparator, other.rightSeparator) && _isEqualNodeLists(node.updaters, other.updaters) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
+    ForStatement other = _other as ForStatement;
+    return isEqualTokens(node.forKeyword, other.forKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.variables, other.variables) &&
+        isEqualNodes(node.initialization, other.initialization) &&
+        isEqualTokens(node.leftSeparator, other.leftSeparator) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightSeparator, other.rightSeparator) &&
+        _isEqualNodeLists(node.updaters, other.updaters) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitFunctionDeclaration(FunctionDeclaration node) {
-    FunctionDeclaration other = this._other as FunctionDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.functionExpression, other.functionExpression);
+    FunctionDeclaration other = _other as FunctionDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.externalKeyword, other.externalKeyword) &&
+        isEqualNodes(node.returnType, other.returnType) &&
+        isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.functionExpression, other.functionExpression);
   }
 
   @override
   bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
-    FunctionDeclarationStatement other = this._other as FunctionDeclarationStatement;
+    FunctionDeclarationStatement other = _other as FunctionDeclarationStatement;
     return isEqualNodes(node.functionDeclaration, other.functionDeclaration);
   }
 
   @override
   bool visitFunctionExpression(FunctionExpression node) {
-    FunctionExpression other = this._other as FunctionExpression;
-    return isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
+    FunctionExpression other = _other as FunctionExpression;
+    return isEqualNodes(node.parameters, other.parameters) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
-    FunctionExpressionInvocation other = this._other as FunctionExpressionInvocation;
-    return isEqualNodes(node.function, other.function) && isEqualNodes(node.argumentList, other.argumentList);
+    FunctionExpressionInvocation other = _other as FunctionExpressionInvocation;
+    return isEqualNodes(node.function, other.function) &&
+        isEqualNodes(node.argumentList, other.argumentList);
   }
 
   @override
   bool visitFunctionTypeAlias(FunctionTypeAlias node) {
-    FunctionTypeAlias other = this._other as FunctionTypeAlias;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.returnType, other.returnType) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.semicolon, other.semicolon);
+    FunctionTypeAlias other = _other as FunctionTypeAlias;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.returnType, other.returnType) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.typeParameters, other.typeParameters) &&
+        isEqualNodes(node.parameters, other.parameters) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
-    FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParameter;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.returnType, other.returnType) && isEqualNodes(node.identifier, other.identifier) && isEqualNodes(node.parameters, other.parameters);
+    FunctionTypedFormalParameter other = _other as FunctionTypedFormalParameter;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualNodes(node.returnType, other.returnType) &&
+        isEqualNodes(node.identifier, other.identifier) &&
+        isEqualNodes(node.parameters, other.parameters);
   }
 
   @override
   bool visitHideCombinator(HideCombinator node) {
-    HideCombinator other = this._other as HideCombinator;
-    return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.hiddenNames, other.hiddenNames);
+    HideCombinator other = _other as HideCombinator;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        _isEqualNodeLists(node.hiddenNames, other.hiddenNames);
   }
 
   @override
   bool visitIfStatement(IfStatement node) {
-    IfStatement other = this._other as IfStatement;
-    return isEqualTokens(node.ifKeyword, other.ifKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.thenStatement, other.thenStatement) && isEqualTokens(node.elseKeyword, other.elseKeyword) && isEqualNodes(node.elseStatement, other.elseStatement);
+    IfStatement other = _other as IfStatement;
+    return isEqualTokens(node.ifKeyword, other.ifKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.thenStatement, other.thenStatement) &&
+        isEqualTokens(node.elseKeyword, other.elseKeyword) &&
+        isEqualNodes(node.elseStatement, other.elseStatement);
   }
 
   @override
   bool visitImplementsClause(ImplementsClause node) {
-    ImplementsClause other = this._other as ImplementsClause;
-    return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.interfaces, other.interfaces);
+    ImplementsClause other = _other as ImplementsClause;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        _isEqualNodeLists(node.interfaces, other.interfaces);
   }
 
   @override
   bool visitImportDirective(ImportDirective node) {
-    ImportDirective other = this._other as ImportDirective;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.asToken, other.asToken) && isEqualNodes(node.prefix, other.prefix) && _isEqualNodeLists(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon);
+    ImportDirective other = _other as ImportDirective;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.uri, other.uri) &&
+        isEqualTokens(node.asToken, other.asToken) &&
+        isEqualNodes(node.prefix, other.prefix) &&
+        _isEqualNodeLists(node.combinators, other.combinators) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitIndexExpression(IndexExpression node) {
-    IndexExpression other = this._other as IndexExpression;
-    return isEqualNodes(node.target, other.target) && isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(node.index, other.index) && isEqualTokens(node.rightBracket, other.rightBracket);
+    IndexExpression other = _other as IndexExpression;
+    return isEqualNodes(node.target, other.target) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        isEqualNodes(node.index, other.index) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitInstanceCreationExpression(InstanceCreationExpression node) {
-    InstanceCreationExpression other = this._other as InstanceCreationExpression;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
+    InstanceCreationExpression other = _other as InstanceCreationExpression;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.constructorName, other.constructorName) &&
+        isEqualNodes(node.argumentList, other.argumentList);
   }
 
   @override
   bool visitIntegerLiteral(IntegerLiteral node) {
-    IntegerLiteral other = this._other as IntegerLiteral;
-    return isEqualTokens(node.literal, other.literal) && (node.value == other.value);
+    IntegerLiteral other = _other as IntegerLiteral;
+    return isEqualTokens(node.literal, other.literal) &&
+        (node.value == other.value);
   }
 
   @override
   bool visitInterpolationExpression(InterpolationExpression node) {
-    InterpolationExpression other = this._other as InterpolationExpression;
-    return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightBracket, other.rightBracket);
+    InterpolationExpression other = _other as InterpolationExpression;
+    return isEqualTokens(node.leftBracket, other.leftBracket) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitInterpolationString(InterpolationString node) {
-    InterpolationString other = this._other as InterpolationString;
-    return isEqualTokens(node.contents, other.contents) && node.value == other.value;
+    InterpolationString other = _other as InterpolationString;
+    return isEqualTokens(node.contents, other.contents) &&
+        node.value == other.value;
   }
 
   @override
   bool visitIsExpression(IsExpression node) {
-    IsExpression other = this._other as IsExpression;
-    return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.isOperator, other.isOperator) && isEqualTokens(node.notOperator, other.notOperator) && isEqualNodes(node.type, other.type);
+    IsExpression other = _other as IsExpression;
+    return isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.isOperator, other.isOperator) &&
+        isEqualTokens(node.notOperator, other.notOperator) &&
+        isEqualNodes(node.type, other.type);
   }
 
   @override
   bool visitLabel(Label node) {
-    Label other = this._other as Label;
-    return isEqualNodes(node.label, other.label) && isEqualTokens(node.colon, other.colon);
+    Label other = _other as Label;
+    return isEqualNodes(node.label, other.label) &&
+        isEqualTokens(node.colon, other.colon);
   }
 
   @override
   bool visitLabeledStatement(LabeledStatement node) {
-    LabeledStatement other = this._other as LabeledStatement;
-    return _isEqualNodeLists(node.labels, other.labels) && isEqualNodes(node.statement, other.statement);
+    LabeledStatement other = _other as LabeledStatement;
+    return _isEqualNodeLists(node.labels, other.labels) &&
+        isEqualNodes(node.statement, other.statement);
   }
 
   @override
   bool visitLibraryDirective(LibraryDirective node) {
-    LibraryDirective other = this._other as LibraryDirective;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.libraryToken, other.libraryToken) && isEqualNodes(node.name, other.name) && isEqualTokens(node.semicolon, other.semicolon);
+    LibraryDirective other = _other as LibraryDirective;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.libraryToken, other.libraryToken) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitLibraryIdentifier(LibraryIdentifier node) {
-    LibraryIdentifier other = this._other as LibraryIdentifier;
+    LibraryIdentifier other = _other as LibraryIdentifier;
     return _isEqualNodeLists(node.components, other.components);
   }
 
   @override
   bool visitListLiteral(ListLiteral node) {
-    ListLiteral other = this._other as ListLiteral;
-    return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes(node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.elements, other.elements) && isEqualTokens(node.rightBracket, other.rightBracket);
+    ListLiteral other = _other as ListLiteral;
+    return isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualNodes(node.typeArguments, other.typeArguments) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.elements, other.elements) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitMapLiteral(MapLiteral node) {
-    MapLiteral other = this._other as MapLiteral;
-    return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes(node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.entries, other.entries) && isEqualTokens(node.rightBracket, other.rightBracket);
+    MapLiteral other = _other as MapLiteral;
+    return isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualNodes(node.typeArguments, other.typeArguments) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.entries, other.entries) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitMapLiteralEntry(MapLiteralEntry node) {
-    MapLiteralEntry other = this._other as MapLiteralEntry;
-    return isEqualNodes(node.key, other.key) && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.value, other.value);
+    MapLiteralEntry other = _other as MapLiteralEntry;
+    return isEqualNodes(node.key, other.key) &&
+        isEqualTokens(node.separator, other.separator) &&
+        isEqualNodes(node.value, other.value);
   }
 
   @override
   bool visitMethodDeclaration(MethodDeclaration node) {
-    MethodDeclaration other = this._other as MethodDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualTokens(node.modifierKeyword, other.modifierKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
+    MethodDeclaration other = _other as MethodDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.externalKeyword, other.externalKeyword) &&
+        isEqualTokens(node.modifierKeyword, other.modifierKeyword) &&
+        isEqualNodes(node.returnType, other.returnType) &&
+        isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
+        isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.parameters, other.parameters) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitMethodInvocation(MethodInvocation node) {
-    MethodInvocation other = this._other as MethodInvocation;
-    return isEqualNodes(node.target, other.target) && isEqualTokens(node.period, other.period) && isEqualNodes(node.methodName, other.methodName) && isEqualNodes(node.argumentList, other.argumentList);
+    MethodInvocation other = _other as MethodInvocation;
+    return isEqualNodes(node.target, other.target) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.methodName, other.methodName) &&
+        isEqualNodes(node.argumentList, other.argumentList);
   }
 
   @override
   bool visitNamedExpression(NamedExpression node) {
-    NamedExpression other = this._other as NamedExpression;
-    return isEqualNodes(node.name, other.name) && isEqualNodes(node.expression, other.expression);
+    NamedExpression other = _other as NamedExpression;
+    return isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.expression, other.expression);
   }
 
   @override
   bool visitNativeClause(NativeClause node) {
-    NativeClause other = this._other as NativeClause;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name);
+    NativeClause other = _other as NativeClause;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.name, other.name);
   }
 
   @override
   bool visitNativeFunctionBody(NativeFunctionBody node) {
-    NativeFunctionBody other = this._other as NativeFunctionBody;
-    return isEqualTokens(node.nativeToken, other.nativeToken) && isEqualNodes(node.stringLiteral, other.stringLiteral) && isEqualTokens(node.semicolon, other.semicolon);
+    NativeFunctionBody other = _other as NativeFunctionBody;
+    return isEqualTokens(node.nativeToken, other.nativeToken) &&
+        isEqualNodes(node.stringLiteral, other.stringLiteral) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitNullLiteral(NullLiteral node) {
-    NullLiteral other = this._other as NullLiteral;
+    NullLiteral other = _other as NullLiteral;
     return isEqualTokens(node.literal, other.literal);
   }
 
   @override
   bool visitParenthesizedExpression(ParenthesizedExpression node) {
-    ParenthesizedExpression other = this._other as ParenthesizedExpression;
-    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
+    ParenthesizedExpression other = _other as ParenthesizedExpression;
+    return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis);
   }
 
   @override
   bool visitPartDirective(PartDirective node) {
-    PartDirective other = this._other as PartDirective;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToken, other.partToken) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.semicolon, other.semicolon);
+    PartDirective other = _other as PartDirective;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.partToken, other.partToken) &&
+        isEqualNodes(node.uri, other.uri) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitPartOfDirective(PartOfDirective node) {
-    PartOfDirective other = this._other as PartOfDirective;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToken, other.partToken) && isEqualTokens(node.ofToken, other.ofToken) && isEqualNodes(node.libraryName, other.libraryName) && isEqualTokens(node.semicolon, other.semicolon);
+    PartOfDirective other = _other as PartOfDirective;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.partToken, other.partToken) &&
+        isEqualTokens(node.ofToken, other.ofToken) &&
+        isEqualNodes(node.libraryName, other.libraryName) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitPostfixExpression(PostfixExpression node) {
-    PostfixExpression other = this._other as PostfixExpression;
-    return isEqualNodes(node.operand, other.operand) && isEqualTokens(node.operator, other.operator);
+    PostfixExpression other = _other as PostfixExpression;
+    return isEqualNodes(node.operand, other.operand) &&
+        isEqualTokens(node.operator, other.operator);
   }
 
   @override
   bool visitPrefixedIdentifier(PrefixedIdentifier node) {
-    PrefixedIdentifier other = this._other as PrefixedIdentifier;
-    return isEqualNodes(node.prefix, other.prefix) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
+    PrefixedIdentifier other = _other as PrefixedIdentifier;
+    return isEqualNodes(node.prefix, other.prefix) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.identifier, other.identifier);
   }
 
   @override
   bool visitPrefixExpression(PrefixExpression node) {
-    PrefixExpression other = this._other as PrefixExpression;
-    return isEqualTokens(node.operator, other.operator) && isEqualNodes(node.operand, other.operand);
+    PrefixExpression other = _other as PrefixExpression;
+    return isEqualTokens(node.operator, other.operator) &&
+        isEqualNodes(node.operand, other.operand);
   }
 
   @override
   bool visitPropertyAccess(PropertyAccess node) {
-    PropertyAccess other = this._other as PropertyAccess;
-    return isEqualNodes(node.target, other.target) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.propertyName, other.propertyName);
+    PropertyAccess other = _other as PropertyAccess;
+    return isEqualNodes(node.target, other.target) &&
+        isEqualTokens(node.operator, other.operator) &&
+        isEqualNodes(node.propertyName, other.propertyName);
   }
 
   @override
-  bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    RedirectingConstructorInvocation other = this._other as RedirectingConstructorInvocation;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
+  bool
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    RedirectingConstructorInvocation other =
+        _other as RedirectingConstructorInvocation;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.constructorName, other.constructorName) &&
+        isEqualNodes(node.argumentList, other.argumentList);
   }
 
   @override
   bool visitRethrowExpression(RethrowExpression node) {
-    RethrowExpression other = this._other as RethrowExpression;
+    RethrowExpression other = _other as RethrowExpression;
     return isEqualTokens(node.keyword, other.keyword);
   }
 
   @override
   bool visitReturnStatement(ReturnStatement node) {
-    ReturnStatement other = this._other as ReturnStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
+    ReturnStatement other = _other as ReturnStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitScriptTag(ScriptTag node) {
-    ScriptTag other = this._other as ScriptTag;
+    ScriptTag other = _other as ScriptTag;
     return isEqualTokens(node.scriptTag, other.scriptTag);
   }
 
   @override
   bool visitShowCombinator(ShowCombinator node) {
-    ShowCombinator other = this._other as ShowCombinator;
-    return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.shownNames, other.shownNames);
+    ShowCombinator other = _other as ShowCombinator;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        _isEqualNodeLists(node.shownNames, other.shownNames);
   }
 
   @override
   bool visitSimpleFormalParameter(SimpleFormalParameter node) {
-    SimpleFormalParameter other = this._other as SimpleFormalParameter;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.identifier, other.identifier);
+    SimpleFormalParameter other = _other as SimpleFormalParameter;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.type, other.type) &&
+        isEqualNodes(node.identifier, other.identifier);
   }
 
   @override
   bool visitSimpleIdentifier(SimpleIdentifier node) {
-    SimpleIdentifier other = this._other as SimpleIdentifier;
+    SimpleIdentifier other = _other as SimpleIdentifier;
     return isEqualTokens(node.token, other.token);
   }
 
   @override
   bool visitSimpleStringLiteral(SimpleStringLiteral node) {
-    SimpleStringLiteral other = this._other as SimpleStringLiteral;
-    return isEqualTokens(node.literal, other.literal) && (node.value == other.value);
+    SimpleStringLiteral other = _other as SimpleStringLiteral;
+    return isEqualTokens(node.literal, other.literal) &&
+        (node.value == other.value);
   }
 
   @override
   bool visitStringInterpolation(StringInterpolation node) {
-    StringInterpolation other = this._other as StringInterpolation;
+    StringInterpolation other = _other as StringInterpolation;
     return _isEqualNodeLists(node.elements, other.elements);
   }
 
   @override
   bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    SuperConstructorInvocation other = this._other as SuperConstructorInvocation;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
+    SuperConstructorInvocation other = _other as SuperConstructorInvocation;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.period, other.period) &&
+        isEqualNodes(node.constructorName, other.constructorName) &&
+        isEqualNodes(node.argumentList, other.argumentList);
   }
 
   @override
   bool visitSuperExpression(SuperExpression node) {
-    SuperExpression other = this._other as SuperExpression;
+    SuperExpression other = _other as SuperExpression;
     return isEqualTokens(node.keyword, other.keyword);
   }
 
   @override
   bool visitSwitchCase(SwitchCase node) {
-    SwitchCase other = this._other as SwitchCase;
-    return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.statements);
+    SwitchCase other = _other as SwitchCase;
+    return _isEqualNodeLists(node.labels, other.labels) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.colon, other.colon) &&
+        _isEqualNodeLists(node.statements, other.statements);
   }
 
   @override
   bool visitSwitchDefault(SwitchDefault node) {
-    SwitchDefault other = this._other as SwitchDefault;
-    return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.statements);
+    SwitchDefault other = _other as SwitchDefault;
+    return _isEqualNodeLists(node.labels, other.labels) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.colon, other.colon) &&
+        _isEqualNodeLists(node.statements, other.statements);
   }
 
   @override
   bool visitSwitchStatement(SwitchStatement node) {
-    SwitchStatement other = this._other as SwitchStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket);
+    SwitchStatement other = _other as SwitchStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.members, other.members) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitSymbolLiteral(SymbolLiteral node) {
-    SymbolLiteral other = this._other as SymbolLiteral;
-    return isEqualTokens(node.poundSign, other.poundSign) && _isEqualTokenLists(node.components, other.components);
+    SymbolLiteral other = _other as SymbolLiteral;
+    return isEqualTokens(node.poundSign, other.poundSign) &&
+        _isEqualTokenLists(node.components, other.components);
   }
 
   @override
   bool visitThisExpression(ThisExpression node) {
-    ThisExpression other = this._other as ThisExpression;
+    ThisExpression other = _other as ThisExpression;
     return isEqualTokens(node.keyword, other.keyword);
   }
 
   @override
   bool visitThrowExpression(ThrowExpression node) {
-    ThrowExpression other = this._other as ThrowExpression;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression);
+    ThrowExpression other = _other as ThrowExpression;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.expression, other.expression);
   }
 
   @override
   bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
-    TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.variables, other.variables) && isEqualTokens(node.semicolon, other.semicolon);
+    TopLevelVariableDeclaration other = _other as TopLevelVariableDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualNodes(node.variables, other.variables) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitTryStatement(TryStatement node) {
-    TryStatement other = this._other as TryStatement;
-    return isEqualTokens(node.tryKeyword, other.tryKeyword) && isEqualNodes(node.body, other.body) && _isEqualNodeLists(node.catchClauses, other.catchClauses) && isEqualTokens(node.finallyKeyword, other.finallyKeyword) && isEqualNodes(node.finallyBlock, other.finallyBlock);
+    TryStatement other = _other as TryStatement;
+    return isEqualTokens(node.tryKeyword, other.tryKeyword) &&
+        isEqualNodes(node.body, other.body) &&
+        _isEqualNodeLists(node.catchClauses, other.catchClauses) &&
+        isEqualTokens(node.finallyKeyword, other.finallyKeyword) &&
+        isEqualNodes(node.finallyBlock, other.finallyBlock);
   }
 
   @override
   bool visitTypeArgumentList(TypeArgumentList node) {
-    TypeArgumentList other = this._other as TypeArgumentList;
-    return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightBracket, other.rightBracket);
+    TypeArgumentList other = _other as TypeArgumentList;
+    return isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.arguments, other.arguments) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitTypeName(TypeName node) {
-    TypeName other = this._other as TypeName;
-    return isEqualNodes(node.name, other.name) && isEqualNodes(node.typeArguments, other.typeArguments);
+    TypeName other = _other as TypeName;
+    return isEqualNodes(node.name, other.name) &&
+        isEqualNodes(node.typeArguments, other.typeArguments);
   }
 
   @override
   bool visitTypeParameter(TypeParameter node) {
-    TypeParameter other = this._other as TypeParameter;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.bound, other.bound);
+    TypeParameter other = _other as TypeParameter;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.bound, other.bound);
   }
 
   @override
   bool visitTypeParameterList(TypeParameterList node) {
-    TypeParameterList other = this._other as TypeParameterList;
-    return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.typeParameters, other.typeParameters) && isEqualTokens(node.rightBracket, other.rightBracket);
+    TypeParameterList other = _other as TypeParameterList;
+    return isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.typeParameters, other.typeParameters) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
   }
 
   @override
   bool visitVariableDeclaration(VariableDeclaration node) {
-    VariableDeclaration other = this._other as VariableDeclaration;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.initializer, other.initializer);
+    VariableDeclaration other = _other as VariableDeclaration;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualNodes(node.name, other.name) &&
+        isEqualTokens(node.equals, other.equals) &&
+        isEqualNodes(node.initializer, other.initializer);
   }
 
   @override
   bool visitVariableDeclarationList(VariableDeclarationList node) {
-    VariableDeclarationList other = this._other as VariableDeclarationList;
-    return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && _isEqualNodeLists(node.variables, other.variables);
+    VariableDeclarationList other = _other as VariableDeclarationList;
+    return isEqualNodes(
+        node.documentationComment,
+        other.documentationComment) &&
+        _isEqualNodeLists(node.metadata, other.metadata) &&
+        isEqualTokens(node.keyword, other.keyword) &&
+        isEqualNodes(node.type, other.type) &&
+        _isEqualNodeLists(node.variables, other.variables);
   }
 
   @override
   bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
-    VariableDeclarationStatement other = this._other as VariableDeclarationStatement;
-    return isEqualNodes(node.variables, other.variables) && isEqualTokens(node.semicolon, other.semicolon);
+    VariableDeclarationStatement other = _other as VariableDeclarationStatement;
+    return isEqualNodes(node.variables, other.variables) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   @override
   bool visitWhileStatement(WhileStatement node) {
-    WhileStatement other = this._other as WhileStatement;
-    return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
+    WhileStatement other = _other as WhileStatement;
+    return isEqualTokens(node.keyword, other.keyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
   }
 
   @override
   bool visitWithClause(WithClause node) {
-    WithClause other = this._other as WithClause;
-    return isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLists(node.mixinTypes, other.mixinTypes);
+    WithClause other = _other as WithClause;
+    return isEqualTokens(node.withKeyword, other.withKeyword) &&
+        _isEqualNodeLists(node.mixinTypes, other.mixinTypes);
   }
 
   @override
   bool visitYieldStatement(YieldStatement node) {
-    YieldStatement other = this._other as YieldStatement;
-    return isEqualTokens(node.yieldKeyword, other.yieldKeyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
+    YieldStatement other = _other as YieldStatement;
+    return isEqualTokens(node.yieldKeyword, other.yieldKeyword) &&
+        isEqualNodes(node.expression, other.expression) &&
+        isEqualTokens(node.semicolon, other.semicolon);
   }
 
   /**
@@ -2592,25 +2885,6 @@
   }
 
   /**
-   * Return `true` if the [first] node and the [second] node have the same
-   * structure.
-   *
-   * *Note:* This method is only visible for testing purposes and should not be
-   * used by clients.
-   */
-  bool isEqualNodes(AstNode first, AstNode second) {
-    if (first == null) {
-      return second == null;
-    } else if (second == null) {
-      return false;
-    } else if (first.runtimeType != second.runtimeType) {
-      return false;
-    }
-    _other = second;
-    return first.accept(this);
-  }
-
-  /**
    * Return `true` if the given arrays of tokens have the same length and corresponding
    * elements are equal.
    *
@@ -2633,23 +2907,11 @@
   }
 
   /**
-   * Return `true` if the [first] token and the [second] token have the same
-   * structure.
-   *
-   * *Note:* This method is only visible for testing purposes and should not be
-   * used by clients.
+   * Return `true` if the [first] node and the [second] node are equal.
    */
-  bool isEqualTokens(Token first, Token second) {
-    if (first == null) {
-      return second == null;
-    } else if (second == null) {
-      return false;
-    } else if (identical(first, second)) {
-      return true;
-    }
-    return first.offset == second.offset
-        && first.length == second.length
-        && first.lexeme == second.lexeme;
+  static bool equalNodes(AstNode first, AstNode second) {
+    AstComparator comparator = new AstComparator();
+    return comparator.isEqualNodes(first, second);
   }
 }
 
@@ -2661,7 +2923,16 @@
   /**
    * An empty array of ast nodes.
    */
-  static List<AstNode> EMPTY_ARRAY = new List<AstNode>(0);
+  static const List<AstNode> EMPTY_ARRAY = const <AstNode>[];
+
+  /**
+   * A comparator that can be used to sort AST nodes in lexical order. In other words,
+   * `compare` will return a negative value if the offset of the first node is less than the
+   * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
+   * if the offset of the first node is greater than the offset of the second node.
+   */
+  static Comparator<AstNode> LEXICAL_ORDER =
+      (AstNode first, AstNode second) => second.offset - first.offset;
 
   /**
    * The parent of the node, or `null` if the node is the root of an AST structure.
@@ -2675,37 +2946,6 @@
   Map<String, Object> _propertyMap;
 
   /**
-   * A comparator that can be used to sort AST nodes in lexical order. In other words,
-   * `compare` will return a negative value if the offset of the first node is less than the
-   * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
-   * if the offset of the first node is greater than the offset of the second node.
-   */
-  static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => second.offset - first.offset;
-
-  /**
-   * Use the given visitor to visit this node.
-   *
-   * @param visitor the visitor that will visit this node
-   * @return the value returned by the visitor as a result of visiting this node
-   */
-  accept(AstVisitor visitor);
-
-  /**
-   * Return the node of the given class that most immediately encloses this node, or `null` if
-   * there is no enclosing node of the given class.
-   *
-   * @param nodeClass the class of the node to be returned
-   * @return the node of the given type that encloses this node
-   */
-  AstNode getAncestor(Predicate<AstNode> predicate) {
-    AstNode node = this;
-    while (node != null && !predicate(node)) {
-      node = node.parent;
-    }
-    return node;
-  }
-
-  /**
    * Return the first token included in this node's source range.
    *
    * @return the first token included in this node's source range
@@ -2730,6 +2970,15 @@
   Token get endToken;
 
   /**
+   * Return `true` if this node is a synthetic node. A synthetic node is a node that was
+   * introduced by the parser in order to recover from an error in the code. Synthetic nodes always
+   * have a length of zero (`0`).
+   *
+   * @return `true` if this node is a synthetic node
+   */
+  bool get isSynthetic => false;
+
+  /**
    * Return the number of characters in the node's source range.
    *
    * @return the number of characters in the node's source range
@@ -2769,16 +3018,13 @@
   AstNode get parent => _parent;
 
   /**
-   * Return the value of the property with the given name, or `null` if this node does not
-   * have a property with the given name.
+   * Set the parent of this node to the given node.
    *
-   * @return the value of the property with the given name
+   * @param newParent the node that is to be made the parent of this node
    */
-  Object getProperty(String propertyName) {
-    if (_propertyMap == null) {
-      return null;
-    }
-    return _propertyMap[propertyName];
+  @deprecated
+  void set parent(AstNode newParent) {
+    _parent = newParent;
   }
 
   /**
@@ -2798,13 +3044,65 @@
   }
 
   /**
-   * Return `true` if this node is a synthetic node. A synthetic node is a node that was
-   * introduced by the parser in order to recover from an error in the code. Synthetic nodes always
-   * have a length of zero (`0`).
+   * Use the given visitor to visit this node.
    *
-   * @return `true` if this node is a synthetic node
+   * @param visitor the visitor that will visit this node
+   * @return the value returned by the visitor as a result of visiting this node
    */
-  bool get isSynthetic => false;
+  accept(AstVisitor visitor);
+
+  /**
+   * Make this node the parent of the given child node.
+   *
+   * @param child the node that will become a child of this node
+   * @return the node that was made a child of this node
+   */
+  AstNode becomeParentOf(AstNode child) {
+    if (child != null) {
+      child._parent = this;
+    }
+    return child;
+  }
+
+  /**
+   * Return the node of the given class that most immediately encloses this node, or `null` if
+   * there is no enclosing node of the given class.
+   *
+   * @param nodeClass the class of the node to be returned
+   * @return the node of the given type that encloses this node
+   */
+  AstNode getAncestor(Predicate<AstNode> predicate) {
+    AstNode node = this;
+    while (node != null && !predicate(node)) {
+      node = node.parent;
+    }
+    return node;
+  }
+
+  /**
+   * Return the value of the property with the given name, or `null` if this node does not
+   * have a property with the given name.
+   *
+   * @return the value of the property with the given name
+   */
+  Object getProperty(String propertyName) {
+    if (_propertyMap == null) {
+      return null;
+    }
+    return _propertyMap[propertyName];
+  }
+
+  /**
+   * If the given child is not `null`, use the given visitor to visit it.
+   *
+   * @param child the child to be visited
+   * @param visitor the visitor that will be used to visit the child
+   */
+  void safelyVisitChild(AstNode child, AstVisitor visitor) {
+    if (child != null) {
+      child.accept(visitor);
+    }
+  }
 
   /**
    * Set the value of the property with the given name to the given value. If the value is
@@ -2851,41 +3149,6 @@
    * @param visitor the visitor that will be used to visit the children of this node
    */
   void visitChildren(AstVisitor visitor);
-
-  /**
-   * Make this node the parent of the given child node.
-   *
-   * @param child the node that will become a child of this node
-   * @return the node that was made a child of this node
-   */
-  AstNode becomeParentOf(AstNode child) {
-    if (child != null) {
-      AstNode node = child;
-      node.parent = this;
-    }
-    return child;
-  }
-
-  /**
-   * If the given child is not `null`, use the given visitor to visit it.
-   *
-   * @param child the child to be visited
-   * @param visitor the visitor that will be used to visit the child
-   */
-  void safelyVisitChild(AstNode child, AstVisitor visitor) {
-    if (child != null) {
-      child.accept(visitor);
-    }
-  }
-
-  /**
-   * Set the parent of this node to the given node.
-   *
-   * @param newParent the node that is to be made the parent of this node
-   */
-  void set parent(AstNode newParent) {
-    _parent = newParent;
-  }
 }
 
 /**
@@ -3047,7 +3310,8 @@
 
   R visitPropertyAccess(PropertyAccess node);
 
-  R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node);
+  R
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node);
 
   R visitRethrowExpression(RethrowExpression node);
 
@@ -3127,13 +3391,10 @@
    * @param expression the expression whose value is being waited on
    */
   AwaitExpression(this.awaitKeyword, Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
-
-  @override
   Token get beginToken {
     if (awaitKeyword != null) {
       return awaitKeyword;
@@ -3151,19 +3412,22 @@
    */
   Expression get expression => _expression;
 
-  @override
-  int get precedence => 0;
-
   /**
    * Set the expression whose value is being waited on to the given expression.
    *
    * @param expression the expression whose value is being waited on
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  int get precedence => 0;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
@@ -3198,14 +3462,14 @@
    * `null` if the AST structure has not been resolved, if the operator is not user definable,
    * or if the operator could not be resolved.
    */
-  MethodElement _staticElement;
+  MethodElement staticElement;
 
   /**
    * The element associated with the operator based on the propagated type of the left operand, or
    * `null` if the AST structure has not been resolved, if the operator is not user definable,
    * or if the operator could not be resolved.
    */
-  MethodElement _propagatedElement;
+  MethodElement propagatedElement;
 
   /**
    * Initialize a newly created binary expression.
@@ -3214,15 +3478,13 @@
    * @param operator the binary operator being applied
    * @param rightOperand the expression used to compute the right operand
    */
-  BinaryExpression(Expression leftOperand, this.operator, Expression rightOperand) {
-    this._leftOperand = becomeParentOf(leftOperand);
-    this._rightOperand = becomeParentOf(rightOperand);
+  BinaryExpression(Expression leftOperand, this.operator,
+      Expression rightOperand) {
+    _leftOperand = becomeParentOf(leftOperand);
+    _rightOperand = becomeParentOf(rightOperand);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitBinaryExpression(this);
-
-  @override
   Token get beginToken => _leftOperand.beginToken;
 
   /**
@@ -3251,36 +3513,6 @@
    */
   Expression get leftOperand => _leftOperand;
 
-  @override
-  int get precedence => operator.type.precedence;
-
-  /**
-   * Return the element associated with the operator based on the propagated type of the left
-   * operand, or `null` if the AST structure has not been resolved, if the operator is not
-   * user definable, or if the operator could not be resolved. One example of the latter case is an
-   * operator that is not defined for the type of the left-hand operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get propagatedElement => _propagatedElement;
-
-  /**
-   * Return the expression used to compute the right operand.
-   *
-   * @return the expression used to compute the right operand
-   */
-  Expression get rightOperand => _rightOperand;
-
-  /**
-   * Return the element associated with the operator based on the static type of the left operand,
-   * or `null` if the AST structure has not been resolved, if the operator is not user
-   * definable, or if the operator could not be resolved. One example of the latter case is an
-   * operator that is not defined for the type of the left operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get staticElement => _staticElement;
-
   /**
    * Set the expression used to compute the left operand to the given expression.
    *
@@ -3290,40 +3522,8 @@
     _leftOperand = becomeParentOf(expression);
   }
 
-  /**
-   * Set the element associated with the operator based on the propagated type of the left operand
-   * to the given element.
-   *
-   * @param element the element to be associated with the operator
-   */
-  void set propagatedElement(MethodElement element) {
-    _propagatedElement = element;
-  }
-
-  /**
-   * Set the expression used to compute the right operand to the given expression.
-   *
-   * @param expression the expression used to compute the right operand
-   */
-  void set rightOperand(Expression expression) {
-    _rightOperand = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the element associated with the operator based on the static type of the left operand to
-   * the given element.
-   *
-   * @param element the static element to be associated with the operator
-   */
-  void set staticElement(MethodElement element) {
-    _staticElement = element;
-  }
-
   @override
-  void visitChildren(AstVisitor visitor) {
-    safelyVisitChild(_leftOperand, visitor);
-    safelyVisitChild(_rightOperand, visitor);
-  }
+  int get precedence => operator.type.precedence;
 
   /**
    * If the AST structure has been resolved, and the function being invoked is known based on
@@ -3336,10 +3536,10 @@
    *         operand will be bound
    */
   ParameterElement get propagatedParameterElementForRightOperand {
-    if (_propagatedElement == null) {
+    if (propagatedElement == null) {
       return null;
     }
-    List<ParameterElement> parameters = _propagatedElement.parameters;
+    List<ParameterElement> parameters = propagatedElement.parameters;
     if (parameters.length < 1) {
       return null;
     }
@@ -3347,6 +3547,22 @@
   }
 
   /**
+   * Return the expression used to compute the right operand.
+   *
+   * @return the expression used to compute the right operand
+   */
+  Expression get rightOperand => _rightOperand;
+
+  /**
+   * Set the expression used to compute the right operand to the given expression.
+   *
+   * @param expression the expression used to compute the right operand
+   */
+  void set rightOperand(Expression expression) {
+    _rightOperand = becomeParentOf(expression);
+  }
+
+  /**
    * If the AST structure has been resolved, and the function being invoked is known based on static
    * type information, then return the parameter element representing the parameter to which the
    * value of the right operand will be bound. Otherwise, return `null`.
@@ -3357,15 +3573,24 @@
    *         operand will be bound
    */
   ParameterElement get staticParameterElementForRightOperand {
-    if (_staticElement == null) {
+    if (staticElement == null) {
       return null;
     }
-    List<ParameterElement> parameters = _staticElement.parameters;
+    List<ParameterElement> parameters = staticElement.parameters;
     if (parameters.length < 1) {
       return null;
     }
     return parameters[0];
   }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitBinaryExpression(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    safelyVisitChild(_leftOperand, visitor);
+    safelyVisitChild(_rightOperand, visitor);
+  }
 }
 
 /**
@@ -3400,14 +3625,10 @@
    * @param rightBracket the right curly bracket
    */
   Block(this.leftBracket, List<Statement> statements, this.rightBracket) {
-    this._statements = new NodeList<Statement>(this);
-    this._statements.addAll(statements);
+    _statements = new NodeList<Statement>(this, statements);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitBlock(this);
-
-  @override
   Token get beginToken => leftBracket;
 
   @override
@@ -3421,6 +3642,9 @@
   NodeList<Statement> get statements => _statements;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitBlock(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _statements.accept(visitor);
   }
@@ -3460,13 +3684,10 @@
    * @param block the block representing the body of the function
    */
   BlockFunctionBody(this.keyword, this.star, Block block) {
-    this._block = becomeParentOf(block);
+    _block = becomeParentOf(block);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
-
-  @override
   Token get beginToken => _block.beginToken;
 
   /**
@@ -3476,6 +3697,15 @@
    */
   Block get block => _block;
 
+  /**
+   * Set the block representing the body of the function to the given block.
+   *
+   * @param block the block representing the body of the function
+   */
+  void set block(Block block) {
+    _block = becomeParentOf(block);
+  }
+
   @override
   Token get endToken => _block.endToken;
 
@@ -3494,14 +3724,8 @@
   @override
   bool get isSynchronous => keyword == null || keyword.lexeme != Parser.ASYNC;
 
-  /**
-   * Set the block representing the body of the function to the given block.
-   *
-   * @param block the block representing the body of the function
-   */
-  void set block(Block block) {
-    this._block = becomeParentOf(block);
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -3537,9 +3761,6 @@
   BooleanLiteral(this.literal, this.value);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this);
-
-  @override
   Token get beginToken => literal;
 
   @override
@@ -3549,6 +3770,9 @@
   bool get isSynthetic => literal.isSynthetic;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -3582,6 +3806,10 @@
    */
   GeneralizingAstVisitor<Object> _childVisitor;
 
+  BreadthFirstVisitor() {
+    _childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this);
+  }
+
   /**
    * Visit all nodes in the tree starting at the given `root` node, in breadth-first order.
    *
@@ -3600,10 +3828,6 @@
     node.visitChildren(_childVisitor);
     return null;
   }
-
-  BreadthFirstVisitor() {
-    this._childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this);
-  }
 }
 
 /**
@@ -3631,6 +3855,17 @@
   Token semicolon;
 
   /**
+   * The AstNode which this break statement is breaking from.  This will be
+   * either a Statement (in the case of breaking out of a loop) or a
+   * SwitchMember (in the case of a labeled break statement whose label matches
+   * a label on a switch case in an enclosing switch statement).  Null if the
+   * AST has not yet been resolved or if the target could not be resolved.
+   * Note that if the source code has errors, the target may be invalid (e.g.
+   * trying to break to a switch case).
+   */
+  AstNode target;
+
+  /**
    * Initialize a newly created break statement.
    *
    * @param keyword the token representing the 'break' keyword
@@ -3638,13 +3873,10 @@
    * @param semicolon the semicolon terminating the statement
    */
   BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
-    this._label = becomeParentOf(label);
+    _label = becomeParentOf(label);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitBreakStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -3667,6 +3899,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitBreakStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_label, visitor);
   }
@@ -3708,15 +3943,11 @@
    * @param cascadeSections the cascade sections sharing the common target
    */
   CascadeExpression(Expression target, List<Expression> cascadeSections) {
-    this._cascadeSections = new NodeList<Expression>(this);
-    this._target = becomeParentOf(target);
-    this._cascadeSections.addAll(cascadeSections);
+    _target = becomeParentOf(target);
+    _cascadeSections = new NodeList<Expression>(this, cascadeSections);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitCascadeExpression(this);
-
-  @override
   Token get beginToken => _target.beginToken;
 
   /**
@@ -3745,10 +3976,13 @@
    * @param target the target of the cascade sections
    */
   void set target(Expression target) {
-    this._target = becomeParentOf(target);
+    _target = becomeParentOf(target);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitCascadeExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_target, visitor);
     _cascadeSections.accept(visitor);
@@ -3787,7 +4021,7 @@
   /**
    * The left parenthesis.
    */
-  Token _leftParenthesis;
+  Token leftParenthesis;
 
   /**
    * The parameter whose value will be the exception that was thrown.
@@ -3809,7 +4043,7 @@
   /**
    * The right parenthesis.
    */
-  Token _rightParenthesis;
+  Token rightParenthesis;
 
   /**
    * The body of the catch block.
@@ -3829,19 +4063,16 @@
    * @param rightParenthesis the right parenthesis
    * @param body the body of the catch block
    */
-  CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifier stackTraceParameter, Token rightParenthesis, Block body) {
-    this._exceptionType = becomeParentOf(exceptionType);
-    this._leftParenthesis = leftParenthesis;
-    this._exceptionParameter = becomeParentOf(exceptionParameter);
-    this._stackTraceParameter = becomeParentOf(stackTraceParameter);
-    this._rightParenthesis = rightParenthesis;
-    this._body = becomeParentOf(body);
+  CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword,
+      this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma,
+      SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) {
+    _exceptionType = becomeParentOf(exceptionType);
+    _exceptionParameter = becomeParentOf(exceptionParameter);
+    _stackTraceParameter = becomeParentOf(stackTraceParameter);
+    _body = becomeParentOf(body);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitCatchClause(this);
-
-  @override
   Token get beginToken {
     if (onKeyword != null) {
       return onKeyword;
@@ -3856,6 +4087,15 @@
    */
   Block get body => _body;
 
+  /**
+   * Set the body of the catch block to the given block.
+   *
+   * @param block the body of the catch block
+   */
+  void set body(Block block) {
+    _body = becomeParentOf(block);
+  }
+
   @override
   Token get endToken => _body.endToken;
 
@@ -3867,45 +4107,6 @@
   SimpleIdentifier get exceptionParameter => _exceptionParameter;
 
   /**
-   * Return the type of exceptions caught by this catch clause, or `null` if this catch clause
-   * catches every type of exception.
-   *
-   * @return the type of exceptions caught by this catch clause
-   */
-  TypeName get exceptionType => _exceptionType;
-
-  /**
-   * Return the left parenthesis.
-   *
-   * @return the left parenthesis
-   */
-  Token get leftParenthesis => _leftParenthesis;
-
-  /**
-   * Return the right parenthesis.
-   *
-   * @return the right parenthesis
-   */
-  Token get rightParenthesis => _rightParenthesis;
-
-  /**
-   * Return the parameter whose value will be the stack trace associated with the exception, or
-   * `null` if there is no stack trace parameter.
-   *
-   * @return the parameter whose value will be the stack trace associated with the exception
-   */
-  SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
-
-  /**
-   * Set the body of the catch block to the given block.
-   *
-   * @param block the body of the catch block
-   */
-  void set body(Block block) {
-    _body = becomeParentOf(block);
-  }
-
-  /**
    * Set the parameter whose value will be the exception that was thrown to the given parameter.
    *
    * @param parameter the parameter whose value will be the exception that was thrown
@@ -3915,31 +4116,29 @@
   }
 
   /**
+   * Return the type of exceptions caught by this catch clause, or `null` if this catch clause
+   * catches every type of exception.
+   *
+   * @return the type of exceptions caught by this catch clause
+   */
+  TypeName get exceptionType => _exceptionType;
+
+  /**
    * Set the type of exceptions caught by this catch clause to the given type.
    *
    * @param exceptionType the type of exceptions caught by this catch clause
    */
   void set exceptionType(TypeName exceptionType) {
-    this._exceptionType = becomeParentOf(exceptionType);
+    _exceptionType = becomeParentOf(exceptionType);
   }
 
   /**
-   * Set the left parenthesis to the given token.
+   * Return the parameter whose value will be the stack trace associated with the exception, or
+   * `null` if there is no stack trace parameter.
    *
-   * @param parenthesis the left parenthesis
+   * @return the parameter whose value will be the stack trace associated with the exception
    */
-  void set leftParenthesis(Token parenthesis) {
-    _leftParenthesis = parenthesis;
-  }
-
-  /**
-   * Set the right parenthesis to the given token.
-   *
-   * @param parenthesis the right parenthesis
-   */
-  void set rightParenthesis(Token parenthesis) {
-    _rightParenthesis = parenthesis;
-  }
+  SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
 
   /**
    * Set the parameter whose value will be the stack trace associated with the exception to the
@@ -3953,6 +4152,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitCatchClause(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_exceptionType, visitor);
     safelyVisitChild(_exceptionParameter, visitor);
@@ -4046,14 +4248,147 @@
    * @param members the members defined by the class
    * @param rightBracket the right curly bracket
    */
-  ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyword, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super(comment, metadata) {
-    this._members = new NodeList<ClassMember>(this);
-    this._name = becomeParentOf(name);
-    this._typeParameters = becomeParentOf(typeParameters);
-    this._extendsClause = becomeParentOf(extendsClause);
-    this._withClause = becomeParentOf(withClause);
-    this._implementsClause = becomeParentOf(implementsClause);
-    this._members.addAll(members);
+  ClassDeclaration(Comment comment, List<Annotation> metadata,
+      this.abstractKeyword, this.classKeyword, SimpleIdentifier name,
+      TypeParameterList typeParameters, ExtendsClause extendsClause,
+      WithClause withClause, ImplementsClause implementsClause, this.leftBracket,
+      List<ClassMember> members, this.rightBracket)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
+    _typeParameters = becomeParentOf(typeParameters);
+    _extendsClause = becomeParentOf(extendsClause);
+    _withClause = becomeParentOf(withClause);
+    _implementsClause = becomeParentOf(implementsClause);
+    _members = new NodeList<ClassMember>(this, members);
+  }
+
+  @override
+  ClassElement get element =>
+      _name != null ? (_name.staticElement as ClassElement) : null;
+
+  @override
+  Token get endToken => rightBracket;
+
+  /**
+   * Return the extends clause for this class, or `null` if the class does not extend any
+   * other class.
+   *
+   * @return the extends clause for this class
+   */
+  ExtendsClause get extendsClause => _extendsClause;
+
+  /**
+   * Set the extends clause for this class to the given clause.
+   *
+   * @param extendsClause the extends clause for this class
+   */
+  void set extendsClause(ExtendsClause extendsClause) {
+    _extendsClause = becomeParentOf(extendsClause);
+  }
+
+  @override
+  Token get firstTokenAfterCommentAndMetadata {
+    if (abstractKeyword != null) {
+      return abstractKeyword;
+    }
+    return classKeyword;
+  }
+
+  /**
+   * Return the implements clause for the class, or `null` if the class does not implement any
+   * interfaces.
+   *
+   * @return the implements clause for the class
+   */
+  ImplementsClause get implementsClause => _implementsClause;
+
+  /**
+   * Set the implements clause for the class to the given clause.
+   *
+   * @param implementsClause the implements clause for the class
+   */
+  void set implementsClause(ImplementsClause implementsClause) {
+    _implementsClause = becomeParentOf(implementsClause);
+  }
+
+  /**
+   * Return `true` if this class is declared to be an abstract class.
+   *
+   * @return `true` if this class is declared to be an abstract class
+   */
+  bool get isAbstract => abstractKeyword != null;
+
+  /**
+   * Return the members defined by the class.
+   *
+   * @return the members defined by the class
+   */
+  NodeList<ClassMember> get members => _members;
+
+  /**
+   * Return the name of the class being declared.
+   *
+   * @return the name of the class being declared
+   */
+  SimpleIdentifier get name => _name;
+
+  /**
+   * Set the name of the class being declared to the given identifier.
+   *
+   * @param identifier the name of the class being declared
+   */
+  void set name(SimpleIdentifier identifier) {
+    _name = becomeParentOf(identifier);
+  }
+
+  /**
+   * Return the native clause for this class, or `null` if the class does not have a native
+   * cluse.
+   *
+   * @return the native clause for this class
+   */
+  NativeClause get nativeClause => _nativeClause;
+
+  /**
+   * Set the native clause for this class to the given clause.
+   *
+   * @param nativeClause the native clause for this class
+   */
+  void set nativeClause(NativeClause nativeClause) {
+    _nativeClause = becomeParentOf(nativeClause);
+  }
+
+  /**
+   * Return the type parameters for the class, or `null` if the class does not have any type
+   * parameters.
+   *
+   * @return the type parameters for the class
+   */
+  TypeParameterList get typeParameters => _typeParameters;
+
+  /**
+   * Set the type parameters for the class to the given list of type parameters.
+   *
+   * @param typeParameters the type parameters for the class
+   */
+  void set typeParameters(TypeParameterList typeParameters) {
+    _typeParameters = becomeParentOf(typeParameters);
+  }
+
+  /**
+   * Return the with clause for the class, or `null` if the class does not have a with clause.
+   *
+   * @return the with clause for the class
+   */
+  WithClause get withClause => _withClause;
+
+  /**
+   * Set the with clause for the class to the given clause.
+   *
+   * @param withClause the with clause for the class
+   */
+  void set withClause(WithClause withClause) {
+    _withClause = becomeParentOf(withClause);
   }
 
   @override
@@ -4081,20 +4416,6 @@
     return null;
   }
 
-  @override
-  ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
-
-  @override
-  Token get endToken => rightBracket;
-
-  /**
-   * Return the extends clause for this class, or `null` if the class does not extend any
-   * other class.
-   *
-   * @return the extends clause for this class
-   */
-  ExtendsClause get extendsClause => _extendsClause;
-
   /**
    * Return the field declared in the class with the given name.
    *
@@ -4105,7 +4426,8 @@
     for (ClassMember classMember in _members) {
       if (classMember is FieldDeclaration) {
         FieldDeclaration fieldDeclaration = classMember;
-        NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables;
+        NodeList<VariableDeclaration> fields =
+            fieldDeclaration.fields.variables;
         for (VariableDeclaration field in fields) {
           SimpleIdentifier fieldName = field.name;
           if (fieldName != null && name == fieldName.name) {
@@ -4118,21 +4440,6 @@
   }
 
   /**
-   * Return the implements clause for the class, or `null` if the class does not implement any
-   * interfaces.
-   *
-   * @return the implements clause for the class
-   */
-  ImplementsClause get implementsClause => _implementsClause;
-
-  /**
-   * Return the members defined by the class.
-   *
-   * @return the members defined by the class
-   */
-  NodeList<ClassMember> get members => _members;
-
-  /**
    * Return the method declared in the class with the given name.
    *
    * @param name the name of the method to find
@@ -4151,97 +4458,6 @@
     return null;
   }
 
-  /**
-   * Return the name of the class being declared.
-   *
-   * @return the name of the class being declared
-   */
-  SimpleIdentifier get name => _name;
-
-  /**
-   * Return the native clause for this class, or `null` if the class does not have a native
-   * cluse.
-   *
-   * @return the native clause for this class
-   */
-  NativeClause get nativeClause => _nativeClause;
-
-  /**
-   * Return the type parameters for the class, or `null` if the class does not have any type
-   * parameters.
-   *
-   * @return the type parameters for the class
-   */
-  TypeParameterList get typeParameters => _typeParameters;
-
-  /**
-   * Return the with clause for the class, or `null` if the class does not have a with clause.
-   *
-   * @return the with clause for the class
-   */
-  WithClause get withClause => _withClause;
-
-  /**
-   * Return `true` if this class is declared to be an abstract class.
-   *
-   * @return `true` if this class is declared to be an abstract class
-   */
-  bool get isAbstract => abstractKeyword != null;
-
-  /**
-   * Set the extends clause for this class to the given clause.
-   *
-   * @param extendsClause the extends clause for this class
-   */
-  void set extendsClause(ExtendsClause extendsClause) {
-    this._extendsClause = becomeParentOf(extendsClause);
-  }
-
-  /**
-   * Set the implements clause for the class to the given clause.
-   *
-   * @param implementsClause the implements clause for the class
-   */
-  void set implementsClause(ImplementsClause implementsClause) {
-    this._implementsClause = becomeParentOf(implementsClause);
-  }
-
-  /**
-   * Set the name of the class being declared to the given identifier.
-   *
-   * @param identifier the name of the class being declared
-   */
-  void set name(SimpleIdentifier identifier) {
-    _name = becomeParentOf(identifier);
-  }
-
-  /**
-   * Set the native clause for this class to the given clause.
-   *
-   * @param nativeClause the native clause for this class
-   */
-  void set nativeClause(NativeClause nativeClause) {
-    this._nativeClause = becomeParentOf(nativeClause);
-  }
-
-  /**
-   * Set the type parameters for the class to the given list of type parameters.
-   *
-   * @param typeParameters the type parameters for the class
-   */
-  void set typeParameters(TypeParameterList typeParameters) {
-    this._typeParameters = becomeParentOf(typeParameters);
-  }
-
-  /**
-   * Set the with clause for the class to the given clause.
-   *
-   * @param withClause the with clause for the class
-   */
-  void set withClause(WithClause withClause) {
-    this._withClause = becomeParentOf(withClause);
-  }
-
   @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
@@ -4253,14 +4469,6 @@
     safelyVisitChild(_nativeClause, visitor);
     members.accept(visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata {
-    if (abstractKeyword != null) {
-      return abstractKeyword;
-    }
-    return classKeyword;
-  }
 }
 
 /**
@@ -4274,7 +4482,8 @@
    * @param comment the documentation comment associated with this member
    * @param metadata the annotations associated with this member
    */
-  ClassMember(Comment comment, List<Annotation> metadata) : super(comment, metadata);
+  ClassMember(Comment comment, List<Annotation> metadata)
+      : super(comment, metadata);
 }
 
 /**
@@ -4341,19 +4550,21 @@
    * @param implementsClause the implements clause for this class
    * @param semicolon the semicolon terminating the declaration
    */
-  ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, SimpleIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause, Token semicolon) : super(comment, metadata, keyword, semicolon) {
-    this._name = becomeParentOf(name);
-    this._typeParameters = becomeParentOf(typeParameters);
-    this._superclass = becomeParentOf(superclass);
-    this._withClause = becomeParentOf(withClause);
-    this._implementsClause = becomeParentOf(implementsClause);
+  ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
+      SimpleIdentifier name, TypeParameterList typeParameters, this.equals,
+      this.abstractKeyword, TypeName superclass, WithClause withClause,
+      ImplementsClause implementsClause, Token semicolon)
+      : super(comment, metadata, keyword, semicolon) {
+    _name = becomeParentOf(name);
+    _typeParameters = becomeParentOf(typeParameters);
+    _superclass = becomeParentOf(superclass);
+    _withClause = becomeParentOf(withClause);
+    _implementsClause = becomeParentOf(implementsClause);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this);
-
-  @override
-  ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
+  ClassElement get element =>
+      _name != null ? (_name.staticElement as ClassElement) : null;
 
   /**
    * Return the implements clause for this class, or `null` if there is no implements clause.
@@ -4363,6 +4574,22 @@
   ImplementsClause get implementsClause => _implementsClause;
 
   /**
+   * Set the implements clause for this class to the given implements clause.
+   *
+   * @param implementsClause the implements clause for this class
+   */
+  void set implementsClause(ImplementsClause implementsClause) {
+    _implementsClause = becomeParentOf(implementsClause);
+  }
+
+  /**
+   * Return `true` if this class is declared to be an abstract class.
+   *
+   * @return `true` if this class is declared to be an abstract class
+   */
+  bool get isAbstract => abstractKeyword != null;
+
+  /**
    * Return the name of the class being declared.
    *
    * @return the name of the class being declared
@@ -4370,6 +4597,15 @@
   SimpleIdentifier get name => _name;
 
   /**
+   * Set the name of the class being declared to the given identifier.
+   *
+   * @param name the name of the class being declared
+   */
+  void set name(SimpleIdentifier name) {
+    _name = becomeParentOf(name);
+  }
+
+  /**
    * Return the name of the superclass of the class being declared.
    *
    * @return the name of the superclass of the class being declared
@@ -4377,6 +4613,15 @@
   TypeName get superclass => _superclass;
 
   /**
+   * Set the name of the superclass of the class being declared to the given name.
+   *
+   * @param superclass the name of the superclass of the class being declared
+   */
+  void set superclass(TypeName superclass) {
+    _superclass = becomeParentOf(superclass);
+  }
+
+  /**
    * Return the type parameters for the class, or `null` if the class does not have any type
    * parameters.
    *
@@ -4385,6 +4630,15 @@
   TypeParameterList get typeParameters => _typeParameters;
 
   /**
+   * Set the type parameters for the class to the given list of parameters.
+   *
+   * @param typeParameters the type parameters for the class
+   */
+  void set typeParameters(TypeParameterList typeParameters) {
+    _typeParameters = becomeParentOf(typeParameters);
+  }
+
+  /**
    * Return the with clause for this class.
    *
    * @return the with clause for this class
@@ -4392,58 +4646,18 @@
   WithClause get withClause => _withClause;
 
   /**
-   * Return `true` if this class is declared to be an abstract class.
-   *
-   * @return `true` if this class is declared to be an abstract class
-   */
-  bool get isAbstract => abstractKeyword != null;
-
-  /**
-   * Set the implements clause for this class to the given implements clause.
-   *
-   * @param implementsClause the implements clause for this class
-   */
-  void set implementsClause(ImplementsClause implementsClause) {
-    this._implementsClause = becomeParentOf(implementsClause);
-  }
-
-  /**
-   * Set the name of the class being declared to the given identifier.
-   *
-   * @param name the name of the class being declared
-   */
-  void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
-  }
-
-  /**
-   * Set the name of the superclass of the class being declared to the given name.
-   *
-   * @param superclass the name of the superclass of the class being declared
-   */
-  void set superclass(TypeName superclass) {
-    this._superclass = becomeParentOf(superclass);
-  }
-
-  /**
-   * Set the type parameters for the class to the given list of parameters.
-   *
-   * @param typeParameters the type parameters for the class
-   */
-  void set typeParameters(TypeParameterList typeParameters) {
-    this._typeParameters = becomeParentOf(typeParameters);
-  }
-
-  /**
    * Set the with clause for this class to the given with clause.
    *
    * @param withClause the with clause for this class
    */
   void set withClause(WithClause withClause) {
-    this._withClause = becomeParentOf(withClause);
+    _withClause = becomeParentOf(withClause);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_name, visitor);
@@ -4504,39 +4718,6 @@
  */
 class Comment extends AstNode {
   /**
-   * Create a block comment.
-   *
-   * @param tokens the tokens representing the comment
-   * @return the block comment that was created
-   */
-  static Comment createBlockComment(List<Token> tokens) => new Comment(tokens, CommentType.BLOCK, null);
-
-  /**
-   * Create a documentation comment.
-   *
-   * @param tokens the tokens representing the comment
-   * @return the documentation comment that was created
-   */
-  static Comment createDocumentationComment(List<Token> tokens) => new Comment(tokens, CommentType.DOCUMENTATION, new List<CommentReference>());
-
-  /**
-   * Create a documentation comment.
-   *
-   * @param tokens the tokens representing the comment
-   * @param references the references embedded within the documentation comment
-   * @return the documentation comment that was created
-   */
-  static Comment createDocumentationCommentWithReferences(List<Token> tokens, List<CommentReference> references) => new Comment(tokens, CommentType.DOCUMENTATION, references);
-
-  /**
-   * Create an end-of-line comment.
-   *
-   * @param tokens the tokens representing the comment
-   * @return the end-of-line comment that was created
-   */
-  static Comment createEndOfLineComment(List<Token> tokens) => new Comment(tokens, CommentType.END_OF_LINE, null);
-
-  /**
    * The tokens representing the comment.
    */
   final List<Token> tokens;
@@ -4560,27 +4741,16 @@
    * @param references the references embedded within the documentation comment
    */
   Comment(this.tokens, this._type, List<CommentReference> references) {
-    this._references = new NodeList<CommentReference>(this);
-    this._references.addAll(references);
+    _references = new NodeList<CommentReference>(this, references);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitComment(this);
-
-  @override
   Token get beginToken => tokens[0];
 
   @override
   Token get endToken => tokens[tokens.length - 1];
 
   /**
-   * Return the references embedded within the documentation comment.
-   *
-   * @return the references embedded within the documentation comment
-   */
-  NodeList<CommentReference> get references => _references;
-
-  /**
    * Return `true` if this is a block comment.
    *
    * @return `true` if this is a block comment
@@ -4601,10 +4771,58 @@
    */
   bool get isEndOfLine => _type == CommentType.END_OF_LINE;
 
+  /**
+   * Return the references embedded within the documentation comment.
+   *
+   * @return the references embedded within the documentation comment
+   */
+  NodeList<CommentReference> get references => _references;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitComment(this);
+
   @override
   void visitChildren(AstVisitor visitor) {
     _references.accept(visitor);
   }
+
+  /**
+   * Create a block comment.
+   *
+   * @param tokens the tokens representing the comment
+   * @return the block comment that was created
+   */
+  static Comment createBlockComment(List<Token> tokens) =>
+      new Comment(tokens, CommentType.BLOCK, null);
+
+  /**
+   * Create a documentation comment.
+   *
+   * @param tokens the tokens representing the comment
+   * @return the documentation comment that was created
+   */
+  static Comment createDocumentationComment(List<Token> tokens) =>
+      new Comment(tokens, CommentType.DOCUMENTATION, new List<CommentReference>());
+
+  /**
+   * Create a documentation comment.
+   *
+   * @param tokens the tokens representing the comment
+   * @param references the references embedded within the documentation comment
+   * @return the documentation comment that was created
+   */
+  static Comment createDocumentationCommentWithReferences(List<Token> tokens,
+      List<CommentReference> references) =>
+      new Comment(tokens, CommentType.DOCUMENTATION, references);
+
+  /**
+   * Create an end-of-line comment.
+   *
+   * @param tokens the tokens representing the comment
+   * @return the end-of-line comment that was created
+   */
+  static Comment createEndOfLineComment(List<Token> tokens) =>
+      new Comment(tokens, CommentType.END_OF_LINE, null);
 }
 
 /**
@@ -4634,13 +4852,10 @@
    * @param identifier the identifier being referenced
    */
   CommentReference(this.newKeyword, Identifier identifier) {
-    this._identifier = becomeParentOf(identifier);
+    _identifier = becomeParentOf(identifier);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitCommentReference(this);
-
-  @override
   Token get beginToken => _identifier.beginToken;
 
   @override
@@ -4659,38 +4874,50 @@
    * @param identifier the identifier being referenced
    */
   void set identifier(Identifier identifier) {
-    this._identifier = becomeParentOf(identifier);
+    _identifier = becomeParentOf(identifier);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitCommentReference(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_identifier, visitor);
   }
 }
 
 /**
- * The enumeration `CommentType` encodes all the different types of comments that are
- * recognized by the parser.
+ * The enumeration `CommentType` encodes all the different types of comments
+ * that are recognized by the parser.
  */
-class CommentType extends Enum<CommentType> {
-  /**
-   * An end-of-line comment.
-   */
-  static const CommentType END_OF_LINE = const CommentType('END_OF_LINE', 0);
-
+class CommentType {
   /**
    * A block comment.
    */
-  static const CommentType BLOCK = const CommentType('BLOCK', 1);
+  static const CommentType BLOCK = const CommentType('BLOCK');
 
   /**
    * A documentation comment.
    */
-  static const CommentType DOCUMENTATION = const CommentType('DOCUMENTATION', 2);
+  static const CommentType DOCUMENTATION = const CommentType('DOCUMENTATION');
 
-  static const List<CommentType> values = const [END_OF_LINE, BLOCK, DOCUMENTATION];
+  /**
+   * An end-of-line comment.
+   */
+  static const CommentType END_OF_LINE = const CommentType('END_OF_LINE');
 
-  const CommentType(String name, int ordinal) : super(name, ordinal);
+  /**
+   * The name of the comment type.
+   */
+  final String name;
+
+  /**
+   * Initialize a newly created comment type to have the given [name].
+   */
+  const CommentType(this.name);
+
+  @override
+  String toString() => name;
 }
 
 /**
@@ -4721,7 +4948,7 @@
   /**
    * The first token in the token stream that was parsed to form this compilation unit.
    */
-  final Token beginToken;
+  Token beginToken;
 
   /**
    * The script tag at the beginning of the compilation unit, or `null` if there is no script
@@ -4765,17 +4992,14 @@
    * @param declarations the declarations contained in this compilation unit
    * @param endToken the last token in the token stream
    */
-  CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directives, List<CompilationUnitMember> declarations, this.endToken) {
-    this._directives = new NodeList<Directive>(this);
-    this._declarations = new NodeList<CompilationUnitMember>(this);
-    this._scriptTag = becomeParentOf(scriptTag);
-    this._directives.addAll(directives);
-    this._declarations.addAll(declarations);
+  CompilationUnit(this.beginToken, ScriptTag scriptTag,
+      List<Directive> directives, List<CompilationUnitMember> declarations,
+      this.endToken) {
+    _scriptTag = becomeParentOf(scriptTag);
+    _directives = new NodeList<Directive>(this, directives);
+    _declarations = new NodeList<CompilationUnitMember>(this, declarations);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitCompilationUnit(this);
-
   /**
    * Return the declarations contained in this compilation unit.
    *
@@ -4816,9 +5040,26 @@
    * @param scriptTag the script tag at the beginning of the compilation unit
    */
   void set scriptTag(ScriptTag scriptTag) {
-    this._scriptTag = becomeParentOf(scriptTag);
+    _scriptTag = becomeParentOf(scriptTag);
   }
 
+  /**
+   * Return an array containing all of the directives and declarations in this compilation unit,
+   * sorted in lexical order.
+   *
+   * @return the directives and declarations in this compilation unit in the order in which they
+   *         appeared in the original source
+   */
+  List<AstNode> get sortedDirectivesAndDeclarations {
+    return <AstNode>[]
+        ..addAll(_directives)
+        ..addAll(_declarations)
+        ..sort(AstNode.LEXICAL_ORDER);
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitCompilationUnit(this);
+
   @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_scriptTag, visitor);
@@ -4845,20 +5086,6 @@
     CompilationUnitMember firstDeclaration = _declarations[0];
     return lastDirective.offset < firstDeclaration.offset;
   }
-
-  /**
-   * Return an array containing all of the directives and declarations in this compilation unit,
-   * sorted in lexical order.
-   *
-   * @return the directives and declarations in this compilation unit in the order in which they
-   *         appeared in the original source
-   */
-  List<AstNode> get sortedDirectivesAndDeclarations {
-    return <AstNode>[]
-      ..addAll(_directives)
-      ..addAll(_declarations)
-      ..sort(AstNode.LEXICAL_ORDER);
-  }
 }
 
 /**
@@ -4882,7 +5109,8 @@
    * @param comment the documentation comment associated with this member
    * @param metadata the annotations associated with this member
    */
-  CompilationUnitMember(Comment comment, List<Annotation> metadata) : super(comment, metadata);
+  CompilationUnitMember(Comment comment, List<Annotation> metadata)
+      : super(comment, metadata);
 }
 
 /**
@@ -4930,16 +5158,14 @@
    * @param elseExpression the expression that is executed if the condition evaluates to
    *          `false`
    */
-  ConditionalExpression(Expression condition, this.question, Expression thenExpression, this.colon, Expression elseExpression) {
-    this._condition = becomeParentOf(condition);
-    this._thenExpression = becomeParentOf(thenExpression);
-    this._elseExpression = becomeParentOf(elseExpression);
+  ConditionalExpression(Expression condition, this.question,
+      Expression thenExpression, this.colon, Expression elseExpression) {
+    _condition = becomeParentOf(condition);
+    _thenExpression = becomeParentOf(thenExpression);
+    _elseExpression = becomeParentOf(elseExpression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
-
-  @override
   Token get beginToken => _condition.beginToken;
 
   /**
@@ -4950,12 +5176,32 @@
   Expression get condition => _condition;
 
   /**
+   * Set the condition used to determine which of the expressions is executed next to the given
+   * expression.
+   *
+   * @param expression the condition used to determine which expression is executed next
+   */
+  void set condition(Expression expression) {
+    _condition = becomeParentOf(expression);
+  }
+
+  /**
    * Return the expression that is executed if the condition evaluates to `false`.
    *
    * @return the expression that is executed if the condition evaluates to `false`
    */
   Expression get elseExpression => _elseExpression;
 
+  /**
+   * Set the expression that is executed if the condition evaluates to `false` to the given
+   * expression.
+   *
+   * @param expression the expression that is executed if the condition evaluates to `false`
+   */
+  void set elseExpression(Expression expression) {
+    _elseExpression = becomeParentOf(expression);
+  }
+
   @override
   Token get endToken => _elseExpression.endToken;
 
@@ -4970,26 +5216,6 @@
   Expression get thenExpression => _thenExpression;
 
   /**
-   * Set the condition used to determine which of the expressions is executed next to the given
-   * expression.
-   *
-   * @param expression the condition used to determine which expression is executed next
-   */
-  void set condition(Expression expression) {
-    _condition = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the expression that is executed if the condition evaluates to `false` to the given
-   * expression.
-   *
-   * @param expression the expression that is executed if the condition evaluates to `false`
-   */
-  void set elseExpression(Expression expression) {
-    _elseExpression = becomeParentOf(expression);
-  }
-
-  /**
    * Set the expression that is executed if the condition evaluates to `true` to the given
    * expression.
    *
@@ -5000,6 +5226,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_condition, visitor);
     safelyVisitChild(_thenExpression, visitor);
@@ -5230,7 +5459,11 @@
   @override
   Object visitInterpolationExpression(InterpolationExpression node) {
     Object value = node.expression.accept(this);
-    if (value == null || value is bool || value is String || value is int || value is double) {
+    if (value == null ||
+        value is bool ||
+        value is String ||
+        value is int ||
+        value is double) {
       return value;
     }
     return NOT_A_CONSTANT;
@@ -5276,10 +5509,12 @@
   Object visitNullLiteral(NullLiteral node) => null;
 
   @override
-  Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expression.accept(this);
+  Object visitParenthesizedExpression(ParenthesizedExpression node) =>
+      node.expression.accept(this);
 
   @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) => _getConstantValue(null);
+  Object visitPrefixedIdentifier(PrefixedIdentifier node) =>
+      _getConstantValue(null);
 
   @override
   Object visitPrefixExpression(PrefixExpression node) {
@@ -5317,7 +5552,8 @@
   Object visitPropertyAccess(PropertyAccess node) => _getConstantValue(null);
 
   @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) => _getConstantValue(null);
+  Object visitSimpleIdentifier(SimpleIdentifier node) =>
+      _getConstantValue(null);
 
   @override
   Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value;
@@ -5480,19 +5716,21 @@
    *          redirected
    * @param body the body of the constructor
    */
-  ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.period, SimpleIdentifier name, FormalParameterList parameters, this.separator, List<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) : super(comment, metadata) {
-    this._initializers = new NodeList<ConstructorInitializer>(this);
-    this._returnType = becomeParentOf(returnType);
-    this._name = becomeParentOf(name);
-    this._parameters = becomeParentOf(parameters);
-    this._initializers.addAll(initializers);
-    this._redirectedConstructor = becomeParentOf(redirectedConstructor);
-    this._body = becomeParentOf(body);
+  ConstructorDeclaration(Comment comment, List<Annotation> metadata,
+      this.externalKeyword, this.constKeyword, this.factoryKeyword,
+      Identifier returnType, this.period, SimpleIdentifier name,
+      FormalParameterList parameters, this.separator,
+      List<ConstructorInitializer> initializers,
+      ConstructorName redirectedConstructor, FunctionBody body)
+      : super(comment, metadata) {
+    _returnType = becomeParentOf(returnType);
+    _name = becomeParentOf(name);
+    _parameters = becomeParentOf(parameters);
+    _initializers = new NodeList<ConstructorInitializer>(this, initializers);
+    _redirectedConstructor = becomeParentOf(redirectedConstructor);
+    _body = becomeParentOf(body);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this);
-
   /**
    * Return the body of the constructor, or `null` if the constructor does not have a body.
    *
@@ -5500,6 +5738,15 @@
    */
   FunctionBody get body => _body;
 
+  /**
+   * Set the body of the constructor to the given function body.
+   *
+   * @param functionBody the body of the constructor
+   */
+  void set body(FunctionBody functionBody) {
+    _body = becomeParentOf(functionBody);
+  }
+
   @override
   Token get endToken {
     if (_body != null) {
@@ -5510,6 +5757,16 @@
     return _parameters.endToken;
   }
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata {
+    Token leftMost =
+        Token.lexicallyFirst([externalKeyword, constKeyword, factoryKeyword]);
+    if (leftMost != null) {
+      return leftMost;
+    }
+    return _returnType.beginToken;
+  }
+
   /**
    * Return the initializers associated with the constructor.
    *
@@ -5526,6 +5783,15 @@
   SimpleIdentifier get name => _name;
 
   /**
+   * Set the name of the constructor to the given identifier.
+   *
+   * @param identifier the name of the constructor
+   */
+  void set name(SimpleIdentifier identifier) {
+    _name = becomeParentOf(identifier);
+  }
+
+  /**
    * Return the parameters associated with the constructor.
    *
    * @return the parameters associated with the constructor
@@ -5533,6 +5799,15 @@
   FormalParameterList get parameters => _parameters;
 
   /**
+   * Set the parameters associated with the constructor to the given list of parameters.
+   *
+   * @param parameters the parameters associated with the constructor
+   */
+  void set parameters(FormalParameterList parameters) {
+    _parameters = becomeParentOf(parameters);
+  }
+
+  /**
    * Return the name of the constructor to which this constructor will be redirected, or
    * `null` if this is not a redirecting factory constructor.
    *
@@ -5541,6 +5816,17 @@
   ConstructorName get redirectedConstructor => _redirectedConstructor;
 
   /**
+   * Set the name of the constructor to which this constructor will be redirected to the given
+   * constructor name.
+   *
+   * @param redirectedConstructor the name of the constructor to which this constructor will be
+   *          redirected
+   */
+  void set redirectedConstructor(ConstructorName redirectedConstructor) {
+    _redirectedConstructor = becomeParentOf(redirectedConstructor);
+  }
+
+  /**
    * Return the type of object being created. This can be different than the type in which the
    * constructor is being declared if the constructor is the implementation of a factory
    * constructor.
@@ -5550,44 +5836,6 @@
   Identifier get returnType => _returnType;
 
   /**
-   * Set the body of the constructor to the given function body.
-   *
-   * @param functionBody the body of the constructor
-   */
-  void set body(FunctionBody functionBody) {
-    _body = becomeParentOf(functionBody);
-  }
-
-  /**
-   * Set the name of the constructor to the given identifier.
-   *
-   * @param identifier the name of the constructor
-   */
-  void set name(SimpleIdentifier identifier) {
-    _name = becomeParentOf(identifier);
-  }
-
-  /**
-   * Set the parameters associated with the constructor to the given list of parameters.
-   *
-   * @param parameters the parameters associated with the constructor
-   */
-  void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
-  }
-
-  /**
-   * Set the name of the constructor to which this constructor will be redirected to the given
-   * constructor name.
-   *
-   * @param redirectedConstructor the name of the constructor to which this constructor will be
-   *          redirected
-   */
-  void set redirectedConstructor(ConstructorName redirectedConstructor) {
-    this._redirectedConstructor = becomeParentOf(redirectedConstructor);
-  }
-
-  /**
    * Set the type of object being created to the given type name.
    *
    * @param typeName the type of object being created
@@ -5597,6 +5845,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_returnType, visitor);
@@ -5606,33 +5857,6 @@
     safelyVisitChild(_redirectedConstructor, visitor);
     safelyVisitChild(_body, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata {
-    Token leftMost = _leftMost([externalKeyword, constKeyword, factoryKeyword]);
-    if (leftMost != null) {
-      return leftMost;
-    }
-    return _returnType.beginToken;
-  }
-
-  /**
-   * Return the left-most of the given tokens, or `null` if there are no tokens given or if
-   * all of the given tokens are `null`.
-   *
-   * @param tokens the tokens being compared to find the left-most token
-   * @return the left-most of the given tokens
-   */
-  Token _leftMost(List<Token> tokens) {
-    Token leftMost = null;
-    int offset = 2147483647;
-    for (Token token in tokens) {
-      if (token != null && token.offset < offset) {
-        leftMost = token;
-      }
-    }
-    return leftMost;
-  }
 }
 
 /**
@@ -5681,15 +5905,13 @@
    * @param equals the token for the equal sign between the field name and the expression
    * @param expression the expression computing the value to which the field will be initialized
    */
-  ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldName, this.equals, Expression expression) {
-    this._fieldName = becomeParentOf(fieldName);
-    this._expression = becomeParentOf(expression);
+  ConstructorFieldInitializer(this.keyword, this.period,
+      SimpleIdentifier fieldName, this.equals, Expression expression) {
+    _fieldName = becomeParentOf(fieldName);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
-
-  @override
   Token get beginToken {
     if (keyword != null) {
       return keyword;
@@ -5708,23 +5930,23 @@
   Expression get expression => _expression;
 
   /**
-   * Return the name of the field being initialized.
-   *
-   * @return the name of the field being initialized
-   */
-  SimpleIdentifier get fieldName => _fieldName;
-
-  /**
    * Set the expression computing the value to which the field will be initialized to the given
    * expression.
    *
    * @param expression the expression computing the value to which the field will be initialized
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   /**
+   * Return the name of the field being initialized.
+   *
+   * @return the name of the field being initialized
+   */
+  SimpleIdentifier get fieldName => _fieldName;
+
+  /**
    * Set the name of the field being initialized to the given identifier.
    *
    * @param identifier the name of the field being initialized
@@ -5734,6 +5956,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_fieldName, visitor);
     safelyVisitChild(_expression, visitor);
@@ -5784,7 +6009,7 @@
    * `null` if the AST structure has not been resolved or if this constructor name could not
    * be resolved.
    */
-  ConstructorElement _staticElement;
+  ConstructorElement staticElement;
 
   /**
    * Initialize a newly created constructor name.
@@ -5794,14 +6019,11 @@
    * @param name the name of the constructor
    */
   ConstructorName(TypeName type, this.period, SimpleIdentifier name) {
-    this._type = becomeParentOf(type);
-    this._name = becomeParentOf(name);
+    _type = becomeParentOf(type);
+    _name = becomeParentOf(name);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitConstructorName(this);
-
-  @override
   Token get beginToken => _type.beginToken;
 
   @override
@@ -5821,13 +6043,13 @@
   SimpleIdentifier get name => _name;
 
   /**
-   * Return the element associated with this constructor name based on static type information, or
-   * `null` if the AST structure has not been resolved or if this constructor name could not
-   * be resolved.
+   * Set the name of the constructor to the given name.
    *
-   * @return the element associated with this constructor name
+   * @param name the name of the constructor
    */
-  ConstructorElement get staticElement => _staticElement;
+  void set name(SimpleIdentifier name) {
+    _name = becomeParentOf(name);
+  }
 
   /**
    * Return the name of the type defining the constructor.
@@ -5837,34 +6059,18 @@
   TypeName get type => _type;
 
   /**
-   * Set the name of the constructor to the given name.
-   *
-   * @param name the name of the constructor
-   */
-  void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
-  }
-
-  /**
-   * Set the element associated with this constructor name based on static type information to the
-   * given element.
-   *
-   * @param element the element to be associated with this constructor name
-   */
-  void set staticElement(ConstructorElement element) {
-    _staticElement = element;
-  }
-
-  /**
    * Set the name of the type defining the constructor to the given type name.
    *
    * @param type the name of the type defining the constructor
    */
   void set type(TypeName type) {
-    this._type = becomeParentOf(type);
+    _type = becomeParentOf(type);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitConstructorName(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_type, visitor);
     safelyVisitChild(_name, visitor);
@@ -5896,6 +6102,16 @@
   Token semicolon;
 
   /**
+   * The AstNode which this continue statement is continuing to.  This will be
+   * either a Statement (in the case of continuing a loop) or a SwitchMember
+   * (in the case of continuing from one switch case to another).  Null if the
+   * AST has not yet been resolved or if the target could not be resolved.
+   * Note that if the source code has errors, the target may be invalid (e.g.
+   * the target may be in an enclosing function).
+   */
+  AstNode target;
+
+  /**
    * Initialize a newly created continue statement.
    *
    * @param keyword the token representing the 'continue' keyword
@@ -5903,13 +6119,10 @@
    * @param semicolon the semicolon terminating the statement
    */
   ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
-    this._label = becomeParentOf(label);
+    _label = becomeParentOf(label);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitContinueStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -5932,6 +6145,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitContinueStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_label, visitor);
   }
@@ -5948,7 +6164,8 @@
    * @param comment the documentation comment associated with this declaration
    * @param metadata the annotations associated with this declaration
    */
-  Declaration(Comment comment, List<Annotation> metadata) : super(comment, metadata);
+  Declaration(Comment comment, List<Annotation> metadata)
+      : super(comment, metadata);
 
   /**
    * Return the element associated with this declaration, or `null` if either this node
@@ -5965,7 +6182,7 @@
  *
  * <pre>
  * declaredIdentifier ::=
- *     ([Annotation] finalConstVarOrType [SimpleIdentifier]
+ *     [Annotation] finalConstVarOrType [SimpleIdentifier]
  * </pre>
  */
 class DeclaredIdentifier extends Declaration {
@@ -5995,26 +6212,34 @@
    * @param type the name of the declared type of the parameter
    * @param identifier the name of the parameter being declared
    */
-  DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, SimpleIdentifier identifier) : super(comment, metadata) {
-    this._type = becomeParentOf(type);
-    this._identifier = becomeParentOf(identifier);
+  DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword,
+      TypeName type, SimpleIdentifier identifier)
+      : super(comment, metadata) {
+    _type = becomeParentOf(type);
+    _identifier = becomeParentOf(identifier);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this);
-
-  @override
   LocalVariableElement get element {
-    SimpleIdentifier identifier = this.identifier;
-    if (identifier == null) {
+    if (_identifier == null) {
       return null;
     }
-    return identifier.staticElement as LocalVariableElement;
+    return _identifier.staticElement as LocalVariableElement;
   }
 
   @override
   Token get endToken => _identifier.endToken;
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata {
+    if (keyword != null) {
+      return keyword;
+    } else if (_type != null) {
+      return _type.beginToken;
+    }
+    return _identifier.beginToken;
+  }
+
   /**
    * Return the name of the variable being declared.
    *
@@ -6023,19 +6248,21 @@
   SimpleIdentifier get identifier => _identifier;
 
   /**
-   * Return the name of the declared type of the parameter, or `null` if the parameter does
-   * not have a declared type.
+   * Set the name of the variable being declared to the given name.
    *
-   * @return the name of the declared type of the parameter
+   * @param identifier the new name of the variable being declared
    */
-  TypeName get type => _type;
+  void set identifier(SimpleIdentifier identifier) {
+    _identifier = becomeParentOf(identifier);
+  }
 
   /**
    * Return `true` if this variable was declared with the 'const' modifier.
    *
    * @return `true` if this variable was declared with the 'const' modifier
    */
-  bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
+  bool get isConst =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
 
   /**
    * Return `true` if this variable was declared with the 'final' modifier. Variables that are
@@ -6044,16 +6271,16 @@
    *
    * @return `true` if this variable was declared with the 'final' modifier
    */
-  bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
+  bool get isFinal =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
 
   /**
-   * Set the name of the variable being declared to the given name.
+   * Return the name of the declared type of the parameter, or `null` if the parameter does
+   * not have a declared type.
    *
-   * @param identifier the new name of the variable being declared
+   * @return the name of the declared type of the parameter
    */
-  void set identifier(SimpleIdentifier identifier) {
-    this._identifier = becomeParentOf(identifier);
-  }
+  TypeName get type => _type;
 
   /**
    * Set the name of the declared type of the parameter to the given type name.
@@ -6065,21 +6292,14 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_type, visitor);
     safelyVisitChild(_identifier, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata {
-    if (keyword != null) {
-      return keyword;
-    } else if (_type != null) {
-      return _type.beginToken;
-    }
-    return _identifier.beginToken;
-  }
 }
 
 /**
@@ -6126,15 +6346,13 @@
    * @param separator the token separating the parameter from the default value
    * @param defaultValue the expression computing the default value for the parameter
    */
-  DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separator, Expression defaultValue) {
-    this._parameter = becomeParentOf(parameter);
-    this._defaultValue = becomeParentOf(defaultValue);
+  DefaultFormalParameter(NormalFormalParameter parameter, this.kind,
+      this.separator, Expression defaultValue) {
+    _parameter = becomeParentOf(parameter);
+    _defaultValue = becomeParentOf(defaultValue);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this);
-
-  @override
   Token get beginToken => _parameter.beginToken;
 
   /**
@@ -6145,6 +6363,15 @@
    */
   Expression get defaultValue => _defaultValue;
 
+  /**
+   * Set the expression computing the default value for the parameter to the given expression.
+   *
+   * @param expression the expression computing the default value for the parameter
+   */
+  void set defaultValue(Expression expression) {
+    _defaultValue = becomeParentOf(expression);
+  }
+
   @override
   Token get endToken {
     if (_defaultValue != null) {
@@ -6156,13 +6383,6 @@
   @override
   SimpleIdentifier get identifier => _parameter.identifier;
 
-  /**
-   * Return the formal parameter with which the default value is associated.
-   *
-   * @return the formal parameter with which the default value is associated
-   */
-  NormalFormalParameter get parameter => _parameter;
-
   @override
   bool get isConst => _parameter != null && _parameter.isConst;
 
@@ -6170,13 +6390,11 @@
   bool get isFinal => _parameter != null && _parameter.isFinal;
 
   /**
-   * Set the expression computing the default value for the parameter to the given expression.
+   * Return the formal parameter with which the default value is associated.
    *
-   * @param expression the expression computing the default value for the parameter
+   * @return the formal parameter with which the default value is associated
    */
-  void set defaultValue(Expression expression) {
-    _defaultValue = becomeParentOf(expression);
-  }
+  NormalFormalParameter get parameter => _parameter;
 
   /**
    * Set the formal parameter with which the default value is associated to the given parameter.
@@ -6188,6 +6406,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_parameter, visitor);
     safelyVisitChild(_defaultValue, visitor);
@@ -6211,9 +6432,7 @@
 
   @override
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    // If result is already true, skip.
     if (!_result) {
-      // Set result to true if isDeferred() is true
       if (node.isDeferred) {
         _result = true;
       }
@@ -6240,7 +6459,7 @@
    * The element associated with this directive, or `null` if the AST structure has not been
    * resolved or if this directive could not be resolved.
    */
-  Element _element;
+  Element element;
 
   /**
    * Initialize a newly create directive.
@@ -6248,16 +6467,8 @@
    * @param comment the documentation comment associated with this directive
    * @param metadata the annotations associated with the directive
    */
-  Directive(Comment comment, List<Annotation> metadata) : super(comment, metadata);
-
-  /**
-   * Return the element associated with this directive, or `null` if the AST structure has not
-   * been resolved or if this directive could not be resolved. Examples of the latter case include a
-   * directive that contains an invalid URL or a URL that does not exist.
-   *
-   * @return the element associated with this directive
-   */
-  Element get element => _element;
+  Directive(Comment comment, List<Annotation> metadata)
+      : super(comment, metadata);
 
   /**
    * Return the token representing the keyword that introduces this directive ('import', 'export',
@@ -6266,15 +6477,6 @@
    * @return the token representing the keyword that introduces this directive
    */
   Token get keyword;
-
-  /**
-   * Set the element associated with this directive to the given element.
-   *
-   * @param element the element associated with this directive
-   */
-  void set element(Element element) {
-    this._element = element;
-  }
 }
 
 /**
@@ -6304,7 +6506,7 @@
   /**
    * The left parenthesis.
    */
-  Token _leftParenthesis;
+  Token leftParenthesis;
 
   /**
    * The condition that determines when the loop will terminate.
@@ -6314,7 +6516,7 @@
   /**
    * The right parenthesis.
    */
-  Token _rightParenthesis;
+  Token rightParenthesis;
 
   /**
    * The semicolon terminating the statement.
@@ -6332,17 +6534,14 @@
    * @param rightParenthesis the right parenthesis
    * @param semicolon the semicolon terminating the statement
    */
-  DoStatement(this.doKeyword, Statement body, this.whileKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, this.semicolon) {
-    this._body = becomeParentOf(body);
-    this._leftParenthesis = leftParenthesis;
-    this._condition = becomeParentOf(condition);
-    this._rightParenthesis = rightParenthesis;
+  DoStatement(this.doKeyword, Statement body, this.whileKeyword,
+      this.leftParenthesis, Expression condition, this.rightParenthesis,
+      this.semicolon) {
+    _body = becomeParentOf(body);
+    _condition = becomeParentOf(condition);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitDoStatement(this);
-
-  @override
   Token get beginToken => doKeyword;
 
   /**
@@ -6353,30 +6552,6 @@
   Statement get body => _body;
 
   /**
-   * Return the condition that determines when the loop will terminate.
-   *
-   * @return the condition that determines when the loop will terminate
-   */
-  Expression get condition => _condition;
-
-  @override
-  Token get endToken => semicolon;
-
-  /**
-   * Return the left parenthesis.
-   *
-   * @return the left parenthesis
-   */
-  Token get leftParenthesis => _leftParenthesis;
-
-  /**
-   * Return the right parenthesis.
-   *
-   * @return the right parenthesis
-   */
-  Token get rightParenthesis => _rightParenthesis;
-
-  /**
    * Set the body of the loop to the given statement.
    *
    * @param statement the body of the loop
@@ -6386,6 +6561,13 @@
   }
 
   /**
+   * Return the condition that determines when the loop will terminate.
+   *
+   * @return the condition that determines when the loop will terminate
+   */
+  Expression get condition => _condition;
+
+  /**
    * Set the condition that determines when the loop will terminate to the given expression.
    *
    * @param expression the condition that determines when the loop will terminate
@@ -6394,23 +6576,11 @@
     _condition = becomeParentOf(expression);
   }
 
-  /**
-   * Set the left parenthesis to the given token.
-   *
-   * @param parenthesis the left parenthesis
-   */
-  void set leftParenthesis(Token parenthesis) {
-    _leftParenthesis = parenthesis;
-  }
+  @override
+  Token get endToken => semicolon;
 
-  /**
-   * Set the right parenthesis to the given token.
-   *
-   * @param parenthesis the right parenthesis
-   */
-  void set rightParenthesis(Token parenthesis) {
-    _rightParenthesis = parenthesis;
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitDoStatement(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -6451,15 +6621,15 @@
   DoubleLiteral(this.literal, this.value);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this);
-
-  @override
   Token get beginToken => literal;
 
   @override
   Token get endToken => literal;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -6493,26 +6663,25 @@
       return null;
     }
     // try to get Element from node
-    {
-      Element nodeElement = locate(node);
-      if (nodeElement != null) {
-        return nodeElement;
-      }
+    Element nodeElement = locate(node);
+    if (nodeElement != null) {
+      return nodeElement;
     }
-    // try to get Angular specific Element
-    {
-      Element element = null;
-      if (element != null) {
-        return element;
-      }
-    }
-    // try to get Polymer specific Element
-    {
-      Element element = null;
-      if (element != null) {
-        return element;
-      }
-    }
+    // TODO(brianwilkerson) Implement or delete the code below.
+//    // try to get Angular specific Element
+//    {
+//      Element element = null;
+//      if (element != null) {
+//        return element;
+//      }
+//    }
+//    // try to get Polymer specific Element
+//    {
+//      Element element = null;
+//      if (element != null) {
+//        return element;
+//      }
+//    }
     // no Element
     return null;
   }
@@ -6526,7 +6695,8 @@
   Element visitAnnotation(Annotation node) => node.element;
 
   @override
-  Element visitAssignmentExpression(AssignmentExpression node) => node.bestElement;
+  Element visitAssignmentExpression(AssignmentExpression node) =>
+      node.bestElement;
 
   @override
   Element visitBinaryExpression(BinaryExpression node) => node.bestElement;
@@ -6538,7 +6708,8 @@
   Element visitCompilationUnit(CompilationUnit node) => node.element;
 
   @override
-  Element visitConstructorDeclaration(ConstructorDeclaration node) => node.element;
+  Element visitConstructorDeclaration(ConstructorDeclaration node) =>
+      node.element;
 
   @override
   Element visitFunctionDeclaration(FunctionDeclaration node) => node.element;
@@ -6549,11 +6720,13 @@
     // Type name in Annotation
     if (parent is Annotation) {
       Annotation annotation = parent;
-      if (identical(annotation.name, node) && annotation.constructorName == null) {
+      if (identical(annotation.name, node) &&
+          annotation.constructorName == null) {
         return annotation.element;
       }
     }
-    // Extra work to map Constructor Declarations to their associated Constructor Elements
+    // Extra work to map Constructor Declarations to their associated
+    // Constructor Elements
     if (parent is ConstructorDeclaration) {
       ConstructorDeclaration decl = parent;
       Identifier returnType = decl.returnType;
@@ -6587,7 +6760,8 @@
   Element visitIndexExpression(IndexExpression node) => node.bestElement;
 
   @override
-  Element visitInstanceCreationExpression(InstanceCreationExpression node) => node.staticElement;
+  Element visitInstanceCreationExpression(InstanceCreationExpression node) =>
+      node.staticElement;
 
   @override
   Element visitLibraryDirective(LibraryDirective node) => node.element;
@@ -6596,7 +6770,8 @@
   Element visitMethodDeclaration(MethodDeclaration node) => node.element;
 
   @override
-  Element visitMethodInvocation(MethodInvocation node) => node.methodName.bestElement;
+  Element visitMethodInvocation(MethodInvocation node) =>
+      node.methodName.bestElement;
 
   @override
   Element visitPostfixExpression(PostfixExpression node) => node.bestElement;
@@ -6643,15 +6818,15 @@
   EmptyFunctionBody(this.semicolon);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this);
-
-  @override
   Token get beginToken => semicolon;
 
   @override
   Token get endToken => semicolon;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // Empty function bodies have no children.
   }
@@ -6679,15 +6854,15 @@
   EmptyStatement(this.semicolon);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitEmptyStatement(this);
-
-  @override
   Token get beginToken => semicolon;
 
   @override
   Token get endToken => semicolon;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitEmptyStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -6710,19 +6885,22 @@
    * @param metadata the annotations associated with this declaration
    * @param name the name of the constant
    */
-  EnumConstantDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifier name) : super(comment, metadata) {
-    this._name = becomeParentOf(name);
+  EnumConstantDeclaration(Comment comment, List<Annotation> metadata,
+      SimpleIdentifier name)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this);
-
-  @override
-  FieldElement get element => _name == null ? null : (_name.staticElement as FieldElement);
+  FieldElement get element =>
+      _name == null ? null : (_name.staticElement as FieldElement);
 
   @override
   Token get endToken => _name.endToken;
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
+
   /**
    * Return the name of the constant.
    *
@@ -6736,11 +6914,11 @@
    * @param name the name of the constant
    */
   void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
-  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
+  accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -6794,15 +6972,14 @@
    * @param constants the enumeration constants being declared
    * @param rightBracket the right curly bracket
    */
-  EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, SimpleIdentifier name, this.leftBracket, List<EnumConstantDeclaration> constants, this.rightBracket) : super(comment, metadata) {
-    this._constants = new NodeList<EnumConstantDeclaration>(this);
-    this._name = becomeParentOf(name);
-    this._constants.addAll(constants);
+  EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword,
+      SimpleIdentifier name, this.leftBracket,
+      List<EnumConstantDeclaration> constants, this.rightBracket)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
+    _constants = new NodeList<EnumConstantDeclaration>(this, constants);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this);
-
   /**
    * Return the enumeration constants being declared.
    *
@@ -6811,11 +6988,15 @@
   NodeList<EnumConstantDeclaration> get constants => _constants;
 
   @override
-  ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
+  ClassElement get element =>
+      _name != null ? (_name.staticElement as ClassElement) : null;
 
   @override
   Token get endToken => rightBracket;
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata => keyword;
+
   /**
    * Return the name of the enumeration.
    *
@@ -6829,11 +7010,11 @@
    * @param name the name of the enumeration
    */
   void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
-  Token get firstTokenAfterCommentAndMetadata => keyword;
+  accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -6847,7 +7028,8 @@
  * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
  */
 class EphemeralIdentifier extends SimpleIdentifier {
-  EphemeralIdentifier(AstNode parent, int location) : super(new StringToken(TokenType.IDENTIFIER, "", location)) {
+  EphemeralIdentifier(AstNode parent, int location)
+      : super(new StringToken(TokenType.IDENTIFIER, "", location)) {
     parent.becomeParentOf(this);
   }
 }
@@ -6871,24 +7053,25 @@
    * @param combinators the combinators used to control which names are exported
    * @param semicolon the semicolon terminating the directive
    */
-  ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, combinators, semicolon);
-
-  @override
-  accept(AstVisitor visitor) => visitor.visitExportDirective(this);
+  ExportDirective(Comment comment, List<Annotation> metadata, Token keyword,
+      StringLiteral libraryUri, List<Combinator> combinators, Token semicolon)
+      : super(comment, metadata, keyword, libraryUri, combinators, semicolon);
 
   @override
   ExportElement get element => super.element as ExportElement;
 
   @override
   LibraryElement get uriElement {
-    ExportElement exportElement = element;
-    if (exportElement != null) {
-      return exportElement.exportedLibrary;
+    if (element != null) {
+      return element.exportedLibrary;
     }
     return null;
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitExportDirective(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     combinators.accept(visitor);
@@ -6957,6 +7140,14 @@
   }
 
   /**
+   * Return `true` if this expression is syntactically valid for the LHS of an
+   * [AssignmentExpression].
+   *
+   * @return `true` if this expression matches the `assignableExpression` production
+   */
+  bool get isAssignable => false;
+
+  /**
    * Return the precedence of this expression. The precedence is a positive integer value that
    * defines how the source code is parsed into an AST. For example `a * b + c` is parsed as
    * `(a * b) + c` because the precedence of `*` is greater than the precedence of
@@ -7042,14 +7233,6 @@
     }
     return null;
   }
-
-  /**
-   * Return `true` if this expression is syntactically valid for the LHS of an
-   * [AssignmentExpression].
-   *
-   * @return `true` if this expression matches the `assignableExpression` production
-   */
-  bool get isAssignable => false;
 }
 
 /**
@@ -7091,14 +7274,12 @@
    * @param expression the expression representing the body of the function
    * @param semicolon the semicolon terminating the statement
    */
-  ExpressionFunctionBody(this.keyword, this.functionDefinition, Expression expression, this.semicolon) {
-    this._expression = becomeParentOf(expression);
+  ExpressionFunctionBody(this.keyword, this.functionDefinition,
+      Expression expression, this.semicolon) {
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
-
-  @override
   Token get beginToken => functionDefinition;
 
   @override
@@ -7116,22 +7297,25 @@
    */
   Expression get expression => _expression;
 
-  @override
-  bool get isAsynchronous => keyword != null;
-
-  @override
-  bool get isSynchronous => keyword == null;
-
   /**
    * Set the expression representing the body of the function to the given expression.
    *
    * @param expression the expression representing the body of the function
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  bool get isAsynchronous => keyword != null;
+
+  @override
+  bool get isSynchronous => keyword == null;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
@@ -7164,13 +7348,10 @@
    * @param semicolon the semicolon terminating the statement
    */
   ExpressionStatement(Expression expression, this.semicolon) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitExpressionStatement(this);
-
-  @override
   Token get beginToken => _expression.beginToken;
 
   @override
@@ -7188,19 +7369,22 @@
    */
   Expression get expression => _expression;
 
-  @override
-  bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
-
   /**
    * Set the expression that comprises the statement to the given expression.
    *
    * @param expression the expression that comprises the statement
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitExpressionStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
@@ -7233,13 +7417,10 @@
    * @param superclass the name of the class that is being extended
    */
   ExtendsClause(this.keyword, TypeName superclass) {
-    this._superclass = becomeParentOf(superclass);
+    _superclass = becomeParentOf(superclass);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitExtendsClause(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -7262,6 +7443,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitExtendsClause(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_superclass, visitor);
   }
@@ -7301,14 +7485,13 @@
    * @param fieldList the fields being declared
    * @param semicolon the semicolon terminating the declaration
    */
-  FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeyword, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata) {
-    this._fieldList = becomeParentOf(fieldList);
+  FieldDeclaration(Comment comment, List<Annotation> metadata,
+      this.staticKeyword, VariableDeclarationList fieldList, this.semicolon)
+      : super(comment, metadata) {
+    _fieldList = becomeParentOf(fieldList);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this);
-
-  @override
   Element get element => null;
 
   @override
@@ -7322,25 +7505,12 @@
   VariableDeclarationList get fields => _fieldList;
 
   /**
-   * Return `true` if the fields are static.
-   *
-   * @return `true` if the fields are declared to be static
-   */
-  bool get isStatic => staticKeyword != null;
-
-  /**
    * Set the fields being declared to the given list of variables.
    *
    * @param fieldList the fields being declared
    */
   void set fields(VariableDeclarationList fieldList) {
-    this._fieldList = becomeParentOf(fieldList);
-  }
-
-  @override
-  void visitChildren(AstVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(_fieldList, visitor);
+    _fieldList = becomeParentOf(fieldList);
   }
 
   @override
@@ -7350,6 +7520,22 @@
     }
     return _fieldList.beginToken;
   }
+
+  /**
+   * Return `true` if the fields are static.
+   *
+   * @return `true` if the fields are declared to be static
+   */
+  bool get isStatic => staticKeyword != null;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(_fieldList, visitor);
+  }
 }
 
 /**
@@ -7402,15 +7588,15 @@
    * @param parameters the parameters of the function-typed parameter, or `null` if this is
    *          not a function-typed field formal parameter
    */
-  FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, FormalParameterList parameters) : super(comment, metadata, identifier) {
-    this._type = becomeParentOf(type);
-    this._parameters = becomeParentOf(parameters);
+  FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword,
+      TypeName type, this.thisToken, this.period, SimpleIdentifier identifier,
+      FormalParameterList parameters)
+      : super(comment, metadata, identifier) {
+    _type = becomeParentOf(type);
+    _parameters = becomeParentOf(parameters);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this);
-
-  @override
   Token get beginToken {
     if (keyword != null) {
       return keyword;
@@ -7423,6 +7609,14 @@
   @override
   Token get endToken => identifier.endToken;
 
+  @override
+  bool get isConst =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
+
+  @override
+  bool get isFinal =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
+
   /**
    * Return the parameters of the function-typed parameter, or `null` if this is not a
    * function-typed field formal parameter.
@@ -7432,6 +7626,15 @@
   FormalParameterList get parameters => _parameters;
 
   /**
+   * Set the parameters of the function-typed parameter to the given parameters.
+   *
+   * @param parameters the parameters of the function-typed parameter
+   */
+  void set parameters(FormalParameterList parameters) {
+    _parameters = becomeParentOf(parameters);
+  }
+
+  /**
    * Return the name of the declared type of the parameter, or `null` if the parameter does
    * not have a declared type. Note that if this is a function-typed field formal parameter this is
    * the return type of the function.
@@ -7440,21 +7643,6 @@
    */
   TypeName get type => _type;
 
-  @override
-  bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
-
-  @override
-  bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
-
-  /**
-   * Set the parameters of the function-typed parameter to the given parameters.
-   *
-   * @param parameters the parameters of the function-typed parameter
-   */
-  void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
-  }
-
   /**
    * Set the name of the declared type of the parameter to the given type name.
    *
@@ -7465,6 +7653,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_type, visitor);
@@ -7540,10 +7731,12 @@
    * @param rightParenthesis the right parenthesis
    * @param body the body of the loop
    */
-  ForEachStatement.con1(this.awaitKeyword, this.forKeyword, this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Statement body) {
-    this._loopVariable = becomeParentOf(loopVariable);
-    this._iterable = becomeParentOf(iterator);
-    this._body = becomeParentOf(body);
+  ForEachStatement.con1(this.awaitKeyword, this.forKeyword,
+      this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword,
+      Expression iterator, this.rightParenthesis, Statement body) {
+    _loopVariable = becomeParentOf(loopVariable);
+    _iterable = becomeParentOf(iterator);
+    _body = becomeParentOf(body);
   }
 
   /**
@@ -7557,16 +7750,15 @@
    * @param rightParenthesis the right parenthesis
    * @param body the body of the loop
    */
-  ForEachStatement.con2(this.awaitKeyword, this.forKeyword, this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Statement body) {
-    this._identifier = becomeParentOf(identifier);
-    this._iterable = becomeParentOf(iterator);
-    this._body = becomeParentOf(body);
+  ForEachStatement.con2(this.awaitKeyword, this.forKeyword,
+      this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword,
+      Expression iterator, this.rightParenthesis, Statement body) {
+    _identifier = becomeParentOf(identifier);
+    _iterable = becomeParentOf(iterator);
+    _body = becomeParentOf(body);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
-
-  @override
   Token get beginToken => forKeyword;
 
   /**
@@ -7576,6 +7768,15 @@
    */
   Statement get body => _body;
 
+  /**
+   * Set the body of the loop to the given block.
+   *
+   * @param body the body of the loop
+   */
+  void set body(Statement body) {
+    _body = becomeParentOf(body);
+  }
+
   @override
   Token get endToken => _body.endToken;
 
@@ -7587,39 +7788,22 @@
   SimpleIdentifier get identifier => _identifier;
 
   /**
-   * Return the expression evaluated to produce the iterator.
-   *
-   * @return the expression evaluated to produce the iterator
-   */
-  Expression get iterable => _iterable;
-
-  /**
-   * Return the declaration of the loop variable, or `null` if the loop variable is a simple
-   * identifier.
-   *
-   * @return the declaration of the loop variable
-   */
-  DeclaredIdentifier get loopVariable => _loopVariable;
-
-  /**
-   * Set the body of the loop to the given block.
-   *
-   * @param body the body of the loop
-   */
-  void set body(Statement body) {
-    this._body = becomeParentOf(body);
-  }
-
-  /**
    * Set the loop variable to the given variable.
    *
    * @param identifier the loop variable
    */
   void set identifier(SimpleIdentifier identifier) {
-    this._identifier = becomeParentOf(identifier);
+    _identifier = becomeParentOf(identifier);
   }
 
   /**
+   * Return the expression evaluated to produce the iterator.
+   *
+   * @return the expression evaluated to produce the iterator
+   */
+  Expression get iterable => _iterable;
+
+  /**
    * Set the expression evaluated to produce the iterator to the given expression.
    *
    * @param expression the expression evaluated to produce the iterator
@@ -7629,6 +7813,22 @@
   }
 
   /**
+   * Return the expression evaluated to produce the iterator.
+   *
+   * Deprecated, use [iterable] instead.
+   */
+  @deprecated
+  Expression get iterator => iterable;
+
+  /**
+   * Return the declaration of the loop variable, or `null` if the loop variable is a simple
+   * identifier.
+   *
+   * @return the declaration of the loop variable
+   */
+  DeclaredIdentifier get loopVariable => _loopVariable;
+
+  /**
    * Set the declaration of the loop variable to the given variable.
    *
    * @param variable the declaration of the loop variable
@@ -7638,6 +7838,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_loopVariable, visitor);
     safelyVisitChild(_identifier, visitor);
@@ -7647,6 +7850,170 @@
 }
 
 /**
+ * The abstract class `FormalParameter` defines the behavior of objects representing a
+ * parameter to a function.
+ *
+ * <pre>
+ * formalParameter ::=
+ *     [NormalFormalParameter]
+ *   | [DefaultFormalParameter]
+ * </pre>
+ */
+abstract class FormalParameter extends AstNode {
+  /**
+   * Return the element representing this parameter, or `null` if this parameter has not been
+   * resolved.
+   *
+   * @return the element representing this parameter
+   */
+  ParameterElement get element {
+    SimpleIdentifier identifier = this.identifier;
+    if (identifier == null) {
+      return null;
+    }
+    return identifier.staticElement as ParameterElement;
+  }
+
+  /**
+   * Return the name of the parameter being declared.
+   *
+   * @return the name of the parameter being declared
+   */
+  SimpleIdentifier get identifier;
+
+  /**
+   * Return `true` if this parameter was declared with the 'const' modifier.
+   *
+   * @return `true` if this parameter was declared with the 'const' modifier
+   */
+  bool get isConst;
+
+  /**
+   * Return `true` if this parameter was declared with the 'final' modifier. Parameters that
+   * are declared with the 'const' modifier will return `false` even though they are
+   * implicitly final.
+   *
+   * @return `true` if this parameter was declared with the 'final' modifier
+   */
+  bool get isFinal;
+
+  /**
+   * Return the kind of this parameter.
+   *
+   * @return the kind of this parameter
+   */
+  ParameterKind get kind;
+}
+
+/**
+ * Instances of the class `FormalParameterList` represent the formal parameter list of a
+ * method declaration, function declaration, or function type alias.
+ *
+ * While the grammar requires all optional formal parameters to follow all of the normal formal
+ * parameters and at most one grouping of optional formal parameters, this class does not enforce
+ * those constraints. All parameters are flattened into a single list, which can have any or all
+ * kinds of parameters (normal, named, and positional) in any order.
+ *
+ * <pre>
+ * formalParameterList ::=
+ *     '(' ')'
+ *   | '(' normalFormalParameters (',' optionalFormalParameters)? ')'
+ *   | '(' optionalFormalParameters ')'
+ *
+ * normalFormalParameters ::=
+ *     [NormalFormalParameter] (',' [NormalFormalParameter])*
+ *
+ * optionalFormalParameters ::=
+ *     optionalPositionalFormalParameters
+ *   | namedFormalParameters
+ *
+ * optionalPositionalFormalParameters ::=
+ *     '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
+ *
+ * namedFormalParameters ::=
+ *     '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
+ * </pre>
+ */
+class FormalParameterList extends AstNode {
+  /**
+   * The left parenthesis.
+   */
+  Token leftParenthesis;
+
+  /**
+   * The parameters associated with the method.
+   */
+  NodeList<FormalParameter> _parameters;
+
+  /**
+   * The left square bracket ('[') or left curly brace ('{') introducing the optional parameters, or
+   * `null` if there are no optional parameters.
+   */
+  Token leftDelimiter;
+
+  /**
+   * The right square bracket (']') or right curly brace ('}') introducing the optional parameters,
+   * or `null` if there are no optional parameters.
+   */
+  Token rightDelimiter;
+
+  /**
+   * The right parenthesis.
+   */
+  Token rightParenthesis;
+
+  /**
+   * Initialize a newly created parameter list.
+   *
+   * @param leftParenthesis the left parenthesis
+   * @param parameters the parameters associated with the method
+   * @param leftDelimiter the left delimiter introducing the optional parameters
+   * @param rightDelimiter the right delimiter introducing the optional parameters
+   * @param rightParenthesis the right parenthesis
+   */
+  FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters,
+      this.leftDelimiter, this.rightDelimiter, this.rightParenthesis) {
+    _parameters = new NodeList<FormalParameter>(this, parameters);
+  }
+
+  @override
+  Token get beginToken => leftParenthesis;
+
+  @override
+  Token get endToken => rightParenthesis;
+
+  /**
+   * Return an array containing the elements representing the parameters in this list. The array
+   * will contain `null`s if the parameters in this list have not been resolved.
+   *
+   * @return the elements representing the parameters in this list
+   */
+  List<ParameterElement> get parameterElements {
+    int count = _parameters.length;
+    List<ParameterElement> types = new List<ParameterElement>(count);
+    for (int i = 0; i < count; i++) {
+      types[i] = _parameters[i].element;
+    }
+    return types;
+  }
+
+  /**
+   * Return the parameters associated with the method.
+   *
+   * @return the parameters associated with the method
+   */
+  NodeList<FormalParameter> get parameters => _parameters;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitFormalParameterList(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _parameters.accept(visitor);
+  }
+}
+
+/**
  * Instances of the class `ForStatement` represent a for statement.
  *
  * <pre>
@@ -7731,19 +8098,18 @@
    * @param rightParenthesis the right parenthesis
    * @param body the body of the loop
    */
-  ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList variableList, Expression initialization, this.leftSeparator, Expression condition, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statement body) {
-    this._updaters = new NodeList<Expression>(this);
-    this._variableList = becomeParentOf(variableList);
-    this._initialization = becomeParentOf(initialization);
-    this._condition = becomeParentOf(condition);
-    this._updaters.addAll(updaters);
-    this._body = becomeParentOf(body);
+  ForStatement(this.forKeyword, this.leftParenthesis,
+      VariableDeclarationList variableList, Expression initialization,
+      this.leftSeparator, Expression condition, this.rightSeparator,
+      List<Expression> updaters, this.rightParenthesis, Statement body) {
+    _variableList = becomeParentOf(variableList);
+    _initialization = becomeParentOf(initialization);
+    _condition = becomeParentOf(condition);
+    _updaters = new NodeList<Expression>(this, updaters);
+    _body = becomeParentOf(body);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitForStatement(this);
-
-  @override
   Token get beginToken => forKeyword;
 
   /**
@@ -7754,6 +8120,15 @@
   Statement get body => _body;
 
   /**
+   * Set the body of the loop to the given statement.
+   *
+   * @param body the body of the loop
+   */
+  void set body(Statement body) {
+    _body = becomeParentOf(body);
+  }
+
+  /**
    * Return the condition used to determine when to terminate the loop, or `null` if there is
    * no condition.
    *
@@ -7761,6 +8136,15 @@
    */
   Expression get condition => _condition;
 
+  /**
+   * Set the condition used to determine when to terminate the loop to the given expression.
+   *
+   * @param expression the condition used to determine when to terminate the loop
+   */
+  void set condition(Expression expression) {
+    _condition = becomeParentOf(expression);
+  }
+
   @override
   Token get endToken => _body.endToken;
 
@@ -7772,6 +8156,15 @@
   Expression get initialization => _initialization;
 
   /**
+   * Set the initialization expression to the given expression.
+   *
+   * @param initialization the initialization expression
+   */
+  void set initialization(Expression initialization) {
+    _initialization = becomeParentOf(initialization);
+  }
+
+  /**
    * Return the list of expressions run after each execution of the loop body.
    *
    * @return the list of expressions run after each execution of the loop body
@@ -7786,42 +8179,18 @@
   VariableDeclarationList get variables => _variableList;
 
   /**
-   * Set the body of the loop to the given statement.
-   *
-   * @param body the body of the loop
-   */
-  void set body(Statement body) {
-    this._body = becomeParentOf(body);
-  }
-
-  /**
-   * Set the condition used to determine when to terminate the loop to the given expression.
-   *
-   * @param expression the condition used to determine when to terminate the loop
-   */
-  void set condition(Expression expression) {
-    _condition = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the initialization expression to the given expression.
-   *
-   * @param initialization the initialization expression
-   */
-  void set initialization(Expression initialization) {
-    this._initialization = becomeParentOf(initialization);
-  }
-
-  /**
    * Set the declaration of the loop variables to the given parameter.
    *
    * @param variableList the declaration of the loop variables
    */
   void set variables(VariableDeclarationList variableList) {
-    this._variableList = becomeParentOf(variableList);
+    _variableList = becomeParentOf(variableList);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitForStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_variableList, visitor);
     safelyVisitChild(_initialization, visitor);
@@ -7832,244 +8201,6 @@
 }
 
 /**
- * The abstract class `FormalParameter` defines the behavior of objects representing a
- * parameter to a function.
- *
- * <pre>
- * formalParameter ::=
- *     [NormalFormalParameter]
- *   | [DefaultFormalParameter]
- * </pre>
- */
-abstract class FormalParameter extends AstNode {
-  /**
-   * Return the element representing this parameter, or `null` if this parameter has not been
-   * resolved.
-   *
-   * @return the element representing this parameter
-   */
-  ParameterElement get element {
-    SimpleIdentifier identifier = this.identifier;
-    if (identifier == null) {
-      return null;
-    }
-    return identifier.staticElement as ParameterElement;
-  }
-
-  /**
-   * Return the name of the parameter being declared.
-   *
-   * @return the name of the parameter being declared
-   */
-  SimpleIdentifier get identifier;
-
-  /**
-   * Return the kind of this parameter.
-   *
-   * @return the kind of this parameter
-   */
-  ParameterKind get kind;
-
-  /**
-   * Return `true` if this parameter was declared with the 'const' modifier.
-   *
-   * @return `true` if this parameter was declared with the 'const' modifier
-   */
-  bool get isConst;
-
-  /**
-   * Return `true` if this parameter was declared with the 'final' modifier. Parameters that
-   * are declared with the 'const' modifier will return `false` even though they are
-   * implicitly final.
-   *
-   * @return `true` if this parameter was declared with the 'final' modifier
-   */
-  bool get isFinal;
-}
-
-/**
- * Instances of the class `FormalParameterList` represent the formal parameter list of a
- * method declaration, function declaration, or function type alias.
- *
- * While the grammar requires all optional formal parameters to follow all of the normal formal
- * parameters and at most one grouping of optional formal parameters, this class does not enforce
- * those constraints. All parameters are flattened into a single list, which can have any or all
- * kinds of parameters (normal, named, and positional) in any order.
- *
- * <pre>
- * formalParameterList ::=
- *     '(' ')'
- *   | '(' normalFormalParameters (',' optionalFormalParameters)? ')'
- *   | '(' optionalFormalParameters ')'
- *
- * normalFormalParameters ::=
- *     [NormalFormalParameter] (',' [NormalFormalParameter])*
- *
- * optionalFormalParameters ::=
- *     optionalPositionalFormalParameters
- *   | namedFormalParameters
- *
- * optionalPositionalFormalParameters ::=
- *     '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
- *
- * namedFormalParameters ::=
- *     '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
- * </pre>
- */
-class FormalParameterList extends AstNode {
-  /**
-   * The left parenthesis.
-   */
-  Token _leftParenthesis;
-
-  /**
-   * The parameters associated with the method.
-   */
-  NodeList<FormalParameter> _parameters;
-
-  /**
-   * The left square bracket ('[') or left curly brace ('{') introducing the optional parameters, or
-   * `null` if there are no optional parameters.
-   */
-  Token _leftDelimiter;
-
-  /**
-   * The right square bracket (']') or right curly brace ('}') introducing the optional parameters,
-   * or `null` if there are no optional parameters.
-   */
-  Token _rightDelimiter;
-
-  /**
-   * The right parenthesis.
-   */
-  Token _rightParenthesis;
-
-  /**
-   * Initialize a newly created parameter list.
-   *
-   * @param leftParenthesis the left parenthesis
-   * @param parameters the parameters associated with the method
-   * @param leftDelimiter the left delimiter introducing the optional parameters
-   * @param rightDelimiter the right delimiter introducing the optional parameters
-   * @param rightParenthesis the right parenthesis
-   */
-  FormalParameterList(Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) {
-    this._parameters = new NodeList<FormalParameter>(this);
-    this._leftParenthesis = leftParenthesis;
-    this._parameters.addAll(parameters);
-    this._leftDelimiter = leftDelimiter;
-    this._rightDelimiter = rightDelimiter;
-    this._rightParenthesis = rightParenthesis;
-  }
-
-  @override
-  accept(AstVisitor visitor) => visitor.visitFormalParameterList(this);
-
-  @override
-  Token get beginToken => _leftParenthesis;
-
-  @override
-  Token get endToken => _rightParenthesis;
-
-  /**
-   * Return the left square bracket ('[') or left curly brace ('{') introducing the optional
-   * parameters, or `null` if there are no optional parameters.
-   *
-   * @return the left square bracket ('[') or left curly brace ('{') introducing the optional
-   *         parameters
-   */
-  Token get leftDelimiter => _leftDelimiter;
-
-  /**
-   * Return the left parenthesis.
-   *
-   * @return the left parenthesis
-   */
-  Token get leftParenthesis => _leftParenthesis;
-
-  /**
-   * Return an array containing the elements representing the parameters in this list. The array
-   * will contain `null`s if the parameters in this list have not been resolved.
-   *
-   * @return the elements representing the parameters in this list
-   */
-  List<ParameterElement> get parameterElements {
-    int count = _parameters.length;
-    List<ParameterElement> types = new List<ParameterElement>(count);
-    for (int i = 0; i < count; i++) {
-      types[i] = _parameters[i].element;
-    }
-    return types;
-  }
-
-  /**
-   * Return the parameters associated with the method.
-   *
-   * @return the parameters associated with the method
-   */
-  NodeList<FormalParameter> get parameters => _parameters;
-
-  /**
-   * Return the right square bracket (']') or right curly brace ('}') introducing the optional
-   * parameters, or `null` if there are no optional parameters.
-   *
-   * @return the right square bracket (']') or right curly brace ('}') introducing the optional
-   *         parameters
-   */
-  Token get rightDelimiter => _rightDelimiter;
-
-  /**
-   * Return the right parenthesis.
-   *
-   * @return the right parenthesis
-   */
-  Token get rightParenthesis => _rightParenthesis;
-
-  /**
-   * Set the left square bracket ('[') or left curly brace ('{') introducing the optional parameters
-   * to the given token.
-   *
-   * @param bracket the left delimiter introducing the optional parameters
-   */
-  void set leftDelimiter(Token bracket) {
-    _leftDelimiter = bracket;
-  }
-
-  /**
-   * Set the left parenthesis to the given token.
-   *
-   * @param parenthesis the left parenthesis
-   */
-  void set leftParenthesis(Token parenthesis) {
-    _leftParenthesis = parenthesis;
-  }
-
-  /**
-   * Set the right square bracket (']') or right curly brace ('}') introducing the optional
-   * parameters to the given token.
-   *
-   * @param bracket the right delimiter introducing the optional parameters
-   */
-  void set rightDelimiter(Token bracket) {
-    _rightDelimiter = bracket;
-  }
-
-  /**
-   * Set the right parenthesis to the given token.
-   *
-   * @param parenthesis the right parenthesis
-   */
-  void set rightParenthesis(Token parenthesis) {
-    _rightParenthesis = parenthesis;
-  }
-
-  @override
-  void visitChildren(AstVisitor visitor) {
-    _parameters.accept(visitor);
-  }
-}
-
-/**
  * The abstract class `FunctionBody` defines the behavior common to objects representing the
  * body of a function or method.
  *
@@ -8082,21 +8213,6 @@
  */
 abstract class FunctionBody extends AstNode {
   /**
-   * Return the token representing the 'async' or 'sync' keyword, or `null` if there is no
-   * such keyword.
-   *
-   * @return the token representing the 'async' or 'sync' keyword
-   */
-  Token get keyword => null;
-
-  /**
-   * Return the star following the 'async' or 'sync' keyword, or `null` if there is no star.
-   *
-   * @return the star following the 'async' or 'sync' keyword
-   */
-  Token get star => null;
-
-  /**
    * Return `true` if this function body is asynchronous.
    *
    * @return `true` if this function body is asynchronous
@@ -8116,6 +8232,21 @@
    * @return `true` if this function body is synchronous
    */
   bool get isSynchronous => true;
+
+  /**
+   * Return the token representing the 'async' or 'sync' keyword, or `null` if there is no
+   * such keyword.
+   *
+   * @return the token representing the 'async' or 'sync' keyword
+   */
+  Token get keyword => null;
+
+  /**
+   * Return the star following the 'async' or 'sync' keyword, or `null` if there is no star.
+   *
+   * @return the star following the 'async' or 'sync' keyword
+   */
+  Token get star => null;
 }
 
 /**
@@ -8169,21 +8300,36 @@
    * @param name the name of the function
    * @param functionExpression the function expression being wrapped
    */
-  FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) : super(comment, metadata) {
-    this._returnType = becomeParentOf(returnType);
-    this._name = becomeParentOf(name);
-    this._functionExpression = becomeParentOf(functionExpression);
+  FunctionDeclaration(Comment comment, List<Annotation> metadata,
+      this.externalKeyword, TypeName returnType, this.propertyKeyword,
+      SimpleIdentifier name, FunctionExpression functionExpression)
+      : super(comment, metadata) {
+    _returnType = becomeParentOf(returnType);
+    _name = becomeParentOf(name);
+    _functionExpression = becomeParentOf(functionExpression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this);
-
-  @override
-  ExecutableElement get element => _name != null ? (_name.staticElement as ExecutableElement) : null;
+  ExecutableElement get element =>
+      _name != null ? (_name.staticElement as ExecutableElement) : null;
 
   @override
   Token get endToken => _functionExpression.endToken;
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata {
+    if (externalKeyword != null) {
+      return externalKeyword;
+    } else if (_returnType != null) {
+      return _returnType.beginToken;
+    } else if (propertyKeyword != null) {
+      return propertyKeyword;
+    } else if (_name != null) {
+      return _name.beginToken;
+    }
+    return _functionExpression.beginToken;
+  }
+
   /**
    * Return the function expression being wrapped.
    *
@@ -8192,6 +8338,33 @@
   FunctionExpression get functionExpression => _functionExpression;
 
   /**
+   * Set the function expression being wrapped to the given function expression.
+   *
+   * @param functionExpression the function expression being wrapped
+   */
+  void set functionExpression(FunctionExpression functionExpression) {
+    _functionExpression = becomeParentOf(functionExpression);
+  }
+
+  /**
+   * Return `true` if this function declares a getter.
+   *
+   * @return `true` if this function declares a getter
+   */
+  bool get isGetter =>
+      propertyKeyword != null &&
+          (propertyKeyword as KeywordToken).keyword == Keyword.GET;
+
+  /**
+   * Return `true` if this function declares a setter.
+   *
+   * @return `true` if this function declares a setter
+   */
+  bool get isSetter =>
+      propertyKeyword != null &&
+          (propertyKeyword as KeywordToken).keyword == Keyword.SET;
+
+  /**
    * Return the name of the function, or `null` if the function is not named.
    *
    * @return the name of the function
@@ -8199,6 +8372,15 @@
   SimpleIdentifier get name => _name;
 
   /**
+   * Set the name of the function to the given identifier.
+   *
+   * @param identifier the name of the function
+   */
+  void set name(SimpleIdentifier identifier) {
+    _name = becomeParentOf(identifier);
+  }
+
+  /**
    * Return the return type of the function, or `null` if no return type was declared.
    *
    * @return the return type of the function
@@ -8206,68 +8388,24 @@
   TypeName get returnType => _returnType;
 
   /**
-   * Return `true` if this function declares a getter.
-   *
-   * @return `true` if this function declares a getter
-   */
-  bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.GET;
-
-  /**
-   * Return `true` if this function declares a setter.
-   *
-   * @return `true` if this function declares a setter
-   */
-  bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.SET;
-
-  /**
-   * Set the function expression being wrapped to the given function expression.
-   *
-   * @param functionExpression the function expression being wrapped
-   */
-  void set functionExpression(FunctionExpression functionExpression) {
-    this._functionExpression = becomeParentOf(functionExpression);
-  }
-
-  /**
-   * Set the name of the function to the given identifier.
-   *
-   * @param identifier the name of the function
-   */
-  void set name(SimpleIdentifier identifier) {
-    this._name = becomeParentOf(identifier);
-  }
-
-  /**
    * Set the return type of the function to the given name.
    *
    * @param returnType the return type of the function
    */
   void set returnType(TypeName returnType) {
-    this._returnType = becomeParentOf(returnType);
+    _returnType = becomeParentOf(returnType);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_returnType, visitor);
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_functionExpression, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata {
-    if (externalKeyword != null) {
-      return externalKeyword;
-    }
-    if (_returnType != null) {
-      return _returnType.beginToken;
-    } else if (propertyKeyword != null) {
-      return propertyKeyword;
-    } else if (_name != null) {
-      return _name.beginToken;
-    }
-    return _functionExpression.beginToken;
-  }
 }
 
 /**
@@ -8286,13 +8424,10 @@
    * @param functionDeclaration the the function declaration being wrapped
    */
   FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) {
-    this._functionDeclaration = becomeParentOf(functionDeclaration);
+    _functionDeclaration = becomeParentOf(functionDeclaration);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
-
-  @override
   Token get beginToken => _functionDeclaration.beginToken;
 
   @override
@@ -8311,10 +8446,13 @@
    * @param functionDeclaration the function declaration being wrapped
    */
   void set functionDeclaration(FunctionDeclaration functionDeclaration) {
-    this._functionDeclaration = becomeParentOf(functionDeclaration);
+    _functionDeclaration = becomeParentOf(functionDeclaration);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_functionDeclaration, visitor);
   }
@@ -8352,22 +8490,19 @@
    * @param body the body of the function
    */
   FunctionExpression(FormalParameterList parameters, FunctionBody body) {
-    this._parameters = becomeParentOf(parameters);
-    this._body = becomeParentOf(body);
+    _parameters = becomeParentOf(parameters);
+    _body = becomeParentOf(body);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFunctionExpression(this);
-
-  @override
   Token get beginToken {
     if (_parameters != null) {
       return _parameters.beginToken;
     } else if (_body != null) {
       return _body.beginToken;
     }
-    // This should never be reached because external functions must be named, hence either the body
-    // or the name should be non-null.
+    // This should never be reached because external functions must be named,
+    // hence either the body or the name should be non-null.
     throw new IllegalStateException("Non-external functions must have a body");
   }
 
@@ -8378,6 +8513,15 @@
    */
   FunctionBody get body => _body;
 
+  /**
+   * Set the body of the function to the given function body.
+   *
+   * @param functionBody the body of the function
+   */
+  void set body(FunctionBody functionBody) {
+    _body = becomeParentOf(functionBody);
+  }
+
   @override
   Token get endToken {
     if (_body != null) {
@@ -8385,8 +8529,8 @@
     } else if (_parameters != null) {
       return _parameters.endToken;
     }
-    // This should never be reached because external functions must be named, hence either the body
-    // or the name should be non-null.
+    // This should never be reached because external functions must be named,
+    // hence either the body or the name should be non-null.
     throw new IllegalStateException("Non-external functions must have a body");
   }
 
@@ -8397,28 +8541,22 @@
    */
   FormalParameterList get parameters => _parameters;
 
-  @override
-  int get precedence => 16;
-
-  /**
-   * Set the body of the function to the given function body.
-   *
-   * @param functionBody the body of the function
-   */
-  void set body(FunctionBody functionBody) {
-    _body = becomeParentOf(functionBody);
-  }
-
   /**
    * Set the parameters associated with the function to the given list of parameters.
    *
    * @param parameters the parameters associated with the function
    */
   void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
+    _parameters = becomeParentOf(parameters);
   }
 
   @override
+  int get precedence => 16;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitFunctionExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_parameters, visitor);
     safelyVisitChild(_body, visitor);
@@ -8458,7 +8596,7 @@
    * The element associated with the function being invoked based on propagated type information, or
    * `null` if the AST structure has not been resolved or the function could not be resolved.
    */
-  ExecutableElement _propagatedElement;
+  ExecutableElement propagatedElement;
 
   /**
    * Initialize a newly created function expression invocation.
@@ -8467,13 +8605,10 @@
    * @param argumentList the list of arguments to the method
    */
   FunctionExpressionInvocation(Expression function, ArgumentList argumentList) {
-    this._function = becomeParentOf(function);
-    this._argumentList = becomeParentOf(argumentList);
+    _function = becomeParentOf(function);
+    _argumentList = becomeParentOf(argumentList);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
-
   /**
    * Return the list of arguments to the method.
    *
@@ -8481,6 +8616,15 @@
    */
   ArgumentList get argumentList => _argumentList;
 
+  /**
+   * Set the list of arguments to the method to the given list.
+   *
+   * @param argumentList the list of arguments to the method
+   */
+  void set argumentList(ArgumentList argumentList) {
+    _argumentList = becomeParentOf(argumentList);
+  }
+
   @override
   Token get beginToken => _function.beginToken;
 
@@ -8510,46 +8654,20 @@
    */
   Expression get function => _function;
 
-  @override
-  int get precedence => 15;
-
-  /**
-   * Return the element associated with the function being invoked based on propagated type
-   * information, or `null` if the AST structure has not been resolved or the function could
-   * not be resolved. One common example of the latter case is an expression whose value can change
-   * over time.
-   *
-   * @return the element associated with the function being invoked
-   */
-  ExecutableElement get propagatedElement => _propagatedElement;
-
-  /**
-   * Set the list of arguments to the method to the given list.
-   *
-   * @param argumentList the list of arguments to the method
-   */
-  void set argumentList(ArgumentList argumentList) {
-    this._argumentList = becomeParentOf(argumentList);
-  }
-
   /**
    * Set the expression producing the function being invoked to the given expression.
    *
    * @param function the expression producing the function being invoked
    */
   void set function(Expression function) {
-    this._function = becomeParentOf(function);
+    _function = becomeParentOf(function);
   }
 
-  /**
-   * Set the element associated with the function being invoked based on propagated type information
-   * to the given element.
-   *
-   * @param element the element to be associated with the function being invoked
-   */
-  void set propagatedElement(ExecutableElement element) {
-    _propagatedElement = element;
-  }
+  @override
+  int get precedence => 15;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -8604,18 +8722,19 @@
    * @param parameters the parameters associated with the function
    * @param semicolon the semicolon terminating the declaration
    */
-  FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, FormalParameterList parameters, Token semicolon) : super(comment, metadata, keyword, semicolon) {
-    this._returnType = becomeParentOf(returnType);
-    this._name = becomeParentOf(name);
-    this._typeParameters = becomeParentOf(typeParameters);
-    this._parameters = becomeParentOf(parameters);
+  FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
+      TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters,
+      FormalParameterList parameters, Token semicolon)
+      : super(comment, metadata, keyword, semicolon) {
+    _returnType = becomeParentOf(returnType);
+    _name = becomeParentOf(name);
+    _typeParameters = becomeParentOf(typeParameters);
+    _parameters = becomeParentOf(parameters);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this);
-
-  @override
-  FunctionTypeAliasElement get element => _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null;
+  FunctionTypeAliasElement get element =>
+      _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null;
 
   /**
    * Return the name of the function type being declared.
@@ -8625,6 +8744,15 @@
   SimpleIdentifier get name => _name;
 
   /**
+   * Set the name of the function type being declared to the given identifier.
+   *
+   * @param name the name of the function type being declared
+   */
+  void set name(SimpleIdentifier name) {
+    _name = becomeParentOf(name);
+  }
+
+  /**
    * Return the parameters associated with the function type.
    *
    * @return the parameters associated with the function type
@@ -8632,6 +8760,15 @@
   FormalParameterList get parameters => _parameters;
 
   /**
+   * Set the parameters associated with the function type to the given list of parameters.
+   *
+   * @param parameters the parameters associated with the function type
+   */
+  void set parameters(FormalParameterList parameters) {
+    _parameters = becomeParentOf(parameters);
+  }
+
+  /**
    * Return the name of the return type of the function type being defined, or `null` if no
    * return type was given.
    *
@@ -8640,32 +8777,6 @@
   TypeName get returnType => _returnType;
 
   /**
-   * Return the type parameters for the function type, or `null` if the function type does not
-   * have any type parameters.
-   *
-   * @return the type parameters for the function type
-   */
-  TypeParameterList get typeParameters => _typeParameters;
-
-  /**
-   * Set the name of the function type being declared to the given identifier.
-   *
-   * @param name the name of the function type being declared
-   */
-  void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
-  }
-
-  /**
-   * Set the parameters associated with the function type to the given list of parameters.
-   *
-   * @param parameters the parameters associated with the function type
-   */
-  void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
-  }
-
-  /**
    * Set the name of the return type of the function type being defined to the given type name.
    *
    * @param typeName the name of the return type of the function type being defined
@@ -8675,15 +8786,26 @@
   }
 
   /**
+   * Return the type parameters for the function type, or `null` if the function type does not
+   * have any type parameters.
+   *
+   * @return the type parameters for the function type
+   */
+  TypeParameterList get typeParameters => _typeParameters;
+
+  /**
    * Set the type parameters for the function type to the given list of parameters.
    *
    * @param typeParameters the type parameters for the function type
    */
   void set typeParameters(TypeParameterList typeParameters) {
-    this._typeParameters = becomeParentOf(typeParameters);
+    _typeParameters = becomeParentOf(typeParameters);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_returnType, visitor);
@@ -8723,15 +8845,15 @@
    * @param identifier the name of the function-typed parameter
    * @param parameters the parameters of the function-typed parameter
    */
-  FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters) : super(comment, metadata, identifier) {
-    this._returnType = becomeParentOf(returnType);
-    this._parameters = becomeParentOf(parameters);
+  FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata,
+      TypeName returnType, SimpleIdentifier identifier,
+      FormalParameterList parameters)
+      : super(comment, metadata, identifier) {
+    _returnType = becomeParentOf(returnType);
+    _parameters = becomeParentOf(parameters);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
-
-  @override
   Token get beginToken {
     if (_returnType != null) {
       return _returnType.beginToken;
@@ -8742,6 +8864,12 @@
   @override
   Token get endToken => _parameters.endToken;
 
+  @override
+  bool get isConst => false;
+
+  @override
+  bool get isFinal => false;
+
   /**
    * Return the parameters of the function-typed parameter.
    *
@@ -8750,6 +8878,15 @@
   FormalParameterList get parameters => _parameters;
 
   /**
+   * Set the parameters of the function-typed parameter to the given parameters.
+   *
+   * @param parameters the parameters of the function-typed parameter
+   */
+  void set parameters(FormalParameterList parameters) {
+    _parameters = becomeParentOf(parameters);
+  }
+
+  /**
    * Return the return type of the function, or `null` if the function does not have a return
    * type.
    *
@@ -8757,31 +8894,19 @@
    */
   TypeName get returnType => _returnType;
 
-  @override
-  bool get isConst => false;
-
-  @override
-  bool get isFinal => false;
-
-  /**
-   * Set the parameters of the function-typed parameter to the given parameters.
-   *
-   * @param parameters the parameters of the function-typed parameter
-   */
-  void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
-  }
-
   /**
    * Set the return type of the function to the given type.
    *
    * @param returnType the return type of the function
    */
   void set returnType(TypeName returnType) {
-    this._returnType = becomeParentOf(returnType);
+    _returnType = becomeParentOf(returnType);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_returnType, visitor);
@@ -8825,7 +8950,8 @@
   R visitAssertStatement(AssertStatement node) => visitStatement(node);
 
   @override
-  R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node);
+  R visitAssignmentExpression(AssignmentExpression node) =>
+      visitExpression(node);
 
   @override
   R visitAwaitExpression(AwaitExpression node) => visitExpression(node);
@@ -8852,7 +8978,8 @@
   R visitCatchClause(CatchClause node) => visitNode(node);
 
   @override
-  R visitClassDeclaration(ClassDeclaration node) => visitCompilationUnitMember(node);
+  R visitClassDeclaration(ClassDeclaration node) =>
+      visitCompilationUnitMember(node);
 
   R visitClassMember(ClassMember node) => visitDeclaration(node);
 
@@ -8870,16 +8997,20 @@
   @override
   R visitCompilationUnit(CompilationUnit node) => visitNode(node);
 
-  R visitCompilationUnitMember(CompilationUnitMember node) => visitDeclaration(node);
+  R visitCompilationUnitMember(CompilationUnitMember node) =>
+      visitDeclaration(node);
 
   @override
-  R visitConditionalExpression(ConditionalExpression node) => visitExpression(node);
+  R visitConditionalExpression(ConditionalExpression node) =>
+      visitExpression(node);
 
   @override
-  R visitConstructorDeclaration(ConstructorDeclaration node) => visitClassMember(node);
+  R visitConstructorDeclaration(ConstructorDeclaration node) =>
+      visitClassMember(node);
 
   @override
-  R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitConstructorInitializer(node);
+  R visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
+      visitConstructorInitializer(node);
 
   R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node);
 
@@ -8895,7 +9026,8 @@
   R visitDeclaredIdentifier(DeclaredIdentifier node) => visitDeclaration(node);
 
   @override
-  R visitDefaultFormalParameter(DefaultFormalParameter node) => visitFormalParameter(node);
+  R visitDefaultFormalParameter(DefaultFormalParameter node) =>
+      visitFormalParameter(node);
 
   R visitDirective(Directive node) => visitAnnotatedNode(node);
 
@@ -8912,10 +9044,12 @@
   R visitEmptyStatement(EmptyStatement node) => visitStatement(node);
 
   @override
-  R visitEnumConstantDeclaration(EnumConstantDeclaration node) => visitDeclaration(node);
+  R visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
+      visitDeclaration(node);
 
   @override
-  R visitEnumDeclaration(EnumDeclaration node) => visitCompilationUnitMember(node);
+  R visitEnumDeclaration(EnumDeclaration node) =>
+      visitCompilationUnitMember(node);
 
   @override
   R visitExportDirective(ExportDirective node) => visitNamespaceDirective(node);
@@ -8923,7 +9057,8 @@
   R visitExpression(Expression node) => visitNode(node);
 
   @override
-  R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitFunctionBody(node);
+  R visitExpressionFunctionBody(ExpressionFunctionBody node) =>
+      visitFunctionBody(node);
 
   @override
   R visitExpressionStatement(ExpressionStatement node) => visitStatement(node);
@@ -8935,7 +9070,8 @@
   R visitFieldDeclaration(FieldDeclaration node) => visitClassMember(node);
 
   @override
-  R visitFieldFormalParameter(FieldFormalParameter node) => visitNormalFormalParameter(node);
+  R visitFieldFormalParameter(FieldFormalParameter node) =>
+      visitNormalFormalParameter(node);
 
   @override
   R visitForEachStatement(ForEachStatement node) => visitStatement(node);
@@ -8951,22 +9087,26 @@
   R visitFunctionBody(FunctionBody node) => visitNode(node);
 
   @override
-  R visitFunctionDeclaration(FunctionDeclaration node) => visitCompilationUnitMember(node);
+  R visitFunctionDeclaration(FunctionDeclaration node) =>
+      visitCompilationUnitMember(node);
 
   @override
-  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visitStatement(node);
+  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      visitStatement(node);
 
   @override
   R visitFunctionExpression(FunctionExpression node) => visitExpression(node);
 
   @override
-  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visitExpression(node);
+  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
+      visitExpression(node);
 
   @override
   R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node);
 
   @override
-  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visitNormalFormalParameter(node);
+  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
+      visitNormalFormalParameter(node);
 
   @override
   R visitHideCombinator(HideCombinator node) => visitCombinator(node);
@@ -8986,7 +9126,8 @@
   R visitIndexExpression(IndexExpression node) => visitExpression(node);
 
   @override
-  R visitInstanceCreationExpression(InstanceCreationExpression node) => visitExpression(node);
+  R visitInstanceCreationExpression(InstanceCreationExpression node) =>
+      visitExpression(node);
 
   @override
   R visitIntegerLiteral(IntegerLiteral node) => visitLiteral(node);
@@ -8994,10 +9135,12 @@
   R visitInterpolationElement(InterpolationElement node) => visitNode(node);
 
   @override
-  R visitInterpolationExpression(InterpolationExpression node) => visitInterpolationElement(node);
+  R visitInterpolationExpression(InterpolationExpression node) =>
+      visitInterpolationElement(node);
 
   @override
-  R visitInterpolationString(InterpolationString node) => visitInterpolationElement(node);
+  R visitInterpolationString(InterpolationString node) =>
+      visitInterpolationElement(node);
 
   @override
   R visitIsExpression(IsExpression node) => visitExpression(node);
@@ -9034,7 +9177,8 @@
   @override
   R visitNamedExpression(NamedExpression node) => visitExpression(node);
 
-  R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(node);
+  R visitNamespaceDirective(NamespaceDirective node) =>
+      visitUriBasedDirective(node);
 
   @override
   R visitNativeClause(NativeClause node) => visitNode(node);
@@ -9047,13 +9191,15 @@
     return null;
   }
 
-  R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParameter(node);
+  R visitNormalFormalParameter(NormalFormalParameter node) =>
+      visitFormalParameter(node);
 
   @override
   R visitNullLiteral(NullLiteral node) => visitLiteral(node);
 
   @override
-  R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpression(node);
+  R visitParenthesizedExpression(ParenthesizedExpression node) =>
+      visitExpression(node);
 
   @override
   R visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
@@ -9074,7 +9220,9 @@
   R visitPropertyAccess(PropertyAccess node) => visitExpression(node);
 
   @override
-  R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node);
+  R
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
+      visitConstructorInitializer(node);
 
   @override
   R visitRethrowExpression(RethrowExpression node) => visitExpression(node);
@@ -9089,25 +9237,30 @@
   R visitShowCombinator(ShowCombinator node) => visitCombinator(node);
 
   @override
-  R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalParameter(node);
+  R visitSimpleFormalParameter(SimpleFormalParameter node) =>
+      visitNormalFormalParameter(node);
 
   @override
   R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node);
 
   @override
-  R visitSimpleStringLiteral(SimpleStringLiteral node) => visitSingleStringLiteral(node);
+  R visitSimpleStringLiteral(SimpleStringLiteral node) =>
+      visitSingleStringLiteral(node);
 
-  R visitSingleStringLiteral(SingleStringLiteral node) => visitStringLiteral(node);
+  R visitSingleStringLiteral(SingleStringLiteral node) =>
+      visitStringLiteral(node);
 
   R visitStatement(Statement node) => visitNode(node);
 
   @override
-  R visitStringInterpolation(StringInterpolation node) => visitSingleStringLiteral(node);
+  R visitStringInterpolation(StringInterpolation node) =>
+      visitSingleStringLiteral(node);
 
   R visitStringLiteral(StringLiteral node) => visitLiteral(node);
 
   @override
-  R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitConstructorInitializer(node);
+  R visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
+      visitConstructorInitializer(node);
 
   @override
   R visitSuperExpression(SuperExpression node) => visitExpression(node);
@@ -9133,7 +9286,8 @@
   R visitThrowExpression(ThrowExpression node) => visitExpression(node);
 
   @override
-  R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitCompilationUnitMember(node);
+  R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
+      visitCompilationUnitMember(node);
 
   @override
   R visitTryStatement(TryStatement node) => visitStatement(node);
@@ -9157,13 +9311,16 @@
   R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node);
 
   @override
-  R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node);
+  R visitVariableDeclaration(VariableDeclaration node) =>
+      visitDeclaration(node);
 
   @override
-  R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node);
+  R visitVariableDeclarationList(VariableDeclarationList node) =>
+      visitNode(node);
 
   @override
-  R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visitStatement(node);
+  R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
+      visitStatement(node);
 
   @override
   R visitWhileStatement(WhileStatement node) => visitStatement(node);
@@ -9175,10 +9332,12 @@
   R visitYieldStatement(YieldStatement node) => visitStatement(node);
 }
 
-class GeneralizingAstVisitor_BreadthFirstVisitor extends GeneralizingAstVisitor<Object> {
+class GeneralizingAstVisitor_BreadthFirstVisitor extends
+    GeneralizingAstVisitor<Object> {
   final BreadthFirstVisitor BreadthFirstVisitor_this;
 
-  GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this) : super();
+  GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this)
+      : super();
 
   @override
   Object visitNode(AstNode node) {
@@ -9208,15 +9367,12 @@
    * @param keyword the comma introducing the combinator
    * @param hiddenNames the list of names from the library that are hidden by this combinator
    */
-  HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyword) {
-    this._hiddenNames = new NodeList<SimpleIdentifier>(this);
-    this._hiddenNames.addAll(hiddenNames);
+  HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames)
+      : super(keyword) {
+    _hiddenNames = new NodeList<SimpleIdentifier>(this, hiddenNames);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitHideCombinator(this);
-
-  @override
   Token get endToken => _hiddenNames.endToken;
 
   /**
@@ -9227,6 +9383,9 @@
   NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitHideCombinator(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _hiddenNames.accept(visitor);
   }
@@ -9244,15 +9403,6 @@
  */
 abstract class Identifier extends Expression {
   /**
-   * Return `true` if the given name is visible only within the library in which it is
-   * declared.
-   *
-   * @param name the name being tested
-   * @return `true` if the given name is private
-   */
-  static bool isPrivateName(String name) => StringUtilities.startsWithChar(name, 0x5F);
-
-  /**
    * Return the best element available for this operator. If resolution was able to find a better
    * element based on type propagation, that element will be returned. Otherwise, the element found
    * using the result of static analysis will be returned. If resolution has not been performed,
@@ -9262,6 +9412,9 @@
    */
   Element get bestElement;
 
+  @override
+  bool get isAssignable => true;
+
   /**
    * Return the lexical representation of the identifier.
    *
@@ -9289,8 +9442,15 @@
    */
   Element get staticElement;
 
-  @override
-  bool get isAssignable => true;
+  /**
+   * Return `true` if the given name is visible only within the library in which it is
+   * declared.
+   *
+   * @param name the name being tested
+   * @return `true` if the given name is private
+   */
+  static bool isPrivateName(String name) =>
+      StringUtilities.startsWithChar(name, 0x5F);
 }
 
 /**
@@ -9349,16 +9509,15 @@
    * @param elseKeyword the token representing the 'else' keyword
    * @param elseStatement the statement that is executed if the condition evaluates to `false`
    */
-  IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.rightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatement) {
-    this._condition = becomeParentOf(condition);
-    this._thenStatement = becomeParentOf(thenStatement);
-    this._elseStatement = becomeParentOf(elseStatement);
+  IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition,
+      this.rightParenthesis, Statement thenStatement, this.elseKeyword,
+      Statement elseStatement) {
+    _condition = becomeParentOf(condition);
+    _thenStatement = becomeParentOf(thenStatement);
+    _elseStatement = becomeParentOf(elseStatement);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitIfStatement(this);
-
-  @override
   Token get beginToken => ifKeyword;
 
   /**
@@ -9369,6 +9528,16 @@
   Expression get condition => _condition;
 
   /**
+   * Set the condition used to determine which of the statements is executed next to the given
+   * expression.
+   *
+   * @param expression the condition used to determine which statement is executed next
+   */
+  void set condition(Expression expression) {
+    _condition = becomeParentOf(expression);
+  }
+
+  /**
    * Return the statement that is executed if the condition evaluates to `false`, or
    * `null` if there is no else statement.
    *
@@ -9376,6 +9545,16 @@
    */
   Statement get elseStatement => _elseStatement;
 
+  /**
+   * Set the statement that is executed if the condition evaluates to `false` to the given
+   * statement.
+   *
+   * @param statement the statement that is executed if the condition evaluates to `false`
+   */
+  void set elseStatement(Statement statement) {
+    _elseStatement = becomeParentOf(statement);
+  }
+
   @override
   Token get endToken {
     if (_elseStatement != null) {
@@ -9392,26 +9571,6 @@
   Statement get thenStatement => _thenStatement;
 
   /**
-   * Set the condition used to determine which of the statements is executed next to the given
-   * expression.
-   *
-   * @param expression the condition used to determine which statement is executed next
-   */
-  void set condition(Expression expression) {
-    _condition = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the statement that is executed if the condition evaluates to `false` to the given
-   * statement.
-   *
-   * @param statement the statement that is executed if the condition evaluates to `false`
-   */
-  void set elseStatement(Statement statement) {
-    _elseStatement = becomeParentOf(statement);
-  }
-
-  /**
    * Set the statement that is executed if the condition evaluates to `true` to the given
    * statement.
    *
@@ -9422,6 +9581,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitIfStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_condition, visitor);
     safelyVisitChild(_thenStatement, visitor);
@@ -9456,14 +9618,10 @@
    * @param interfaces the interfaces that are being implemented
    */
   ImplementsClause(this.keyword, List<TypeName> interfaces) {
-    this._interfaces = new NodeList<TypeName>(this);
-    this._interfaces.addAll(interfaces);
+    _interfaces = new NodeList<TypeName>(this, interfaces);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitImplementsClause(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -9477,6 +9635,9 @@
   NodeList<TypeName> get interfaces => _interfaces;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitImplementsClause(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _interfaces.accept(visitor);
   }
@@ -9492,7 +9653,8 @@
  * </pre>
  */
 class ImportDirective extends NamespaceDirective {
-  static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1, ImportDirective import2) {
+  static Comparator<ImportDirective> COMPARATOR =
+      (ImportDirective import1, ImportDirective import2) {
     //
     // uri
     //
@@ -9544,7 +9706,8 @@
           allHides1.add(simpleIdentifier.name);
         }
       } else {
-        NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownNames;
+        NodeList<SimpleIdentifier> shows =
+            (combinator as ShowCombinator).shownNames;
         for (SimpleIdentifier simpleIdentifier in shows) {
           allShows1.add(simpleIdentifier.name);
         }
@@ -9560,7 +9723,8 @@
           allHides2.add(simpleIdentifier.name);
         }
       } else {
-        NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownNames;
+        NodeList<SimpleIdentifier> shows =
+            (combinator as ShowCombinator).shownNames;
         for (SimpleIdentifier simpleIdentifier in shows) {
           allShows2.add(simpleIdentifier.name);
         }
@@ -9612,14 +9776,14 @@
    * @param combinators the combinators used to control how names are imported
    * @param semicolon the semicolon terminating the directive
    */
-  ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, this.deferredToken, this.asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
-    this._prefix = becomeParentOf(prefix);
+  ImportDirective(Comment comment, List<Annotation> metadata, Token keyword,
+      StringLiteral libraryUri, this.deferredToken, this.asToken,
+      SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon)
+      : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
+    _prefix = becomeParentOf(prefix);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitImportDirective(this);
-
-  @override
   ImportElement get element => super.element as ImportElement;
 
   /**
@@ -9630,6 +9794,15 @@
    */
   SimpleIdentifier get prefix => _prefix;
 
+  /**
+   * Set the prefix to be used with the imported names to the given identifier.
+   *
+   * @param prefix the prefix to be used with the imported names
+   */
+  void set prefix(SimpleIdentifier prefix) {
+    _prefix = becomeParentOf(prefix);
+  }
+
   @override
   LibraryElement get uriElement {
     ImportElement element = this.element;
@@ -9639,14 +9812,8 @@
     return element.importedLibrary;
   }
 
-  /**
-   * Set the prefix to be used with the imported names to the given identifier.
-   *
-   * @param prefix the prefix to be used with the imported names
-   */
-  void set prefix(SimpleIdentifier prefix) {
-    this._prefix = becomeParentOf(prefix);
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitImportDirective(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -9689,32 +9856,54 @@
   IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap);
 
   @override
-  AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStrings(_cloneNodeList(node.strings));
+  AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
+      new AdjacentStrings(_cloneNodeList(node.strings));
 
   @override
   Annotation visitAnnotation(Annotation node) {
-    Annotation copy = new Annotation(_mapToken(node.atSign), _cloneNode(node.name), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.arguments));
+    Annotation copy = new Annotation(
+        _mapToken(node.atSign),
+        _cloneNode(node.name),
+        _mapToken(node.period),
+        _cloneNode(node.constructorName),
+        _cloneNode(node.arguments));
     copy.element = node.element;
     return copy;
   }
 
   @override
-  ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(_mapToken(node.leftParenthesis), _cloneNodeList(node.arguments), _mapToken(node.rightParenthesis));
+  ArgumentList visitArgumentList(ArgumentList node) =>
+      new ArgumentList(
+          _mapToken(node.leftParenthesis),
+          _cloneNodeList(node.arguments),
+          _mapToken(node.rightParenthesis));
 
   @override
   AsExpression visitAsExpression(AsExpression node) {
-    AsExpression copy = new AsExpression(_cloneNode(node.expression), _mapToken(node.asOperator), _cloneNode(node.type));
+    AsExpression copy = new AsExpression(
+        _cloneNode(node.expression),
+        _mapToken(node.asOperator),
+        _cloneNode(node.type));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _mapToken(node.semicolon));
+  AstNode visitAssertStatement(AssertStatement node) =>
+      new AssertStatement(
+          _mapToken(node.keyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.condition),
+          _mapToken(node.rightParenthesis),
+          _mapToken(node.semicolon));
 
   @override
   AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
-    AssignmentExpression copy = new AssignmentExpression(_cloneNode(node.leftHandSide), _mapToken(node.operator), _cloneNode(node.rightHandSide));
+    AssignmentExpression copy = new AssignmentExpression(
+        _cloneNode(node.leftHandSide),
+        _mapToken(node.operator),
+        _cloneNode(node.rightHandSide));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -9723,11 +9912,15 @@
   }
 
   @override
-  AwaitExpression visitAwaitExpression(AwaitExpression node) => new AwaitExpression(_mapToken(node.awaitKeyword), _cloneNode(node.expression));
+  AwaitExpression visitAwaitExpression(AwaitExpression node) =>
+      new AwaitExpression(_mapToken(node.awaitKeyword), _cloneNode(node.expression));
 
   @override
   BinaryExpression visitBinaryExpression(BinaryExpression node) {
-    BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), _mapToken(node.operator), _cloneNode(node.rightOperand));
+    BinaryExpression copy = new BinaryExpression(
+        _cloneNode(node.leftOperand),
+        _mapToken(node.operator),
+        _cloneNode(node.rightOperand));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -9736,47 +9929,98 @@
   }
 
   @override
-  Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), _cloneNodeList(node.statements), _mapToken(node.rightBracket));
+  Block visitBlock(Block node) =>
+      new Block(
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.statements),
+          _mapToken(node.rightBracket));
 
   @override
-  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block));
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
+      new BlockFunctionBody(
+          _mapToken(node.keyword),
+          _mapToken(node.star),
+          _cloneNode(node.block));
 
   @override
   BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
-    BooleanLiteral copy = new BooleanLiteral(_mapToken(node.literal), node.value);
+    BooleanLiteral copy =
+        new BooleanLiteral(_mapToken(node.literal), node.value);
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(_mapToken(node.keyword), _cloneNode(node.label), _mapToken(node.semicolon));
+  BreakStatement visitBreakStatement(BreakStatement node) =>
+      new BreakStatement(
+          _mapToken(node.keyword),
+          _cloneNode(node.label),
+          _mapToken(node.semicolon));
 
   @override
   CascadeExpression visitCascadeExpression(CascadeExpression node) {
-    CascadeExpression copy = new CascadeExpression(_cloneNode(node.target), _cloneNodeList(node.cascadeSections));
+    CascadeExpression copy = new CascadeExpression(
+        _cloneNode(node.target),
+        _cloneNodeList(node.cascadeSections));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  CatchClause visitCatchClause(CatchClause node) => new CatchClause(_mapToken(node.onKeyword), _cloneNode(node.exceptionType), _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.exceptionParameter), _mapToken(node.comma), _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis), _cloneNode(node.body));
+  CatchClause visitCatchClause(CatchClause node) =>
+      new CatchClause(
+          _mapToken(node.onKeyword),
+          _cloneNode(node.exceptionType),
+          _mapToken(node.catchKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.exceptionParameter),
+          _mapToken(node.comma),
+          _cloneNode(node.stackTraceParameter),
+          _mapToken(node.rightParenthesis),
+          _cloneNode(node.body));
 
   @override
   ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
-    ClassDeclaration copy = new ClassDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.abstractKeyword), _mapToken(node.classKeyword), _cloneNode(node.name), _cloneNode(node.typeParameters), _cloneNode(node.extendsClause), _cloneNode(node.withClause), _cloneNode(node.implementsClause), _mapToken(node.leftBracket), _cloneNodeList(node.members), _mapToken(node.rightBracket));
+    ClassDeclaration copy = new ClassDeclaration(
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.abstractKeyword),
+        _mapToken(node.classKeyword),
+        _cloneNode(node.name),
+        _cloneNode(node.typeParameters),
+        _cloneNode(node.extendsClause),
+        _cloneNode(node.withClause),
+        _cloneNode(node.implementsClause),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.members),
+        _mapToken(node.rightBracket));
     copy.nativeClause = _cloneNode(node.nativeClause);
     return copy;
   }
 
   @override
-  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.name), _cloneNode(node.typeParameters), _mapToken(node.equals), _mapToken(node.abstractKeyword), _cloneNode(node.superclass), _cloneNode(node.withClause), _cloneNode(node.implementsClause), _mapToken(node.semicolon));
+  ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) =>
+      new ClassTypeAlias(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.name),
+          _cloneNode(node.typeParameters),
+          _mapToken(node.equals),
+          _mapToken(node.abstractKeyword),
+          _cloneNode(node.superclass),
+          _cloneNode(node.withClause),
+          _cloneNode(node.implementsClause),
+          _mapToken(node.semicolon));
 
   @override
   Comment visitComment(Comment node) {
     if (node.isDocumentation) {
-      return Comment.createDocumentationCommentWithReferences(_mapTokens(node.tokens), _cloneNodeList(node.references));
+      return Comment.createDocumentationCommentWithReferences(
+          _mapTokens(node.tokens),
+          _cloneNodeList(node.references));
     } else if (node.isBlock) {
       return Comment.createBlockComment(_mapTokens(node.tokens));
     }
@@ -9784,11 +10028,17 @@
   }
 
   @override
-  CommentReference visitCommentReference(CommentReference node) => new CommentReference(_mapToken(node.newKeyword), _cloneNode(node.identifier));
+  CommentReference visitCommentReference(CommentReference node) =>
+      new CommentReference(_mapToken(node.newKeyword), _cloneNode(node.identifier));
 
   @override
   CompilationUnit visitCompilationUnit(CompilationUnit node) {
-    CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken), _cloneNode(node.scriptTag), _cloneNodeList(node.directives), _cloneNodeList(node.declarations), _mapToken(node.endToken));
+    CompilationUnit copy = new CompilationUnit(
+        _mapToken(node.beginToken),
+        _cloneNode(node.scriptTag),
+        _cloneNodeList(node.directives),
+        _cloneNodeList(node.declarations),
+        _mapToken(node.endToken));
     copy.lineInfo = node.lineInfo;
     copy.element = node.element;
     return copy;
@@ -9796,40 +10046,93 @@
 
   @override
   ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
-    ConditionalExpression copy = new ConditionalExpression(_cloneNode(node.condition), _mapToken(node.question), _cloneNode(node.thenExpression), _mapToken(node.colon), _cloneNode(node.elseExpression));
+    ConditionalExpression copy = new ConditionalExpression(
+        _cloneNode(node.condition),
+        _mapToken(node.question),
+        _cloneNode(node.thenExpression),
+        _mapToken(node.colon),
+        _cloneNode(node.elseExpression));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node) {
-    ConstructorDeclaration copy = new ConstructorDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _mapToken(node.constKeyword), _mapToken(node.factoryKeyword), _cloneNode(node.returnType), _mapToken(node.period), _cloneNode(node.name), _cloneNode(node.parameters), _mapToken(node.separator), _cloneNodeList(node.initializers), _cloneNode(node.redirectedConstructor), _cloneNode(node.body));
+  ConstructorDeclaration
+      visitConstructorDeclaration(ConstructorDeclaration node) {
+    ConstructorDeclaration copy = new ConstructorDeclaration(
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.externalKeyword),
+        _mapToken(node.constKeyword),
+        _mapToken(node.factoryKeyword),
+        _cloneNode(node.returnType),
+        _mapToken(node.period),
+        _cloneNode(node.name),
+        _cloneNode(node.parameters),
+        _mapToken(node.separator),
+        _cloneNodeList(node.initializers),
+        _cloneNode(node.redirectedConstructor),
+        _cloneNode(node.body));
     copy.element = node.element;
     return copy;
   }
 
   @override
-  ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node) => new ConstructorFieldInitializer(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.fieldName), _mapToken(node.equals), _cloneNode(node.expression));
+  ConstructorFieldInitializer
+      visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
+      new ConstructorFieldInitializer(
+          _mapToken(node.keyword),
+          _mapToken(node.period),
+          _cloneNode(node.fieldName),
+          _mapToken(node.equals),
+          _cloneNode(node.expression));
 
   @override
   ConstructorName visitConstructorName(ConstructorName node) {
-    ConstructorName copy = new ConstructorName(_cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name));
+    ConstructorName copy = new ConstructorName(
+        _cloneNode(node.type),
+        _mapToken(node.period),
+        _cloneNode(node.name));
     copy.staticElement = node.staticElement;
     return copy;
   }
 
   @override
-  ContinueStatement visitContinueStatement(ContinueStatement node) => new ContinueStatement(_mapToken(node.keyword), _cloneNode(node.label), _mapToken(node.semicolon));
+  ContinueStatement visitContinueStatement(ContinueStatement node) =>
+      new ContinueStatement(
+          _mapToken(node.keyword),
+          _cloneNode(node.label),
+          _mapToken(node.semicolon));
 
   @override
-  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new DeclaredIdentifier(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNode(node.identifier));
+  DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
+      new DeclaredIdentifier(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNode(node.identifier));
 
   @override
-  DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node) => new DefaultFormalParameter(_cloneNode(node.parameter), node.kind, _mapToken(node.separator), _cloneNode(node.defaultValue));
+  DefaultFormalParameter
+      visitDefaultFormalParameter(DefaultFormalParameter node) =>
+      new DefaultFormalParameter(
+          _cloneNode(node.parameter),
+          node.kind,
+          _mapToken(node.separator),
+          _cloneNode(node.defaultValue));
 
   @override
-  DoStatement visitDoStatement(DoStatement node) => new DoStatement(_mapToken(node.doKeyword), _cloneNode(node.body), _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _mapToken(node.semicolon));
+  DoStatement visitDoStatement(DoStatement node) =>
+      new DoStatement(
+          _mapToken(node.doKeyword),
+          _cloneNode(node.body),
+          _mapToken(node.whileKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.condition),
+          _mapToken(node.rightParenthesis),
+          _mapToken(node.semicolon));
 
   @override
   DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
@@ -9840,63 +10143,150 @@
   }
 
   @override
-  EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyFunctionBody(_mapToken(node.semicolon));
+  EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
+      new EmptyFunctionBody(_mapToken(node.semicolon));
 
   @override
-  EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement(_mapToken(node.semicolon));
+  EmptyStatement visitEmptyStatement(EmptyStatement node) =>
+      new EmptyStatement(_mapToken(node.semicolon));
 
   @override
-  AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => new EnumConstantDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.name));
+  AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
+      new EnumConstantDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.name));
 
   @override
-  AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.name), _mapToken(node.leftBracket), _cloneNodeList(node.constants), _mapToken(node.rightBracket));
+  AstNode visitEnumDeclaration(EnumDeclaration node) =>
+      new EnumDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.name),
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.constants),
+          _mapToken(node.rightBracket));
 
   @override
   ExportDirective visitExportDirective(ExportDirective node) {
-    ExportDirective copy = new ExportDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.uri), _cloneNodeList(node.combinators), _mapToken(node.semicolon));
+    ExportDirective copy = new ExportDirective(
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.keyword),
+        _cloneNode(node.uri),
+        _cloneNodeList(node.combinators),
+        _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
   }
 
   @override
-  ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node) => new ExpressionFunctionBody(_mapToken(node.keyword), _mapToken(node.functionDefinition), _cloneNode(node.expression), _mapToken(node.semicolon));
+  ExpressionFunctionBody
+      visitExpressionFunctionBody(ExpressionFunctionBody node) =>
+      new ExpressionFunctionBody(
+          _mapToken(node.keyword),
+          _mapToken(node.functionDefinition),
+          _cloneNode(node.expression),
+          _mapToken(node.semicolon));
 
   @override
-  ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon));
+  ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
+      new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon));
 
   @override
-  ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(_mapToken(node.keyword), _cloneNode(node.superclass));
+  ExtendsClause visitExtendsClause(ExtendsClause node) =>
+      new ExtendsClause(_mapToken(node.keyword), _cloneNode(node.superclass));
 
   @override
-  FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.staticKeyword), _cloneNode(node.fields), _mapToken(node.semicolon));
+  FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
+      new FieldDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.staticKeyword),
+          _cloneNode(node.fields),
+          _mapToken(node.semicolon));
 
   @override
-  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => new FieldFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _mapToken(node.thisToken), _mapToken(node.period), _cloneNode(node.identifier), _cloneNode(node.parameters));
+  FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
+      new FieldFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _mapToken(node.thisToken),
+          _mapToken(node.period),
+          _cloneNode(node.identifier),
+          _cloneNode(node.parameters));
 
   @override
   ForEachStatement visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable == null) {
-      return new ForEachStatement.con2(_mapToken(node.awaitKeyword), _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.identifier), _mapToken(node.inKeyword), _cloneNode(node.iterable), _mapToken(node.rightParenthesis), _cloneNode(node.body));
+      return new ForEachStatement.con2(
+          _mapToken(node.awaitKeyword),
+          _mapToken(node.forKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.identifier),
+          _mapToken(node.inKeyword),
+          _cloneNode(node.iterable),
+          _mapToken(node.rightParenthesis),
+          _cloneNode(node.body));
     }
-    return new ForEachStatement.con1(_mapToken(node.awaitKeyword), _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(loopVariable), _mapToken(node.inKeyword), _cloneNode(node.iterable), _mapToken(node.rightParenthesis), _cloneNode(node.body));
+    return new ForEachStatement.con1(
+        _mapToken(node.awaitKeyword),
+        _mapToken(node.forKeyword),
+        _mapToken(node.leftParenthesis),
+        _cloneNode(loopVariable),
+        _mapToken(node.inKeyword),
+        _cloneNode(node.iterable),
+        _mapToken(node.rightParenthesis),
+        _cloneNode(node.body));
   }
 
   @override
-  FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(_mapToken(node.leftParenthesis), _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter), _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis));
+  FormalParameterList visitFormalParameterList(FormalParameterList node) =>
+      new FormalParameterList(
+          _mapToken(node.leftParenthesis),
+          _cloneNodeList(node.parameters),
+          _mapToken(node.leftDelimiter),
+          _mapToken(node.rightDelimiter),
+          _mapToken(node.rightParenthesis));
 
   @override
-  ForStatement visitForStatement(ForStatement node) => new ForStatement(_mapToken(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.variables), _cloneNode(node.initialization), _mapToken(node.leftSeparator), _cloneNode(node.condition), _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), _mapToken(node.rightParenthesis), _cloneNode(node.body));
+  ForStatement visitForStatement(ForStatement node) =>
+      new ForStatement(
+          _mapToken(node.forKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.variables),
+          _cloneNode(node.initialization),
+          _mapToken(node.leftSeparator),
+          _cloneNode(node.condition),
+          _mapToken(node.rightSeparator),
+          _cloneNodeList(node.updaters),
+          _mapToken(node.rightParenthesis),
+          _cloneNode(node.body));
 
   @override
-  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _cloneNode(node.returnType), _mapToken(node.propertyKeyword), _cloneNode(node.name), _cloneNode(node.functionExpression));
+  FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
+      new FunctionDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.externalKeyword),
+          _cloneNode(node.returnType),
+          _mapToken(node.propertyKeyword),
+          _cloneNode(node.name),
+          _cloneNode(node.functionExpression));
 
   @override
-  FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
+  FunctionDeclarationStatement
+      visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
 
   @override
   FunctionExpression visitFunctionExpression(FunctionExpression node) {
-    FunctionExpression copy = new FunctionExpression(_cloneNode(node.parameters), _cloneNode(node.body));
+    FunctionExpression copy =
+        new FunctionExpression(_cloneNode(node.parameters), _cloneNode(node.body));
     copy.element = node.element;
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
@@ -9904,8 +10294,11 @@
   }
 
   @override
-  FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
-    FunctionExpressionInvocation copy = new FunctionExpressionInvocation(_cloneNode(node.function), _cloneNode(node.argumentList));
+  FunctionExpressionInvocation
+      visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
+        _cloneNode(node.function),
+        _cloneNode(node.argumentList));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -9914,31 +10307,75 @@
   }
 
   @override
-  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new FunctionTypeAlias(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.returnType), _cloneNode(node.name), _cloneNode(node.typeParameters), _cloneNode(node.parameters), _mapToken(node.semicolon));
+  FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
+      new FunctionTypeAlias(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.returnType),
+          _cloneNode(node.name),
+          _cloneNode(node.typeParameters),
+          _cloneNode(node.parameters),
+          _mapToken(node.semicolon));
 
   @override
-  FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.returnType), _cloneNode(node.identifier), _cloneNode(node.parameters));
+  FunctionTypedFormalParameter
+      visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
+      new FunctionTypedFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.returnType),
+          _cloneNode(node.identifier),
+          _cloneNode(node.parameters));
 
   @override
-  HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(_mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
+  HideCombinator visitHideCombinator(HideCombinator node) =>
+      new HideCombinator(_mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
 
   @override
-  IfStatement visitIfStatement(IfStatement node) => new IfStatement(_mapToken(node.ifKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _cloneNode(node.thenStatement), _mapToken(node.elseKeyword), _cloneNode(node.elseStatement));
+  IfStatement visitIfStatement(IfStatement node) =>
+      new IfStatement(
+          _mapToken(node.ifKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.condition),
+          _mapToken(node.rightParenthesis),
+          _cloneNode(node.thenStatement),
+          _mapToken(node.elseKeyword),
+          _cloneNode(node.elseStatement));
 
   @override
-  ImplementsClause visitImplementsClause(ImplementsClause node) => new ImplementsClause(_mapToken(node.keyword), _cloneNodeList(node.interfaces));
+  ImplementsClause visitImplementsClause(ImplementsClause node) =>
+      new ImplementsClause(_mapToken(node.keyword), _cloneNodeList(node.interfaces));
 
   @override
-  ImportDirective visitImportDirective(ImportDirective node) => new ImportDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.uri), _mapToken(node.deferredToken), _mapToken(node.asToken), _cloneNode(node.prefix), _cloneNodeList(node.combinators), _mapToken(node.semicolon));
+  ImportDirective visitImportDirective(ImportDirective node) =>
+      new ImportDirective(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.uri),
+          _mapToken(node.deferredToken),
+          _mapToken(node.asToken),
+          _cloneNode(node.prefix),
+          _cloneNodeList(node.combinators),
+          _mapToken(node.semicolon));
 
   @override
   IndexExpression visitIndexExpression(IndexExpression node) {
     Token period = _mapToken(node.period);
     IndexExpression copy;
     if (period == null) {
-      copy = new IndexExpression.forTarget(_cloneNode(node.target), _mapToken(node.leftBracket), _cloneNode(node.index), _mapToken(node.rightBracket));
+      copy = new IndexExpression.forTarget(
+          _cloneNode(node.target),
+          _mapToken(node.leftBracket),
+          _cloneNode(node.index),
+          _mapToken(node.rightBracket));
     } else {
-      copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), _cloneNode(node.index), _mapToken(node.rightBracket));
+      copy = new IndexExpression.forCascade(
+          period,
+          _mapToken(node.leftBracket),
+          _cloneNode(node.index),
+          _mapToken(node.rightBracket));
     }
     copy.auxiliaryElements = node.auxiliaryElements;
     copy.propagatedElement = node.propagatedElement;
@@ -9949,8 +10386,12 @@
   }
 
   @override
-  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) {
-    InstanceCreationExpression copy = new InstanceCreationExpression(_mapToken(node.keyword), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
+  InstanceCreationExpression
+      visitInstanceCreationExpression(InstanceCreationExpression node) {
+    InstanceCreationExpression copy = new InstanceCreationExpression(
+        _mapToken(node.keyword),
+        _cloneNode(node.constructorName),
+        _cloneNode(node.argumentList));
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
     copy.staticType = node.staticType;
@@ -9959,38 +10400,58 @@
 
   @override
   IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
-    IntegerLiteral copy = new IntegerLiteral(_mapToken(node.literal), node.value);
+    IntegerLiteral copy =
+        new IntegerLiteral(_mapToken(node.literal), node.value);
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  InterpolationExpression visitInterpolationExpression(InterpolationExpression node) => new InterpolationExpression(_mapToken(node.leftBracket), _cloneNode(node.expression), _mapToken(node.rightBracket));
+  InterpolationExpression
+      visitInterpolationExpression(InterpolationExpression node) =>
+      new InterpolationExpression(
+          _mapToken(node.leftBracket),
+          _cloneNode(node.expression),
+          _mapToken(node.rightBracket));
 
   @override
-  InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(_mapToken(node.contents), node.value);
+  InterpolationString visitInterpolationString(InterpolationString node) =>
+      new InterpolationString(_mapToken(node.contents), node.value);
 
   @override
   IsExpression visitIsExpression(IsExpression node) {
-    IsExpression copy = new IsExpression(_cloneNode(node.expression), _mapToken(node.isOperator), _mapToken(node.notOperator), _cloneNode(node.type));
+    IsExpression copy = new IsExpression(
+        _cloneNode(node.expression),
+        _mapToken(node.isOperator),
+        _mapToken(node.notOperator),
+        _cloneNode(node.type));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  Label visitLabel(Label node) => new Label(_cloneNode(node.label), _mapToken(node.colon));
+  Label visitLabel(Label node) =>
+      new Label(_cloneNode(node.label), _mapToken(node.colon));
 
   @override
-  LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledStatement(_cloneNodeList(node.labels), _cloneNode(node.statement));
+  LabeledStatement visitLabeledStatement(LabeledStatement node) =>
+      new LabeledStatement(_cloneNodeList(node.labels), _cloneNode(node.statement));
 
   @override
-  LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.libraryToken), _cloneNode(node.name), _mapToken(node.semicolon));
+  LibraryDirective visitLibraryDirective(LibraryDirective node) =>
+      new LibraryDirective(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.libraryToken),
+          _cloneNode(node.name),
+          _mapToken(node.semicolon));
 
   @override
   LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
-    LibraryIdentifier copy = new LibraryIdentifier(_cloneNodeList(node.components));
+    LibraryIdentifier copy =
+        new LibraryIdentifier(_cloneNodeList(node.components));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -9998,7 +10459,12 @@
 
   @override
   ListLiteral visitListLiteral(ListLiteral node) {
-    ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword), _cloneNode(node.typeArguments), _mapToken(node.leftBracket), _cloneNodeList(node.elements), _mapToken(node.rightBracket));
+    ListLiteral copy = new ListLiteral(
+        _mapToken(node.constKeyword),
+        _cloneNode(node.typeArguments),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.elements),
+        _mapToken(node.rightBracket));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10006,21 +10472,45 @@
 
   @override
   MapLiteral visitMapLiteral(MapLiteral node) {
-    MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword), _cloneNode(node.typeArguments), _mapToken(node.leftBracket), _cloneNodeList(node.entries), _mapToken(node.rightBracket));
+    MapLiteral copy = new MapLiteral(
+        _mapToken(node.constKeyword),
+        _cloneNode(node.typeArguments),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.entries),
+        _mapToken(node.rightBracket));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value));
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
+      new MapLiteralEntry(
+          _cloneNode(node.key),
+          _mapToken(node.separator),
+          _cloneNode(node.value));
 
   @override
-  MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new MethodDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _mapToken(node.modifierKeyword), _cloneNode(node.returnType), _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword), _cloneNode(node.name), _cloneNode(node.parameters), _cloneNode(node.body));
+  MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
+      new MethodDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.externalKeyword),
+          _mapToken(node.modifierKeyword),
+          _cloneNode(node.returnType),
+          _mapToken(node.propertyKeyword),
+          _mapToken(node.operatorKeyword),
+          _cloneNode(node.name),
+          _cloneNode(node.parameters),
+          _cloneNode(node.body));
 
   @override
   MethodInvocation visitMethodInvocation(MethodInvocation node) {
-    MethodInvocation copy = new MethodInvocation(_cloneNode(node.target), _mapToken(node.period), _cloneNode(node.methodName), _cloneNode(node.argumentList));
+    MethodInvocation copy = new MethodInvocation(
+        _cloneNode(node.target),
+        _mapToken(node.period),
+        _cloneNode(node.methodName),
+        _cloneNode(node.argumentList));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10028,17 +10518,23 @@
 
   @override
   NamedExpression visitNamedExpression(NamedExpression node) {
-    NamedExpression copy = new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
+    NamedExpression copy =
+        new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  AstNode visitNativeClause(NativeClause node) => new NativeClause(_mapToken(node.keyword), _cloneNode(node.name));
+  AstNode visitNativeClause(NativeClause node) =>
+      new NativeClause(_mapToken(node.keyword), _cloneNode(node.name));
 
   @override
-  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new NativeFunctionBody(_mapToken(node.nativeToken), _cloneNode(node.stringLiteral), _mapToken(node.semicolon));
+  NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
+      new NativeFunctionBody(
+          _mapToken(node.nativeToken),
+          _cloneNode(node.stringLiteral),
+          _mapToken(node.semicolon));
 
   @override
   NullLiteral visitNullLiteral(NullLiteral node) {
@@ -10049,8 +10545,12 @@
   }
 
   @override
-  ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node) {
-    ParenthesizedExpression copy = new ParenthesizedExpression(_mapToken(node.leftParenthesis), _cloneNode(node.expression), _mapToken(node.rightParenthesis));
+  ParenthesizedExpression
+      visitParenthesizedExpression(ParenthesizedExpression node) {
+    ParenthesizedExpression copy = new ParenthesizedExpression(
+        _mapToken(node.leftParenthesis),
+        _cloneNode(node.expression),
+        _mapToken(node.rightParenthesis));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10058,21 +10558,33 @@
 
   @override
   PartDirective visitPartDirective(PartDirective node) {
-    PartDirective copy = new PartDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.partToken), _cloneNode(node.uri), _mapToken(node.semicolon));
+    PartDirective copy = new PartDirective(
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.partToken),
+        _cloneNode(node.uri),
+        _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
   }
 
   @override
   PartOfDirective visitPartOfDirective(PartOfDirective node) {
-    PartOfDirective copy = new PartOfDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.partToken), _mapToken(node.ofToken), _cloneNode(node.libraryName), _mapToken(node.semicolon));
+    PartOfDirective copy = new PartOfDirective(
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.partToken),
+        _mapToken(node.ofToken),
+        _cloneNode(node.libraryName),
+        _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
   }
 
   @override
   PostfixExpression visitPostfixExpression(PostfixExpression node) {
-    PostfixExpression copy = new PostfixExpression(_cloneNode(node.operand), _mapToken(node.operator));
+    PostfixExpression copy =
+        new PostfixExpression(_cloneNode(node.operand), _mapToken(node.operator));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -10082,7 +10594,10 @@
 
   @override
   PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) {
-    PrefixedIdentifier copy = new PrefixedIdentifier(_cloneNode(node.prefix), _mapToken(node.period), _cloneNode(node.identifier));
+    PrefixedIdentifier copy = new PrefixedIdentifier(
+        _cloneNode(node.prefix),
+        _mapToken(node.period),
+        _cloneNode(node.identifier));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10090,7 +10605,8 @@
 
   @override
   PrefixExpression visitPrefixExpression(PrefixExpression node) {
-    PrefixExpression copy = new PrefixExpression(_mapToken(node.operator), _cloneNode(node.operand));
+    PrefixExpression copy =
+        new PrefixExpression(_mapToken(node.operator), _cloneNode(node.operand));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -10100,15 +10616,24 @@
 
   @override
   PropertyAccess visitPropertyAccess(PropertyAccess node) {
-    PropertyAccess copy = new PropertyAccess(_cloneNode(node.target), _mapToken(node.operator), _cloneNode(node.propertyName));
+    PropertyAccess copy = new PropertyAccess(
+        _cloneNode(node.target),
+        _mapToken(node.operator),
+        _cloneNode(node.propertyName));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
+  RedirectingConstructorInvocation
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    RedirectingConstructorInvocation copy =
+        new RedirectingConstructorInvocation(
+            _mapToken(node.keyword),
+            _mapToken(node.period),
+            _cloneNode(node.constructorName),
+            _cloneNode(node.argumentList));
     copy.staticElement = node.staticElement;
     return copy;
   }
@@ -10122,25 +10647,39 @@
   }
 
   @override
-  ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatement(_mapToken(node.keyword), _cloneNode(node.expression), _mapToken(node.semicolon));
+  ReturnStatement visitReturnStatement(ReturnStatement node) =>
+      new ReturnStatement(
+          _mapToken(node.keyword),
+          _cloneNode(node.expression),
+          _mapToken(node.semicolon));
 
   @override
-  ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(_mapToken(node.scriptTag));
+  ScriptTag visitScriptTag(ScriptTag node) =>
+      new ScriptTag(_mapToken(node.scriptTag));
 
   @override
-  ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames));
+  ShowCombinator visitShowCombinator(ShowCombinator node) =>
+      new ShowCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames));
 
   @override
-  SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) => new SimpleFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNode(node.identifier));
+  SimpleFormalParameter
+      visitSimpleFormalParameter(SimpleFormalParameter node) =>
+      new SimpleFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNode(node.identifier));
 
   @override
   SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
     Token mappedToken = _mapToken(node.token);
     if (mappedToken == null) {
-      // This only happens for SimpleIdentifiers created by the parser as part of scanning
-      // documentation comments (the tokens for those identifiers are not in the original token
-      // stream and hence do not get copied). This extra check can be removed if the scanner is
-      // changed to scan documentation comments for the parser.
+      // This only happens for SimpleIdentifiers created by the parser as part
+      // of scanning documentation comments (the tokens for those identifiers
+      // are not in the original token stream and hence do not get copied).
+      // This extra check can be removed if the scanner is changed to scan
+      // documentation comments for the parser.
       mappedToken = node.token;
     }
     SimpleIdentifier copy = new SimpleIdentifier(mappedToken);
@@ -10154,7 +10693,8 @@
 
   @override
   SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
-    SimpleStringLiteral copy = new SimpleStringLiteral(_mapToken(node.literal), node.value);
+    SimpleStringLiteral copy =
+        new SimpleStringLiteral(_mapToken(node.literal), node.value);
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10162,15 +10702,21 @@
 
   @override
   StringInterpolation visitStringInterpolation(StringInterpolation node) {
-    StringInterpolation copy = new StringInterpolation(_cloneNodeList(node.elements));
+    StringInterpolation copy =
+        new StringInterpolation(_cloneNodeList(node.elements));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    SuperConstructorInvocation copy = new SuperConstructorInvocation(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
+  SuperConstructorInvocation
+      visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    SuperConstructorInvocation copy = new SuperConstructorInvocation(
+        _mapToken(node.keyword),
+        _mapToken(node.period),
+        _cloneNode(node.constructorName),
+        _cloneNode(node.argumentList));
     copy.staticElement = node.staticElement;
     return copy;
   }
@@ -10184,17 +10730,37 @@
   }
 
   @override
-  SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(_cloneNodeList(node.labels), _mapToken(node.keyword), _cloneNode(node.expression), _mapToken(node.colon), _cloneNodeList(node.statements));
+  SwitchCase visitSwitchCase(SwitchCase node) =>
+      new SwitchCase(
+          _cloneNodeList(node.labels),
+          _mapToken(node.keyword),
+          _cloneNode(node.expression),
+          _mapToken(node.colon),
+          _cloneNodeList(node.statements));
 
   @override
-  SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(_cloneNodeList(node.labels), _mapToken(node.keyword), _mapToken(node.colon), _cloneNodeList(node.statements));
+  SwitchDefault visitSwitchDefault(SwitchDefault node) =>
+      new SwitchDefault(
+          _cloneNodeList(node.labels),
+          _mapToken(node.keyword),
+          _mapToken(node.colon),
+          _cloneNodeList(node.statements));
 
   @override
-  SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.expression), _mapToken(node.rightParenthesis), _mapToken(node.leftBracket), _cloneNodeList(node.members), _mapToken(node.rightBracket));
+  SwitchStatement visitSwitchStatement(SwitchStatement node) =>
+      new SwitchStatement(
+          _mapToken(node.keyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.expression),
+          _mapToken(node.rightParenthesis),
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.members),
+          _mapToken(node.rightBracket));
 
   @override
   AstNode visitSymbolLiteral(SymbolLiteral node) {
-    SymbolLiteral copy = new SymbolLiteral(_mapToken(node.poundSign), _mapTokens(node.components));
+    SymbolLiteral copy =
+        new SymbolLiteral(_mapToken(node.poundSign), _mapTokens(node.components));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10210,51 +10776,108 @@
 
   @override
   ThrowExpression visitThrowExpression(ThrowExpression node) {
-    ThrowExpression copy = new ThrowExpression(_mapToken(node.keyword), _cloneNode(node.expression));
+    ThrowExpression copy =
+        new ThrowExpression(_mapToken(node.keyword), _cloneNode(node.expression));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.variables), _mapToken(node.semicolon));
+  TopLevelVariableDeclaration
+      visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
+      new TopLevelVariableDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.variables),
+          _mapToken(node.semicolon));
 
   @override
-  TryStatement visitTryStatement(TryStatement node) => new TryStatement(_mapToken(node.tryKeyword), _cloneNode(node.body), _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword), _cloneNode(node.finallyBlock));
+  TryStatement visitTryStatement(TryStatement node) =>
+      new TryStatement(
+          _mapToken(node.tryKeyword),
+          _cloneNode(node.body),
+          _cloneNodeList(node.catchClauses),
+          _mapToken(node.finallyKeyword),
+          _cloneNode(node.finallyBlock));
 
   @override
-  TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgumentList(_mapToken(node.leftBracket), _cloneNodeList(node.arguments), _mapToken(node.rightBracket));
+  TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
+      new TypeArgumentList(
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.arguments),
+          _mapToken(node.rightBracket));
 
   @override
   TypeName visitTypeName(TypeName node) {
-    TypeName copy = new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
+    TypeName copy =
+        new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
     copy.type = node.type;
     return copy;
   }
 
   @override
-  TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.name), _mapToken(node.keyword), _cloneNode(node.bound));
+  TypeParameter visitTypeParameter(TypeParameter node) =>
+      new TypeParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.name),
+          _mapToken(node.keyword),
+          _cloneNode(node.bound));
 
   @override
-  TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypeParameterList(_mapToken(node.leftBracket), _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket));
+  TypeParameterList visitTypeParameterList(TypeParameterList node) =>
+      new TypeParameterList(
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.typeParameters),
+          _mapToken(node.rightBracket));
 
   @override
-  VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, _cloneNodeList(node.metadata), _cloneNode(node.name), _mapToken(node.equals), _cloneNode(node.initializer));
+  VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
+      new VariableDeclaration(
+          null,
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.name),
+          _mapToken(node.equals),
+          _cloneNode(node.initializer));
 
   @override
-  VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node) => new VariableDeclarationList(null, _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNodeList(node.variables));
+  VariableDeclarationList
+      visitVariableDeclarationList(VariableDeclarationList node) =>
+      new VariableDeclarationList(
+          null,
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNodeList(node.variables));
 
   @override
-  VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node) => new VariableDeclarationStatement(_cloneNode(node.variables), _mapToken(node.semicolon));
+  VariableDeclarationStatement
+      visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
+      new VariableDeclarationStatement(
+          _cloneNode(node.variables),
+          _mapToken(node.semicolon));
 
   @override
-  WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _cloneNode(node.body));
+  WhileStatement visitWhileStatement(WhileStatement node) =>
+      new WhileStatement(
+          _mapToken(node.keyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.condition),
+          _mapToken(node.rightParenthesis),
+          _cloneNode(node.body));
 
   @override
-  WithClause visitWithClause(WithClause node) => new WithClause(_mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
+  WithClause visitWithClause(WithClause node) =>
+      new WithClause(_mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
 
   @override
-  YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(_mapToken(node.yieldKeyword), _mapToken(node.star), _cloneNode(node.expression), _mapToken(node.semicolon));
+  YieldStatement visitYieldStatement(YieldStatement node) =>
+      new YieldStatement(
+          _mapToken(node.yieldKeyword),
+          _mapToken(node.star),
+          _cloneNode(node.expression),
+          _mapToken(node.semicolon));
 
   AstNode _cloneNode(AstNode node) {
     if (node == null) {
@@ -10314,7 +10937,7 @@
   /**
    * The left square bracket.
    */
-  Token _leftBracket;
+  Token leftBracket;
 
   /**
    * The expression used to compute the index.
@@ -10324,21 +10947,21 @@
   /**
    * The right square bracket.
    */
-  Token _rightBracket;
+  Token rightBracket;
 
   /**
    * The element associated with the operator based on the static type of the target, or
    * `null` if the AST structure has not been resolved or if the operator could not be
    * resolved.
    */
-  MethodElement _staticElement;
+  MethodElement staticElement;
 
   /**
    * The element associated with the operator based on the propagated type of the target, or
    * `null` if the AST structure has not been resolved or if the operator could not be
    * resolved.
    */
-  MethodElement _propagatedElement;
+  MethodElement propagatedElement;
 
   /**
    * If this expression is both in a getter and setter context, the [AuxiliaryElements] will
@@ -10350,34 +10973,29 @@
   /**
    * Initialize a newly created index expression.
    *
-   * @param target the expression used to compute the object being indexed
-   * @param leftBracket the left square bracket
-   * @param index the expression used to compute the index
-   * @param rightBracket the right square bracket
-   */
-  IndexExpression.forTarget(Expression target, Token leftBracket, Expression index, Token rightBracket) {
-    this._target = becomeParentOf(target);
-    this._leftBracket = leftBracket;
-    this._index = becomeParentOf(index);
-    this._rightBracket = rightBracket;
-  }
-
-  /**
-   * Initialize a newly created index expression.
-   *
    * @param period the period ("..") before a cascaded index expression
    * @param leftBracket the left square bracket
    * @param index the expression used to compute the index
    * @param rightBracket the right square bracket
    */
-  IndexExpression.forCascade(this.period, Token leftBracket, Expression index, Token rightBracket) {
-    this._leftBracket = leftBracket;
-    this._index = becomeParentOf(index);
-    this._rightBracket = rightBracket;
+  IndexExpression.forCascade(this.period, this.leftBracket, Expression index,
+      this.rightBracket) {
+    _index = becomeParentOf(index);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitIndexExpression(this);
+  /**
+   * Initialize a newly created index expression.
+   *
+   * @param target the expression used to compute the object being indexed
+   * @param leftBracket the left square bracket
+   * @param index the expression used to compute the index
+   * @param rightBracket the right square bracket
+   */
+  IndexExpression.forTarget(Expression target, this.leftBracket,
+      Expression index, this.rightBracket) {
+    _target = becomeParentOf(target);
+    _index = becomeParentOf(index);
+  }
 
   @override
   Token get beginToken {
@@ -10404,7 +11022,7 @@
   }
 
   @override
-  Token get endToken => _rightBracket;
+  Token get endToken => rightBracket;
 
   /**
    * Return the expression used to compute the index.
@@ -10414,24 +11032,49 @@
   Expression get index => _index;
 
   /**
-   * Return the left square bracket.
+   * Set the expression used to compute the index to the given expression.
    *
-   * @return the left square bracket
+   * @param expression the expression used to compute the index
    */
-  Token get leftBracket => _leftBracket;
+  void set index(Expression expression) {
+    _index = becomeParentOf(expression);
+  }
+
+  @override
+  bool get isAssignable => true;
+
+  /**
+   * Return `true` if this expression is cascaded. If it is, then the target of this
+   * expression is not stored locally but is stored in the nearest ancestor that is a
+   * [CascadeExpression].
+   *
+   * @return `true` if this expression is cascaded
+   */
+  bool get isCascaded => period != null;
 
   @override
   int get precedence => 15;
 
   /**
-   * Return the element associated with the operator based on the propagated type of the target, or
-   * `null` if the AST structure has not been resolved or if the operator could not be
-   * resolved. One example of the latter case is an operator that is not defined for the type of the
-   * target.
+   * If the AST structure has been resolved, and the function being invoked is known based on
+   * propagated type information, then return the parameter element representing the parameter to
+   * which the value of the index expression will be bound. Otherwise, return `null`.
    *
-   * @return the element associated with this operator
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
+   *
+   * @return the parameter element representing the parameter to which the value of the index
+   *         expression will be bound
    */
-  MethodElement get propagatedElement => _propagatedElement;
+  ParameterElement get propagatedParameterElementForIndex {
+    if (propagatedElement == null) {
+      return null;
+    }
+    List<ParameterElement> parameters = propagatedElement.parameters;
+    if (parameters.length < 1) {
+      return null;
+    }
+    return parameters[0];
+  }
 
   /**
    * Return the expression used to compute the object being indexed. If this index expression is not
@@ -10457,21 +11100,25 @@
   }
 
   /**
-   * Return the right square bracket.
+   * If the AST structure has been resolved, and the function being invoked is known based on static
+   * type information, then return the parameter element representing the parameter to which the
+   * value of the index expression will be bound. Otherwise, return `null`.
    *
-   * @return the right square bracket
-   */
-  Token get rightBracket => _rightBracket;
-
-  /**
-   * Return the element associated with the operator based on the static type of the target, or
-   * `null` if the AST structure has not been resolved or if the operator could not be
-   * resolved. One example of the latter case is an operator that is not defined for the type of the
-   * target.
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
-   * @return the element associated with the operator
+   * @return the parameter element representing the parameter to which the value of the index
+   *         expression will be bound
    */
-  MethodElement get staticElement => _staticElement;
+  ParameterElement get staticParameterElementForIndex {
+    if (staticElement == null) {
+      return null;
+    }
+    List<ParameterElement> parameters = staticElement.parameters;
+    if (parameters.length < 1) {
+      return null;
+    }
+    return parameters[0];
+  }
 
   /**
    * Return the expression used to compute the object being indexed, or `null` if this index
@@ -10483,6 +11130,18 @@
   Expression get target => _target;
 
   /**
+   * Set the expression used to compute the object being indexed to the given expression.
+   *
+   * @param expression the expression used to compute the object being indexed
+   */
+  void set target(Expression expression) {
+    _target = becomeParentOf(expression);
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitIndexExpression(this);
+
+  /**
    * Return `true` if this expression is computing a right-hand value.
    *
    * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
@@ -10495,7 +11154,8 @@
     AstNode parent = this.parent;
     if (parent is AssignmentExpression) {
       AssignmentExpression assignment = parent;
-      if (identical(assignment.leftHandSide, this) && assignment.operator.type == TokenType.EQ) {
+      if (identical(assignment.leftHandSide, this) &&
+          assignment.operator.type == TokenType.EQ) {
         return false;
       }
     }
@@ -10525,120 +11185,10 @@
   }
 
   @override
-  bool get isAssignable => true;
-
-  /**
-   * Return `true` if this expression is cascaded. If it is, then the target of this
-   * expression is not stored locally but is stored in the nearest ancestor that is a
-   * [CascadeExpression].
-   *
-   * @return `true` if this expression is cascaded
-   */
-  bool get isCascaded => period != null;
-
-  /**
-   * Set the expression used to compute the index to the given expression.
-   *
-   * @param expression the expression used to compute the index
-   */
-  void set index(Expression expression) {
-    _index = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the left square bracket to the given token.
-   *
-   * @param bracket the left square bracket
-   */
-  void set leftBracket(Token bracket) {
-    _leftBracket = bracket;
-  }
-
-  /**
-   * Set the element associated with the operator based on the propagated type of the target to the
-   * given element.
-   *
-   * @param element the element to be associated with this operator
-   */
-  void set propagatedElement(MethodElement element) {
-    _propagatedElement = element;
-  }
-
-  /**
-   * Set the right square bracket to the given token.
-   *
-   * @param bracket the right square bracket
-   */
-  void set rightBracket(Token bracket) {
-    _rightBracket = bracket;
-  }
-
-  /**
-   * Set the element associated with the operator based on the static type of the target to the
-   * given element.
-   *
-   * @param element the static element to be associated with the operator
-   */
-  void set staticElement(MethodElement element) {
-    _staticElement = element;
-  }
-
-  /**
-   * Set the expression used to compute the object being indexed to the given expression.
-   *
-   * @param expression the expression used to compute the object being indexed
-   */
-  void set target(Expression expression) {
-    _target = becomeParentOf(expression);
-  }
-
-  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_target, visitor);
     safelyVisitChild(_index, visitor);
   }
-
-  /**
-   * If the AST structure has been resolved, and the function being invoked is known based on
-   * propagated type information, then return the parameter element representing the parameter to
-   * which the value of the index expression will be bound. Otherwise, return `null`.
-   *
-   * This method is only intended to be used by [Expression.propagatedParameterElement].
-   *
-   * @return the parameter element representing the parameter to which the value of the index
-   *         expression will be bound
-   */
-  ParameterElement get propagatedParameterElementForIndex {
-    if (_propagatedElement == null) {
-      return null;
-    }
-    List<ParameterElement> parameters = _propagatedElement.parameters;
-    if (parameters.length < 1) {
-      return null;
-    }
-    return parameters[0];
-  }
-
-  /**
-   * If the AST structure has been resolved, and the function being invoked is known based on static
-   * type information, then return the parameter element representing the parameter to which the
-   * value of the index expression will be bound. Otherwise, return `null`.
-   *
-   * This method is only intended to be used by [Expression.staticParameterElement].
-   *
-   * @return the parameter element representing the parameter to which the value of the index
-   *         expression will be bound
-   */
-  ParameterElement get staticParameterElementForIndex {
-    if (_staticElement == null) {
-      return null;
-    }
-    List<ParameterElement> parameters = _staticElement.parameters;
-    if (parameters.length < 1) {
-      return null;
-    }
-    return parameters[0];
-  }
 }
 
 /**
@@ -10675,7 +11225,7 @@
   /**
    * The result of evaluating this expression, if it is constant.
    */
-  EvaluationResultImpl _result;
+  EvaluationResultImpl evaluationResult;
 
   /**
    * Initialize a newly created instance creation expression.
@@ -10684,14 +11234,12 @@
    * @param constructorName the name of the constructor to be invoked
    * @param argumentList the list of arguments to the constructor
    */
-  InstanceCreationExpression(this.keyword, ConstructorName constructorName, ArgumentList argumentList) {
-    this._constructorName = becomeParentOf(constructorName);
-    this._argumentList = becomeParentOf(argumentList);
+  InstanceCreationExpression(this.keyword, ConstructorName constructorName,
+      ArgumentList argumentList) {
+    _constructorName = becomeParentOf(constructorName);
+    _argumentList = becomeParentOf(argumentList);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this);
-
   /**
    * Return the list of arguments to the constructor.
    *
@@ -10699,6 +11247,15 @@
    */
   ArgumentList get argumentList => _argumentList;
 
+  /**
+   * Set the list of arguments to the constructor to the given list.
+   *
+   * @param argumentList the list of arguments to the constructor
+   */
+  void set argumentList(ArgumentList argumentList) {
+    _argumentList = becomeParentOf(argumentList);
+  }
+
   @override
   Token get beginToken => keyword;
 
@@ -10709,55 +11266,31 @@
    */
   ConstructorName get constructorName => _constructorName;
 
-  @override
-  Token get endToken => _argumentList.endToken;
-
-  /**
-   * Return the result of evaluating this constant as a compile-time constant expression, or
-   * `null` if this variable is not a 'const' expression or an error prevented the result from
-   * being computed.
-   *
-   * @return the result of evaluating this constant
-   */
-  EvaluationResultImpl get evaluationResult => _result;
-
-  @override
-  int get precedence => 16;
-
-  /**
-   * Return `true` if this creation expression is used to invoke a constant constructor.
-   *
-   * @return `true` if this creation expression is used to invoke a constant constructor
-   */
-  bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
-
-  /**
-   * Set the list of arguments to the constructor to the given list.
-   *
-   * @param argumentList the list of arguments to the constructor
-   */
-  void set argumentList(ArgumentList argumentList) {
-    this._argumentList = becomeParentOf(argumentList);
-  }
-
   /**
    * Set the name of the constructor to be invoked to the given name.
    *
    * @param constructorName the name of the constructor to be invoked
    */
   void set constructorName(ConstructorName constructorName) {
-    this._constructorName = becomeParentOf(constructorName);
+    _constructorName = becomeParentOf(constructorName);
   }
 
+  @override
+  Token get endToken => _argumentList.endToken;
+
   /**
-   * Set the result of evaluating this expression as a compile-time constant expression to the given
-   * result.
+   * Return `true` if this creation expression is used to invoke a constant constructor.
    *
-   * @param result the result of evaluating this expression
+   * @return `true` if this creation expression is used to invoke a constant constructor
    */
-  void set evaluationResult(EvaluationResultImpl result) {
-    this._result = result;
-  }
+  bool get isConst =>
+      keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
+
+  @override
+  int get precedence => 16;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -10802,15 +11335,15 @@
   IntegerLiteral(this.literal, this.value);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this);
-
-  @override
   Token get beginToken => literal;
 
   @override
   Token get endToken => literal;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -10863,14 +11396,12 @@
    * @param expression the expression to be evaluated for the value to be converted into a string
    * @param rightBracket the right curly bracket
    */
-  InterpolationExpression(this.leftBracket, Expression expression, this.rightBracket) {
-    this._expression = becomeParentOf(expression);
+  InterpolationExpression(this.leftBracket, Expression expression,
+      this.rightBracket) {
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this);
-
-  @override
   Token get beginToken => leftBracket;
 
   @override
@@ -10895,10 +11426,13 @@
    * @param expression the expression to be evaluated for the value to be converted into a string
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
@@ -10917,7 +11451,7 @@
   /**
    * The characters that will be added to the string.
    */
-  Token _contents;
+  Token contents;
 
   /**
    * The value of the literal.
@@ -10930,62 +11464,19 @@
    * @param the characters that will be added to the string
    * @param value the value of the literal
    */
-  InterpolationString(Token contents, String value) {
-    this._contents = contents;
-    this._value = value;
+  InterpolationString(this.contents, String value) {
+    _value = value;
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
-
-  @override
-  Token get beginToken => _contents;
-
-  /**
-   * Return the characters that will be added to the string.
-   *
-   * @return the characters that will be added to the string
-   */
-  Token get contents => _contents;
-
-  @override
-  Token get endToken => _contents;
-
-  /**
-   * Return the value of the literal.
-   *
-   * @return the value of the literal
-   */
-  String get value => _value;
-
-  /**
-   * Set the characters that will be added to the string to those in the given string.
-   *
-   * @param string the characters that will be added to the string
-   */
-  void set contents(Token string) {
-    _contents = string;
-  }
-
-  /**
-   * Set the value of the literal to the given string.
-   *
-   * @param string the value of the literal
-   */
-  void set value(String string) {
-    _value = string;
-  }
-
-  @override
-  void visitChildren(AstVisitor visitor) {
-  }
+  Token get beginToken => contents;
 
   /**
    * Return the offset of the after-last contents character.
    */
   int get contentsEnd {
-    int end = _contents.end;
-    String lexeme = _contents.lexeme;
+    int end = contents.end;
+    String lexeme = contents.lexeme;
     if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) ||
         StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) {
       end -= 3;
@@ -10999,8 +11490,8 @@
    * Return the offset of the first contents character.
    */
   int get contentsOffset {
-    int offset = _contents.offset;
-    String lexeme = _contents.lexeme;
+    int offset = contents.offset;
+    String lexeme = contents.lexeme;
     if (lexeme.codeUnitAt(0) == 0x72) {
       offset += 1;
     }
@@ -11012,6 +11503,32 @@
     }
     return offset;
   }
+
+  @override
+  Token get endToken => contents;
+
+  /**
+   * Return the value of the literal.
+   *
+   * @return the value of the literal
+   */
+  String get value => _value;
+
+  /**
+   * Set the value of the literal to the given string.
+   *
+   * @param string the value of the literal
+   */
+  void set value(String string) {
+    _value = string;
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+  }
 }
 
 /**
@@ -11051,15 +11568,13 @@
    * @param notOperator the not operator, or `null` if the sense of the test is not negated
    * @param type the name of the type being tested for
    */
-  IsExpression(Expression expression, this.isOperator, this.notOperator, TypeName type) {
-    this._expression = becomeParentOf(expression);
-    this._type = becomeParentOf(type);
+  IsExpression(Expression expression, this.isOperator, this.notOperator,
+      TypeName type) {
+    _expression = becomeParentOf(expression);
+    _type = becomeParentOf(type);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitIsExpression(this);
-
-  @override
   Token get beginToken => _expression.beginToken;
 
   @override
@@ -11072,6 +11587,16 @@
    */
   Expression get expression => _expression;
 
+  /**
+   * Set the expression used to compute the value whose type is being tested to the given
+   * expression.
+   *
+   * @param expression the expression used to compute the value whose type is being tested
+   */
+  void set expression(Expression expression) {
+    _expression = becomeParentOf(expression);
+  }
+
   @override
   int get precedence => 7;
 
@@ -11083,25 +11608,18 @@
   TypeName get type => _type;
 
   /**
-   * Set the expression used to compute the value whose type is being tested to the given
-   * expression.
-   *
-   * @param expression the expression used to compute the value whose type is being tested
-   */
-  void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
-  }
-
-  /**
    * Set the name of the type being tested for to the given name.
    *
    * @param name the name of the type being tested for
    */
   void set type(TypeName name) {
-    this._type = becomeParentOf(name);
+    _type = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitIsExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
     safelyVisitChild(_type, visitor);
@@ -11134,13 +11652,10 @@
    * @param colon the colon that separates the label from whatever follows
    */
   Label(SimpleIdentifier label, this.colon) {
-    this._label = becomeParentOf(label);
+    _label = becomeParentOf(label);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitLabel(this);
-
-  @override
   Token get beginToken => _label.beginToken;
 
   @override
@@ -11159,10 +11674,13 @@
    * @param label the label being associated with the statement
    */
   void set label(SimpleIdentifier label) {
-    this._label = becomeParentOf(label);
+    _label = becomeParentOf(label);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitLabel(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_label, visitor);
   }
@@ -11195,15 +11713,11 @@
    * @param statement the statement with which the labels are being associated
    */
   LabeledStatement(List<Label> labels, Statement statement) {
-    this._labels = new NodeList<Label>(this);
-    this._labels.addAll(labels);
-    this._statement = becomeParentOf(statement);
+    _labels = new NodeList<Label>(this, labels);
+    _statement = becomeParentOf(statement);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
-
-  @override
   Token get beginToken {
     if (!_labels.isEmpty) {
       return _labels.beginToken;
@@ -11234,10 +11748,16 @@
    * @param statement the statement with which the labels are being associated
    */
   void set statement(Statement statement) {
-    this._statement = becomeParentOf(statement);
+    _statement = becomeParentOf(statement);
   }
 
   @override
+  Statement get unlabeled => _statement.unlabeled;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _labels.accept(visitor);
     safelyVisitChild(_statement, visitor);
@@ -11277,15 +11797,17 @@
    * @param name the name of the library being defined
    * @param semicolon the semicolon terminating the directive
    */
-  LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken, LibraryIdentifier name, this.semicolon) : super(comment, metadata) {
-    this._name = becomeParentOf(name);
+  LibraryDirective(Comment comment, List<Annotation> metadata,
+      this.libraryToken, LibraryIdentifier name, this.semicolon)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitLibraryDirective(this);
+  Token get endToken => semicolon;
 
   @override
-  Token get endToken => semicolon;
+  Token get firstTokenAfterCommentAndMetadata => libraryToken;
 
   @override
   Token get keyword => libraryToken;
@@ -11303,17 +11825,17 @@
    * @param name the name of the library being defined
    */
   void set name(LibraryIdentifier name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitLibraryDirective(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_name, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata => libraryToken;
 }
 
 /**
@@ -11336,14 +11858,10 @@
    * @param components the components of the identifier
    */
   LibraryIdentifier(List<SimpleIdentifier> components) {
-    this._components = new NodeList<SimpleIdentifier>(this);
-    this._components.addAll(components);
+    _components = new NodeList<SimpleIdentifier>(this, components);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this);
-
-  @override
   Token get beginToken => _components.beginToken;
 
   @override
@@ -11384,6 +11902,9 @@
   Element get staticElement => null;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _components.accept(visitor);
   }
@@ -11401,7 +11922,7 @@
   /**
    * The left square bracket.
    */
-  Token _leftBracket;
+  Token leftBracket;
 
   /**
    * The expressions used to compute the elements of the list.
@@ -11411,7 +11932,7 @@
   /**
    * The right square bracket.
    */
-  Token _rightBracket;
+  Token rightBracket;
 
   /**
    * Initialize a newly created list literal.
@@ -11423,27 +11944,22 @@
    * @param elements the expressions used to compute the elements of the list
    * @param rightBracket the right square bracket
    */
-  ListLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBracket, List<Expression> elements, Token rightBracket) : super(constKeyword, typeArguments) {
-    this._elements = new NodeList<Expression>(this);
-    this._leftBracket = leftBracket;
-    this._elements.addAll(elements);
-    this._rightBracket = rightBracket;
+  ListLiteral(Token constKeyword, TypeArgumentList typeArguments,
+      this.leftBracket, List<Expression> elements, this.rightBracket)
+      : super(constKeyword, typeArguments) {
+    _elements = new NodeList<Expression>(this, elements);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitListLiteral(this);
-
-  @override
   Token get beginToken {
-    Token token = constKeyword;
-    if (token != null) {
-      return token;
+    if (constKeyword != null) {
+      return constKeyword;
     }
     TypeArgumentList typeArguments = this.typeArguments;
     if (typeArguments != null) {
       return typeArguments.beginToken;
     }
-    return _leftBracket;
+    return leftBracket;
   }
 
   /**
@@ -11454,39 +11970,10 @@
   NodeList<Expression> get elements => _elements;
 
   @override
-  Token get endToken => _rightBracket;
+  Token get endToken => rightBracket;
 
-  /**
-   * Return the left square bracket.
-   *
-   * @return the left square bracket
-   */
-  Token get leftBracket => _leftBracket;
-
-  /**
-   * Return the right square bracket.
-   *
-   * @return the right square bracket
-   */
-  Token get rightBracket => _rightBracket;
-
-  /**
-   * Set the left square bracket to the given token.
-   *
-   * @param bracket the left square bracket
-   */
-  void set leftBracket(Token bracket) {
-    _leftBracket = bracket;
-  }
-
-  /**
-   * Set the right square bracket to the given token.
-   *
-   * @param bracket the right square bracket
-   */
-  void set rightBracket(Token bracket) {
-    _rightBracket = bracket;
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitListLiteral(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -11527,7 +12014,7 @@
   /**
    * The left curly bracket.
    */
-  Token _leftBracket;
+  Token leftBracket;
 
   /**
    * The entries in the map.
@@ -11537,7 +12024,7 @@
   /**
    * The right curly bracket.
    */
-  Token _rightBracket;
+  Token rightBracket;
 
   /**
    * Initialize a newly created map literal.
@@ -11549,31 +12036,26 @@
    * @param entries the entries in the map
    * @param rightBracket the right curly bracket
    */
-  MapLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket) : super(constKeyword, typeArguments) {
-    this._entries = new NodeList<MapLiteralEntry>(this);
-    this._leftBracket = leftBracket;
-    this._entries.addAll(entries);
-    this._rightBracket = rightBracket;
+  MapLiteral(Token constKeyword, TypeArgumentList typeArguments,
+      this.leftBracket, List<MapLiteralEntry> entries, this.rightBracket)
+      : super(constKeyword, typeArguments) {
+    _entries = new NodeList<MapLiteralEntry>(this, entries);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitMapLiteral(this);
-
-  @override
   Token get beginToken {
-    Token token = constKeyword;
-    if (token != null) {
-      return token;
+    if (constKeyword != null) {
+      return constKeyword;
     }
     TypeArgumentList typeArguments = this.typeArguments;
     if (typeArguments != null) {
       return typeArguments.beginToken;
     }
-    return _leftBracket;
+    return leftBracket;
   }
 
   @override
-  Token get endToken => _rightBracket;
+  Token get endToken => rightBracket;
 
   /**
    * Return the entries in the map.
@@ -11582,37 +12064,8 @@
    */
   NodeList<MapLiteralEntry> get entries => _entries;
 
-  /**
-   * Return the left curly bracket.
-   *
-   * @return the left curly bracket
-   */
-  Token get leftBracket => _leftBracket;
-
-  /**
-   * Return the right curly bracket.
-   *
-   * @return the right curly bracket
-   */
-  Token get rightBracket => _rightBracket;
-
-  /**
-   * Set the left curly bracket to the given token.
-   *
-   * @param bracket the left curly bracket
-   */
-  void set leftBracket(Token bracket) {
-    _leftBracket = bracket;
-  }
-
-  /**
-   * Set the right curly bracket to the given token.
-   *
-   * @param bracket the right curly bracket
-   */
-  void set rightBracket(Token bracket) {
-    _rightBracket = bracket;
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitMapLiteral(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -11654,14 +12107,11 @@
    * @param value the expression computing the value that will be associated with the key
    */
   MapLiteralEntry(Expression key, this.separator, Expression value) {
-    this._key = becomeParentOf(key);
-    this._value = becomeParentOf(value);
+    _key = becomeParentOf(key);
+    _value = becomeParentOf(value);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this);
-
-  @override
   Token get beginToken => _key.beginToken;
 
   @override
@@ -11675,13 +12125,6 @@
   Expression get key => _key;
 
   /**
-   * Return the expression computing the value that will be associated with the key.
-   *
-   * @return the expression computing the value that will be associated with the key
-   */
-  Expression get value => _value;
-
-  /**
    * Set the expression computing the key with which the value will be associated to the given
    * string.
    *
@@ -11692,6 +12135,13 @@
   }
 
   /**
+   * Return the expression computing the value that will be associated with the key.
+   *
+   * @return the expression computing the value that will be associated with the key
+   */
+  Expression get value => _value;
+
+  /**
    * Set the expression computing the value that will be associated with the key to the given
    * expression.
    *
@@ -11702,6 +12152,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_key, visitor);
     safelyVisitChild(_value, visitor);
@@ -11783,16 +12236,17 @@
    *          declares a getter
    * @param body the body of the method
    */
-  MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) : super(comment, metadata) {
-    this._returnType = becomeParentOf(returnType);
-    this._name = becomeParentOf(name);
-    this._parameters = becomeParentOf(parameters);
-    this._body = becomeParentOf(body);
+  MethodDeclaration(Comment comment, List<Annotation> metadata,
+      this.externalKeyword, this.modifierKeyword, TypeName returnType,
+      this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name,
+      FormalParameterList parameters, FunctionBody body)
+      : super(comment, metadata) {
+    _returnType = becomeParentOf(returnType);
+    _name = becomeParentOf(name);
+    _parameters = becomeParentOf(parameters);
+    _body = becomeParentOf(body);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this);
-
   /**
    * Return the body of the method.
    *
@@ -11801,77 +12255,6 @@
   FunctionBody get body => _body;
 
   /**
-   * Return the element associated with this method, or `null` if the AST structure has not
-   * been resolved. The element can either be a [MethodElement], if this represents the
-   * declaration of a normal method, or a [PropertyAccessorElement] if this represents the
-   * declaration of either a getter or a setter.
-   *
-   * @return the element associated with this method
-   */
-  @override
-  ExecutableElement get element => _name != null ? (_name.staticElement as ExecutableElement) : null;
-
-  @override
-  Token get endToken => _body.endToken;
-
-  /**
-   * Return the name of the method.
-   *
-   * @return the name of the method
-   */
-  SimpleIdentifier get name => _name;
-
-  /**
-   * Return the parameters associated with the method, or `null` if this method declares a
-   * getter.
-   *
-   * @return the parameters associated with the method
-   */
-  FormalParameterList get parameters => _parameters;
-
-  /**
-   * Return the return type of the method, or `null` if no return type was declared.
-   *
-   * @return the return type of the method
-   */
-  TypeName get returnType => _returnType;
-
-  /**
-   * Return `true` if this method is declared to be an abstract method.
-   *
-   * @return `true` if this method is declared to be an abstract method
-   */
-  bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody);
-
-  /**
-   * Return `true` if this method declares a getter.
-   *
-   * @return `true` if this method declares a getter
-   */
-  bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.GET;
-
-  /**
-   * Return `true` if this method declares an operator.
-   *
-   * @return `true` if this method declares an operator
-   */
-  bool get isOperator => operatorKeyword != null;
-
-  /**
-   * Return `true` if this method declares a setter.
-   *
-   * @return `true` if this method declares a setter
-   */
-  bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.SET;
-
-  /**
-   * Return `true` if this method is declared to be a static method.
-   *
-   * @return `true` if this method is declared to be a static method
-   */
-  bool get isStatic => modifierKeyword != null && (modifierKeyword as KeywordToken).keyword == Keyword.STATIC;
-
-  /**
    * Set the body of the method to the given function body.
    *
    * @param functionBody the body of the method
@@ -11881,40 +12264,19 @@
   }
 
   /**
-   * Set the name of the method to the given identifier.
+   * Return the element associated with this method, or `null` if the AST structure has not
+   * been resolved. The element can either be a [MethodElement], if this represents the
+   * declaration of a normal method, or a [PropertyAccessorElement] if this represents the
+   * declaration of either a getter or a setter.
    *
-   * @param identifier the name of the method
+   * @return the element associated with this method
    */
-  void set name(SimpleIdentifier identifier) {
-    _name = becomeParentOf(identifier);
-  }
-
-  /**
-   * Set the parameters associated with the method to the given list of parameters.
-   *
-   * @param parameters the parameters associated with the method
-   */
-  void set parameters(FormalParameterList parameters) {
-    this._parameters = becomeParentOf(parameters);
-  }
-
-  /**
-   * Set the return type of the method to the given type name.
-   *
-   * @param typeName the return type of the method
-   */
-  void set returnType(TypeName typeName) {
-    _returnType = becomeParentOf(typeName);
-  }
+  @override
+  ExecutableElement get element =>
+      _name != null ? (_name.staticElement as ExecutableElement) : null;
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(_returnType, visitor);
-    safelyVisitChild(_name, visitor);
-    safelyVisitChild(_parameters, visitor);
-    safelyVisitChild(_body, visitor);
-  }
+  Token get endToken => _body.endToken;
 
   @override
   Token get firstTokenAfterCommentAndMetadata {
@@ -11929,6 +12291,109 @@
     }
     return _name.beginToken;
   }
+
+  /**
+   * Return `true` if this method is declared to be an abstract method.
+   *
+   * @return `true` if this method is declared to be an abstract method
+   */
+  bool get isAbstract =>
+      externalKeyword == null && (_body is EmptyFunctionBody);
+
+  /**
+   * Return `true` if this method declares a getter.
+   *
+   * @return `true` if this method declares a getter
+   */
+  bool get isGetter =>
+      propertyKeyword != null &&
+          (propertyKeyword as KeywordToken).keyword == Keyword.GET;
+
+  /**
+   * Return `true` if this method declares an operator.
+   *
+   * @return `true` if this method declares an operator
+   */
+  bool get isOperator => operatorKeyword != null;
+
+  /**
+   * Return `true` if this method declares a setter.
+   *
+   * @return `true` if this method declares a setter
+   */
+  bool get isSetter =>
+      propertyKeyword != null &&
+          (propertyKeyword as KeywordToken).keyword == Keyword.SET;
+
+  /**
+   * Return `true` if this method is declared to be a static method.
+   *
+   * @return `true` if this method is declared to be a static method
+   */
+  bool get isStatic =>
+      modifierKeyword != null &&
+          (modifierKeyword as KeywordToken).keyword == Keyword.STATIC;
+
+  /**
+   * Return the name of the method.
+   *
+   * @return the name of the method
+   */
+  SimpleIdentifier get name => _name;
+
+  /**
+   * Set the name of the method to the given identifier.
+   *
+   * @param identifier the name of the method
+   */
+  void set name(SimpleIdentifier identifier) {
+    _name = becomeParentOf(identifier);
+  }
+
+  /**
+   * Return the parameters associated with the method, or `null` if this method declares a
+   * getter.
+   *
+   * @return the parameters associated with the method
+   */
+  FormalParameterList get parameters => _parameters;
+
+  /**
+   * Set the parameters associated with the method to the given list of parameters.
+   *
+   * @param parameters the parameters associated with the method
+   */
+  void set parameters(FormalParameterList parameters) {
+    _parameters = becomeParentOf(parameters);
+  }
+
+  /**
+   * Return the return type of the method, or `null` if no return type was declared.
+   *
+   * @return the return type of the method
+   */
+  TypeName get returnType => _returnType;
+
+  /**
+   * Set the return type of the method to the given type name.
+   *
+   * @param typeName the return type of the method
+   */
+  void set returnType(TypeName typeName) {
+    _returnType = becomeParentOf(typeName);
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(_returnType, visitor);
+    safelyVisitChild(_name, visitor);
+    safelyVisitChild(_parameters, visitor);
+    safelyVisitChild(_body, visitor);
+  }
 }
 
 /**
@@ -11974,15 +12439,13 @@
    * @param methodName the name of the method being invoked
    * @param argumentList the list of arguments to the method
    */
-  MethodInvocation(Expression target, this.period, SimpleIdentifier methodName, ArgumentList argumentList) {
-    this._target = becomeParentOf(target);
-    this._methodName = becomeParentOf(methodName);
-    this._argumentList = becomeParentOf(argumentList);
+  MethodInvocation(Expression target, this.period, SimpleIdentifier methodName,
+      ArgumentList argumentList) {
+    _target = becomeParentOf(target);
+    _methodName = becomeParentOf(methodName);
+    _argumentList = becomeParentOf(argumentList);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitMethodInvocation(this);
-
   /**
    * Return the list of arguments to the method.
    *
@@ -11990,6 +12453,15 @@
    */
   ArgumentList get argumentList => _argumentList;
 
+  /**
+   * Set the list of arguments to the method to the given list.
+   *
+   * @param argumentList the list of arguments to the method
+   */
+  void set argumentList(ArgumentList argumentList) {
+    _argumentList = becomeParentOf(argumentList);
+  }
+
   @override
   Token get beginToken {
     if (_target != null) {
@@ -12004,12 +12476,31 @@
   Token get endToken => _argumentList.endToken;
 
   /**
+   * Return `true` if this expression is cascaded. If it is, then the target of this
+   * expression is not stored locally but is stored in the nearest ancestor that is a
+   * [CascadeExpression].
+   *
+   * @return `true` if this expression is cascaded
+   */
+  bool get isCascaded =>
+      period != null && period.type == TokenType.PERIOD_PERIOD;
+
+  /**
    * Return the name of the method being invoked.
    *
    * @return the name of the method being invoked
    */
   SimpleIdentifier get methodName => _methodName;
 
+  /**
+   * Set the name of the method being invoked to the given identifier.
+   *
+   * @param identifier the name of the method being invoked
+   */
+  void set methodName(SimpleIdentifier identifier) {
+    _methodName = becomeParentOf(identifier);
+  }
+
   @override
   int get precedence => 15;
 
@@ -12047,33 +12538,6 @@
   Expression get target => _target;
 
   /**
-   * Return `true` if this expression is cascaded. If it is, then the target of this
-   * expression is not stored locally but is stored in the nearest ancestor that is a
-   * [CascadeExpression].
-   *
-   * @return `true` if this expression is cascaded
-   */
-  bool get isCascaded => period != null && period.type == TokenType.PERIOD_PERIOD;
-
-  /**
-   * Set the list of arguments to the method to the given list.
-   *
-   * @param argumentList the list of arguments to the method
-   */
-  void set argumentList(ArgumentList argumentList) {
-    this._argumentList = becomeParentOf(argumentList);
-  }
-
-  /**
-   * Set the name of the method being invoked to the given identifier.
-   *
-   * @param identifier the name of the method being invoked
-   */
-  void set methodName(SimpleIdentifier identifier) {
-    _methodName = becomeParentOf(identifier);
-  }
-
-  /**
    * Set the expression producing the object on which the method is defined to the given expression.
    *
    * @param expression the expression producing the object on which the method is defined
@@ -12083,6 +12547,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitMethodInvocation(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_target, visitor);
     safelyVisitChild(_methodName, visitor);
@@ -12117,14 +12584,11 @@
    * @param expression the expression with which the name is associated
    */
   NamedExpression(Label name, Expression expression) {
-    this._name = becomeParentOf(name);
-    this._expression = becomeParentOf(expression);
+    _name = becomeParentOf(name);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitNamedExpression(this);
-
-  @override
   Token get beginToken => _name.beginToken;
 
   /**
@@ -12153,25 +12617,22 @@
   Expression get expression => _expression;
 
   /**
-   * Return the name associated with the expression.
-   *
-   * @return the name associated with the expression
-   */
-  Label get name => _name;
-
-  @override
-  int get precedence => 0;
-
-  /**
    * Set the expression with which the name is associated to the given expression.
    *
    * @param expression the expression with which the name is associated
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   /**
+   * Return the name associated with the expression.
+   *
+   * @return the name associated with the expression
+   */
+  Label get name => _name;
+
+  /**
    * Set the name associated with the expression to the given identifier.
    *
    * @param identifier the name associated with the expression
@@ -12181,6 +12642,12 @@
   }
 
   @override
+  int get precedence => 0;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitNamedExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_expression, visitor);
@@ -12223,9 +12690,10 @@
    * @param combinators the combinators used to control which names are imported or exported
    * @param semicolon the semicolon terminating the directive
    */
-  NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, StringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(comment, metadata, libraryUri) {
-    this._combinators = new NodeList<Combinator>(this);
-    this._combinators.addAll(combinators);
+  NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword,
+      StringLiteral libraryUri, List<Combinator> combinators, this.semicolon)
+      : super(comment, metadata, libraryUri) {
+    _combinators = new NodeList<Combinator>(this, combinators);
   }
 
   /**
@@ -12239,10 +12707,10 @@
   Token get endToken => semicolon;
 
   @override
-  LibraryElement get uriElement;
+  Token get firstTokenAfterCommentAndMetadata => keyword;
 
   @override
-  Token get firstTokenAfterCommentAndMetadata => keyword;
+  LibraryElement get uriElement;
 }
 
 /**
@@ -12272,13 +12740,10 @@
    * @param name the name of the native object that implements the class.
    */
   NativeClause(this.keyword, StringLiteral name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitNativeClause(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -12297,10 +12762,13 @@
    * @param name the name of the native object that implements the class.
    */
   void set name(StringLiteral name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitNativeClause(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_name, visitor);
   }
@@ -12319,7 +12787,7 @@
   /**
    * The token representing 'native' that marks the start of the function body.
    */
-  final Token nativeToken;
+  Token nativeToken;
 
   /**
    * The string literal, after the 'native' token.
@@ -12329,7 +12797,7 @@
   /**
    * The token representing the semicolon that marks the end of the function body.
    */
-  final Token semicolon;
+  Token semicolon;
 
   /**
    * Initialize a newly created function body consisting of the 'native' token, a string literal,
@@ -12339,14 +12807,12 @@
    * @param stringLiteral the string literal
    * @param semicolon the token representing the semicolon that marks the end of the function body
    */
-  NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicolon) {
-    this._stringLiteral = becomeParentOf(stringLiteral);
+  NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral,
+      this.semicolon) {
+    _stringLiteral = becomeParentOf(stringLiteral);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this);
-
-  @override
   Token get beginToken => nativeToken;
 
   @override
@@ -12365,16 +12831,153 @@
    * @param stringLiteral the string literal representing the string after the 'native' token
    */
   void set stringLiteral(StringLiteral stringLiteral) {
-    this._stringLiteral = becomeParentOf(stringLiteral);
+    _stringLiteral = becomeParentOf(stringLiteral);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_stringLiteral, visitor);
   }
 }
 
 /**
+ * Instances of the class `NodeList` represent a list of AST nodes that have a
+ * common parent.
+ */
+class NodeList<E extends AstNode> extends Object with ListMixin<E> {
+  /**
+   * The node that is the parent of each of the elements in the list.
+   */
+  AstNode owner;
+
+  /**
+   * The elements contained in the list.
+   */
+  List<E> _elements = <E>[];
+
+  /**
+   * Initialize a newly created list of nodes such that all of the nodes that
+   * are added to the list will have their parent set to the given [owner]. The
+   * list will initially be populated with the given [elements].
+   */
+  NodeList(this.owner, [List<E> elements]) {
+    addAll(elements);
+  }
+
+  /**
+   * Return the first token included in this node list's source range, or `null`
+   * if the list is empty.
+   */
+  Token get beginToken {
+    if (_elements.length == 0) {
+      return null;
+    }
+    return _elements[0].beginToken;
+  }
+
+  /**
+   * Return the last token included in this node list's source range, or `null`
+   * if the list is empty.
+   */
+  Token get endToken {
+    int length = _elements.length;
+    if (length == 0) {
+      return null;
+    }
+    return _elements[length - 1].endToken;
+  }
+
+  int get length => _elements.length;
+
+  @deprecated
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize NodeList.");
+  }
+
+  E operator [](int index) {
+    if (index < 0 || index >= _elements.length) {
+      throw new RangeError("Index: $index, Size: ${_elements.length}");
+    }
+    return _elements[index];
+  }
+
+  void operator []=(int index, E node) {
+    if (index < 0 || index >= _elements.length) {
+      throw new RangeError("Index: $index, Size: ${_elements.length}");
+    }
+    owner.becomeParentOf(node);
+    _elements[index] = node;
+  }
+
+  /**
+   * Use the given [visitor] to visit each of the nodes in this list.
+   */
+  accept(AstVisitor visitor) {
+    int length = _elements.length;
+    for (var i = 0; i < length; i++) {
+      _elements[i].accept(visitor);
+    }
+  }
+
+  @override
+  void add(E node) {
+    insert(length, node);
+  }
+
+  @override
+  bool addAll(Iterable<E> nodes) {
+    if (nodes != null && !nodes.isEmpty) {
+      _elements.addAll(nodes);
+      for (E node in nodes) {
+        owner.becomeParentOf(node);
+      }
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  void clear() {
+    _elements = <E>[];
+  }
+
+  @override
+  void insert(int index, E node) {
+    int length = _elements.length;
+    if (index < 0 || index > length) {
+      throw new RangeError("Index: $index, Size: ${_elements.length}");
+    }
+    owner.becomeParentOf(node);
+    if (length == 0) {
+      _elements.add(node);
+    } else {
+      _elements.insert(index, node);
+    }
+  }
+
+  @override
+  E removeAt(int index) {
+    if (index < 0 || index >= _elements.length) {
+      throw new RangeError("Index: $index, Size: ${_elements.length}");
+    }
+    E removedNode = _elements[index];
+    _elements.removeAt(index);
+    return removedNode;
+  }
+
+  /**
+   * Create an empty list with the given [owner].
+   *
+   * Use "new NodeList<E>(owner)"
+   */
+  @deprecated
+  static NodeList create(AstNode owner) => new NodeList(owner);
+}
+
+/**
  * Instances of the class `NodeLocator` locate the [AstNode] associated with a
  * source range, given the AST structure built from the source. More specifically, they will return
  * the [AstNode] with the shortest length whose source range completely encompasses
@@ -12413,10 +13016,7 @@
    * @param start the start offset of the range used to identify the node
    * @param end the end offset of the range used to identify the node
    */
-  NodeLocator.con2(int start, int end) {
-    this._startOffset = start;
-    this._endOffset = end;
-  }
+  NodeLocator.con2(this._startOffset, this._endOffset);
 
   /**
    * Return the node that was found that corresponds to the given source range, or `null` if
@@ -12465,7 +13065,8 @@
     } on NodeLocator_NodeFoundException catch (exception) {
       rethrow;
     } catch (exception, stackTrace) {
-      // Ignore the exception and proceed in order to visit the rest of the structure.
+      // Ignore the exception and proceed in order to visit the rest of the
+      // structure.
       AnalysisEngine.instance.logger.logInformation(
           "Exception caught while traversing an AST structure.",
           new CaughtException(exception, stackTrace));
@@ -12483,7 +13084,6 @@
  * been found.
  */
 class NodeLocator_NodeFoundException extends RuntimeException {
-  static int _serialVersionUID = 1;
 }
 
 /**
@@ -12491,29 +13091,6 @@
  * in an AST node with another node.
  */
 class NodeReplacer implements AstVisitor<bool> {
-  /**
-   * Replace the old node with the new node in the AST structure containing the old node.
-   *
-   * @param oldNode
-   * @param newNode
-   * @return `true` if the replacement was successful
-   * @throws IllegalArgumentException if either node is `null`, if the old node does not have
-   *           a parent node, or if the AST structure has been corrupted
-   */
-  static bool replace(AstNode oldNode, AstNode newNode) {
-    if (oldNode == null || newNode == null) {
-      throw new IllegalArgumentException("The old and new nodes must be non-null");
-    } else if (identical(oldNode, newNode)) {
-      return true;
-    }
-    AstNode parent = oldNode.parent;
-    if (parent == null) {
-      throw new IllegalArgumentException("The old node is not a child of another node");
-    }
-    NodeReplacer replacer = new NodeReplacer(oldNode, newNode);
-    return parent.accept(replacer);
-  }
-
   final AstNode _oldNode;
 
   final AstNode _newNode;
@@ -12883,7 +13460,8 @@
   }
 
   @override
-  bool visitExportDirective(ExportDirective node) => visitNamespaceDirective(node);
+  bool visitExportDirective(ExportDirective node) =>
+      visitNamespaceDirective(node);
 
   @override
   bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
@@ -13284,7 +13862,8 @@
   }
 
   bool visitNode(AstNode node) {
-    throw new IllegalArgumentException("The old node is not a child of it's parent");
+    throw new IllegalArgumentException(
+        "The old node is not a child of it's parent");
   }
 
   bool visitNormalFormalParameter(NormalFormalParameter node) {
@@ -13367,7 +13946,8 @@
   }
 
   @override
-  bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  bool
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     if (identical(node.constructorName, _oldNode)) {
       node.constructorName = _newNode as SimpleIdentifier;
       return true;
@@ -13635,6 +14215,31 @@
     }
     return false;
   }
+
+  /**
+   * Replace the old node with the new node in the AST structure containing the old node.
+   *
+   * @param oldNode
+   * @param newNode
+   * @return `true` if the replacement was successful
+   * @throws IllegalArgumentException if either node is `null`, if the old node does not have
+   *           a parent node, or if the AST structure has been corrupted
+   */
+  static bool replace(AstNode oldNode, AstNode newNode) {
+    if (oldNode == null || newNode == null) {
+      throw new IllegalArgumentException(
+          "The old and new nodes must be non-null");
+    } else if (identical(oldNode, newNode)) {
+      return true;
+    }
+    AstNode parent = oldNode.parent;
+    if (parent == null) {
+      throw new IllegalArgumentException(
+          "The old node is not a child of another node");
+    }
+    NodeReplacer replacer = new NodeReplacer(oldNode, newNode);
+    return parent.accept(replacer);
+  }
 }
 
 /**
@@ -13672,11 +14277,11 @@
    * @param metadata the annotations associated with this parameter
    * @param identifier the name of the parameter being declared
    */
-  NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier identifier) {
-    this._metadata = new NodeList<Annotation>(this);
-    this._comment = becomeParentOf(comment);
-    this._metadata.addAll(metadata);
-    this._identifier = becomeParentOf(identifier);
+  NormalFormalParameter(Comment comment, List<Annotation> metadata,
+      SimpleIdentifier identifier) {
+    _comment = becomeParentOf(comment);
+    _metadata = new NodeList<Annotation>(this, metadata);
+    _identifier = becomeParentOf(identifier);
   }
 
   /**
@@ -13687,9 +14292,27 @@
    */
   Comment get documentationComment => _comment;
 
+  /**
+   * Set the documentation comment associated with this parameter to the given comment
+   *
+   * @param comment the documentation comment to be associated with this parameter
+   */
+  void set documentationComment(Comment comment) {
+    _comment = becomeParentOf(comment);
+  }
+
   @override
   SimpleIdentifier get identifier => _identifier;
 
+  /**
+   * Set the name of the parameter being declared to the given identifier.
+   *
+   * @param identifier the name of the parameter being declared
+   */
+  void set identifier(SimpleIdentifier identifier) {
+    _identifier = becomeParentOf(identifier);
+  }
+
   @override
   ParameterKind get kind {
     AstNode parent = this.parent;
@@ -13707,38 +14330,34 @@
   NodeList<Annotation> get metadata => _metadata;
 
   /**
-   * Set the documentation comment associated with this parameter to the given comment
-   *
-   * @param comment the documentation comment to be associated with this parameter
-   */
-  void set documentationComment(Comment comment) {
-    this._comment = becomeParentOf(comment);
-  }
-
-  /**
-   * Set the name of the parameter being declared to the given identifier.
-   *
-   * @param identifier the name of the parameter being declared
-   */
-  void set identifier(SimpleIdentifier identifier) {
-    this._identifier = becomeParentOf(identifier);
-  }
-
-  /**
    * Set the metadata associated with this node to the given metadata.
    *
    * @param metadata the metadata to be associated with this node
    */
   void set metadata(List<Annotation> metadata) {
-    this._metadata.clear();
-    this._metadata.addAll(metadata);
+    _metadata.clear();
+    _metadata.addAll(metadata);
+  }
+
+  /**
+   * Return an array containing the comment and annotations associated with this parameter, sorted
+   * in lexical order.
+   *
+   * @return the comment and annotations associated with this parameter in the order in which they
+   *         appeared in the original source
+   */
+  List<AstNode> get sortedCommentAndAnnotations {
+    return <AstNode>[]
+        ..add(_comment)
+        ..addAll(_metadata)
+        ..sort(AstNode.LEXICAL_ORDER);
   }
 
   @override
   void visitChildren(AstVisitor visitor) {
     //
-    // Note that subclasses are responsible for visiting the identifier because they often need to
-    // visit other nodes before visiting the identifier.
+    // Note that subclasses are responsible for visiting the identifier because
+    // they often need to visit other nodes before visiting the identifier.
     //
     if (_commentIsBeforeAnnotations()) {
       safelyVisitChild(_comment, visitor);
@@ -13762,20 +14381,6 @@
     Annotation firstAnnotation = _metadata[0];
     return _comment.offset < firstAnnotation.offset;
   }
-
-  /**
-   * Return an array containing the comment and annotations associated with this parameter, sorted
-   * in lexical order.
-   *
-   * @return the comment and annotations associated with this parameter in the order in which they
-   *         appeared in the original source
-   */
-  List<AstNode> get sortedCommentAndAnnotations {
-    return <AstNode>[]
-      ..add(_comment)
-      ..addAll(_metadata)
-      ..sort(AstNode.LEXICAL_ORDER);
-  }
 }
 
 /**
@@ -13797,12 +14402,7 @@
    *
    * @param token the token representing the literal
    */
-  NullLiteral(Token token) {
-    this.literal = token;
-  }
-
-  @override
-  accept(AstVisitor visitor) => visitor.visitNullLiteral(this);
+  NullLiteral(this.literal);
 
   @override
   Token get beginToken => literal;
@@ -13811,6 +14411,9 @@
   Token get endToken => literal;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitNullLiteral(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -13828,7 +14431,7 @@
   /**
    * The left parenthesis.
    */
-  Token _leftParenthesis;
+  Token leftParenthesis;
 
   /**
    * The expression within the parentheses.
@@ -13838,7 +14441,7 @@
   /**
    * The right parenthesis.
    */
-  Token _rightParenthesis;
+  Token rightParenthesis;
 
   /**
    * Initialize a newly created parenthesized expression.
@@ -13847,20 +14450,16 @@
    * @param expression the expression within the parentheses
    * @param rightParenthesis the right parenthesis
    */
-  ParenthesizedExpression(Token leftParenthesis, Expression expression, Token rightParenthesis) {
-    this._leftParenthesis = leftParenthesis;
-    this._expression = becomeParentOf(expression);
-    this._rightParenthesis = rightParenthesis;
+  ParenthesizedExpression(this.leftParenthesis, Expression expression,
+      this.rightParenthesis) {
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this);
+  Token get beginToken => leftParenthesis;
 
   @override
-  Token get beginToken => _leftParenthesis;
-
-  @override
-  Token get endToken => _rightParenthesis;
+  Token get endToken => rightParenthesis;
 
   /**
    * Return the expression within the parentheses.
@@ -13870,48 +14469,19 @@
   Expression get expression => _expression;
 
   /**
-   * Return the left parenthesis.
-   *
-   * @return the left parenthesis
-   */
-  Token get leftParenthesis => _leftParenthesis;
-
-  @override
-  int get precedence => 15;
-
-  /**
-   * Return the right parenthesis.
-   *
-   * @return the right parenthesis
-   */
-  Token get rightParenthesis => _rightParenthesis;
-
-  /**
    * Set the expression within the parentheses to the given expression.
    *
    * @param expression the expression within the parentheses
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
-  /**
-   * Set the left parenthesis to the given token.
-   *
-   * @param parenthesis the left parenthesis
-   */
-  void set leftParenthesis(Token parenthesis) {
-    _leftParenthesis = parenthesis;
-  }
+  @override
+  int get precedence => 15;
 
-  /**
-   * Set the right parenthesis to the given token.
-   *
-   * @param parenthesis the right parenthesis
-   */
-  void set rightParenthesis(Token parenthesis) {
-    _rightParenthesis = parenthesis;
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -13947,22 +14517,24 @@
    * @param partUri the URI of the part being included
    * @param semicolon the semicolon terminating the directive
    */
-  PartDirective(Comment comment, List<Annotation> metadata, this.partToken, StringLiteral partUri, this.semicolon) : super(comment, metadata, partUri);
-
-  @override
-  accept(AstVisitor visitor) => visitor.visitPartDirective(this);
+  PartDirective(Comment comment, List<Annotation> metadata, this.partToken,
+      StringLiteral partUri, this.semicolon)
+      : super(comment, metadata, partUri);
 
   @override
   Token get endToken => semicolon;
 
   @override
+  Token get firstTokenAfterCommentAndMetadata => partToken;
+
+  @override
   Token get keyword => partToken;
 
   @override
   CompilationUnitElement get uriElement => element as CompilationUnitElement;
 
   @override
-  Token get firstTokenAfterCommentAndMetadata => partToken;
+  accept(AstVisitor visitor) => visitor.visitPartDirective(this);
 }
 
 /**
@@ -14004,15 +14576,17 @@
    * @param libraryName the name of the library that the containing compilation unit is part of
    * @param semicolon the semicolon terminating the directive
    */
-  PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, this.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, metadata) {
-    this._libraryName = becomeParentOf(libraryName);
+  PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken,
+      this.ofToken, LibraryIdentifier libraryName, this.semicolon)
+      : super(comment, metadata) {
+    _libraryName = becomeParentOf(libraryName);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitPartOfDirective(this);
+  Token get endToken => semicolon;
 
   @override
-  Token get endToken => semicolon;
+  Token get firstTokenAfterCommentAndMetadata => partToken;
 
   @override
   Token get keyword => partToken;
@@ -14030,17 +14604,17 @@
    * @param libraryName the name of the library that the containing compilation unit is part of
    */
   void set libraryName(LibraryIdentifier libraryName) {
-    this._libraryName = becomeParentOf(libraryName);
+    _libraryName = becomeParentOf(libraryName);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitPartOfDirective(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_libraryName, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata => partToken;
 }
 
 /**
@@ -14067,14 +14641,14 @@
    * `null` if the AST structure has not been resolved, if the operator is not user definable,
    * or if the operator could not be resolved.
    */
-  MethodElement _propagatedElement;
+  MethodElement propagatedElement;
 
   /**
    * The element associated with the operator based on the static type of the operand, or
    * `null` if the AST structure has not been resolved, if the operator is not user definable,
    * or if the operator could not be resolved.
    */
-  MethodElement _staticElement;
+  MethodElement staticElement;
 
   /**
    * Initialize a newly created postfix expression.
@@ -14083,13 +14657,10 @@
    * @param operator the postfix operator being applied to the operand
    */
   PostfixExpression(Expression operand, this.operator) {
-    this._operand = becomeParentOf(operand);
+    _operand = becomeParentOf(operand);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitPostfixExpression(this);
-
-  @override
   Token get beginToken => _operand.beginToken;
 
   /**
@@ -14118,64 +14689,19 @@
    */
   Expression get operand => _operand;
 
+  /**
+   * Set the expression computing the operand for the operator to the given expression.
+   *
+   * @param expression the expression computing the operand for the operator
+   */
+  void set operand(Expression expression) {
+    _operand = becomeParentOf(expression);
+  }
+
   @override
   int get precedence => 15;
 
   /**
-   * Return the element associated with the operator based on the propagated type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved. One example of the latter case is an operator that is
-   * not defined for the type of the operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get propagatedElement => _propagatedElement;
-
-  /**
-   * Return the element associated with the operator based on the static type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved. One example of the latter case is an operator that is
-   * not defined for the type of the operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get staticElement => _staticElement;
-
-  /**
-   * Set the expression computing the operand for the operator to the given expression.
-   *
-   * @param expression the expression computing the operand for the operator
-   */
-  void set operand(Expression expression) {
-    _operand = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the element associated with the operator based on the propagated type of the operand to the
-   * given element.
-   *
-   * @param element the element to be associated with the operator
-   */
-  void set propagatedElement(MethodElement element) {
-    _propagatedElement = element;
-  }
-
-  /**
-   * Set the element associated with the operator based on the static type of the operand to the
-   * given element.
-   *
-   * @param element the element to be associated with the operator
-   */
-  void set staticElement(MethodElement element) {
-    _staticElement = element;
-  }
-
-  @override
-  void visitChildren(AstVisitor visitor) {
-    safelyVisitChild(_operand, visitor);
-  }
-
-  /**
    * If the AST structure has been resolved, and the function being invoked is known based on
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the operand will be bound. Otherwise, return `null`.
@@ -14186,10 +14712,10 @@
    *         operand will be bound
    */
   ParameterElement get propagatedParameterElementForOperand {
-    if (_propagatedElement == null) {
+    if (propagatedElement == null) {
       return null;
     }
-    List<ParameterElement> parameters = _propagatedElement.parameters;
+    List<ParameterElement> parameters = propagatedElement.parameters;
     if (parameters.length < 1) {
       return null;
     }
@@ -14207,190 +14733,23 @@
    *         operand will be bound
    */
   ParameterElement get staticParameterElementForOperand {
-    if (_staticElement == null) {
+    if (staticElement == null) {
       return null;
     }
-    List<ParameterElement> parameters = _staticElement.parameters;
+    List<ParameterElement> parameters = staticElement.parameters;
     if (parameters.length < 1) {
       return null;
     }
     return parameters[0];
   }
-}
-
-/**
- * Instances of the class `PrefixExpression` represent a prefix unary expression.
- *
- * <pre>
- * prefixExpression ::=
- *     [Token] [Expression]
- * </pre>
- */
-class PrefixExpression extends Expression {
-  /**
-   * The prefix operator being applied to the operand.
-   */
-  Token operator;
-
-  /**
-   * The expression computing the operand for the operator.
-   */
-  Expression _operand;
-
-  /**
-   * The element associated with the operator based on the static type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved.
-   */
-  MethodElement _staticElement;
-
-  /**
-   * The element associated with the operator based on the propagated type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved.
-   */
-  MethodElement _propagatedElement;
-
-  /**
-   * Initialize a newly created prefix expression.
-   *
-   * @param operator the prefix operator being applied to the operand
-   * @param operand the expression computing the operand for the operator
-   */
-  PrefixExpression(this.operator, Expression operand) {
-    this._operand = becomeParentOf(operand);
-  }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitPrefixExpression(this);
-
-  @override
-  Token get beginToken => operator;
-
-  /**
-   * Return the best element available for this operator. If resolution was able to find a better
-   * element based on type propagation, that element will be returned. Otherwise, the element found
-   * using the result of static analysis will be returned. If resolution has not been performed,
-   * then `null` will be returned.
-   *
-   * @return the best element available for this operator
-   */
-  MethodElement get bestElement {
-    MethodElement element = propagatedElement;
-    if (element == null) {
-      element = staticElement;
-    }
-    return element;
-  }
-
-  @override
-  Token get endToken => _operand.endToken;
-
-  /**
-   * Return the expression computing the operand for the operator.
-   *
-   * @return the expression computing the operand for the operator
-   */
-  Expression get operand => _operand;
-
-  @override
-  int get precedence => 14;
-
-  /**
-   * Return the element associated with the operator based on the propagated type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved. One example of the latter case is an operator that is
-   * not defined for the type of the operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get propagatedElement => _propagatedElement;
-
-  /**
-   * Return the element associated with the operator based on the static type of the operand, or
-   * `null` if the AST structure has not been resolved, if the operator is not user definable,
-   * or if the operator could not be resolved. One example of the latter case is an operator that is
-   * not defined for the type of the operand.
-   *
-   * @return the element associated with the operator
-   */
-  MethodElement get staticElement => _staticElement;
-
-  /**
-   * Set the expression computing the operand for the operator to the given expression.
-   *
-   * @param expression the expression computing the operand for the operator
-   */
-  void set operand(Expression expression) {
-    _operand = becomeParentOf(expression);
-  }
-
-  /**
-   * Set the element associated with the operator based on the propagated type of the operand to the
-   * given element.
-   *
-   * @param element the element to be associated with the operator
-   */
-  void set propagatedElement(MethodElement element) {
-    _propagatedElement = element;
-  }
-
-  /**
-   * Set the element associated with the operator based on the static type of the operand to the
-   * given element.
-   *
-   * @param element the static element to be associated with the operator
-   */
-  void set staticElement(MethodElement element) {
-    _staticElement = element;
-  }
+  accept(AstVisitor visitor) => visitor.visitPostfixExpression(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_operand, visitor);
   }
-
-  /**
-   * If the AST structure has been resolved, and the function being invoked is known based on
-   * propagated type information, then return the parameter element representing the parameter to
-   * which the value of the operand will be bound. Otherwise, return `null`.
-   *
-   * This method is only intended to be used by [Expression.propagatedParameterElement].
-   *
-   * @return the parameter element representing the parameter to which the value of the right
-   *         operand will be bound
-   */
-  ParameterElement get propagatedParameterElementForOperand {
-    if (_propagatedElement == null) {
-      return null;
-    }
-    List<ParameterElement> parameters = _propagatedElement.parameters;
-    if (parameters.length < 1) {
-      return null;
-    }
-    return parameters[0];
-  }
-
-  /**
-   * If the AST structure has been resolved, and the function being invoked is known based on static
-   * type information, then return the parameter element representing the parameter to which the
-   * value of the operand will be bound. Otherwise, return `null`.
-   *
-   * This method is only intended to be used by [Expression.staticParameterElement].
-   *
-   * @return the parameter element representing the parameter to which the value of the right
-   *         operand will be bound
-   */
-  ParameterElement get staticParameterElementForOperand {
-    if (_staticElement == null) {
-      return null;
-    }
-    List<ParameterElement> parameters = _staticElement.parameters;
-    if (parameters.length < 1) {
-      return null;
-    }
-    return parameters[0];
-  }
 }
 
 /**
@@ -14426,15 +14785,13 @@
    * @param period the period used to separate the prefix from the identifier
    * @param identifier the prefix associated with the library in which the identifier is defined
    */
-  PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier identifier) {
-    this._prefix = becomeParentOf(prefix);
-    this._identifier = becomeParentOf(identifier);
+  PrefixedIdentifier(SimpleIdentifier prefix, this.period,
+      SimpleIdentifier identifier) {
+    _prefix = becomeParentOf(prefix);
+    _identifier = becomeParentOf(identifier);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this);
-
-  @override
   Token get beginToken => _prefix.beginToken;
 
   @override
@@ -14455,6 +14812,37 @@
    */
   SimpleIdentifier get identifier => _identifier;
 
+  /**
+   * Set the identifier being prefixed to the given identifier.
+   *
+   * @param identifier the identifier being prefixed
+   */
+  void set identifier(SimpleIdentifier identifier) {
+    _identifier = becomeParentOf(identifier);
+  }
+
+  /**
+   * Return `true` if this type is a deferred type.
+   *
+   * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
+   * is a deferred prefix.
+   *
+   * @return `true` if this type is a deferred type
+   */
+  bool get isDeferred {
+    Element element = _prefix.staticElement;
+    if (element is! PrefixElement) {
+      return false;
+    }
+    PrefixElement prefixElement = element as PrefixElement;
+    List<ImportElement> imports =
+        prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
+    if (imports.length != 1) {
+      return false;
+    }
+    return imports[0].isDeferred;
+  }
+
   @override
   String get name => "${_prefix.name}.${_identifier.name}";
 
@@ -14468,6 +14856,16 @@
    */
   SimpleIdentifier get prefix => _prefix;
 
+  /**
+   * Set the prefix associated with the library in which the identifier is defined to the given
+   * identifier.
+   *
+   * @param identifier the prefix associated with the library in which the identifier is defined
+   */
+  void set prefix(SimpleIdentifier identifier) {
+    _prefix = becomeParentOf(identifier);
+  }
+
   @override
   Element get propagatedElement {
     if (_identifier == null) {
@@ -14484,45 +14882,8 @@
     return _identifier.staticElement;
   }
 
-  /**
-   * Return `true` if this type is a deferred type.
-   *
-   * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
-   * is a deferred prefix.
-   *
-   * @return `true` if this type is a deferred type
-   */
-  bool get isDeferred {
-    Element element = _prefix.staticElement;
-    if (element is! PrefixElement) {
-      return false;
-    }
-    PrefixElement prefixElement = element as PrefixElement;
-    List<ImportElement> imports = prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
-    if (imports.length != 1) {
-      return false;
-    }
-    return imports[0].isDeferred;
-  }
-
-  /**
-   * Set the identifier being prefixed to the given identifier.
-   *
-   * @param identifier the identifier being prefixed
-   */
-  void set identifier(SimpleIdentifier identifier) {
-    this._identifier = becomeParentOf(identifier);
-  }
-
-  /**
-   * Set the prefix associated with the library in which the identifier is defined to the given
-   * identifier.
-   *
-   * @param identifier the prefix associated with the library in which the identifier is defined
-   */
-  void set prefix(SimpleIdentifier identifier) {
-    _prefix = becomeParentOf(identifier);
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -14532,6 +14893,141 @@
 }
 
 /**
+ * Instances of the class `PrefixExpression` represent a prefix unary expression.
+ *
+ * <pre>
+ * prefixExpression ::=
+ *     [Token] [Expression]
+ * </pre>
+ */
+class PrefixExpression extends Expression {
+  /**
+   * The prefix operator being applied to the operand.
+   */
+  Token operator;
+
+  /**
+   * The expression computing the operand for the operator.
+   */
+  Expression _operand;
+
+  /**
+   * The element associated with the operator based on the static type of the operand, or
+   * `null` if the AST structure has not been resolved, if the operator is not user definable,
+   * or if the operator could not be resolved.
+   */
+  MethodElement staticElement;
+
+  /**
+   * The element associated with the operator based on the propagated type of the operand, or
+   * `null` if the AST structure has not been resolved, if the operator is not user definable,
+   * or if the operator could not be resolved.
+   */
+  MethodElement propagatedElement;
+
+  /**
+   * Initialize a newly created prefix expression.
+   *
+   * @param operator the prefix operator being applied to the operand
+   * @param operand the expression computing the operand for the operator
+   */
+  PrefixExpression(this.operator, Expression operand) {
+    _operand = becomeParentOf(operand);
+  }
+
+  @override
+  Token get beginToken => operator;
+
+  /**
+   * Return the best element available for this operator. If resolution was able to find a better
+   * element based on type propagation, that element will be returned. Otherwise, the element found
+   * using the result of static analysis will be returned. If resolution has not been performed,
+   * then `null` will be returned.
+   *
+   * @return the best element available for this operator
+   */
+  MethodElement get bestElement {
+    MethodElement element = propagatedElement;
+    if (element == null) {
+      element = staticElement;
+    }
+    return element;
+  }
+
+  @override
+  Token get endToken => _operand.endToken;
+
+  /**
+   * Return the expression computing the operand for the operator.
+   *
+   * @return the expression computing the operand for the operator
+   */
+  Expression get operand => _operand;
+
+  /**
+   * Set the expression computing the operand for the operator to the given expression.
+   *
+   * @param expression the expression computing the operand for the operator
+   */
+  void set operand(Expression expression) {
+    _operand = becomeParentOf(expression);
+  }
+
+  @override
+  int get precedence => 14;
+
+  /**
+   * If the AST structure has been resolved, and the function being invoked is known based on
+   * propagated type information, then return the parameter element representing the parameter to
+   * which the value of the operand will be bound. Otherwise, return `null`.
+   *
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
+   *
+   * @return the parameter element representing the parameter to which the value of the right
+   *         operand will be bound
+   */
+  ParameterElement get propagatedParameterElementForOperand {
+    if (propagatedElement == null) {
+      return null;
+    }
+    List<ParameterElement> parameters = propagatedElement.parameters;
+    if (parameters.length < 1) {
+      return null;
+    }
+    return parameters[0];
+  }
+
+  /**
+   * If the AST structure has been resolved, and the function being invoked is known based on static
+   * type information, then return the parameter element representing the parameter to which the
+   * value of the operand will be bound. Otherwise, return `null`.
+   *
+   * This method is only intended to be used by [Expression.staticParameterElement].
+   *
+   * @return the parameter element representing the parameter to which the value of the right
+   *         operand will be bound
+   */
+  ParameterElement get staticParameterElementForOperand {
+    if (staticElement == null) {
+      return null;
+    }
+    List<ParameterElement> parameters = staticElement.parameters;
+    if (parameters.length < 1) {
+      return null;
+    }
+    return parameters[0];
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitPrefixExpression(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    safelyVisitChild(_operand, visitor);
+  }
+}
+
+/**
  * Instances of the class `PropertyAccess` represent the access of a property of an object.
  *
  * Note, however, that accesses to properties of objects can also be represented as
@@ -14566,15 +15062,13 @@
    * @param operator the property access operator
    * @param propertyName the name of the property being accessed
    */
-  PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName) {
-    this._target = becomeParentOf(target);
-    this._propertyName = becomeParentOf(propertyName);
+  PropertyAccess(Expression target, this.operator,
+      SimpleIdentifier propertyName) {
+    _target = becomeParentOf(target);
+    _propertyName = becomeParentOf(propertyName);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitPropertyAccess(this);
-
-  @override
   Token get beginToken {
     if (_target != null) {
       return _target.beginToken;
@@ -14586,6 +15080,19 @@
   Token get endToken => _propertyName.endToken;
 
   @override
+  bool get isAssignable => true;
+
+  /**
+   * Return `true` if this expression is cascaded. If it is, then the target of this
+   * expression is not stored locally but is stored in the nearest ancestor that is a
+   * [CascadeExpression].
+   *
+   * @return `true` if this expression is cascaded
+   */
+  bool get isCascaded =>
+      operator != null && operator.type == TokenType.PERIOD_PERIOD;
+
+  @override
   int get precedence => 15;
 
   /**
@@ -14596,6 +15103,15 @@
   SimpleIdentifier get propertyName => _propertyName;
 
   /**
+   * Set the name of the property being accessed to the given identifier.
+   *
+   * @param identifier the name of the property being accessed
+   */
+  void set propertyName(SimpleIdentifier identifier) {
+    _propertyName = becomeParentOf(identifier);
+  }
+
+  /**
    * Return the expression used to compute the receiver of the invocation. If this invocation is not
    * part of a cascade expression, then this is the same as [getTarget]. If this invocation
    * is part of a cascade expression, then the target stored with the cascade expression is
@@ -14627,27 +15143,6 @@
    */
   Expression get target => _target;
 
-  @override
-  bool get isAssignable => true;
-
-  /**
-   * Return `true` if this expression is cascaded. If it is, then the target of this
-   * expression is not stored locally but is stored in the nearest ancestor that is a
-   * [CascadeExpression].
-   *
-   * @return `true` if this expression is cascaded
-   */
-  bool get isCascaded => operator != null && operator.type == TokenType.PERIOD_PERIOD;
-
-  /**
-   * Set the name of the property being accessed to the given identifier.
-   *
-   * @param identifier the name of the property being accessed
-   */
-  void set propertyName(SimpleIdentifier identifier) {
-    _propertyName = becomeParentOf(identifier);
-  }
-
   /**
    * Set the expression computing the object defining the property being accessed to the given
    * expression.
@@ -14659,6 +15154,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitPropertyAccess(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_target, visitor);
     safelyVisitChild(_propertyName, visitor);
@@ -15138,7 +15636,8 @@
   }
 
   @override
-  R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  R
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     node.visitChildren(this);
     return null;
   }
@@ -15359,14 +15858,12 @@
    * @param constructorName the name of the constructor that is being invoked
    * @param argumentList the list of arguments to the constructor
    */
-  RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier constructorName, ArgumentList argumentList) {
-    this._constructorName = becomeParentOf(constructorName);
-    this._argumentList = becomeParentOf(argumentList);
+  RedirectingConstructorInvocation(this.keyword, this.period,
+      SimpleIdentifier constructorName, ArgumentList argumentList) {
+    _constructorName = becomeParentOf(constructorName);
+    _argumentList = becomeParentOf(argumentList);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(this);
-
   /**
    * Return the list of arguments to the constructor.
    *
@@ -15374,6 +15871,15 @@
    */
   ArgumentList get argumentList => _argumentList;
 
+  /**
+   * Set the list of arguments to the constructor to the given list.
+   *
+   * @param argumentList the list of arguments to the constructor
+   */
+  void set argumentList(ArgumentList argumentList) {
+    _argumentList = becomeParentOf(argumentList);
+  }
+
   @override
   Token get beginToken => keyword;
 
@@ -15385,18 +15891,6 @@
    */
   SimpleIdentifier get constructorName => _constructorName;
 
-  @override
-  Token get endToken => _argumentList.endToken;
-
-  /**
-   * Set the list of arguments to the constructor to the given list.
-   *
-   * @param argumentList the list of arguments to the constructor
-   */
-  void set argumentList(ArgumentList argumentList) {
-    this._argumentList = becomeParentOf(argumentList);
-  }
-
   /**
    * Set the name of the constructor that is being invoked to the given identifier.
    *
@@ -15407,6 +15901,13 @@
   }
 
   @override
+  Token get endToken => _argumentList.endToken;
+
+  @override
+  accept(AstVisitor visitor) =>
+      visitor.visitRedirectingConstructorInvocation(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_constructorName, visitor);
     safelyVisitChild(_argumentList, visitor);
@@ -15435,9 +15936,6 @@
   RethrowExpression(this.keyword);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitRethrowExpression(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -15447,6 +15945,9 @@
   int get precedence => 0;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitRethrowExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -15485,13 +15986,10 @@
    * @param semicolon the semicolon terminating the statement
    */
   ReturnStatement(this.keyword, Expression expression, this.semicolon) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitReturnStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -15511,10 +16009,13 @@
    * @param expression the expression computing the value to be returned
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitReturnStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
@@ -15533,7 +16034,8 @@
 
   AstNode _immediateChild;
 
-  Map<String, SimpleIdentifier> _locals = new HashMap<String, SimpleIdentifier>();
+  Map<String, SimpleIdentifier> _locals =
+      new HashMap<String, SimpleIdentifier>();
 
   final int _position;
 
@@ -15607,7 +16109,8 @@
 
   @override
   Object visitFunctionExpression(FunctionExpression node) {
-    if (node.parameters != null && !identical(_immediateChild, node.parameters)) {
+    if (node.parameters != null &&
+        !identical(_immediateChild, node.parameters)) {
       _addParameters(node.parameters.parameters);
     }
     return super.visitFunctionExpression(node);
@@ -15686,7 +16189,8 @@
       }
       if (stmt is VariableDeclarationStatement) {
         _addVariables(stmt.variables.variables);
-      } else if (stmt is FunctionDeclarationStatement && !_referenceIsWithinLocalFunction) {
+      } else if (stmt is FunctionDeclarationStatement &&
+          !_referenceIsWithinLocalFunction) {
         _addToScope(stmt.functionDeclaration.name);
       }
     }
@@ -15725,15 +16229,15 @@
   ScriptTag(this.scriptTag);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitScriptTag(this);
-
-  @override
   Token get beginToken => scriptTag;
 
   @override
   Token get endToken => scriptTag;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitScriptTag(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -15760,15 +16264,12 @@
    * @param keyword the comma introducing the combinator
    * @param shownNames the list of names from the library that are made visible by this combinator
    */
-  ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keyword) {
-    this._shownNames = new NodeList<SimpleIdentifier>(this);
-    this._shownNames.addAll(shownNames);
+  ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames)
+      : super(keyword) {
+    _shownNames = new NodeList<SimpleIdentifier>(this, shownNames);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitShowCombinator(this);
-
-  @override
   Token get endToken => _shownNames.endToken;
 
   /**
@@ -15779,6 +16280,9 @@
   NodeList<SimpleIdentifier> get shownNames => _shownNames;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitShowCombinator(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _shownNames.accept(visitor);
   }
@@ -15918,19 +16422,22 @@
   R visitFunctionDeclaration(FunctionDeclaration node) => null;
 
   @override
-  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => null;
+  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      null;
 
   @override
   R visitFunctionExpression(FunctionExpression node) => null;
 
   @override
-  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => null;
+  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
+      null;
 
   @override
   R visitFunctionTypeAlias(FunctionTypeAlias node) => null;
 
   @override
-  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => null;
+  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
+      null;
 
   @override
   R visitHideCombinator(HideCombinator node) => null;
@@ -16023,7 +16530,9 @@
   R visitPropertyAccess(PropertyAccess node) => null;
 
   @override
-  R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null;
+  R
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
+      null;
 
   @override
   R visitRethrowExpression(RethrowExpression node) => null;
@@ -16098,7 +16607,8 @@
   R visitVariableDeclarationList(VariableDeclarationList node) => null;
 
   @override
-  R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null;
+  R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
+      null;
 
   @override
   R visitWhileStatement(WhileStatement node) => null;
@@ -16140,14 +16650,13 @@
    * @param type the name of the declared type of the parameter
    * @param identifier the name of the parameter being declared
    */
-  SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identifier) {
-    this._type = becomeParentOf(type);
+  SimpleFormalParameter(Comment comment, List<Annotation> metadata,
+      this.keyword, TypeName type, SimpleIdentifier identifier)
+      : super(comment, metadata, identifier) {
+    _type = becomeParentOf(type);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this);
-
-  @override
   Token get beginToken {
     NodeList<Annotation> metadata = this.metadata;
     if (!metadata.isEmpty) {
@@ -16163,6 +16672,14 @@
   @override
   Token get endToken => identifier.endToken;
 
+  @override
+  bool get isConst =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
+
+  @override
+  bool get isFinal =>
+      (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
+
   /**
    * Return the name of the declared type of the parameter, or `null` if the parameter does
    * not have a declared type.
@@ -16171,12 +16688,6 @@
    */
   TypeName get type => _type;
 
-  @override
-  bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
-
-  @override
-  bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
-
   /**
    * Set the name of the declared type of the parameter to the given type name.
    *
@@ -16187,6 +16698,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_type, visitor);
@@ -16240,9 +16754,6 @@
   SimpleIdentifier(this.token);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this);
-
-  @override
   Token get beginToken => token;
 
   @override
@@ -16256,6 +16767,32 @@
   @override
   Token get endToken => token;
 
+  /**
+   * Returns `true` if this identifier is the "name" part of a prefixed identifier or a method
+   * invocation.
+   *
+   * @return `true` if this identifier is the "name" part of a prefixed identifier or a method
+   *         invocation
+   */
+  bool get isQualified {
+    AstNode parent = this.parent;
+    if (parent is PrefixedIdentifier) {
+      return identical(parent.identifier, this);
+    }
+    if (parent is PropertyAccess) {
+      return identical(parent.propertyName, this);
+    }
+    if (parent is MethodInvocation) {
+      MethodInvocation invocation = parent;
+      return identical(invocation.methodName, this) &&
+          invocation.realTarget != null;
+    }
+    return false;
+  }
+
+  @override
+  bool get isSynthetic => token.isSynthetic;
+
   @override
   String get name => token.lexeme;
 
@@ -16265,10 +16802,33 @@
   @override
   Element get propagatedElement => _propagatedElement;
 
+  /**
+   * Set the element associated with this identifier based on propagated type information to the
+   * given element.
+   *
+   * @param element the element to be associated with this identifier
+   */
+  void set propagatedElement(Element element) {
+    _propagatedElement = _validateElement(element);
+  }
+
   @override
   Element get staticElement => _staticElement;
 
   /**
+   * Set the element associated with this identifier based on static type information to the given
+   * element.
+   *
+   * @param element the element to be associated with this identifier
+   */
+  void set staticElement(Element element) {
+    _staticElement = _validateElement(element);
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this);
+
+  /**
    * Return `true` if this identifier is the name being declared in a declaration.
    *
    * @return `true` if this identifier is the name being declared in a declaration
@@ -16298,10 +16858,12 @@
     } else if (parent is ImportDirective) {
       return identical(this, parent.prefix);
     } else if (parent is Label) {
-      return identical(this, parent.label) && (parent.parent is LabeledStatement);
+      return identical(this, parent.label) &&
+          (parent.parent is LabeledStatement);
     } else if (parent is MethodDeclaration) {
       return identical(this, parent.name);
-    } else if (parent is FunctionTypedFormalParameter || parent is SimpleFormalParameter) {
+    } else if (parent is FunctionTypedFormalParameter ||
+        parent is SimpleFormalParameter) {
       return identical(this, (parent as NormalFormalParameter).identifier);
     } else if (parent is TypeParameter) {
       return identical(this, parent.name);
@@ -16346,7 +16908,8 @@
     // analyze usage
     if (parent is AssignmentExpression) {
       AssignmentExpression expr = parent as AssignmentExpression;
-      if (identical(expr.leftHandSide, target) && expr.operator.type == TokenType.EQ) {
+      if (identical(expr.leftHandSide, target) &&
+          expr.operator.type == TokenType.EQ) {
         return false;
       }
     }
@@ -16401,51 +16964,6 @@
     return false;
   }
 
-  /**
-   * Returns `true` if this identifier is the "name" part of a prefixed identifier or a method
-   * invocation.
-   *
-   * @return `true` if this identifier is the "name" part of a prefixed identifier or a method
-   *         invocation
-   */
-  bool get isQualified {
-    AstNode parent = this.parent;
-    if (parent is PrefixedIdentifier) {
-      return identical(parent.identifier, this);
-    }
-    if (parent is PropertyAccess) {
-      return identical(parent.propertyName, this);
-    }
-    if (parent is MethodInvocation) {
-      MethodInvocation invocation = parent;
-      return identical(invocation.methodName, this) && invocation.realTarget != null;
-    }
-    return false;
-  }
-
-  @override
-  bool get isSynthetic => token.isSynthetic;
-
-  /**
-   * Set the element associated with this identifier based on propagated type information to the
-   * given element.
-   *
-   * @param element the element to be associated with this identifier
-   */
-  void set propagatedElement(Element element) {
-    _propagatedElement = _validateElement(element);
-  }
-
-  /**
-   * Set the element associated with this identifier based on static type information to the given
-   * element.
-   *
-   * @param element the element to be associated with this identifier
-   */
-  void set staticElement(Element element) {
-    _staticElement = _validateElement(element);
-  }
-
   @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
@@ -16460,7 +16978,8 @@
    * @param element the element to be associated with this identifier
    * @return the element to be associated with this identifier
    */
-  Element _returnOrReportElement(AstNode parent, bool isValid, Element element) {
+  Element _returnOrReportElement(AstNode parent, bool isValid,
+      Element element) {
     if (!isValid) {
       AnalysisEngine.instance.logger.logInformation(
           "Internal error: attempting to set the name of a ${parent.runtimeType} to a ${element.runtimeType}",
@@ -16486,20 +17005,43 @@
       return _returnOrReportElement(parent, element is ClassElement, element);
     } else if (parent is ClassTypeAlias && identical(parent.name, this)) {
       return _returnOrReportElement(parent, element is ClassElement, element);
-    } else if (parent is DeclaredIdentifier && identical(parent.identifier, this)) {
-      return _returnOrReportElement(parent, element is LocalVariableElement, element);
-    } else if (parent is FormalParameter && identical(parent.identifier, this)) {
-      return _returnOrReportElement(parent, element is ParameterElement, element);
+    } else if (parent is DeclaredIdentifier &&
+        identical(parent.identifier, this)) {
+      return _returnOrReportElement(
+          parent,
+          element is LocalVariableElement,
+          element);
+    } else if (parent is FormalParameter &&
+        identical(parent.identifier, this)) {
+      return _returnOrReportElement(
+          parent,
+          element is ParameterElement,
+          element);
     } else if (parent is FunctionDeclaration && identical(parent.name, this)) {
-      return _returnOrReportElement(parent, element is ExecutableElement, element);
+      return _returnOrReportElement(
+          parent,
+          element is ExecutableElement,
+          element);
     } else if (parent is FunctionTypeAlias && identical(parent.name, this)) {
-      return _returnOrReportElement(parent, element is FunctionTypeAliasElement, element);
+      return _returnOrReportElement(
+          parent,
+          element is FunctionTypeAliasElement,
+          element);
     } else if (parent is MethodDeclaration && identical(parent.name, this)) {
-      return _returnOrReportElement(parent, element is ExecutableElement, element);
+      return _returnOrReportElement(
+          parent,
+          element is ExecutableElement,
+          element);
     } else if (parent is TypeParameter && identical(parent.name, this)) {
-      return _returnOrReportElement(parent, element is TypeParameterElement, element);
+      return _returnOrReportElement(
+          parent,
+          element is TypeParameterElement,
+          element);
     } else if (parent is VariableDeclaration && identical(parent.name, this)) {
-      return _returnOrReportElement(parent, element is VariableElement, element);
+      return _returnOrReportElement(
+          parent,
+          element is VariableElement,
+          element);
     }
     return element;
   }
@@ -16544,7 +17086,7 @@
   /**
    * The toolkit specific element associated with this literal, or `null`.
    */
-  Element _toolkitElement;
+  Element toolkitElement;
 
   /**
    * Initialize a newly created simple string literal.
@@ -16553,14 +17095,16 @@
    * @param value the value of the literal
    */
   SimpleStringLiteral(this.literal, String value) {
-    this._value = StringUtilities.intern(value);
+    _value = StringUtilities.intern(value);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this);
+  Token get beginToken => literal;
 
   @override
-  Token get beginToken => literal;
+  int get contentsEnd {
+    return contentsOffset + value.length;
+  }
 
   @override
   int get contentsOffset {
@@ -16577,27 +17121,8 @@
   }
 
   @override
-  int get contentsEnd {
-    return contentsOffset + value.length;
-  }
-
-  @override
   Token get endToken => literal;
 
-  /**
-   * Return the toolkit specific, non-Dart, element associated with this literal, or `null`.
-   *
-   * @return the element associated with this literal
-   */
-  Element get toolkitElement => _toolkitElement;
-
-  /**
-   * Return the value of the literal.
-   *
-   * @return the value of the literal
-   */
-  String get value => _value;
-
   @override
   bool get isMultiline {
     String lexeme = literal.lexeme;
@@ -16634,13 +17159,11 @@
   bool get isSynthetic => literal.isSynthetic;
 
   /**
-   * Set the toolkit specific, non-Dart, element associated with this literal.
+   * Return the value of the literal.
    *
-   * @param element the toolkit specific element to be associated with this literal
+   * @return the value of the literal
    */
-  void set toolkitElement(Element element) {
-    _toolkitElement = element;
-  }
+  String get value => _value;
 
   /**
    * Set the value of the literal to the given string.
@@ -16652,14 +17175,55 @@
   }
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    // There are no children to visit.
-  }
+  accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this);
 
   @override
   void appendStringValue(StringBuffer buffer) {
     buffer.write(value);
   }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    // There are no children to visit.
+  }
+}
+
+/**
+ * Instances of the class [SingleStringLiteral] represent a single string
+ * literal expression.
+ *
+ * <pre>
+ * singleStringLiteral ::=
+ *     [SimpleStringLiteral]
+ *   | [StringInterpolation]
+ * </pre>
+ */
+abstract class SingleStringLiteral extends StringLiteral {
+  /**
+   * Return the offset of the after-last contents character.
+   */
+  int get contentsEnd;
+
+  /**
+   * Return the offset of the first contents character.
+   */
+  int get contentsOffset;
+
+  /**
+   * Return `true` if this string literal is a multi-line string.
+   */
+  bool get isMultiline;
+
+  /**
+   * Return `true` if this string literal is a raw string.
+   */
+  bool get isRaw;
+
+  /**
+   * Return `true` if this string literal uses single qoutes (' or ''').
+   * Return `false` if this string literal uses double qoutes (" or """).
+   */
+  bool get isSingleQuoted;
 }
 
 /**
@@ -16685,6 +17249,11 @@
  * </pre>
  */
 abstract class Statement extends AstNode {
+  /**
+   * If this is a labeled statement, return the unlabeled portion of the
+   * statement.  Otherwise return the statement itself.
+   */
+  Statement get unlabeled => this;
 }
 
 /**
@@ -16708,15 +17277,23 @@
    * @param elements the elements that will be composed to produce the resulting string
    */
   StringInterpolation(List<InterpolationElement> elements) {
-    this._elements = new NodeList<InterpolationElement>(this);
-    this._elements.addAll(elements);
+    _elements = new NodeList<InterpolationElement>(this, elements);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitStringInterpolation(this);
+  Token get beginToken => _elements.beginToken;
 
   @override
-  Token get beginToken => _elements.beginToken;
+  int get contentsEnd {
+    InterpolationString element = _elements.last;
+    return element.contentsEnd;
+  }
+
+  @override
+  int get contentsOffset {
+    InterpolationString element = _elements.first;
+    return element.contentsOffset;
+  }
 
   /**
    * Return the elements that will be composed to produce the resulting string.
@@ -16729,31 +17306,9 @@
   Token get endToken => _elements.endToken;
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    _elements.accept(visitor);
-  }
-
-  @override
-  void appendStringValue(StringBuffer buffer) {
-    throw new IllegalArgumentException();
-  }
-
-  @override
-  int get contentsOffset {
-    InterpolationString element = _elements.first;
-    return element.contentsOffset;
-  }
-
-  @override
-  int get contentsEnd {
-    InterpolationString element = _elements.last;
-    return element.contentsEnd;
-  }
-
-  @override
   bool get isMultiline {
     InterpolationString element = _elements.first;
-    String lexeme = element._contents.lexeme;
+    String lexeme = element.contents.lexeme;
     if (lexeme.length < 3) {
       return false;
     }
@@ -16764,13 +17319,26 @@
   @override
   bool get isRaw => false;
 
-
   @override
   bool get isSingleQuoted {
     InterpolationString lastString = _elements.first;
-    String lexeme = lastString._contents.lexeme;
+    String lexeme = lastString.contents.lexeme;
     return StringUtilities.startsWithChar(lexeme, 0x27);
   }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitStringInterpolation(this);
+
+  @override
+  void appendStringValue(StringBuffer buffer) {
+    throw new IllegalArgumentException();
+  }
+
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _elements.accept(visitor);
+  }
 }
 
 /**
@@ -16807,44 +17375,6 @@
 }
 
 /**
- * Instances of the class [SingleStringLiteral] represent a single string
- * literal expression.
- *
- * <pre>
- * singleStringLiteral ::=
- *     [SimpleStringLiteral]
- *   | [StringInterpolation]
- * </pre>
- */
-abstract class SingleStringLiteral extends StringLiteral {
-  /**
-   * Return the offset of the first contents character.
-   */
-  int get contentsOffset;
-
-  /**
-   * Return the offset of the after-last contents character.
-   */
-  int get contentsEnd;
-
-  /**
-   * Return `true` if this string literal is a multi-line string.
-   */
-  bool get isMultiline;
-
-  /**
-   * Return `true` if this string literal is a raw string.
-   */
-  bool get isRaw;
-
-  /**
-   * Return `true` if this string literal uses single qoutes (' or ''').
-   * Return `false` if this string literal uses double qoutes (" or """).
-   */
-  bool get isSingleQuoted;
-}
-
-/**
  * Instances of the class `SuperConstructorInvocation` represent the invocation of a
  * superclass' constructor from within a constructor's initialization list.
  *
@@ -16891,14 +17421,12 @@
    * @param constructorName the name of the constructor that is being invoked
    * @param argumentList the list of arguments to the constructor
    */
-  SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constructorName, ArgumentList argumentList) {
-    this._constructorName = becomeParentOf(constructorName);
-    this._argumentList = becomeParentOf(argumentList);
+  SuperConstructorInvocation(this.keyword, this.period,
+      SimpleIdentifier constructorName, ArgumentList argumentList) {
+    _constructorName = becomeParentOf(constructorName);
+    _argumentList = becomeParentOf(argumentList);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
-
   /**
    * Return the list of arguments to the constructor.
    *
@@ -16906,6 +17434,15 @@
    */
   ArgumentList get argumentList => _argumentList;
 
+  /**
+   * Set the list of arguments to the constructor to the given list.
+   *
+   * @param argumentList the list of arguments to the constructor
+   */
+  void set argumentList(ArgumentList argumentList) {
+    _argumentList = becomeParentOf(argumentList);
+  }
+
   @override
   Token get beginToken => keyword;
 
@@ -16917,18 +17454,6 @@
    */
   SimpleIdentifier get constructorName => _constructorName;
 
-  @override
-  Token get endToken => _argumentList.endToken;
-
-  /**
-   * Set the list of arguments to the constructor to the given list.
-   *
-   * @param argumentList the list of arguments to the constructor
-   */
-  void set argumentList(ArgumentList argumentList) {
-    this._argumentList = becomeParentOf(argumentList);
-  }
-
   /**
    * Set the name of the constructor that is being invoked to the given identifier.
    *
@@ -16939,6 +17464,12 @@
   }
 
   @override
+  Token get endToken => _argumentList.endToken;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_constructorName, visitor);
     safelyVisitChild(_argumentList, visitor);
@@ -16967,9 +17498,6 @@
   SuperExpression(this.keyword);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSuperExpression(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -16979,6 +17507,9 @@
   int get precedence => 16;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitSuperExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -17007,13 +17538,12 @@
    * @param colon the colon separating the keyword or the expression from the statements
    * @param statements the statements that will be executed if this switch member is selected
    */
-  SwitchCase(List<Label> labels, Token keyword, Expression expression, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements) {
-    this._expression = becomeParentOf(expression);
+  SwitchCase(List<Label> labels, Token keyword, Expression expression,
+      Token colon, List<Statement> statements)
+      : super(labels, keyword, colon, statements) {
+    _expression = becomeParentOf(expression);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitSwitchCase(this);
-
   /**
    * Return the expression controlling whether the statements will be executed.
    *
@@ -17027,10 +17557,13 @@
    * @param expression the expression controlling whether the statements will be executed
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitSwitchCase(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     labels.accept(visitor);
     safelyVisitChild(_expression, visitor);
@@ -17055,7 +17588,9 @@
    * @param colon the colon separating the keyword or the expression from the statements
    * @param statements the statements that will be executed if this switch member is selected
    */
-  SwitchDefault(List<Label> labels, Token keyword, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements);
+  SwitchDefault(List<Label> labels, Token keyword, Token colon,
+      List<Statement> statements)
+      : super(labels, keyword, colon, statements);
 
   @override
   accept(AstVisitor visitor) => visitor.visitSwitchDefault(this);
@@ -17106,11 +17641,10 @@
    * @param colon the colon separating the keyword or the expression from the statements
    * @param statements the statements that will be executed if this switch member is selected
    */
-  SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> statements) {
-    this._labels = new NodeList<Label>(this);
-    this._statements = new NodeList<Statement>(this);
-    this._labels.addAll(labels);
-    this._statements.addAll(statements);
+  SwitchMember(List<Label> labels, this.keyword, this.colon,
+      List<Statement> statements) {
+    _labels = new NodeList<Label>(this, labels);
+    _statements = new NodeList<Statement>(this, statements);
   }
 
   @override
@@ -17199,16 +17733,14 @@
    * @param members the switch members that can be selected by the expression
    * @param rightBracket the right curly bracket
    */
-  SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, this.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBracket) {
-    this._members = new NodeList<SwitchMember>(this);
-    this._expression = becomeParentOf(expression);
-    this._members.addAll(members);
+  SwitchStatement(this.keyword, this.leftParenthesis, Expression expression,
+      this.rightParenthesis, this.leftBracket, List<SwitchMember> members,
+      this.rightBracket) {
+    _expression = becomeParentOf(expression);
+    _members = new NodeList<SwitchMember>(this, members);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSwitchStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -17222,22 +17754,25 @@
   Expression get expression => _expression;
 
   /**
-   * Return the switch members that can be selected by the expression.
-   *
-   * @return the switch members that can be selected by the expression
-   */
-  NodeList<SwitchMember> get members => _members;
-
-  /**
    * Set the expression used to determine which of the switch members will be selected to the given
    * expression.
    *
    * @param expression the expression used to determine which of the switch members will be selected
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
+  /**
+   * Return the switch members that can be selected by the expression.
+   *
+   * @return the switch members that can be selected by the expression
+   */
+  NodeList<SwitchMember> get members => _members;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitSwitchStatement(this);
+
   @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
@@ -17273,15 +17808,15 @@
   SymbolLiteral(this.poundSign, this.components);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this);
-
-  @override
   Token get beginToken => poundSign;
 
   @override
   Token get endToken => components[components.length - 1];
 
   @override
+  accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -17309,9 +17844,6 @@
   ThisExpression(this.keyword);
 
   @override
-  accept(AstVisitor visitor) => visitor.visitThisExpression(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -17321,6 +17853,9 @@
   int get precedence => 16;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitThisExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     // There are no children to visit.
   }
@@ -17352,13 +17887,10 @@
    * @param expression the expression computing the exception to be thrown
    */
   ThrowExpression(this.keyword, Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitThrowExpression(this);
-
-  @override
   Token get beginToken => keyword;
 
   @override
@@ -17376,25 +17908,98 @@
    */
   Expression get expression => _expression;
 
-  @override
-  int get precedence => 0;
-
   /**
    * Set the expression computing the exception to be thrown to the given expression.
    *
    * @param expression the expression computing the exception to be thrown
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  int get precedence => 0;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitThrowExpression(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
 }
 
 /**
+ * Instances of the class `TopLevelVariableDeclaration` represent the declaration of one or
+ * more top-level variables of the same type.
+ *
+ * <pre>
+ * topLevelVariableDeclaration ::=
+ *     ('final' | 'const') type? staticFinalDeclarationList ';'
+ *   | variableDeclaration ';'
+ * </pre>
+ */
+class TopLevelVariableDeclaration extends CompilationUnitMember {
+  /**
+   * The top-level variables being declared.
+   */
+  VariableDeclarationList _variableList;
+
+  /**
+   * The semicolon terminating the declaration.
+   */
+  Token semicolon;
+
+  /**
+   * Initialize a newly created top-level variable declaration.
+   *
+   * @param comment the documentation comment associated with this variable
+   * @param metadata the annotations associated with this variable
+   * @param variableList the top-level variables being declared
+   * @param semicolon the semicolon terminating the declaration
+   */
+  TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata,
+      VariableDeclarationList variableList, this.semicolon)
+      : super(comment, metadata) {
+    _variableList = becomeParentOf(variableList);
+  }
+
+  @override
+  Element get element => null;
+
+  @override
+  Token get endToken => semicolon;
+
+  @override
+  Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
+
+  /**
+   * Return the top-level variables being declared.
+   *
+   * @return the top-level variables being declared
+   */
+  VariableDeclarationList get variables => _variableList;
+
+  /**
+   * Set the top-level variables being declared to the given list of variables.
+   *
+   * @param variableList the top-level variables being declared
+   */
+  void set variables(VariableDeclarationList variableList) {
+    _variableList = becomeParentOf(variableList);
+  }
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(_variableList, visitor);
+  }
+}
+
+/**
  * Instances of the class `ToSourceVisitor` write a source representation of a visited AST
  * node (and all of it's children) to a writer.
  */
@@ -18157,7 +18762,8 @@
   }
 
   @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     _writer.print("this");
     _visitNodeWithPrefix(".", node.constructorName);
     _visitNode(node.argumentList);
@@ -18447,7 +19053,8 @@
    * @param nodes the nodes to be printed
    * @param separator the separator to be printed between adjacent nodes
    */
-  void _visitNodeListWithSeparatorAndPrefix(String prefix, NodeList<AstNode> nodes, String separator) {
+  void _visitNodeListWithSeparatorAndPrefix(String prefix,
+      NodeList<AstNode> nodes, String separator) {
     if (nodes != null) {
       int size = nodes.length;
       if (size > 0) {
@@ -18469,7 +19076,8 @@
    * @param separator the separator to be printed between adjacent nodes
    * @param suffix the suffix to be printed if the list is not empty
    */
-  void _visitNodeListWithSeparatorAndSuffix(NodeList<AstNode> nodes, String separator, String suffix) {
+  void _visitNodeListWithSeparatorAndSuffix(NodeList<AstNode> nodes,
+      String separator, String suffix) {
     if (nodes != null) {
       int size = nodes.length;
       if (size > 0) {
@@ -18525,74 +19133,6 @@
 }
 
 /**
- * Instances of the class `TopLevelVariableDeclaration` represent the declaration of one or
- * more top-level variables of the same type.
- *
- * <pre>
- * topLevelVariableDeclaration ::=
- *     ('final' | 'const') type? staticFinalDeclarationList ';'
- *   | variableDeclaration ';'
- * </pre>
- */
-class TopLevelVariableDeclaration extends CompilationUnitMember {
-  /**
-   * The top-level variables being declared.
-   */
-  VariableDeclarationList _variableList;
-
-  /**
-   * The semicolon terminating the declaration.
-   */
-  Token semicolon;
-
-  /**
-   * Initialize a newly created top-level variable declaration.
-   *
-   * @param comment the documentation comment associated with this variable
-   * @param metadata the annotations associated with this variable
-   * @param variableList the top-level variables being declared
-   * @param semicolon the semicolon terminating the declaration
-   */
-  TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, VariableDeclarationList variableList, this.semicolon) : super(comment, metadata) {
-    this._variableList = becomeParentOf(variableList);
-  }
-
-  @override
-  accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
-
-  @override
-  Element get element => null;
-
-  @override
-  Token get endToken => semicolon;
-
-  /**
-   * Return the top-level variables being declared.
-   *
-   * @return the top-level variables being declared
-   */
-  VariableDeclarationList get variables => _variableList;
-
-  /**
-   * Set the top-level variables being declared to the given list of variables.
-   *
-   * @param variableList the top-level variables being declared
-   */
-  void set variables(VariableDeclarationList variableList) {
-    this._variableList = becomeParentOf(variableList);
-  }
-
-  @override
-  void visitChildren(AstVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(_variableList, visitor);
-  }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
-}
-
-/**
  * Instances of the class `TryStatement` represent a try statement.
  *
  * <pre>
@@ -18640,17 +19180,14 @@
    * @param finallyKeyword the token representing the 'finally' keyword
    * @param finallyBlock the finally block contained in the try statement
    */
-  TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this.finallyKeyword, Block finallyBlock) {
-    this._catchClauses = new NodeList<CatchClause>(this);
-    this._body = becomeParentOf(body);
-    this._catchClauses.addAll(catchClauses);
-    this._finallyBlock = becomeParentOf(finallyBlock);
+  TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses,
+      this.finallyKeyword, Block finallyBlock) {
+    _body = becomeParentOf(body);
+    _catchClauses = new NodeList<CatchClause>(this, catchClauses);
+    _finallyBlock = becomeParentOf(finallyBlock);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitTryStatement(this);
-
-  @override
   Token get beginToken => tryKeyword;
 
   /**
@@ -18661,6 +19198,15 @@
   Block get body => _body;
 
   /**
+   * Set the body of the statement to the given block.
+   *
+   * @param block the body of the statement
+   */
+  void set body(Block block) {
+    _body = becomeParentOf(block);
+  }
+
+  /**
    * Return the catch clauses contained in the try statement.
    *
    * @return the catch clauses contained in the try statement
@@ -18688,15 +19234,6 @@
   Block get finallyBlock => _finallyBlock;
 
   /**
-   * Set the body of the statement to the given block.
-   *
-   * @param block the body of the statement
-   */
-  void set body(Block block) {
-    _body = becomeParentOf(block);
-  }
-
-  /**
    * Set the finally block contained in the try statement to the given block.
    *
    * @param block the finally block contained in the try statement
@@ -18706,6 +19243,9 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitTryStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_body, visitor);
     _catchClauses.accept(visitor);
@@ -18744,7 +19284,9 @@
    * @param keyword the token representing the 'typedef' keyword
    * @param semicolon the semicolon terminating the declaration
    */
-  TypeAlias(Comment comment, List<Annotation> metadata, this.keyword, this.semicolon) : super(comment, metadata);
+  TypeAlias(Comment comment, List<Annotation> metadata, this.keyword,
+      this.semicolon)
+      : super(comment, metadata);
 
   @override
   Token get endToken => semicolon;
@@ -18784,14 +19326,11 @@
    * @param arguments the type arguments associated with the type
    * @param rightBracket the right bracket
    */
-  TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket) {
-    this._arguments = new NodeList<TypeName>(this);
-    this._arguments.addAll(arguments);
+  TypeArgumentList(this.leftBracket, List<TypeName> arguments,
+      this.rightBracket) {
+    _arguments = new NodeList<TypeName>(this, arguments);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this);
-
   /**
    * Return the type arguments associated with the type.
    *
@@ -18806,12 +19345,71 @@
   Token get endToken => rightBracket;
 
   @override
+  accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     _arguments.accept(visitor);
   }
 }
 
 /**
+ * The abstract class `TypedLiteral` defines the behavior common to literals that have a type
+ * associated with them.
+ *
+ * <pre>
+ * listLiteral ::=
+ *     [ListLiteral]
+ *   | [MapLiteral]
+ * </pre>
+ */
+abstract class TypedLiteral extends Literal {
+  /**
+   * The token representing the 'const' keyword, or `null` if the literal is not a constant.
+   */
+  Token constKeyword;
+
+  /**
+   * The type argument associated with this literal, or `null` if no type arguments were
+   * declared.
+   */
+  TypeArgumentList _typeArguments;
+
+  /**
+   * Initialize a newly created typed literal.
+   *
+   * @param constKeyword the token representing the 'const' keyword
+   * @param typeArguments the type argument associated with this literal, or `null` if no type
+   *          arguments were declared
+   */
+  TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
+    _typeArguments = becomeParentOf(typeArguments);
+  }
+
+  /**
+   * Return the type argument associated with this literal, or `null` if no type arguments
+   * were declared.
+   *
+   * @return the type argument associated with this literal
+   */
+  TypeArgumentList get typeArguments => _typeArguments;
+
+  /**
+   * Set the type argument associated with this literal to the given arguments.
+   *
+   * @param typeArguments the type argument associated with this literal
+   */
+  void set typeArguments(TypeArgumentList typeArguments) {
+    _typeArguments = becomeParentOf(typeArguments);
+  }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    safelyVisitChild(_typeArguments, visitor);
+  }
+}
+
+/**
  * Instances of the class `TypeName` represent the name of a type, which can optionally
  * include type arguments.
  *
@@ -18844,14 +19442,11 @@
    *          no type arguments
    */
   TypeName(Identifier name, TypeArgumentList typeArguments) {
-    this._name = becomeParentOf(name);
-    this._typeArguments = becomeParentOf(typeArguments);
+    _name = becomeParentOf(name);
+    _typeArguments = becomeParentOf(typeArguments);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitTypeName(this);
-
-  @override
   Token get beginToken => _name.beginToken;
 
   @override
@@ -18863,21 +19458,6 @@
   }
 
   /**
-   * Return the name of the type.
-   *
-   * @return the name of the type
-   */
-  Identifier get name => _name;
-
-  /**
-   * Return the type arguments associated with the type, or `null` if there are no type
-   * arguments.
-   *
-   * @return the type arguments associated with the type
-   */
-  TypeArgumentList get typeArguments => _typeArguments;
-
-  /**
    * Return `true` if this type is a deferred type.
    *
    * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
@@ -18897,6 +19477,13 @@
   bool get isSynthetic => _name.isSynthetic && _typeArguments == null;
 
   /**
+   * Return the name of the type.
+   *
+   * @return the name of the type
+   */
+  Identifier get name => _name;
+
+  /**
    * Set the name of the type to the given identifier.
    *
    * @param identifier the name of the type
@@ -18906,15 +19493,26 @@
   }
 
   /**
+   * Return the type arguments associated with the type, or `null` if there are no type
+   * arguments.
+   *
+   * @return the type arguments associated with the type
+   */
+  TypeArgumentList get typeArguments => _typeArguments;
+
+  /**
    * Set the type arguments associated with the type to the given type arguments.
    *
    * @param typeArguments the type arguments associated with the type
    */
   void set typeArguments(TypeArgumentList typeArguments) {
-    this._typeArguments = becomeParentOf(typeArguments);
+    _typeArguments = becomeParentOf(typeArguments);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitTypeName(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_typeArguments, visitor);
@@ -18956,14 +19554,13 @@
    * @param keyword the token representing the 'extends' keyword
    * @param bound the name of the upper bound for legal arguments
    */
-  TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier name, this.keyword, TypeName bound) : super(comment, metadata) {
-    this._name = becomeParentOf(name);
-    this._bound = becomeParentOf(bound);
+  TypeParameter(Comment comment, List<Annotation> metadata,
+      SimpleIdentifier name, this.keyword, TypeName bound)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
+    _bound = becomeParentOf(bound);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitTypeParameter(this);
-
   /**
    * Return the name of the upper bound for legal arguments, or `null` if there was no
    * explicit upper bound.
@@ -18972,8 +19569,18 @@
    */
   TypeName get bound => _bound;
 
+  /**
+   * Set the name of the upper bound for legal arguments to the given type name.
+   *
+   * @param typeName the name of the upper bound for legal arguments
+   */
+  void set bound(TypeName typeName) {
+    _bound = becomeParentOf(typeName);
+  }
+
   @override
-  TypeParameterElement get element => _name != null ? (_name.staticElement as TypeParameterElement) : null;
+  TypeParameterElement get element =>
+      _name != null ? (_name.staticElement as TypeParameterElement) : null;
 
   @override
   Token get endToken {
@@ -18983,6 +19590,9 @@
     return _bound.endToken;
   }
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
+
   /**
    * Return the name of the type parameter.
    *
@@ -18991,15 +19601,6 @@
   SimpleIdentifier get name => _name;
 
   /**
-   * Set the name of the upper bound for legal arguments to the given type name.
-   *
-   * @param typeName the name of the upper bound for legal arguments
-   */
-  void set bound(TypeName typeName) {
-    _bound = becomeParentOf(typeName);
-  }
-
-  /**
    * Set the name of the type parameter to the given identifier.
    *
    * @param identifier the name of the type parameter
@@ -19009,14 +19610,14 @@
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitTypeParameter(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_bound, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
 }
 
 /**
@@ -19050,15 +19651,12 @@
    * @param typeParameters the type parameters in the list
    * @param rightBracket the right angle bracket
    */
-  TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.rightBracket) {
-    this._typeParameters = new NodeList<TypeParameter>(this);
-    this._typeParameters.addAll(typeParameters);
+  TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters,
+      this.rightBracket) {
+    _typeParameters = new NodeList<TypeParameter>(this, typeParameters);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitTypeParameterList(this);
-
-  @override
   Token get beginToken => leftBracket;
 
   @override
@@ -19072,64 +19670,11 @@
   NodeList<TypeParameter> get typeParameters => _typeParameters;
 
   @override
-  void visitChildren(AstVisitor visitor) {
-    _typeParameters.accept(visitor);
-  }
-}
-
-/**
- * The abstract class `TypedLiteral` defines the behavior common to literals that have a type
- * associated with them.
- *
- * <pre>
- * listLiteral ::=
- *     [ListLiteral]
- *   | [MapLiteral]
- * </pre>
- */
-abstract class TypedLiteral extends Literal {
-  /**
-   * The token representing the 'const' keyword, or `null` if the literal is not a constant.
-   */
-  Token constKeyword;
-
-  /**
-   * The type argument associated with this literal, or `null` if no type arguments were
-   * declared.
-   */
-  TypeArgumentList _typeArguments;
-
-  /**
-   * Initialize a newly created typed literal.
-   *
-   * @param constKeyword the token representing the 'const' keyword
-   * @param typeArguments the type argument associated with this literal, or `null` if no type
-   *          arguments were declared
-   */
-  TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
-    this._typeArguments = becomeParentOf(typeArguments);
-  }
-
-  /**
-   * Return the type argument associated with this literal, or `null` if no type arguments
-   * were declared.
-   *
-   * @return the type argument associated with this literal
-   */
-  TypeArgumentList get typeArguments => _typeArguments;
-
-  /**
-   * Set the type argument associated with this literal to the given arguments.
-   *
-   * @param typeArguments the type argument associated with this literal
-   */
-  void set typeArguments(TypeArgumentList typeArguments) {
-    this._typeArguments = becomeParentOf(typeArguments);
-  }
+  accept(AstVisitor visitor) => visitor.visitTypeParameterList(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
-    safelyVisitChild(_typeArguments, visitor);
+    _typeParameters.accept(visitor);
   }
 }
 
@@ -19208,7 +19753,8 @@
   R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node);
 
   @override
-  R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitNode(node);
+  R visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
+      visitNode(node);
 
   @override
   R visitConstructorName(ConstructorName node) => visitNode(node);
@@ -19235,7 +19781,8 @@
   R visitEmptyStatement(EmptyStatement node) => visitNode(node);
 
   @override
-  R visitEnumConstantDeclaration(EnumConstantDeclaration node) => visitNode(node);
+  R visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
+      visitNode(node);
 
   @override
   R visitEnumDeclaration(EnumDeclaration node) => visitNode(node);
@@ -19271,19 +19818,22 @@
   R visitFunctionDeclaration(FunctionDeclaration node) => visitNode(node);
 
   @override
-  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visitNode(node);
+  R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      visitNode(node);
 
   @override
   R visitFunctionExpression(FunctionExpression node) => visitNode(node);
 
   @override
-  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visitNode(node);
+  R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
+      visitNode(node);
 
   @override
   R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node);
 
   @override
-  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visitNode(node);
+  R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
+      visitNode(node);
 
   @override
   R visitHideCombinator(HideCombinator node) => visitNode(node);
@@ -19301,13 +19851,15 @@
   R visitIndexExpression(IndexExpression node) => visitNode(node);
 
   @override
-  R visitInstanceCreationExpression(InstanceCreationExpression node) => visitNode(node);
+  R visitInstanceCreationExpression(InstanceCreationExpression node) =>
+      visitNode(node);
 
   @override
   R visitIntegerLiteral(IntegerLiteral node) => visitNode(node);
 
   @override
-  R visitInterpolationExpression(InterpolationExpression node) => visitNode(node);
+  R visitInterpolationExpression(InterpolationExpression node) =>
+      visitNode(node);
 
   @override
   R visitInterpolationString(InterpolationString node) => visitNode(node);
@@ -19360,7 +19912,8 @@
   R visitNullLiteral(NullLiteral node) => visitNode(node);
 
   @override
-  R visitParenthesizedExpression(ParenthesizedExpression node) => visitNode(node);
+  R visitParenthesizedExpression(ParenthesizedExpression node) =>
+      visitNode(node);
 
   @override
   R visitPartDirective(PartDirective node) => visitNode(node);
@@ -19381,7 +19934,9 @@
   R visitPropertyAccess(PropertyAccess node) => visitNode(node);
 
   @override
-  R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitNode(node);
+  R
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
+      visitNode(node);
 
   @override
   R visitRethrowExpression(RethrowExpression node) => visitNode(node);
@@ -19408,7 +19963,8 @@
   R visitStringInterpolation(StringInterpolation node) => visitNode(node);
 
   @override
-  R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitNode(node);
+  R visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
+      visitNode(node);
 
   @override
   R visitSuperExpression(SuperExpression node) => visitNode(node);
@@ -19432,7 +19988,8 @@
   R visitThrowExpression(ThrowExpression node) => visitNode(node);
 
   @override
-  R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitNode(node);
+  R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
+      visitNode(node);
 
   @override
   R visitTryStatement(TryStatement node) => visitNode(node);
@@ -19453,10 +20010,12 @@
   R visitVariableDeclaration(VariableDeclaration node) => visitNode(node);
 
   @override
-  R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node);
+  R visitVariableDeclarationList(VariableDeclarationList node) =>
+      visitNode(node);
 
   @override
-  R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visitNode(node);
+  R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
+      visitNode(node);
 
   @override
   R visitWhileStatement(WhileStatement node) => visitNode(node);
@@ -19481,16 +20040,16 @@
  */
 abstract class UriBasedDirective extends Directive {
   /**
-   * The URI referenced by this directive.
-   */
-  StringLiteral _uri;
-
-  /**
    * The prefix of a URI using the `dart-ext` scheme to reference a native code library.
    */
   static String _DART_EXT_SCHEME = "dart-ext:";
 
   /**
+   * The URI referenced by this directive.
+   */
+  StringLiteral _uri;
+
+  /**
    * The content of the URI.
    */
   String uriContent;
@@ -19507,8 +20066,10 @@
    * @param metadata the annotations associated with the directive
    * @param uri the URI referenced by this directive
    */
-  UriBasedDirective(Comment comment, List<Annotation> metadata, StringLiteral uri) : super(comment, metadata) {
-    this._uri = becomeParentOf(uri);
+  UriBasedDirective(Comment comment, List<Annotation> metadata,
+      StringLiteral uri)
+      : super(comment, metadata) {
+    _uri = becomeParentOf(uri);
   }
 
   /**
@@ -19519,6 +20080,15 @@
   StringLiteral get uri => _uri;
 
   /**
+   * Set the URI referenced by this directive to the given URI.
+   *
+   * @param uri the URI referenced by this directive
+   */
+  void set uri(StringLiteral uri) {
+    _uri = becomeParentOf(uri);
+  }
+
+  /**
    * Return the element associated with the URI of this directive, or `null` if the AST
    * structure has not been resolved or if the URI could not be resolved. Examples of the latter
    * case include a directive that contains an invalid URL or a URL that does not exist.
@@ -19528,15 +20098,6 @@
   Element get uriElement;
 
   /**
-   * Set the URI referenced by this directive to the given URI.
-   *
-   * @param uri the URI referenced by this directive
-   */
-  void set uri(StringLiteral uri) {
-    this._uri = becomeParentOf(uri);
-  }
-
-  /**
    * Validate the given directive, but do not check for existence.
    *
    * @return a code indicating the problem if there is one, or `null` no problem
@@ -19571,19 +20132,28 @@
 /**
  * Validation codes returned by [UriBasedDirective.validate].
  */
-class UriValidationCode extends Enum<UriValidationCode> {
-  static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_URI', 0);
+class UriValidationCode {
+  static const UriValidationCode INVALID_URI =
+      const UriValidationCode('INVALID_URI');
 
-  static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCode('URI_WITH_INTERPOLATION', 1);
+  static const UriValidationCode URI_WITH_INTERPOLATION =
+      const UriValidationCode('URI_WITH_INTERPOLATION');
 
-  static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationCode('URI_WITH_DART_EXT_SCHEME', 2);
+  static const UriValidationCode URI_WITH_DART_EXT_SCHEME =
+      const UriValidationCode('URI_WITH_DART_EXT_SCHEME');
 
-  static const List<UriValidationCode> values = const [
-      INVALID_URI,
-      URI_WITH_INTERPOLATION,
-      URI_WITH_DART_EXT_SCHEME];
+  /**
+   * The name of the validation code.
+   */
+  final String name;
 
-  const UriValidationCode(String name, int ordinal) : super(name, ordinal);
+  /**
+   * Initialize a newly created validation code to have the given [name].
+   */
+  const UriValidationCode(this.name);
+
+  @override
+  String toString() => name;
 }
 
 /**
@@ -19623,14 +20193,13 @@
    * @param equals the equal sign separating the variable name from the initial value
    * @param initializer the expression used to compute the initial value for the variable
    */
-  VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifier name, this.equals, Expression initializer) : super(comment, metadata) {
-    this._name = becomeParentOf(name);
-    this._initializer = becomeParentOf(initializer);
+  VariableDeclaration(Comment comment, List<Annotation> metadata,
+      SimpleIdentifier name, this.equals, Expression initializer)
+      : super(comment, metadata) {
+    _name = becomeParentOf(name);
+    _initializer = becomeParentOf(initializer);
   }
 
-  @override
-  accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this);
-
   /**
    * This overridden implementation of getDocumentationComment() looks in the grandparent node for
    * dartdoc comments if no documentation is specifically available on the node.
@@ -19650,7 +20219,8 @@
   }
 
   @override
-  VariableElement get element => _name != null ? (_name.staticElement as VariableElement) : null;
+  VariableElement get element =>
+      _name != null ? (_name.staticElement as VariableElement) : null;
 
   @override
   Token get endToken {
@@ -19660,6 +20230,9 @@
     return _name.endToken;
   }
 
+  @override
+  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
+
   /**
    * Return the expression used to compute the initial value for the variable, or `null` if
    * the initial value was not specified.
@@ -19669,11 +20242,13 @@
   Expression get initializer => _initializer;
 
   /**
-   * Return the name of the variable being declared.
+   * Set the expression used to compute the initial value for the variable to the given expression.
    *
-   * @return the name of the variable being declared
+   * @param initializer the expression used to compute the initial value for the variable
    */
-  SimpleIdentifier get name => _name;
+  void set initializer(Expression initializer) {
+    _initializer = becomeParentOf(initializer);
+  }
 
   /**
    * Return `true` if this variable was declared with the 'const' modifier.
@@ -19698,13 +20273,11 @@
   }
 
   /**
-   * Set the expression used to compute the initial value for the variable to the given expression.
+   * Return the name of the variable being declared.
    *
-   * @param initializer the expression used to compute the initial value for the variable
+   * @return the name of the variable being declared
    */
-  void set initializer(Expression initializer) {
-    this._initializer = becomeParentOf(initializer);
-  }
+  SimpleIdentifier get name => _name;
 
   /**
    * Set the name of the variable being declared to the given identifier.
@@ -19712,18 +20285,18 @@
    * @param name the name of the variable being declared
    */
   void set name(SimpleIdentifier name) {
-    this._name = becomeParentOf(name);
+    _name = becomeParentOf(name);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_name, visitor);
     safelyVisitChild(_initializer, visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
 }
 
 /**
@@ -19767,38 +20340,33 @@
    * @param type the type of the variables being declared
    * @param variables a list containing the individual variables being declared
    */
-  VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, List<VariableDeclaration> variables) : super(comment, metadata) {
-    this._variables = new NodeList<VariableDeclaration>(this);
-    this._type = becomeParentOf(type);
-    this._variables.addAll(variables);
+  VariableDeclarationList(Comment comment, List<Annotation> metadata,
+      this.keyword, TypeName type, List<VariableDeclaration> variables)
+      : super(comment, metadata) {
+    _type = becomeParentOf(type);
+    _variables = new NodeList<VariableDeclaration>(this, variables);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this);
-
-  @override
   Token get endToken => _variables.endToken;
 
-  /**
-   * Return the type of the variables being declared, or `null` if no type was provided.
-   *
-   * @return the type of the variables being declared
-   */
-  TypeName get type => _type;
-
-  /**
-   * Return a list containing the individual variables being declared.
-   *
-   * @return a list containing the individual variables being declared
-   */
-  NodeList<VariableDeclaration> get variables => _variables;
+  @override
+  Token get firstTokenAfterCommentAndMetadata {
+    if (keyword != null) {
+      return keyword;
+    } else if (_type != null) {
+      return _type.beginToken;
+    }
+    return _variables.beginToken;
+  }
 
   /**
    * Return `true` if the variables in this list were declared with the 'const' modifier.
    *
    * @return `true` if the variables in this list were declared with the 'const' modifier
    */
-  bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
+  bool get isConst =>
+      keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
 
   /**
    * Return `true` if the variables in this list were declared with the 'final' modifier.
@@ -19807,7 +20375,15 @@
    *
    * @return `true` if the variables in this list were declared with the 'final' modifier
    */
-  bool get isFinal => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.FINAL;
+  bool get isFinal =>
+      keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.FINAL;
+
+  /**
+   * Return the type of the variables being declared, or `null` if no type was provided.
+   *
+   * @return the type of the variables being declared
+   */
+  TypeName get type => _type;
 
   /**
    * Set the type of the variables being declared to the given type name.
@@ -19818,22 +20394,22 @@
     _type = becomeParentOf(typeName);
   }
 
+  /**
+   * Return a list containing the individual variables being declared.
+   *
+   * @return a list containing the individual variables being declared
+   */
+  NodeList<VariableDeclaration> get variables => _variables;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this);
+
   @override
   void visitChildren(AstVisitor visitor) {
     super.visitChildren(visitor);
     safelyVisitChild(_type, visitor);
     _variables.accept(visitor);
   }
-
-  @override
-  Token get firstTokenAfterCommentAndMetadata {
-    if (keyword != null) {
-      return keyword;
-    } else if (_type != null) {
-      return _type.beginToken;
-    }
-    return _variables.beginToken;
-  }
 }
 
 /**
@@ -19862,14 +20438,12 @@
    * @param variableList the fields being declared
    * @param semicolon the semicolon terminating the statement
    */
-  VariableDeclarationStatement(VariableDeclarationList variableList, this.semicolon) {
-    this._variableList = becomeParentOf(variableList);
+  VariableDeclarationStatement(VariableDeclarationList variableList,
+      this.semicolon) {
+    _variableList = becomeParentOf(variableList);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
-
-  @override
   Token get beginToken => _variableList.beginToken;
 
   @override
@@ -19888,10 +20462,13 @@
    * @param variableList the variables being declared
    */
   void set variables(VariableDeclarationList variableList) {
-    this._variableList = becomeParentOf(variableList);
+    _variableList = becomeParentOf(variableList);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_variableList, visitor);
   }
@@ -19940,15 +20517,13 @@
    * @param rightParenthesis the right parenthesis
    * @param body the body of the loop
    */
-  WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, Statement body) {
-    this._condition = becomeParentOf(condition);
-    this._body = becomeParentOf(body);
+  WhileStatement(this.keyword, this.leftParenthesis, Expression condition,
+      this.rightParenthesis, Statement body) {
+    _condition = becomeParentOf(condition);
+    _body = becomeParentOf(body);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitWhileStatement(this);
-
-  @override
   Token get beginToken => keyword;
 
   /**
@@ -19959,16 +20534,6 @@
   Statement get body => _body;
 
   /**
-   * Return the expression used to determine whether to execute the body of the loop.
-   *
-   * @return the expression used to determine whether to execute the body of the loop
-   */
-  Expression get condition => _condition;
-
-  @override
-  Token get endToken => _body.endToken;
-
-  /**
    * Set the body of the loop to the given statement.
    *
    * @param statement the body of the loop
@@ -19978,6 +20543,13 @@
   }
 
   /**
+   * Return the expression used to determine whether to execute the body of the loop.
+   *
+   * @return the expression used to determine whether to execute the body of the loop
+   */
+  Expression get condition => _condition;
+
+  /**
    * Set the expression used to determine whether to execute the body of the loop to the given
    * expression.
    *
@@ -19988,6 +20560,12 @@
   }
 
   @override
+  Token get endToken => _body.endToken;
+
+  @override
+  accept(AstVisitor visitor) => visitor.visitWhileStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_condition, visitor);
     safelyVisitChild(_body, visitor);
@@ -20006,7 +20584,7 @@
   /**
    * The token representing the 'with' keyword.
    */
-  Token _withKeyword;
+  Token withKeyword;
 
   /**
    * The names of the mixins that were specified.
@@ -20019,43 +20597,35 @@
    * @param withKeyword the token representing the 'with' keyword
    * @param mixinTypes the names of the mixins that were specified
    */
-  WithClause(Token withKeyword, List<TypeName> mixinTypes) {
-    this._mixinTypes = new NodeList<TypeName>(this);
-    this._withKeyword = withKeyword;
-    this._mixinTypes.addAll(mixinTypes);
+  WithClause(this.withKeyword, List<TypeName> mixinTypes) {
+    _mixinTypes = new NodeList<TypeName>(this, mixinTypes);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitWithClause(this);
-
-  @override
-  Token get beginToken => _withKeyword;
+  Token get beginToken => withKeyword;
 
   @override
   Token get endToken => _mixinTypes.endToken;
 
   /**
+   * Set the token representing the 'with' keyword to the given token.
+   *
+   * @param withKeyword the token representing the 'with' keyword
+   */
+  @deprecated
+  void set mixinKeyword(Token withKeyword) {
+    this.withKeyword = withKeyword;
+  }
+
+  /**
    * Return the names of the mixins that were specified.
    *
    * @return the names of the mixins that were specified
    */
   NodeList<TypeName> get mixinTypes => _mixinTypes;
 
-  /**
-   * Return the token representing the 'with' keyword.
-   *
-   * @return the token representing the 'with' keyword
-   */
-  Token get withKeyword => _withKeyword;
-
-  /**
-   * Set the token representing the 'with' keyword to the given token.
-   *
-   * @param withKeyword the token representing the 'with' keyword
-   */
-  void set mixinKeyword(Token withKeyword) {
-    this._withKeyword = withKeyword;
-  }
+  @override
+  accept(AstVisitor visitor) => visitor.visitWithClause(this);
 
   @override
   void visitChildren(AstVisitor visitor) {
@@ -20095,14 +20665,12 @@
    * @param expression the expression whose value will be yielded
    * @param semicolon the semicolon following the expression
    */
-  YieldStatement(this.yieldKeyword, this.star, Expression expression, this.semicolon) {
-    this._expression = becomeParentOf(expression);
+  YieldStatement(this.yieldKeyword, this.star, Expression expression,
+      this.semicolon) {
+    _expression = becomeParentOf(expression);
   }
 
   @override
-  accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
-
-  @override
   Token get beginToken {
     if (yieldKeyword != null) {
       return yieldKeyword;
@@ -20131,136 +20699,14 @@
    * @param expression the expression whose value will be yielded
    */
   void set expression(Expression expression) {
-    this._expression = becomeParentOf(expression);
+    _expression = becomeParentOf(expression);
   }
 
   @override
+  accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
+
+  @override
   void visitChildren(AstVisitor visitor) {
     safelyVisitChild(_expression, visitor);
   }
 }
-/**
- * Instances of the class {@code NodeList} represent a list of AST nodes that have a common parent.
- */
-class NodeList<E extends AstNode> extends Object with ListMixin<E> {
-  /**
-   * Create an empty list with the given owner. This is a convenience method that allows the
-   * compiler to determine the correct value of the type argument [E] without needing to
-   * explicitly specify it.
-   *
-   * @param owner the node that is the parent of each of the elements in the list
-   * @return the list that was created
-   */
-  static NodeList create(AstNode owner) => new NodeList(owner);
-
-  /**
-   * The node that is the parent of each of the elements in the list.
-   */
-  AstNode owner;
-
-  /**
-   * The elements contained in the list.
-   */
-  List<E> _elements = <E>[];
-
-  /**
-   * Initialize a newly created list of nodes to be empty.
-   *
-   * @param owner the node that is the parent of each of the elements in the list
-   */
-  NodeList(this.owner);
-
-  /**
-   * Use the given visitor to visit each of the nodes in this list.
-   *
-   * @param visitor the visitor to be used to visit the elements of this list
-   */
-  accept(AstVisitor visitor) {
-    var length = _elements.length;
-    for (var i = 0; i < length; i++) {
-      _elements[i].accept(visitor);
-    }
-  }
-  void add(E node) {
-    insert(length, node);
-  }
-  void insert(int index, E node) {
-    int length = _elements.length;
-    if (index < 0 || index > length) {
-      throw new RangeError("Index: $index, Size: ${_elements.length}");
-    }
-    owner.becomeParentOf(node);
-    if (length == 0) {
-      _elements = <E> [node];
-    } else {
-      _elements.insert(index, node);
-    }
-  }
-  bool addAll(Iterable<E> nodes) {
-    if (nodes != null && !nodes.isEmpty) {
-      _elements.addAll(nodes);
-      for (E node in nodes) {
-        owner.becomeParentOf(node);
-      }
-      return true;
-    }
-    return false;
-  }
-  E operator[](int index) {
-    if (index < 0 || index >= _elements.length) {
-      throw new RangeError("Index: $index, Size: ${_elements.length}");
-    }
-    return _elements[index] as E;
-  }
-
-  /**
-   * Return the first token included in this node's source range.
-   *
-   * @return the first token included in this node's source range
-   */
-  Token get beginToken {
-    if (_elements.length == 0) {
-      return null;
-    }
-    return _elements[0].beginToken;
-  }
-
-  /**
-   * Return the last token included in this node list's source range.
-   *
-   * @return the last token included in this node list's source range
-   */
-  Token get endToken {
-    if (_elements.length == 0) {
-      return null;
-    }
-    return _elements[_elements.length - 1].endToken;
-  }
-  E removeAt(int index) {
-    if (index < 0 || index >= _elements.length) {
-      throw new RangeError("Index: $index, Size: ${_elements.length}");
-    }
-    E removedNode = _elements[index] as E;
-    int length = _elements.length;
-    if (length == 1) {
-      _elements = AstNode.EMPTY_ARRAY;
-      return removedNode;
-    }
-    _elements.removeAt(index);
-    return removedNode;
-  }
-  void operator[]=(int index, E node) {
-    if (index < 0 || index >= _elements.length) {
-      throw new RangeError("Index: $index, Size: ${_elements.length}");
-    }
-    owner.becomeParentOf(node);
-    _elements[index] = node;
-  }
-  void clear() {
-    _elements = <E>[];
-  }
-  int get length => _elements.length;
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize NodeList.");
-  }
-}
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index a361ede..7eaf916 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -8,17 +8,18 @@
 library engine.constant;
 
 import 'dart:collection';
-import 'java_core.dart';
-import 'java_engine.dart' show ObjectUtilities;
-import 'source.dart' show Source;
-import 'error.dart';
-import 'scanner.dart' show Token, TokenType;
+
 import 'ast.dart';
 import 'element.dart';
-import 'resolver.dart' show TypeProvider;
 import 'engine.dart' show AnalysisEngine, RecordingErrorListener;
-import 'utilities_dart.dart' show ParameterKind;
+import 'error.dart';
+import 'java_core.dart';
+import 'java_engine.dart' show ObjectUtilities;
+import 'resolver.dart' show TypeProvider;
+import 'scanner.dart' show Token, TokenType;
+import 'source.dart' show Source;
 import 'utilities_collection.dart';
+import 'utilities_dart.dart' show ParameterKind;
 
 /**
  * Instances of the class `BoolState` represent the state of an object representing a boolean
@@ -26,11 +27,6 @@
  */
 class BoolState extends InstanceState {
   /**
-   * The value of this instance.
-   */
-  final bool value;
-
-  /**
    * An instance representing the boolean value 'false'.
    */
   static BoolState FALSE_STATE = new BoolState(false);
@@ -46,12 +42,9 @@
   static BoolState UNKNOWN_VALUE = new BoolState(null);
 
   /**
-   * Return the boolean state representing the given boolean value.
-   *
-   * @param value the value to be represented
-   * @return the boolean state representing the given boolean value
+   * The value of this instance.
    */
-  static BoolState from(bool value) => value ? BoolState.TRUE_STATE : BoolState.FALSE_STATE;
+  final bool value;
 
   /**
    * Initialize a newly created state to represent the given value.
@@ -61,6 +54,33 @@
   BoolState(this.value);
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => value == null ? 0 : (value ? 2 : 3);
+
+  /**
+   * Return `true` if this object represents an object whose type is 'bool'.
+   *
+   * @return `true` if this object represents a boolean value
+   */
+  @override
+  bool get isBool => true;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  bool get isUnknown => value == null;
+
+  @override
+  String get typeName => "bool";
+
+  @override
+  bool operator ==(Object object) =>
+      object is BoolState && identical(value, object.value);
+
+  @override
   BoolState convertToBool() => this;
 
   @override
@@ -95,32 +115,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is BoolState && identical(value, object.value);
-
-  @override
-  String get typeName => "bool";
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => value == null ? 0 : (value ? 2 : 3);
-
-  /**
-   * Return `true` if this object represents an object whose type is 'bool'.
-   *
-   * @return `true` if this object represents a boolean value
-   */
-  @override
-  bool get isBool => true;
-
-  @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
-  bool get isUnknown => value == null;
-
-  @override
   BoolState logicalAnd(InstanceState rightOperand) {
     assertBool(rightOperand);
     if (value == null) {
@@ -148,6 +142,15 @@
 
   @override
   String toString() => value == null ? "-unknown-" : (value ? "true" : "false");
+
+  /**
+   * Return the boolean state representing the given boolean value.
+   *
+   * @param value the value to be represented
+   * @return the boolean state representing the given boolean value
+   */
+  static BoolState from(bool value) =>
+      value ? BoolState.TRUE_STATE : BoolState.FALSE_STATE;
 }
 
 /**
@@ -215,7 +218,8 @@
   EvaluationResult evaluate(Expression expression) {
     RecordingErrorListener errorListener = new RecordingErrorListener();
     ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
-    DartObjectImpl result = expression.accept(new ConstantVisitor.con1(_typeProvider, errorReporter));
+    DartObjectImpl result =
+        expression.accept(new ConstantVisitor.con1(_typeProvider, errorReporter));
     if (result != null) {
       return EvaluationResult.forValue(result);
     }
@@ -232,17 +236,20 @@
   /**
    * A table mapping constant variable elements to the declarations of those variables.
    */
-  final HashMap<VariableElement, VariableDeclaration> variableMap = new HashMap<VariableElement, VariableDeclaration>();
+  final HashMap<VariableElement, VariableDeclaration> variableMap =
+      new HashMap<VariableElement, VariableDeclaration>();
 
   /**
    * A table mapping constant constructors to the declarations of those constructors.
    */
-  final HashMap<ConstructorElement, ConstructorDeclaration> constructorMap = new HashMap<ConstructorElement, ConstructorDeclaration>();
+  final HashMap<ConstructorElement, ConstructorDeclaration> constructorMap =
+      new HashMap<ConstructorElement, ConstructorDeclaration>();
 
   /**
    * A collection of constant constructor invocations.
    */
-  final List<InstanceCreationExpression> constructorInvocations = new List<InstanceCreationExpression>();
+  final List<InstanceCreationExpression> constructorInvocations =
+      new List<InstanceCreationExpression>();
 
   @override
   Object visitConstructorDeclaration(ConstructorDeclaration node) {
@@ -296,28 +303,26 @@
   /**
    * Source of RegExp matching declarable operator names. From sdk/lib/internal/symbol.dart.
    */
-  static String _OPERATOR_RE = "(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)";
+  static String _OPERATOR_RE =
+      "(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)";
 
   /**
    * Source of RegExp matching any public identifier. From sdk/lib/internal/symbol.dart.
    */
-  static String _PUBLIC_IDENTIFIER_RE = "(?!${ConstantValueComputer._RESERVED_WORD_RE}\\b(?!\\\$))[a-zA-Z\$][\\w\$]*";
+  static String _PUBLIC_IDENTIFIER_RE =
+      "(?!${ConstantValueComputer._RESERVED_WORD_RE}\\b(?!\\\$))[a-zA-Z\$][\\w\$]*";
 
   /**
    * Source of RegExp matching Dart reserved words. From sdk/lib/internal/symbol.dart.
    */
-  static String _RESERVED_WORD_RE = "(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|v(?:ar|oid)|w(?:hile|ith))";
+  static String _RESERVED_WORD_RE =
+      "(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|v(?:ar|oid)|w(?:hile|ith))";
 
   /**
    * RegExp that validates a non-empty non-private symbol. From sdk/lib/internal/symbol.dart.
    */
-  static RegExp _PUBLIC_SYMBOL_PATTERN = new RegExp("^(?:${ConstantValueComputer._OPERATOR_RE}\$|$_PUBLIC_IDENTIFIER_RE(?:=?\$|[.](?!\$)))+?\$");
-
-  /**
-   * Determine whether the given string is a valid name for a public symbol (i.e. whether it is
-   * allowed for a call to the Symbol constructor).
-   */
-  static bool isValidPublicSymbol(String name) => name.isEmpty || name == "void" || new JavaPatternMatcher(_PUBLIC_SYMBOL_PATTERN, name).matches();
+  static RegExp _PUBLIC_SYMBOL_PATTERN = new RegExp(
+      "^(?:${ConstantValueComputer._OPERATOR_RE}\$|$_PUBLIC_IDENTIFIER_RE(?:=?\$|[.](?!\$)))+?\$");
 
   /**
    * The type provider used to access the known types.
@@ -377,81 +382,6 @@
   }
 
   /**
-   * Compute values for all of the constants in the compilation units that were added.
-   */
-  void computeValues() {
-    _variableDeclarationMap = _constantFinder.variableMap;
-    constructorDeclarationMap = _constantFinder.constructorMap;
-    _constructorInvocations = _constantFinder.constructorInvocations;
-    _variableDeclarationMap.values.forEach((VariableDeclaration declaration) {
-      ReferenceFinder referenceFinder = new ReferenceFinder(declaration, referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
-      referenceGraph.addNode(declaration);
-      declaration.initializer.accept(referenceFinder);
-    });
-    constructorDeclarationMap.forEach((ConstructorElement element, ConstructorDeclaration declaration) {
-      ReferenceFinder referenceFinder = new ReferenceFinder(declaration, referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
-      referenceGraph.addNode(declaration);
-      bool superInvocationFound = false;
-      NodeList<ConstructorInitializer> initializers = declaration.initializers;
-      for (ConstructorInitializer initializer in initializers) {
-        if (initializer is SuperConstructorInvocation) {
-          superInvocationFound = true;
-        }
-        initializer.accept(referenceFinder);
-      }
-      if (!superInvocationFound) {
-        // No explicit superconstructor invocation found, so we need to manually insert
-        // a reference to the implicit superconstructor.
-        InterfaceType superclass = (element.returnType as InterfaceType).superclass;
-        if (superclass != null && !superclass.isObject) {
-          ConstructorElement unnamedConstructor = superclass.element.unnamedConstructor;
-          ConstructorDeclaration superConstructorDeclaration = findConstructorDeclaration(unnamedConstructor);
-          if (superConstructorDeclaration != null) {
-            referenceGraph.addEdge(declaration, superConstructorDeclaration);
-          }
-        }
-      }
-      for (FormalParameter parameter in declaration.parameters.parameters) {
-        referenceGraph.addNode(parameter);
-        referenceGraph.addEdge(declaration, parameter);
-        if (parameter is DefaultFormalParameter) {
-          Expression defaultValue = parameter.defaultValue;
-          if (defaultValue != null) {
-            ReferenceFinder parameterReferenceFinder = new ReferenceFinder(parameter, referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
-            defaultValue.accept(parameterReferenceFinder);
-          }
-        }
-      }
-    });
-    for (InstanceCreationExpression expression in _constructorInvocations) {
-      referenceGraph.addNode(expression);
-      ConstructorElement constructor = expression.staticElement;
-      if (constructor == null) {
-        continue;
-      }
-      constructor = _followConstantRedirectionChain(constructor);
-      ConstructorDeclaration declaration = findConstructorDeclaration(constructor);
-      // An instance creation expression depends both on the constructor and the arguments passed
-      // to it.
-      ReferenceFinder referenceFinder = new ReferenceFinder(expression, referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
-      if (declaration != null) {
-        referenceGraph.addEdge(expression, declaration);
-      }
-      expression.argumentList.accept(referenceFinder);
-    }
-    List<List<AstNode>> topologicalSort = referenceGraph.computeTopologicalSort();
-    for (List<AstNode> constantsInCycle in topologicalSort) {
-      if (constantsInCycle.length == 1) {
-        _computeValueFor(constantsInCycle[0]);
-      } else {
-        for (AstNode constant in constantsInCycle) {
-          _generateCycleError(constantsInCycle, constant);
-        }
-      }
-    }
-  }
-
-  /**
    * This method is called just before computing the constant value associated with an AST node.
    * Unit tests will override this method to introduce additional error checking.
    */
@@ -474,12 +404,112 @@
   }
 
   /**
+   * Compute values for all of the constants in the compilation units that were added.
+   */
+  void computeValues() {
+    _variableDeclarationMap = _constantFinder.variableMap;
+    constructorDeclarationMap = _constantFinder.constructorMap;
+    _constructorInvocations = _constantFinder.constructorInvocations;
+    _variableDeclarationMap.values.forEach((VariableDeclaration declaration) {
+      ReferenceFinder referenceFinder = new ReferenceFinder(
+          declaration,
+          referenceGraph,
+          _variableDeclarationMap,
+          constructorDeclarationMap);
+      referenceGraph.addNode(declaration);
+      declaration.initializer.accept(referenceFinder);
+    });
+    constructorDeclarationMap.forEach(
+        (ConstructorElement element, ConstructorDeclaration declaration) {
+      ReferenceFinder referenceFinder = new ReferenceFinder(
+          declaration,
+          referenceGraph,
+          _variableDeclarationMap,
+          constructorDeclarationMap);
+      referenceGraph.addNode(declaration);
+      bool superInvocationFound = false;
+      NodeList<ConstructorInitializer> initializers = declaration.initializers;
+      for (ConstructorInitializer initializer in initializers) {
+        if (initializer is SuperConstructorInvocation) {
+          superInvocationFound = true;
+        }
+        initializer.accept(referenceFinder);
+      }
+      if (!superInvocationFound) {
+        // No explicit superconstructor invocation found, so we need to
+        // manually insert a reference to the implicit superconstructor.
+        InterfaceType superclass =
+            (element.returnType as InterfaceType).superclass;
+        if (superclass != null && !superclass.isObject) {
+          ConstructorElement unnamedConstructor =
+              superclass.element.unnamedConstructor;
+          ConstructorDeclaration superConstructorDeclaration =
+              findConstructorDeclaration(unnamedConstructor);
+          if (superConstructorDeclaration != null) {
+            referenceGraph.addEdge(declaration, superConstructorDeclaration);
+          }
+        }
+      }
+      for (FormalParameter parameter in declaration.parameters.parameters) {
+        referenceGraph.addNode(parameter);
+        referenceGraph.addEdge(declaration, parameter);
+        if (parameter is DefaultFormalParameter) {
+          Expression defaultValue = parameter.defaultValue;
+          if (defaultValue != null) {
+            ReferenceFinder parameterReferenceFinder = new ReferenceFinder(
+                parameter,
+                referenceGraph,
+                _variableDeclarationMap,
+                constructorDeclarationMap);
+            defaultValue.accept(parameterReferenceFinder);
+          }
+        }
+      }
+    });
+    for (InstanceCreationExpression expression in _constructorInvocations) {
+      referenceGraph.addNode(expression);
+      ConstructorElement constructor = expression.staticElement;
+      if (constructor == null) {
+        continue;
+      }
+      constructor = _followConstantRedirectionChain(constructor);
+      ConstructorDeclaration declaration =
+          findConstructorDeclaration(constructor);
+      // An instance creation expression depends both on the constructor and
+      // the arguments passed to it.
+      ReferenceFinder referenceFinder = new ReferenceFinder(
+          expression,
+          referenceGraph,
+          _variableDeclarationMap,
+          constructorDeclarationMap);
+      if (declaration != null) {
+        referenceGraph.addEdge(expression, declaration);
+      }
+      expression.argumentList.accept(referenceFinder);
+    }
+    List<List<AstNode>> topologicalSort =
+        referenceGraph.computeTopologicalSort();
+    for (List<AstNode> constantsInCycle in topologicalSort) {
+      if (constantsInCycle.length == 1) {
+        _computeValueFor(constantsInCycle[0]);
+      } else {
+        for (AstNode constant in constantsInCycle) {
+          _generateCycleError(constantsInCycle, constant);
+        }
+      }
+    }
+  }
+
+  /**
    * Create the ConstantVisitor used to evaluate constants. Unit tests will override this method to
    * introduce additional error checking.
    */
-  ConstantVisitor createConstantVisitor(ErrorReporter errorReporter) => new ConstantVisitor.con1(typeProvider, errorReporter);
+  ConstantVisitor createConstantVisitor(ErrorReporter errorReporter) =>
+      new ConstantVisitor.con1(typeProvider, errorReporter);
 
-  ConstructorDeclaration findConstructorDeclaration(ConstructorElement constructor) => constructorDeclarationMap[_getConstructorBase(constructor)];
+  ConstructorDeclaration
+      findConstructorDeclaration(ConstructorElement constructor) =>
+      constructorDeclarationMap[_getConstructorBase(constructor)];
 
   /**
    * Check that the arguments to a call to fromEnvironment() are correct.
@@ -491,7 +521,9 @@
    *          Note: "defaultValue" is always allowed to be null.
    * @return true if the arguments are correct, false if there is an error.
    */
-  bool _checkFromEnvironmentArguments(NodeList<Expression> arguments, List<DartObjectImpl> argumentValues, HashMap<String, DartObjectImpl> namedArgumentValues, InterfaceType expectedDefaultValueType) {
+  bool _checkFromEnvironmentArguments(NodeList<Expression> arguments,
+      List<DartObjectImpl> argumentValues, HashMap<String,
+      DartObjectImpl> namedArgumentValues, InterfaceType expectedDefaultValueType) {
     int argumentCount = arguments.length;
     if (argumentCount < 1 || argumentCount > 2) {
       return false;
@@ -506,11 +538,14 @@
       if (arguments[1] is! NamedExpression) {
         return false;
       }
-      if (!((arguments[1] as NamedExpression).name.label.name == _DEFAULT_VALUE_PARAM)) {
+      if (!((arguments[1] as NamedExpression).name.label.name ==
+          _DEFAULT_VALUE_PARAM)) {
         return false;
       }
-      ParameterizedType defaultValueType = namedArgumentValues[_DEFAULT_VALUE_PARAM].type;
-      if (!(identical(defaultValueType, expectedDefaultValueType) || identical(defaultValueType, typeProvider.nullType))) {
+      ParameterizedType defaultValueType =
+          namedArgumentValues[_DEFAULT_VALUE_PARAM].type;
+      if (!(identical(defaultValueType, expectedDefaultValueType) ||
+          identical(defaultValueType, typeProvider.nullType))) {
         return false;
       }
     }
@@ -525,7 +560,9 @@
    * @param namedArgumentValues the values of the named arguments.
    * @return true if the arguments are correct, false if there is an error.
    */
-  bool _checkSymbolArguments(NodeList<Expression> arguments, List<DartObjectImpl> argumentValues, HashMap<String, DartObjectImpl> namedArgumentValues) {
+  bool _checkSymbolArguments(NodeList<Expression> arguments,
+      List<DartObjectImpl> argumentValues, HashMap<String,
+      DartObjectImpl> namedArgumentValues) {
     if (arguments.length != 1) {
       return false;
     }
@@ -550,36 +587,51 @@
       VariableDeclaration declaration = constNode;
       VariableElement element = declaration.element;
       RecordingErrorListener errorListener = new RecordingErrorListener();
-      ErrorReporter errorReporter = new ErrorReporter(errorListener, element.source);
-      DartObjectImpl dartObject = declaration.initializer.accept(createConstantVisitor(errorReporter));
+      ErrorReporter errorReporter =
+          new ErrorReporter(errorListener, element.source);
+      DartObjectImpl dartObject =
+          declaration.initializer.accept(createConstantVisitor(errorReporter));
       if (dartObject != null) {
         if (!_runtimeTypeMatch(dartObject, element.type)) {
           errorReporter.reportErrorForNode(
               CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-              declaration, [dartObject.type, element.type]);
+              declaration,
+              [dartObject.type, element.type]);
         }
       }
-      (element as VariableElementImpl).evaluationResult = new EvaluationResultImpl.con2(dartObject, errorListener.errors);
+      (element as VariableElementImpl).evaluationResult =
+          new EvaluationResultImpl.con2(dartObject, errorListener.errors);
     } else if (constNode is InstanceCreationExpression) {
       InstanceCreationExpression expression = constNode;
       ConstructorElement constructor = expression.staticElement;
       if (constructor == null) {
-        // Couldn't resolve the constructor so we can't compute a value.  No problem--the error
-        // has already been reported.  But we still need to store an evaluation result.
+        // Couldn't resolve the constructor so we can't compute a value.
+        // No problem - the error has already been reported.
+        // But we still need to store an evaluation result.
         expression.evaluationResult = new EvaluationResultImpl.con1(null);
         return;
       }
       RecordingErrorListener errorListener = new RecordingErrorListener();
-      CompilationUnit sourceCompilationUnit = expression.getAncestor((node) => node is CompilationUnit);
-      ErrorReporter errorReporter = new ErrorReporter(errorListener, sourceCompilationUnit.element.source);
+      CompilationUnit sourceCompilationUnit =
+          expression.getAncestor((node) => node is CompilationUnit);
+      ErrorReporter errorReporter =
+          new ErrorReporter(errorListener, sourceCompilationUnit.element.source);
       ConstantVisitor constantVisitor = createConstantVisitor(errorReporter);
-      DartObjectImpl result = _evaluateConstructorCall(constNode, expression.argumentList.arguments, constructor, constantVisitor, errorReporter);
-      expression.evaluationResult = new EvaluationResultImpl.con2(result, errorListener.errors);
+      DartObjectImpl result = _evaluateConstructorCall(
+          constNode,
+          expression.argumentList.arguments,
+          constructor,
+          constantVisitor,
+          errorReporter);
+      expression.evaluationResult =
+          new EvaluationResultImpl.con2(result, errorListener.errors);
     } else if (constNode is ConstructorDeclaration) {
       ConstructorDeclaration declaration = constNode;
       NodeList<ConstructorInitializer> initializers = declaration.initializers;
-      ConstructorElementImpl constructor = declaration.element as ConstructorElementImpl;
-      constructor.constantInitializers = new ConstantValueComputer_InitializerCloner().cloneNodeList(initializers);
+      ConstructorElementImpl constructor =
+          declaration.element as ConstructorElementImpl;
+      constructor.constantInitializers =
+          new ConstantValueComputer_InitializerCloner().cloneNodeList(initializers);
     } else if (constNode is FormalParameter) {
       if (constNode is DefaultFormalParameter) {
         DefaultFormalParameter parameter = constNode;
@@ -587,14 +639,18 @@
         Expression defaultValue = parameter.defaultValue;
         if (defaultValue != null) {
           RecordingErrorListener errorListener = new RecordingErrorListener();
-          ErrorReporter errorReporter = new ErrorReporter(errorListener, element.source);
-          DartObjectImpl dartObject = defaultValue.accept(createConstantVisitor(errorReporter));
-          (element as ParameterElementImpl).evaluationResult = new EvaluationResultImpl.con2(dartObject, errorListener.errors);
+          ErrorReporter errorReporter =
+              new ErrorReporter(errorListener, element.source);
+          DartObjectImpl dartObject =
+              defaultValue.accept(createConstantVisitor(errorReporter));
+          (element as ParameterElementImpl).evaluationResult =
+              new EvaluationResultImpl.con2(dartObject, errorListener.errors);
         }
       }
     } else {
       // Should not happen.
-      AnalysisEngine.instance.logger.logError("Constant value computer trying to compute the value of a node which is not a VariableDeclaration, InstanceCreationExpression, FormalParameter, or ConstructorDeclaration");
+      AnalysisEngine.instance.logger.logError(
+          "Constant value computer trying to compute the value of a node which is not a VariableDeclaration, InstanceCreationExpression, FormalParameter, or ConstructorDeclaration");
       return;
     }
   }
@@ -608,40 +664,50 @@
    * @param namedArgumentValues Named parameters passed to fromEnvironment()
    * @return A [DartObjectImpl] object corresponding to the evaluated result
    */
-  DartObjectImpl _computeValueFromEnvironment(DartObject environmentValue, DartObjectImpl builtInDefaultValue, HashMap<String, DartObjectImpl> namedArgumentValues) {
+  DartObjectImpl _computeValueFromEnvironment(DartObject environmentValue,
+      DartObjectImpl builtInDefaultValue, HashMap<String,
+      DartObjectImpl> namedArgumentValues) {
     DartObjectImpl value = environmentValue as DartObjectImpl;
     if (value.isUnknown || value.isNull) {
-      // The name either doesn't exist in the environment or we couldn't parse the corresponding
-      // value.  If the code supplied an explicit default, use it.
+      // The name either doesn't exist in the environment or we couldn't parse
+      // the corresponding value.
+      // If the code supplied an explicit default, use it.
       if (namedArgumentValues.containsKey(_DEFAULT_VALUE_PARAM)) {
         value = namedArgumentValues[_DEFAULT_VALUE_PARAM];
       } else if (value.isNull) {
-        // The code didn't supply an explicit default.  The name exists in the environment but
-        // we couldn't parse the corresponding value.  So use the built-in default value, because
-        // this is what the VM does.
+        // The code didn't supply an explicit default.
+        // The name exists in the environment but we couldn't parse the
+        // corresponding value.
+        // So use the built-in default value, because this is what the VM does.
         value = builtInDefaultValue;
       } else {
-        // The code didn't supply an explicit default.  The name doesn't exist in the environment.
-        // The VM would use the built-in default value, but we don't want to do that for analysis
-        // because it's likely to lead to cascading errors.  So just leave [value] in the unknown
-        // state.
+        // The code didn't supply an explicit default.
+        // The name doesn't exist in the environment.
+        // The VM would use the built-in default value, but we don't want to do
+        // that for analysis because it's likely to lead to cascading errors.
+        // So just leave [value] in the unknown state.
       }
     }
     return value;
   }
 
-  DartObjectImpl _evaluateConstructorCall(AstNode node, NodeList<Expression> arguments, ConstructorElement constructor, ConstantVisitor constantVisitor, ErrorReporter errorReporter) {
+  DartObjectImpl _evaluateConstructorCall(AstNode node,
+      NodeList<Expression> arguments, ConstructorElement constructor,
+      ConstantVisitor constantVisitor, ErrorReporter errorReporter) {
     int argumentCount = arguments.length;
-    List<DartObjectImpl> argumentValues = new List<DartObjectImpl>(argumentCount);
+    List<DartObjectImpl> argumentValues =
+        new List<DartObjectImpl>(argumentCount);
     List<Expression> argumentNodes = new List<Expression>(argumentCount);
-    HashMap<String, DartObjectImpl> namedArgumentValues = new HashMap<String, DartObjectImpl>();
+    HashMap<String, DartObjectImpl> namedArgumentValues =
+        new HashMap<String, DartObjectImpl>();
     HashMap<String, NamedExpression> namedArgumentNodes =
         new HashMap<String, NamedExpression>();
     for (int i = 0; i < argumentCount; i++) {
       Expression argument = arguments[i];
       if (argument is NamedExpression) {
         String name = argument.name.label.name;
-        namedArgumentValues[name] = constantVisitor._valueOf(argument.expression);
+        namedArgumentValues[name] =
+            constantVisitor._valueOf(argument.expression);
         namedArgumentNodes[name] = argument;
         argumentValues[i] = constantVisitor.null2;
       } else {
@@ -652,54 +718,89 @@
     constructor = _followConstantRedirectionChain(constructor);
     InterfaceType definingClass = constructor.returnType as InterfaceType;
     if (constructor.isFactory) {
-      // We couldn't find a non-factory constructor.  See if it's because we reached an external
-      // const factory constructor that we can emulate.
+      // We couldn't find a non-factory constructor.
+      // See if it's because we reached an external const factory constructor
+      // that we can emulate.
       if (constructor.name == "fromEnvironment") {
-        if (!_checkFromEnvironmentArguments(arguments, argumentValues, namedArgumentValues, definingClass)) {
-          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node);
+        if (!_checkFromEnvironmentArguments(
+            arguments,
+            argumentValues,
+            namedArgumentValues,
+            definingClass)) {
+          errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+              node);
           return null;
         }
-        String variableName = argumentCount < 1 ? null : argumentValues[0].stringValue;
+        String variableName =
+            argumentCount < 1 ? null : argumentValues[0].stringValue;
         if (identical(definingClass, typeProvider.boolType)) {
           DartObject valueFromEnvironment;
-          valueFromEnvironment = _declaredVariables.getBool(typeProvider, variableName);
-          return _computeValueFromEnvironment(valueFromEnvironment, new DartObjectImpl(typeProvider.boolType, BoolState.FALSE_STATE), namedArgumentValues);
+          valueFromEnvironment =
+              _declaredVariables.getBool(typeProvider, variableName);
+          return _computeValueFromEnvironment(
+              valueFromEnvironment,
+              new DartObjectImpl(typeProvider.boolType, BoolState.FALSE_STATE),
+              namedArgumentValues);
         } else if (identical(definingClass, typeProvider.intType)) {
           DartObject valueFromEnvironment;
-          valueFromEnvironment = _declaredVariables.getInt(typeProvider, variableName);
-          return _computeValueFromEnvironment(valueFromEnvironment, new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE), namedArgumentValues);
+          valueFromEnvironment =
+              _declaredVariables.getInt(typeProvider, variableName);
+          return _computeValueFromEnvironment(
+              valueFromEnvironment,
+              new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE),
+              namedArgumentValues);
         } else if (identical(definingClass, typeProvider.stringType)) {
           DartObject valueFromEnvironment;
-          valueFromEnvironment = _declaredVariables.getString(typeProvider, variableName);
-          return _computeValueFromEnvironment(valueFromEnvironment, new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE), namedArgumentValues);
+          valueFromEnvironment =
+              _declaredVariables.getString(typeProvider, variableName);
+          return _computeValueFromEnvironment(
+              valueFromEnvironment,
+              new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE),
+              namedArgumentValues);
         }
-      } else if (constructor.name == "" && identical(definingClass, typeProvider.symbolType) && argumentCount == 1) {
-        if (!_checkSymbolArguments(arguments, argumentValues, namedArgumentValues)) {
-          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node);
+      } else if (constructor.name == "" &&
+          identical(definingClass, typeProvider.symbolType) &&
+          argumentCount == 1) {
+        if (!_checkSymbolArguments(
+            arguments,
+            argumentValues,
+            namedArgumentValues)) {
+          errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+              node);
           return null;
         }
         String argumentValue = argumentValues[0].stringValue;
-        return new DartObjectImpl(definingClass, new SymbolState(argumentValue));
+        return new DartObjectImpl(
+            definingClass,
+            new SymbolState(argumentValue));
       }
-      // Either it's an external const factory constructor that we can't emulate, or an error
-      // occurred (a cycle, or a const constructor trying to delegate to a non-const constructor).
-      // In the former case, the best we can do is consider it an unknown value.  In the latter
-      // case, the error has already been reported, so considering it an unknown value will
-      // suppress further errors.
+      // Either it's an external const factory constructor that we can't
+      // emulate, or an error occurred (a cycle, or a const constructor trying
+      // to delegate to a non-const constructor).
+      // In the former case, the best we can do is consider it an unknown value.
+      // In the latter case, the error has already been reported, so considering
+      // it an unknown value will suppress further errors.
       return constantVisitor._validWithUnknownValue(definingClass);
     }
     beforeGetConstantInitializers(constructor);
-    ConstructorElementImpl constructorBase = _getConstructorBase(constructor) as ConstructorElementImpl;
-    List<ConstructorInitializer> initializers = constructorBase.constantInitializers;
+    ConstructorElementImpl constructorBase =
+        _getConstructorBase(constructor) as ConstructorElementImpl;
+    List<ConstructorInitializer> initializers =
+        constructorBase.constantInitializers;
     if (initializers == null) {
-      // This can happen in some cases where there are compile errors in the code being analyzed
-      // (for example if the code is trying to create a const instance using a non-const
-      // constructor, or the node we're visiting is involved in a cycle).  The error has already
-      // been reported, so consider it an unknown value to suppress further errors.
+      // This can happen in some cases where there are compile errors in the
+      // code being analyzed (for example if the code is trying to create a
+      // const instance using a non-const constructor, or the node we're
+      // visiting is involved in a cycle).  The error has already been reported,
+      // so consider it an unknown value to suppress further errors.
       return constantVisitor._validWithUnknownValue(definingClass);
     }
-    HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
-    HashMap<String, DartObjectImpl> parameterMap = new HashMap<String, DartObjectImpl>();
+    HashMap<String, DartObjectImpl> fieldMap =
+        new HashMap<String, DartObjectImpl>();
+    HashMap<String, DartObjectImpl> parameterMap =
+        new HashMap<String, DartObjectImpl>();
     List<ParameterElement> parameters = constructor.parameters;
     int parameterCount = parameters.length;
     for (int i = 0; i < parameterCount; i++) {
@@ -724,10 +825,11 @@
         errorTarget = node;
       }
       if (argumentValue == null && baseParameter is ParameterElementImpl) {
-        // The parameter is an optional positional parameter for which no value was provided, so
-        // use the default value.
+        // The parameter is an optional positional parameter for which no value
+        // was provided, so use the default value.
         beforeGetParameterDefault(baseParameter);
-        EvaluationResultImpl evaluationResult = (baseParameter as ParameterElementImpl).evaluationResult;
+        EvaluationResultImpl evaluationResult =
+            (baseParameter as ParameterElementImpl).evaluationResult;
         if (evaluationResult == null) {
           // No default was provided, so the default value is null.
           argumentValue = constantVisitor.null2;
@@ -766,14 +868,17 @@
         }
       }
     }
-    ConstantVisitor initializerVisitor = new ConstantVisitor.con2(typeProvider, parameterMap, errorReporter);
+    ConstantVisitor initializerVisitor =
+        new ConstantVisitor.con2(typeProvider, parameterMap, errorReporter);
     String superName = null;
     NodeList<Expression> superArguments = null;
     for (ConstructorInitializer initializer in initializers) {
       if (initializer is ConstructorFieldInitializer) {
         ConstructorFieldInitializer constructorFieldInitializer = initializer;
-        Expression initializerExpression = constructorFieldInitializer.expression;
-        DartObjectImpl evaluationResult = initializerExpression.accept(initializerVisitor);
+        Expression initializerExpression =
+            constructorFieldInitializer.expression;
+        DartObjectImpl evaluationResult =
+            initializerExpression.accept(initializerVisitor);
         if (evaluationResult != null) {
           String fieldName = constructorFieldInitializer.fieldName.name;
           fieldMap[fieldName] = evaluationResult;
@@ -783,7 +888,8 @@
             if (!_runtimeTypeMatch(evaluationResult, field.type)) {
               errorReporter.reportErrorForNode(
                   CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-                  node, [evaluationResult.type, fieldName, field.type]);
+                  node,
+                  [evaluationResult.type, fieldName, field.type]);
             }
           }
         }
@@ -800,28 +906,46 @@
         ConstructorElement constructor = initializer.staticElement;
         if (constructor != null && constructor.isConst) {
           return _evaluateConstructorCall(
-              node, initializer.argumentList.arguments, constructor,
-              initializerVisitor, errorReporter);
+              node,
+              initializer.argumentList.arguments,
+              constructor,
+              initializerVisitor,
+              errorReporter);
         }
       }
     }
     // Evaluate explicit or implicit call to super().
     InterfaceType superclass = definingClass.superclass;
     if (superclass != null && !superclass.isObject) {
-      ConstructorElement superConstructor = superclass.lookUpConstructor(superName, constructor.library);
+      ConstructorElement superConstructor =
+          superclass.lookUpConstructor(superName, constructor.library);
       if (superConstructor != null) {
         if (superArguments == null) {
           superArguments = new NodeList<Expression>(null);
         }
-        _evaluateSuperConstructorCall(node, fieldMap, superConstructor, superArguments, initializerVisitor, errorReporter);
+        _evaluateSuperConstructorCall(
+            node,
+            fieldMap,
+            superConstructor,
+            superArguments,
+            initializerVisitor,
+            errorReporter);
       }
     }
     return new DartObjectImpl(definingClass, new GenericState(fieldMap));
   }
 
-  void _evaluateSuperConstructorCall(AstNode node, HashMap<String, DartObjectImpl> fieldMap, ConstructorElement superConstructor, NodeList<Expression> superArguments, ConstantVisitor initializerVisitor, ErrorReporter errorReporter) {
+  void _evaluateSuperConstructorCall(AstNode node, HashMap<String,
+      DartObjectImpl> fieldMap, ConstructorElement superConstructor,
+      NodeList<Expression> superArguments, ConstantVisitor initializerVisitor,
+      ErrorReporter errorReporter) {
     if (superConstructor != null && superConstructor.isConst) {
-      DartObjectImpl evaluationResult = _evaluateConstructorCall(node, superArguments, superConstructor, initializerVisitor, errorReporter);
+      DartObjectImpl evaluationResult = _evaluateConstructorCall(
+          node,
+          superArguments,
+          superConstructor,
+          initializerVisitor,
+          errorReporter);
       if (evaluationResult != null) {
         fieldMap[GenericState.SUPERCLASS_FIELD] = evaluationResult;
       }
@@ -837,30 +961,38 @@
    *         is encountered), the chain will be followed as far as possible and then a const factory
    *         constructor will be returned.
    */
-  ConstructorElement _followConstantRedirectionChain(ConstructorElement constructor) {
-    HashSet<ConstructorElement> constructorsVisited = new HashSet<ConstructorElement>();
+  ConstructorElement
+      _followConstantRedirectionChain(ConstructorElement constructor) {
+    HashSet<ConstructorElement> constructorsVisited =
+        new HashSet<ConstructorElement>();
     while (constructor.isFactory) {
-      if (identical(constructor.enclosingElement.type, typeProvider.symbolType)) {
-        // The dart:core.Symbol has a const factory constructor that redirects to
-        // dart:_internal.Symbol.  That in turn redirects to an external const constructor, which
-        // we won't be able to evaluate.  So stop following the chain of redirections at
-        // dart:core.Symbol, and let [evaluateInstanceCreationExpression] handle it specially.
+      if (identical(
+          constructor.enclosingElement.type,
+          typeProvider.symbolType)) {
+        // The dart:core.Symbol has a const factory constructor that redirects
+        // to dart:_internal.Symbol.  That in turn redirects to an external
+        // const constructor, which we won't be able to evaluate.
+        // So stop following the chain of redirections at dart:core.Symbol, and
+        // let [evaluateInstanceCreationExpression] handle it specially.
         break;
       }
       constructorsVisited.add(constructor);
-      ConstructorElement redirectedConstructor = constructor.redirectedConstructor;
+      ConstructorElement redirectedConstructor =
+          constructor.redirectedConstructor;
       if (redirectedConstructor == null) {
         // This can happen if constructor is an external factory constructor.
         break;
       }
       if (!redirectedConstructor.isConst) {
         // Delegating to a non-const constructor--this is not allowed (and
-        // is checked elsewhere--see [ErrorVerifier.checkForRedirectToNonConstConstructor()]).
+        // is checked elsewhere--see
+        // [ErrorVerifier.checkForRedirectToNonConstConstructor()]).
         break;
       }
       if (constructorsVisited.contains(redirectedConstructor)) {
         // Cycle in redirecting factory constructors--this is not allowed
-        // and is checked elsewhere--see [ErrorVerifier.checkForRecursiveFactoryRedirect()]).
+        // and is checked elsewhere--see
+        // [ErrorVerifier.checkForRecursiveFactoryRedirect()]).
         break;
       }
       constructor = redirectedConstructor;
@@ -900,6 +1032,15 @@
     }
     return obj.type.isSubtypeOf(type);
   }
+
+  /**
+   * Determine whether the given string is a valid name for a public symbol (i.e. whether it is
+   * allowed for a call to the Symbol constructor).
+   */
+  static bool isValidPublicSymbol(String name) =>
+      name.isEmpty ||
+          name == "void" ||
+          new JavaPatternMatcher(_PUBLIC_SYMBOL_PATTERN, name).matches();
 }
 
 /**
@@ -914,13 +1055,24 @@
   ConstantValueComputer_InitializerCloner() : super(true);
 
   @override
-  InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) {
-    InstanceCreationExpression expression = super.visitInstanceCreationExpression(node);
+  InstanceCreationExpression
+      visitInstanceCreationExpression(InstanceCreationExpression node) {
+    InstanceCreationExpression expression =
+        super.visitInstanceCreationExpression(node);
     expression.evaluationResult = node.evaluationResult;
     return expression;
   }
 
   @override
+  RedirectingConstructorInvocation
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    RedirectingConstructorInvocation invocation =
+        super.visitRedirectingConstructorInvocation(node);
+    invocation.staticElement = node.staticElement;
+    return invocation;
+  }
+
+  @override
   SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
     SimpleIdentifier identifier = super.visitSimpleIdentifier(node);
     identifier.staticElement = node.staticElement;
@@ -928,17 +1080,10 @@
   }
 
   @override
-  SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    SuperConstructorInvocation invocation = super.visitSuperConstructorInvocation(node);
-    invocation.staticElement = node.staticElement;
-    return invocation;
-  }
-
-  @override
-  RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
-      RedirectingConstructorInvocation node) {
-    RedirectingConstructorInvocation invocation =
-        super.visitRedirectingConstructorInvocation(node);
+  SuperConstructorInvocation
+      visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    SuperConstructorInvocation invocation =
+        super.visitSuperConstructorInvocation(node);
     invocation.staticElement = node.staticElement;
     return invocation;
   }
@@ -1019,7 +1164,8 @@
    */
   ConstantVisitor.con1(this._typeProvider, this._errorReporter) {
     this._lexicalEnvironment = null;
-    this._dartObjectComputer = new DartObjectComputer(_errorReporter, _typeProvider);
+    this._dartObjectComputer =
+        new DartObjectComputer(_errorReporter, _typeProvider);
   }
 
   /**
@@ -1029,9 +1175,31 @@
    * @param lexicalEnvironment values which should override simpleIdentifiers, or null if no
    *          overriding is necessary.
    */
-  ConstantVisitor.con2(this._typeProvider, HashMap<String, DartObjectImpl> lexicalEnvironment, this._errorReporter) {
+  ConstantVisitor.con2(this._typeProvider, HashMap<String,
+      DartObjectImpl> lexicalEnvironment, this._errorReporter) {
     this._lexicalEnvironment = lexicalEnvironment;
-    this._dartObjectComputer = new DartObjectComputer(_errorReporter, _typeProvider);
+    this._dartObjectComputer =
+        new DartObjectComputer(_errorReporter, _typeProvider);
+  }
+
+  /**
+   * Return an object representing the value 'null'.
+   *
+   * @return an object representing the value 'null'
+   */
+  DartObjectImpl get null2 {
+    if (_nullObject == null) {
+      _nullObject =
+          new DartObjectImpl(_typeProvider.nullType, NullState.NULL_STATE);
+    }
+    return _nullObject;
+  }
+
+  /**
+   * This method is called just before retrieving an evaluation result from an AST node. Unit tests
+   * will override it to introduce additional error checking.
+   */
+  void beforeGetEvaluationResult(AstNode node) {
   }
 
   @override
@@ -1041,7 +1209,8 @@
       if (result == null) {
         result = string.accept(this);
       } else {
-        result = _dartObjectComputer.concatenate(node, result, string.accept(this));
+        result =
+            _dartObjectComputer.concatenate(node, result, string.accept(this));
       }
     }
     return result;
@@ -1054,7 +1223,8 @@
     TokenType operatorType = node.operator.type;
     // 'null' is almost never good operand
     if (operatorType != TokenType.BANG_EQ && operatorType != TokenType.EQ_EQ) {
-      if (leftResult != null && leftResult.isNull || rightResult != null && rightResult.isNull) {
+      if (leftResult != null && leftResult.isNull ||
+          rightResult != null && rightResult.isNull) {
         _error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
         return null;
       }
@@ -1078,13 +1248,19 @@
       } else if (operatorType == TokenType.GT) {
         return _dartObjectComputer.greaterThan(node, leftResult, rightResult);
       } else if (operatorType == TokenType.GT_EQ) {
-        return _dartObjectComputer.greaterThanOrEqual(node, leftResult, rightResult);
+        return _dartObjectComputer.greaterThanOrEqual(
+            node,
+            leftResult,
+            rightResult);
       } else if (operatorType == TokenType.GT_GT) {
         return _dartObjectComputer.shiftRight(node, leftResult, rightResult);
       } else if (operatorType == TokenType.LT) {
         return _dartObjectComputer.lessThan(node, leftResult, rightResult);
       } else if (operatorType == TokenType.LT_EQ) {
-        return _dartObjectComputer.lessThanOrEqual(node, leftResult, rightResult);
+        return _dartObjectComputer.lessThanOrEqual(
+            node,
+            leftResult,
+            rightResult);
       } else if (operatorType == TokenType.LT_LT) {
         return _dartObjectComputer.shiftLeft(node, leftResult, rightResult);
       } else if (operatorType == TokenType.MINUS) {
@@ -1109,7 +1285,8 @@
   }
 
   @override
-  DartObjectImpl visitBooleanLiteral(BooleanLiteral node) => new DartObjectImpl(_typeProvider.boolType, BoolState.from(node.value));
+  DartObjectImpl visitBooleanLiteral(BooleanLiteral node) =>
+      new DartObjectImpl(_typeProvider.boolType, BoolState.from(node.value));
 
   @override
   DartObjectImpl visitConditionalExpression(ConditionalExpression node) {
@@ -1120,14 +1297,17 @@
     if (conditionResult == null) {
       return conditionResult;
     } else if (!conditionResult.isBool) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, condition);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+          condition);
       return null;
     } else if (thenResult == null) {
       return thenResult;
     } else if (elseResult == null) {
       return elseResult;
     }
-    conditionResult = _dartObjectComputer.applyBooleanConversion(condition, conditionResult);
+    conditionResult =
+        _dartObjectComputer.applyBooleanConversion(condition, conditionResult);
     if (conditionResult == null) {
       return conditionResult;
     }
@@ -1138,14 +1318,17 @@
     }
     ParameterizedType thenType = thenResult.type;
     ParameterizedType elseType = elseResult.type;
-    return _validWithUnknownValue(thenType.getLeastUpperBound(elseType) as InterfaceType);
+    return _validWithUnknownValue(
+        thenType.getLeastUpperBound(elseType) as InterfaceType);
   }
 
   @override
-  DartObjectImpl visitDoubleLiteral(DoubleLiteral node) => new DartObjectImpl(_typeProvider.doubleType, new DoubleState(node.value));
+  DartObjectImpl visitDoubleLiteral(DoubleLiteral node) =>
+      new DartObjectImpl(_typeProvider.doubleType, new DoubleState(node.value));
 
   @override
-  DartObjectImpl visitInstanceCreationExpression(InstanceCreationExpression node) {
+  DartObjectImpl
+      visitInstanceCreationExpression(InstanceCreationExpression node) {
     if (!node.isConst) {
       // TODO(brianwilkerson) Figure out which error to report.
       _error(node, null);
@@ -1162,7 +1345,8 @@
   }
 
   @override
-  DartObjectImpl visitIntegerLiteral(IntegerLiteral node) => new DartObjectImpl(_typeProvider.intType, new IntState(node.value));
+  DartObjectImpl visitIntegerLiteral(IntegerLiteral node) =>
+      new DartObjectImpl(_typeProvider.intType, new IntState(node.value));
 
   @override
   DartObjectImpl visitInterpolationExpression(InterpolationExpression node) {
@@ -1175,12 +1359,15 @@
   }
 
   @override
-  DartObjectImpl visitInterpolationString(InterpolationString node) => new DartObjectImpl(_typeProvider.stringType, new StringState(node.value));
+  DartObjectImpl visitInterpolationString(InterpolationString node) =>
+      new DartObjectImpl(_typeProvider.stringType, new StringState(node.value));
 
   @override
   DartObjectImpl visitListLiteral(ListLiteral node) {
     if (node.constKeyword == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL,
+          node);
       return null;
     }
     bool errorOccurred = false;
@@ -1197,7 +1384,8 @@
       return null;
     }
     DartType elementType = _typeProvider.dynamicType;
-    if (node.typeArguments != null && node.typeArguments.arguments.length == 1) {
+    if (node.typeArguments != null &&
+        node.typeArguments.arguments.length == 1) {
       DartType type = node.typeArguments.arguments[0].type;
       if (type != null) {
         elementType = type;
@@ -1210,11 +1398,14 @@
   @override
   DartObjectImpl visitMapLiteral(MapLiteral node) {
     if (node.constKeyword == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL,
+          node);
       return null;
     }
     bool errorOccurred = false;
-    HashMap<DartObjectImpl, DartObjectImpl> map = new HashMap<DartObjectImpl, DartObjectImpl>();
+    HashMap<DartObjectImpl, DartObjectImpl> map =
+        new HashMap<DartObjectImpl, DartObjectImpl>();
     for (MapLiteralEntry entry in node.entries) {
       DartObjectImpl keyResult = entry.key.accept(this);
       DartObjectImpl valueResult = entry.value.accept(this);
@@ -1229,7 +1420,8 @@
     }
     DartType keyType = _typeProvider.dynamicType;
     DartType valueType = _typeProvider.dynamicType;
-    if (node.typeArguments != null && node.typeArguments.arguments.length == 2) {
+    if (node.typeArguments != null &&
+        node.typeArguments.arguments.length == 2) {
       DartType keyTypeCandidate = node.typeArguments.arguments[0].type;
       if (keyTypeCandidate != null) {
         keyType = keyTypeCandidate;
@@ -1239,8 +1431,8 @@
         valueType = valueTypeCandidate;
       }
     }
-    InterfaceType mapType = _typeProvider.mapType.substitute4(
-        [keyType, valueType]);
+    InterfaceType mapType =
+        _typeProvider.mapType.substitute4([keyType, valueType]);
     return new DartObjectImpl(mapType, new MapState(map));
   }
 
@@ -1258,7 +1450,9 @@
             if (library.isDartCore) {
               DartObjectImpl leftArgument = arguments[0].accept(this);
               DartObjectImpl rightArgument = arguments[1].accept(this);
-              return _dartObjectComputer.isIdentical(node, leftArgument,
+              return _dartObjectComputer.isIdentical(
+                  node,
+                  leftArgument,
                   rightArgument);
             }
           }
@@ -1271,7 +1465,8 @@
   }
 
   @override
-  DartObjectImpl visitNamedExpression(NamedExpression node) => node.expression.accept(this);
+  DartObjectImpl visitNamedExpression(NamedExpression node) =>
+      node.expression.accept(this);
 
   @override
   DartObjectImpl visitNode(AstNode node) {
@@ -1284,11 +1479,13 @@
   DartObjectImpl visitNullLiteral(NullLiteral node) => null2;
 
   @override
-  DartObjectImpl visitParenthesizedExpression(ParenthesizedExpression node) => node.expression.accept(this);
+  DartObjectImpl visitParenthesizedExpression(ParenthesizedExpression node) =>
+      node.expression.accept(this);
 
   @override
   DartObjectImpl visitPrefixedIdentifier(PrefixedIdentifier node) {
-    // TODO(brianwilkerson) Uncomment the lines below when the new constant support can be added.
+    // TODO(brianwilkerson) Uncomment the lines below when the new constant
+    // support can be added.
     //    Element element = node.getStaticElement();
     //    if (isStringLength(element)) {
     //      EvaluationResultImpl target = node.getPrefix().accept(this);
@@ -1333,7 +1530,8 @@
   @override
   DartObjectImpl visitPropertyAccess(PropertyAccess node) {
     Element element = node.propertyName.staticElement;
-    // TODO(brianwilkerson) Uncomment the lines below when the new constant support can be added.
+    // TODO(brianwilkerson) Uncomment the lines below when the new constant
+    // support can be added.
     //    if (isStringLength(element)) {
     //      EvaluationResultImpl target = node.getRealTarget().accept(this);
     //      return target.stringLength(typeProvider, node);
@@ -1343,14 +1541,16 @@
 
   @override
   DartObjectImpl visitSimpleIdentifier(SimpleIdentifier node) {
-    if (_lexicalEnvironment != null && _lexicalEnvironment.containsKey(node.name)) {
+    if (_lexicalEnvironment != null &&
+        _lexicalEnvironment.containsKey(node.name)) {
       return _lexicalEnvironment[node.name];
     }
     return _getConstantValue(node, node.staticElement);
   }
 
   @override
-  DartObjectImpl visitSimpleStringLiteral(SimpleStringLiteral node) => new DartObjectImpl(_typeProvider.stringType, new StringState(node.value));
+  DartObjectImpl visitSimpleStringLiteral(SimpleStringLiteral node) =>
+      new DartObjectImpl(_typeProvider.stringType, new StringState(node.value));
 
   @override
   DartObjectImpl visitStringInterpolation(StringInterpolation node) {
@@ -1361,7 +1561,8 @@
         result = element.accept(this);
         first = false;
       } else {
-        result = _dartObjectComputer.concatenate(node, result, element.accept(this));
+        result =
+            _dartObjectComputer.concatenate(node, result, element.accept(this));
       }
     }
     return result;
@@ -1377,57 +1578,9 @@
       }
       buffer.write(components[i].lexeme);
     }
-    return new DartObjectImpl(_typeProvider.symbolType, new SymbolState(buffer.toString()));
-  }
-
-  /**
-   * This method is called just before retrieving an evaluation result from an AST node. Unit tests
-   * will override it to introduce additional error checking.
-   */
-  void beforeGetEvaluationResult(AstNode node) {
-  }
-
-  /**
-   * Return an object representing the value 'null'.
-   *
-   * @return an object representing the value 'null'
-   */
-  DartObjectImpl get null2 {
-    if (_nullObject == null) {
-      _nullObject = new DartObjectImpl(_typeProvider.nullType, NullState.NULL_STATE);
-    }
-    return _nullObject;
-  }
-
-  DartObjectImpl _validWithUnknownValue(InterfaceType type) {
-    if (type.element.library.isDartCore) {
-      String typeName = type.name;
-      if (typeName == "bool") {
-        return new DartObjectImpl(type, BoolState.UNKNOWN_VALUE);
-      } else if (typeName == "double") {
-        return new DartObjectImpl(type, DoubleState.UNKNOWN_VALUE);
-      } else if (typeName == "int") {
-        return new DartObjectImpl(type, IntState.UNKNOWN_VALUE);
-      } else if (typeName == "String") {
-        return new DartObjectImpl(type, StringState.UNKNOWN_VALUE);
-      }
-    }
-    return new DartObjectImpl(type, GenericState.UNKNOWN_VALUE);
-  }
-
-  /**
-   * Return the value of the given expression, or a representation of 'null' if the expression
-   * cannot be evaluated.
-   *
-   * @param expression the expression whose value is to be returned
-   * @return the value of the given expression
-   */
-  DartObjectImpl _valueOf(Expression expression) {
-    DartObjectImpl expressionValue = expression.accept(this);
-    if (expressionValue != null) {
-      return expressionValue;
-    }
-    return null2;
+    return new DartObjectImpl(
+        _typeProvider.symbolType,
+        new SymbolState(buffer.toString()));
   }
 
   /**
@@ -1437,7 +1590,9 @@
    * @param code the error code indicating the nature of the error
    */
   void _error(AstNode node, ErrorCode code) {
-    _errorReporter.reportErrorForNode(code == null ? CompileTimeErrorCode.INVALID_CONSTANT : code, node);
+    _errorReporter.reportErrorForNode(
+        code == null ? CompileTimeErrorCode.INVALID_CONSTANT : code,
+        node);
   }
 
   /**
@@ -1475,22 +1630,35 @@
     return null;
   }
 
+  DartObjectImpl _validWithUnknownValue(InterfaceType type) {
+    if (type.element.library.isDartCore) {
+      String typeName = type.name;
+      if (typeName == "bool") {
+        return new DartObjectImpl(type, BoolState.UNKNOWN_VALUE);
+      } else if (typeName == "double") {
+        return new DartObjectImpl(type, DoubleState.UNKNOWN_VALUE);
+      } else if (typeName == "int") {
+        return new DartObjectImpl(type, IntState.UNKNOWN_VALUE);
+      } else if (typeName == "String") {
+        return new DartObjectImpl(type, StringState.UNKNOWN_VALUE);
+      }
+    }
+    return new DartObjectImpl(type, GenericState.UNKNOWN_VALUE);
+  }
+
   /**
-   * Return `true` if the given element represents the 'length' getter in class 'String'.
+   * Return the value of the given expression, or a representation of 'null' if the expression
+   * cannot be evaluated.
    *
-   * @param element the element being tested.
-   * @return
+   * @param expression the expression whose value is to be returned
+   * @return the value of the given expression
    */
-  bool _isStringLength(Element element) {
-    if (element is! PropertyAccessorElement) {
-      return false;
+  DartObjectImpl _valueOf(Expression expression) {
+    DartObjectImpl expressionValue = expression.accept(this);
+    if (expressionValue != null) {
+      return expressionValue;
     }
-    PropertyAccessorElement accessor = element as PropertyAccessorElement;
-    if (!accessor.isGetter || accessor.name != "length") {
-      return false;
-    }
-    Element parent = accessor.enclosingElement;
-    return parent == _typeProvider.stringType.element;
+    return null2;
   }
 }
 
@@ -1516,6 +1684,13 @@
   double get doubleValue;
 
   /**
+   * Return `true` if this object's value can be represented exactly.
+   *
+   * @return `true` if this object's value can be represented exactly
+   */
+  bool get hasExactValue;
+
+  /**
    * Return the integer value of this object, or `null` if either the value of this object is
    * not known or this object is not of type 'int'.
    *
@@ -1524,6 +1699,27 @@
   int get intValue;
 
   /**
+   * Return `true` if this object represents the value 'false'.
+   *
+   * @return `true` if this object represents the value 'false'
+   */
+  bool get isFalse;
+
+  /**
+   * Return `true` if this object represents the value 'null'.
+   *
+   * @return `true` if this object represents the value 'null'
+   */
+  bool get isNull;
+
+  /**
+   * Return `true` if this object represents the value 'true'.
+   *
+   * @return `true` if this object represents the value 'true'
+   */
+  bool get isTrue;
+
+  /**
    * Return the string value of this object, or `null` if either the value of this object is
    * not known or this object is not of type 'String'.
    *
@@ -1546,34 +1742,6 @@
    * @return this object's value
    */
   Object get value;
-
-  /**
-   * Return `true` if this object's value can be represented exactly.
-   *
-   * @return `true` if this object's value can be represented exactly
-   */
-  bool get hasExactValue;
-
-  /**
-   * Return `true` if this object represents the value 'false'.
-   *
-   * @return `true` if this object represents the value 'false'
-   */
-  bool get isFalse;
-
-  /**
-   * Return `true` if this object represents the value 'null'.
-   *
-   * @return `true` if this object represents the value 'null'
-   */
-  bool get isNull;
-
-  /**
-   * Return `true` if this object represents the value 'true'.
-   *
-   * @return `true` if this object represents the value 'true'
-   */
-  bool get isTrue;
 }
 
 /**
@@ -1594,7 +1762,8 @@
 
   DartObjectComputer(this._errorReporter, this._typeProvider);
 
-  DartObjectImpl add(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl add(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.add(_typeProvider, rightOperand);
@@ -1612,7 +1781,8 @@
    * @param node the node against which errors should be reported
    * @return the result of applying boolean conversion to the given value
    */
-  DartObjectImpl applyBooleanConversion(AstNode node, DartObjectImpl evaluationResult) {
+  DartObjectImpl applyBooleanConversion(AstNode node,
+      DartObjectImpl evaluationResult) {
     if (evaluationResult != null) {
       try {
         return evaluationResult.convertToBool(_typeProvider);
@@ -1623,7 +1793,8 @@
     return null;
   }
 
-  DartObjectImpl bitAnd(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl bitAnd(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.bitAnd(_typeProvider, rightOperand);
@@ -1645,7 +1816,8 @@
     return null;
   }
 
-  DartObjectImpl bitOr(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl bitOr(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.bitOr(_typeProvider, rightOperand);
@@ -1656,7 +1828,8 @@
     return null;
   }
 
-  DartObjectImpl bitXor(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl bitXor(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.bitXor(_typeProvider, rightOperand);
@@ -1667,7 +1840,8 @@
     return null;
   }
 
-  DartObjectImpl concatenate(Expression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl concatenate(Expression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.concatenate(_typeProvider, rightOperand);
@@ -1678,7 +1852,8 @@
     return null;
   }
 
-  DartObjectImpl divide(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl divide(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.divide(_typeProvider, rightOperand);
@@ -1689,7 +1864,8 @@
     return null;
   }
 
-  DartObjectImpl equalEqual(Expression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl equalEqual(Expression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.equalEqual(_typeProvider, rightOperand);
@@ -1700,7 +1876,8 @@
     return null;
   }
 
-  DartObjectImpl greaterThan(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl greaterThan(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.greaterThan(_typeProvider, rightOperand);
@@ -1711,7 +1888,8 @@
     return null;
   }
 
-  DartObjectImpl greaterThanOrEqual(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl greaterThanOrEqual(BinaryExpression node,
+      DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.greaterThanOrEqual(_typeProvider, rightOperand);
@@ -1722,7 +1900,8 @@
     return null;
   }
 
-  DartObjectImpl integerDivide(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl integerDivide(BinaryExpression node,
+      DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.integerDivide(_typeProvider, rightOperand);
@@ -1734,7 +1913,7 @@
   }
 
   DartObjectImpl isIdentical(Expression node, DartObjectImpl leftOperand,
-                             DartObjectImpl rightOperand) {
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.isIdentical(_typeProvider, rightOperand);
@@ -1745,7 +1924,8 @@
     return null;
   }
 
-  DartObjectImpl lessThan(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl lessThan(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.lessThan(_typeProvider, rightOperand);
@@ -1756,7 +1936,8 @@
     return null;
   }
 
-  DartObjectImpl lessThanOrEqual(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl lessThanOrEqual(BinaryExpression node,
+      DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.lessThanOrEqual(_typeProvider, rightOperand);
@@ -1767,7 +1948,8 @@
     return null;
   }
 
-  DartObjectImpl logicalAnd(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl logicalAnd(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.logicalAnd(_typeProvider, rightOperand);
@@ -1789,7 +1971,8 @@
     return null;
   }
 
-  DartObjectImpl logicalOr(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl logicalOr(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.logicalOr(_typeProvider, rightOperand);
@@ -1800,7 +1983,8 @@
     return null;
   }
 
-  DartObjectImpl minus(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl minus(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.minus(_typeProvider, rightOperand);
@@ -1822,7 +2006,8 @@
     return null;
   }
 
-  DartObjectImpl notEqual(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl notEqual(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.notEqual(_typeProvider, rightOperand);
@@ -1833,7 +2018,8 @@
     return null;
   }
 
-  DartObjectImpl performToString(AstNode node, DartObjectImpl evaluationResult) {
+  DartObjectImpl performToString(AstNode node,
+      DartObjectImpl evaluationResult) {
     if (evaluationResult != null) {
       try {
         return evaluationResult.performToString(_typeProvider);
@@ -1844,7 +2030,8 @@
     return null;
   }
 
-  DartObjectImpl remainder(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl remainder(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.remainder(_typeProvider, rightOperand);
@@ -1855,7 +2042,8 @@
     return null;
   }
 
-  DartObjectImpl shiftLeft(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl shiftLeft(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.shiftLeft(_typeProvider, rightOperand);
@@ -1866,7 +2054,8 @@
     return null;
   }
 
-  DartObjectImpl shiftRight(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl shiftRight(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.shiftRight(_typeProvider, rightOperand);
@@ -1883,10 +2072,12 @@
    * @param node the node against which errors should be reported
    * @return the result of invoking the 'length' getter on this result
    */
-  EvaluationResultImpl stringLength(Expression node, EvaluationResultImpl evaluationResult) {
+  EvaluationResultImpl stringLength(Expression node,
+      EvaluationResultImpl evaluationResult) {
     if (evaluationResult.value != null) {
       try {
-        return new EvaluationResultImpl.con1(evaluationResult.value.stringLength(_typeProvider));
+        return new EvaluationResultImpl.con1(
+            evaluationResult.value.stringLength(_typeProvider));
       } on EvaluationException catch (exception) {
         _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
@@ -1894,7 +2085,8 @@
     return new EvaluationResultImpl.con1(null);
   }
 
-  DartObjectImpl times(BinaryExpression node, DartObjectImpl leftOperand, DartObjectImpl rightOperand) {
+  DartObjectImpl times(BinaryExpression node, DartObjectImpl leftOperand,
+      DartObjectImpl rightOperand) {
     if (leftOperand != null && rightOperand != null) {
       try {
         return leftOperand.times(_typeProvider, rightOperand);
@@ -1911,6 +2103,11 @@
  */
 class DartObjectImpl implements DartObject {
   /**
+   * An empty list of objects.
+   */
+  static const List<DartObjectImpl> EMPTY_LIST = const <DartObjectImpl>[];
+
+  /**
    * The run-time type of this object.
    */
   final ParameterizedType type;
@@ -1921,11 +2118,6 @@
   final InstanceState _state;
 
   /**
-   * An empty list of objects.
-   */
-  static const List<DartObjectImpl> EMPTY_LIST = const <DartObjectImpl>[];
-
-  /**
    * Initialize a newly created object to have the given type and state.
    *
    * @param type the run-time type of this object
@@ -1933,6 +2125,97 @@
    */
   DartObjectImpl(this.type, this._state);
 
+  @override
+  bool get boolValue {
+    if (_state is BoolState) {
+      return (_state as BoolState).value;
+    }
+    return null;
+  }
+
+  @override
+  double get doubleValue {
+    if (_state is DoubleState) {
+      return (_state as DoubleState).value;
+    }
+    return null;
+  }
+
+  HashMap<String, DartObjectImpl> get fields => _state.fields;
+
+  @override
+  bool get hasExactValue => _state.hasExactValue;
+
+  @override
+  int get hashCode =>
+      ObjectUtilities.combineHashCodes(type.hashCode, _state.hashCode);
+
+  @override
+  int get intValue {
+    if (_state is IntState) {
+      return (_state as IntState).value;
+    }
+    return null;
+  }
+
+  /**
+   * Return `true` if this object represents an object whose type is 'bool'.
+   *
+   * @return `true` if this object represents a boolean value
+   */
+  bool get isBool => _state.isBool;
+
+  /**
+   * Return `true` if this object represents an object whose type is either 'bool', 'num',
+   * 'String', or 'Null'.
+   *
+   * @return `true` if this object represents either a boolean, numeric, string or null value
+   */
+  bool get isBoolNumStringOrNull => _state.isBoolNumStringOrNull;
+
+  @override
+  bool get isFalse =>
+      _state is BoolState && identical((_state as BoolState).value, false);
+
+  @override
+  bool get isNull => _state is NullState;
+
+  @override
+  bool get isTrue =>
+      _state is BoolState && identical((_state as BoolState).value, true);
+
+  /**
+   * Return true if this object represents an unknown value.
+   */
+  bool get isUnknown => _state.isUnknown;
+
+  /**
+   * Return `true` if this object represents an instance of a user-defined class.
+   *
+   * @return `true` if this object represents an instance of a user-defined class
+   */
+  bool get isUserDefinedObject => _state is GenericState;
+
+  @override
+  String get stringValue {
+    if (_state is StringState) {
+      return (_state as StringState).value;
+    }
+    return null;
+  }
+
+  @override
+  Object get value => _state.value;
+
+  @override
+  bool operator ==(Object object) {
+    if (object is! DartObjectImpl) {
+      return false;
+    }
+    DartObjectImpl dartObject = object as DartObjectImpl;
+    return type == dartObject.type && _state == dartObject._state;
+  }
+
   /**
    * Return the result of invoking the '+' operator on this object with the given argument.
    *
@@ -1964,7 +2247,9 @@
    * @return the result of invoking the '&' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl bitAnd(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.bitAnd(rightOperand._state));
+  DartObjectImpl bitAnd(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.intType, _state.bitAnd(rightOperand._state));
 
   /**
    * Return the result of invoking the '~' operator on this object.
@@ -1973,7 +2258,8 @@
    * @return the result of invoking the '~' operator on this object
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl bitNot(TypeProvider typeProvider) => new DartObjectImpl(typeProvider.intType, _state.bitNot());
+  DartObjectImpl bitNot(TypeProvider typeProvider) =>
+      new DartObjectImpl(typeProvider.intType, _state.bitNot());
 
   /**
    * Return the result of invoking the '|' operator on this object with the given argument.
@@ -1983,7 +2269,9 @@
    * @return the result of invoking the '|' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl bitOr(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.bitOr(rightOperand._state));
+  DartObjectImpl bitOr(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.intType, _state.bitOr(rightOperand._state));
 
   /**
    * Return the result of invoking the '^' operator on this object with the given argument.
@@ -1993,7 +2281,9 @@
    * @return the result of invoking the '^' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl bitXor(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.bitXor(rightOperand._state));
+  DartObjectImpl bitXor(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.intType, _state.bitXor(rightOperand._state));
 
   /**
    * Return the result of invoking the ' ' operator on this object with the given argument.
@@ -2003,7 +2293,11 @@
    * @return the result of invoking the ' ' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl concatenate(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.stringType, _state.concatenate(rightOperand._state));
+  DartObjectImpl concatenate(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.stringType,
+          _state.concatenate(rightOperand._state));
 
   /**
    * Return the result of applying boolean conversion to this object.
@@ -2028,7 +2322,8 @@
    * @return the result of invoking the '/' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl divide(TypeProvider typeProvider, DartObjectImpl rightOperand) {
+  DartObjectImpl divide(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) {
     InstanceState result = _state.divide(rightOperand._state);
     if (result is IntState) {
       return new DartObjectImpl(typeProvider.intType, result);
@@ -2049,62 +2344,26 @@
    * @return the result of invoking the '==' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl equalEqual(TypeProvider typeProvider, DartObjectImpl rightOperand) {
+  DartObjectImpl equalEqual(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) {
     if (type != rightOperand.type) {
       String typeName = type.name;
-      if (!(typeName == "bool" || typeName == "double" || typeName == "int" || typeName == "num" || typeName == "String" || typeName == "Null" || type.isDynamic)) {
-        throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
+      if (!(typeName == "bool" ||
+          typeName == "double" ||
+          typeName == "int" ||
+          typeName == "num" ||
+          typeName == "String" ||
+          typeName == "Null" ||
+          type.isDynamic)) {
+        throw new EvaluationException(
+            CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
       }
     }
-    return new DartObjectImpl(typeProvider.boolType, _state.equalEqual(rightOperand._state));
+    return new DartObjectImpl(
+        typeProvider.boolType,
+        _state.equalEqual(rightOperand._state));
   }
 
-  @override
-  bool operator ==(Object object) {
-    if (object is! DartObjectImpl) {
-      return false;
-    }
-    DartObjectImpl dartObject = object as DartObjectImpl;
-    return type == dartObject.type && _state == dartObject._state;
-  }
-
-  @override
-  bool get boolValue {
-    if (_state is BoolState) {
-      return (_state as BoolState).value;
-    }
-    return null;
-  }
-
-  @override
-  double get doubleValue {
-    if (_state is DoubleState) {
-      return (_state as DoubleState).value;
-    }
-    return null;
-  }
-
-  HashMap<String, DartObjectImpl> get fields => _state.fields;
-
-  @override
-  int get intValue {
-    if (_state is IntState) {
-      return (_state as IntState).value;
-    }
-    return null;
-  }
-
-  @override
-  String get stringValue {
-    if (_state is StringState) {
-      return (_state as StringState).value;
-    }
-    return null;
-  }
-
-  @override
-  Object get value => _state.value;
-
   /**
    * Return the result of invoking the '&gt;' operator on this object with the given argument.
    *
@@ -2113,7 +2372,11 @@
    * @return the result of invoking the '&gt;' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl greaterThan(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.greaterThan(rightOperand._state));
+  DartObjectImpl greaterThan(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.boolType,
+          _state.greaterThan(rightOperand._state));
 
   /**
    * Return the result of invoking the '&gt;=' operator on this object with the given argument.
@@ -2123,13 +2386,11 @@
    * @return the result of invoking the '&gt;=' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl greaterThanOrEqual(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.greaterThanOrEqual(rightOperand._state));
-
-  @override
-  bool get hasExactValue => _state.hasExactValue;
-
-  @override
-  int get hashCode => ObjectUtilities.combineHashCodes(type.hashCode, _state.hashCode);
+  DartObjectImpl greaterThanOrEqual(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.boolType,
+          _state.greaterThanOrEqual(rightOperand._state));
 
   /**
    * Return the result of invoking the '~/' operator on this object with the given argument.
@@ -2139,7 +2400,11 @@
    * @return the result of invoking the '~/' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl integerDivide(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.integerDivide(rightOperand._state));
+  DartObjectImpl integerDivide(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.intType,
+          _state.integerDivide(rightOperand._state));
 
   /**
    * Return the result of invoking the identical function on this object with
@@ -2151,48 +2416,13 @@
    *         the given argument
    */
   DartObjectImpl isIdentical(TypeProvider typeProvider,
-                             DartObjectImpl rightOperand) {
-    return new DartObjectImpl(typeProvider.boolType,
+      DartObjectImpl rightOperand) {
+    return new DartObjectImpl(
+        typeProvider.boolType,
         _state.isIdentical(rightOperand._state));
   }
 
   /**
-   * Return `true` if this object represents an object whose type is 'bool'.
-   *
-   * @return `true` if this object represents a boolean value
-   */
-  bool get isBool => _state.isBool;
-
-  /**
-   * Return `true` if this object represents an object whose type is either 'bool', 'num',
-   * 'String', or 'Null'.
-   *
-   * @return `true` if this object represents either a boolean, numeric, string or null value
-   */
-  bool get isBoolNumStringOrNull => _state.isBoolNumStringOrNull;
-
-  @override
-  bool get isFalse => _state is BoolState && identical((_state as BoolState).value, false);
-
-  @override
-  bool get isNull => _state is NullState;
-
-  @override
-  bool get isTrue => _state is BoolState && identical((_state as BoolState).value, true);
-
-  /**
-   * Return true if this object represents an unknown value.
-   */
-  bool get isUnknown => _state.isUnknown;
-
-  /**
-   * Return `true` if this object represents an instance of a user-defined class.
-   *
-   * @return `true` if this object represents an instance of a user-defined class
-   */
-  bool get isUserDefinedObject => _state is GenericState;
-
-  /**
    * Return the result of invoking the '&lt;' operator on this object with the given argument.
    *
    * @param typeProvider the type provider used to find known types
@@ -2200,7 +2430,9 @@
    * @return the result of invoking the '&lt;' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl lessThan(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.lessThan(rightOperand._state));
+  DartObjectImpl lessThan(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.boolType, _state.lessThan(rightOperand._state));
 
   /**
    * Return the result of invoking the '&lt;=' operator on this object with the given argument.
@@ -2210,7 +2442,11 @@
    * @return the result of invoking the '&lt;=' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl lessThanOrEqual(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.lessThanOrEqual(rightOperand._state));
+  DartObjectImpl lessThanOrEqual(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.boolType,
+          _state.lessThanOrEqual(rightOperand._state));
 
   /**
    * Return the result of invoking the '&&' operator on this object with the given argument.
@@ -2220,7 +2456,11 @@
    * @return the result of invoking the '&&' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl logicalAnd(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.logicalAnd(rightOperand._state));
+  DartObjectImpl logicalAnd(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.boolType,
+          _state.logicalAnd(rightOperand._state));
 
   /**
    * Return the result of invoking the '!' operator on this object.
@@ -2229,7 +2469,8 @@
    * @return the result of invoking the '!' operator on this object
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl logicalNot(TypeProvider typeProvider) => new DartObjectImpl(typeProvider.boolType, _state.logicalNot());
+  DartObjectImpl logicalNot(TypeProvider typeProvider) =>
+      new DartObjectImpl(typeProvider.boolType, _state.logicalNot());
 
   /**
    * Return the result of invoking the '||' operator on this object with the given argument.
@@ -2239,7 +2480,11 @@
    * @return the result of invoking the '||' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl logicalOr(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.boolType, _state.logicalOr(rightOperand._state));
+  DartObjectImpl logicalOr(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.boolType,
+          _state.logicalOr(rightOperand._state));
 
   /**
    * Return the result of invoking the '-' operator on this object with the given argument.
@@ -2290,14 +2535,21 @@
    * @return the result of invoking the '!=' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl notEqual(TypeProvider typeProvider, DartObjectImpl rightOperand) {
+  DartObjectImpl notEqual(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) {
     if (type != rightOperand.type) {
       String typeName = type.name;
-      if (typeName != "bool" && typeName != "double" && typeName != "int" && typeName != "num" && typeName != "String") {
+      if (typeName != "bool" &&
+          typeName != "double" &&
+          typeName != "int" &&
+          typeName != "num" &&
+          typeName != "String") {
         return new DartObjectImpl(typeProvider.boolType, BoolState.TRUE_STATE);
       }
     }
-    return new DartObjectImpl(typeProvider.boolType, _state.equalEqual(rightOperand._state).logicalNot());
+    return new DartObjectImpl(
+        typeProvider.boolType,
+        _state.equalEqual(rightOperand._state).logicalNot());
   }
 
   /**
@@ -2323,7 +2575,8 @@
    * @return the result of invoking the '%' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl remainder(TypeProvider typeProvider, DartObjectImpl rightOperand) {
+  DartObjectImpl remainder(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) {
     InstanceState result = _state.remainder(rightOperand._state);
     if (result is IntState) {
       return new DartObjectImpl(typeProvider.intType, result);
@@ -2333,7 +2586,8 @@
       return new DartObjectImpl(typeProvider.numType, result);
     }
     // We should never get here.
-    throw new IllegalStateException("remainder returned a ${result.runtimeType}");
+    throw new IllegalStateException(
+        "remainder returned a ${result.runtimeType}");
   }
 
   /**
@@ -2344,7 +2598,9 @@
    * @return the result of invoking the '&lt;&lt;' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl shiftLeft(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.shiftLeft(rightOperand._state));
+  DartObjectImpl shiftLeft(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.intType, _state.shiftLeft(rightOperand._state));
 
   /**
    * Return the result of invoking the '&gt;&gt;' operator on this object with the given argument.
@@ -2354,7 +2610,11 @@
    * @return the result of invoking the '&gt;&gt;' operator on this object with the given argument
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl shiftRight(TypeProvider typeProvider, DartObjectImpl rightOperand) => new DartObjectImpl(typeProvider.intType, _state.shiftRight(rightOperand._state));
+  DartObjectImpl shiftRight(TypeProvider typeProvider,
+      DartObjectImpl rightOperand) =>
+      new DartObjectImpl(
+          typeProvider.intType,
+          _state.shiftRight(rightOperand._state));
 
   /**
    * Return the result of invoking the 'length' getter on this object.
@@ -2363,7 +2623,8 @@
    * @return the result of invoking the 'length' getter on this object
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
-  DartObjectImpl stringLength(TypeProvider typeProvider) => new DartObjectImpl(typeProvider.intType, _state.stringLength());
+  DartObjectImpl stringLength(TypeProvider typeProvider) =>
+      new DartObjectImpl(typeProvider.intType, _state.stringLength());
 
   /**
    * Return the result of invoking the '*' operator on this object with the given argument.
@@ -2467,7 +2728,8 @@
   DartObject getString(TypeProvider typeProvider, String variableName) {
     String value = _declaredVariables[variableName];
     if (value == null) {
-      return new DartObjectImpl(typeProvider.stringType,
+      return new DartObjectImpl(
+          typeProvider.stringType,
           StringState.UNKNOWN_VALUE);
     }
     return new DartObjectImpl(typeProvider.stringType, new StringState(value));
@@ -2480,16 +2742,16 @@
  */
 class DoubleState extends NumState {
   /**
-   * The value of this instance.
-   */
-  final double value;
-
-  /**
    * A state that can be used to represent a double whose value is not known.
    */
   static DoubleState UNKNOWN_VALUE = new DoubleState(null);
 
   /**
+   * The value of this instance.
+   */
+  final double value;
+
+  /**
    * Initialize a newly created state to represent a double with the given value.
    *
    * @param value the value of this instance
@@ -2497,6 +2759,25 @@
   DoubleState(this.value);
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => value == null ? 0 : value.hashCode;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  bool get isUnknown => value == null;
+
+  @override
+  String get typeName => "double";
+
+  @override
+  bool operator ==(Object object) =>
+      object is DoubleState && (value == object.value);
+
+  @override
   NumState add(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     if (value == null) {
@@ -2517,7 +2798,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2549,7 +2831,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2559,6 +2842,83 @@
   }
 
   @override
+  BoolState greaterThan(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value > rightValue.toDouble());
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value > rightValue);
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
+  BoolState greaterThanOrEqual(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value >= rightValue.toDouble());
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value >= rightValue);
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
+  IntState integerDivide(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return IntState.UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return IntState.UNKNOWN_VALUE;
+      }
+      double result = value / rightValue.toDouble();
+      return new IntState(result.toInt());
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return IntState.UNKNOWN_VALUE;
+      }
+      double result = value / rightValue;
+      return new IntState(result.toInt());
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return IntState.UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
   BoolState isIdentical(InstanceState rightOperand) {
     if (value == null) {
       return BoolState.UNKNOWN_VALUE;
@@ -2582,98 +2942,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is DoubleState && (value == object.value);
-
-  @override
-  String get typeName => "double";
-
-  @override
-  BoolState greaterThan(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value > rightValue.toDouble());
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value > rightValue);
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  BoolState greaterThanOrEqual(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value >= rightValue.toDouble());
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value >= rightValue);
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => value == null ? 0 : value.hashCode;
-
-  @override
-  IntState integerDivide(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return IntState.UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return IntState.UNKNOWN_VALUE;
-      }
-      double result = value / rightValue.toDouble();
-      return new IntState(result.toInt());
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return IntState.UNKNOWN_VALUE;
-      }
-      double result = value / rightValue;
-      return new IntState(result.toInt());
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return IntState.UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
-  bool get isUnknown => value == null;
-
-  @override
   BoolState lessThan(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     if (value == null) {
@@ -2694,7 +2962,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return BoolState.UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2718,7 +2987,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return BoolState.UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2742,7 +3012,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2774,7 +3045,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2798,7 +3070,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -2816,6 +3089,15 @@
   static DynamicState DYNAMIC_STATE = new DynamicState();
 
   @override
+  bool get isBool => true;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  String get typeName => "dynamic";
+
+  @override
   NumState add(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     return _unknownNum(rightOperand);
@@ -2867,14 +3149,6 @@
   }
 
   @override
-  BoolState isIdentical(InstanceState rightOperand) {
-    return BoolState.UNKNOWN_VALUE;
-  }
-
-  @override
-  String get typeName => "dynamic";
-
-  @override
   BoolState greaterThan(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     return BoolState.UNKNOWN_VALUE;
@@ -2893,10 +3167,9 @@
   }
 
   @override
-  bool get isBool => true;
-
-  @override
-  bool get isBoolNumStringOrNull => true;
+  BoolState isIdentical(InstanceState rightOperand) {
+    return BoolState.UNKNOWN_VALUE;
+  }
 
   @override
   BoolState lessThan(InstanceState rightOperand) {
@@ -2999,24 +3272,6 @@
  */
 class EvaluationResult {
   /**
-   * Return an evaluation result representing the result of evaluating an expression that is not a
-   * compile-time constant because of the given errors.
-   *
-   * @param errors the errors that should be reported for the expression(s) that were evaluated
-   * @return the result of evaluating an expression that is not a compile-time constant
-   */
-  static EvaluationResult forErrors(List<AnalysisError> errors) => new EvaluationResult(null, errors);
-
-  /**
-   * Return an evaluation result representing the result of evaluating an expression that is a
-   * compile-time constant that evaluates to the given value.
-   *
-   * @param value the value of the expression
-   * @return the result of evaluating an expression that is a compile-time constant
-   */
-  static EvaluationResult forValue(DartObject value) => new EvaluationResult(value, null);
-
-  /**
    * The value of the expression.
    */
   final DartObject value;
@@ -3041,7 +3296,8 @@
    * the expression is not a valid compile time constant if the errors would have been reported by
    * other parts of the analysis engine.
    */
-  List<AnalysisError> get errors => _errors == null ? AnalysisError.NO_ERRORS : _errors;
+  List<AnalysisError> get errors =>
+      _errors == null ? AnalysisError.NO_ERRORS : _errors;
 
   /**
    * Return `true` if the expression is a compile-time constant expression that would not
@@ -3050,6 +3306,26 @@
    * @return `true` if the expression is a valid compile-time constant expression
    */
   bool get isValid => _errors == null;
+
+  /**
+   * Return an evaluation result representing the result of evaluating an expression that is not a
+   * compile-time constant because of the given errors.
+   *
+   * @param errors the errors that should be reported for the expression(s) that were evaluated
+   * @return the result of evaluating an expression that is not a compile-time constant
+   */
+  static EvaluationResult forErrors(List<AnalysisError> errors) =>
+      new EvaluationResult(null, errors);
+
+  /**
+   * Return an evaluation result representing the result of evaluating an expression that is a
+   * compile-time constant that evaluates to the given value.
+   *
+   * @param value the value of the expression
+   * @return the result of evaluating an expression that is a compile-time constant
+   */
+  static EvaluationResult forValue(DartObject value) =>
+      new EvaluationResult(value, null);
 }
 
 /**
@@ -3076,6 +3352,8 @@
     this._errors = errors;
   }
 
+  List<AnalysisError> get errors => _errors;
+
   bool equalValues(TypeProvider typeProvider, EvaluationResultImpl result) {
     if (this.value != null) {
       if (result.value == null) {
@@ -3087,8 +3365,6 @@
     }
   }
 
-  List<AnalysisError> get errors => _errors;
-
   @override
   String toString() {
     if (value == null) {
@@ -3116,6 +3392,16 @@
   FunctionState(this._element);
 
   @override
+  int get hashCode => _element == null ? 0 : _element.hashCode;
+
+  @override
+  String get typeName => "Function";
+
+  @override
+  bool operator ==(Object object) =>
+      object is FunctionState && (_element == object._element);
+
+  @override
   StringState convertToString() {
     if (_element == null) {
       return StringState.UNKNOWN_VALUE;
@@ -3124,9 +3410,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is FunctionState && (_element == object._element);
-
-  @override
   BoolState equalEqual(InstanceState rightOperand) {
     return isIdentical(rightOperand);
   }
@@ -3149,12 +3432,6 @@
   }
 
   @override
-  String get typeName => "Function";
-
-  @override
-  int get hashCode => _element == null ? 0 : _element.hashCode;
-
-  @override
   String toString() => _element == null ? "-unknown-" : _element.name;
 }
 
@@ -3164,11 +3441,6 @@
  */
 class GenericState extends InstanceState {
   /**
-   * The values of the fields of this instance.
-   */
-  final HashMap<String, DartObjectImpl> _fieldMap;
-
-  /**
    * Pseudo-field that we use to represent fields in the superclass.
    */
   static String SUPERCLASS_FIELD = "(super)";
@@ -3176,7 +3448,13 @@
   /**
    * A state that can be used to represent an object whose state is not known.
    */
-  static GenericState UNKNOWN_VALUE = new GenericState(new HashMap<String, DartObjectImpl>());
+  static GenericState UNKNOWN_VALUE =
+      new GenericState(new HashMap<String, DartObjectImpl>());
+
+  /**
+   * The values of the fields of this instance.
+   */
+  final HashMap<String, DartObjectImpl> _fieldMap;
 
   /**
    * Initialize a newly created state to represent a newly created object.
@@ -3186,6 +3464,46 @@
   GenericState(this._fieldMap);
 
   @override
+  HashMap<String, DartObjectImpl> get fields => _fieldMap;
+
+  @override
+  int get hashCode {
+    int hashCode = 0;
+    for (DartObjectImpl value in _fieldMap.values) {
+      hashCode += value.hashCode;
+    }
+    return hashCode;
+  }
+
+  @override
+  bool get isUnknown => identical(this, UNKNOWN_VALUE);
+
+  @override
+  String get typeName => "user defined type";
+
+  @override
+  bool operator ==(Object object) {
+    if (object is! GenericState) {
+      return false;
+    }
+    GenericState state = object as GenericState;
+    HashSet<String> otherFields =
+        new HashSet<String>.from(state._fieldMap.keys.toSet());
+    for (String fieldName in _fieldMap.keys.toSet()) {
+      if (_fieldMap[fieldName] != state._fieldMap[fieldName]) {
+        return false;
+      }
+      otherFields.remove(fieldName);
+    }
+    for (String fieldName in otherFields) {
+      if (state._fieldMap[fieldName] != _fieldMap[fieldName]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @override
   StringState convertToString() => StringState.UNKNOWN_VALUE;
 
   @override
@@ -3201,45 +3519,6 @@
     }
     return BoolState.from(this == rightOperand);
   }
-
-  @override
-  bool operator ==(Object object) {
-    if (object is! GenericState) {
-      return false;
-    }
-    GenericState state = object as GenericState;
-    HashSet<String> otherFields = new HashSet<String>.from(state._fieldMap.keys.toSet());
-    for (String fieldName in _fieldMap.keys.toSet()) {
-      if (_fieldMap[fieldName] != state._fieldMap[fieldName]) {
-        return false;
-      }
-      otherFields.remove(fieldName);
-    }
-    for (String fieldName in otherFields) {
-      if (state._fieldMap[fieldName] != _fieldMap[fieldName]) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  @override
-  HashMap<String, DartObjectImpl> get fields => _fieldMap;
-
-  @override
-  String get typeName => "user defined type";
-
-  @override
-  int get hashCode {
-    int hashCode = 0;
-    for (DartObjectImpl value in _fieldMap.values) {
-      hashCode += value.hashCode;
-    }
-    return hashCode;
-  }
-
-  @override
-  bool get isUnknown => identical(this, UNKNOWN_VALUE);
 }
 
 /**
@@ -3248,6 +3527,55 @@
  */
 abstract class InstanceState {
   /**
+   * If this represents a generic dart object, return a map from its fieldnames to their values.
+   * Otherwise return null.
+   */
+  HashMap<String, DartObjectImpl> get fields => null;
+
+  /**
+   * Return `true` if this object's value can be represented exactly.
+   *
+   * @return `true` if this object's value can be represented exactly
+   */
+  bool get hasExactValue => false;
+
+  /**
+   * Return `true` if this object represents an object whose type is 'bool'.
+   *
+   * @return `true` if this object represents a boolean value
+   */
+  bool get isBool => false;
+
+  /**
+   * Return `true` if this object represents an object whose type is either 'bool', 'num',
+   * 'String', or 'Null'.
+   *
+   * @return `true` if this object represents either a boolean, numeric, string or null value
+   */
+  bool get isBoolNumStringOrNull => false;
+
+  /**
+   * Return true if this object represents an unknown value.
+   */
+  bool get isUnknown => false;
+
+  /**
+   * Return the name of the type of this value.
+   *
+   * @return the name of the type of this value
+   */
+  String get typeName;
+
+  /**
+   * Return this object's value if it can be represented exactly, or `null` if either the
+   * value cannot be represented exactly or if the value is `null`. Clients should use
+   * [hasExactValue] to distinguish between these two cases.
+   *
+   * @return this object's value
+   */
+  Object get value => null;
+
+  /**
    * Return the result of invoking the '+' operator on this object with the given argument.
    *
    * @param rightOperand the right-hand operand of the operation
@@ -3255,16 +3583,95 @@
    * @throws EvaluationException if the operator is not appropriate for an object of this kind
    */
   InstanceState add(InstanceState rightOperand) {
-    // TODO(brianwilkerson) Uncomment the code below when the new constant support can be added.
-    //    if (this instanceof StringState || rightOperand instanceof StringState) {
-    //      return concatenate(rightOperand);
-    //    }
+    // TODO(brianwilkerson) Uncomment the code below when the new constant
+    // support can be added.
+//    if (this instanceof StringState || rightOperand instanceof StringState) {
+//      return concatenate(rightOperand);
+//    }
     assertNumOrNull(this);
     assertNumOrNull(rightOperand);
     throw new EvaluationException(CompileTimeErrorCode.INVALID_CONSTANT);
   }
 
   /**
+   * Throw an exception if the given state does not represent a boolean value.
+   *
+   * @param state the state being tested
+   * @throws EvaluationException if the given state does not represent a boolean value
+   */
+  void assertBool(InstanceState state) {
+    if (!(state is BoolState || state is DynamicState)) {
+      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
+    }
+  }
+
+  /**
+   * Throw an exception if the given state does not represent a boolean, numeric, string or null
+   * value.
+   *
+   * @param state the state being tested
+   * @throws EvaluationException if the given state does not represent a boolean, numeric, string or
+   *           null value
+   */
+  void assertBoolNumStringOrNull(InstanceState state) {
+    if (!(state is BoolState ||
+        state is DoubleState ||
+        state is IntState ||
+        state is NumState ||
+        state is StringState ||
+        state is NullState ||
+        state is DynamicState)) {
+      throw new EvaluationException(
+          CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
+    }
+  }
+
+  /**
+   * Throw an exception if the given state does not represent an integer or null value.
+   *
+   * @param state the state being tested
+   * @throws EvaluationException if the given state does not represent an integer or null value
+   */
+  void assertIntOrNull(InstanceState state) {
+    if (!(state is IntState ||
+        state is NumState ||
+        state is NullState ||
+        state is DynamicState)) {
+      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
+    }
+  }
+
+  /**
+   * Throw an exception if the given state does not represent a boolean, numeric, string or null
+   * value.
+   *
+   * @param state the state being tested
+   * @throws EvaluationException if the given state does not represent a boolean, numeric, string or
+   *           null value
+   */
+  void assertNumOrNull(InstanceState state) {
+    if (!(state is DoubleState ||
+        state is IntState ||
+        state is NumState ||
+        state is NullState ||
+        state is DynamicState)) {
+      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
+    }
+  }
+
+  /**
+   * Throw an exception if the given state does not represent a String value.
+   *
+   * @param state the state being tested
+   * @throws EvaluationException if the given state does not represent a String value
+   */
+  void assertString(InstanceState state) {
+    if (!(state is StringState || state is DynamicState)) {
+      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
+    }
+  }
+
+  /**
    * Return the result of invoking the '&' operator on this object with the given argument.
    *
    * @param rightOperand the right-hand operand of the operation
@@ -3366,28 +3773,6 @@
   BoolState equalEqual(InstanceState rightOperand);
 
   /**
-   * If this represents a generic dart object, return a map from its fieldnames to their values.
-   * Otherwise return null.
-   */
-  HashMap<String, DartObjectImpl> get fields => null;
-
-  /**
-   * Return the name of the type of this value.
-   *
-   * @return the name of the type of this value
-   */
-  String get typeName;
-
-  /**
-   * Return this object's value if it can be represented exactly, or `null` if either the
-   * value cannot be represented exactly or if the value is `null`. Clients should use
-   * [hasExactValue] to distinguish between these two cases.
-   *
-   * @return this object's value
-   */
-  Object get value => null;
-
-  /**
    * Return the result of invoking the '&gt;' operator on this object with the given argument.
    *
    * @param rightOperand the right-hand operand of the operation
@@ -3414,13 +3799,6 @@
   }
 
   /**
-   * Return `true` if this object's value can be represented exactly.
-   *
-   * @return `true` if this object's value can be represented exactly
-   */
-  bool get hasExactValue => false;
-
-  /**
    * Return the result of invoking the '~/' operator on this object with the given argument.
    *
    * @param rightOperand the right-hand operand of the operation
@@ -3444,26 +3822,6 @@
   BoolState isIdentical(InstanceState rightOperand);
 
   /**
-   * Return `true` if this object represents an object whose type is 'bool'.
-   *
-   * @return `true` if this object represents a boolean value
-   */
-  bool get isBool => false;
-
-  /**
-   * Return `true` if this object represents an object whose type is either 'bool', 'num',
-   * 'String', or 'Null'.
-   *
-   * @return `true` if this object represents either a boolean, numeric, string or null value
-   */
-  bool get isBoolNumStringOrNull => false;
-
-  /**
-   * Return true if this object represents an unknown value.
-   */
-  bool get isUnknown => false;
-
-  /**
    * Return the result of invoking the '&lt;' operator on this object with the given argument.
    *
    * @param rightOperand the right-hand operand of the operation
@@ -3612,70 +3970,6 @@
     assertNumOrNull(rightOperand);
     throw new EvaluationException(CompileTimeErrorCode.INVALID_CONSTANT);
   }
-
-  /**
-   * Throw an exception if the given state does not represent a boolean value.
-   *
-   * @param state the state being tested
-   * @throws EvaluationException if the given state does not represent a boolean value
-   */
-  void assertBool(InstanceState state) {
-    if (!(state is BoolState || state is DynamicState)) {
-      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
-    }
-  }
-
-  /**
-   * Throw an exception if the given state does not represent a boolean, numeric, string or null
-   * value.
-   *
-   * @param state the state being tested
-   * @throws EvaluationException if the given state does not represent a boolean, numeric, string or
-   *           null value
-   */
-  void assertBoolNumStringOrNull(InstanceState state) {
-    if (!(state is BoolState || state is DoubleState || state is IntState || state is NumState || state is StringState || state is NullState || state is DynamicState)) {
-      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
-    }
-  }
-
-  /**
-   * Throw an exception if the given state does not represent an integer or null value.
-   *
-   * @param state the state being tested
-   * @throws EvaluationException if the given state does not represent an integer or null value
-   */
-  void assertIntOrNull(InstanceState state) {
-    if (!(state is IntState || state is NumState || state is NullState || state is DynamicState)) {
-      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
-    }
-  }
-
-  /**
-   * Throw an exception if the given state does not represent a boolean, numeric, string or null
-   * value.
-   *
-   * @param state the state being tested
-   * @throws EvaluationException if the given state does not represent a boolean, numeric, string or
-   *           null value
-   */
-  void assertNumOrNull(InstanceState state) {
-    if (!(state is DoubleState || state is IntState || state is NumState || state is NullState || state is DynamicState)) {
-      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
-    }
-  }
-
-  /**
-   * Throw an exception if the given state does not represent a String value.
-   *
-   * @param state the state being tested
-   * @throws EvaluationException if the given state does not represent a String value
-   */
-  void assertString(InstanceState state) {
-    if (!(state is StringState || state is DynamicState)) {
-      throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
-    }
-  }
 }
 
 /**
@@ -3683,16 +3977,16 @@
  */
 class IntState extends NumState {
   /**
-   * The value of this instance.
-   */
-  final int value;
-
-  /**
    * A state that can be used to represent an int whose value is not known.
    */
   static IntState UNKNOWN_VALUE = new IntState(null);
 
   /**
+   * The value of this instance.
+   */
+  final int value;
+
+  /**
    * Initialize a newly created state to represent an int with the given value.
    *
    * @param value the value of this instance
@@ -3700,6 +3994,25 @@
   IntState(this.value);
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => value == null ? 0 : value.hashCode;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  bool get isUnknown => value == null;
+
+  @override
+  String get typeName => "int";
+
+  @override
+  bool operator ==(Object object) =>
+      object is IntState && (value == object.value);
+
+  @override
   NumState add(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     if (value == null) {
@@ -3723,7 +4036,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3741,7 +4055,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3767,7 +4082,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3785,7 +4101,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3822,7 +4139,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3832,6 +4150,85 @@
   }
 
   @override
+  BoolState greaterThan(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value.compareTo(rightValue) > 0);
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value.toDouble() > rightValue);
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
+  BoolState greaterThanOrEqual(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value.compareTo(rightValue) >= 0);
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return BoolState.UNKNOWN_VALUE;
+      }
+      return BoolState.from(value.toDouble() >= rightValue);
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return BoolState.UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
+  IntState integerDivide(InstanceState rightOperand) {
+    assertNumOrNull(rightOperand);
+    if (value == null) {
+      return UNKNOWN_VALUE;
+    }
+    if (rightOperand is IntState) {
+      int rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return UNKNOWN_VALUE;
+      } else if (rightValue == 0) {
+        throw new EvaluationException(
+            CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE);
+      }
+      return new IntState(value ~/ rightValue);
+    } else if (rightOperand is DoubleState) {
+      double rightValue = rightOperand.value;
+      if (rightValue == null) {
+        return UNKNOWN_VALUE;
+      }
+      double result = value.toDouble() / rightValue;
+      return new IntState(result.toInt());
+    } else if (rightOperand is DynamicState || rightOperand is NumState) {
+      return UNKNOWN_VALUE;
+    }
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+  }
+
+  @override
   BoolState isIdentical(InstanceState rightOperand) {
     if (value == null) {
       return BoolState.UNKNOWN_VALUE;
@@ -3855,99 +4252,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is IntState && (value == object.value);
-
-  @override
-  String get typeName => "int";
-
-  @override
-  BoolState greaterThan(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value.compareTo(rightValue) > 0);
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value.toDouble() > rightValue);
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  BoolState greaterThanOrEqual(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value.compareTo(rightValue) >= 0);
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return BoolState.UNKNOWN_VALUE;
-      }
-      return BoolState.from(value.toDouble() >= rightValue);
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => value == null ? 0 : value.hashCode;
-
-  @override
-  IntState integerDivide(InstanceState rightOperand) {
-    assertNumOrNull(rightOperand);
-    if (value == null) {
-      return UNKNOWN_VALUE;
-    }
-    if (rightOperand is IntState) {
-      int rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return UNKNOWN_VALUE;
-      } else if (rightValue == 0) {
-        throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE);
-      }
-      return new IntState(value ~/ rightValue);
-    } else if (rightOperand is DoubleState) {
-      double rightValue = rightOperand.value;
-      if (rightValue == null) {
-        return UNKNOWN_VALUE;
-      }
-      double result = value.toDouble() / rightValue;
-      return new IntState(result.toInt());
-    } else if (rightOperand is DynamicState || rightOperand is NumState) {
-      return UNKNOWN_VALUE;
-    }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
-  }
-
-  @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
-  bool get isUnknown => value == null;
-
-  @override
   BoolState lessThan(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     if (value == null) {
@@ -3968,7 +4272,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return BoolState.UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -3992,7 +4297,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return BoolState.UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4019,7 +4325,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4056,7 +4363,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4076,7 +4384,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4096,7 +4405,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4123,7 +4433,8 @@
     } else if (rightOperand is DynamicState || rightOperand is NumState) {
       return UNKNOWN_VALUE;
     }
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4148,20 +4459,41 @@
   ListState(this._elements);
 
   @override
-  StringState convertToString() => StringState.UNKNOWN_VALUE;
-
-  @override
-  BoolState equalEqual(InstanceState rightOperand) {
-    assertBoolNumStringOrNull(rightOperand);
-    return isIdentical(rightOperand);
+  bool get hasExactValue {
+    int count = _elements.length;
+    for (int i = 0; i < count; i++) {
+      if (!_elements[i].hasExactValue) {
+        return false;
+      }
+    }
+    return true;
   }
 
   @override
-  BoolState isIdentical(InstanceState rightOperand) {
-    if (rightOperand is DynamicState) {
-      return BoolState.UNKNOWN_VALUE;
+  int get hashCode {
+    int value = 0;
+    int count = _elements.length;
+    for (int i = 0; i < count; i++) {
+      value = (value << 3) ^ _elements[i].hashCode;
     }
-    return BoolState.from(this == rightOperand);
+    return value;
+  }
+
+  @override
+  String get typeName => "List";
+
+  @override
+  List<Object> get value {
+    int count = _elements.length;
+    List<Object> result = new List<Object>(count);
+    for (int i = 0; i < count; i++) {
+      DartObjectImpl element = _elements[i];
+      if (!element.hasExactValue) {
+        return null;
+      }
+      result[i] = element.value;
+    }
+    return result;
   }
 
   @override
@@ -4185,41 +4517,20 @@
   }
 
   @override
-  String get typeName => "List";
+  StringState convertToString() => StringState.UNKNOWN_VALUE;
 
   @override
-  List<Object> get value {
-    int count = _elements.length;
-    List<Object> result = new List<Object>(count);
-    for (int i = 0; i < count; i++) {
-      DartObjectImpl element = _elements[i];
-      if (!element.hasExactValue) {
-        return null;
-      }
-      result[i] = element.value;
-    }
-    return result;
+  BoolState equalEqual(InstanceState rightOperand) {
+    assertBoolNumStringOrNull(rightOperand);
+    return isIdentical(rightOperand);
   }
 
   @override
-  bool get hasExactValue {
-    int count = _elements.length;
-    for (int i = 0; i < count; i++) {
-      if (!_elements[i].hasExactValue) {
-        return false;
-      }
+  BoolState isIdentical(InstanceState rightOperand) {
+    if (rightOperand is DynamicState) {
+      return BoolState.UNKNOWN_VALUE;
     }
-    return true;
-  }
-
-  @override
-  int get hashCode {
-    int value = 0;
-    int count = _elements.length;
-    for (int i = 0; i < count; i++) {
-      value = (value << 3) ^ _elements[i].hashCode;
-    }
-    return value;
+    return BoolState.from(this == rightOperand);
   }
 }
 
@@ -4241,38 +4552,9 @@
   MapState(this._entries);
 
   @override
-  StringState convertToString() => StringState.UNKNOWN_VALUE;
-
-  @override
-  BoolState equalEqual(InstanceState rightOperand) {
-    assertBoolNumStringOrNull(rightOperand);
-    return isIdentical(rightOperand);
-  }
-
-  @override
-  BoolState isIdentical(InstanceState rightOperand) {
-    if (rightOperand is DynamicState) {
-      return BoolState.UNKNOWN_VALUE;
-    }
-    return BoolState.from(this == rightOperand);
-  }
-
-  @override
-  bool operator ==(Object object) {
-    if (object is! MapState) {
-      return false;
-    }
-    HashMap<DartObjectImpl, DartObjectImpl> otherElements = (object as MapState)._entries;
-    int count = _entries.length;
-    if (otherElements.length != count) {
-      return false;
-    } else if (count == 0) {
-      return true;
-    }
+  bool get hasExactValue {
     for (DartObjectImpl key in _entries.keys) {
-      DartObjectImpl value = _entries[key];
-      DartObjectImpl otherValue = otherElements[key];
-      if (value != otherValue) {
+      if (!key.hasExactValue || !_entries[key].hasExactValue) {
         return false;
       }
     }
@@ -4280,6 +4562,15 @@
   }
 
   @override
+  int get hashCode {
+    int value = 0;
+    for (DartObjectImpl key in _entries.keys.toSet()) {
+      value = (value << 3) ^ key.hashCode;
+    }
+    return value;
+  }
+
+  @override
   String get typeName => "Map";
 
   @override
@@ -4296,9 +4587,22 @@
   }
 
   @override
-  bool get hasExactValue {
+  bool operator ==(Object object) {
+    if (object is! MapState) {
+      return false;
+    }
+    HashMap<DartObjectImpl, DartObjectImpl> otherElements =
+        (object as MapState)._entries;
+    int count = _entries.length;
+    if (otherElements.length != count) {
+      return false;
+    } else if (count == 0) {
+      return true;
+    }
     for (DartObjectImpl key in _entries.keys) {
-      if (!key.hasExactValue || !_entries[key].hasExactValue) {
+      DartObjectImpl value = _entries[key];
+      DartObjectImpl otherValue = otherElements[key];
+      if (value != otherValue) {
         return false;
       }
     }
@@ -4306,12 +4610,20 @@
   }
 
   @override
-  int get hashCode {
-    int value = 0;
-    for (DartObjectImpl key in _entries.keys.toSet()) {
-      value = (value << 3) ^ key.hashCode;
+  StringState convertToString() => StringState.UNKNOWN_VALUE;
+
+  @override
+  BoolState equalEqual(InstanceState rightOperand) {
+    assertBoolNumStringOrNull(rightOperand);
+    return isIdentical(rightOperand);
+  }
+
+  @override
+  BoolState isIdentical(InstanceState rightOperand) {
+    if (rightOperand is DynamicState) {
+      return BoolState.UNKNOWN_VALUE;
     }
-    return value;
+    return BoolState.from(this == rightOperand);
   }
 }
 
@@ -4325,8 +4637,24 @@
   static NullState NULL_STATE = new NullState();
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => 0;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  String get typeName => "Null";
+
+  @override
+  bool operator ==(Object object) => object is NullState;
+
+  @override
   BoolState convertToBool() {
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4347,23 +4675,9 @@
   }
 
   @override
-  bool operator ==(Object object) => object is NullState;
-
-  @override
-  String get typeName => "Null";
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => 0;
-
-  @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
   BoolState logicalNot() {
-    throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
+    throw new EvaluationException(
+        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
   }
 
   @override
@@ -4381,6 +4695,21 @@
   static NumState UNKNOWN_VALUE = new NumState();
 
   @override
+  int get hashCode => 7;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  bool get isUnknown => identical(this, UNKNOWN_VALUE);
+
+  @override
+  String get typeName => "num";
+
+  @override
+  bool operator ==(Object object) => object is NumState;
+
+  @override
   NumState add(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     return UNKNOWN_VALUE;
@@ -4402,17 +4731,6 @@
   }
 
   @override
-  BoolState isIdentical(InstanceState rightOperand) {
-    return BoolState.UNKNOWN_VALUE;
-  }
-
-  @override
-  bool operator ==(Object object) => object is NumState;
-
-  @override
-  String get typeName => "num";
-
-  @override
   BoolState greaterThan(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     return BoolState.UNKNOWN_VALUE;
@@ -4425,9 +4743,6 @@
   }
 
   @override
-  int get hashCode => 7;
-
-  @override
   IntState integerDivide(InstanceState rightOperand) {
     assertNumOrNull(rightOperand);
     if (rightOperand is IntState) {
@@ -4435,7 +4750,8 @@
       if (rightValue == null) {
         return IntState.UNKNOWN_VALUE;
       } else if (rightValue == 0) {
-        throw new EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE);
+        throw new EvaluationException(
+            CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE);
       }
     } else if (rightOperand is DynamicState) {
       return IntState.UNKNOWN_VALUE;
@@ -4444,10 +4760,9 @@
   }
 
   @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
-  bool get isUnknown => identical(this, UNKNOWN_VALUE);
+  BoolState isIdentical(InstanceState rightOperand) {
+    return BoolState.UNKNOWN_VALUE;
+  }
 
   @override
   BoolState lessThan(InstanceState rightOperand) {
@@ -4510,7 +4825,8 @@
   /**
    * A table mapping constant constructors to the declarations of those constructors.
    */
-  final HashMap<ConstructorElement, ConstructorDeclaration> _constructorDeclarationMap;
+  final HashMap<ConstructorElement, ConstructorDeclaration>
+      _constructorDeclarationMap;
 
   /**
    * Initialize a newly created reference finder to find references from the given variable to other
@@ -4524,7 +4840,8 @@
    * @param constructorDeclarationMap A table mapping constant constructors to the declarations of
    *          those constructors.
    */
-  ReferenceFinder(this._source, this._referenceGraph, this._variableDeclarationMap, this._constructorDeclarationMap);
+  ReferenceFinder(this._source, this._referenceGraph,
+      this._variableDeclarationMap, this._constructorDeclarationMap);
 
   @override
   Object visitInstanceCreationExpression(InstanceCreationExpression node) {
@@ -4535,6 +4852,21 @@
   }
 
   @override
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    super.visitRedirectingConstructorInvocation(node);
+    ConstructorElement target = node.staticElement;
+    if (target != null && target.isConst) {
+      ConstructorDeclaration targetDeclaration =
+          _constructorDeclarationMap[target];
+      if (targetDeclaration != null) {
+        _referenceGraph.addEdge(_source, targetDeclaration);
+      }
+    }
+    return null;
+  }
+
+  @override
   Object visitSimpleIdentifier(SimpleIdentifier node) {
     Element element = node.staticElement;
     if (element is PropertyAccessorElement) {
@@ -4543,11 +4875,13 @@
     if (element is VariableElement) {
       VariableElement variable = element as VariableElement;
       if (variable.isConst) {
-        VariableDeclaration variableDeclaration = _variableDeclarationMap[variable];
-        // The declaration will be null when the variable is not defined in the compilation units
-        // that were used to produce the variableDeclarationMap.  In such cases, the variable should
-        // already have a value associated with it, but we don't bother to check because there's
-        // nothing we can do about it at this point.
+        VariableDeclaration variableDeclaration =
+            _variableDeclarationMap[variable];
+        // The declaration will be null when the variable is not defined in the
+        // compilation units that were used to produce the
+        // variableDeclarationMap.  In such cases, the variable should already
+        // have a value associated with it, but we don't bother to check because
+        // there's nothing we can do about it at this point.
         if (variableDeclaration != null) {
           _referenceGraph.addEdge(_source, variableDeclaration);
         }
@@ -4561,10 +4895,12 @@
     super.visitSuperConstructorInvocation(node);
     ConstructorElement constructor = node.staticElement;
     if (constructor != null && constructor.isConst) {
-      ConstructorDeclaration constructorDeclaration = _constructorDeclarationMap[constructor];
-      // The declaration will be null when the constructor is not defined in the compilation
-      // units that were used to produce the constructorDeclarationMap.  In such cases, the
-      // constructor should already have its initializer AST's stored in it, but we don't bother
+      ConstructorDeclaration constructorDeclaration =
+          _constructorDeclarationMap[constructor];
+      // The declaration will be null when the constructor is not defined in the
+      // compilation units that were used to produce the
+      // constructorDeclarationMap.  In such cases, the constructor should
+      // already have its initializer AST's stored in it, but we don't bother
       // to check because there's nothing we can do about it at this point.
       if (constructorDeclaration != null) {
         _referenceGraph.addEdge(_source, constructorDeclaration);
@@ -4572,19 +4908,6 @@
     }
     return null;
   }
-
-  @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    super.visitRedirectingConstructorInvocation(node);
-    ConstructorElement target = node.staticElement;
-    if (target != null && target.isConst) {
-      ConstructorDeclaration targetDeclaration = _constructorDeclarationMap[target];
-      if (targetDeclaration != null) {
-        _referenceGraph.addEdge(_source, targetDeclaration);
-      }
-    }
-    return null;
-  }
 }
 
 /**
@@ -4593,16 +4916,16 @@
  */
 class StringState extends InstanceState {
   /**
-   * The value of this instance.
-   */
-  final String value;
-
-  /**
    * A state that can be used to represent a double whose value is not known.
    */
   static StringState UNKNOWN_VALUE = new StringState(null);
 
   /**
+   * The value of this instance.
+   */
+  final String value;
+
+  /**
    * Initialize a newly created state to represent the given value.
    *
    * @param value the value of this instance
@@ -4610,6 +4933,25 @@
   StringState(this.value);
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => value == null ? 0 : value.hashCode;
+
+  @override
+  bool get isBoolNumStringOrNull => true;
+
+  @override
+  bool get isUnknown => value == null;
+
+  @override
+  String get typeName => "String";
+
+  @override
+  bool operator ==(Object object) =>
+      object is StringState && (value == object.value);
+
+  @override
   StringState concatenate(InstanceState rightOperand) {
     if (value == null) {
       return UNKNOWN_VALUE;
@@ -4653,24 +4995,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is StringState && (value == object.value);
-
-  @override
-  String get typeName => "String";
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => value == null ? 0 : value.hashCode;
-
-  @override
-  bool get isBoolNumStringOrNull => true;
-
-  @override
-  bool get isUnknown => value == null;
-
-  @override
   IntState stringLength() {
     if (value == null) {
       return IntState.UNKNOWN_VALUE;
@@ -4700,6 +5024,19 @@
   SymbolState(this.value);
 
   @override
+  bool get hasExactValue => true;
+
+  @override
+  int get hashCode => value == null ? 0 : value.hashCode;
+
+  @override
+  String get typeName => "Symbol";
+
+  @override
+  bool operator ==(Object object) =>
+      object is SymbolState && (value == object.value);
+
+  @override
   StringState convertToString() {
     if (value == null) {
       return StringState.UNKNOWN_VALUE;
@@ -4731,18 +5068,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is SymbolState && (value == object.value);
-
-  @override
-  String get typeName => "Symbol";
-
-  @override
-  bool get hasExactValue => true;
-
-  @override
-  int get hashCode => value == null ? 0 : value.hashCode;
-
-  @override
   String toString() => value == null ? "-unknown-" : "#$value";
 }
 
@@ -4763,6 +5088,16 @@
   TypeState(this._element);
 
   @override
+  int get hashCode => _element == null ? 0 : _element.hashCode;
+
+  @override
+  String get typeName => "Type";
+
+  @override
+  bool operator ==(Object object) =>
+      object is TypeState && (_element == object._element);
+
+  @override
   StringState convertToString() {
     if (_element == null) {
       return StringState.UNKNOWN_VALUE;
@@ -4771,9 +5106,6 @@
   }
 
   @override
-  bool operator ==(Object object) => object is TypeState && (_element == object._element);
-
-  @override
   BoolState equalEqual(InstanceState rightOperand) {
     assertBoolNumStringOrNull(rightOperand);
     return isIdentical(rightOperand);
@@ -4797,11 +5129,5 @@
   }
 
   @override
-  String get typeName => "Type";
-
-  @override
-  int get hashCode => _element == null ? 0 : _element.hashCode;
-
-  @override
   String toString() => _element == null ? "-unknown-" : _element.name;
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 755b8c6..e3342b7 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -8,17 +8,18 @@
 library engine.element;
 
 import 'dart:collection';
+
+import 'ast.dart';
+import 'constant.dart' show EvaluationResultImpl;
+import 'engine.dart' show AnalysisContext, AnalysisEngine, AnalysisException;
+import 'html.dart' show XmlAttributeNode, XmlTagNode;
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'utilities_collection.dart';
-import 'source.dart';
-import 'scanner.dart' show Keyword;
-import 'ast.dart';
-import 'sdk.dart' show DartSdk;
-import 'html.dart' show XmlAttributeNode, XmlTagNode;
-import 'engine.dart' show AnalysisContext, AnalysisEngine, AnalysisException;
-import 'constant.dart' show EvaluationResultImpl;
 import 'resolver.dart';
+import 'scanner.dart' show Keyword;
+import 'sdk.dart' show DartSdk;
+import 'source.dart';
+import 'utilities_collection.dart';
 import 'utilities_dart.dart';
 
 /**
@@ -33,19 +34,22 @@
 
   final List<Source> elementSources;
 
-  AngularApplication(this.entryPoint, this._librarySources, this.elements, this.elementSources);
+  AngularApplication(this.entryPoint, this._librarySources, this.elements,
+      this.elementSources);
 
   /**
    * Checks if this application depends on the library with the given [Source].
    */
-  bool dependsOn(Source librarySource) => _librarySources.contains(librarySource);
+  bool dependsOn(Source librarySource) =>
+      _librarySources.contains(librarySource);
 }
 
 /**
  * The interface `AngularControllerElement` defines the Angular component described by
  * <code>Component</code> annotation.
  */
-abstract class AngularComponentElement implements AngularHasSelectorElement, AngularHasTemplateElement {
+abstract class AngularComponentElement implements AngularHasSelectorElement,
+    AngularHasTemplateElement {
   /**
    * Return an array containing all of the properties declared by this component.
    */
@@ -73,7 +77,8 @@
 /**
  * Implementation of `AngularComponentElement`.
  */
-class AngularComponentElementImpl extends AngularHasSelectorElementImpl implements AngularComponentElement {
+class AngularComponentElementImpl extends AngularHasSelectorElementImpl
+    implements AngularComponentElement {
   /**
    * The offset of the defining <code>Component</code> annotation.
    */
@@ -87,7 +92,8 @@
   /**
    * The array containing all of the scope properties set by this component.
    */
-  List<AngularScopePropertyElement> _scopeProperties = AngularScopePropertyElement.EMPTY_ARRAY;
+  List<AngularScopePropertyElement> _scopeProperties =
+      AngularScopePropertyElement.EMPTY_ARRAY;
 
   /**
    * The the CSS file URI.
@@ -121,10 +127,12 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularComponentElementImpl(String name, int nameOffset, this._annotationOffset) : super(name, nameOffset);
+  AngularComponentElementImpl(String name, int nameOffset,
+      this._annotationOffset)
+      : super(name, nameOffset);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this);
+  String get identifier => "AngularComponent@$_annotationOffset";
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_COMPONENT;
@@ -132,9 +140,6 @@
   @override
   List<AngularPropertyElement> get properties => _properties;
 
-  @override
-  List<AngularScopePropertyElement> get scopeProperties => _scopeProperties;
-
   /**
    * Set an array containing all of the properties declared by this component.
    *
@@ -147,6 +152,9 @@
     this._properties = properties;
   }
 
+  @override
+  List<AngularScopePropertyElement> get scopeProperties => _scopeProperties;
+
   /**
    * Set an array containing all of the scope properties declared by this component.
    *
@@ -160,14 +168,14 @@
   }
 
   @override
+  accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this);
+
+  @override
   void visitChildren(ElementVisitor visitor) {
     safelyVisitChildren(_properties, visitor);
     safelyVisitChildren(_scopeProperties, visitor);
     super.visitChildren(visitor);
   }
-
-  @override
-  String get identifier => "AngularComponent@$_annotationOffset";
 }
 
 /**
@@ -180,7 +188,8 @@
 /**
  * Implementation of `AngularControllerElement`.
  */
-class AngularControllerElementImpl extends AngularHasSelectorElementImpl implements AngularControllerElement {
+class AngularControllerElementImpl extends AngularHasSelectorElementImpl
+    implements AngularControllerElement {
   /**
    * Initialize a newly created Angular controller to have the given name.
    *
@@ -188,13 +197,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularControllerElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitAngularControllerElement(this);
+  AngularControllerElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_CONTROLLER;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitAngularControllerElement(this);
 }
 
 /**
@@ -216,7 +226,8 @@
 /**
  * Implementation of `AngularDirectiveElement`.
  */
-class AngularDecoratorElementImpl extends AngularHasSelectorElementImpl implements AngularDecoratorElement {
+class AngularDecoratorElementImpl extends AngularHasSelectorElementImpl
+    implements AngularDecoratorElement {
   /**
    * The offset of the annotation that defines this directive.
    */
@@ -235,10 +246,10 @@
   AngularDecoratorElementImpl(this._offset) : super(null, -1);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this);
+  String get displayName => selector.displayName;
 
   @override
-  String get displayName => selector.displayName;
+  String get identifier => "Decorator@$_offset";
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE;
@@ -246,12 +257,6 @@
   @override
   List<AngularPropertyElement> get properties => _properties;
 
-  @override
-  bool isClass(String name) {
-    Element enclosing = enclosingElement;
-    return enclosing is ClassElement && enclosing.name == name;
-  }
-
   /**
    * Set an array containing all of the properties declared by this directive.
    *
@@ -265,13 +270,19 @@
   }
 
   @override
+  accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this);
+
+  @override
+  bool isClass(String name) {
+    Element enclosing = enclosingElement;
+    return enclosing is ClassElement && enclosing.name == name;
+  }
+
+  @override
   void visitChildren(ElementVisitor visitor) {
     safelyVisitChildren(_properties, visitor);
     super.visitChildren(visitor);
   }
-
-  @override
-  String get identifier => "Decorator@$_offset";
 }
 
 /**
@@ -280,9 +291,9 @@
  */
 abstract class AngularElement implements ToolkitObjectElement {
   /**
-   * An empty array of Angular elements.
+   * An empty list of Angular elements.
    */
-  static final List<AngularElement> EMPTY_ARRAY = new List<AngularElement>(0);
+  static const List<AngularElement> EMPTY_ARRAY = const <AngularElement>[];
 
   /**
    * Returns the [AngularApplication] this element is used in.
@@ -295,7 +306,8 @@
 /**
  * Implementation of `AngularElement`.
  */
-abstract class AngularElementImpl extends ToolkitObjectElementImpl implements AngularElement {
+abstract class AngularElementImpl extends ToolkitObjectElementImpl implements
+    AngularElement {
   /**
    * The [AngularApplication] this element is used in.
    */
@@ -331,7 +343,8 @@
 /**
  * Implementation of `AngularFormatterElement`.
  */
-class AngularFormatterElementImpl extends AngularElementImpl implements AngularFormatterElement {
+class AngularFormatterElementImpl extends AngularElementImpl implements
+    AngularFormatterElement {
   /**
    * Initialize a newly created Angular formatter to have the given name.
    *
@@ -339,32 +352,43 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularFormatterElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitAngularFormatterElement(this);
+  AngularFormatterElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_FORMATTER;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitAngularFormatterElement(this);
 }
 
 /**
  * [AngularSelectorElement] based on presence of attribute.
  */
-abstract class AngularHasAttributeSelectorElement implements AngularSelectorElement {
+abstract class AngularHasAttributeSelectorElement implements
+    AngularSelectorElement {
 }
 
 /**
  * [AngularSelectorElement] based on presence of a class.
  */
-abstract class AngularHasClassSelectorElement implements AngularSelectorElement {
+abstract class AngularHasClassSelectorElement implements AngularSelectorElement
+    {
 }
 
 /**
  * Implementation of [AngularSelectorElement] based on presence of a class.
  */
-class AngularHasClassSelectorElementImpl extends AngularSelectorElementImpl implements AngularHasClassSelectorElement {
-  AngularHasClassSelectorElementImpl(String name, int offset) : super(name, offset);
+class AngularHasClassSelectorElementImpl extends AngularSelectorElementImpl
+    implements AngularHasClassSelectorElement {
+  AngularHasClassSelectorElementImpl(String name, int offset)
+      : super(name, offset);
+
+  @override
+  void appendTo(StringBuffer buffer) {
+    buffer.write(".");
+    buffer.write(name);
+  }
 
   @override
   bool apply(XmlTagNode node) {
@@ -382,12 +406,6 @@
     }
     return false;
   }
-
-  @override
-  void appendTo(StringBuffer buffer) {
-    buffer.write(".");
-    buffer.write(name);
-  }
 }
 
 /**
@@ -406,7 +424,8 @@
 /**
  * Implementation of `AngularSelectorElement`.
  */
-abstract class AngularHasSelectorElementImpl extends AngularElementImpl implements AngularHasSelectorElement {
+abstract class AngularHasSelectorElementImpl extends AngularElementImpl
+    implements AngularHasSelectorElement {
   /**
    * The selector of this element.
    */
@@ -419,7 +438,8 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularHasSelectorElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  AngularHasSelectorElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   AngularSelectorElement get selector => _selector;
@@ -470,9 +490,11 @@
  */
 abstract class AngularPropertyElement implements AngularElement {
   /**
-   * An empty array of property elements.
+   * An empty list of property elements.
    */
-  static final List<AngularPropertyElement> EMPTY_ARRAY = <AngularPropertyElement>[];
+  static const List<AngularPropertyElement> EMPTY_ARRAY = const
+      <AngularPropertyElement>[
+      ];
 
   /**
    * Returns the field this property is mapped to.
@@ -500,7 +522,8 @@
 /**
  * Implementation of `AngularPropertyElement`.
  */
-class AngularPropertyElementImpl extends AngularElementImpl implements AngularPropertyElement {
+class AngularPropertyElementImpl extends AngularElementImpl implements
+    AngularPropertyElement {
   /**
    * The [FieldElement] to which this property is bound.
    */
@@ -520,13 +543,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularPropertyElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitAngularPropertyElement(this);
+  AngularPropertyElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_PROPERTY;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitAngularPropertyElement(this);
 }
 
 /**
@@ -545,28 +569,39 @@
    * This allows the component to control the invocation of the closure. This is useful for passing
    * expressions into controllers which act like callbacks. (cost: 0 watches)
    */
-  static const AngularPropertyKind CALLBACK = const AngularPropertyKind('CALLBACK', 1);
+  static const AngularPropertyKind CALLBACK =
+      const AngularPropertyKind('CALLBACK', 1);
 
   /**
    * `=>` - Treat the DOM attribute value as an expression. Set up a watch, which will read the
    * expression in the attribute and assign the value to destination expression. (cost: 1 watch)
    */
-  static const AngularPropertyKind ONE_WAY = const AngularPropertyKind('ONE_WAY', 2);
+  static const AngularPropertyKind ONE_WAY =
+      const AngularPropertyKind('ONE_WAY', 2);
 
   /**
    * `=>!` - Treat the DOM attribute value as an expression. Set up a one time watch on expression.
    * Once the expression turns not null it will no longer update. (cost: 1 watches until not null,
    * then 0 watches)
    */
-  static const AngularPropertyKind ONE_WAY_ONE_TIME = const AngularPropertyKind('ONE_WAY_ONE_TIME', 3);
+  static const AngularPropertyKind ONE_WAY_ONE_TIME =
+      const AngularPropertyKind('ONE_WAY_ONE_TIME', 3);
 
   /**
    * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on both outside as well
    * as component scope to keep the source and destination in sync. (cost: 2 watches)
    */
-  static const AngularPropertyKind TWO_WAY = const AngularPropertyKind_TWO_WAY('TWO_WAY', 4);
+  static const AngularPropertyKind TWO_WAY =
+      const AngularPropertyKind_TWO_WAY('TWO_WAY', 4);
 
-  static const List<AngularPropertyKind> values = const [ATTR, CALLBACK, ONE_WAY, ONE_WAY_ONE_TIME, TWO_WAY];
+  static const List<AngularPropertyKind> values = const [
+      ATTR,
+      CALLBACK,
+      ONE_WAY,
+      ONE_WAY_ONE_TIME,
+      TWO_WAY];
+
+  const AngularPropertyKind(String name, int ordinal) : super(name, ordinal);
 
   /**
    * Returns `true` if property of this kind calls field getter.
@@ -577,12 +612,11 @@
    * Returns `true` if property of this kind calls field setter.
    */
   bool callsSetter() => true;
-
-  const AngularPropertyKind(String name, int ordinal) : super(name, ordinal);
 }
 
 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind {
-  const AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordinal);
+  const AngularPropertyKind_TWO_WAY(String name, int ordinal)
+      : super(name, ordinal);
 
   @override
   bool callsGetter() => true;
@@ -594,9 +628,11 @@
  */
 abstract class AngularScopePropertyElement implements AngularElement {
   /**
-   * An empty array of scope property elements.
+   * An empty list of scope property elements.
    */
-  static final List<AngularScopePropertyElement> EMPTY_ARRAY = <AngularScopePropertyElement>[];
+  static const List<AngularScopePropertyElement> EMPTY_ARRAY = const
+      <AngularScopePropertyElement>[
+      ];
 
   /**
    * Returns the type of this property, not `null`, maybe <code>dynamic</code>.
@@ -609,7 +645,8 @@
 /**
  * Implementation of `AngularScopePropertyElement`.
  */
-class AngularScopePropertyElementImpl extends AngularElementImpl implements AngularScopePropertyElement {
+class AngularScopePropertyElementImpl extends AngularElementImpl implements
+    AngularScopePropertyElement {
   /**
    * The type of the property
    */
@@ -622,13 +659,15 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularScopePropertyElementImpl(String name, int nameOffset, this.type) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(this);
+  AngularScopePropertyElementImpl(String name, int nameOffset, this.type)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY;
+
+  @override
+  accept(ElementVisitor visitor) =>
+      visitor.visitAngularScopePropertyElement(this);
 }
 
 /**
@@ -650,7 +689,8 @@
 /**
  * Implementation of `AngularFormatterElement`.
  */
-abstract class AngularSelectorElementImpl extends AngularElementImpl implements AngularSelectorElement {
+abstract class AngularSelectorElementImpl extends AngularElementImpl implements
+    AngularSelectorElement {
   /**
    * Initialize a newly created Angular selector to have the given name.
    *
@@ -658,13 +698,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  AngularSelectorElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitAngularSelectorElement(this);
+  AngularSelectorElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_SELECTOR;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitAngularSelectorElement(this);
 }
 
 /**
@@ -676,17 +717,19 @@
 /**
  * Implementation of [AngularSelectorElement] based on tag name.
  */
-class AngularTagSelectorElementImpl extends AngularSelectorElementImpl implements AngularTagSelectorElement {
+class AngularTagSelectorElementImpl extends AngularSelectorElementImpl
+    implements AngularTagSelectorElement {
   AngularTagSelectorElementImpl(String name, int offset) : super(name, offset);
 
   @override
+  AngularApplication get application =>
+      (enclosingElement as AngularElementImpl).application;
+
+  @override
   bool apply(XmlTagNode node) {
     String tagName = name;
     return node.tag == tagName;
   }
-
-  @override
-  AngularApplication get application => (enclosingElement as AngularElementImpl).application;
 }
 
 /**
@@ -695,15 +738,18 @@
  */
 abstract class AngularViewElement implements AngularHasTemplateElement {
   /**
-   * An empty array of view elements.
+   * An empty list of view elements.
    */
-  static final List<AngularViewElement> EMPTY_ARRAY = new List<AngularViewElement>(0);
+  static const List<AngularViewElement> EMPTY_ARRAY = const
+      <AngularViewElement>[
+      ];
 }
 
 /**
  * Implementation of `AngularViewElement`.
  */
-class AngularViewElementImpl extends AngularElementImpl implements AngularViewElement {
+class AngularViewElementImpl extends AngularElementImpl implements
+    AngularViewElement {
   /**
    * The HTML template URI.
    */
@@ -722,16 +768,17 @@
   /**
    * Initialize a newly created Angular view.
    */
-  AngularViewElementImpl(this.templateUri, this.templateUriOffset) : super(null, -1);
+  AngularViewElementImpl(this.templateUri, this.templateUriOffset)
+      : super(null, -1);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this);
+  String get identifier => "AngularView@$templateUriOffset";
 
   @override
   ElementKind get kind => ElementKind.ANGULAR_VIEW;
 
   @override
-  String get identifier => "AngularView@$templateUriOffset";
+  accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this);
 }
 
 /**
@@ -785,28 +832,35 @@
   BottomTypeImpl() : super(null, "<bottom>");
 
   @override
-  bool operator ==(Object object) => identical(object, this);
-
-  @override
   int get hashCode => 0;
 
   @override
   bool get isBottom => true;
 
   @override
+  bool operator ==(Object object) => identical(object, this);
+
+  @override
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      identical(object, this);
+
+  @override
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      true;
+
+  @override
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      true;
+
+  @override
   bool isSupertypeOf(DartType type) => false;
 
   @override
-  BottomTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) => this;
-
-  @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => identical(object, this);
-
-  @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) => true;
-
-  @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) => true;
+  BottomTypeImpl substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) =>
+      this;
 }
 
 /**
@@ -836,15 +890,6 @@
   List<ConstructorElement> get constructors;
 
   /**
-   * Return the field (synthetic or explicit) defined in this class that has the given name, or
-   * `null` if this class does not define a field with the given name.
-   *
-   * @param fieldName the name of the field to be returned
-   * @return the field with the given name that is defined in this class
-   */
-  FieldElement getField(String fieldName);
-
-  /**
    * Return an array containing all of the fields declared in this class.
    *
    * @return the fields declared in this class
@@ -852,13 +897,26 @@
   List<FieldElement> get fields;
 
   /**
-   * Return the element representing the getter with the given name that is declared in this class,
-   * or `null` if this class does not declare a getter with the given name.
+   * Return `true` if this class or its superclass declares a non-final instance field.
    *
-   * @param getterName the name of the getter to be returned
-   * @return the getter declared in this class with the given name
+   * @return `true` if this class or its superclass declares a non-final instance field
    */
-  PropertyAccessorElement getGetter(String getterName);
+  bool get hasNonFinalField;
+
+  /**
+   * Return `true` if this class has reference to super (so, for example, cannot be used as a
+   * mixin).
+   *
+   * @return `true` if this class has reference to super
+   */
+  bool get hasReferenceToSuper;
+
+  /**
+   * Return `true` if this class declares a static member.
+   *
+   * @return `true` if this class declares a static member
+   */
+  bool get hasStaticMember;
 
   /**
    * Return an array containing all of the interfaces that are implemented by this class.
@@ -873,13 +931,54 @@
   List<InterfaceType> get interfaces;
 
   /**
-   * Return the element representing the method with the given name that is declared in this class,
-   * or `null` if this class does not declare a method with the given name.
+   * Return `true` if this class is abstract. A class is abstract if it has an explicit
+   * `abstract` modifier. Note, that this definition of <i>abstract</i> is different from
+   * <i>has unimplemented members</i>.
    *
-   * @param methodName the name of the method to be returned
-   * @return the method declared in this class with the given name
+   * @return `true` if this class is abstract
    */
-  MethodElement getMethod(String methodName);
+  bool get isAbstract;
+
+  /**
+   * Return `true` if this class is defined by an enum declaration.
+   *
+   * @return `true` if this class is defined by an enum declaration
+   */
+  bool get isEnum;
+
+  /**
+   * Return `true` if this class [isProxy], or if it inherits the proxy annotation
+   * from a supertype.
+   *
+   * @return `true` if this class defines or inherits a proxy
+   */
+  bool get isOrInheritsProxy;
+
+  /**
+   * Return `true` if this element has an annotation of the form '@proxy'.
+   *
+   * @return `true` if this element defines a proxy
+   */
+  bool get isProxy;
+
+  /**
+   * Return `true` if this class is defined by a typedef construct.
+   *
+   * @return `true` if this class is defined by a typedef construct
+   */
+  bool get isTypedef;
+
+  /**
+   * Return `true` if this class can validly be used as a mixin when defining another class.
+   * The behavior of this method is defined by the Dart Language Specification in section 9:
+   * <blockquote>It is a compile-time error if a declared or derived mixin refers to super. It is a
+   * compile-time error if a declared or derived mixin explicitly declares a constructor. It is a
+   * compile-time error if a mixin is derived from a class whose superclass is not
+   * Object.</blockquote>
+   *
+   * @return `true` if this class can validly be used as a mixin
+   */
+  bool get isValidMixin;
 
   /**
    * Return an array containing all of the methods declared in this class.
@@ -902,15 +1001,6 @@
   List<InterfaceType> get mixins;
 
   /**
-   * Return the named constructor declared in this class with the given name, or `null` if
-   * this class does not declare a named constructor with the given name.
-   *
-   * @param name the name of the constructor to be returned
-   * @return the element representing the specified constructor
-   */
-  ConstructorElement getNamedConstructor(String name);
-
-  /**
    * Return the resolved [ClassDeclaration] node that declares this [ClassElement].
    *
    * This method is expensive, because resolved AST might be evicted from cache, so parsing and
@@ -922,15 +1012,6 @@
   ClassDeclaration get node;
 
   /**
-   * Return the element representing the setter with the given name that is declared in this class,
-   * or `null` if this class does not declare a setter with the given name.
-   *
-   * @param setterName the name of the getter to be returned
-   * @return the setter declared in this class with the given name
-   */
-  PropertyAccessorElement getSetter(String setterName);
-
-  /**
    * Return the superclass of this class, or `null` if the class represents the class
    * 'Object'. All other classes will have a non-`null` superclass. If the superclass was not
    * explicitly declared then the implicit superclass 'Object' will be returned.
@@ -978,57 +1059,49 @@
   ConstructorElement get unnamedConstructor;
 
   /**
-   * Return `true` if this class or its superclass declares a non-final instance field.
+   * Return the field (synthetic or explicit) defined in this class that has the given name, or
+   * `null` if this class does not define a field with the given name.
    *
-   * @return `true` if this class or its superclass declares a non-final instance field
+   * @param fieldName the name of the field to be returned
+   * @return the field with the given name that is defined in this class
    */
-  bool get hasNonFinalField;
+  FieldElement getField(String fieldName);
 
   /**
-   * Return `true` if this class has reference to super (so, for example, cannot be used as a
-   * mixin).
+   * Return the element representing the getter with the given name that is declared in this class,
+   * or `null` if this class does not declare a getter with the given name.
    *
-   * @return `true` if this class has reference to super
+   * @param getterName the name of the getter to be returned
+   * @return the getter declared in this class with the given name
    */
-  bool get hasReferenceToSuper;
+  PropertyAccessorElement getGetter(String getterName);
 
   /**
-   * Return `true` if this class declares a static member.
+   * Return the element representing the method with the given name that is declared in this class,
+   * or `null` if this class does not declare a method with the given name.
    *
-   * @return `true` if this class declares a static member
+   * @param methodName the name of the method to be returned
+   * @return the method declared in this class with the given name
    */
-  bool get hasStaticMember;
+  MethodElement getMethod(String methodName);
 
   /**
-   * Return `true` if this class is abstract. A class is abstract if it has an explicit
-   * `abstract` modifier. Note, that this definition of <i>abstract</i> is different from
-   * <i>has unimplemented members</i>.
+   * Return the named constructor declared in this class with the given name, or `null` if
+   * this class does not declare a named constructor with the given name.
    *
-   * @return `true` if this class is abstract
+   * @param name the name of the constructor to be returned
+   * @return the element representing the specified constructor
    */
-  bool get isAbstract;
+  ConstructorElement getNamedConstructor(String name);
 
   /**
-   * Return `true` if this class is defined by an enum declaration.
+   * Return the element representing the setter with the given name that is declared in this class,
+   * or `null` if this class does not declare a setter with the given name.
    *
-   * @return `true` if this class is defined by an enum declaration
+   * @param setterName the name of the getter to be returned
+   * @return the setter declared in this class with the given name
    */
-  bool get isEnum;
-
-  /**
-   * Return `true` if this class [isProxy], or if it inherits the proxy annotation
-   * from a supertype.
-   *
-   * @return `true` if this class defines or inherits a proxy
-   */
-  bool get isOrInheritsProxy;
-
-  /**
-   * Return `true` if this element has an annotation of the form '@proxy'.
-   *
-   * @return `true` if this element defines a proxy
-   */
-  bool get isProxy;
+  PropertyAccessorElement getSetter(String setterName);
 
   /**
    * Determine whether the given [constructor], which exists in the superclass
@@ -1037,25 +1110,6 @@
   bool isSuperConstructorAccessible(ConstructorElement constructor);
 
   /**
-   * Return `true` if this class is defined by a typedef construct.
-   *
-   * @return `true` if this class is defined by a typedef construct
-   */
-  bool get isTypedef;
-
-  /**
-   * Return `true` if this class can validly be used as a mixin when defining another class.
-   * The behavior of this method is defined by the Dart Language Specification in section 9:
-   * <blockquote>It is a compile-time error if a declared or derived mixin refers to super. It is a
-   * compile-time error if a declared or derived mixin explicitly declares a constructor. It is a
-   * compile-time error if a mixin is derived from a class whose superclass is not
-   * Object.</blockquote>
-   *
-   * @return `true` if this class can validly be used as a mixin
-   */
-  bool get isValidMixin;
-
-  /**
    * Return the element representing the method that results from looking up the given method in
    * this class with respect to the given library, ignoring abstract methods, or `null` if the
    * look up fails. The behavior of this method is defined by the Dart Language Specification in
@@ -1092,7 +1146,8 @@
    * @return the result of looking up the given getter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library);
+  PropertyAccessorElement lookUpGetter(String getterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the getter that results from looking up the given getter in the
@@ -1112,7 +1167,8 @@
    * @return the result of looking up the given getter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName, LibraryElement library);
+  PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the method that results from looking up the given method in the
@@ -1131,7 +1187,8 @@
    * @return the result of looking up the given method in the superclass of this class with respect
    *         to the given library
    */
-  MethodElement lookUpInheritedConcreteMethod(String methodName, LibraryElement library);
+  MethodElement lookUpInheritedConcreteMethod(String methodName,
+      LibraryElement library);
 
   /**
    * Return the element representing the setter that results from looking up the given setter in the
@@ -1151,7 +1208,8 @@
    * @return the result of looking up the given setter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName, LibraryElement library);
+  PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the method that results from looking up the given method in the
@@ -1170,7 +1228,8 @@
    * @return the result of looking up the given method in the superclass of this class with respect
    *         to the given library
    */
-  MethodElement lookUpInheritedMethod(String methodName, LibraryElement library);
+  MethodElement lookUpInheritedMethod(String methodName,
+      LibraryElement library);
 
   /**
    * Return the element representing the method that results from looking up the given method in
@@ -1209,7 +1268,8 @@
    * @return the result of looking up the given setter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library);
+  PropertyAccessorElement lookUpSetter(String setterName,
+      LibraryElement library);
 }
 
 /**
@@ -1217,9 +1277,15 @@
  */
 class ClassElementImpl extends ElementImpl implements ClassElement {
   /**
+   * An empty list of class elements.
+   */
+  static const List<ClassElement> EMPTY_ARRAY = const <ClassElement>[];
+
+  /**
    * An array containing all of the accessors (getters and setters) contained in this class.
    */
-  List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_ARRAY;
+  List<PropertyAccessorElement> _accessors =
+      PropertyAccessorElementImpl.EMPTY_ARRAY;
 
   /**
    * An array containing all of the constructors contained in this class.
@@ -1265,19 +1331,8 @@
   /**
    * An array containing all of the type parameters defined for this class.
    */
-  List<TypeParameterElement> _typeParameters = TypeParameterElementImpl.EMPTY_ARRAY;
-
-  /**
-   * An empty array of class elements.
-   */
-  static List<ClassElement> EMPTY_ARRAY = new List<ClassElement>(0);
-
-  /**
-   * Initialize a newly created class element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  ClassElementImpl.forNode(Identifier name) : super.forNode(name);
+  List<TypeParameterElement> _typeParameters =
+      TypeParameterElementImpl.EMPTY_ARRAY;
 
   /**
    * Initialize a newly created class element to have the given name.
@@ -1288,25 +1343,37 @@
    */
   ClassElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitClassElement(this);
+  /**
+   * Initialize a newly created class element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  ClassElementImpl.forNode(Identifier name) : super.forNode(name);
 
   /**
-   * Add the given [toolkitObject] to the list of toolkit specific information
-   * objects attached to this class.
+   * Set whether this class is abstract to correspond to the given value.
+   *
+   * @param isAbstract `true` if the class is abstract
    */
-  void addToolkitObjects(ToolkitObjectElement toolkitObject) {
-    (toolkitObject as ToolkitObjectElementImpl).enclosingElement = this;
-    if (_toolkitObjects.isEmpty) {
-      // Convert from a non-growable list to a growable list.
-      _toolkitObjects = <ToolkitObjectElement>[];
-    }
-    _toolkitObjects.add(toolkitObject);
+  void set abstract(bool isAbstract) {
+    setModifier(Modifier.ABSTRACT, isAbstract);
   }
 
   @override
   List<PropertyAccessorElement> get accessors => _accessors;
 
+  /**
+   * Set the accessors contained in this class to the given accessors.
+   *
+   * @param accessors the accessors contained in this class
+   */
+  void set accessors(List<PropertyAccessorElement> accessors) {
+    for (PropertyAccessorElement accessor in accessors) {
+      (accessor as PropertyAccessorElementImpl).enclosingElement = this;
+    }
+    this._accessors = accessors;
+  }
+
   @override
   List<InterfaceType> get allSupertypes {
     List<InterfaceType> list = new List<InterfaceType>();
@@ -1315,125 +1382,42 @@
   }
 
   @override
-  ElementImpl getChild(String identifier) {
-    //
-    // The casts in this method are safe because the set methods would have thrown a CCE if any of
-    // the elements in the arrays were not of the expected types.
-    //
-    for (PropertyAccessorElement accessor in _accessors) {
-      if ((accessor as PropertyAccessorElementImpl).identifier == identifier) {
-        return accessor as PropertyAccessorElementImpl;
-      }
-    }
-    for (ConstructorElement constructor in _constructors) {
-      if ((constructor as ConstructorElementImpl).identifier == identifier) {
-        return constructor as ConstructorElementImpl;
-      }
-    }
-    for (FieldElement field in _fields) {
-      if ((field as FieldElementImpl).identifier == identifier) {
-        return field as FieldElementImpl;
-      }
-    }
-    for (MethodElement method in _methods) {
-      if ((method as MethodElementImpl).identifier == identifier) {
-        return method as MethodElementImpl;
-      }
-    }
-    for (TypeParameterElement typeParameter in _typeParameters) {
-      if ((typeParameter as TypeParameterElementImpl).identifier == identifier) {
-        return typeParameter as TypeParameterElementImpl;
-      }
-    }
-    return null;
-  }
-
-  @override
   List<ConstructorElement> get constructors => _constructors;
 
-  @override
-  FieldElement getField(String name) {
-    for (FieldElement fieldElement in _fields) {
-      if (name == fieldElement.name) {
-        return fieldElement;
-      }
+  /**
+   * Set the constructors contained in this class to the given constructors.
+   *
+   * @param constructors the constructors contained in this class
+   */
+  void set constructors(List<ConstructorElement> constructors) {
+    for (ConstructorElement constructor in constructors) {
+      (constructor as ConstructorElementImpl).enclosingElement = this;
     }
-    return null;
+    this._constructors = constructors;
+  }
+
+  /**
+   * Set whether this class is defined by an enum declaration to correspond to the given value.
+   *
+   * @param isEnum `true` if the class is defined by an enum declaration
+   */
+  void set enum2(bool isEnum) {
+    setModifier(Modifier.ENUM, isEnum);
   }
 
   @override
   List<FieldElement> get fields => _fields;
 
-  @override
-  PropertyAccessorElement getGetter(String getterName) {
-    for (PropertyAccessorElement accessor in _accessors) {
-      if (accessor.isGetter && accessor.name == getterName) {
-        return accessor;
-      }
+  /**
+   * Set the fields contained in this class to the given fields.
+   *
+   * @param fields the fields contained in this class
+   */
+  void set fields(List<FieldElement> fields) {
+    for (FieldElement field in fields) {
+      (field as FieldElementImpl).enclosingElement = this;
     }
-    return null;
-  }
-
-  @override
-  ElementKind get kind => ElementKind.CLASS;
-
-  @override
-  MethodElement getMethod(String methodName) {
-    for (MethodElement method in _methods) {
-      if (method.name == methodName) {
-        return method;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<MethodElement> get methods => _methods;
-
-  @override
-  ConstructorElement getNamedConstructor(String name) {
-    for (ConstructorElement element in constructors) {
-      String elementName = element.name;
-      if (elementName != null && elementName == name) {
-        return element;
-      }
-    }
-    return null;
-  }
-
-  @override
-  ClassDeclaration get node => getNodeMatching((node) => node is ClassDeclaration);
-
-  @override
-  PropertyAccessorElement getSetter(String setterName) {
-    // TODO (jwren) revisit- should we append '=' here or require clients to include it?
-    // Do we need the check for isSetter below?
-    if (!StringUtilities.endsWithChar(setterName, 0x3D)) {
-      setterName += '=';
-    }
-    for (PropertyAccessorElement accessor in _accessors) {
-      if (accessor.isSetter && accessor.name == setterName) {
-        return accessor;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<ToolkitObjectElement> get toolkitObjects => _toolkitObjects;
-
-  @override
-  List<TypeParameterElement> get typeParameters => _typeParameters;
-
-  @override
-  ConstructorElement get unnamedConstructor {
-    for (ConstructorElement element in constructors) {
-      String name = element.displayName;
-      if (name == null || name.isEmpty) {
-        return element;
-      }
-    }
-    return null;
+    this._fields = fields;
   }
 
   @override
@@ -1446,7 +1430,10 @@
       if (visitedClasses.add(currentElement)) {
         // check fields
         for (FieldElement field in currentElement.fields) {
-          if (!field.isFinal && !field.isConst && !field.isStatic && !field.isSynthetic) {
+          if (!field.isFinal &&
+              !field.isConst &&
+              !field.isStatic &&
+              !field.isSynthetic) {
             return true;
           }
         }
@@ -1472,6 +1459,15 @@
   @override
   bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER);
 
+  /**
+   * Set whether this class references 'super' to the given value.
+   *
+   * @param isReferencedSuper `true` references 'super'
+   */
+  void set hasReferenceToSuper(bool isReferencedSuper) {
+    setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
+  }
+
   @override
   bool get hasStaticMember {
     for (MethodElement method in _methods) {
@@ -1494,7 +1490,8 @@
   bool get isEnum => hasModifier(Modifier.ENUM);
 
   @override
-  bool get isOrInheritsProxy => _safeIsOrInheritsProxy(this, new HashSet<ClassElement>());
+  bool get isOrInheritsProxy =>
+      _safeIsOrInheritsProxy(this, new HashSet<ClassElement>());
 
   @override
   bool get isProxy {
@@ -1507,114 +1504,16 @@
   }
 
   @override
-  bool isSuperConstructorAccessible(ConstructorElement constructor) {
-    // If this class has no mixins, then all superclass constructors are
-    // accessible.
-    if (mixins.isEmpty) {
-      return true;
-    }
-    // Otherwise only constructors that lack optional parameters are
-    // accessible (see dartbug.com/19576).
-    for (ParameterElement parameter in constructor.parameters) {
-      if (parameter.parameterKind != ParameterKind.REQUIRED) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  @override
   bool get isTypedef => hasModifier(Modifier.TYPEDEF);
 
   @override
   bool get isValidMixin => hasModifier(Modifier.MIXIN);
 
   @override
-  MethodElement lookUpConcreteMethod(String methodName, LibraryElement library) => _internalLookUpConcreteMethod(methodName, library, true);
+  ElementKind get kind => ElementKind.CLASS;
 
   @override
-  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) => _internalLookUpGetter(getterName, library, true);
-
-  @override
-  PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName, LibraryElement library) => _internalLookUpConcreteGetter(getterName, library, false);
-
-  @override
-  MethodElement lookUpInheritedConcreteMethod(String methodName, LibraryElement library) => _internalLookUpConcreteMethod(methodName, library, false);
-
-  @override
-  PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName, LibraryElement library) => _internalLookUpConcreteSetter(setterName, library, false);
-
-  @override
-  MethodElement lookUpInheritedMethod(String methodName, LibraryElement library) => _internalLookUpMethod(methodName, library, false);
-
-  @override
-  MethodElement lookUpMethod(String methodName, LibraryElement library) => _internalLookUpMethod(methodName, library, true);
-
-  @override
-  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library) => _internalLookUpSetter(setterName, library, true);
-
-  /**
-   * Set whether this class is abstract to correspond to the given value.
-   *
-   * @param isAbstract `true` if the class is abstract
-   */
-  void set abstract(bool isAbstract) {
-    setModifier(Modifier.ABSTRACT, isAbstract);
-  }
-
-  /**
-   * Set the accessors contained in this class to the given accessors.
-   *
-   * @param accessors the accessors contained in this class
-   */
-  void set accessors(List<PropertyAccessorElement> accessors) {
-    for (PropertyAccessorElement accessor in accessors) {
-      (accessor as PropertyAccessorElementImpl).enclosingElement = this;
-    }
-    this._accessors = accessors;
-  }
-
-  /**
-   * Set the constructors contained in this class to the given constructors.
-   *
-   * @param constructors the constructors contained in this class
-   */
-  void set constructors(List<ConstructorElement> constructors) {
-    for (ConstructorElement constructor in constructors) {
-      (constructor as ConstructorElementImpl).enclosingElement = this;
-    }
-    this._constructors = constructors;
-  }
-
-  /**
-   * Set whether this class is defined by an enum declaration to correspond to the given value.
-   *
-   * @param isEnum `true` if the class is defined by an enum declaration
-   */
-  void set enum2(bool isEnum) {
-    setModifier(Modifier.ENUM, isEnum);
-  }
-
-  /**
-   * Set the fields contained in this class to the given fields.
-   *
-   * @param fields the fields contained in this class
-   */
-  void set fields(List<FieldElement> fields) {
-    for (FieldElement field in fields) {
-      (field as FieldElementImpl).enclosingElement = this;
-    }
-    this._fields = fields;
-  }
-
-  /**
-   * Set whether this class references 'super' to the given value.
-   *
-   * @param isReferencedSuper `true` references 'super'
-   */
-  void set hasReferenceToSuper(bool isReferencedSuper) {
-    setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
-  }
+  List<MethodElement> get methods => _methods;
 
   /**
    * Set the methods contained in this class to the given methods.
@@ -1628,6 +1527,23 @@
     this._methods = methods;
   }
 
+  bool get mixinErrorsReported => hasModifier(Modifier.MIXIN_ERRORS_REPORTED);
+
+  /**
+   * Set whether an error has reported explaining why this class is an
+   * invalid mixin application.
+   */
+  void set mixinErrorsReported(bool value) {
+    setModifier(Modifier.MIXIN_ERRORS_REPORTED, value);
+  }
+
+  @override
+  ClassDeclaration get node =>
+      getNodeMatching((node) => node is ClassDeclaration);
+
+  @override
+  List<ToolkitObjectElement> get toolkitObjects => _toolkitObjects;
+
   /**
    * Set whether this class is defined by a typedef construct to correspond to the given value.
    *
@@ -1637,6 +1553,9 @@
     setModifier(Modifier.TYPEDEF, isTypedef);
   }
 
+  @override
+  List<TypeParameterElement> get typeParameters => _typeParameters;
+
   /**
    * Set the type parameters defined for this class to the given type parameters.
    *
@@ -1649,6 +1568,17 @@
     this._typeParameters = typeParameters;
   }
 
+  @override
+  ConstructorElement get unnamedConstructor {
+    for (ConstructorElement element in constructors) {
+      String name = element.displayName;
+      if (name == null || name.isEmpty) {
+        return element;
+      }
+    }
+    return null;
+  }
+
   /**
    * Set whether this class is a valid mixin to correspond to the given value.
    *
@@ -1659,14 +1589,19 @@
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(_accessors, visitor);
-    safelyVisitChildren(_constructors, visitor);
-    safelyVisitChildren(_fields, visitor);
-    safelyVisitChildren(_methods, visitor);
-    safelyVisitChildren(_toolkitObjects, visitor);
-    safelyVisitChildren(_typeParameters, visitor);
+  accept(ElementVisitor visitor) => visitor.visitClassElement(this);
+
+  /**
+   * Add the given [toolkitObject] to the list of toolkit specific information
+   * objects attached to this class.
+   */
+  void addToolkitObjects(ToolkitObjectElement toolkitObject) {
+    (toolkitObject as ToolkitObjectElementImpl).enclosingElement = this;
+    if (_toolkitObjects.isEmpty) {
+      // Convert from a non-growable list to a growable list.
+      _toolkitObjects = <ToolkitObjectElement>[];
+    }
+    _toolkitObjects.add(toolkitObject);
   }
 
   @override
@@ -1690,6 +1625,166 @@
     }
   }
 
+  @override
+  ElementImpl getChild(String identifier) {
+    //
+    // The casts in this method are safe because the set methods would have
+    // thrown a CCE if any of the elements in the arrays were not of the
+    // expected types.
+    //
+    for (PropertyAccessorElement accessor in _accessors) {
+      if ((accessor as PropertyAccessorElementImpl).identifier == identifier) {
+        return accessor as PropertyAccessorElementImpl;
+      }
+    }
+    for (ConstructorElement constructor in _constructors) {
+      if ((constructor as ConstructorElementImpl).identifier == identifier) {
+        return constructor as ConstructorElementImpl;
+      }
+    }
+    for (FieldElement field in _fields) {
+      if ((field as FieldElementImpl).identifier == identifier) {
+        return field as FieldElementImpl;
+      }
+    }
+    for (MethodElement method in _methods) {
+      if ((method as MethodElementImpl).identifier == identifier) {
+        return method as MethodElementImpl;
+      }
+    }
+    for (TypeParameterElement typeParameter in _typeParameters) {
+      if ((typeParameter as TypeParameterElementImpl).identifier ==
+          identifier) {
+        return typeParameter as TypeParameterElementImpl;
+      }
+    }
+    return null;
+  }
+
+  @override
+  FieldElement getField(String name) {
+    for (FieldElement fieldElement in _fields) {
+      if (name == fieldElement.name) {
+        return fieldElement;
+      }
+    }
+    return null;
+  }
+
+  @override
+  PropertyAccessorElement getGetter(String getterName) {
+    for (PropertyAccessorElement accessor in _accessors) {
+      if (accessor.isGetter && accessor.name == getterName) {
+        return accessor;
+      }
+    }
+    return null;
+  }
+
+  @override
+  MethodElement getMethod(String methodName) {
+    for (MethodElement method in _methods) {
+      if (method.name == methodName) {
+        return method;
+      }
+    }
+    return null;
+  }
+
+  @override
+  ConstructorElement getNamedConstructor(String name) {
+    for (ConstructorElement element in constructors) {
+      String elementName = element.name;
+      if (elementName != null && elementName == name) {
+        return element;
+      }
+    }
+    return null;
+  }
+
+  @override
+  PropertyAccessorElement getSetter(String setterName) {
+    // TODO (jwren) revisit- should we append '=' here or require clients to
+    // include it?
+    // Do we need the check for isSetter below?
+    if (!StringUtilities.endsWithChar(setterName, 0x3D)) {
+      setterName += '=';
+    }
+    for (PropertyAccessorElement accessor in _accessors) {
+      if (accessor.isSetter && accessor.name == setterName) {
+        return accessor;
+      }
+    }
+    return null;
+  }
+
+  @override
+  bool isSuperConstructorAccessible(ConstructorElement constructor) {
+    // If this class has no mixins, then all superclass constructors are
+    // accessible.
+    if (mixins.isEmpty) {
+      return true;
+    }
+    // Otherwise only constructors that lack optional parameters are
+    // accessible (see dartbug.com/19576).
+    for (ParameterElement parameter in constructor.parameters) {
+      if (parameter.parameterKind != ParameterKind.REQUIRED) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @override
+  MethodElement lookUpConcreteMethod(String methodName,
+      LibraryElement library) =>
+      _internalLookUpConcreteMethod(methodName, library, true);
+
+  @override
+  PropertyAccessorElement lookUpGetter(String getterName,
+      LibraryElement library) =>
+      _internalLookUpGetter(getterName, library, true);
+
+  @override
+  PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName,
+      LibraryElement library) =>
+      _internalLookUpConcreteGetter(getterName, library, false);
+
+  @override
+  MethodElement lookUpInheritedConcreteMethod(String methodName,
+      LibraryElement library) =>
+      _internalLookUpConcreteMethod(methodName, library, false);
+
+  @override
+  PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName,
+      LibraryElement library) =>
+      _internalLookUpConcreteSetter(setterName, library, false);
+
+  @override
+  MethodElement lookUpInheritedMethod(String methodName,
+      LibraryElement library) =>
+      _internalLookUpMethod(methodName, library, false);
+
+  @override
+  MethodElement lookUpMethod(String methodName, LibraryElement library) =>
+      _internalLookUpMethod(methodName, library, true);
+
+  @override
+  PropertyAccessorElement lookUpSetter(String setterName,
+      LibraryElement library) =>
+      _internalLookUpSetter(setterName, library, true);
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(_accessors, visitor);
+    safelyVisitChildren(_constructors, visitor);
+    safelyVisitChildren(_fields, visitor);
+    safelyVisitChildren(_methods, visitor);
+    safelyVisitChildren(_toolkitObjects, visitor);
+    safelyVisitChildren(_typeParameters, visitor);
+  }
+
   void _collectAllSupertypes(List<InterfaceType> supertypes) {
     List<InterfaceType> typesToVisit = new List<InterfaceType>();
     List<ClassElement> visitedClasses = new List<ClassElement>();
@@ -1719,20 +1814,27 @@
     }
   }
 
-  PropertyAccessorElement _internalLookUpConcreteGetter(String getterName, LibraryElement library, bool includeThisClass) {
-    PropertyAccessorElement getter = _internalLookUpGetter(getterName, library, includeThisClass);
+  PropertyAccessorElement _internalLookUpConcreteGetter(String getterName,
+      LibraryElement library, bool includeThisClass) {
+    PropertyAccessorElement getter =
+        _internalLookUpGetter(getterName, library, includeThisClass);
     while (getter != null && getter.isAbstract) {
       Element definingClass = getter.enclosingElement;
       if (definingClass is! ClassElementImpl) {
         return null;
       }
-      getter = (definingClass as ClassElementImpl)._internalLookUpGetter(getterName, library, false);
+      getter = (definingClass as ClassElementImpl)._internalLookUpGetter(
+          getterName,
+          library,
+          false);
     }
     return getter;
   }
 
-  MethodElement _internalLookUpConcreteMethod(String methodName, LibraryElement library, bool includeThisClass) {
-    MethodElement method = _internalLookUpMethod(methodName, library, includeThisClass);
+  MethodElement _internalLookUpConcreteMethod(String methodName,
+      LibraryElement library, bool includeThisClass) {
+    MethodElement method =
+        _internalLookUpMethod(methodName, library, includeThisClass);
     while (method != null && method.isAbstract) {
       ClassElement definingClass = method.enclosingElement;
       if (definingClass == null) {
@@ -1743,19 +1845,25 @@
     return method;
   }
 
-  PropertyAccessorElement _internalLookUpConcreteSetter(String setterName, LibraryElement library, bool includeThisClass) {
-    PropertyAccessorElement setter = _internalLookUpSetter(setterName, library, includeThisClass);
+  PropertyAccessorElement _internalLookUpConcreteSetter(String setterName,
+      LibraryElement library, bool includeThisClass) {
+    PropertyAccessorElement setter =
+        _internalLookUpSetter(setterName, library, includeThisClass);
     while (setter != null && setter.isAbstract) {
       Element definingClass = setter.enclosingElement;
       if (definingClass is! ClassElementImpl) {
         return null;
       }
-      setter = (definingClass as ClassElementImpl)._internalLookUpSetter(setterName, library, false);
+      setter = (definingClass as ClassElementImpl)._internalLookUpSetter(
+          setterName,
+          library,
+          false);
     }
     return setter;
   }
 
-  PropertyAccessorElement _internalLookUpGetter(String getterName, LibraryElement library, bool includeThisClass) {
+  PropertyAccessorElement _internalLookUpGetter(String getterName,
+      LibraryElement library, bool includeThisClass) {
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     ClassElement currentElement = this;
     if (includeThisClass) {
@@ -1787,7 +1895,8 @@
     return null;
   }
 
-  MethodElement _internalLookUpMethod(String methodName, LibraryElement library, bool includeThisClass) {
+  MethodElement _internalLookUpMethod(String methodName, LibraryElement library,
+      bool includeThisClass) {
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     ClassElement currentElement = this;
     if (includeThisClass) {
@@ -1819,7 +1928,8 @@
     return null;
   }
 
-  PropertyAccessorElement _internalLookUpSetter(String setterName, LibraryElement library, bool includeThisClass) {
+  PropertyAccessorElement _internalLookUpSetter(String setterName,
+      LibraryElement library, bool includeThisClass) {
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     ClassElement currentElement = this;
     if (includeThisClass) {
@@ -1851,14 +1961,16 @@
     return null;
   }
 
-  bool _safeIsOrInheritsProxy(ClassElement classElt, HashSet<ClassElement> visitedClassElts) {
+  bool _safeIsOrInheritsProxy(ClassElement classElt,
+      HashSet<ClassElement> visitedClassElts) {
     if (visitedClassElts.contains(classElt)) {
       return false;
     }
     visitedClassElts.add(classElt);
     if (classElt.isProxy) {
       return true;
-    } else if (classElt.supertype != null && _safeIsOrInheritsProxy(classElt.supertype.element, visitedClassElts)) {
+    } else if (classElt.supertype != null &&
+        _safeIsOrInheritsProxy(classElt.supertype.element, visitedClassElts)) {
       return true;
     }
     List<InterfaceType> supertypes = classElt.interfaces;
@@ -1930,15 +2042,6 @@
   LibraryElement get enclosingElement;
 
   /**
-   * Return the enum defined in this compilation unit that has the given name, or `null` if
-   * this compilation unit does not define an enum with the given name.
-   *
-   * @param enumName the name of the enum to be returned
-   * @return the enum with the given name that is defined in this compilation unit
-   */
-  ClassElement getEnum(String enumName);
-
-  /**
    * Return an array containing all of the enums contained in this compilation unit.
    *
    * @return an array containing all of the enums contained in this compilation unit
@@ -1960,6 +2063,15 @@
   List<FunctionTypeAliasElement> get functionTypeAliases;
 
   /**
+   * Return `true` if this compilation unit defines a top-level function named
+   * `loadLibrary`.
+   *
+   * @return `true` if this compilation unit defines a top-level function named
+   *         `loadLibrary`
+   */
+  bool get hasLoadLibraryFunction;
+
+  /**
    * Return the resolved [CompilationUnit] node that declares this element.
    *
    * This method is expensive, because resolved AST might be evicted from cache, so parsing and
@@ -1978,15 +2090,6 @@
   List<TopLevelVariableElement> get topLevelVariables;
 
   /**
-   * Return the class defined in this compilation unit that has the given name, or `null` if
-   * this compilation unit does not define a class with the given name.
-   *
-   * @param className the name of the class to be returned
-   * @return the class with the given name that is defined in this compilation unit
-   */
-  ClassElement getType(String className);
-
-  /**
    * Return an array containing all of the classes contained in this compilation unit.
    *
    * @return the classes contained in this compilation unit
@@ -1994,24 +2097,36 @@
   List<ClassElement> get types;
 
   /**
-   * Return `true` if this compilation unit defines a top-level function named
-   * `loadLibrary`.
+   * Return the enum defined in this compilation unit that has the given name, or `null` if
+   * this compilation unit does not define an enum with the given name.
    *
-   * @return `true` if this compilation unit defines a top-level function named
-   *         `loadLibrary`
+   * @param enumName the name of the enum to be returned
+   * @return the enum with the given name that is defined in this compilation unit
    */
-  bool get hasLoadLibraryFunction;
+  ClassElement getEnum(String enumName);
+
+  /**
+   * Return the class defined in this compilation unit that has the given name, or `null` if
+   * this compilation unit does not define a class with the given name.
+   *
+   * @param className the name of the class to be returned
+   * @return the class with the given name that is defined in this compilation unit
+   */
+  ClassElement getType(String className);
 }
 
 /**
  * Instances of the class `CompilationUnitElementImpl` implement a
  * [CompilationUnitElement].
  */
-class CompilationUnitElementImpl extends UriReferencedElementImpl implements CompilationUnitElement {
+class CompilationUnitElementImpl extends UriReferencedElementImpl implements
+    CompilationUnitElement {
   /**
-   * An empty array of compilation unit elements.
+   * An empty list of compilation unit elements.
    */
-  static List<CompilationUnitElement> EMPTY_ARRAY = new List<CompilationUnitElement>(0);
+  static const List<CompilationUnitElement> EMPTY_ARRAY = const
+      <CompilationUnitElement>[
+      ];
 
   /**
    * The source that corresponds to this compilation unit.
@@ -2022,7 +2137,8 @@
    * An array containing all of the top-level accessors (getters and setters) contained in this
    * compilation unit.
    */
-  List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_ARRAY;
+  List<PropertyAccessorElement> _accessors =
+      PropertyAccessorElementImpl.EMPTY_ARRAY;
 
   /**
    * An array containing all of the enums contained in this compilation unit.
@@ -2042,7 +2158,8 @@
   /**
    * An array containing all of the function type aliases contained in this compilation unit.
    */
-  List<FunctionTypeAliasElement> _typeAliases = FunctionTypeAliasElementImpl.EMPTY_ARRAY;
+  List<FunctionTypeAliasElement> _typeAliases =
+      FunctionTypeAliasElementImpl.EMPTY_ARRAY;
 
   /**
    * An array containing all of the types contained in this compilation unit.
@@ -2052,7 +2169,8 @@
   /**
    * An array containing all of the variables contained in this compilation unit.
    */
-  List<TopLevelVariableElement> _variables = TopLevelVariableElementImpl.EMPTY_ARRAY;
+  List<TopLevelVariableElement> _variables =
+      TopLevelVariableElementImpl.EMPTY_ARRAY;
 
   /**
    * An array containing all of the Angular views contained in this compilation unit.
@@ -2067,113 +2185,8 @@
   CompilationUnitElementImpl(String name) : super(name, -1);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
-
-  @override
-  bool operator ==(Object object) => object != null && runtimeType == object.runtimeType && source == (object as CompilationUnitElementImpl).source;
-
-  @override
   List<PropertyAccessorElement> get accessors => _accessors;
 
-  @override
-  List<AngularViewElement> get angularViews => _angularViews;
-
-  @override
-  ElementImpl getChild(String identifier) {
-    //
-    // The casts in this method are safe because the set methods would have thrown a CCE if any of
-    // the elements in the arrays were not of the expected types.
-    //
-    for (PropertyAccessorElement accessor in _accessors) {
-      if ((accessor as PropertyAccessorElementImpl).identifier == identifier) {
-        return accessor as PropertyAccessorElementImpl;
-      }
-    }
-    for (VariableElement variable in _variables) {
-      if ((variable as VariableElementImpl).identifier == identifier) {
-        return variable as VariableElementImpl;
-      }
-    }
-    for (ExecutableElement function in _functions) {
-      if ((function as ExecutableElementImpl).identifier == identifier) {
-        return function as ExecutableElementImpl;
-      }
-    }
-    for (FunctionTypeAliasElement typeAlias in _typeAliases) {
-      if ((typeAlias as FunctionTypeAliasElementImpl).identifier == identifier) {
-        return typeAlias as FunctionTypeAliasElementImpl;
-      }
-    }
-    for (ClassElement type in _types) {
-      if ((type as ClassElementImpl).identifier == identifier) {
-        return type as ClassElementImpl;
-      }
-    }
-    for (ClassElement type in _enums) {
-      if ((type as ClassElementImpl).identifier == identifier) {
-        return type as ClassElementImpl;
-      }
-    }
-    return null;
-  }
-
-  @override
-  LibraryElement get enclosingElement => super.enclosingElement as LibraryElement;
-
-  @override
-  ClassElement getEnum(String enumName) {
-    for (ClassElement enumDeclaration in _enums) {
-      if (enumDeclaration.name == enumName) {
-        return enumDeclaration;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<ClassElement> get enums => _enums;
-
-  @override
-  List<FunctionElement> get functions => _functions;
-
-  @override
-  List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases;
-
-  @override
-  ElementKind get kind => ElementKind.COMPILATION_UNIT;
-
-  @override
-  CompilationUnit get node => unit;
-
-  @override
-  List<TopLevelVariableElement> get topLevelVariables => _variables;
-
-  @override
-  ClassElement getType(String className) {
-    for (ClassElement type in _types) {
-      if (type.name == className) {
-        return type;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<ClassElement> get types => _types;
-
-  @override
-  int get hashCode => source.hashCode;
-
-  @override
-  bool get hasLoadLibraryFunction {
-    for (int i = 0; i < _functions.length; i++) {
-      if (_functions[i].name == FunctionElement.LOAD_LIBRARY_NAME) {
-        return true;
-      }
-    }
-    return false;
-  }
-
   /**
    * Set the top-level accessors (getters and setters) contained in this compilation unit to the
    * given accessors.
@@ -2187,6 +2200,9 @@
     this._accessors = accessors;
   }
 
+  @override
+  List<AngularViewElement> get angularViews => _angularViews;
+
   /**
    * Set the Angular views defined in this compilation unit.
    *
@@ -2199,6 +2215,13 @@
     this._angularViews = angularViews;
   }
 
+  @override
+  LibraryElement get enclosingElement =>
+      super.enclosingElement as LibraryElement;
+
+  @override
+  List<ClassElement> get enums => _enums;
+
   /**
    * Set the enums contained in this compilation unit to the given enums.
    *
@@ -2211,6 +2234,9 @@
     this._enums = enums;
   }
 
+  @override
+  List<FunctionElement> get functions => _functions;
+
   /**
    * Set the top-level functions contained in this compilation unit to the given functions.
    *
@@ -2223,6 +2249,34 @@
     this._functions = functions;
   }
 
+  @override
+  List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases;
+
+  @override
+  int get hashCode => source.hashCode;
+
+  @override
+  bool get hasLoadLibraryFunction {
+    for (int i = 0; i < _functions.length; i++) {
+      if (_functions[i].name == FunctionElement.LOAD_LIBRARY_NAME) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  String get identifier => source.encoding;
+
+  @override
+  ElementKind get kind => ElementKind.COMPILATION_UNIT;
+
+  @override
+  CompilationUnit get node => unit;
+
+  @override
+  List<TopLevelVariableElement> get topLevelVariables => _variables;
+
   /**
    * Set the top-level variables contained in this compilation unit to the given variables.
    *
@@ -2247,6 +2301,9 @@
     this._typeAliases = typeAliases;
   }
 
+  @override
+  List<ClassElement> get types => _types;
+
   /**
    * Set the types contained in this compilation unit to the given types.
    *
@@ -2260,15 +2317,13 @@
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(_accessors, visitor);
-    safelyVisitChildren(_functions, visitor);
-    safelyVisitChildren(_typeAliases, visitor);
-    safelyVisitChildren(_types, visitor);
-    safelyVisitChildren(_variables, visitor);
-    safelyVisitChildren(_angularViews, visitor);
-  }
+  bool operator ==(Object object) =>
+      object != null &&
+          runtimeType == object.runtimeType &&
+          source == (object as CompilationUnitElementImpl).source;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -2280,7 +2335,77 @@
   }
 
   @override
-  String get identifier => source.encoding;
+  ElementImpl getChild(String identifier) {
+    //
+    // The casts in this method are safe because the set methods would have
+    // thrown a CCE if any of the elements in the arrays were not of the
+    // expected types.
+    //
+    for (PropertyAccessorElement accessor in _accessors) {
+      if ((accessor as PropertyAccessorElementImpl).identifier == identifier) {
+        return accessor as PropertyAccessorElementImpl;
+      }
+    }
+    for (VariableElement variable in _variables) {
+      if ((variable as VariableElementImpl).identifier == identifier) {
+        return variable as VariableElementImpl;
+      }
+    }
+    for (ExecutableElement function in _functions) {
+      if ((function as ExecutableElementImpl).identifier == identifier) {
+        return function as ExecutableElementImpl;
+      }
+    }
+    for (FunctionTypeAliasElement typeAlias in _typeAliases) {
+      if ((typeAlias as FunctionTypeAliasElementImpl).identifier ==
+          identifier) {
+        return typeAlias as FunctionTypeAliasElementImpl;
+      }
+    }
+    for (ClassElement type in _types) {
+      if ((type as ClassElementImpl).identifier == identifier) {
+        return type as ClassElementImpl;
+      }
+    }
+    for (ClassElement type in _enums) {
+      if ((type as ClassElementImpl).identifier == identifier) {
+        return type as ClassElementImpl;
+      }
+    }
+    return null;
+  }
+
+  @override
+  ClassElement getEnum(String enumName) {
+    for (ClassElement enumDeclaration in _enums) {
+      if (enumDeclaration.name == enumName) {
+        return enumDeclaration;
+      }
+    }
+    return null;
+  }
+
+  @override
+  ClassElement getType(String className) {
+    for (ClassElement type in _types) {
+      if (type.name == className) {
+        return type;
+      }
+    }
+    return null;
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(_accessors, visitor);
+    safelyVisitChildren(_enums, visitor);
+    safelyVisitChildren(_functions, visitor);
+    safelyVisitChildren(_typeAliases, visitor);
+    safelyVisitChildren(_types, visitor);
+    safelyVisitChildren(_variables, visitor);
+    safelyVisitChildren(_angularViews, visitor);
+  }
 
   /**
    * Returns the associated toolkit objects.
@@ -2369,57 +2494,11 @@
 }
 
 /**
- * Instances of the class `ConstTopLevelVariableElementImpl` implement a
- * `TopLevelVariableElement` for a top-level 'const' variable that has an initializer.
- */
-class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl {
-  /**
-   * The result of evaluating this variable's initializer.
-   */
-  EvaluationResultImpl _result;
-
-  /**
-   * Initialize a newly created top-level variable element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  ConstTopLevelVariableElementImpl(Identifier name) : super.forNode(name);
-
-  @override
-  EvaluationResultImpl get evaluationResult => _result;
-
-  @override
-  void set evaluationResult(EvaluationResultImpl result) {
-    this._result = result;
-  }
-}
-
-/**
  * The interface `ConstructorElement` defines the behavior of elements representing a
  * constructor or a factory method defined within a type.
  */
-abstract class ConstructorElement implements ClassMemberElement, ExecutableElement {
-  /**
-   * Return the resolved [ConstructorDeclaration] node that declares this
-   * [ConstructorElement] .
-   *
-   * This method is expensive, because resolved AST might be evicted from cache, so parsing and
-   * resolving will be performed.
-   *
-   * @return the resolved [ConstructorDeclaration], not `null`.
-   */
-  @override
-  ConstructorDeclaration get node;
-
-  /**
-   * Return the constructor to which this constructor is redirecting, or `null` if this
-   * constructor does not redirect to another constructor or if the library containing this
-   * constructor has not yet been resolved.
-   *
-   * @return the constructor to which this constructor is redirecting
-   */
-  ConstructorElement get redirectedConstructor;
-
+abstract class ConstructorElement implements ClassMemberElement,
+    ExecutableElement {
   /**
    * Return `true` if this constructor is a const constructor.
    *
@@ -2441,16 +2520,40 @@
    * @return `true` if this constructor represents a factory constructor
    */
   bool get isFactory;
+
+  /**
+   * Return the resolved [ConstructorDeclaration] node that declares this
+   * [ConstructorElement] .
+   *
+   * This method is expensive, because resolved AST might be evicted from cache, so parsing and
+   * resolving will be performed.
+   *
+   * @return the resolved [ConstructorDeclaration], not `null`.
+   */
+  @override
+  ConstructorDeclaration get node;
+
+  /**
+   * Return the constructor to which this constructor is redirecting, or `null` if this
+   * constructor does not redirect to another constructor or if the library containing this
+   * constructor has not yet been resolved.
+   *
+   * @return the constructor to which this constructor is redirecting
+   */
+  ConstructorElement get redirectedConstructor;
 }
 
 /**
  * Instances of the class `ConstructorElementImpl` implement a `ConstructorElement`.
  */
-class ConstructorElementImpl extends ExecutableElementImpl implements ConstructorElement {
+class ConstructorElementImpl extends ExecutableElementImpl implements
+    ConstructorElement {
   /**
-   * An empty array of constructor elements.
+   * An empty list of constructor elements.
    */
-  static List<ConstructorElement> EMPTY_ARRAY = new List<ConstructorElement>(0);
+  static const List<ConstructorElement> EMPTY_ARRAY = const
+      <ConstructorElement>[
+      ];
 
   /**
    * The constructor to which this constructor is redirecting.
@@ -2467,29 +2570,38 @@
    * Initialize a newly created constructor element to have the given name.
    *
    * @param name the name of this element
-   */
-  ConstructorElementImpl.forNode(Identifier name) : super.forNode(name);
-
-  /**
-   * Initialize a newly created constructor element to have the given name.
-   *
-   * @param name the name of this element
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
   ConstructorElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitConstructorElement(this);
+  /**
+   * Initialize a newly created constructor element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  ConstructorElementImpl.forNode(Identifier name) : super.forNode(name);
+
+  /**
+   * Set whether this constructor represents a 'const' constructor to the given value.
+   *
+   * @param isConst `true` if this constructor represents a 'const' constructor
+   */
+  void set const2(bool isConst) {
+    setModifier(Modifier.CONST, isConst);
+  }
 
   @override
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
 
-  @override
-  ElementKind get kind => ElementKind.CONSTRUCTOR;
-
-  @override
-  ConstructorDeclaration get node => getNodeMatching((node) => node is ConstructorDeclaration);
+  /**
+   * Set whether this constructor represents a factory method to the given value.
+   *
+   * @param isFactory `true` if this constructor represents a factory method
+   */
+  void set factory(bool isFactory) {
+    setModifier(Modifier.FACTORY, isFactory);
+  }
 
   @override
   bool get isConst => hasModifier(Modifier.CONST);
@@ -2517,23 +2629,15 @@
   @override
   bool get isStatic => false;
 
-  /**
-   * Set whether this constructor represents a 'const' constructor to the given value.
-   *
-   * @param isConst `true` if this constructor represents a 'const' constructor
-   */
-  void set const2(bool isConst) {
-    setModifier(Modifier.CONST, isConst);
-  }
+  @override
+  ElementKind get kind => ElementKind.CONSTRUCTOR;
 
-  /**
-   * Set whether this constructor represents a factory method to the given value.
-   *
-   * @param isFactory `true` if this constructor represents a factory method
-   */
-  void set factory(bool isFactory) {
-    setModifier(Modifier.FACTORY, isFactory);
-  }
+  @override
+  ConstructorDeclaration get node =>
+      getNodeMatching((node) => node is ConstructorDeclaration);
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitConstructorElement(this);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -2553,60 +2657,24 @@
  */
 class ConstructorMember extends ExecutableMember implements ConstructorElement {
   /**
-   * If the given constructor's type is different when any type parameters from the defining type's
-   * declaration are replaced with the actual type arguments from the defining type, create a
-   * constructor member representing the given constructor. Return the member that was created, or
-   * the base constructor if no member was created.
-   *
-   * @param baseConstructor the base constructor for which a member might be created
-   * @param definingType the type defining the parameters and arguments to be used in the
-   *          substitution
-   * @return the constructor element that will return the correctly substituted types
-   */
-  static ConstructorElement from(ConstructorElement baseConstructor, InterfaceType definingType) {
-    if (baseConstructor == null || definingType.typeArguments.length == 0) {
-      return baseConstructor;
-    }
-    FunctionType baseType = baseConstructor.type;
-    if (baseType == null) {
-      // TODO(brianwilkerson) We need to understand when this can happen.
-      return baseConstructor;
-    }
-    List<DartType> argumentTypes = definingType.typeArguments;
-    List<DartType> parameterTypes = definingType.element.type.typeArguments;
-    FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
-    if (baseType == substitutedType) {
-      return baseConstructor;
-    }
-    // TODO(brianwilkerson) Consider caching the substituted type in the instance. It would use more
-    // memory but speed up some operations. We need to see how often the type is being re-computed.
-    return new ConstructorMember(baseConstructor, definingType);
-  }
-
-  /**
    * Initialize a newly created element to represent a constructor of the given parameterized type.
    *
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  ConstructorMember(ConstructorElement baseElement, InterfaceType definingType) : super(baseElement, definingType);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitConstructorElement(this);
+  ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
+      : super(baseElement, definingType);
 
   @override
   ConstructorElement get baseElement => super.baseElement as ConstructorElement;
 
   @override
+  InterfaceType get definingType => super.definingType as InterfaceType;
+
+  @override
   ClassElement get enclosingElement => baseElement.enclosingElement;
 
   @override
-  ConstructorDeclaration get node => baseElement.node;
-
-  @override
-  ConstructorElement get redirectedConstructor => from(baseElement.redirectedConstructor, definingType);
-
-  @override
   bool get isConst => baseElement.isConst;
 
   @override
@@ -2616,6 +2684,16 @@
   bool get isFactory => baseElement.isFactory;
 
   @override
+  ConstructorDeclaration get node => baseElement.node;
+
+  @override
+  ConstructorElement get redirectedConstructor =>
+      from(baseElement.redirectedConstructor, definingType);
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitConstructorElement(this);
+
+  @override
   String toString() {
     ConstructorElement baseElement = this.baseElement;
     List<ParameterElement> parameters = this.parameters;
@@ -2643,8 +2721,65 @@
     return buffer.toString();
   }
 
+  /**
+   * If the given constructor's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a
+   * constructor member representing the given constructor. Return the member that was created, or
+   * the base constructor if no member was created.
+   *
+   * @param baseConstructor the base constructor for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   *          substitution
+   * @return the constructor element that will return the correctly substituted types
+   */
+  static ConstructorElement from(ConstructorElement baseConstructor,
+      InterfaceType definingType) {
+    if (baseConstructor == null || definingType.typeArguments.length == 0) {
+      return baseConstructor;
+    }
+    FunctionType baseType = baseConstructor.type;
+    if (baseType == null) {
+      // TODO(brianwilkerson) We need to understand when this can happen.
+      return baseConstructor;
+    }
+    List<DartType> argumentTypes = definingType.typeArguments;
+    List<DartType> parameterTypes = definingType.element.type.typeArguments;
+    FunctionType substitutedType =
+        baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseConstructor;
+    }
+    // TODO(brianwilkerson) Consider caching the substituted type in the
+    // instance. It would use more memory but speed up some operations.
+    // We need to see how often the type is being re-computed.
+    return new ConstructorMember(baseConstructor, definingType);
+  }
+}
+
+/**
+ * Instances of the class `ConstTopLevelVariableElementImpl` implement a
+ * `TopLevelVariableElement` for a top-level 'const' variable that has an initializer.
+ */
+class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl {
+  /**
+   * The result of evaluating this variable's initializer.
+   */
+  EvaluationResultImpl _result;
+
+  /**
+   * Initialize a newly created top-level variable element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  ConstTopLevelVariableElementImpl(Identifier name) : super.forNode(name);
+
   @override
-  InterfaceType get definingType => super.definingType as InterfaceType;
+  EvaluationResultImpl get evaluationResult => _result;
+
+  @override
+  void set evaluationResult(EvaluationResultImpl result) {
+    this._result = result;
+  }
 }
 
 /**
@@ -2667,25 +2802,6 @@
   Element get element;
 
   /**
-   * Return the least upper bound of this type and the given [type], or `null`
-   * if there is no least upper bound.
-   */
-  DartType getLeastUpperBound(DartType type);
-
-  /**
-   * Return the name of this type, or `null` if the type does not have a name,
-   * such as when the type represents the type of an unnamed function.
-   */
-  String get name;
-
-  /**
-   * Return `true` if this type is assignable to the given [type]. A type
-   * <i>T</i> may be assigned to a type <i>S</i>, written <i>T</i> &hArr;
-   * <i>S</i>, iff either <i>T</i> <: <i>S</i> or <i>S</i> <: <i>T</i>.
-   */
-  bool isAssignableTo(DartType type);
-
-  /**
    * Return `true` if this type represents the bottom type.
    */
   bool get isBottom;
@@ -2702,16 +2818,45 @@
   bool get isDynamic;
 
   /**
-   * Return `true` if this type is more specific than the given [type].
-   */
-  bool isMoreSpecificThan(DartType type);
-
-  /**
    * Return `true` if this type represents the type 'Object'.
    */
   bool get isObject;
 
   /**
+   * Return `true` if this type represents a typename that couldn't be resolved.
+   */
+  bool get isUndefined;
+
+  /**
+   * Return `true` if this type represents the type 'void'.
+   */
+  bool get isVoid;
+
+  /**
+   * Return the name of this type, or `null` if the type does not have a name,
+   * such as when the type represents the type of an unnamed function.
+   */
+  String get name;
+
+  /**
+   * Return the least upper bound of this type and the given [type], or `null`
+   * if there is no least upper bound.
+   */
+  DartType getLeastUpperBound(DartType type);
+
+  /**
+   * Return `true` if this type is assignable to the given [type]. A type
+   * <i>T</i> may be assigned to a type <i>S</i>, written <i>T</i> &hArr;
+   * <i>S</i>, iff either <i>T</i> <: <i>S</i> or <i>S</i> <: <i>T</i>.
+   */
+  bool isAssignableTo(DartType type);
+
+  /**
+   * Return `true` if this type is more specific than the given [type].
+   */
+  bool isMoreSpecificThan(DartType type);
+
+  /**
    * Return `true` if this type is a subtype of the given [type].
    */
   bool isSubtypeOf(DartType type);
@@ -2724,16 +2869,6 @@
   bool isSupertypeOf(DartType type);
 
   /**
-   * Return `true` if this type represents a typename that couldn't be resolved.
-   */
-  bool get isUndefined;
-
-  /**
-   * Return `true` if this type represents the type 'void'.
-   */
-  bool get isVoid;
-
-  /**
    * Return the type resulting from substituting the given [argumentTypes] for
    * the given [parameterTypes] in this type. The specification defines this
    * operation in section 2:
@@ -2750,14 +2885,16 @@
    * Note too that the current implementation of this method is only guaranteed
    * to work when the argument types are type variables.
    */
-  DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes);
+  DartType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes);
 }
 
 /**
  * Instances of the class `DefaultFieldFormalParameterElementImpl` implement a
  * `FieldFormalParameterElementImpl` for parameters that have an initializer.
  */
-class DefaultFieldFormalParameterElementImpl extends FieldFormalParameterElementImpl {
+class DefaultFieldFormalParameterElementImpl extends
+    FieldFormalParameterElementImpl {
   /**
    * The result of evaluating this variable's initializer.
    */
@@ -2815,7 +2952,8 @@
    *
    * @return the unique instance of this class
    */
-  static DynamicElementImpl get instance => DynamicTypeImpl.instance.element as DynamicElementImpl;
+  static DynamicElementImpl get instance =>
+      DynamicTypeImpl.instance.element as DynamicElementImpl;
 
   /**
    * The type defined by this element.
@@ -2832,10 +2970,10 @@
   }
 
   @override
-  accept(ElementVisitor visitor) => null;
+  ElementKind get kind => ElementKind.DYNAMIC;
 
   @override
-  ElementKind get kind => ElementKind.DYNAMIC;
+  accept(ElementVisitor visitor) => null;
 }
 
 /**
@@ -2857,38 +2995,27 @@
   /**
    * Prevent the creation of instances of this class.
    */
-  DynamicTypeImpl._() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) {
+  DynamicTypeImpl._()
+      : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) {
     (element as DynamicElementImpl).type = this;
   }
 
   @override
-  bool operator ==(Object object) => identical(object, this);
-
-  @override
   int get hashCode => 1;
 
   @override
   bool get isDynamic => true;
 
   @override
-  bool isSupertypeOf(DartType type) => true;
+  bool operator ==(Object object) => identical(object, this);
 
   @override
-  DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    int length = parameterTypes.length;
-    for (int i = 0; i < length; i++) {
-      if (parameterTypes[i] == this) {
-        return argumentTypes[i];
-      }
-    }
-    return this;
-  }
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      identical(object, this);
 
   @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => identical(object, this);
-
-  @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     // T is S
     if (identical(this, type)) {
       return true;
@@ -2898,7 +3025,24 @@
   }
 
   @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) => true;
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      true;
+
+  @override
+  bool isSupertypeOf(DartType type) => true;
+
+  @override
+  DartType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
+    int length = parameterTypes.length;
+    for (int i = 0; i < length; i++) {
+      if (parameterTypes[i] == this) {
+        return argumentTypes[i];
+      }
+    }
+    return this;
+  }
 }
 
 /**
@@ -2929,36 +3073,9 @@
    * A comparator that can be used to sort elements by their name offset. Elements with a smaller
    * offset will be sorted to be before elements with a larger name offset.
    */
-  static final Comparator<Element> SORT_BY_OFFSET = (Element firstElement, Element secondElement) => firstElement.nameOffset - secondElement.nameOffset;
-
-  /**
-   * Use the given visitor to visit this element.
-   *
-   * @param visitor the visitor that will visit this element
-   * @return the value returned by the visitor as a result of visiting this element
-   */
-  accept(ElementVisitor visitor);
-
-  /**
-   * Return the documentation comment for this element as it appears in the original source
-   * (complete with the beginning and ending delimiters), or `null` if this element does not
-   * have a documentation comment associated with it. This can be a long-running operation if the
-   * information needed to access the comment is not cached.
-   *
-   * @return this element's documentation comment
-   * @throws AnalysisException if the documentation comment could not be determined because the
-   *           analysis could not be performed
-   */
-  String computeDocumentationComment();
-
-  /**
-   * Return the element of the given class that most immediately encloses this element, or
-   * `null` if there is no enclosing element of the given class.
-   *
-   * @param elementClass the class of the element to be returned
-   * @return the element that encloses this element
-   */
-  Element getAncestor(Predicate<Element> predicate);
+  static final Comparator<Element> SORT_BY_OFFSET =
+      (Element firstElement, Element secondElement) =>
+          firstElement.nameOffset - secondElement.nameOffset;
 
   /**
    * Return the analysis context in which this element is defined.
@@ -2987,13 +3104,44 @@
   Element get enclosingElement;
 
   /**
-   * Return a display name for the given element that includes the path to the compilation unit in
-   * which the type is defined.
+   * Return `true` if this element has an annotation of the form '@deprecated' or
+   * '@Deprecated('..')'.
    *
-   * @param shortName the short display name. If null, [getDisplayName] is used.
-   * @return a display name that can help distinguish between two types with the same name
+   * @return `true` if this element is deprecated
    */
-  String getExtendedDisplayName(String shortName);
+  bool get isDeprecated;
+
+  /**
+   * Return `true` if this element has an annotation of the form '@override'.
+   *
+   * @return `true` if this element is overridden
+   */
+  bool get isOverride;
+
+  /**
+   * Return `true` if this element is private. Private elements are visible only within the
+   * library in which they are declared.
+   *
+   * @return `true` if this element is private
+   */
+  bool get isPrivate;
+
+  /**
+   * Return `true` if this element is public. Public elements are visible within any library
+   * that imports the library in which they are declared.
+   *
+   * @return `true` if this element is public
+   */
+  bool get isPublic;
+
+  /**
+   * Return `true` if this element is synthetic. A synthetic element is an element that is not
+   * represented in the source code explicitly, but is implied by the source code, such as the
+   * default constructor for a class that does not explicitly define any constructors.
+   *
+   * @return `true` if this element is synthetic
+   */
+  bool get isSynthetic;
 
   /**
    * Return the kind of element that this is.
@@ -3076,6 +3224,44 @@
   CompilationUnit get unit;
 
   /**
+   * Use the given visitor to visit this element.
+   *
+   * @param visitor the visitor that will visit this element
+   * @return the value returned by the visitor as a result of visiting this element
+   */
+  accept(ElementVisitor visitor);
+
+  /**
+   * Return the documentation comment for this element as it appears in the original source
+   * (complete with the beginning and ending delimiters), or `null` if this element does not
+   * have a documentation comment associated with it. This can be a long-running operation if the
+   * information needed to access the comment is not cached.
+   *
+   * @return this element's documentation comment
+   * @throws AnalysisException if the documentation comment could not be determined because the
+   *           analysis could not be performed
+   */
+  String computeDocumentationComment();
+
+  /**
+   * Return the element of the given class that most immediately encloses this element, or
+   * `null` if there is no enclosing element of the given class.
+   *
+   * @param elementClass the class of the element to be returned
+   * @return the element that encloses this element
+   */
+  Element getAncestor(Predicate<Element> predicate);
+
+  /**
+   * Return a display name for the given element that includes the path to the compilation unit in
+   * which the type is defined.
+   *
+   * @param shortName the short display name. If null, [getDisplayName] is used.
+   * @return a display name that can help distinguish between two types with the same name
+   */
+  String getExtendedDisplayName(String shortName);
+
+  /**
    * Return `true` if this element, assuming that it is within scope, is accessible to code in
    * the given library. This is defined by the Dart Language Specification in section 3.2:
    * <blockquote> A declaration <i>m</i> is accessible to library <i>L</i> if <i>m</i> is declared
@@ -3087,46 +3273,6 @@
   bool isAccessibleIn(LibraryElement library);
 
   /**
-   * Return `true` if this element has an annotation of the form '@deprecated' or
-   * '@Deprecated('..')'.
-   *
-   * @return `true` if this element is deprecated
-   */
-  bool get isDeprecated;
-
-  /**
-   * Return `true` if this element has an annotation of the form '@override'.
-   *
-   * @return `true` if this element is overridden
-   */
-  bool get isOverride;
-
-  /**
-   * Return `true` if this element is private. Private elements are visible only within the
-   * library in which they are declared.
-   *
-   * @return `true` if this element is private
-   */
-  bool get isPrivate;
-
-  /**
-   * Return `true` if this element is public. Public elements are visible within any library
-   * that imports the library in which they are declared.
-   *
-   * @return `true` if this element is public
-   */
-  bool get isPublic;
-
-  /**
-   * Return `true` if this element is synthetic. A synthetic element is an element that is not
-   * represented in the source code explicitly, but is implied by the source code, such as the
-   * default constructor for a class that does not explicitly define any constructors.
-   *
-   * @return `true` if this element is synthetic
-   */
-  bool get isSynthetic;
-
-  /**
    * Use the given visitor to visit all of the children of this element. There is no guarantee of
    * the order in which the children will be visited.
    *
@@ -3179,14 +3325,11 @@
  */
 class ElementAnnotationImpl implements ElementAnnotation {
   /**
-   * The element representing the field, variable, or constructor being used as an annotation.
+   * An empty list of annotations.
    */
-  final Element element;
-
-  /**
-   * An empty array of annotations.
-   */
-  static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImpl>(0);
+  static const List<ElementAnnotationImpl> EMPTY_ARRAY = const
+      <ElementAnnotationImpl>[
+      ];
 
   /**
    * The name of the class used to mark an element as being deprecated.
@@ -3210,6 +3353,11 @@
   static String PROXY_VARIABLE_NAME = "proxy";
 
   /**
+   * The element representing the field, variable, or constructor being used as an annotation.
+   */
+  final Element element;
+
+  /**
    * Initialize a newly created annotation.
    *
    * @param element the element representing the field, variable, or constructor being used as an
@@ -3224,10 +3372,12 @@
       if (library != null && library.isDartCore) {
         if (element is ConstructorElement) {
           ConstructorElement constructorElement = element as ConstructorElement;
-          if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME) {
+          if (constructorElement.enclosingElement.name ==
+              _DEPRECATED_CLASS_NAME) {
             return true;
           }
-        } else if (element is PropertyAccessorElement && element.name == _DEPRECATED_VARIABLE_NAME) {
+        } else if (element is PropertyAccessorElement &&
+            element.name == _DEPRECATED_VARIABLE_NAME) {
           return true;
         }
       }
@@ -3240,7 +3390,8 @@
     if (element != null) {
       LibraryElement library = element.library;
       if (library != null && library.isDartCore) {
-        if (element is PropertyAccessorElement && element.name == _OVERRIDE_VARIABLE_NAME) {
+        if (element is PropertyAccessorElement &&
+            element.name == _OVERRIDE_VARIABLE_NAME) {
           return true;
         }
       }
@@ -3253,7 +3404,8 @@
     if (element != null) {
       LibraryElement library = element.library;
       if (library != null && library.isDartCore) {
-        if (element is PropertyAccessorElement && element.name == PROXY_VARIABLE_NAME) {
+        if (element is PropertyAccessorElement &&
+            element.name == PROXY_VARIABLE_NAME) {
           return true;
         }
       }
@@ -3300,14 +3452,12 @@
   /**
    * A cached copy of the calculated hashCode for this element.
    */
-  int _cachedHashCode = 0;
+  int _cachedHashCode;
 
   /**
-   * Initialize a newly created element to have the given name.
-   *
-   * @param name the name of this element
+   * A cached copy of the calculated location for this element.
    */
-  ElementImpl.forNode(Identifier name) : this(name == null ? "" : name.name, name == null ? -1 : name.offset);
+  ElementLocation _cachedLocation;
 
   /**
    * Initialize a newly created element to have the given name.
@@ -3320,43 +3470,13 @@
     this._name = StringUtilities.intern(name);
   }
 
-  @override
-  String computeDocumentationComment() {
-    AnalysisContext context = this.context;
-    if (context == null) {
-      return null;
-    }
-    return context.computeDocumentationComment(this);
-  }
-
-  @override
-  bool operator ==(Object object) {
-    if (identical(this, object)) {
-      return true;
-    }
-    if (object == null || hashCode != object.hashCode) {
-      return false;
-    }
-    return object.runtimeType == runtimeType && (object as Element).location == location;
-  }
-
-  @override
-  Element getAncestor(Predicate<Element> predicate) {
-    Element ancestor = _enclosingElement;
-    while (ancestor != null && !predicate(ancestor)) {
-      ancestor = ancestor.enclosingElement;
-    }
-    return ancestor;
-  }
-
   /**
-   * Return the child of this element that is uniquely identified by the given identifier, or
-   * `null` if there is no such child.
+   * Initialize a newly created element to have the given name.
    *
-   * @param identifier the identifier used to select a child
-   * @return the child of this element with the given identifier
+   * @param name the name of this element
    */
-  ElementImpl getChild(String identifier) => null;
+  ElementImpl.forNode(Identifier name)
+      : this(name == null ? "" : name.name, name == null ? -1 : name.offset);
 
   @override
   AnalysisContext get context {
@@ -3372,66 +3492,20 @@
   @override
   Element get enclosingElement => _enclosingElement;
 
-  @override
-  String getExtendedDisplayName(String shortName) {
-    if (shortName == null) {
-      shortName = displayName;
-    }
-    Source source = this.source;
-    if (source != null) {
-      return "$shortName (${source.fullName})";
-    }
-    return shortName;
-  }
-
   /**
-   * Return `true` if this element is used or potentially can be used.
+   * Set the enclosing element of this element to the given element.
    *
-   * For a top-level element: it is public, or it is private and used in the
-   * defining library.
-   *
-   * For a local variable: its value is used (i.e. purely read or invoked)
-   * somewhere in its scope.
-   *
-   * This information is only available for local variables (including
-   * parameters) and only after the compilation unit containing the element
-   * has been resolved.
+   * @param element the enclosing element of this element
    */
-  bool get isUsed {
-    if (isPublic) {
-      return true;
-    }
-    return hasModifier(Modifier.IS_USED_IN_LIBRARY);
+  void set enclosingElement(Element element) {
+    _enclosingElement = element as ElementImpl;
   }
 
   @override
-  LibraryElement get library => getAncestor((element) => element is LibraryElement);
-
-  @override
-  ElementLocation get location => new ElementLocationImpl.con1(this);
-
-  @override
-  String get name => _name;
-
-  @override
-  AstNode get node => getNodeMatching((node) => node is AstNode);
-
-  @override
-  Source get source {
-    if (_enclosingElement == null) {
-      return null;
-    }
-    return _enclosingElement.source;
-  }
-
-  @override
-  CompilationUnit get unit => context.resolveCompilationUnit(source, library);
-
-  @override
   int get hashCode {
     // TODO: We might want to re-visit this optimization in the future.
     // We cache the hash code value as this is a very frequently called method.
-    if (_cachedHashCode == 0) {
+    if (_cachedHashCode == null) {
       int hashIdentifier = identifier.hashCode;
       Element enclosing = enclosingElement;
       if (enclosing != null) {
@@ -3443,13 +3517,13 @@
     return _cachedHashCode;
   }
 
-  @override
-  bool isAccessibleIn(LibraryElement library) {
-    if (Identifier.isPrivateName(_name)) {
-      return library == this.library;
-    }
-    return true;
-  }
+  /**
+   * Return an identifier that uniquely identifies this element among the children of this element's
+   * parent.
+   *
+   * @return an identifier that uniquely identifies this element relative to its parent
+   */
+  String get identifier => name;
 
   @override
   bool get isDeprecated {
@@ -3486,13 +3560,36 @@
   @override
   bool get isSynthetic => hasModifier(Modifier.SYNTHETIC);
 
-  /**
-   * Set the enclosing element of this element to the given element.
-   *
-   * @param element the enclosing element of this element
-   */
-  void set enclosingElement(Element element) {
-    _enclosingElement = element as ElementImpl;
+  @override
+  LibraryElement get library =>
+      getAncestor((element) => element is LibraryElement);
+
+  @override
+  ElementLocation get location {
+    if (_cachedLocation == null) {
+      _cachedLocation = new ElementLocationImpl.con1(this);
+    }
+    return _cachedLocation;
+  }
+
+  @override
+  String get name => _name;
+
+  void set name(String name) {
+    this._name = name;
+    _cachedLocation = null;
+    _cachedHashCode = null;
+  }
+
+  @override
+  AstNode get node => getNodeMatching((node) => node is AstNode);
+
+  @override
+  Source get source {
+    if (_enclosingElement == null) {
+      return null;
+    }
+    return _enclosingElement.source;
   }
 
   /**
@@ -3505,15 +3602,18 @@
   }
 
   @override
-  String toString() {
-    StringBuffer buffer = new StringBuffer();
-    appendTo(buffer);
-    return buffer.toString();
-  }
+  CompilationUnit get unit => context.resolveCompilationUnit(source, library);
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    // There are no children to visit
+  bool operator ==(Object object) {
+    if (identical(this, object)) {
+      return true;
+    }
+    if (object == null || hashCode != object.hashCode) {
+      return false;
+    }
+    return object.runtimeType == runtimeType &&
+        (object as Element).location == location;
   }
 
   /**
@@ -3529,6 +3629,15 @@
     }
   }
 
+  @override
+  String computeDocumentationComment() {
+    AnalysisContext context = this.context;
+    if (context == null) {
+      return null;
+    }
+    return context.computeDocumentationComment(this);
+  }
+
   /**
    * Set this [Element] as an enclosing for given.
    *
@@ -3538,13 +3647,35 @@
     element.enclosingElement = this;
   }
 
+  @override
+  Element getAncestor(Predicate<Element> predicate) {
+    Element ancestor = _enclosingElement;
+    while (ancestor != null && !predicate(ancestor)) {
+      ancestor = ancestor.enclosingElement;
+    }
+    return ancestor;
+  }
+
   /**
-   * Return an identifier that uniquely identifies this element among the children of this element's
-   * parent.
+   * Return the child of this element that is uniquely identified by the given identifier, or
+   * `null` if there is no such child.
    *
-   * @return an identifier that uniquely identifies this element relative to its parent
+   * @param identifier the identifier used to select a child
+   * @return the child of this element with the given identifier
    */
-  String get identifier => name;
+  ElementImpl getChild(String identifier) => null;
+
+  @override
+  String getExtendedDisplayName(String shortName) {
+    if (shortName == null) {
+      shortName = displayName;
+    }
+    Source source = this.source;
+    if (source != null) {
+      return "$shortName (${source.fullName})";
+    }
+    return shortName;
+  }
 
   /**
    * Return the resolved [AstNode] of the given type enclosing [getNameOffset].
@@ -3568,13 +3699,15 @@
    * @param modifier the modifier being tested for
    * @return `true` if this element has the given modifier associated with it
    */
-  bool hasModifier(Modifier modifier) => BooleanArray.getEnum(_modifiers, modifier);
+  bool hasModifier(Modifier modifier) =>
+      BooleanArray.getEnum(_modifiers, modifier);
 
-  /**
-   * Specifies that the element is used.
-   */
-  void markUsed() {
-    setModifier(Modifier.IS_USED_IN_LIBRARY, true);
+  @override
+  bool isAccessibleIn(LibraryElement library) {
+    if (Identifier.isPrivateName(_name)) {
+      return library == this.library;
+    }
+    return true;
   }
 
   /**
@@ -3613,83 +3746,122 @@
   void setModifier(Modifier modifier, bool value) {
     _modifiers = BooleanArray.setEnum(_modifiers, modifier, value);
   }
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    appendTo(buffer);
+    return buffer.toString();
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    // There are no children to visit
+  }
 }
 
 /**
  * The enumeration `ElementKind` defines the various kinds of elements in the element model.
  */
 class ElementKind extends Enum<ElementKind> {
-  static const ElementKind ANGULAR_FORMATTER = const ElementKind('ANGULAR_FORMATTER', 0, "Angular formatter");
+  static const ElementKind ANGULAR_FORMATTER =
+      const ElementKind('ANGULAR_FORMATTER', 0, "Angular formatter");
 
-  static const ElementKind ANGULAR_COMPONENT = const ElementKind('ANGULAR_COMPONENT', 1, "Angular component");
+  static const ElementKind ANGULAR_COMPONENT =
+      const ElementKind('ANGULAR_COMPONENT', 1, "Angular component");
 
-  static const ElementKind ANGULAR_CONTROLLER = const ElementKind('ANGULAR_CONTROLLER', 2, "Angular controller");
+  static const ElementKind ANGULAR_CONTROLLER =
+      const ElementKind('ANGULAR_CONTROLLER', 2, "Angular controller");
 
-  static const ElementKind ANGULAR_DIRECTIVE = const ElementKind('ANGULAR_DIRECTIVE', 3, "Angular directive");
+  static const ElementKind ANGULAR_DIRECTIVE =
+      const ElementKind('ANGULAR_DIRECTIVE', 3, "Angular directive");
 
-  static const ElementKind ANGULAR_PROPERTY = const ElementKind('ANGULAR_PROPERTY', 4, "Angular property");
+  static const ElementKind ANGULAR_PROPERTY =
+      const ElementKind('ANGULAR_PROPERTY', 4, "Angular property");
 
-  static const ElementKind ANGULAR_SCOPE_PROPERTY = const ElementKind('ANGULAR_SCOPE_PROPERTY', 5, "Angular scope property");
+  static const ElementKind ANGULAR_SCOPE_PROPERTY =
+      const ElementKind('ANGULAR_SCOPE_PROPERTY', 5, "Angular scope property");
 
-  static const ElementKind ANGULAR_SELECTOR = const ElementKind('ANGULAR_SELECTOR', 6, "Angular selector");
+  static const ElementKind ANGULAR_SELECTOR =
+      const ElementKind('ANGULAR_SELECTOR', 6, "Angular selector");
 
-  static const ElementKind ANGULAR_VIEW = const ElementKind('ANGULAR_VIEW', 7, "Angular view");
+  static const ElementKind ANGULAR_VIEW =
+      const ElementKind('ANGULAR_VIEW', 7, "Angular view");
 
   static const ElementKind CLASS = const ElementKind('CLASS', 8, "class");
 
-  static const ElementKind COMPILATION_UNIT = const ElementKind('COMPILATION_UNIT', 9, "compilation unit");
+  static const ElementKind COMPILATION_UNIT =
+      const ElementKind('COMPILATION_UNIT', 9, "compilation unit");
 
-  static const ElementKind CONSTRUCTOR = const ElementKind('CONSTRUCTOR', 10, "constructor");
+  static const ElementKind CONSTRUCTOR =
+      const ElementKind('CONSTRUCTOR', 10, "constructor");
 
-  static const ElementKind DYNAMIC = const ElementKind('DYNAMIC', 11, "<dynamic>");
+  static const ElementKind DYNAMIC =
+      const ElementKind('DYNAMIC', 11, "<dynamic>");
 
-  static const ElementKind EMBEDDED_HTML_SCRIPT = const ElementKind('EMBEDDED_HTML_SCRIPT', 12, "embedded html script");
+  static const ElementKind EMBEDDED_HTML_SCRIPT =
+      const ElementKind('EMBEDDED_HTML_SCRIPT', 12, "embedded html script");
 
   static const ElementKind ERROR = const ElementKind('ERROR', 13, "<error>");
 
-  static const ElementKind EXPORT = const ElementKind('EXPORT', 14, "export directive");
+  static const ElementKind EXPORT =
+      const ElementKind('EXPORT', 14, "export directive");
 
-  static const ElementKind EXTERNAL_HTML_SCRIPT = const ElementKind('EXTERNAL_HTML_SCRIPT', 15, "external html script");
+  static const ElementKind EXTERNAL_HTML_SCRIPT =
+      const ElementKind('EXTERNAL_HTML_SCRIPT', 15, "external html script");
 
   static const ElementKind FIELD = const ElementKind('FIELD', 16, "field");
 
-  static const ElementKind FUNCTION = const ElementKind('FUNCTION', 17, "function");
+  static const ElementKind FUNCTION =
+      const ElementKind('FUNCTION', 17, "function");
 
   static const ElementKind GETTER = const ElementKind('GETTER', 18, "getter");
 
   static const ElementKind HTML = const ElementKind('HTML', 19, "html");
 
-  static const ElementKind IMPORT = const ElementKind('IMPORT', 20, "import directive");
+  static const ElementKind IMPORT =
+      const ElementKind('IMPORT', 20, "import directive");
 
   static const ElementKind LABEL = const ElementKind('LABEL', 21, "label");
 
-  static const ElementKind LIBRARY = const ElementKind('LIBRARY', 22, "library");
+  static const ElementKind LIBRARY =
+      const ElementKind('LIBRARY', 22, "library");
 
-  static const ElementKind LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE', 23, "local variable");
+  static const ElementKind LOCAL_VARIABLE =
+      const ElementKind('LOCAL_VARIABLE', 23, "local variable");
 
   static const ElementKind METHOD = const ElementKind('METHOD', 24, "method");
 
   static const ElementKind NAME = const ElementKind('NAME', 25, "<name>");
 
-  static const ElementKind PARAMETER = const ElementKind('PARAMETER', 26, "parameter");
+  static const ElementKind PARAMETER =
+      const ElementKind('PARAMETER', 26, "parameter");
 
-  static const ElementKind POLYMER_ATTRIBUTE = const ElementKind('POLYMER_ATTRIBUTE', 27, "Polymer attribute");
+  static const ElementKind POLYMER_ATTRIBUTE =
+      const ElementKind('POLYMER_ATTRIBUTE', 27, "Polymer attribute");
 
-  static const ElementKind POLYMER_TAG_DART = const ElementKind('POLYMER_TAG_DART', 28, "Polymer Dart tag");
+  static const ElementKind POLYMER_TAG_DART =
+      const ElementKind('POLYMER_TAG_DART', 28, "Polymer Dart tag");
 
-  static const ElementKind POLYMER_TAG_HTML = const ElementKind('POLYMER_TAG_HTML', 29, "Polymer HTML tag");
+  static const ElementKind POLYMER_TAG_HTML =
+      const ElementKind('POLYMER_TAG_HTML', 29, "Polymer HTML tag");
 
-  static const ElementKind PREFIX = const ElementKind('PREFIX', 30, "import prefix");
+  static const ElementKind PREFIX =
+      const ElementKind('PREFIX', 30, "import prefix");
 
   static const ElementKind SETTER = const ElementKind('SETTER', 31, "setter");
 
-  static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VARIABLE', 32, "top level variable");
+  static const ElementKind TOP_LEVEL_VARIABLE =
+      const ElementKind('TOP_LEVEL_VARIABLE', 32, "top level variable");
 
-  static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYPE_ALIAS', 33, "function type alias");
+  static const ElementKind FUNCTION_TYPE_ALIAS =
+      const ElementKind('FUNCTION_TYPE_ALIAS', 33, "function type alias");
 
-  static const ElementKind TYPE_PARAMETER = const ElementKind('TYPE_PARAMETER', 34, "type parameter");
+  static const ElementKind TYPE_PARAMETER =
+      const ElementKind('TYPE_PARAMETER', 34, "type parameter");
 
-  static const ElementKind UNIVERSE = const ElementKind('UNIVERSE', 35, "<universe>");
+  static const ElementKind UNIVERSE =
+      const ElementKind('UNIVERSE', 35, "<universe>");
 
   static const List<ElementKind> values = const [
       ANGULAR_FORMATTER,
@@ -3730,6 +3902,19 @@
       UNIVERSE];
 
   /**
+   * The name displayed in the UI for this kind of element.
+   */
+  final String displayName;
+
+  /**
+   * Initialize a newly created element kind to have the given display name.
+   *
+   * @param displayName the name displayed in the UI for this kind of element
+   */
+  const ElementKind(String name, int ordinal, this.displayName)
+      : super(name, ordinal);
+
+  /**
    * Return the kind of the given element, or [ERROR] if the element is `null`. This is
    * a utility method that can reduce the need for null checks in other places.
    *
@@ -3742,18 +3927,6 @@
     }
     return element.kind;
   }
-
-  /**
-   * The name displayed in the UI for this kind of element.
-   */
-  final String displayName;
-
-  /**
-   * Initialize a newly created element kind to have the given display name.
-   *
-   * @param displayName the name displayed in the UI for this kind of element
-   */
-  const ElementKind(String name, int ordinal, this.displayName) : super(name, ordinal);
 }
 
 /**
@@ -3783,14 +3956,29 @@
  */
 class ElementLocationImpl implements ElementLocation {
   /**
+   * The character used to separate components in the encoded form.
+   */
+  static int _SEPARATOR_CHAR = 0x3B;
+
+  /**
    * The path to the element whose location is represented by this object.
    */
   List<String> _components;
 
   /**
-   * The character used to separate components in the encoded form.
+   * The object managing [indexKeyId] and [indexLocationId].
    */
-  static int _SEPARATOR_CHAR = 0x3B;
+  Object indexOwner;
+
+  /**
+   * A cached id of this location in index.
+   */
+  int indexKeyId;
+
+  /**
+   * A cached id of this location in index.
+   */
+  int indexLocationId;
 
   /**
    * Initialize a newly created location to represent the given element.
@@ -3826,28 +4014,6 @@
   }
 
   @override
-  bool operator ==(Object object) {
-    if (identical(this, object)) {
-      return true;
-    }
-    if (object is! ElementLocationImpl) {
-      return false;
-    }
-    ElementLocationImpl location = object as ElementLocationImpl;
-    List<String> otherComponents = location._components;
-    int length = _components.length;
-    if (otherComponents.length != length) {
-      return false;
-    }
-    for (int i = 0; i < length; i++) {
-      if (_components[i] != otherComponents[i]) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  @override
   List<String> get components => _components;
 
   @override
@@ -3874,6 +4040,28 @@
   }
 
   @override
+  bool operator ==(Object object) {
+    if (identical(this, object)) {
+      return true;
+    }
+    if (object is! ElementLocationImpl) {
+      return false;
+    }
+    ElementLocationImpl location = object as ElementLocationImpl;
+    List<String> otherComponents = location._components;
+    int length = _components.length;
+    if (otherComponents.length != length) {
+      return false;
+    }
+    for (int i = 0; i < length; i++) {
+      if (_components[i] != otherComponents[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @override
   String toString() => encoding;
 
   /**
@@ -3890,7 +4078,8 @@
     while (index < length) {
       int currentChar = encoding.codeUnitAt(index);
       if (currentChar == _SEPARATOR_CHAR) {
-        if (index + 1 < length && encoding.codeUnitAt(index + 1) == _SEPARATOR_CHAR) {
+        if (index + 1 < length &&
+            encoding.codeUnitAt(index + 1) == _SEPARATOR_CHAR) {
           buffer.writeCharCode(_SEPARATOR_CHAR);
           index += 2;
         } else {
@@ -3948,6 +4137,24 @@
    */
   ElementPair(this._first, this._second);
 
+  /**
+   * Return the first element.
+   *
+   * @return the first element
+   */
+  Element get firstElt => _first;
+
+  @override
+  int get hashCode =>
+      ObjectUtilities.combineHashCodes(_first.hashCode, _second.hashCode);
+
+  /**
+   * Return the second element
+   *
+   * @return the second element
+   */
+  Element get secondElt => _second;
+
   @override
   bool operator ==(Object object) {
     if (identical(object, this)) {
@@ -3959,23 +4166,6 @@
     }
     return false;
   }
-
-  /**
-   * Return the first element.
-   *
-   * @return the first element
-   */
-  Element get firstElt => _first;
-
-  /**
-   * Return the second element
-   *
-   * @return the second element
-   */
-  Element get secondElt => _second;
-
-  @override
-  int get hashCode => ObjectUtilities.combineHashCodes(_first.hashCode, _second.hashCode);
 }
 
 /**
@@ -4067,7 +4257,8 @@
  * Instances of the class `EmbeddedHtmlScriptElementImpl` implement an
  * [EmbeddedHtmlScriptElement].
  */
-class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements EmbeddedHtmlScriptElement {
+class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements
+    EmbeddedHtmlScriptElement {
   /**
    * The library defined by the script tag's content.
    */
@@ -4081,9 +4272,6 @@
   EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitEmbeddedHtmlScriptElement(this);
-
-  @override
   ElementKind get kind => ElementKind.EMBEDDED_HTML_SCRIPT;
 
   @override
@@ -4100,6 +4288,10 @@
   }
 
   @override
+  accept(ElementVisitor visitor) =>
+      visitor.visitEmbeddedHtmlScriptElement(this);
+
+  @override
   void visitChildren(ElementVisitor visitor) {
     safelyVisitChild(_scriptLibrary, visitor);
   }
@@ -4118,41 +4310,6 @@
   List<FunctionElement> get functions;
 
   /**
-   * Return an array containing all of the labels defined within this executable element.
-   *
-   * @return the labels defined within this executable element
-   */
-  List<LabelElement> get labels;
-
-  /**
-   * Return an array containing all of the local variables defined within this executable element.
-   *
-   * @return the local variables defined within this executable element
-   */
-  List<LocalVariableElement> get localVariables;
-
-  /**
-   * Return an array containing all of the parameters defined by this executable element.
-   *
-   * @return the parameters defined by this executable element
-   */
-  List<ParameterElement> get parameters;
-
-  /**
-   * Return the return type defined by this executable element.
-   *
-   * @return the return type defined by this executable element
-   */
-  DartType get returnType;
-
-  /**
-   * Return the type of function defined by this executable element.
-   *
-   * @return the type of function defined by this executable element
-   */
-  FunctionType get type;
-
-  /**
    * Return `true` if this executable element has body marked as being asynchronous.
    *
    * @return `true` if this executable element has body marked as being asynchronous
@@ -4189,13 +4346,55 @@
    * @return `true` if this executable element has a body marked as being synchronous
    */
   bool get isSynchronous;
+
+  /**
+   * Return an array containing all of the labels defined within this executable element.
+   *
+   * @return the labels defined within this executable element
+   */
+  List<LabelElement> get labels;
+
+  /**
+   * Return an array containing all of the local variables defined within this executable element.
+   *
+   * @return the local variables defined within this executable element
+   */
+  List<LocalVariableElement> get localVariables;
+
+  /**
+   * Return an array containing all of the parameters defined by this executable element.
+   *
+   * @return the parameters defined by this executable element
+   */
+  List<ParameterElement> get parameters;
+
+  /**
+   * Return the return type defined by this executable element.
+   *
+   * @return the return type defined by this executable element
+   */
+  DartType get returnType;
+
+  /**
+   * Return the type of function defined by this executable element.
+   *
+   * @return the type of function defined by this executable element
+   */
+  FunctionType get type;
 }
 
 /**
  * The abstract class `ExecutableElementImpl` implements the behavior common to
  * `ExecutableElement`s.
  */
-abstract class ExecutableElementImpl extends ElementImpl implements ExecutableElement {
+abstract class ExecutableElementImpl extends ElementImpl implements
+    ExecutableElement {
+  /**
+   * An empty list of executable elements.
+   */
+  static const List<ExecutableElement> EMPTY_ARRAY = const <ExecutableElement>[
+      ];
+
   /**
    * An array containing all of the functions defined within this executable element.
    */
@@ -4209,7 +4408,8 @@
   /**
    * An array containing all of the local variables defined within this executable element.
    */
-  List<LocalVariableElement> _localVariables = LocalVariableElementImpl.EMPTY_ARRAY;
+  List<LocalVariableElement> _localVariables =
+      LocalVariableElementImpl.EMPTY_ARRAY;
 
   /**
    * An array containing all of the parameters defined by this executable element.
@@ -4227,9 +4427,13 @@
   FunctionType type;
 
   /**
-   * An empty array of executable elements.
+   * Initialize a newly created executable element to have the given name.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<ExecutableElement> EMPTY_ARRAY = new List<ExecutableElement>(0);
+  ExecutableElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
   /**
    * Initialize a newly created executable element to have the given name.
@@ -4239,64 +4443,6 @@
   ExecutableElementImpl.forNode(Identifier name) : super.forNode(name);
 
   /**
-   * Initialize a newly created executable element to have the given name.
-   *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
-   */
-  ExecutableElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  ElementImpl getChild(String identifier) {
-    for (ExecutableElement function in _functions) {
-      if ((function as ExecutableElementImpl).identifier == identifier) {
-        return function as ExecutableElementImpl;
-      }
-    }
-    for (LabelElement label in _labels) {
-      if ((label as LabelElementImpl).identifier == identifier) {
-        return label as LabelElementImpl;
-      }
-    }
-    for (VariableElement variable in _localVariables) {
-      if ((variable as VariableElementImpl).identifier == identifier) {
-        return variable as VariableElementImpl;
-      }
-    }
-    for (ParameterElement parameter in _parameters) {
-      if ((parameter as ParameterElementImpl).identifier == identifier) {
-        return parameter as ParameterElementImpl;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<FunctionElement> get functions => _functions;
-
-  @override
-  List<LabelElement> get labels => _labels;
-
-  @override
-  List<LocalVariableElement> get localVariables => _localVariables;
-
-  @override
-  List<ParameterElement> get parameters => _parameters;
-
-  @override
-  bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS);
-
-  @override
-  bool get isGenerator => hasModifier(Modifier.GENERATOR);
-
-  @override
-  bool get isOperator => false;
-
-  @override
-  bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS);
-
-  /**
    * Set whether this method's body is asynchronous to correspond to the given value.
    *
    * @param isAsynchronous `true` if the method's body is asynchronous
@@ -4305,6 +4451,9 @@
     setModifier(Modifier.ASYNCHRONOUS, isAsynchronous);
   }
 
+  @override
+  List<FunctionElement> get functions => _functions;
+
   /**
    * Set the functions defined within this executable element to the given functions.
    *
@@ -4326,6 +4475,21 @@
     setModifier(Modifier.GENERATOR, isGenerator);
   }
 
+  @override
+  bool get isAsynchronous => hasModifier(Modifier.ASYNCHRONOUS);
+
+  @override
+  bool get isGenerator => hasModifier(Modifier.GENERATOR);
+
+  @override
+  bool get isOperator => false;
+
+  @override
+  bool get isSynchronous => !hasModifier(Modifier.ASYNCHRONOUS);
+
+  @override
+  List<LabelElement> get labels => _labels;
+
   /**
    * Set the labels defined within this executable element to the given labels.
    *
@@ -4338,6 +4502,9 @@
     this._labels = labels;
   }
 
+  @override
+  List<LocalVariableElement> get localVariables => _localVariables;
+
   /**
    * Set the local variables defined within this executable element to the given variables.
    *
@@ -4350,6 +4517,9 @@
     this._localVariables = localVariables;
   }
 
+  @override
+  List<ParameterElement> get parameters => _parameters;
+
   /**
    * Set the parameters defined by this executable element to the given parameters.
    *
@@ -4363,15 +4533,6 @@
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(_functions, visitor);
-    safelyVisitChildren(_labels, visitor);
-    safelyVisitChildren(_localVariables, visitor);
-    safelyVisitChildren(_parameters, visitor);
-  }
-
-  @override
   void appendTo(StringBuffer buffer) {
     if (this.kind != ElementKind.GETTER) {
       buffer.write("(");
@@ -4411,6 +4572,40 @@
       buffer.write(type.returnType);
     }
   }
+
+  @override
+  ElementImpl getChild(String identifier) {
+    for (ExecutableElement function in _functions) {
+      if ((function as ExecutableElementImpl).identifier == identifier) {
+        return function as ExecutableElementImpl;
+      }
+    }
+    for (LabelElement label in _labels) {
+      if ((label as LabelElementImpl).identifier == identifier) {
+        return label as LabelElementImpl;
+      }
+    }
+    for (VariableElement variable in _localVariables) {
+      if ((variable as VariableElementImpl).identifier == identifier) {
+        return variable as VariableElementImpl;
+      }
+    }
+    for (ParameterElement parameter in _parameters) {
+      if ((parameter as ParameterElementImpl).identifier == identifier) {
+        return parameter as ParameterElementImpl;
+      }
+    }
+    return null;
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(_functions, visitor);
+    safelyVisitChildren(_labels, visitor);
+    safelyVisitChildren(_localVariables, visitor);
+    safelyVisitChildren(_parameters, visitor);
+  }
 }
 
 /**
@@ -4426,7 +4621,8 @@
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  ExecutableMember(ExecutableElement baseElement, InterfaceType definingType) : super(baseElement, definingType);
+  ExecutableMember(ExecutableElement baseElement, InterfaceType definingType)
+      : super(baseElement, definingType);
 
   @override
   ExecutableElement get baseElement => super.baseElement as ExecutableElement;
@@ -4434,45 +4630,14 @@
   @override
   List<FunctionElement> get functions {
     //
-    // Elements within this element should have type parameters substituted, just like this element.
+    // Elements within this element should have type parameters substituted,
+    // just like this element.
     //
     throw new UnsupportedOperationException();
-    //    return getBaseElement().getFunctions();
+//    return getBaseElement().getFunctions();
   }
 
   @override
-  List<LabelElement> get labels => baseElement.labels;
-
-  @override
-  List<LocalVariableElement> get localVariables {
-    //
-    // Elements within this element should have type parameters substituted, just like this element.
-    //
-    throw new UnsupportedOperationException();
-    //    return getBaseElement().getLocalVariables();
-  }
-
-  @override
-  List<ParameterElement> get parameters {
-    List<ParameterElement> baseParameters = baseElement.parameters;
-    int parameterCount = baseParameters.length;
-    if (parameterCount == 0) {
-      return baseParameters;
-    }
-    List<ParameterElement> parameterizedParameters = new List<ParameterElement>(parameterCount);
-    for (int i = 0; i < parameterCount; i++) {
-      parameterizedParameters[i] = ParameterMember.from(baseParameters[i], definingType);
-    }
-    return parameterizedParameters;
-  }
-
-  @override
-  DartType get returnType => substituteFor(baseElement.returnType);
-
-  @override
-  FunctionType get type => substituteFor(baseElement.type);
-
-  @override
   bool get isAsynchronous => baseElement.isAsynchronous;
 
   @override
@@ -4488,9 +4653,44 @@
   bool get isSynchronous => baseElement.isSynchronous;
 
   @override
+  List<LabelElement> get labels => baseElement.labels;
+
+  @override
+  List<LocalVariableElement> get localVariables {
+    //
+    // Elements within this element should have type parameters substituted,
+    // just like this element.
+    //
+    throw new UnsupportedOperationException();
+//    return getBaseElement().getLocalVariables();
+  }
+
+  @override
+  List<ParameterElement> get parameters {
+    List<ParameterElement> baseParameters = baseElement.parameters;
+    int parameterCount = baseParameters.length;
+    if (parameterCount == 0) {
+      return baseParameters;
+    }
+    List<ParameterElement> parameterizedParameters =
+        new List<ParameterElement>(parameterCount);
+    for (int i = 0; i < parameterCount; i++) {
+      parameterizedParameters[i] =
+          ParameterMember.from(baseParameters[i], definingType);
+    }
+    return parameterizedParameters;
+  }
+
+  @override
+  DartType get returnType => substituteFor(baseElement.returnType);
+
+  @override
+  FunctionType get type => substituteFor(baseElement.type);
+
+  @override
   void visitChildren(ElementVisitor visitor) {
-    // TODO(brianwilkerson) We need to finish implementing the accessors used below so that we can
-    // safely invoke them.
+    // TODO(brianwilkerson) We need to finish implementing the accessors used
+    // below so that we can safely invoke them.
     super.visitChildren(visitor);
     safelyVisitChildren(baseElement.functions, visitor);
     safelyVisitChildren(labels, visitor);
@@ -4505,9 +4705,9 @@
  */
 abstract class ExportElement implements Element, UriReferencedElement {
   /**
-   * An empty array of export elements.
+   * An empty list of export elements.
    */
-  static final List<ExportElement> EMPTY_ARRAY = new List<ExportElement>(0);
+  static const List<ExportElement> EMPTY_ARRAY = const <ExportElement>[];
 
   /**
    * Return an array containing the combinators that were specified as part of the export directive
@@ -4528,7 +4728,8 @@
 /**
  * Instances of the class `ExportElementImpl` implement an [ExportElement].
  */
-class ExportElementImpl extends UriReferencedElementImpl implements ExportElement {
+class ExportElementImpl extends UriReferencedElementImpl implements
+    ExportElement {
   /**
    * The library that is exported from this library by this export directive.
    */
@@ -4546,19 +4747,19 @@
   ExportElementImpl() : super(null, -1);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitExportElement(this);
+  String get identifier => exportedLibrary.name;
 
   @override
   ElementKind get kind => ElementKind.EXPORT;
 
   @override
+  accept(ElementVisitor visitor) => visitor.visitExportElement(this);
+
+  @override
   void appendTo(StringBuffer buffer) {
     buffer.write("export ");
     (exportedLibrary as LibraryElementImpl).appendTo(buffer);
   }
-
-  @override
-  String get identifier => exportedLibrary.name;
 }
 
 /**
@@ -4580,7 +4781,8 @@
  * Instances of the class `ExternalHtmlScriptElementImpl` implement an
  * [ExternalHtmlScriptElement].
  */
-class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements ExternalHtmlScriptElement {
+class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements
+    ExternalHtmlScriptElement {
   /**
    * The source specified in the `source` attribute or `null` if unspecified.
    */
@@ -4594,34 +4796,30 @@
   ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitExternalHtmlScriptElement(this);
+  ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT;
 
   @override
-  ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT;
+  accept(ElementVisitor visitor) =>
+      visitor.visitExternalHtmlScriptElement(this);
 }
 
 /**
  * The interface `FieldElement` defines the behavior of elements representing a field defined
  * within a type.
  */
-abstract class FieldElement implements ClassMemberElement, PropertyInducingElement {
+abstract class FieldElement implements ClassMemberElement,
+    PropertyInducingElement {
 }
 
 /**
  * Instances of the class `FieldElementImpl` implement a `FieldElement`.
  */
-class FieldElementImpl extends PropertyInducingElementImpl implements FieldElement {
+class FieldElementImpl extends PropertyInducingElementImpl implements
+    FieldElement {
   /**
-   * An empty array of field elements.
+   * An empty list of field elements.
    */
-  static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0);
-
-  /**
-   * Initialize a newly created field element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  FieldElementImpl.forNode(Identifier name) : super.forNode(name);
+  static const List<FieldElement> EMPTY_ARRAY = const <FieldElement>[];
 
   /**
    * Initialize a newly created synthetic field element to have the given name.
@@ -4632,17 +4830,21 @@
    */
   FieldElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+  /**
+   * Initialize a newly created field element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  FieldElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
 
   @override
-  ElementKind get kind => ElementKind.FIELD;
+  bool get isStatic => hasModifier(Modifier.STATIC);
 
   @override
-  bool get isStatic => hasModifier(Modifier.STATIC);
+  ElementKind get kind => ElementKind.FIELD;
 
   /**
    * Set whether this field is static to correspond to the given value.
@@ -4652,6 +4854,9 @@
   void set static(bool isStatic) {
     setModifier(Modifier.STATIC, isStatic);
   }
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
 }
 
 /**
@@ -4673,7 +4878,8 @@
  * [ParameterElementImpl] to provide the additional information of the [FieldElement]
  * associated with the parameter.
  */
-class FieldFormalParameterElementImpl extends ParameterElementImpl implements FieldFormalParameterElement {
+class FieldFormalParameterElementImpl extends ParameterElementImpl implements
+    FieldFormalParameterElement {
   /**
    * The field associated with this field formal parameter.
    */
@@ -4687,27 +4893,28 @@
   FieldFormalParameterElementImpl(Identifier name) : super.forNode(name);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(this);
+  bool get isInitializingFormal => true;
 
   @override
-  bool get isInitializingFormal => true;
+  accept(ElementVisitor visitor) =>
+      visitor.visitFieldFormalParameterElement(this);
 }
 
 /**
  * Instances of the class `FieldFormalParameterMember` represent a parameter element defined
  * in a parameterized type where the values of the type parameters are known.
  */
-class FieldFormalParameterMember extends ParameterMember implements FieldFormalParameterElement {
+class FieldFormalParameterMember extends ParameterMember implements
+    FieldFormalParameterElement {
   /**
    * Initialize a newly created element to represent a parameter of the given parameterized type.
    *
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  FieldFormalParameterMember(FieldFormalParameterElement baseElement, ParameterizedType definingType) : super(baseElement, definingType);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(this);
+  FieldFormalParameterMember(FieldFormalParameterElement baseElement,
+      ParameterizedType definingType)
+      : super(baseElement, definingType);
 
   @override
   FieldElement get field {
@@ -4717,6 +4924,10 @@
     }
     return field;
   }
+
+  @override
+  accept(ElementVisitor visitor) =>
+      visitor.visitFieldFormalParameterElement(this);
 }
 
 /**
@@ -4725,6 +4936,44 @@
  */
 class FieldMember extends VariableMember implements FieldElement {
   /**
+   * Initialize a newly created element to represent a field of the given parameterized type.
+   *
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  FieldMember(FieldElement baseElement, InterfaceType definingType)
+      : super(baseElement, definingType);
+
+  @override
+  FieldElement get baseElement => super.baseElement as FieldElement;
+
+  @override
+  InterfaceType get definingType => super.definingType as InterfaceType;
+
+  @override
+  ClassElement get enclosingElement => baseElement.enclosingElement;
+
+  @override
+  PropertyAccessorElement get getter =>
+      PropertyAccessorMember.from(baseElement.getter, definingType);
+
+  @override
+  bool get isStatic => baseElement.isStatic;
+
+  @override
+  DartType get propagatedType => substituteFor(baseElement.propagatedType);
+
+  @override
+  PropertyAccessorElement get setter =>
+      PropertyAccessorMember.from(baseElement.setter, definingType);
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
+
+  @override
+  String toString() => '$type $displayName';
+
+  /**
    * If the given field's type is different when any type parameters from the defining type's
    * declaration are replaced with the actual type arguments from the defining type, create a field
    * member representing the given field. Return the member that was created, or the base field if
@@ -4739,8 +4988,9 @@
     if (!_isChangedByTypeSubstitution(baseField, definingType)) {
       return baseField;
     }
-    // TODO(brianwilkerson) Consider caching the substituted type in the instance. It would use more
-    // memory but speed up some operations. We need to see how often the type is being re-computed.
+    // TODO(brianwilkerson) Consider caching the substituted type in the
+    // instance. It would use more memory but speed up some operations.
+    // We need to see how often the type is being re-computed.
     return new FieldMember(baseField, definingType);
   }
 
@@ -4753,22 +5003,25 @@
    *          substitution
    * @return true if the type is changed by type substitution.
    */
-  static bool _isChangedByTypeSubstitution(FieldElement baseField, InterfaceType definingType) {
+  static bool _isChangedByTypeSubstitution(FieldElement baseField,
+      InterfaceType definingType) {
     List<DartType> argumentTypes = definingType.typeArguments;
     if (baseField != null && argumentTypes.length != 0) {
       DartType baseType = baseField.type;
       List<DartType> parameterTypes = definingType.element.type.typeArguments;
       if (baseType != null) {
-        DartType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
+        DartType substitutedType =
+            baseType.substitute2(argumentTypes, parameterTypes);
         if (baseType != substitutedType) {
           return true;
         }
       }
-      // If the field has a propagated type, then we need to check whether the propagated type
-      // needs substitution.
+      // If the field has a propagated type, then we need to check whether the
+      // propagated type needs substitution.
       DartType basePropagatedType = baseField.propagatedType;
       if (basePropagatedType != null) {
-        DartType substitutedPropagatedType = basePropagatedType.substitute2(argumentTypes, parameterTypes);
+        DartType substitutedPropagatedType =
+            basePropagatedType.substitute2(argumentTypes, parameterTypes);
         if (basePropagatedType != substitutedPropagatedType) {
           return true;
         }
@@ -4776,41 +5029,6 @@
     }
     return false;
   }
-
-  /**
-   * Initialize a newly created element to represent a field of the given parameterized type.
-   *
-   * @param baseElement the element on which the parameterized element was created
-   * @param definingType the type in which the element is defined
-   */
-  FieldMember(FieldElement baseElement, InterfaceType definingType) : super(baseElement, definingType);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
-
-  @override
-  FieldElement get baseElement => super.baseElement as FieldElement;
-
-  @override
-  ClassElement get enclosingElement => baseElement.enclosingElement;
-
-  @override
-  PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.getter, definingType);
-
-  @override
-  DartType get propagatedType => substituteFor(baseElement.propagatedType);
-
-  @override
-  PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.setter, definingType);
-
-  @override
-  bool get isStatic => baseElement.isStatic;
-
-  @override
-  String toString() => '$type $displayName';
-
-  @override
-  InterfaceType get definingType => super.definingType as InterfaceType;
 }
 
 /**
@@ -4850,7 +5068,13 @@
 /**
  * Instances of the class `FunctionElementImpl` implement a `FunctionElement`.
  */
-class FunctionElementImpl extends ExecutableElementImpl implements FunctionElement {
+class FunctionElementImpl extends ExecutableElementImpl implements
+    FunctionElement {
+  /**
+   * An empty list of function elements.
+   */
+  static const List<FunctionElement> EMPTY_ARRAY = const <FunctionElement>[];
+
   /**
    * The offset to the beginning of the visible range for this element.
    */
@@ -4863,9 +5087,13 @@
   int _visibleRangeLength = -1;
 
   /**
-   * An empty array of function elements.
+   * Initialize a newly created function element to have the given name and offset.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0);
+  FunctionElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
   /**
    * Initialize a newly created function element to have the given name.
@@ -4883,23 +5111,24 @@
    */
   FunctionElementImpl.forOffset(int nameOffset) : super("", nameOffset);
 
-  /**
-   * Initialize a newly created function element to have the given name and offset.
-   *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
-   */
-  FunctionElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  @override
+  String get identifier {
+    String identifier = super.identifier;
+    if (!isStatic) {
+      identifier += "@$nameOffset";
+    }
+    return identifier;
+  }
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
+  bool get isStatic => enclosingElement is CompilationUnitElement;
 
   @override
   ElementKind get kind => ElementKind.FUNCTION;
 
   @override
-  FunctionDeclaration get node => getNodeMatching((node) => node is FunctionDeclaration);
+  FunctionDeclaration get node =>
+      getNodeMatching((node) => node is FunctionDeclaration);
 
   @override
   SourceRange get visibleRange {
@@ -4910,7 +5139,16 @@
   }
 
   @override
-  bool get isStatic => enclosingElement is CompilationUnitElement;
+  accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
+
+  @override
+  void appendTo(StringBuffer buffer) {
+    String name = displayName;
+    if (name != null) {
+      buffer.write(name);
+    }
+    super.appendTo(buffer);
+  }
 
   /**
    * Set the visible range for this element to the range starting at the given offset with the given
@@ -4924,24 +5162,6 @@
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
-
-  @override
-  void appendTo(StringBuffer buffer) {
-    String name = displayName;
-    if (name != null) {
-      buffer.write(name);
-    }
-    super.appendTo(buffer);
-  }
-
-  @override
-  String get identifier {
-    String identifier = super.identifier;
-    if (!isStatic) {
-      identifier += "@$nameOffset";
-    }
-    return identifier;
-  }
 }
 
 /**
@@ -5057,6 +5277,10 @@
   @override
   bool isSubtypeOf(DartType type);
 
+  @override
+  FunctionType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes);
+
   /**
    * Return the type resulting from substituting the given arguments for this type's parameters.
    * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`.
@@ -5065,9 +5289,6 @@
    * @return the result of performing the substitution
    */
   FunctionType substitute3(List<DartType> argumentTypes);
-
-  @override
-  FunctionType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes);
 }
 
 /**
@@ -5128,7 +5349,14 @@
  * Instances of the class `FunctionTypeAliasElementImpl` implement a
  * `FunctionTypeAliasElement`.
  */
-class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAliasElement {
+class FunctionTypeAliasElementImpl extends ElementImpl implements
+    FunctionTypeAliasElement {
+  /**
+   * An empty array of type alias elements.
+   */
+  static List<FunctionTypeAliasElement> EMPTY_ARRAY =
+      new List<FunctionTypeAliasElement>(0);
+
   /**
    * An array containing all of the parameters defined by this type alias.
    */
@@ -5147,12 +5375,8 @@
   /**
    * An array containing all of the type parameters defined for this type.
    */
-  List<TypeParameterElement> _typeParameters = TypeParameterElementImpl.EMPTY_ARRAY;
-
-  /**
-   * An empty array of type alias elements.
-   */
-  static List<FunctionTypeAliasElement> EMPTY_ARRAY = new List<FunctionTypeAliasElement>(0);
+  List<TypeParameterElement> _typeParameters =
+      TypeParameterElementImpl.EMPTY_ARRAY;
 
   /**
    * Initialize a newly created type alias element to have the given name.
@@ -5161,7 +5385,8 @@
    * [nameOffset] the offset of the name of this element in the file that
    *    contains the declaration of this element
    */
-  FunctionTypeAliasElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  FunctionTypeAliasElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   /**
    * Initialize a newly created type alias element to have the given name.
@@ -5171,38 +5396,19 @@
   FunctionTypeAliasElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this);
-
-  @override
-  ElementImpl getChild(String identifier) {
-    for (VariableElement parameter in _parameters) {
-      if ((parameter as VariableElementImpl).identifier == identifier) {
-        return parameter as VariableElementImpl;
-      }
-    }
-    for (TypeParameterElement typeParameter in _typeParameters) {
-      if ((typeParameter as TypeParameterElementImpl).identifier == identifier) {
-        return typeParameter as TypeParameterElementImpl;
-      }
-    }
-    return null;
-  }
-
-  @override
-  CompilationUnitElement get enclosingElement => super.enclosingElement as CompilationUnitElement;
+  CompilationUnitElement get enclosingElement =>
+      super.enclosingElement as CompilationUnitElement;
 
   @override
   ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
 
   @override
-  FunctionTypeAlias get node => getNodeMatching((node) => node is FunctionTypeAlias);
+  FunctionTypeAlias get node =>
+      getNodeMatching((node) => node is FunctionTypeAlias);
 
   @override
   List<ParameterElement> get parameters => _parameters;
 
-  @override
-  List<TypeParameterElement> get typeParameters => _typeParameters;
-
   /**
    * Set the parameters defined by this type alias to the given parameters.
    *
@@ -5217,6 +5423,9 @@
     this._parameters = parameters;
   }
 
+  @override
+  List<TypeParameterElement> get typeParameters => _typeParameters;
+
   /**
    * Set the type parameters defined for this type to the given parameters.
    *
@@ -5229,6 +5438,58 @@
     this._typeParameters = typeParameters;
   }
 
+  @override
+  accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this);
+
+  @override
+  void appendTo(StringBuffer buffer) {
+    buffer.write("typedef ");
+    buffer.write(displayName);
+    int typeParameterCount = _typeParameters.length;
+    if (typeParameterCount > 0) {
+      buffer.write("<");
+      for (int i = 0; i < typeParameterCount; i++) {
+        if (i > 0) {
+          buffer.write(", ");
+        }
+        (_typeParameters[i] as TypeParameterElementImpl).appendTo(buffer);
+      }
+      buffer.write(">");
+    }
+    buffer.write("(");
+    int parameterCount = _parameters.length;
+    for (int i = 0; i < parameterCount; i++) {
+      if (i > 0) {
+        buffer.write(", ");
+      }
+      (_parameters[i] as ParameterElementImpl).appendTo(buffer);
+    }
+    buffer.write(")");
+    if (type != null) {
+      buffer.write(Element.RIGHT_ARROW);
+      buffer.write(type.returnType);
+    } else if (returnType != null) {
+      buffer.write(Element.RIGHT_ARROW);
+      buffer.write(returnType);
+    }
+  }
+
+  @override
+  ElementImpl getChild(String identifier) {
+    for (VariableElement parameter in _parameters) {
+      if ((parameter as VariableElementImpl).identifier == identifier) {
+        return parameter as VariableElementImpl;
+      }
+    }
+    for (TypeParameterElement typeParameter in _typeParameters) {
+      if ((typeParameter as TypeParameterElementImpl).identifier ==
+          identifier) {
+        return typeParameter as TypeParameterElementImpl;
+      }
+    }
+    return null;
+  }
+
   /**
    * Set the parameters defined by this type alias to the given parameters without becoming the
    * parent of the parameters. This should only be used by the [TypeResolverVisitor] when
@@ -5257,36 +5518,6 @@
     safelyVisitChildren(_parameters, visitor);
     safelyVisitChildren(_typeParameters, visitor);
   }
-
-  @override
-  void appendTo(StringBuffer buffer) {
-    buffer.write("typedef ");
-    buffer.write(displayName);
-    int typeParameterCount = _typeParameters.length;
-    if (typeParameterCount > 0) {
-      buffer.write("<");
-      for (int i = 0; i < typeParameterCount; i++) {
-        if (i > 0) {
-          buffer.write(", ");
-        }
-        (_typeParameters[i] as TypeParameterElementImpl).appendTo(buffer);
-      }
-      buffer.write(">");
-    }
-    buffer.write("(");
-    int parameterCount = _parameters.length;
-    for (int i = 0; i < parameterCount; i++) {
-      if (i > 0) {
-        buffer.write(", ");
-      }
-      (_parameters[i] as ParameterElementImpl).appendTo(buffer);
-    }
-    buffer.write(")");
-    if (type != null) {
-      buffer.write(Element.RIGHT_ARROW);
-      buffer.write(type.returnType);
-    }
-  }
 }
 
 /**
@@ -5295,36 +5526,6 @@
  */
 class FunctionTypeImpl extends TypeImpl implements FunctionType {
   /**
-   * Return `true` if all of the name/type pairs in the first map are equal to the
-   * corresponding name/type pairs in the second map. The maps are expected to iterate over their
-   * entries in the same order in which those entries were added to the map.
-   *
-   * @param firstTypes the first map of name/type pairs being compared
-   * @param secondTypes the second map of name/type pairs being compared
-   * @param visitedElementPairs a set of visited element pairs
-   * @return `true` if all of the name/type pairs in the first map are equal to the
-   *         corresponding name/type pairs in the second map
-   */
-  static bool _equals(Map<String, DartType> firstTypes, Map<String, DartType> secondTypes, Set<ElementPair> visitedElementPairs) {
-    if (secondTypes.length != firstTypes.length) {
-      return false;
-    }
-    Iterator<String> firstKeys = firstTypes.keys.iterator;
-    Iterator<String> secondKeys = secondTypes.keys.iterator;
-    while (firstKeys.moveNext() && secondKeys.moveNext()) {
-      String firstKey = firstKeys.current;
-      String secondKey = secondKeys.current;
-      TypeImpl firstType = firstTypes[firstKey];
-      TypeImpl secondType = secondTypes[secondKey];
-      if (firstKey != secondKey
-          || !firstType.internalEquals(secondType, visitedElementPairs)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
    * An array containing the actual types of the type arguments.
    */
   List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY;
@@ -5343,17 +5544,41 @@
    *
    * @param element the element representing the declaration of the function type
    */
-  FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, element == null ? null : element.name);
+  FunctionTypeImpl.con2(FunctionTypeAliasElement element)
+      : super(element, element == null ? null : element.name);
 
-  @override
-  bool operator ==(Object object) => internalEquals(object, new HashSet<ElementPair>());
+  /**
+   * @return the base parameter elements of this function element, not `null`.
+   */
+  List<ParameterElement> get baseParameters {
+    Element element = this.element;
+    if (element is ExecutableElement) {
+      return element.parameters;
+    } else {
+      return (element as FunctionTypeAliasElement).parameters;
+    }
+  }
+
+  /**
+   * Return the return type defined by this function's element.
+   *
+   * @return the return type defined by this function's element
+   */
+  DartType get baseReturnType {
+    Element element = this.element;
+    if (element is ExecutableElement) {
+      return element.returnType;
+    } else {
+      return (element as FunctionTypeAliasElement).returnType;
+    }
+  }
 
   @override
   String get displayName {
     String name = this.name;
     if (name == null || name.length == 0) {
-      // Function types have an empty name when they are defined implicitly by either a closure or
-      // as part of a parameter declaration.
+      // Function types have an empty name when they are defined implicitly by
+      // either a closure or as part of a parameter declaration.
       List<DartType> normalParameterTypes = this.normalParameterTypes;
       List<DartType> optionalParameterTypes = this.optionalParameterTypes;
       Map<String, DartType> namedParameterTypes = this.namedParameterTypes;
@@ -5420,111 +5645,6 @@
   }
 
   @override
-  Map<String, DartType> get namedParameterTypes {
-    LinkedHashMap<String, DartType> namedParameterTypes = new LinkedHashMap<String, DartType>();
-    List<ParameterElement> parameters = baseParameters;
-    if (parameters.length == 0) {
-      return namedParameterTypes;
-    }
-    List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typeParameters);
-    for (ParameterElement parameter in parameters) {
-      if (parameter.parameterKind == ParameterKind.NAMED) {
-        DartType type = parameter.type;
-        if (typeArguments.length != 0 && typeArguments.length == typeParameters.length) {
-          type = type.substitute2(typeArguments, typeParameters);
-        }
-        namedParameterTypes[parameter.name] = type;
-      }
-    }
-    return namedParameterTypes;
-  }
-
-  @override
-  List<DartType> get normalParameterTypes {
-    List<ParameterElement> parameters = baseParameters;
-    if (parameters.length == 0) {
-      return TypeImpl.EMPTY_ARRAY;
-    }
-    List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typeParameters);
-    List<DartType> types = new List<DartType>();
-    for (ParameterElement parameter in parameters) {
-      if (parameter.parameterKind == ParameterKind.REQUIRED) {
-        DartType type = parameter.type;
-        if (typeArguments.length != 0 && typeArguments.length == typeParameters.length) {
-          type = type.substitute2(typeArguments, typeParameters);
-        }
-        types.add(type);
-      }
-    }
-    return types;
-  }
-
-  @override
-  List<DartType> get optionalParameterTypes {
-    List<ParameterElement> parameters = baseParameters;
-    if (parameters.length == 0) {
-      return TypeImpl.EMPTY_ARRAY;
-    }
-    List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typeParameters);
-    List<DartType> types = new List<DartType>();
-    for (ParameterElement parameter in parameters) {
-      if (parameter.parameterKind == ParameterKind.POSITIONAL) {
-        DartType type = parameter.type;
-        if (typeArguments.length != 0 && typeArguments.length == typeParameters.length) {
-          type = type.substitute2(typeArguments, typeParameters);
-        }
-        types.add(type);
-      }
-    }
-    return types;
-  }
-
-  @override
-  List<ParameterElement> get parameters {
-    List<ParameterElement> baseParameters = this.baseParameters;
-    // no parameters, quick return
-    int parameterCount = baseParameters.length;
-    if (parameterCount == 0) {
-      return baseParameters;
-    }
-    // create specialized parameters
-    List<ParameterElement> specializedParameters = new List<ParameterElement>(parameterCount);
-    for (int i = 0; i < parameterCount; i++) {
-      specializedParameters[i] = ParameterMember.from(baseParameters[i], this);
-    }
-    return specializedParameters;
-  }
-
-  @override
-  DartType get returnType {
-    DartType baseReturnType = this.baseReturnType;
-    if (baseReturnType == null) {
-      // TODO(brianwilkerson) This is a patch. The return type should never be null and we need to
-      // understand why it is and fix it.
-      return DynamicTypeImpl.instance;
-    }
-    // If there are no arguments to substitute, or if the arguments size doesn't match the parameter
-    // size, return the base return type.
-    if (typeArguments.length == 0 || typeArguments.length != typeParameters.length) {
-      return baseReturnType;
-    }
-    return baseReturnType.substitute2(typeArguments, TypeParameterTypeImpl.getTypes(typeParameters));
-  }
-
-  @override
-  List<TypeParameterElement> get typeParameters {
-    Element element = this.element;
-    if (element is FunctionTypeAliasElement) {
-      return element.typeParameters;
-    }
-    ClassElement definingClass = element.getAncestor((element) => element is ClassElement);
-    if (definingClass != null) {
-      return definingClass.typeParameters;
-    }
-    return TypeParameterElementImpl.EMPTY_ARRAY;
-  }
-
-  @override
   int get hashCode {
     if (element == null) {
       return 0;
@@ -5548,139 +5668,127 @@
   }
 
   @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
-    // trivial base cases
-    if (type == null) {
-      return false;
-    } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunction || type.isObject) {
-      return true;
-    } else if (type is UnionType) {
-      return (type as UnionTypeImpl).internalUnionTypeIsLessSpecificThan(this, withDynamic, visitedTypePairs);
-    } else if (type is! FunctionType) {
-      return false;
-    } else if (this == type) {
-      return true;
+  Map<String, DartType> get namedParameterTypes {
+    LinkedHashMap<String, DartType> namedParameterTypes =
+        new LinkedHashMap<String, DartType>();
+    List<ParameterElement> parameters = baseParameters;
+    if (parameters.length == 0) {
+      return namedParameterTypes;
     }
-    FunctionType t = this;
-    FunctionType s = type as FunctionType;
-    List<DartType> tTypes = t.normalParameterTypes;
-    List<DartType> tOpTypes = t.optionalParameterTypes;
-    List<DartType> sTypes = s.normalParameterTypes;
-    List<DartType> sOpTypes = s.optionalParameterTypes;
-    // If one function has positional and the other has named parameters, return false.
-    if ((sOpTypes.length > 0 && t.namedParameterTypes.length > 0) || (tOpTypes.length > 0 && s.namedParameterTypes.length > 0)) {
-      return false;
-    }
-    // named parameters case
-    if (t.namedParameterTypes.length > 0) {
-      // check that the number of required parameters are equal, and check that every t_i is
-      // more specific than every s_i
-      if (t.normalParameterTypes.length != s.normalParameterTypes.length) {
-        return false;
-      } else if (t.normalParameterTypes.length > 0) {
-        for (int i = 0; i < tTypes.length; i++) {
-          if (!(tTypes[i] as TypeImpl).isMoreSpecificThan2(sTypes[i], withDynamic, visitedTypePairs)) {
-            return false;
-          }
+    List<DartType> typeParameters =
+        TypeParameterTypeImpl.getTypes(this.typeParameters);
+    for (ParameterElement parameter in parameters) {
+      if (parameter.parameterKind == ParameterKind.NAMED) {
+        DartType type = parameter.type;
+        if (typeArguments.length != 0 &&
+            typeArguments.length == typeParameters.length) {
+          type = type.substitute2(typeArguments, typeParameters);
         }
-      }
-      Map<String, DartType> namedTypesT = t.namedParameterTypes;
-      Map<String, DartType> namedTypesS = s.namedParameterTypes;
-      // if k >= m is false, return false: the passed function type has more named parameter types than this
-      if (namedTypesT.length < namedTypesS.length) {
-        return false;
-      }
-      // Loop through each element in S verifying that T has a matching
-      // parameter name and that the corresponding type is more specific then
-      // the type in S.
-      for (String keyS in namedTypesS.keys) {
-        DartType typeT = namedTypesT[keyS];
-        if (typeT == null) {
-          return false;
-        }
-        if (!(typeT as TypeImpl).isMoreSpecificThan2(namedTypesS[keyS], withDynamic, visitedTypePairs)) {
-          return false;
-        }
-      }
-    } else if (s.namedParameterTypes.length > 0) {
-      return false;
-    } else {
-      // positional parameter case
-      int tArgLength = tTypes.length + tOpTypes.length;
-      int sArgLength = sTypes.length + sOpTypes.length;
-      // Check that the total number of parameters in t is greater than or equal to the number of
-      // parameters in s and that the number of required parameters in s is greater than or equal to
-      // the number of required parameters in t.
-      if (tArgLength < sArgLength || sTypes.length < tTypes.length) {
-        return false;
-      }
-      if (tOpTypes.length == 0 && sOpTypes.length == 0) {
-        // No positional arguments, don't copy contents to new array
-        for (int i = 0; i < sTypes.length; i++) {
-          if (!(tTypes[i] as TypeImpl).isMoreSpecificThan2(sTypes[i], withDynamic, visitedTypePairs)) {
-            return false;
-          }
-        }
-      } else {
-        // Else, we do have positional parameters, copy required and positional parameter types into
-        // arrays to do the compare (for loop below).
-        List<DartType> tAllTypes = new List<DartType>(sArgLength);
-        for (int i = 0; i < tTypes.length; i++) {
-          tAllTypes[i] = tTypes[i];
-        }
-        for (int i = tTypes.length, j = 0; i < sArgLength; i++, j++) {
-          tAllTypes[i] = tOpTypes[j];
-        }
-        List<DartType> sAllTypes = new List<DartType>(sArgLength);
-        for (int i = 0; i < sTypes.length; i++) {
-          sAllTypes[i] = sTypes[i];
-        }
-        for (int i = sTypes.length, j = 0; i < sArgLength; i++, j++) {
-          sAllTypes[i] = sOpTypes[j];
-        }
-        for (int i = 0; i < sAllTypes.length; i++) {
-          if (!(tAllTypes[i] as TypeImpl).isMoreSpecificThan2(sAllTypes[i], withDynamic, visitedTypePairs)) {
-            return false;
-          }
-        }
+        namedParameterTypes[parameter.name] = type;
       }
     }
-    DartType tRetType = t.returnType;
-    DartType sRetType = s.returnType;
-    return sRetType.isVoid || (tRetType as TypeImpl).isMoreSpecificThan2(sRetType, withDynamic, visitedTypePairs);
+    return namedParameterTypes;
   }
 
-  /**
-   * Return `true` if this type is assignable to the given type. A function type <i>T</i> may
-   * be assigned to a function type <i>S</i>, written <i>T</i> &hArr; <i>S</i>, iff <i>T</i> <:
-   * <i>S</i> (Function Types section of spec). Note that this is more restrictive than the
-   * "may be assigned to" rule for interface types.
-   *
-   *
-   * @param type the type being compared with this type
-   * @return `true` if this type is assignable to the given type
-   */
   @override
-  bool isAssignableTo(DartType type) => isSubtypeOf2(type, new HashSet<TypeImpl_TypePair>());
+  List<DartType> get normalParameterTypes {
+    List<ParameterElement> parameters = baseParameters;
+    if (parameters.length == 0) {
+      return TypeImpl.EMPTY_ARRAY;
+    }
+    List<DartType> typeParameters =
+        TypeParameterTypeImpl.getTypes(this.typeParameters);
+    List<DartType> types = new List<DartType>();
+    for (ParameterElement parameter in parameters) {
+      if (parameter.parameterKind == ParameterKind.REQUIRED) {
+        DartType type = parameter.type;
+        if (typeArguments.length != 0 &&
+            typeArguments.length == typeParameters.length) {
+          type = type.substitute2(typeArguments, typeParameters);
+        }
+        types.add(type);
+      }
+    }
+    return types;
+  }
 
   @override
-  FunctionTypeImpl substitute3(List<DartType> argumentTypes) => substitute2(argumentTypes, typeArguments);
+  List<DartType> get optionalParameterTypes {
+    List<ParameterElement> parameters = baseParameters;
+    if (parameters.length == 0) {
+      return TypeImpl.EMPTY_ARRAY;
+    }
+    List<DartType> typeParameters =
+        TypeParameterTypeImpl.getTypes(this.typeParameters);
+    List<DartType> types = new List<DartType>();
+    for (ParameterElement parameter in parameters) {
+      if (parameter.parameterKind == ParameterKind.POSITIONAL) {
+        DartType type = parameter.type;
+        if (typeArguments.length != 0 &&
+            typeArguments.length == typeParameters.length) {
+          type = type.substitute2(typeArguments, typeParameters);
+        }
+        types.add(type);
+      }
+    }
+    return types;
+  }
 
   @override
-  FunctionTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    if (argumentTypes.length != parameterTypes.length) {
-      throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.length}) != parameterTypes.length (${parameterTypes.length})");
+  List<ParameterElement> get parameters {
+    List<ParameterElement> baseParameters = this.baseParameters;
+    // no parameters, quick return
+    int parameterCount = baseParameters.length;
+    if (parameterCount == 0) {
+      return baseParameters;
     }
-    if (argumentTypes.length == 0) {
-      return this;
+    // create specialized parameters
+    List<ParameterElement> specializedParameters =
+        new List<ParameterElement>(parameterCount);
+    for (int i = 0; i < parameterCount; i++) {
+      specializedParameters[i] = ParameterMember.from(baseParameters[i], this);
     }
+    return specializedParameters;
+  }
+
+  @override
+  DartType get returnType {
+    DartType baseReturnType = this.baseReturnType;
+    if (baseReturnType == null) {
+      // TODO(brianwilkerson) This is a patch. The return type should never be
+      // null and we need to understand why it is and fix it.
+      return DynamicTypeImpl.instance;
+    }
+    // If there are no arguments to substitute, or if the arguments size doesn't
+    // match the parameter size, return the base return type.
+    if (typeArguments.length == 0 ||
+        typeArguments.length != typeParameters.length) {
+      return baseReturnType;
+    }
+    return baseReturnType.substitute2(
+        typeArguments,
+        TypeParameterTypeImpl.getTypes(typeParameters));
+  }
+
+  @override
+  List<TypeParameterElement> get typeParameters {
     Element element = this.element;
-    FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionTypeImpl.con1(element) : new FunctionTypeImpl.con2(element as FunctionTypeAliasElement);
-    newType.typeArguments = TypeImpl.substitute(typeArguments, argumentTypes, parameterTypes);
-    return newType;
+    if (element is FunctionTypeAliasElement) {
+      return element.typeParameters;
+    }
+    ClassElement definingClass =
+        element.getAncestor((element) => element is ClassElement);
+    if (definingClass != null) {
+      return definingClass.typeParameters;
+    }
+    return TypeParameterElementImpl.EMPTY_ARRAY;
   }
 
   @override
+  bool operator ==(Object object) =>
+      internalEquals(object, new HashSet<ElementPair>());
+
+  @override
   void appendTo(StringBuffer buffer) {
     List<DartType> normalParameterTypes = this.normalParameterTypes;
     List<DartType> optionalParameterTypes = this.optionalParameterTypes;
@@ -5743,31 +5851,35 @@
     }
   }
 
-  /**
-   * @return the base parameter elements of this function element, not `null`.
-   */
-  List<ParameterElement> get baseParameters {
-    Element element = this.element;
-    if (element is ExecutableElement) {
-      return element.parameters;
-    } else {
-      return (element as FunctionTypeAliasElement).parameters;
-    }
-  }
-
   @override
   bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) {
     if (object is! FunctionTypeImpl) {
       return false;
     }
     FunctionTypeImpl otherType = object as FunctionTypeImpl;
-    // If the visitedTypePairs already has the pair (this, type), use the elements to determine equality
+    // If the visitedTypePairs already has the pair (this, type),
+    // use the elements to determine equality
     ElementPair elementPair = new ElementPair(element, otherType.element);
     if (!visitedElementPairs.add(elementPair)) {
       return elementPair.firstElt == elementPair.secondElt;
     }
     // Compute the result
-    bool result = TypeImpl.equalArrays(normalParameterTypes, otherType.normalParameterTypes, visitedElementPairs) && TypeImpl.equalArrays(optionalParameterTypes, otherType.optionalParameterTypes, visitedElementPairs) && _equals(namedParameterTypes, otherType.namedParameterTypes, visitedElementPairs) && (returnType as TypeImpl).internalEquals(otherType.returnType, visitedElementPairs);
+    bool result =
+        TypeImpl.equalArrays(
+            normalParameterTypes,
+            otherType.normalParameterTypes,
+            visitedElementPairs) &&
+        TypeImpl.equalArrays(
+            optionalParameterTypes,
+            otherType.optionalParameterTypes,
+            visitedElementPairs) &&
+        _equals(
+            namedParameterTypes,
+            otherType.namedParameterTypes,
+            visitedElementPairs) &&
+        (returnType as TypeImpl).internalEquals(
+            otherType.returnType,
+            visitedElementPairs);
     // Remove the pair from our visited pairs list
     visitedElementPairs.remove(elementPair);
     // Return the result
@@ -5775,14 +5887,21 @@
   }
 
   @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     // trivial base cases
     if (type == null) {
       return false;
-    } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunction || type.isObject) {
+    } else if (identical(this, type) ||
+        type.isDynamic ||
+        type.isDartCoreFunction ||
+        type.isObject) {
       return true;
     } else if (type is UnionType) {
-      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visitedTypePairs);
+      return (type as UnionTypeImpl).internalUnionTypeIsLessSpecificThan(
+          this,
+          withDynamic,
+          visitedTypePairs);
     } else if (type is! FunctionType) {
       return false;
     } else if (this == type) {
@@ -5794,26 +5913,162 @@
     List<DartType> tOpTypes = t.optionalParameterTypes;
     List<DartType> sTypes = s.normalParameterTypes;
     List<DartType> sOpTypes = s.optionalParameterTypes;
-    // If one function has positional and the other has named parameters, return false.
-    if ((sOpTypes.length > 0 && t.namedParameterTypes.length > 0) || (tOpTypes.length > 0 && s.namedParameterTypes.length > 0)) {
+    // If one function has positional and the other has named parameters,
+    // return false.
+    if ((sOpTypes.length > 0 && t.namedParameterTypes.length > 0) ||
+        (tOpTypes.length > 0 && s.namedParameterTypes.length > 0)) {
       return false;
     }
     // named parameters case
     if (t.namedParameterTypes.length > 0) {
-      // check that the number of required parameters are equal, and check that every t_i is
-      // assignable to every s_i
+      // check that the number of required parameters are equal, and check that
+      // every t_i is more specific than every s_i
       if (t.normalParameterTypes.length != s.normalParameterTypes.length) {
         return false;
       } else if (t.normalParameterTypes.length > 0) {
         for (int i = 0; i < tTypes.length; i++) {
-          if (!(tTypes[i] as TypeImpl).isAssignableTo2(sTypes[i], visitedTypePairs)) {
+          if (!(tTypes[i] as TypeImpl).isMoreSpecificThan2(
+              sTypes[i],
+              withDynamic,
+              visitedTypePairs)) {
             return false;
           }
         }
       }
       Map<String, DartType> namedTypesT = t.namedParameterTypes;
       Map<String, DartType> namedTypesS = s.namedParameterTypes;
-      // if k >= m is false, return false: the passed function type has more named parameter types than this
+      // if k >= m is false, return false: the passed function type has more
+      // named parameter types than this
+      if (namedTypesT.length < namedTypesS.length) {
+        return false;
+      }
+      // Loop through each element in S verifying that T has a matching
+      // parameter name and that the corresponding type is more specific then
+      // the type in S.
+      for (String keyS in namedTypesS.keys) {
+        DartType typeT = namedTypesT[keyS];
+        if (typeT == null) {
+          return false;
+        }
+        if (!(typeT as TypeImpl).isMoreSpecificThan2(
+            namedTypesS[keyS],
+            withDynamic,
+            visitedTypePairs)) {
+          return false;
+        }
+      }
+    } else if (s.namedParameterTypes.length > 0) {
+      return false;
+    } else {
+      // positional parameter case
+      int tArgLength = tTypes.length + tOpTypes.length;
+      int sArgLength = sTypes.length + sOpTypes.length;
+      // Check that the total number of parameters in t is greater than or equal
+      // to the number of parameters in s and that the number of required
+      // parameters in s is greater than or equal to the number of required
+      // parameters in t.
+      if (tArgLength < sArgLength || sTypes.length < tTypes.length) {
+        return false;
+      }
+      if (tOpTypes.length == 0 && sOpTypes.length == 0) {
+        // No positional arguments, don't copy contents to new array
+        for (int i = 0; i < sTypes.length; i++) {
+          if (!(tTypes[i] as TypeImpl).isMoreSpecificThan2(
+              sTypes[i],
+              withDynamic,
+              visitedTypePairs)) {
+            return false;
+          }
+        }
+      } else {
+        // Else, we do have positional parameters, copy required and positional
+        // parameter types into arrays to do the compare (for loop below).
+        List<DartType> tAllTypes = new List<DartType>(sArgLength);
+        for (int i = 0; i < tTypes.length; i++) {
+          tAllTypes[i] = tTypes[i];
+        }
+        for (int i = tTypes.length,
+            j = 0; i < sArgLength; i++, j++) {
+          tAllTypes[i] = tOpTypes[j];
+        }
+        List<DartType> sAllTypes = new List<DartType>(sArgLength);
+        for (int i = 0; i < sTypes.length; i++) {
+          sAllTypes[i] = sTypes[i];
+        }
+        for (int i = sTypes.length,
+            j = 0; i < sArgLength; i++, j++) {
+          sAllTypes[i] = sOpTypes[j];
+        }
+        for (int i = 0; i < sAllTypes.length; i++) {
+          if (!(tAllTypes[i] as TypeImpl).isMoreSpecificThan2(
+              sAllTypes[i],
+              withDynamic,
+              visitedTypePairs)) {
+            return false;
+          }
+        }
+      }
+    }
+    DartType tRetType = t.returnType;
+    DartType sRetType = s.returnType;
+    return sRetType.isVoid ||
+        (tRetType as TypeImpl).isMoreSpecificThan2(
+            sRetType,
+            withDynamic,
+            visitedTypePairs);
+  }
+
+  @override
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    // trivial base cases
+    if (type == null) {
+      return false;
+    } else if (identical(this, type) ||
+        type.isDynamic ||
+        type.isDartCoreFunction ||
+        type.isObject) {
+      return true;
+    } else if (type is UnionType) {
+      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(
+          this,
+          visitedTypePairs);
+    } else if (type is! FunctionType) {
+      return false;
+    } else if (this == type) {
+      return true;
+    }
+    FunctionType t = this;
+    FunctionType s = type as FunctionType;
+    List<DartType> tTypes = t.normalParameterTypes;
+    List<DartType> tOpTypes = t.optionalParameterTypes;
+    List<DartType> sTypes = s.normalParameterTypes;
+    List<DartType> sOpTypes = s.optionalParameterTypes;
+    // If one function has positional and the other has named parameters,
+    // return false.
+    if ((sOpTypes.length > 0 && t.namedParameterTypes.length > 0) ||
+        (tOpTypes.length > 0 && s.namedParameterTypes.length > 0)) {
+      return false;
+    }
+    // named parameters case
+    if (t.namedParameterTypes.length > 0) {
+      // check that the number of required parameters are equal,
+      // and check that every t_i is assignable to every s_i
+      if (t.normalParameterTypes.length != s.normalParameterTypes.length) {
+        return false;
+      } else if (t.normalParameterTypes.length > 0) {
+        for (int i = 0; i < tTypes.length; i++) {
+          if (!(tTypes[i] as TypeImpl).isAssignableTo2(
+              sTypes[i],
+              visitedTypePairs)) {
+            return false;
+          }
+        }
+      }
+      Map<String, DartType> namedTypesT = t.namedParameterTypes;
+      Map<String, DartType> namedTypesS = s.namedParameterTypes;
+      // if k >= m is false, return false: the passed function type has more
+      // named parameter types than this
       if (namedTypesT.length < namedTypesS.length) {
         return false;
       }
@@ -5825,7 +6080,9 @@
         if (typeT == null) {
           return false;
         }
-        if (!(typeT as TypeImpl).isAssignableTo2(namedTypesS[keyS], visitedTypePairs)) {
+        if (!(typeT as TypeImpl).isAssignableTo2(
+            namedTypesS[keyS],
+            visitedTypePairs)) {
           return false;
         }
       }
@@ -5835,38 +6092,45 @@
       // positional parameter case
       int tArgLength = tTypes.length + tOpTypes.length;
       int sArgLength = sTypes.length + sOpTypes.length;
-      // Check that the total number of parameters in t is greater than or equal to the number of
-      // parameters in s and that the number of required parameters in s is greater than or equal to
-      // the number of required parameters in t.
+      // Check that the total number of parameters in t is greater than or equal
+      // to the number of parameters in s and that the number of required
+      // parameters in s is greater than or equal to the number of required
+      // parameters in t.
       if (tArgLength < sArgLength || sTypes.length < tTypes.length) {
         return false;
       }
       if (tOpTypes.length == 0 && sOpTypes.length == 0) {
         // No positional arguments, don't copy contents to new array
         for (int i = 0; i < sTypes.length; i++) {
-          if (!(tTypes[i] as TypeImpl).isAssignableTo2(sTypes[i], visitedTypePairs)) {
+          if (!(tTypes[i] as TypeImpl).isAssignableTo2(
+              sTypes[i],
+              visitedTypePairs)) {
             return false;
           }
         }
       } else {
-        // Else, we do have positional parameters, copy required and positional parameter types into
-        // arrays to do the compare (for loop below).
+        // Else, we do have positional parameters, copy required and positional
+        // parameter types into arrays to do the compare (for loop below).
         List<DartType> tAllTypes = new List<DartType>(sArgLength);
         for (int i = 0; i < tTypes.length; i++) {
           tAllTypes[i] = tTypes[i];
         }
-        for (int i = tTypes.length, j = 0; i < sArgLength; i++, j++) {
+        for (int i = tTypes.length,
+            j = 0; i < sArgLength; i++, j++) {
           tAllTypes[i] = tOpTypes[j];
         }
         List<DartType> sAllTypes = new List<DartType>(sArgLength);
         for (int i = 0; i < sTypes.length; i++) {
           sAllTypes[i] = sTypes[i];
         }
-        for (int i = sTypes.length, j = 0; i < sArgLength; i++, j++) {
+        for (int i = sTypes.length,
+            j = 0; i < sArgLength; i++, j++) {
           sAllTypes[i] = sOpTypes[j];
         }
         for (int i = 0; i < sAllTypes.length; i++) {
-          if (!(tAllTypes[i] as TypeImpl).isAssignableTo2(sAllTypes[i], visitedTypePairs)) {
+          if (!(tAllTypes[i] as TypeImpl).isAssignableTo2(
+              sAllTypes[i],
+              visitedTypePairs)) {
             return false;
           }
         }
@@ -5874,21 +6138,76 @@
     }
     DartType tRetType = t.returnType;
     DartType sRetType = s.returnType;
-    return sRetType.isVoid || (tRetType as TypeImpl).isAssignableTo2(sRetType, visitedTypePairs);
+    return sRetType.isVoid ||
+        (tRetType as TypeImpl).isAssignableTo2(sRetType, visitedTypePairs);
   }
 
   /**
-   * Return the return type defined by this function's element.
+   * Return `true` if this type is assignable to the given type. A function type <i>T</i> may
+   * be assigned to a function type <i>S</i>, written <i>T</i> &hArr; <i>S</i>, iff <i>T</i> <:
+   * <i>S</i> (Function Types section of spec). Note that this is more restrictive than the
+   * "may be assigned to" rule for interface types.
    *
-   * @return the return type defined by this function's element
+   *
+   * @param type the type being compared with this type
+   * @return `true` if this type is assignable to the given type
    */
-  DartType get baseReturnType {
-    Element element = this.element;
-    if (element is ExecutableElement) {
-      return element.returnType;
-    } else {
-      return (element as FunctionTypeAliasElement).returnType;
+  @override
+  bool isAssignableTo(DartType type) =>
+      isSubtypeOf2(type, new HashSet<TypeImpl_TypePair>());
+
+  @override
+  FunctionTypeImpl substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
+    if (argumentTypes.length != parameterTypes.length) {
+      throw new IllegalArgumentException(
+          "argumentTypes.length (${argumentTypes.length}) != parameterTypes.length (${parameterTypes.length})");
     }
+    if (argumentTypes.length == 0) {
+      return this;
+    }
+    Element element = this.element;
+    FunctionTypeImpl newType = (element is ExecutableElement) ?
+        new FunctionTypeImpl.con1(element) :
+        new FunctionTypeImpl.con2(element as FunctionTypeAliasElement);
+    newType.typeArguments =
+        TypeImpl.substitute(typeArguments, argumentTypes, parameterTypes);
+    return newType;
+  }
+
+  @override
+  FunctionTypeImpl substitute3(List<DartType> argumentTypes) =>
+      substitute2(argumentTypes, typeArguments);
+
+  /**
+   * Return `true` if all of the name/type pairs in the first map are equal to the
+   * corresponding name/type pairs in the second map. The maps are expected to iterate over their
+   * entries in the same order in which those entries were added to the map.
+   *
+   * @param firstTypes the first map of name/type pairs being compared
+   * @param secondTypes the second map of name/type pairs being compared
+   * @param visitedElementPairs a set of visited element pairs
+   * @return `true` if all of the name/type pairs in the first map are equal to the
+   *         corresponding name/type pairs in the second map
+   */
+  static bool _equals(Map<String, DartType> firstTypes, Map<String,
+      DartType> secondTypes, Set<ElementPair> visitedElementPairs) {
+    if (secondTypes.length != firstTypes.length) {
+      return false;
+    }
+    Iterator<String> firstKeys = firstTypes.keys.iterator;
+    Iterator<String> secondKeys = secondTypes.keys.iterator;
+    while (firstKeys.moveNext() && secondKeys.moveNext()) {
+      String firstKey = firstKeys.current;
+      String secondKey = secondKeys.current;
+      TypeImpl firstType = firstTypes[firstKey];
+      TypeImpl secondType = secondTypes[secondKey];
+      if (firstKey != secondKey ||
+          !firstType.internalEquals(secondType, visitedElementPairs)) {
+        return false;
+      }
+    }
+    return true;
   }
 }
 
@@ -5949,41 +6268,53 @@
  */
 class GeneralizingElementVisitor<R> implements ElementVisitor<R> {
   @override
-  R visitAngularComponentElement(AngularComponentElement element) => visitAngularHasSelectorElement(element);
+  R visitAngularComponentElement(AngularComponentElement element) =>
+      visitAngularHasSelectorElement(element);
 
   @override
-  R visitAngularControllerElement(AngularControllerElement element) => visitAngularHasSelectorElement(element);
+  R visitAngularControllerElement(AngularControllerElement element) =>
+      visitAngularHasSelectorElement(element);
 
   @override
-  R visitAngularDirectiveElement(AngularDecoratorElement element) => visitAngularHasSelectorElement(element);
+  R visitAngularDirectiveElement(AngularDecoratorElement element) =>
+      visitAngularHasSelectorElement(element);
 
-  R visitAngularElement(AngularElement element) => visitToolkitObjectElement(element);
+  R visitAngularElement(AngularElement element) =>
+      visitToolkitObjectElement(element);
 
   @override
-  R visitAngularFormatterElement(AngularFormatterElement element) => visitAngularElement(element);
+  R visitAngularFormatterElement(AngularFormatterElement element) =>
+      visitAngularElement(element);
 
-  R visitAngularHasSelectorElement(AngularHasSelectorElement element) => visitAngularElement(element);
+  R visitAngularHasSelectorElement(AngularHasSelectorElement element) =>
+      visitAngularElement(element);
 
   @override
-  R visitAngularPropertyElement(AngularPropertyElement element) => visitAngularElement(element);
+  R visitAngularPropertyElement(AngularPropertyElement element) =>
+      visitAngularElement(element);
 
   @override
-  R visitAngularScopePropertyElement(AngularScopePropertyElement element) => visitAngularElement(element);
+  R visitAngularScopePropertyElement(AngularScopePropertyElement element) =>
+      visitAngularElement(element);
 
   @override
-  R visitAngularSelectorElement(AngularSelectorElement element) => visitAngularElement(element);
+  R visitAngularSelectorElement(AngularSelectorElement element) =>
+      visitAngularElement(element);
 
   @override
-  R visitAngularViewElement(AngularViewElement element) => visitAngularElement(element);
+  R visitAngularViewElement(AngularViewElement element) =>
+      visitAngularElement(element);
 
   @override
   R visitClassElement(ClassElement element) => visitElement(element);
 
   @override
-  R visitCompilationUnitElement(CompilationUnitElement element) => visitElement(element);
+  R visitCompilationUnitElement(CompilationUnitElement element) =>
+      visitElement(element);
 
   @override
-  R visitConstructorElement(ConstructorElement element) => visitExecutableElement(element);
+  R visitConstructorElement(ConstructorElement element) =>
+      visitExecutableElement(element);
 
   R visitElement(Element element) {
     element.visitChildren(this);
@@ -5991,7 +6322,8 @@
   }
 
   @override
-  R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => visitHtmlScriptElement(element);
+  R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) =>
+      visitHtmlScriptElement(element);
 
   R visitExecutableElement(ExecutableElement element) => visitElement(element);
 
@@ -5999,19 +6331,23 @@
   R visitExportElement(ExportElement element) => visitElement(element);
 
   @override
-  R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHtmlScriptElement(element);
+  R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) =>
+      visitHtmlScriptElement(element);
 
   @override
-  R visitFieldElement(FieldElement element) => visitPropertyInducingElement(element);
+  R visitFieldElement(FieldElement element) =>
+      visitPropertyInducingElement(element);
 
   @override
-  R visitFieldFormalParameterElement(FieldFormalParameterElement element) => visitParameterElement(element);
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element) =>
+      visitParameterElement(element);
 
   @override
   R visitFunctionElement(FunctionElement element) => visitLocalElement(element);
 
   @override
-  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElement(element);
+  R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) =>
+      visitElement(element);
 
   @override
   R visitHtmlElement(HtmlElement element) => visitElement(element);
@@ -6039,43 +6375,56 @@
   }
 
   @override
-  R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement(element);
+  R visitLocalVariableElement(LocalVariableElement element) =>
+      visitLocalElement(element);
 
   @override
-  R visitMethodElement(MethodElement element) => visitExecutableElement(element);
+  R visitMethodElement(MethodElement element) =>
+      visitExecutableElement(element);
 
   @override
-  R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement(element);
+  R visitMultiplyDefinedElement(MultiplyDefinedElement element) =>
+      visitElement(element);
 
   @override
-  R visitParameterElement(ParameterElement element) => visitLocalElement(element);
+  R visitParameterElement(ParameterElement element) =>
+      visitLocalElement(element);
 
   @override
-  R visitPolymerAttributeElement(PolymerAttributeElement element) => visitPolymerElement(element);
+  R visitPolymerAttributeElement(PolymerAttributeElement element) =>
+      visitPolymerElement(element);
 
-  R visitPolymerElement(PolymerElement element) => visitToolkitObjectElement(element);
+  R visitPolymerElement(PolymerElement element) =>
+      visitToolkitObjectElement(element);
 
   @override
-  R visitPolymerTagDartElement(PolymerTagDartElement element) => visitPolymerElement(element);
+  R visitPolymerTagDartElement(PolymerTagDartElement element) =>
+      visitPolymerElement(element);
 
   @override
-  R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) => visitPolymerElement(element);
+  R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) =>
+      visitPolymerElement(element);
 
   @override
   R visitPrefixElement(PrefixElement element) => visitElement(element);
 
   @override
-  R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecutableElement(element);
+  R visitPropertyAccessorElement(PropertyAccessorElement element) =>
+      visitExecutableElement(element);
 
-  R visitPropertyInducingElement(PropertyInducingElement element) => visitVariableElement(element);
+  R visitPropertyInducingElement(PropertyInducingElement element) =>
+      visitVariableElement(element);
 
-  R visitToolkitObjectElement(ToolkitObjectElement element) => visitElement(element);
+  R visitToolkitObjectElement(ToolkitObjectElement element) =>
+      visitElement(element);
 
   @override
-  R visitTopLevelVariableElement(TopLevelVariableElement element) => visitPropertyInducingElement(element);
+  R visitTopLevelVariableElement(TopLevelVariableElement element) =>
+      visitPropertyInducingElement(element);
 
   @override
-  R visitTypeParameterElement(TypeParameterElement element) => visitElement(element);
+  R visitTypeParameterElement(TypeParameterElement element) =>
+      visitElement(element);
 
   R visitVariableElement(VariableElement element) => visitElement(element);
 }
@@ -6083,14 +6432,10 @@
 /**
  * Implementation of [AngularSelectorElement] based on presence of attribute.
  */
-class HasAttributeSelectorElementImpl extends AngularSelectorElementImpl implements AngularHasAttributeSelectorElement {
-  HasAttributeSelectorElementImpl(String attributeName, int offset) : super(attributeName, offset);
-
-  @override
-  bool apply(XmlTagNode node) {
-    String attributeName = name;
-    return node.getAttribute(attributeName) != null;
-  }
+class HasAttributeSelectorElementImpl extends AngularSelectorElementImpl
+    implements AngularHasAttributeSelectorElement {
+  HasAttributeSelectorElementImpl(String attributeName, int offset)
+      : super(attributeName, offset);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -6098,6 +6443,12 @@
     buffer.write(name);
     buffer.write("]");
   }
+
+  @override
+  bool apply(XmlTagNode node) {
+    String attributeName = name;
+    return node.getAttribute(attributeName) != null;
+  }
 }
 
 /**
@@ -6173,9 +6524,9 @@
  */
 class HtmlElementImpl extends ElementImpl implements HtmlElement {
   /**
-   * An empty array of HTML file elements.
+   * An empty list of HTML file elements.
    */
-  static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0);
+  static const List<HtmlElement> EMPTY_ARRAY = const <HtmlElement>[];
 
   /**
    * The analysis context in which this library is defined.
@@ -6212,18 +6563,10 @@
   HtmlElementImpl(this.context, String name) : super(name, -1);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitHtmlElement(this);
+  int get hashCode => source.hashCode;
 
   @override
-  bool operator ==(Object object) {
-    if (identical(object, this)) {
-      return true;
-    }
-    if (object == null) {
-      return false;
-    }
-    return runtimeType == object.runtimeType && source == (object as HtmlElementImpl).source;
-  }
+  String get identifier => source.encoding;
 
   @override
   ElementKind get kind => ElementKind.HTML;
@@ -6231,12 +6574,6 @@
   @override
   List<PolymerTagHtmlElement> get polymerTags => _polymerTags;
 
-  @override
-  List<HtmlScriptElement> get scripts => _scripts;
-
-  @override
-  int get hashCode => source.hashCode;
-
   /**
    * Set the [PolymerTagHtmlElement]s defined in the HTML file.
    */
@@ -6251,6 +6588,9 @@
     this._polymerTags = polymerTags;
   }
 
+  @override
+  List<HtmlScriptElement> get scripts => _scripts;
+
   /**
    * Set the scripts contained in the HTML file to the given scripts.
    *
@@ -6268,13 +6608,21 @@
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(_scripts, visitor);
-    safelyVisitChildren(_polymerTags, visitor);
+  bool operator ==(Object object) {
+    if (identical(object, this)) {
+      return true;
+    }
+    if (object == null) {
+      return false;
+    }
+    return runtimeType == object.runtimeType &&
+        source == (object as HtmlElementImpl).source;
   }
 
   @override
+  accept(ElementVisitor visitor) => visitor.visitHtmlElement(this);
+
+  @override
   void appendTo(StringBuffer buffer) {
     if (source == null) {
       buffer.write("{HTML file}");
@@ -6284,7 +6632,11 @@
   }
 
   @override
-  String get identifier => source.encoding;
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(_scripts, visitor);
+    safelyVisitChildren(_polymerTags, visitor);
+  }
 }
 
 /**
@@ -6299,18 +6651,21 @@
 /**
  * Instances of the class `HtmlScriptElementImpl` implement an [HtmlScriptElement].
  */
-abstract class HtmlScriptElementImpl extends ElementImpl implements HtmlScriptElement {
+abstract class HtmlScriptElementImpl extends ElementImpl implements
+    HtmlScriptElement {
   /**
-   * An empty array of HTML script elements.
+   * An empty list of HTML script elements.
    */
-  static List<HtmlScriptElement> EMPTY_ARRAY = new List<HtmlScriptElement>(0);
+  static const List<HtmlScriptElement> EMPTY_ARRAY = const <HtmlScriptElement>[
+      ];
 
   /**
    * Initialize a newly created script element to have the specified tag name and offset.
    *
    * @param node the XML node from which this element is derived (not `null`)
    */
-  HtmlScriptElementImpl(XmlTagNode node) : super(node.tag, node.tagToken.offset);
+  HtmlScriptElementImpl(XmlTagNode node)
+      : super(node.tag, node.tagToken.offset);
 }
 
 /**
@@ -6319,9 +6674,9 @@
  */
 abstract class ImportElement implements Element, UriReferencedElement {
   /**
-   * An empty array of import elements.
+   * An empty list of import elements.
    */
-  static final List<ImportElement> EMPTY_ARRAY = new List<ImportElement>(0);
+  static const List<ImportElement> EMPTY_ARRAY = const <ImportElement>[];
 
   /**
    * Return an array containing the combinators that were specified as part of the import directive
@@ -6339,6 +6694,13 @@
   LibraryElement get importedLibrary;
 
   /**
+   * Return `true` if this import is for a deferred library.
+   *
+   * @return `true` if this import is for a deferred library
+   */
+  bool get isDeferred;
+
+  /**
    * Return the prefix that was specified as part of the import directive, or `null` if there
    * was no prefix specified.
    *
@@ -6354,19 +6716,13 @@
    * @return the offset of the prefix of this import
    */
   int get prefixOffset;
-
-  /**
-   * Return `true` if this import is for a deferred library.
-   *
-   * @return `true` if this import is for a deferred library
-   */
-  bool get isDeferred;
 }
 
 /**
  * Instances of the class `ImportElementImpl` implement an [ImportElement].
  */
-class ImportElementImpl extends UriReferencedElementImpl implements ImportElement {
+class ImportElementImpl extends UriReferencedElementImpl implements
+    ImportElement {
   /**
    * The offset of the prefix of this import in the file that contains the this import directive, or
    * `-1` if this import is synthetic.
@@ -6397,15 +6753,6 @@
    */
   ImportElementImpl(int offset) : super(null, offset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitImportElement(this);
-
-  @override
-  ElementKind get kind => ElementKind.IMPORT;
-
-  @override
-  bool get isDeferred => hasModifier(Modifier.DEFERRED);
-
   /**
    * Set whether this import is for a deferred library to correspond to the given value.
    *
@@ -6416,10 +6763,17 @@
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(prefix, visitor);
-  }
+  String get identifier =>
+      "${(importedLibrary as LibraryElementImpl).identifier}@$nameOffset";
+
+  @override
+  bool get isDeferred => hasModifier(Modifier.DEFERRED);
+
+  @override
+  ElementKind get kind => ElementKind.IMPORT;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitImportElement(this);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -6428,7 +6782,10 @@
   }
 
   @override
-  String get identifier => "${(importedLibrary as LibraryElementImpl).identifier}@$nameOffset";
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(prefix, visitor);
+  }
 }
 
 /**
@@ -6437,9 +6794,9 @@
  */
 abstract class InterfaceType implements ParameterizedType {
   /**
-   * An empty array of types.
+   * An empty list of types.
    */
-  static final List<InterfaceType> EMPTY_ARRAY = new List<InterfaceType>(0);
+  static const List<InterfaceType> EMPTY_ARRAY = const <InterfaceType>[];
 
   /**
    * Return an array containing all of the accessors (getters and setters) declared in this type.
@@ -6452,15 +6809,6 @@
   ClassElement get element;
 
   /**
-   * Return the element representing the getter with the given name that is declared in this class,
-   * or `null` if this class does not declare a getter with the given name.
-   *
-   * @param getterName the name of the getter to be returned
-   * @return the getter declared in this class with the given name
-   */
-  PropertyAccessorElement getGetter(String getterName);
-
-  /**
    * Return an array containing all of the interfaces that are implemented by this interface. Note
    * that this is <b>not</b>, in general, equivalent to getting the interfaces from this type's
    * element because the types returned by this method will have had their type parameters replaced.
@@ -6470,6 +6818,42 @@
   List<InterfaceType> get interfaces;
 
   /**
+   * Return an array containing all of the methods declared in this type.
+   *
+   * @return the methods declared in this type
+   */
+  List<MethodElement> get methods;
+
+  /**
+   * Return an array containing all of the mixins that are applied to the class being extended in
+   * order to derive the superclass of this class. Note that this is <b>not</b>, in general,
+   * equivalent to getting the mixins from this type's element because the types returned by this
+   * method will have had their type parameters replaced.
+   *
+   * @return the mixins that are applied to derive the superclass of this class
+   */
+  List<InterfaceType> get mixins;
+
+  /**
+   * Return the type representing the superclass of this type, or null if this type represents the
+   * class 'Object'. Note that this is <b>not</b>, in general, equivalent to getting the superclass
+   * from this type's element because the type returned by this method will have had it's type
+   * parameters replaced.
+   *
+   * @return the superclass of this type
+   */
+  InterfaceType get superclass;
+
+  /**
+   * Return the element representing the getter with the given name that is declared in this class,
+   * or `null` if this class does not declare a getter with the given name.
+   *
+   * @param getterName the name of the getter to be returned
+   * @return the getter declared in this class with the given name
+   */
+  PropertyAccessorElement getGetter(String getterName);
+
+  /**
    * Return the least upper bound of this type and the given type, or `null` if there is no
    * least upper bound.
    *
@@ -6498,23 +6882,6 @@
   MethodElement getMethod(String methodName);
 
   /**
-   * Return an array containing all of the methods declared in this type.
-   *
-   * @return the methods declared in this type
-   */
-  List<MethodElement> get methods;
-
-  /**
-   * Return an array containing all of the mixins that are applied to the class being extended in
-   * order to derive the superclass of this class. Note that this is <b>not</b>, in general,
-   * equivalent to getting the mixins from this type's element because the types returned by this
-   * method will have had their type parameters replaced.
-   *
-   * @return the mixins that are applied to derive the superclass of this class
-   */
-  List<InterfaceType> get mixins;
-
-  /**
    * Return the element representing the setter with the given name that is declared in this class,
    * or `null` if this class does not declare a setter with the given name.
    *
@@ -6524,16 +6891,6 @@
   PropertyAccessorElement getSetter(String setterName);
 
   /**
-   * Return the type representing the superclass of this type, or null if this type represents the
-   * class 'Object'. Note that this is <b>not</b>, in general, equivalent to getting the superclass
-   * from this type's element because the type returned by this method will have had it's type
-   * parameters replaced.
-   *
-   * @return the superclass of this type
-   */
-  InterfaceType get superclass;
-
-  /**
    * Return `true` if this type is a direct supertype of the given type. The implicit
    * interface of class <i>I</i> is a direct supertype of the implicit interface of class <i>J</i>
    * iff:
@@ -6594,7 +6951,8 @@
    * @return the result of looking up the given constructor in this class with respect to the given
    *         library
    */
-  ConstructorElement lookUpConstructor(String constructorName, LibraryElement library);
+  ConstructorElement lookUpConstructor(String constructorName,
+      LibraryElement library);
 
   /**
    * Return the element representing the getter that results from looking up the given getter in
@@ -6614,7 +6972,8 @@
    * @return the result of looking up the given getter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library);
+  PropertyAccessorElement lookUpGetter(String getterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the getter that results from looking up the given getter in the
@@ -6634,7 +6993,8 @@
    * @return the result of looking up the given getter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryElement library);
+  PropertyAccessorElement lookUpGetterInSuperclass(String getterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the method that results from looking up the given method in
@@ -6672,7 +7032,8 @@
    * @return the result of looking up the given method in this class with respect to the given
    *         library
    */
-  MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement library);
+  MethodElement lookUpMethodInSuperclass(String methodName,
+      LibraryElement library);
 
   /**
    * Return the element representing the setter that results from looking up the given setter in
@@ -6692,7 +7053,8 @@
    * @return the result of looking up the given setter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library);
+  PropertyAccessorElement lookUpSetter(String setterName,
+      LibraryElement library);
 
   /**
    * Return the element representing the setter that results from looking up the given setter in the
@@ -6712,7 +7074,12 @@
    * @return the result of looking up the given setter in this class with respect to the given
    *         library
    */
-  PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryElement library);
+  PropertyAccessorElement lookUpSetterInSuperclass(String setterName,
+      LibraryElement library);
+
+  @override
+  InterfaceType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes);
 
   /**
    * Return the type resulting from substituting the given arguments for this
@@ -6721,134 +7088,40 @@
    */
   InterfaceType substitute4(List<DartType> argumentTypes);
 
-  @override
-  InterfaceType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes);
-}
-
-/**
- * Instances of the class `InterfaceTypeImpl` defines the behavior common to objects
- * representing the type introduced by either a class or an interface, or a reference to such a
- * type.
- */
-class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
   /**
-   * This method computes the longest inheritance path from some passed [Type] to Object.
+   * Returns a "smart" version of the "least upper bound" of the given types.
    *
-   * @param type the [Type] to compute the longest inheritance path of from the passed
-   *          [Type] to Object
-   * @return the computed longest inheritance path to Object
-   * See [InterfaceType.getLeastUpperBound].
-   */
-  static int computeLongestInheritancePathToObject(InterfaceType type) => _computeLongestInheritancePathToObject(type, 0, new HashSet<ClassElement>());
-
-  /**
-   * Returns the set of all superinterfaces of the passed [Type].
+   * If these types have the same element and differ only in terms of the type
+   * arguments, attempts to find a compatible set of type arguments.
    *
-   * @param type the [Type] to compute the set of superinterfaces of
-   * @return the [Set] of superinterfaces of the passed [Type]
-   * See [getLeastUpperBound].
+   * Otherwise, calls [DartType.getLeastUpperBound].
    */
-  static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => _computeSuperinterfaceSet(type, new HashSet<InterfaceType>());
-
-  /**
-   * This method computes the longest inheritance path from some passed [Type] to Object. This
-   * method calls itself recursively, callers should use the public method
-   * [computeLongestInheritancePathToObject].
-   *
-   * @param type the [Type] to compute the longest inheritance path of from the passed
-   *          [Type] to Object
-   * @param depth a field used recursively
-   * @param visitedClasses the classes that have already been visited
-   * @return the computed longest inheritance path to Object
-   * See [computeLongestInheritancePathToObject], and [getLeastUpperBound].
-   */
-  static int _computeLongestInheritancePathToObject(InterfaceType type, int depth, HashSet<ClassElement> visitedClasses) {
-    ClassElement classElement = type.element;
-    // Object case
-    if (classElement.supertype == null || visitedClasses.contains(classElement)) {
-      return depth;
+  static InterfaceType getSmartLeastUpperBound(InterfaceType first,
+      InterfaceType second) {
+    if (first.element == second.element) {
+      return _leastUpperBound(first, second);
     }
-    int longestPath = 1;
-    try {
-      visitedClasses.add(classElement);
-      List<InterfaceType> superinterfaces = classElement.interfaces;
-      int pathLength;
-      if (superinterfaces.length > 0) {
-        // loop through each of the superinterfaces recursively calling this method and keeping track
-        // of the longest path to return
-        for (InterfaceType superinterface in superinterfaces) {
-          pathLength = _computeLongestInheritancePathToObject(superinterface, depth + 1, visitedClasses);
-          if (pathLength > longestPath) {
-            longestPath = pathLength;
-          }
-        }
-      }
-      // finally, perform this same check on the super type
-      // TODO(brianwilkerson) Does this also need to add in the number of mixin classes?
-      InterfaceType supertype = classElement.supertype;
-      pathLength = _computeLongestInheritancePathToObject(supertype, depth + 1, visitedClasses);
-      if (pathLength > longestPath) {
-        longestPath = pathLength;
-      }
-    } finally {
-      visitedClasses.remove(classElement);
-    }
-    return longestPath;
+    return first.getLeastUpperBound(second);
   }
 
   /**
-   * Returns the set of all superinterfaces of the passed [Type]. This is a recursive method,
-   * callers should call the public [computeSuperinterfaceSet].
+   * Return the "least upper bound" of the given types under the assumption that
+   * the types have the same element and differ only in terms of the type
+   * arguments.
    *
-   * @param type the [Type] to compute the set of superinterfaces of
-   * @param set a [HashSet] used recursively by this method
-   * @return the [Set] of superinterfaces of the passed [Type]
-   * See [computeSuperinterfaceSet], and [getLeastUpperBound].
+   * The resulting type is composed by comparing the corresponding type
+   * arguments, keeping those that are the same, and using 'dynamic' for those
+   * that are different.
    */
-  static Set<InterfaceType> _computeSuperinterfaceSet(InterfaceType type, HashSet<InterfaceType> set) {
-    Element element = type.element;
-    if (element != null) {
-      List<InterfaceType> superinterfaces = type.interfaces;
-      for (InterfaceType superinterface in superinterfaces) {
-        if (set.add(superinterface)) {
-          _computeSuperinterfaceSet(superinterface, set);
-        }
-      }
-      InterfaceType supertype = type.superclass;
-      if (supertype != null) {
-        if (set.add(supertype)) {
-          _computeSuperinterfaceSet(supertype, set);
-        }
-      }
+  static InterfaceType _leastUpperBound(InterfaceType firstType,
+      InterfaceType secondType) {
+    ClassElement firstElement = firstType.element;
+    ClassElement secondElement = secondType.element;
+    if (firstElement != secondElement) {
+      throw new IllegalArgumentException(
+          'The same elements expected, but '
+              '$firstElement and $secondElement are given.');
     }
-    return set;
-  }
-
-  /**
-   * Return the intersection of the given sets of types, where intersection is based on the equality
-   * of the types themselves.
-   *
-   * @param first the first set of types to be intersected
-   * @param second the second set of types to be intersected
-   * @return the intersection of the given sets of types
-   */
-  static List<InterfaceType> _intersection(Set<InterfaceType> first, Set<InterfaceType> second) {
-    Set<InterfaceType> result = new HashSet<InterfaceType>.from(first);
-    result.retainAll(second);
-    return new List.from(result);
-  }
-
-  /**
-   * Return the "least upper bound" of the given types under the assumption that the types have the
-   * same element and differ only in terms of the type arguments. The resulting type is composed by
-   * comparing the corresponding type arguments, keeping those that are the same, and using
-   * 'dynamic' for those that are different.
-   *
-   * @param firstType the first type
-   * @param secondType the second type
-   * @return the "least upper bound" of the given types
-   */
-  static InterfaceType _leastUpperBound(InterfaceType firstType, InterfaceType secondType) {
     if (firstType == secondType) {
       return firstType;
     }
@@ -6861,8 +7134,9 @@
     List<DartType> lubArguments = new List<DartType>(argumentCount);
     for (int i = 0; i < argumentCount; i++) {
       //
-      // Ideally we would take the least upper bound of the two argument types, but this can cause
-      // an infinite recursion (such as when finding the least upper bound of String and num).
+      // Ideally we would take the least upper bound of the two argument types,
+      // but this can cause an infinite recursion (such as when finding the
+      // least upper bound of String and num).
       //
       if (firstArguments[i] == secondArguments[i]) {
         lubArguments[i] = firstArguments[i];
@@ -6871,11 +7145,18 @@
         lubArguments[i] = DynamicTypeImpl.instance;
       }
     }
-    InterfaceTypeImpl lub = new InterfaceTypeImpl.con1(firstType.element);
+    InterfaceTypeImpl lub = new InterfaceTypeImpl.con1(firstElement);
     lub.typeArguments = lubArguments;
     return lub;
   }
+}
 
+/**
+ * Instances of the class `InterfaceTypeImpl` defines the behavior common to objects
+ * representing the type introduced by either a class or an interface, or a reference to such a
+ * type.
+ */
+class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
   /**
    * An array containing the actual types of the type arguments.
    */
@@ -6886,7 +7167,8 @@
    *
    * @param element the element representing the declaration of the type
    */
-  InterfaceTypeImpl.con1(ClassElement element) : super(element, element.displayName);
+  InterfaceTypeImpl.con1(ClassElement element)
+      : super(element, element.displayName);
 
   /**
    * Initialize a newly created type to have the given name. This constructor should only be used in
@@ -6897,12 +7179,10 @@
   InterfaceTypeImpl.con2(String name) : super(null, name);
 
   @override
-  bool operator ==(Object object) => internalEquals(object, new HashSet<ElementPair>());
-
-  @override
   List<PropertyAccessorElement> get accessors {
     List<PropertyAccessorElement> accessors = element.accessors;
-    List<PropertyAccessorElement> members = new List<PropertyAccessorElement>(accessors.length);
+    List<PropertyAccessorElement> members =
+        new List<PropertyAccessorElement>(accessors.length);
     for (int i = 0; i < accessors.length; i++) {
       members[i] = PropertyAccessorMember.from(accessors[i], this);
     }
@@ -6942,7 +7222,13 @@
   ClassElement get element => super.element as ClassElement;
 
   @override
-  PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember.from((element as ClassElementImpl).getGetter(getterName), this);
+  int get hashCode {
+    ClassElement element = this.element;
+    if (element == null) {
+      return 0;
+    }
+    return element.hashCode;
+  }
 
   @override
   List<InterfaceType> get interfaces {
@@ -6956,69 +7242,23 @@
     int count = interfaces.length;
     List<InterfaceType> typedInterfaces = new List<InterfaceType>(count);
     for (int i = 0; i < count; i++) {
-      typedInterfaces[i] = interfaces[i].substitute2(typeArguments, parameterTypes);
+      typedInterfaces[i] =
+          interfaces[i].substitute2(typeArguments, parameterTypes);
     }
     return typedInterfaces;
   }
 
   @override
-  DartType getLeastUpperBound(DartType type) {
-    // quick check for self
-    if (identical(type, this)) {
-      return this;
+  bool get isDartCoreFunction {
+    ClassElement element = this.element;
+    if (element == null) {
+      return false;
     }
-    // dynamic
-    DartType dynamicType = DynamicTypeImpl.instance;
-    if (identical(this, dynamicType) || identical(type, dynamicType)) {
-      return dynamicType;
-    }
-    // TODO (jwren) opportunity here for a better, faster algorithm if this turns out to be a bottle-neck
-    if (type is! InterfaceType) {
-      return null;
-    }
-    // new names to match up with the spec
-    InterfaceType i = this;
-    InterfaceType j = type as InterfaceType;
-    // compute set of supertypes
-    Set<InterfaceType> si = computeSuperinterfaceSet(i);
-    Set<InterfaceType> sj = computeSuperinterfaceSet(j);
-    // union si with i and sj with j
-    si.add(i);
-    sj.add(j);
-    // compute intersection, reference as set 's'
-    List<InterfaceType> s = _intersection(si, sj);
-    // for each element in Set s, compute the largest inheritance path to Object
-    List<int> depths = new List<int>.filled(s.length, 0);
-    int maxDepth = 0;
-    for (int n = 0; n < s.length; n++) {
-      depths[n] = computeLongestInheritancePathToObject(s[n]);
-      if (depths[n] > maxDepth) {
-        maxDepth = depths[n];
-      }
-    }
-    // ensure that the currently computed maxDepth is unique,
-    // otherwise, decrement and test for uniqueness again
-    for (; maxDepth >= 0; maxDepth--) {
-      int indexOfLeastUpperBound = -1;
-      int numberOfTypesAtMaxDepth = 0;
-      for (int m = 0; m < depths.length; m++) {
-        if (depths[m] == maxDepth) {
-          numberOfTypesAtMaxDepth++;
-          indexOfLeastUpperBound = m;
-        }
-      }
-      if (numberOfTypesAtMaxDepth == 1) {
-        return s[indexOfLeastUpperBound];
-      }
-    }
-    // illegal state, log and return null- Object at maxDepth == 0 should always return itself as
-    // the least upper bound.
-    // TODO (jwren) log the error state
-    return null;
+    return element.name == "Function" && element.library.isDartCore;
   }
 
   @override
-  MethodElement getMethod(String methodName) => MethodMember.from((element as ClassElementImpl).getMethod(methodName), this);
+  bool get isObject => element.supertype == null;
 
   @override
   List<MethodElement> get methods {
@@ -7048,9 +7288,6 @@
   }
 
   @override
-  PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember.from((element as ClassElementImpl).getSetter(setterName), this);
-
-  @override
   InterfaceType get superclass {
     ClassElement classElement = element;
     InterfaceType supertype = classElement.supertype;
@@ -7058,7 +7295,8 @@
       return null;
     }
     List<DartType> typeParameters = classElement.type.typeArguments;
-    if (typeArguments.length == 0 || typeArguments.length != typeParameters.length) {
+    if (typeArguments.length == 0 ||
+        typeArguments.length != typeParameters.length) {
       return supertype;
     }
     return supertype.substitute2(typeArguments, typeParameters);
@@ -7068,21 +7306,222 @@
   List<TypeParameterElement> get typeParameters => element.typeParameters;
 
   @override
-  int get hashCode {
-    ClassElement element = this.element;
-    if (element == null) {
-      return 0;
+  bool operator ==(Object object) =>
+      internalEquals(object, new HashSet<ElementPair>());
+
+  @override
+  void appendTo(StringBuffer buffer) {
+    buffer.write(name);
+    int argumentCount = typeArguments.length;
+    if (argumentCount > 0) {
+      buffer.write("<");
+      for (int i = 0; i < argumentCount; i++) {
+        if (i > 0) {
+          buffer.write(", ");
+        }
+        (typeArguments[i] as TypeImpl).appendTo(buffer);
+      }
+      buffer.write(">");
     }
-    return element.hashCode;
   }
 
   @override
-  bool get isDartCoreFunction {
-    ClassElement element = this.element;
-    if (element == null) {
+  PropertyAccessorElement getGetter(String getterName) =>
+      PropertyAccessorMember.from(
+          (element as ClassElementImpl).getGetter(getterName),
+          this);
+
+  @override
+  DartType getLeastUpperBound(DartType type) {
+    // quick check for self
+    if (identical(type, this)) {
+      return this;
+    }
+    // dynamic
+    DartType dynamicType = DynamicTypeImpl.instance;
+    if (identical(this, dynamicType) || identical(type, dynamicType)) {
+      return dynamicType;
+    }
+    // TODO (jwren) opportunity here for a better, faster algorithm if this
+    // turns out to be a bottle-neck
+    if (type is! InterfaceType) {
+      return null;
+    }
+    // new names to match up with the spec
+    InterfaceType i = this;
+    InterfaceType j = type as InterfaceType;
+    // compute set of supertypes
+    Set<InterfaceType> si = computeSuperinterfaceSet(i);
+    Set<InterfaceType> sj = computeSuperinterfaceSet(j);
+    // union si with i and sj with j
+    si.add(i);
+    sj.add(j);
+    // compute intersection, reference as set 's'
+    List<InterfaceType> s = _intersection(si, sj);
+    // for each element in Set s, compute the largest inheritance path to Object
+    List<int> depths = new List<int>.filled(s.length, 0);
+    int maxDepth = 0;
+    for (int n = 0; n < s.length; n++) {
+      depths[n] = computeLongestInheritancePathToObject(s[n]);
+      if (depths[n] > maxDepth) {
+        maxDepth = depths[n];
+      }
+    }
+    // ensure that the currently computed maxDepth is unique,
+    // otherwise, decrement and test for uniqueness again
+    for ( ; maxDepth >= 0; maxDepth--) {
+      int indexOfLeastUpperBound = -1;
+      int numberOfTypesAtMaxDepth = 0;
+      for (int m = 0; m < depths.length; m++) {
+        if (depths[m] == maxDepth) {
+          numberOfTypesAtMaxDepth++;
+          indexOfLeastUpperBound = m;
+        }
+      }
+      if (numberOfTypesAtMaxDepth == 1) {
+        return s[indexOfLeastUpperBound];
+      }
+    }
+    // illegal state, log and return null- Object at maxDepth == 0 should always
+    // return itself as the least upper bound.
+    // TODO (jwren) log the error state
+    return null;
+  }
+
+  @override
+  MethodElement getMethod(String methodName) =>
+      MethodMember.from((element as ClassElementImpl).getMethod(methodName), this);
+
+  @override
+  PropertyAccessorElement getSetter(String setterName) =>
+      PropertyAccessorMember.from(
+          (element as ClassElementImpl).getSetter(setterName),
+          this);
+
+  @override
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) {
+    if (object is! InterfaceTypeImpl) {
       return false;
     }
-    return element.name == "Function" && element.library.isDartCore;
+    InterfaceTypeImpl otherType = object as InterfaceTypeImpl;
+    return (element == otherType.element) &&
+        TypeImpl.equalArrays(
+            typeArguments,
+            otherType.typeArguments,
+            visitedElementPairs);
+  }
+
+  @override
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    //
+    // S is dynamic.
+    // The test to determine whether S is dynamic is done here because dynamic
+    // is not an instance of InterfaceType.
+    //
+    if (type.isDynamic) {
+      return true;
+    } else if (type is UnionType) {
+      return (type as UnionTypeImpl).internalUnionTypeIsLessSpecificThan(
+          this,
+          withDynamic,
+          visitedTypePairs);
+    } else if (type is! InterfaceType) {
+      return false;
+    }
+    return _isMoreSpecificThan(
+        type as InterfaceType,
+        new HashSet<ClassElement>(),
+        withDynamic,
+        visitedTypePairs);
+  }
+
+  @override
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    //
+    // T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S
+    //
+    if (type.isDynamic) {
+      return true;
+    } else if (type is TypeParameterType) {
+      return false;
+    } else if (type is UnionType) {
+      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(
+          this,
+          visitedTypePairs);
+    } else if (type is FunctionType) {
+      // This implementation assumes transitivity
+      // for function type subtyping on the RHS, but a literal reading
+      // of the spec does not specify this. More precisely:
+      // if T <: F1 and F1 <: F2 and F1 and F2 are function types,
+      // then we assume T <: F2.
+      //
+      // From the Function Types section of the spec:
+      //
+      //   If a type I includes an instance method named call(), and the type of
+      //   call() is the function type F, then I is considered to be a
+      //   subtype of F.
+      //
+      // However, the section on Interface Types says
+      //
+      //   T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S.
+      //
+      // after giving rules for << (pronounced "more specific than").
+      // However, the "only if" direction of the "iff" in the definition of <:
+      // seems to be contradicted by the special case <: rule quoted from the
+      // Function Types section: I see no rule for << which tells us that
+      // I << F if I has call() at type F.
+      //
+      // After defining <: , the spec then
+      // emphasizes that unlike the relation <<, the relation <: is not
+      // transitive in general:
+      //
+      //   Note that <: is not a partial order on types, it is only binary
+      //   relation on types.
+      //   This is because <: is not transitive.
+      //   If it was, the subtype rule would have a cycle.
+      //
+      //   For example: List <: List<String> and List<int> <: List,
+      //   but List<int> is not a subtype of List<String>.
+      //   Although <: is not a partial order on types, it does contain a
+      //   partial order, namely <<.
+      //   This means that, barring raw types, intuition about classical subtype
+      //   rules does apply.
+      //
+      // There is no other occurrence of the word "raw" in relation to types in
+      // the spec that I can find, but presumably it's a reference to
+      //
+      //   http://docs.oracle.com/javase/tutorial/java/generics/rawTypes.html
+      //
+      // so e.g. non-generic types are never raw. As pointed out by paulberry,
+      // it's not clear whether a type like T<int, dynamic> should be considered
+      // raw or not. On the one hand, it doesn't correspond to a
+      // "raw"-in-the-Java-sense occurrence of T, which would instead
+      // be T<dynamic, dynamic>; on the other hand, it's treated differently
+      // by <: and << when occurring on the left hand side.
+      ClassElement element = this.element;
+      InheritanceManager manager = new InheritanceManager(element.library);
+      FunctionType callType = manager.lookupMemberType(this, "call");
+      if (callType != null) {
+        // A more literal reading of the spec would give something like
+        //
+        //  return callType.equals(type)
+        //
+        // here, but that causes 101 errors in the external tests
+        // (tools/test.py --mode release --compiler dartanalyzer --runtime none)
+        return callType.isSubtypeOf(type);
+      }
+      return false;
+    } else if (type is! InterfaceType) {
+      return false;
+    } else if (this == type) {
+      return true;
+    }
+    return _isSubtypeOf(
+        type as InterfaceType,
+        new HashSet<ClassElement>(),
+        visitedTypePairs);
   }
 
   @override
@@ -7092,7 +7531,8 @@
     ClassElement jElement = j.element;
     InterfaceType supertype = jElement.supertype;
     //
-    // If J has no direct supertype then it is Object, and Object has no direct supertypes.
+    // If J has no direct supertype then it is Object, and Object has no direct
+    // supertypes.
     //
     if (supertype == null) {
       return false;
@@ -7127,16 +7567,14 @@
     //
     // J is a mixin application of the mixin of I.
     //
-    // TODO(brianwilkerson) Determine whether this needs to be implemented or whether it is covered
-    // by the case above.
+    // TODO(brianwilkerson) Determine whether this needs to be implemented or
+    // whether it is covered by the case above.
     return false;
   }
 
   @override
-  bool get isObject => element.supertype == null;
-
-  @override
-  ConstructorElement lookUpConstructor(String constructorName, LibraryElement library) {
+  ConstructorElement lookUpConstructor(String constructorName,
+      LibraryElement library) {
     // prepare base ConstructorElement
     ConstructorElement constructorElement;
     if (constructorName == null) {
@@ -7145,7 +7583,8 @@
       constructorElement = element.getNamedConstructor(constructorName);
     }
     // not found or not accessible
-    if (constructorElement == null || !constructorElement.isAccessibleIn(library)) {
+    if (constructorElement == null ||
+        !constructorElement.isAccessibleIn(library)) {
       return null;
     }
     // return member
@@ -7153,7 +7592,8 @@
   }
 
   @override
-  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) {
+  PropertyAccessorElement lookUpGetter(String getterName,
+      LibraryElement library) {
     PropertyAccessorElement element = getGetter(getterName);
     if (element != null && element.isAccessibleIn(library)) {
       return element;
@@ -7162,7 +7602,8 @@
   }
 
   @override
-  PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryElement library) {
+  PropertyAccessorElement lookUpGetterInSuperclass(String getterName,
+      LibraryElement library) {
     for (InterfaceType mixin in mixins) {
       PropertyAccessorElement element = mixin.getGetter(getterName);
       if (element != null && element.isAccessibleIn(library)) {
@@ -7171,7 +7612,8 @@
     }
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     InterfaceType supertype = superclass;
-    ClassElement supertypeElement = supertype == null ? null : supertype.element;
+    ClassElement supertypeElement =
+        supertype == null ? null : supertype.element;
     while (supertype != null && !visitedClasses.contains(supertypeElement)) {
       visitedClasses.add(supertypeElement);
       PropertyAccessorElement element = supertype.getGetter(getterName);
@@ -7200,7 +7642,8 @@
   }
 
   @override
-  MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement library) {
+  MethodElement lookUpMethodInSuperclass(String methodName,
+      LibraryElement library) {
     for (InterfaceType mixin in mixins) {
       MethodElement element = mixin.getMethod(methodName);
       if (element != null && element.isAccessibleIn(library)) {
@@ -7209,7 +7652,8 @@
     }
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     InterfaceType supertype = superclass;
-    ClassElement supertypeElement = supertype == null ? null : supertype.element;
+    ClassElement supertypeElement =
+        supertype == null ? null : supertype.element;
     while (supertype != null && !visitedClasses.contains(supertypeElement)) {
       visitedClasses.add(supertypeElement);
       MethodElement element = supertype.getMethod(methodName);
@@ -7229,7 +7673,8 @@
   }
 
   @override
-  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library) {
+  PropertyAccessorElement lookUpSetter(String setterName,
+      LibraryElement library) {
     PropertyAccessorElement element = getSetter(setterName);
     if (element != null && element.isAccessibleIn(library)) {
       return element;
@@ -7238,7 +7683,8 @@
   }
 
   @override
-  PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryElement library) {
+  PropertyAccessorElement lookUpSetterInSuperclass(String setterName,
+      LibraryElement library) {
     for (InterfaceType mixin in mixins) {
       PropertyAccessorElement element = mixin.getSetter(setterName);
       if (element != null && element.isAccessibleIn(library)) {
@@ -7247,7 +7693,8 @@
     }
     HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
     InterfaceType supertype = superclass;
-    ClassElement supertypeElement = supertype == null ? null : supertype.element;
+    ClassElement supertypeElement =
+        supertype == null ? null : supertype.element;
     while (supertype != null && !visitedClasses.contains(supertypeElement)) {
       visitedClasses.add(supertypeElement);
       PropertyAccessorElement element = supertype.getSetter(setterName);
@@ -7267,17 +7714,17 @@
   }
 
   @override
-  InterfaceTypeImpl substitute4(List<DartType> argumentTypes) => substitute2(argumentTypes, typeArguments);
-
-  @override
-  InterfaceTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
+  InterfaceTypeImpl substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
     if (argumentTypes.length != parameterTypes.length) {
-      throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.length}) != parameterTypes.length (${parameterTypes.length})");
+      throw new IllegalArgumentException(
+          "argumentTypes.length (${argumentTypes.length}) != parameterTypes.length (${parameterTypes.length})");
     }
     if (argumentTypes.length == 0 || typeArguments.length == 0) {
       return this;
     }
-    List<DartType> newTypeArguments = TypeImpl.substitute(typeArguments, argumentTypes, parameterTypes);
+    List<DartType> newTypeArguments =
+        TypeImpl.substitute(typeArguments, argumentTypes, parameterTypes);
     if (JavaArrays.equals(newTypeArguments, typeArguments)) {
       return this;
     }
@@ -7287,124 +7734,15 @@
   }
 
   @override
-  void appendTo(StringBuffer buffer) {
-    buffer.write(name);
-    int argumentCount = typeArguments.length;
-    if (argumentCount > 0) {
-      buffer.write("<");
-      for (int i = 0; i < argumentCount; i++) {
-        if (i > 0) {
-          buffer.write(", ");
-        }
-        (typeArguments[i] as TypeImpl).appendTo(buffer);
-      }
-      buffer.write(">");
-    }
-  }
+  InterfaceTypeImpl substitute4(List<DartType> argumentTypes) =>
+      substitute2(argumentTypes, typeArguments);
 
-  @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) {
-    if (object is! InterfaceTypeImpl) {
-      return false;
-    }
-    InterfaceTypeImpl otherType = object as InterfaceTypeImpl;
-    return (element == otherType.element) && TypeImpl.equalArrays(typeArguments, otherType.typeArguments, visitedElementPairs);
-  }
-
-  @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool _isMoreSpecificThan(InterfaceType s,
+      HashSet<ClassElement> visitedClasses, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     //
-    // S is dynamic.
-    // The test to determine whether S is dynamic is done here because dynamic is not an instance of
-    // InterfaceType.
-    //
-    if (type.isDynamic) {
-      return true;
-    } else if (type is UnionType) {
-      return (type as UnionTypeImpl).internalUnionTypeIsLessSpecificThan(this, withDynamic, visitedTypePairs);
-    } else if (type is! InterfaceType) {
-      return false;
-    }
-    return _isMoreSpecificThan(type as InterfaceType, new HashSet<ClassElement>(), withDynamic, visitedTypePairs);
-  }
-
-  @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) {
-    //
-    // T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S
-    //
-    if (type.isDynamic) {
-      return true;
-    } else if (type is TypeParameterType) {
-      return false;
-    } else if (type is UnionType) {
-      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visitedTypePairs);
-    } else if (type is FunctionType) {
-      // This implementation assumes transitivity
-      // for function type subtyping on the RHS, but a literal reading
-      // of the spec does not specify this. More precisely: if T <: F1 and F1 <: F2 and
-      // F1 and F2 are function types, then we assume T <: F2.
-      //
-      // From the Function Types section of the spec:
-      //
-      //   If a type I includes an instance method named call(), and the type of call()
-      //   is the function type F, then I is considered to be a subtype of F.
-      //
-      // However, the section on Interface Types says
-      //
-      //   T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S.
-      //
-      // after giving rules for << (pronounced "more specific than"). However, the "only if"
-      // direction of the "iff"
-      // in the definition of <: seems to be contradicted by the special case <: rule
-      // quoted from the Function Types section: I see no rule for << which tells us that
-      // I << F if I has call() at type F.
-      //
-      // After defining <: , the spec then
-      // emphasizes that unlike the relation <<, the relation <: is not transitive in general:
-      //
-      //   Note that <: is not a partial order on types, it is only binary relation on types.
-      //   This is because <: is not transitive. If it was, the subtype rule would have a cycle.
-      //   For example: List <: List<String> and List<int> <: List, but List<int> is not a subtype
-      //   of List<String>. Although <: is not a partial order on types, it does contain a partial
-      //   order, namely <<. This means that, barring raw types, intuition about classical subtype
-      //   rules does apply.
-      //
-      // There is no other occurrence of the word "raw" in relation to types in the spec that I can
-      // find, but presumably it's a reference to
-      //
-      //   http://docs.oracle.com/javase/tutorial/java/generics/rawTypes.html
-      //
-      // so e.g. non-generic types are never raw. As pointed out by paulberry, it's not clear
-      // whether a type like T<int, dynamic> should be considered raw or not. On the one hand, it
-      // doesn't correspond to a "raw"-in-the-Java-sense occurrence of T, which would instead
-      // be T<dynamic, dynamic>; on the other hand, it's treated differently by <: and << when
-      // occurring on the left hand side.
-      ClassElement element = this.element;
-      InheritanceManager manager = new InheritanceManager(element.library);
-      FunctionType callType = manager.lookupMemberType(this, "call");
-      if (callType != null) {
-        // A more literal reading of the spec would give something like
-        //
-        //  return callType.equals(type)
-        //
-        // here, but that causes 101 errors in the external tests
-        // (tools/test.py --mode release --compiler dartanalyzer --runtime none).
-        return callType.isSubtypeOf(type);
-      }
-      return false;
-    } else if (type is! InterfaceType) {
-      return false;
-    } else if (this == type) {
-      return true;
-    }
-    return _isSubtypeOf(type as InterfaceType, new HashSet<ClassElement>(), visitedTypePairs);
-  }
-
-  bool _isMoreSpecificThan(InterfaceType s, HashSet<ClassElement> visitedClasses, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
-    //
-    // A type T is more specific than a type S, written T << S,  if one of the following conditions
-    // is met:
+    // A type T is more specific than a type S, written T << S,
+    // if one of the following conditions is met:
     //
     // Reflexivity: T is S.
     //
@@ -7420,7 +7758,8 @@
       return true;
     }
     //
-    // Covariance: T is of the form I<T1, ..., Tn> and S is of the form I<S1, ..., Sn> and Ti << Si, 1 <= i <= n.
+    // Covariance: T is of the form I<T1, ..., Tn> and S is of the form
+    // I<S1, ..., Sn> and Ti << Si, 1 <= i <= n.
     //
     ClassElement tElement = this.element;
     ClassElement sElement = s.element;
@@ -7431,7 +7770,10 @@
         return false;
       }
       for (int i = 0; i < tArguments.length; i++) {
-        if (!(tArguments[i] as TypeImpl).isMoreSpecificThan2(sArguments[i], withDynamic, visitedTypePairs)) {
+        if (!(tArguments[i] as TypeImpl).isMoreSpecificThan2(
+            sArguments[i],
+            withDynamic,
+            visitedTypePairs)) {
           return false;
         }
       }
@@ -7446,26 +7788,41 @@
       return false;
     }
     visitedClasses.add(element);
-    // Iterate over all of the types U that are more specific than T because they are direct
-    // supertypes of T and return true if any of them are more specific than S.
+    // Iterate over all of the types U that are more specific than T because
+    // they are direct supertypes of T and return true if any of them are more
+    // specific than S.
     InterfaceType supertype = superclass;
-    if (supertype != null && (supertype as InterfaceTypeImpl)._isMoreSpecificThan(s, visitedClasses, withDynamic, visitedTypePairs)) {
+    if (supertype != null &&
+        (supertype as InterfaceTypeImpl)._isMoreSpecificThan(
+            s,
+            visitedClasses,
+            withDynamic,
+            visitedTypePairs)) {
       return true;
     }
     for (InterfaceType interfaceType in interfaces) {
-      if ((interfaceType as InterfaceTypeImpl)._isMoreSpecificThan(s, visitedClasses, withDynamic, visitedTypePairs)) {
+      if ((interfaceType as InterfaceTypeImpl)._isMoreSpecificThan(
+          s,
+          visitedClasses,
+          withDynamic,
+          visitedTypePairs)) {
         return true;
       }
     }
     for (InterfaceType mixinType in mixins) {
-      if ((mixinType as InterfaceTypeImpl)._isMoreSpecificThan(s, visitedClasses, withDynamic, visitedTypePairs)) {
+      if ((mixinType as InterfaceTypeImpl)._isMoreSpecificThan(
+          s,
+          visitedClasses,
+          withDynamic,
+          visitedTypePairs)) {
         return true;
       }
     }
     return false;
   }
 
-  bool _isSubtypeOf(InterfaceType type, HashSet<ClassElement> visitedClasses, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool _isSubtypeOf(InterfaceType type, HashSet<ClassElement> visitedClasses,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     InterfaceType typeT = this;
     InterfaceType typeS = type;
     ClassElement elementT = element;
@@ -7476,19 +7833,21 @@
     if (typeT == typeS) {
       return true;
     } else if (elementT == typeS.element) {
-      // For each of the type arguments return true if all type args from T is a subtype of all
-      // types from S.
+      // For each of the type arguments return true if all type args from T is
+      // a subtype of all types from S.
       List<DartType> typeTArgs = typeT.typeArguments;
       List<DartType> typeSArgs = typeS.typeArguments;
       if (typeTArgs.length != typeSArgs.length) {
-        // This case covers the case where two objects are being compared that have a different
-        // number of parameterized types.
+        // This case covers the case where two objects are being compared that
+        // have a different number of parameterized types.
         return false;
       }
       for (int i = 0; i < typeTArgs.length; i++) {
-        // Recursively call isSubtypeOf the type arguments and return false if the T argument is not
-        // a subtype of the S argument.
-        if (!(typeTArgs[i] as TypeImpl).isSubtypeOf2(typeSArgs[i], visitedTypePairs)) {
+        // Recursively call isSubtypeOf the type arguments and return false if
+        // the T argument is not a subtype of the S argument.
+        if (!(typeTArgs[i] as TypeImpl).isSubtypeOf2(
+            typeSArgs[i],
+            visitedTypePairs)) {
           return false;
         }
       }
@@ -7498,23 +7857,151 @@
     }
     InterfaceType supertype = superclass;
     // The type is Object, return false.
-    if (supertype != null && (supertype as InterfaceTypeImpl)._isSubtypeOf(typeS, visitedClasses, visitedTypePairs)) {
+    if (supertype != null &&
+        (supertype as InterfaceTypeImpl)._isSubtypeOf(
+            typeS,
+            visitedClasses,
+            visitedTypePairs)) {
       return true;
     }
     List<InterfaceType> interfaceTypes = interfaces;
     for (InterfaceType interfaceType in interfaceTypes) {
-      if ((interfaceType as InterfaceTypeImpl)._isSubtypeOf(typeS, visitedClasses, visitedTypePairs)) {
+      if ((interfaceType as InterfaceTypeImpl)._isSubtypeOf(
+          typeS,
+          visitedClasses,
+          visitedTypePairs)) {
         return true;
       }
     }
     List<InterfaceType> mixinTypes = mixins;
     for (InterfaceType mixinType in mixinTypes) {
-      if ((mixinType as InterfaceTypeImpl)._isSubtypeOf(typeS, visitedClasses, visitedTypePairs)) {
+      if ((mixinType as InterfaceTypeImpl)._isSubtypeOf(
+          typeS,
+          visitedClasses,
+          visitedTypePairs)) {
         return true;
       }
     }
     return false;
   }
+
+  /**
+   * This method computes the longest inheritance path from some passed [Type] to Object.
+   *
+   * @param type the [Type] to compute the longest inheritance path of from the passed
+   *          [Type] to Object
+   * @return the computed longest inheritance path to Object
+   * See [InterfaceType.getLeastUpperBound].
+   */
+  static int computeLongestInheritancePathToObject(InterfaceType type) =>
+      _computeLongestInheritancePathToObject(type, 0, new HashSet<ClassElement>());
+
+  /**
+   * Returns the set of all superinterfaces of the passed [Type].
+   *
+   * @param type the [Type] to compute the set of superinterfaces of
+   * @return the [Set] of superinterfaces of the passed [Type]
+   * See [getLeastUpperBound].
+   */
+  static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) =>
+      _computeSuperinterfaceSet(type, new HashSet<InterfaceType>());
+
+  /**
+   * This method computes the longest inheritance path from some passed [Type] to Object. This
+   * method calls itself recursively, callers should use the public method
+   * [computeLongestInheritancePathToObject].
+   *
+   * @param type the [Type] to compute the longest inheritance path of from the passed
+   *          [Type] to Object
+   * @param depth a field used recursively
+   * @param visitedClasses the classes that have already been visited
+   * @return the computed longest inheritance path to Object
+   * See [computeLongestInheritancePathToObject], and [getLeastUpperBound].
+   */
+  static int _computeLongestInheritancePathToObject(InterfaceType type,
+      int depth, HashSet<ClassElement> visitedClasses) {
+    ClassElement classElement = type.element;
+    // Object case
+    if (classElement.supertype == null ||
+        visitedClasses.contains(classElement)) {
+      return depth;
+    }
+    int longestPath = 1;
+    try {
+      visitedClasses.add(classElement);
+      List<InterfaceType> superinterfaces = classElement.interfaces;
+      int pathLength;
+      if (superinterfaces.length > 0) {
+        // loop through each of the superinterfaces recursively calling this
+        // method and keeping track of the longest path to return
+        for (InterfaceType superinterface in superinterfaces) {
+          pathLength = _computeLongestInheritancePathToObject(
+              superinterface,
+              depth + 1,
+              visitedClasses);
+          if (pathLength > longestPath) {
+            longestPath = pathLength;
+          }
+        }
+      }
+      // finally, perform this same check on the super type
+      // TODO(brianwilkerson) Does this also need to add in the number of mixin
+      // classes?
+      InterfaceType supertype = classElement.supertype;
+      pathLength =
+          _computeLongestInheritancePathToObject(supertype, depth + 1, visitedClasses);
+      if (pathLength > longestPath) {
+        longestPath = pathLength;
+      }
+    } finally {
+      visitedClasses.remove(classElement);
+    }
+    return longestPath;
+  }
+
+  /**
+   * Returns the set of all superinterfaces of the passed [Type]. This is a recursive method,
+   * callers should call the public [computeSuperinterfaceSet].
+   *
+   * @param type the [Type] to compute the set of superinterfaces of
+   * @param set a [HashSet] used recursively by this method
+   * @return the [Set] of superinterfaces of the passed [Type]
+   * See [computeSuperinterfaceSet], and [getLeastUpperBound].
+   */
+  static Set<InterfaceType> _computeSuperinterfaceSet(InterfaceType type,
+      HashSet<InterfaceType> set) {
+    Element element = type.element;
+    if (element != null) {
+      List<InterfaceType> superinterfaces = type.interfaces;
+      for (InterfaceType superinterface in superinterfaces) {
+        if (set.add(superinterface)) {
+          _computeSuperinterfaceSet(superinterface, set);
+        }
+      }
+      InterfaceType supertype = type.superclass;
+      if (supertype != null) {
+        if (set.add(supertype)) {
+          _computeSuperinterfaceSet(supertype, set);
+        }
+      }
+    }
+    return set;
+  }
+
+  /**
+   * Return the intersection of the given sets of types, where intersection is based on the equality
+   * of the types themselves.
+   *
+   * @param first the first set of types to be intersected
+   * @param second the second set of types to be intersected
+   * @return the intersection of the given sets of types
+   */
+  static List<InterfaceType> _intersection(Set<InterfaceType> first,
+      Set<InterfaceType> second) {
+    Set<InterfaceType> result = new HashSet<InterfaceType>.from(first);
+    result.retainAll(second);
+    return new List.from(result);
+  }
 }
 
 /**
@@ -7525,17 +8012,19 @@
 
   String _attributeName;
 
-  IsTagHasAttributeSelectorElementImpl(String tagName, String attributeName) : super("$tagName[$attributeName]", -1) {
+  IsTagHasAttributeSelectorElementImpl(String tagName, String attributeName)
+      : super("$tagName[$attributeName]", -1) {
     this._tagName = tagName;
     this._attributeName = attributeName;
   }
 
-  @override
-  bool apply(XmlTagNode node) => node.tag == _tagName && node.getAttribute(_attributeName) != null;
-
   String get attributeName => _attributeName;
 
   String get tagName => _tagName;
+
+  @override
+  bool apply(XmlTagNode node) =>
+      node.tag == _tagName && node.getAttribute(_attributeName) != null;
 }
 
 /**
@@ -7557,6 +8046,11 @@
  */
 class LabelElementImpl extends ElementImpl implements LabelElement {
   /**
+   * An empty list of label elements.
+   */
+  static const List<LabelElement> EMPTY_ARRAY = const <LabelElement>[];
+
+  /**
    * A flag indicating whether this label is associated with a `switch` statement.
    */
   final bool _onSwitchStatement;
@@ -7568,11 +8062,6 @@
   final bool _onSwitchMember;
 
   /**
-   * An empty array of label elements.
-   */
-  static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0);
-
-  /**
    * Initialize a newly created label element to have the given name.
    *
    * @param name the name of this element
@@ -7580,16 +8069,13 @@
    *          statement
    * @param onSwitchMember `true` if this label is associated with a `switch` member
    */
-  LabelElementImpl(Identifier name, this._onSwitchStatement, this._onSwitchMember) : super.forNode(name);
+  LabelElementImpl(Identifier name, this._onSwitchStatement,
+      this._onSwitchMember)
+      : super.forNode(name);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitLabelElement(this);
-
-  @override
-  ExecutableElement get enclosingElement => super.enclosingElement as ExecutableElement;
-
-  @override
-  ElementKind get kind => ElementKind.LABEL;
+  ExecutableElement get enclosingElement =>
+      super.enclosingElement as ExecutableElement;
 
   /**
    * Return `true` if this label is associated with a `switch` member (`case` or
@@ -7605,6 +8091,12 @@
    * @return `true` if this label is associated with a `switch` statement
    */
   bool get isOnSwitchStatement => _onSwitchStatement;
+
+  @override
+  ElementKind get kind => ElementKind.LABEL;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitLabelElement(this);
 }
 
 /**
@@ -7642,6 +8134,19 @@
   List<ExportElement> get exports;
 
   /**
+   * Return `true` if the defining compilation unit of this library contains at least one
+   * import directive whose URI uses the "dart-ext" scheme.
+   */
+  bool get hasExtUri;
+
+  /**
+   * Return `true` if this library defines a top-level function named `loadLibrary`.
+   *
+   * @return `true` if this library defines a top-level function named `loadLibrary`
+   */
+  bool get hasLoadLibraryFunction;
+
+  /**
    * Return an array containing all of the libraries that are imported into this library. This
    * includes all of the libraries that are imported using a prefix (also available through the
    * prefixes returned by [getPrefixes]) and those that are imported without a prefix.
@@ -7658,74 +8163,6 @@
   List<ImportElement> get imports;
 
   /**
-   * Return an array containing all of the imports that share the given prefix, or an empty array if
-   * there are no such imports.
-   *
-   * @param prefixElement the prefix element shared by the returned imports
-   */
-  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement);
-
-  /**
-   * Return the element representing the synthetic function `loadLibrary` that is implicitly
-   * defined for this library if the library is imported using a deferred import.
-   */
-  FunctionElement get loadLibraryFunction;
-
-  /**
-   * Return an array containing all of the compilation units that are included in this library using
-   * a `part` directive. This does not include the defining compilation unit that contains the
-   * `part` directives.
-   *
-   * @return the compilation units that are included in this library
-   */
-  List<CompilationUnitElement> get parts;
-
-  /**
-   * Return an array containing elements for each of the prefixes used to `import` libraries
-   * into this library. Each prefix can be used in more than one `import` directive.
-   *
-   * @return the prefixes used to `import` libraries into this library
-   */
-  List<PrefixElement> get prefixes;
-
-  /**
-   * Return the class defined in this library that has the given name, or `null` if this
-   * library does not define a class with the given name.
-   *
-   * @param className the name of the class to be returned
-   * @return the class with the given name that is defined in this library
-   */
-  ClassElement getType(String className);
-
-  /**
-   * Return an array containing all of the compilation units this library consists of. This includes
-   * the defining compilation unit and units included using the `part` directive.
-   *
-   * @return the compilation units this library consists of
-   */
-  List<CompilationUnitElement> get units;
-
-  /**
-   * Return an array containing all directly and indirectly imported libraries.
-   *
-   * @return all directly and indirectly imported libraries
-   */
-  List<LibraryElement> get visibleLibraries;
-
-  /**
-   * Return `true` if the defining compilation unit of this library contains at least one
-   * import directive whose URI uses the "dart-ext" scheme.
-   */
-  bool get hasExtUri;
-
-  /**
-   * Return `true` if this library defines a top-level function named `loadLibrary`.
-   *
-   * @return `true` if this library defines a top-level function named `loadLibrary`
-   */
-  bool get hasLoadLibraryFunction;
-
-  /**
    * Return `true` if this library is created for Angular analysis. If this library has not
    * yet had toolkit references resolved, then `false` will be returned.
    *
@@ -7755,6 +8192,61 @@
   bool get isInSdk;
 
   /**
+   * Return the element representing the synthetic function `loadLibrary` that is implicitly
+   * defined for this library if the library is imported using a deferred import.
+   */
+  FunctionElement get loadLibraryFunction;
+
+  /**
+   * Return an array containing all of the compilation units that are included in this library using
+   * a `part` directive. This does not include the defining compilation unit that contains the
+   * `part` directives.
+   *
+   * @return the compilation units that are included in this library
+   */
+  List<CompilationUnitElement> get parts;
+
+  /**
+   * Return an array containing elements for each of the prefixes used to `import` libraries
+   * into this library. Each prefix can be used in more than one `import` directive.
+   *
+   * @return the prefixes used to `import` libraries into this library
+   */
+  List<PrefixElement> get prefixes;
+
+  /**
+   * Return an array containing all of the compilation units this library consists of. This includes
+   * the defining compilation unit and units included using the `part` directive.
+   *
+   * @return the compilation units this library consists of
+   */
+  List<CompilationUnitElement> get units;
+
+  /**
+   * Return an array containing all directly and indirectly imported libraries.
+   *
+   * @return all directly and indirectly imported libraries
+   */
+  List<LibraryElement> get visibleLibraries;
+
+  /**
+   * Return an array containing all of the imports that share the given prefix, or an empty array if
+   * there are no such imports.
+   *
+   * @param prefixElement the prefix element shared by the returned imports
+   */
+  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement);
+
+  /**
+   * Return the class defined in this library that has the given name, or `null` if this
+   * library does not define a class with the given name.
+   *
+   * @param className the name of the class to be returned
+   * @return the class with the given name that is defined in this library
+   */
+  ClassElement getType(String className);
+
+  /**
    * Return `true` if this library is up to date with respect to the given time stamp. If any
    * transitively referenced Source is newer than the time stamp, this method returns false.
    *
@@ -7769,46 +8261,9 @@
  */
 class LibraryElementImpl extends ElementImpl implements LibraryElement {
   /**
-   * An empty array of library elements.
+   * An empty list of library elements.
    */
-  static List<LibraryElement> EMPTY_ARRAY = new List<LibraryElement>(0);
-
-  /**
-   * Determine if the given library is up to date with respect to the given time stamp.
-   *
-   * @param library the library to process
-   * @param timeStamp the time stamp to check against
-   * @param visitedLibraries the set of visited libraries
-   */
-  static bool _safeIsUpToDate(LibraryElement library, int timeStamp, Set<LibraryElement> visitedLibraries) {
-    if (!visitedLibraries.contains(library)) {
-      visitedLibraries.add(library);
-      AnalysisContext context = library.context;
-      // Check the defining compilation unit.
-      if (timeStamp < context.getModificationStamp(library.definingCompilationUnit.source)) {
-        return false;
-      }
-      // Check the parted compilation units.
-      for (CompilationUnitElement element in library.parts) {
-        if (timeStamp < context.getModificationStamp(element.source)) {
-          return false;
-        }
-      }
-      // Check the imported libraries.
-      for (LibraryElement importedLibrary in library.importedLibraries) {
-        if (!_safeIsUpToDate(importedLibrary, timeStamp, visitedLibraries)) {
-          return false;
-        }
-      }
-      // Check the exported libraries.
-      for (LibraryElement exportedLibrary in library.exportedLibraries) {
-        if (!_safeIsUpToDate(exportedLibrary, timeStamp, visitedLibraries)) {
-          return false;
-        }
-      }
-    }
-    return true;
-  }
+  static const List<LibraryElement> EMPTY_ARRAY = const <LibraryElement>[];
 
   /**
    * The analysis context in which this library is defined.
@@ -7857,50 +8312,43 @@
    *
    * @param context the analysis context in which the library is defined
    * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  LibraryElementImpl.forNode(this.context, LibraryIdentifier name) : super.forNode(name);
+  LibraryElementImpl(this.context, String name, int nameOffset)
+      : super(name, nameOffset);
 
   /**
    * Initialize a newly created library element to have the given name.
    *
    * @param context the analysis context in which the library is defined
    * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
    */
-  LibraryElementImpl(this.context, String name, int nameOffset) : super(name, nameOffset);
+  LibraryElementImpl.forNode(this.context, LibraryIdentifier name)
+      : super.forNode(name);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
-
-  @override
-  bool operator ==(Object object) => object != null && runtimeType == object.runtimeType && _definingCompilationUnit == (object as LibraryElementImpl).definingCompilationUnit;
-
-  @override
-  ElementImpl getChild(String identifier) {
-    if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == identifier) {
-      return _definingCompilationUnit as CompilationUnitElementImpl;
-    }
-    for (CompilationUnitElement part in _parts) {
-      if ((part as CompilationUnitElementImpl).identifier == identifier) {
-        return part as CompilationUnitElementImpl;
-      }
-    }
-    for (ImportElement importElement in _imports) {
-      if ((importElement as ImportElementImpl).identifier == identifier) {
-        return importElement as ImportElementImpl;
-      }
-    }
-    for (ExportElement exportElement in _exports) {
-      if ((exportElement as ExportElementImpl).identifier == identifier) {
-        return exportElement as ExportElementImpl;
-      }
-    }
-    return null;
+  /**
+   * Specifies if this library is created for Angular analysis.
+   */
+  void set angularHtml(bool isAngularHtml) {
+    this._isAngularHtml = isAngularHtml;
   }
 
   @override
-  CompilationUnitElement get definingCompilationUnit => _definingCompilationUnit;
+  CompilationUnitElement get definingCompilationUnit =>
+      _definingCompilationUnit;
+
+  /**
+   * Set the compilation unit that defines this library to the given compilation unit.
+   *
+   * @param definingCompilationUnit the compilation unit that defines this library
+   */
+  void set
+      definingCompilationUnit(CompilationUnitElement definingCompilationUnit) {
+    (definingCompilationUnit as CompilationUnitElementImpl).enclosingElement =
+        this;
+    this._definingCompilationUnit = definingCompilationUnit;
+  }
 
   @override
   List<LibraryElement> get exportedLibraries {
@@ -7917,108 +8365,30 @@
   @override
   List<ExportElement> get exports => _exports;
 
-  @override
-  List<LibraryElement> get importedLibraries {
-    HashSet<LibraryElement> libraries = new HashSet<LibraryElement>();
-    for (ImportElement element in _imports) {
-      LibraryElement library = element.importedLibrary;
-      if (library != null) {
-        libraries.add(library);
-      }
+  /**
+   * Set the specifications of all of the exports defined in this library to the given array.
+   *
+   * @param exports the specifications of all of the exports defined in this library
+   */
+  void set exports(List<ExportElement> exports) {
+    for (ExportElement exportElement in exports) {
+      (exportElement as ExportElementImpl).enclosingElement = this;
     }
-    return new List.from(libraries);
-  }
-
-  @override
-  List<ImportElement> get imports => _imports;
-
-  @override
-  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement) {
-    int count = _imports.length;
-    List<ImportElement> importList = new List<ImportElement>();
-    for (int i = 0; i < count; i++) {
-      if (identical(_imports[i].prefix, prefixElement)) {
-        importList.add(_imports[i]);
-      }
-    }
-    return importList;
-  }
-
-  @override
-  ElementKind get kind => ElementKind.LIBRARY;
-
-  @override
-  LibraryElement get library => this;
-
-  @override
-  FunctionElement get loadLibraryFunction {
-    if (_loadLibraryFunction == null) {
-      FunctionElementImpl function = new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
-      function.synthetic = true;
-      function.enclosingElement = this;
-      function.returnType = loadLibraryReturnType;
-      function.type = new FunctionTypeImpl.con1(function);
-      _loadLibraryFunction = function;
-    }
-    return _loadLibraryFunction;
-  }
-
-  @override
-  List<CompilationUnitElement> get parts => _parts;
-
-  @override
-  List<PrefixElement> get prefixes {
-    HashSet<PrefixElement> prefixes = new HashSet<PrefixElement>();
-    for (ImportElement element in _imports) {
-      PrefixElement prefix = element.prefix;
-      if (prefix != null) {
-        prefixes.add(prefix);
-      }
-    }
-    return new List.from(prefixes);
-  }
-
-  @override
-  Source get source {
-    if (_definingCompilationUnit == null) {
-      return null;
-    }
-    return _definingCompilationUnit.source;
-  }
-
-  @override
-  ClassElement getType(String className) {
-    ClassElement type = _definingCompilationUnit.getType(className);
-    if (type != null) {
-      return type;
-    }
-    for (CompilationUnitElement part in _parts) {
-      type = part.getType(className);
-      if (type != null) {
-        return type;
-      }
-    }
-    return null;
-  }
-
-  @override
-  List<CompilationUnitElement> get units {
-    List<CompilationUnitElement> units = new List<CompilationUnitElement>(1 + _parts.length);
-    units[0] = _definingCompilationUnit;
-    JavaSystem.arraycopy(_parts, 0, units, 1, _parts.length);
-    return units;
-  }
-
-  @override
-  List<LibraryElement> get visibleLibraries {
-    Set<LibraryElement> visibleLibraries = new Set();
-    _addVisibleLibraries(visibleLibraries, false);
-    return new List.from(visibleLibraries);
+    this._exports = exports;
   }
 
   @override
   bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI);
 
+  /**
+   * Set whether this library has an import of a "dart-ext" URI to the given value.
+   *
+   * @param hasExtUri `true` if this library has an import of a "dart-ext" URI
+   */
+  void set hasExtUri(bool hasExtUri) {
+    setModifier(Modifier.HAS_EXT_URI, hasExtUri);
+  }
+
   @override
   int get hashCode => _definingCompilationUnit.hashCode;
 
@@ -8036,60 +8406,22 @@
   }
 
   @override
-  bool get isAngularHtml => _isAngularHtml;
+  String get identifier => _definingCompilationUnit.source.encoding;
 
   @override
-  bool get isBrowserApplication => entryPoint != null && isOrImportsBrowserLibrary;
-
-  @override
-  bool get isDartCore => name == "dart.core";
-
-  @override
-  bool get isInSdk => StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x74, 0x2E);
-
-  @override
-  bool isUpToDate(int timeStamp) {
-    Set<LibraryElement> visitedLibraries = new Set();
-    return _safeIsUpToDate(this, timeStamp, visitedLibraries);
-  }
-
-  /**
-   * Specifies if this library is created for Angular analysis.
-   */
-  void set angularHtml(bool isAngularHtml) {
-    this._isAngularHtml = isAngularHtml;
-  }
-
-  /**
-   * Set the compilation unit that defines this library to the given compilation unit.
-   *
-   * @param definingCompilationUnit the compilation unit that defines this library
-   */
-  void set definingCompilationUnit(CompilationUnitElement definingCompilationUnit) {
-    (definingCompilationUnit as CompilationUnitElementImpl).enclosingElement = this;
-    this._definingCompilationUnit = definingCompilationUnit;
-  }
-
-  /**
-   * Set the specifications of all of the exports defined in this library to the given array.
-   *
-   * @param exports the specifications of all of the exports defined in this library
-   */
-  void set exports(List<ExportElement> exports) {
-    for (ExportElement exportElement in exports) {
-      (exportElement as ExportElementImpl).enclosingElement = this;
+  List<LibraryElement> get importedLibraries {
+    HashSet<LibraryElement> libraries = new HashSet<LibraryElement>();
+    for (ImportElement element in _imports) {
+      LibraryElement library = element.importedLibrary;
+      if (library != null) {
+        libraries.add(library);
+      }
     }
-    this._exports = exports;
+    return new List.from(libraries);
   }
 
-  /**
-   * Set whether this library has an import of a "dart-ext" URI to the given value.
-   *
-   * @param hasExtUri `true` if this library has an import of a "dart-ext" URI
-   */
-  void set hasExtUri(bool hasExtUri) {
-    setModifier(Modifier.HAS_EXT_URI, hasExtUri);
-  }
+  @override
+  List<ImportElement> get imports => _imports;
 
   /**
    * Set the specifications of all of the imports defined in this library to the given array.
@@ -8107,89 +8439,19 @@
     this._imports = imports;
   }
 
-  /**
-   * Set the compilation units that are included in this library using a `part` directive.
-   *
-   * @param parts the compilation units that are included in this library using a `part`
-   *          directive
-   */
-  void set parts(List<CompilationUnitElement> parts) {
-    for (CompilationUnitElement compilationUnit in parts) {
-      (compilationUnit as CompilationUnitElementImpl).enclosingElement = this;
-    }
-    this._parts = parts;
-  }
+  @override
+  bool get isAngularHtml => _isAngularHtml;
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(_definingCompilationUnit, visitor);
-    safelyVisitChildren(_exports, visitor);
-    safelyVisitChildren(_imports, visitor);
-    safelyVisitChildren(_parts, visitor);
-  }
+  bool get isBrowserApplication =>
+      entryPoint != null && isOrImportsBrowserLibrary;
 
   @override
-  String get identifier => _definingCompilationUnit.source.encoding;
+  bool get isDartCore => name == "dart.core";
 
-  /**
-   * Recursively fills set of visible libraries for [getVisibleElementsLibraries].
-   */
-  void _addVisibleLibraries(Set<LibraryElement> visibleLibraries, bool includeExports) {
-    // maybe already processed
-    if (!visibleLibraries.add(this)) {
-      return;
-    }
-    // add imported libraries
-    for (ImportElement importElement in _imports) {
-      LibraryElement importedLibrary = importElement.importedLibrary;
-      if (importedLibrary != null) {
-        (importedLibrary as LibraryElementImpl)._addVisibleLibraries(visibleLibraries, true);
-      }
-    }
-    // add exported libraries
-    if (includeExports) {
-      for (ExportElement exportElement in _exports) {
-        LibraryElement exportedLibrary = exportElement.exportedLibrary;
-        if (exportedLibrary != null) {
-          (exportedLibrary as LibraryElementImpl)._addVisibleLibraries(visibleLibraries, true);
-        }
-      }
-    }
-  }
-
-  /**
-   * Return the object representing the type "Future" from the dart:async library, or the type
-   * "void" if the type "Future" cannot be accessed.
-   *
-   * @return the type "Future" from the dart:async library
-   */
-  DartType get loadLibraryReturnType {
-    try {
-      Source asyncSource = context.sourceFactory.forUri(DartSdk.DART_ASYNC);
-      if (asyncSource == null) {
-        AnalysisEngine.instance.logger.logError("Could not create a source for dart:async");
-        return VoidTypeImpl.instance;
-      }
-      LibraryElement asyncElement = context.computeLibraryElement(asyncSource);
-      if (asyncElement == null) {
-        AnalysisEngine.instance.logger.logError("Could not build the element model for dart:async");
-        return VoidTypeImpl.instance;
-      }
-      ClassElement futureElement = asyncElement.getType("Future");
-      if (futureElement == null) {
-        AnalysisEngine.instance.logger.logError("Could not find type Future in dart:async");
-        return VoidTypeImpl.instance;
-      }
-      InterfaceType futureType = futureElement.type;
-      return futureType.substitute4(<DartType> [DynamicTypeImpl.instance]);
-    } on AnalysisException catch (exception, stackTrace) {
-      AnalysisEngine.instance.logger.logError(
-          "Could not build the element model for dart:async",
-          new CaughtException(exception, stackTrace));
-      return VoidTypeImpl.instance;
-    }
-  }
+  @override
+  bool get isInSdk =>
+      StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x74, 0x2E);
 
   /**
    * Answer `true` if the receiver directly or indirectly imports the dart:html libraries.
@@ -8219,6 +8481,260 @@
     }
     return false;
   }
+
+  @override
+  ElementKind get kind => ElementKind.LIBRARY;
+
+  @override
+  LibraryElement get library => this;
+
+  @override
+  FunctionElement get loadLibraryFunction {
+    if (_loadLibraryFunction == null) {
+      FunctionElementImpl function =
+          new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
+      function.synthetic = true;
+      function.enclosingElement = this;
+      function.returnType = loadLibraryReturnType;
+      function.type = new FunctionTypeImpl.con1(function);
+      _loadLibraryFunction = function;
+    }
+    return _loadLibraryFunction;
+  }
+
+  /**
+   * Return the object representing the type "Future" from the dart:async library, or the type
+   * "void" if the type "Future" cannot be accessed.
+   *
+   * @return the type "Future" from the dart:async library
+   */
+  DartType get loadLibraryReturnType {
+    try {
+      Source asyncSource = context.sourceFactory.forUri(DartSdk.DART_ASYNC);
+      if (asyncSource == null) {
+        AnalysisEngine.instance.logger.logError(
+            "Could not create a source for dart:async");
+        return VoidTypeImpl.instance;
+      }
+      LibraryElement asyncElement = context.computeLibraryElement(asyncSource);
+      if (asyncElement == null) {
+        AnalysisEngine.instance.logger.logError(
+            "Could not build the element model for dart:async");
+        return VoidTypeImpl.instance;
+      }
+      ClassElement futureElement = asyncElement.getType("Future");
+      if (futureElement == null) {
+        AnalysisEngine.instance.logger.logError(
+            "Could not find type Future in dart:async");
+        return VoidTypeImpl.instance;
+      }
+      InterfaceType futureType = futureElement.type;
+      return futureType.substitute4(<DartType>[DynamicTypeImpl.instance]);
+    } on AnalysisException catch (exception, stackTrace) {
+      AnalysisEngine.instance.logger.logError(
+          "Could not build the element model for dart:async",
+          new CaughtException(exception, stackTrace));
+      return VoidTypeImpl.instance;
+    }
+  }
+
+  @override
+  List<CompilationUnitElement> get parts => _parts;
+
+  /**
+   * Set the compilation units that are included in this library using a `part` directive.
+   *
+   * @param parts the compilation units that are included in this library using a `part`
+   *          directive
+   */
+  void set parts(List<CompilationUnitElement> parts) {
+    for (CompilationUnitElement compilationUnit in parts) {
+      (compilationUnit as CompilationUnitElementImpl).enclosingElement = this;
+    }
+    this._parts = parts;
+  }
+
+  @override
+  List<PrefixElement> get prefixes {
+    HashSet<PrefixElement> prefixes = new HashSet<PrefixElement>();
+    for (ImportElement element in _imports) {
+      PrefixElement prefix = element.prefix;
+      if (prefix != null) {
+        prefixes.add(prefix);
+      }
+    }
+    return new List.from(prefixes);
+  }
+
+  @override
+  Source get source {
+    if (_definingCompilationUnit == null) {
+      return null;
+    }
+    return _definingCompilationUnit.source;
+  }
+
+  @override
+  List<CompilationUnitElement> get units {
+    List<CompilationUnitElement> units =
+        new List<CompilationUnitElement>(1 + _parts.length);
+    units[0] = _definingCompilationUnit;
+    JavaSystem.arraycopy(_parts, 0, units, 1, _parts.length);
+    return units;
+  }
+
+  @override
+  List<LibraryElement> get visibleLibraries {
+    Set<LibraryElement> visibleLibraries = new Set();
+    _addVisibleLibraries(visibleLibraries, false);
+    return new List.from(visibleLibraries);
+  }
+
+  @override
+  bool operator ==(Object object) =>
+      object != null &&
+          runtimeType == object.runtimeType &&
+          _definingCompilationUnit ==
+              (object as LibraryElementImpl).definingCompilationUnit;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
+
+  @override
+  ElementImpl getChild(String identifier) {
+    if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier ==
+        identifier) {
+      return _definingCompilationUnit as CompilationUnitElementImpl;
+    }
+    for (CompilationUnitElement part in _parts) {
+      if ((part as CompilationUnitElementImpl).identifier == identifier) {
+        return part as CompilationUnitElementImpl;
+      }
+    }
+    for (ImportElement importElement in _imports) {
+      if ((importElement as ImportElementImpl).identifier == identifier) {
+        return importElement as ImportElementImpl;
+      }
+    }
+    for (ExportElement exportElement in _exports) {
+      if ((exportElement as ExportElementImpl).identifier == identifier) {
+        return exportElement as ExportElementImpl;
+      }
+    }
+    return null;
+  }
+
+  @override
+  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement) {
+    int count = _imports.length;
+    List<ImportElement> importList = new List<ImportElement>();
+    for (int i = 0; i < count; i++) {
+      if (identical(_imports[i].prefix, prefixElement)) {
+        importList.add(_imports[i]);
+      }
+    }
+    return importList;
+  }
+
+  @override
+  ClassElement getType(String className) {
+    ClassElement type = _definingCompilationUnit.getType(className);
+    if (type != null) {
+      return type;
+    }
+    for (CompilationUnitElement part in _parts) {
+      type = part.getType(className);
+      if (type != null) {
+        return type;
+      }
+    }
+    return null;
+  }
+
+  @override
+  bool isUpToDate(int timeStamp) {
+    Set<LibraryElement> visitedLibraries = new Set();
+    return _safeIsUpToDate(this, timeStamp, visitedLibraries);
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(_definingCompilationUnit, visitor);
+    safelyVisitChildren(_exports, visitor);
+    safelyVisitChildren(_imports, visitor);
+    safelyVisitChildren(_parts, visitor);
+  }
+
+  /**
+   * Recursively fills set of visible libraries for [getVisibleElementsLibraries].
+   */
+  void _addVisibleLibraries(Set<LibraryElement> visibleLibraries,
+      bool includeExports) {
+    // maybe already processed
+    if (!visibleLibraries.add(this)) {
+      return;
+    }
+    // add imported libraries
+    for (ImportElement importElement in _imports) {
+      LibraryElement importedLibrary = importElement.importedLibrary;
+      if (importedLibrary != null) {
+        (importedLibrary as LibraryElementImpl)._addVisibleLibraries(
+            visibleLibraries,
+            true);
+      }
+    }
+    // add exported libraries
+    if (includeExports) {
+      for (ExportElement exportElement in _exports) {
+        LibraryElement exportedLibrary = exportElement.exportedLibrary;
+        if (exportedLibrary != null) {
+          (exportedLibrary as LibraryElementImpl)._addVisibleLibraries(
+              visibleLibraries,
+              true);
+        }
+      }
+    }
+  }
+
+  /**
+   * Determine if the given library is up to date with respect to the given time stamp.
+   *
+   * @param library the library to process
+   * @param timeStamp the time stamp to check against
+   * @param visitedLibraries the set of visited libraries
+   */
+  static bool _safeIsUpToDate(LibraryElement library, int timeStamp,
+      Set<LibraryElement> visitedLibraries) {
+    if (!visitedLibraries.contains(library)) {
+      visitedLibraries.add(library);
+      AnalysisContext context = library.context;
+      // Check the defining compilation unit.
+      if (timeStamp <
+          context.getModificationStamp(library.definingCompilationUnit.source)) {
+        return false;
+      }
+      // Check the parted compilation units.
+      for (CompilationUnitElement element in library.parts) {
+        if (timeStamp < context.getModificationStamp(element.source)) {
+          return false;
+        }
+      }
+      // Check the imported libraries.
+      for (LibraryElement importedLibrary in library.importedLibraries) {
+        if (!_safeIsUpToDate(importedLibrary, timeStamp, visitedLibraries)) {
+          return false;
+        }
+      }
+      // Check the exported libraries.
+      for (LibraryElement exportedLibrary in library.exportedLibraries) {
+        if (!_safeIsUpToDate(exportedLibrary, timeStamp, visitedLibraries)) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
 }
 
 /**
@@ -8260,7 +8776,15 @@
 /**
  * Instances of the class `LocalVariableElementImpl` implement a `LocalVariableElement`.
  */
-class LocalVariableElementImpl extends VariableElementImpl implements LocalVariableElement {
+class LocalVariableElementImpl extends VariableElementImpl implements
+    LocalVariableElement {
+  /**
+   * An empty list of field elements.
+   */
+  static const List<LocalVariableElement> EMPTY_ARRAY = const
+      <LocalVariableElement>[
+      ];
+
   /**
    * The offset to the beginning of the visible range for this element.
    */
@@ -8273,9 +8797,14 @@
   int _visibleRangeLength = -1;
 
   /**
-   * An empty array of field elements.
+   * Initialize a newly created method element to have the given name.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<LocalVariableElement> EMPTY_ARRAY = new List<LocalVariableElement>(0);
+  LocalVariableElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   /**
    * Initialize a newly created local variable element to have the given name.
@@ -8284,35 +8813,49 @@
    */
   LocalVariableElementImpl.forNode(Identifier name) : super.forNode(name);
 
-  /**
-   * Initialize a newly created method element to have the given name.
-   *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
-   */
-  LocalVariableElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
   @override
-  accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this);
-
-  @override
-  bool get isUsed {
-    return hasModifier(Modifier.IS_USED_IN_LIBRARY);
+  String get identifier {
+    int enclosingOffset =
+        enclosingElement != null ? enclosingElement.nameOffset : 0;
+    int delta = nameOffset - enclosingOffset;
+    return '${super.identifier}@$delta';
   }
 
   @override
+  bool get isPotentiallyMutatedInClosure =>
+      hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT);
+
+  @override
+  bool get isPotentiallyMutatedInScope =>
+      hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE);
+
+  @override
   ElementKind get kind => ElementKind.LOCAL_VARIABLE;
 
   @override
   List<ToolkitObjectElement> get toolkitObjects {
-    CompilationUnitElementImpl unit = getAncestor((element) => element is CompilationUnitElementImpl);
+    CompilationUnitElementImpl unit =
+        getAncestor((element) => element is CompilationUnitElementImpl);
     if (unit == null) {
       return ToolkitObjectElement.EMPTY_ARRAY;
     }
     return unit._getToolkitObjects(this);
   }
 
+  /**
+   * Set the toolkit specific information objects attached to this variable.
+   *
+   * @param toolkitObjects the toolkit objects attached to this variable
+   */
+  void set toolkitObjects(List<ToolkitObjectElement> toolkitObjects) {
+    CompilationUnitElementImpl unit =
+        getAncestor((element) => element is CompilationUnitElementImpl);
+    if (unit == null) {
+      return;
+    }
+    unit._setToolkitObjects(this, toolkitObjects);
+  }
+
   @override
   SourceRange get visibleRange {
     if (_visibleRangeLength < 0) {
@@ -8322,10 +8865,14 @@
   }
 
   @override
-  bool get isPotentiallyMutatedInClosure => hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT);
+  accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this);
 
   @override
-  bool get isPotentiallyMutatedInScope => hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE);
+  void appendTo(StringBuffer buffer) {
+    buffer.write(type);
+    buffer.write(" ");
+    buffer.write(displayName);
+  }
 
   /**
    * Specifies that this variable is potentially mutated somewhere in closure.
@@ -8342,19 +8889,6 @@
   }
 
   /**
-   * Set the toolkit specific information objects attached to this variable.
-   *
-   * @param toolkitObjects the toolkit objects attached to this variable
-   */
-  void set toolkitObjects(List<ToolkitObjectElement> toolkitObjects) {
-    CompilationUnitElementImpl unit = getAncestor((element) => element is CompilationUnitElementImpl);
-    if (unit == null) {
-      return;
-    }
-    unit._setToolkitObjects(this, toolkitObjects);
-  }
-
-  /**
    * Set the visible range for this element to the range starting at the given offset with the given
    * length.
    *
@@ -8366,16 +8900,6 @@
     _visibleRangeOffset = offset;
     _visibleRangeLength = length;
   }
-
-  @override
-  void appendTo(StringBuffer buffer) {
-    buffer.write(type);
-    buffer.write(" ");
-    buffer.write(displayName);
-  }
-
-  @override
-  String get identifier => "${super.identifier}@$nameOffset";
 }
 
 /**
@@ -8401,12 +8925,6 @@
    */
   Member(this._baseElement, this._definingType);
 
-  @override
-  String computeDocumentationComment() => _baseElement.computeDocumentationComment();
-
-  @override
-  Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(predicate);
-
   /**
    * Return the element on which the parameterized element was created.
    *
@@ -8417,11 +8935,30 @@
   @override
   AnalysisContext get context => _baseElement.context;
 
+  /**
+   * Return the type in which the element is defined.
+   *
+   * @return the type in which the element is defined
+   */
+  ParameterizedType get definingType => _definingType;
+
   @override
   String get displayName => _baseElement.displayName;
 
   @override
-  String getExtendedDisplayName(String shortName) => _baseElement.getExtendedDisplayName(shortName);
+  bool get isDeprecated => _baseElement.isDeprecated;
+
+  @override
+  bool get isOverride => _baseElement.isOverride;
+
+  @override
+  bool get isPrivate => _baseElement.isPrivate;
+
+  @override
+  bool get isPublic => _baseElement.isPublic;
+
+  @override
+  bool get isSynthetic => _baseElement.isSynthetic;
 
   @override
   ElementKind get kind => _baseElement.kind;
@@ -8451,34 +8988,20 @@
   CompilationUnit get unit => _baseElement.unit;
 
   @override
-  bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(library);
+  String computeDocumentationComment() =>
+      _baseElement.computeDocumentationComment();
 
   @override
-  bool get isDeprecated => _baseElement.isDeprecated;
+  Element getAncestor(Predicate<Element> predicate) =>
+      baseElement.getAncestor(predicate);
 
   @override
-  bool get isOverride => _baseElement.isOverride;
+  String getExtendedDisplayName(String shortName) =>
+      _baseElement.getExtendedDisplayName(shortName);
 
   @override
-  bool get isPrivate => _baseElement.isPrivate;
-
-  @override
-  bool get isPublic => _baseElement.isPublic;
-
-  @override
-  bool get isSynthetic => _baseElement.isSynthetic;
-
-  @override
-  void visitChildren(ElementVisitor visitor) {
-    // There are no children to visit
-  }
-
-  /**
-   * Return the type in which the element is defined.
-   *
-   * @return the type in which the element is defined
-   */
-  ParameterizedType get definingType => _definingType;
+  bool isAccessibleIn(LibraryElement library) =>
+      _baseElement.isAccessibleIn(library);
 
   /**
    * If the given child is not `null`, use the given visitor to visit it.
@@ -8518,7 +9041,8 @@
       return null;
     }
     List<DartType> argumentTypes = _definingType.typeArguments;
-    List<DartType> parameterTypes = TypeParameterTypeImpl.getTypes(_definingType.typeParameters);
+    List<DartType> parameterTypes =
+        TypeParameterTypeImpl.getTypes(_definingType.typeParameters);
     return type.substitute2(argumentTypes, parameterTypes);
   }
 
@@ -8537,6 +9061,11 @@
     }
     return substitutedTypes;
   }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    // There are no children to visit
+  }
 }
 
 /**
@@ -8545,6 +9074,14 @@
  */
 abstract class MethodElement implements ClassMemberElement, ExecutableElement {
   /**
+   * Return `true` if this method is abstract. Methods are abstract if they are not external
+   * and have no body.
+   *
+   * @return `true` if this method is abstract
+   */
+  bool get isAbstract;
+
+  /**
    * Return the resolved [MethodDeclaration] node that declares this [MethodElement].
    *
    * This method is expensive, because resolved AST might be evicted from cache, so parsing and
@@ -8554,14 +9091,6 @@
    */
   @override
   MethodDeclaration get node;
-
-  /**
-   * Return `true` if this method is abstract. Methods are abstract if they are not external
-   * and have no body.
-   *
-   * @return `true` if this method is abstract
-   */
-  bool get isAbstract;
 }
 
 /**
@@ -8569,16 +9098,9 @@
  */
 class MethodElementImpl extends ExecutableElementImpl implements MethodElement {
   /**
-   * An empty array of method elements.
+   * An empty list of method elements.
    */
-  static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0);
-
-  /**
-   * Initialize a newly created method element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  MethodElementImpl.forNode(Identifier name) : super.forNode(name);
+  static const List<MethodElement> EMPTY_ARRAY = const <MethodElement>[];
 
   /**
    * Initialize a newly created method element to have the given name.
@@ -8589,8 +9111,21 @@
    */
   MethodElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
+  /**
+   * Initialize a newly created method element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  MethodElementImpl.forNode(Identifier name) : super.forNode(name);
+
+  /**
+   * Set whether this method is abstract to correspond to the given value.
+   *
+   * @param isAbstract `true` if the method is abstract
+   */
+  void set abstract(bool isAbstract) {
+    setModifier(Modifier.ABSTRACT, isAbstract);
+  }
 
   @override
   String get displayName {
@@ -8605,6 +9140,25 @@
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
 
   @override
+  bool get isAbstract => hasModifier(Modifier.ABSTRACT);
+
+  @override
+  bool get isOperator {
+    String name = displayName;
+    if (name.isEmpty) {
+      return false;
+    }
+    int first = name.codeUnitAt(0);
+    return !((0x61 <= first && first <= 0x7A) ||
+        (0x41 <= first && first <= 0x5A) ||
+        first == 0x5F ||
+        first == 0x24);
+  }
+
+  @override
+  bool get isStatic => hasModifier(Modifier.STATIC);
+
+  @override
   ElementKind get kind => ElementKind.METHOD;
 
   @override
@@ -8619,32 +9173,8 @@
   }
 
   @override
-  MethodDeclaration get node => getNodeMatching((node) => node is MethodDeclaration);
-
-  @override
-  bool get isAbstract => hasModifier(Modifier.ABSTRACT);
-
-  @override
-  bool get isOperator {
-    String name = displayName;
-    if (name.isEmpty) {
-      return false;
-    }
-    int first = name.codeUnitAt(0);
-    return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A) || first == 0x5F || first == 0x24);
-  }
-
-  @override
-  bool get isStatic => hasModifier(Modifier.STATIC);
-
-  /**
-   * Set whether this method is abstract to correspond to the given value.
-   *
-   * @param isAbstract `true` if the method is abstract
-   */
-  void set abstract(bool isAbstract) {
-    setModifier(Modifier.ABSTRACT, isAbstract);
-  }
+  MethodDeclaration get node =>
+      getNodeMatching((node) => node is MethodDeclaration);
 
   /**
    * Set whether this method is static to correspond to the given value.
@@ -8656,6 +9186,9 @@
   }
 
   @override
+  accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
+
+  @override
   void appendTo(StringBuffer buffer) {
     buffer.write(enclosingElement.displayName);
     buffer.write(".");
@@ -8670,42 +9203,13 @@
  */
 class MethodMember extends ExecutableMember implements MethodElement {
   /**
-   * If the given method's type is different when any type parameters from the defining type's
-   * declaration are replaced with the actual type arguments from the defining type, create a method
-   * member representing the given method. Return the member that was created, or the base method if
-   * no member was created.
-   *
-   * @param baseMethod the base method for which a member might be created
-   * @param definingType the type defining the parameters and arguments to be used in the
-   *          substitution
-   * @return the method element that will return the correctly substituted types
-   */
-  static MethodElement from(MethodElement baseMethod, InterfaceType definingType) {
-    if (baseMethod == null || definingType.typeArguments.length == 0) {
-      return baseMethod;
-    }
-    FunctionType baseType = baseMethod.type;
-    List<DartType> argumentTypes = definingType.typeArguments;
-    List<DartType> parameterTypes = definingType.element.type.typeArguments;
-    FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
-    if (baseType == substitutedType) {
-      return baseMethod;
-    }
-    // TODO(brianwilkerson) Consider caching the substituted type in the instance. It would use more
-    // memory but speed up some operations. We need to see how often the type is being re-computed.
-    return new MethodMember(baseMethod, definingType);
-  }
-
-  /**
    * Initialize a newly created element to represent a method of the given parameterized type.
    *
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  MethodMember(MethodElement baseElement, InterfaceType definingType) : super(baseElement, definingType);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
+  MethodMember(MethodElement baseElement, InterfaceType definingType)
+      : super(baseElement, definingType);
 
   @override
   MethodElement get baseElement => super.baseElement as MethodElement;
@@ -8714,10 +9218,13 @@
   ClassElement get enclosingElement => baseElement.enclosingElement;
 
   @override
+  bool get isAbstract => baseElement.isAbstract;
+
+  @override
   MethodDeclaration get node => baseElement.node;
 
   @override
-  bool get isAbstract => baseElement.isAbstract;
+  accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
 
   @override
   String toString() {
@@ -8743,6 +9250,36 @@
     }
     return buffer.toString();
   }
+
+  /**
+   * If the given method's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a method
+   * member representing the given method. Return the member that was created, or the base method if
+   * no member was created.
+   *
+   * @param baseMethod the base method for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   *          substitution
+   * @return the method element that will return the correctly substituted types
+   */
+  static MethodElement from(MethodElement baseMethod,
+      InterfaceType definingType) {
+    if (baseMethod == null || definingType.typeArguments.length == 0) {
+      return baseMethod;
+    }
+    FunctionType baseType = baseMethod.type;
+    List<DartType> argumentTypes = definingType.typeArguments;
+    List<DartType> parameterTypes = definingType.element.type.typeArguments;
+    FunctionType substitutedType =
+        baseType.substitute2(argumentTypes, parameterTypes);
+    if (baseType == substitutedType) {
+      return baseMethod;
+    }
+    // TODO(brianwilkerson) Consider caching the substituted type in the
+    // instance. It would use more memory but speed up some operations.
+    // We need to see how often the type is being re-computed.
+    return new MethodMember(baseMethod, definingType);
+  }
 }
 
 /**
@@ -8802,36 +9339,34 @@
   static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 9);
 
   /**
-   * Indicates that the element is used in the declaring library.
-   *
-   *
-   * For a top-level element: it is public, or it is private and used in the
-   * defining library.
-   *
-   * For a local variable: its value is used (i.e. purely read or invoked)
-   * somewhere in its scope.
-   */
-  static const Modifier IS_USED_IN_LIBRARY = const Modifier('IS_USED_IN_LIBRARY', 10);
-
-  /**
    * Indicates that a class can validly be used as a mixin.
    */
-  static const Modifier MIXIN = const Modifier('MIXIN', 11);
+  static const Modifier MIXIN = const Modifier('MIXIN', 10);
+
+  /**
+   * Indicates that an error has reported explaining why this class is an
+   * invalid mixin application.
+   */
+  static const Modifier MIXIN_ERRORS_REPORTED =
+      const Modifier('MIXIN_ERRORS_REPORTED', 11);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated within the context.
    */
-  static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT = const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 12);
+  static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT =
+      const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 12);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated within the scope.
    */
-  static const Modifier POTENTIALLY_MUTATED_IN_SCOPE = const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 13);
+  static const Modifier POTENTIALLY_MUTATED_IN_SCOPE =
+      const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 13);
 
   /**
    * Indicates that a class contains an explicit reference to 'super'.
    */
-  static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 14);
+  static const Modifier REFERENCES_SUPER =
+      const Modifier('REFERENCES_SUPER', 14);
 
   /**
    * Indicates that the pseudo-modifier 'set' was applied to the element.
@@ -8867,8 +9402,8 @@
       GENERATOR,
       GETTER,
       HAS_EXT_URI,
-      IS_USED_IN_LIBRARY,
       MIXIN,
+      MIXIN_ERRORS_REPORTED,
       POTENTIALLY_MUTATED_IN_CONTEXT,
       POTENTIALLY_MUTATED_IN_SCOPE,
       REFERENCES_SUPER,
@@ -8910,14 +9445,145 @@
  */
 class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
   /**
+   * The analysis context in which the multiply defined elements are defined.
+   */
+  final AnalysisContext context;
+
+  /**
+   * The name of the conflicting elements.
+   */
+  String _name;
+
+  /**
+   * A list containing all of the elements that conflict.
+   */
+  final List<Element> conflictingElements;
+
+  /**
+   * Initialize a newly created element to represent a list of conflicting elements.
+   *
+   * @param context the analysis context in which the multiply defined elements are defined
+   * @param conflictingElements the elements that conflict
+   */
+  MultiplyDefinedElementImpl(this.context, this.conflictingElements) {
+    _name = conflictingElements[0].name;
+  }
+
+  @override
+  String get displayName => _name;
+
+  @override
+  Element get enclosingElement => null;
+
+  @override
+  bool get isDeprecated => false;
+
+  @override
+  bool get isOverride => false;
+
+  @override
+  bool get isPrivate {
+    String name = displayName;
+    if (name == null) {
+      return false;
+    }
+    return Identifier.isPrivateName(name);
+  }
+
+  @override
+  bool get isPublic => !isPrivate;
+
+  @override
+  bool get isSynthetic => true;
+
+  @override
+  ElementKind get kind => ElementKind.ERROR;
+
+  @override
+  LibraryElement get library => null;
+
+  @override
+  ElementLocation get location => null;
+
+  @override
+  List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY;
+
+  @override
+  String get name => _name;
+
+  @override
+  int get nameOffset => -1;
+
+  @override
+  AstNode get node => null;
+
+  @override
+  Source get source => null;
+
+  @override
+  DartType get type => DynamicTypeImpl.instance;
+
+  @override
+  CompilationUnit get unit => null;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this);
+
+  @override
+  String computeDocumentationComment() => null;
+
+  @override
+  Element getAncestor(Predicate<Element> predicate) => null;
+
+  @override
+  String getExtendedDisplayName(String shortName) {
+    if (shortName != null) {
+      return shortName;
+    }
+    return displayName;
+  }
+
+  @override
+  bool isAccessibleIn(LibraryElement library) {
+    for (Element element in conflictingElements) {
+      if (element.isAccessibleIn(library)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("[");
+    int count = conflictingElements.length;
+    for (int i = 0; i < count; i++) {
+      if (i > 0) {
+        buffer.write(", ");
+      }
+      (conflictingElements[i] as ElementImpl).appendTo(buffer);
+    }
+    buffer.write("]");
+    return buffer.toString();
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    // There are no children to visit
+  }
+
+  /**
    * Return an element that represents the given conflicting elements.
    *
    * @param context the analysis context in which the multiply defined elements are defined
    * @param firstElement the first element that conflicts
    * @param secondElement the second element that conflicts
    */
-  static Element fromElements(AnalysisContext context, Element firstElement, Element secondElement) {
-    List<Element> conflictingElements = _computeConflictingElements(firstElement, secondElement);
+  static Element fromElements(AnalysisContext context, Element firstElement,
+      Element secondElement) {
+    List<Element> conflictingElements =
+        _computeConflictingElements(firstElement, secondElement);
     int length = conflictingElements.length;
     if (length == 0) {
       return null;
@@ -8953,141 +9619,13 @@
    * @param secondElement the second element to be included
    * @return an array containing all of the conflicting elements
    */
-  static List<Element> _computeConflictingElements(Element firstElement, Element secondElement) {
+  static List<Element> _computeConflictingElements(Element firstElement,
+      Element secondElement) {
     HashSet<Element> elements = new HashSet<Element>();
     _add(elements, firstElement);
     _add(elements, secondElement);
     return new List.from(elements);
   }
-
-  /**
-   * The analysis context in which the multiply defined elements are defined.
-   */
-  final AnalysisContext context;
-
-  /**
-   * The name of the conflicting elements.
-   */
-  String _name;
-
-  /**
-   * A list containing all of the elements that conflict.
-   */
-  final List<Element> conflictingElements;
-
-  /**
-   * Initialize a newly created element to represent a list of conflicting elements.
-   *
-   * @param context the analysis context in which the multiply defined elements are defined
-   * @param conflictingElements the elements that conflict
-   */
-  MultiplyDefinedElementImpl(this.context, this.conflictingElements) {
-    _name = conflictingElements[0].name;
-  }
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this);
-
-  @override
-  String computeDocumentationComment() => null;
-
-  @override
-  Element getAncestor(Predicate<Element> predicate) => null;
-
-  @override
-  String get displayName => _name;
-
-  @override
-  Element get enclosingElement => null;
-
-  @override
-  String getExtendedDisplayName(String shortName) {
-    if (shortName != null) {
-      return shortName;
-    }
-    return displayName;
-  }
-
-  @override
-  ElementKind get kind => ElementKind.ERROR;
-
-  @override
-  LibraryElement get library => null;
-
-  @override
-  ElementLocation get location => null;
-
-  @override
-  List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY;
-
-  @override
-  String get name => _name;
-
-  @override
-  int get nameOffset => -1;
-
-  @override
-  AstNode get node => null;
-
-  @override
-  Source get source => null;
-
-  @override
-  DartType get type => DynamicTypeImpl.instance;
-
-  @override
-  CompilationUnit get unit => null;
-
-  @override
-  bool isAccessibleIn(LibraryElement library) {
-    for (Element element in conflictingElements) {
-      if (element.isAccessibleIn(library)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  @override
-  bool get isDeprecated => false;
-
-  @override
-  bool get isOverride => false;
-
-  @override
-  bool get isPrivate {
-    String name = displayName;
-    if (name == null) {
-      return false;
-    }
-    return Identifier.isPrivateName(name);
-  }
-
-  @override
-  bool get isPublic => !isPrivate;
-
-  @override
-  bool get isSynthetic => true;
-
-  @override
-  String toString() {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write("[");
-    int count = conflictingElements.length;
-    for (int i = 0; i < count; i++) {
-      if (i > 0) {
-        buffer.write(", ");
-      }
-      (conflictingElements[i] as ElementImpl).appendTo(buffer);
-    }
-    buffer.write("]");
-    return buffer.toString();
-  }
-
-  @override
-  void visitChildren(ElementVisitor visitor) {
-    // There are no children to visit
-  }
 }
 
 /**
@@ -9110,7 +9648,8 @@
  * [MethodElementImpl], with the additional information of an array of
  * [ExecutableElement]s from which this element was composed.
  */
-class MultiplyInheritedMethodElementImpl extends MethodElementImpl implements MultiplyInheritedExecutableElement {
+class MultiplyInheritedMethodElementImpl extends MethodElementImpl implements
+    MultiplyInheritedExecutableElement {
   /**
    * An array the array of executable elements that were used to compose this element.
    */
@@ -9133,13 +9672,15 @@
  * an [PropertyAccessorElementImpl], with the additional information of an array of
  * [ExecutableElement]s from which this element was composed.
  */
-class MultiplyInheritedPropertyAccessorElementImpl extends PropertyAccessorElementImpl implements MultiplyInheritedExecutableElement {
+class MultiplyInheritedPropertyAccessorElementImpl extends
+    PropertyAccessorElementImpl implements MultiplyInheritedExecutableElement {
   /**
    * An array the array of executable elements that were used to compose this element.
    */
   List<ExecutableElement> _elements = PropertyAccessorElementImpl.EMPTY_ARRAY;
 
-  MultiplyInheritedPropertyAccessorElementImpl(Identifier name) : super.forNode(name) {
+  MultiplyInheritedPropertyAccessorElementImpl(Identifier name)
+      : super.forNode(name) {
     synthetic = true;
   }
 
@@ -9157,9 +9698,11 @@
  */
 abstract class NamespaceCombinator {
   /**
-   * An empty array of namespace combinators.
+   * An empty list of namespace combinators.
    */
-  static const List<NamespaceCombinator> EMPTY_ARRAY = const <NamespaceCombinator>[];
+  static const List<NamespaceCombinator> EMPTY_ARRAY = const
+      <NamespaceCombinator>[
+      ];
 }
 
 /**
@@ -9175,6 +9718,13 @@
   String get defaultValueCode;
 
   /**
+   * Return `true` if this parameter is an initializing formal parameter.
+   *
+   * @return `true` if this parameter is an initializing formal parameter
+   */
+  bool get isInitializingFormal;
+
+  /**
    * Return the kind of this parameter.
    *
    * @return the kind of this parameter
@@ -9188,19 +9738,18 @@
    * @return the parameters defined by this parameter element
    */
   List<ParameterElement> get parameters;
-
-  /**
-   * Return `true` if this parameter is an initializing formal parameter.
-   *
-   * @return `true` if this parameter is an initializing formal parameter
-   */
-  bool get isInitializingFormal;
 }
 
 /**
  * Instances of the class `ParameterElementImpl` implement a `ParameterElement`.
  */
-class ParameterElementImpl extends VariableElementImpl implements ParameterElement {
+class ParameterElementImpl extends VariableElementImpl implements
+    ParameterElement {
+  /**
+   * An empty list of field elements.
+   */
+  static const List<ParameterElement> EMPTY_ARRAY = const <ParameterElement>[];
+
   /**
    * An array containing all of the parameters defined by this parameter element. There will only be
    * parameters if this parameter is a function typed parameter.
@@ -9229,18 +9778,6 @@
   int _visibleRangeLength = -1;
 
   /**
-   * An empty array of field elements.
-   */
-  static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0);
-
-  /**
-   * Initialize a newly created parameter element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  ParameterElementImpl.forNode(Identifier name) : super.forNode(name);
-
-  /**
    * Initialize a newly created parameter element to have the given name.
    *
    * @param name the name of this element
@@ -9249,59 +9786,16 @@
    */
   ParameterElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
-
-  @override
-  ElementImpl getChild(String identifier) {
-    for (ParameterElement parameter in _parameters) {
-      if ((parameter as ParameterElementImpl).identifier == identifier) {
-        return parameter as ParameterElementImpl;
-      }
-    }
-    return null;
-  }
+  /**
+   * Initialize a newly created parameter element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  ParameterElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
   String get defaultValueCode => _defaultValueCode;
 
-  @override
-  ElementKind get kind => ElementKind.PARAMETER;
-
-  @override
-  List<ParameterElement> get parameters => _parameters;
-
-  @override
-  SourceRange get visibleRange {
-    if (_visibleRangeLength < 0) {
-      return null;
-    }
-    return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
-  }
-
-  @override
-  bool get isInitializingFormal => false;
-
-  @override
-  bool get isPotentiallyMutatedInClosure => hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT);
-
-  @override
-  bool get isPotentiallyMutatedInScope => hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE);
-
-  /**
-   * Specifies that this variable is potentially mutated somewhere in closure.
-   */
-  void markPotentiallyMutatedInClosure() {
-    setModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT, true);
-  }
-
-  /**
-   * Specifies that this variable is potentially mutated somewhere in its scope.
-   */
-  void markPotentiallyMutatedInScope() {
-    setModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE, true);
-  }
-
   /**
    * Set Dart code of the default value.
    */
@@ -9309,6 +9803,23 @@
     this._defaultValueCode = StringUtilities.intern(defaultValueCode);
   }
 
+  @override
+  bool get isInitializingFormal => false;
+
+  @override
+  bool get isPotentiallyMutatedInClosure =>
+      hasModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT);
+
+  @override
+  bool get isPotentiallyMutatedInScope =>
+      hasModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE);
+
+  @override
+  ElementKind get kind => ElementKind.PARAMETER;
+
+  @override
+  List<ParameterElement> get parameters => _parameters;
+
   /**
    * Set the parameters defined by this executable element to the given parameters.
    *
@@ -9321,24 +9832,16 @@
     this._parameters = parameters;
   }
 
-  /**
-   * Set the visible range for this element to the range starting at the given offset with the given
-   * length.
-   *
-   * @param offset the offset to the beginning of the visible range for this element
-   * @param length the length of the visible range for this element, or `-1` if this element
-   *          does not have a visible range
-   */
-  void setVisibleRange(int offset, int length) {
-    _visibleRangeOffset = offset;
-    _visibleRangeLength = length;
+  @override
+  SourceRange get visibleRange {
+    if (_visibleRangeLength < 0) {
+      return null;
+    }
+    return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
   }
 
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(_parameters, visitor);
-  }
+  accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -9379,131 +9882,48 @@
       buffer.write(_defaultValueCode);
     }
   }
-}
 
-/**
- * Instances of the class `ParameterMember` represent a parameter element defined in a
- * parameterized type where the values of the type parameters are known.
- */
-class ParameterMember extends VariableMember implements ParameterElement {
-  /**
-   * If the given parameter's type is different when any type parameters from the defining type's
-   * declaration are replaced with the actual type arguments from the defining type, create a
-   * parameter member representing the given parameter. Return the member that was created, or the
-   * base parameter if no member was created.
-   *
-   * @param baseParameter the base parameter for which a member might be created
-   * @param definingType the type defining the parameters and arguments to be used in the
-   *          substitution
-   * @return the parameter element that will return the correctly substituted types
-   */
-  static ParameterElement from(ParameterElement baseParameter, ParameterizedType definingType) {
-    if (baseParameter == null || definingType.typeArguments.length == 0) {
-      return baseParameter;
-    }
-    // Check if parameter type depends on defining type type arguments.
-    // It is possible that we did not resolve field formal parameter yet, so skip this check for it.
-    bool isFieldFormal = baseParameter is FieldFormalParameterElement;
-    if (!isFieldFormal) {
-      DartType baseType = baseParameter.type;
-      List<DartType> argumentTypes = definingType.typeArguments;
-      List<DartType> parameterTypes = TypeParameterTypeImpl.getTypes(definingType.typeParameters);
-      DartType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
-      if (baseType == substitutedType) {
-        return baseParameter;
+  @override
+  ElementImpl getChild(String identifier) {
+    for (ParameterElement parameter in _parameters) {
+      if ((parameter as ParameterElementImpl).identifier == identifier) {
+        return parameter as ParameterElementImpl;
       }
     }
-    // TODO(brianwilkerson) Consider caching the substituted type in the instance. It would use more
-    // memory but speed up some operations. We need to see how often the type is being re-computed.
-    if (isFieldFormal) {
-      return new FieldFormalParameterMember(baseParameter as FieldFormalParameterElement, definingType);
-    }
-    return new ParameterMember(baseParameter, definingType);
+    return null;
   }
 
   /**
-   * Initialize a newly created element to represent a parameter of the given parameterized type.
-   *
-   * @param baseElement the element on which the parameterized element was created
-   * @param definingType the type in which the element is defined
+   * Specifies that this variable is potentially mutated somewhere in closure.
    */
-  ParameterMember(ParameterElement baseElement, ParameterizedType definingType) : super(baseElement, definingType);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
-
-  @override
-  Element getAncestor(Predicate<Element> predicate) {
-    Element element = baseElement.getAncestor(predicate);
-    ParameterizedType definingType = this.definingType;
-    if (definingType is InterfaceType) {
-      InterfaceType definingInterfaceType = definingType;
-      if (element is ConstructorElement) {
-        return ConstructorMember.from(element, definingInterfaceType);
-      } else if (element is MethodElement) {
-        return MethodMember.from(element, definingInterfaceType);
-      } else if (element is PropertyAccessorElement) {
-        return PropertyAccessorMember.from(element, definingInterfaceType);
-      }
-    }
-    return element;
+  void markPotentiallyMutatedInClosure() {
+    setModifier(Modifier.POTENTIALLY_MUTATED_IN_CONTEXT, true);
   }
 
-  @override
-  ParameterElement get baseElement => super.baseElement as ParameterElement;
-
-  @override
-  String get defaultValueCode => baseElement.defaultValueCode;
-
-  @override
-  Element get enclosingElement => baseElement.enclosingElement;
-
-  @override
-  ParameterKind get parameterKind => baseElement.parameterKind;
-
-  @override
-  List<ParameterElement> get parameters {
-    List<ParameterElement> baseParameters = baseElement.parameters;
-    int parameterCount = baseParameters.length;
-    if (parameterCount == 0) {
-      return baseParameters;
-    }
-    List<ParameterElement> parameterizedParameters = new List<ParameterElement>(parameterCount);
-    for (int i = 0; i < parameterCount; i++) {
-      parameterizedParameters[i] = ParameterMember.from(baseParameters[i], definingType);
-    }
-    return parameterizedParameters;
+  /**
+   * Specifies that this variable is potentially mutated somewhere in its scope.
+   */
+  void markPotentiallyMutatedInScope() {
+    setModifier(Modifier.POTENTIALLY_MUTATED_IN_SCOPE, true);
   }
 
-  @override
-  SourceRange get visibleRange => baseElement.visibleRange;
-
-  @override
-  bool get isInitializingFormal => baseElement.isInitializingFormal;
-
-  @override
-  String toString() {
-    ParameterElement baseElement = this.baseElement;
-    String left = "";
-    String right = "";
-    while (true) {
-      if (baseElement.parameterKind == ParameterKind.NAMED) {
-        left = "{";
-        right = "}";
-      } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) {
-        left = "[";
-        right = "]";
-      } else if (baseElement.parameterKind == ParameterKind.REQUIRED) {
-      }
-      break;
-    }
-    return '$left$type ${baseElement.displayName}$right';
+  /**
+   * Set the visible range for this element to the range starting at the given offset with the given
+   * length.
+   *
+   * @param offset the offset to the beginning of the visible range for this element
+   * @param length the length of the visible range for this element, or `-1` if this element
+   *          does not have a visible range
+   */
+  void setVisibleRange(int offset, int length) {
+    _visibleRangeOffset = offset;
+    _visibleRangeLength = length;
   }
 
   @override
   void visitChildren(ElementVisitor visitor) {
     super.visitChildren(visitor);
-    safelyVisitChildren(parameters, visitor);
+    safelyVisitChildren(_parameters, visitor);
   }
 }
 
@@ -9532,6 +9952,142 @@
 }
 
 /**
+ * Instances of the class `ParameterMember` represent a parameter element defined in a
+ * parameterized type where the values of the type parameters are known.
+ */
+class ParameterMember extends VariableMember implements ParameterElement {
+  /**
+   * Initialize a newly created element to represent a parameter of the given parameterized type.
+   *
+   * @param baseElement the element on which the parameterized element was created
+   * @param definingType the type in which the element is defined
+   */
+  ParameterMember(ParameterElement baseElement, ParameterizedType definingType)
+      : super(baseElement, definingType);
+
+  @override
+  ParameterElement get baseElement => super.baseElement as ParameterElement;
+
+  @override
+  String get defaultValueCode => baseElement.defaultValueCode;
+
+  @override
+  Element get enclosingElement => baseElement.enclosingElement;
+
+  @override
+  bool get isInitializingFormal => baseElement.isInitializingFormal;
+
+  @override
+  ParameterKind get parameterKind => baseElement.parameterKind;
+
+  @override
+  List<ParameterElement> get parameters {
+    List<ParameterElement> baseParameters = baseElement.parameters;
+    int parameterCount = baseParameters.length;
+    if (parameterCount == 0) {
+      return baseParameters;
+    }
+    List<ParameterElement> parameterizedParameters =
+        new List<ParameterElement>(parameterCount);
+    for (int i = 0; i < parameterCount; i++) {
+      parameterizedParameters[i] =
+          ParameterMember.from(baseParameters[i], definingType);
+    }
+    return parameterizedParameters;
+  }
+
+  @override
+  SourceRange get visibleRange => baseElement.visibleRange;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
+
+  @override
+  Element getAncestor(Predicate<Element> predicate) {
+    Element element = baseElement.getAncestor(predicate);
+    ParameterizedType definingType = this.definingType;
+    if (definingType is InterfaceType) {
+      InterfaceType definingInterfaceType = definingType;
+      if (element is ConstructorElement) {
+        return ConstructorMember.from(element, definingInterfaceType);
+      } else if (element is MethodElement) {
+        return MethodMember.from(element, definingInterfaceType);
+      } else if (element is PropertyAccessorElement) {
+        return PropertyAccessorMember.from(element, definingInterfaceType);
+      }
+    }
+    return element;
+  }
+
+  @override
+  String toString() {
+    ParameterElement baseElement = this.baseElement;
+    String left = "";
+    String right = "";
+    while (true) {
+      if (baseElement.parameterKind == ParameterKind.NAMED) {
+        left = "{";
+        right = "}";
+      } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) {
+        left = "[";
+        right = "]";
+      } else if (baseElement.parameterKind == ParameterKind.REQUIRED) {
+      }
+      break;
+    }
+    return '$left$type ${baseElement.displayName}$right';
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(parameters, visitor);
+  }
+
+  /**
+   * If the given parameter's type is different when any type parameters from the defining type's
+   * declaration are replaced with the actual type arguments from the defining type, create a
+   * parameter member representing the given parameter. Return the member that was created, or the
+   * base parameter if no member was created.
+   *
+   * @param baseParameter the base parameter for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   *          substitution
+   * @return the parameter element that will return the correctly substituted types
+   */
+  static ParameterElement from(ParameterElement baseParameter,
+      ParameterizedType definingType) {
+    if (baseParameter == null || definingType.typeArguments.length == 0) {
+      return baseParameter;
+    }
+    // Check if parameter type depends on defining type type arguments.
+    // It is possible that we did not resolve field formal parameter yet,
+    // so skip this check for it.
+    bool isFieldFormal = baseParameter is FieldFormalParameterElement;
+    if (!isFieldFormal) {
+      DartType baseType = baseParameter.type;
+      List<DartType> argumentTypes = definingType.typeArguments;
+      List<DartType> parameterTypes =
+          TypeParameterTypeImpl.getTypes(definingType.typeParameters);
+      DartType substitutedType =
+          baseType.substitute2(argumentTypes, parameterTypes);
+      if (baseType == substitutedType) {
+        return baseParameter;
+      }
+    }
+    // TODO(brianwilkerson) Consider caching the substituted type in the
+    // instance. It would use more memory but speed up some operations.
+    // We need to see how often the type is being re-computed.
+    if (isFieldFormal) {
+      return new FieldFormalParameterMember(
+          baseParameter as FieldFormalParameterElement,
+          definingType);
+    }
+    return new ParameterMember(baseParameter, definingType);
+  }
+}
+
+/**
  * The interface `PolymerAttributeElement` defines an attribute in
  * [PolymerTagHtmlElement].
  *
@@ -9542,9 +10098,11 @@
  */
 abstract class PolymerAttributeElement implements PolymerElement {
   /**
-   * An empty array of Polymer custom tag attributes.
+   * An empty list of Polymer custom tag attributes.
    */
-  static final List<PolymerAttributeElement> EMPTY_ARRAY = new List<PolymerAttributeElement>(0);
+  static const List<PolymerAttributeElement> EMPTY_ARRAY = const
+      <PolymerAttributeElement>[
+      ];
 
   /**
    * Return the [FieldElement] associated with this attribute. Maybe `null` if
@@ -9556,7 +10114,8 @@
 /**
  * Implementation of `PolymerAttributeElement`.
  */
-class PolymerAttributeElementImpl extends PolymerElementImpl implements PolymerAttributeElement {
+class PolymerAttributeElementImpl extends PolymerElementImpl implements
+    PolymerAttributeElement {
   /**
    * The [FieldElement] associated with this attribute.
    */
@@ -9569,13 +10128,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  PolymerAttributeElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitPolymerAttributeElement(this);
+  PolymerAttributeElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.POLYMER_ATTRIBUTE;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitPolymerAttributeElement(this);
 }
 
 /**
@@ -9584,15 +10144,16 @@
  */
 abstract class PolymerElement implements ToolkitObjectElement {
   /**
-   * An empty array of Polymer elements.
+   * An empty list of Polymer elements.
    */
-  static final List<PolymerElement> EMPTY_ARRAY = new List<PolymerElement>(0);
+  static const List<PolymerElement> EMPTY_ARRAY = const <PolymerElement>[];
 }
 
 /**
  * Implementation of `PolymerElement`.
  */
-abstract class PolymerElementImpl extends ToolkitObjectElementImpl implements PolymerElement {
+abstract class PolymerElementImpl extends ToolkitObjectElementImpl implements
+    PolymerElement {
   /**
    * Initialize a newly created Polymer element to have the given name.
    *
@@ -9628,7 +10189,8 @@
 /**
  * Implementation of `PolymerTagDartElement`.
  */
-class PolymerTagDartElementImpl extends PolymerElementImpl implements PolymerTagDartElement {
+class PolymerTagDartElementImpl extends PolymerElementImpl implements
+    PolymerTagDartElement {
   /**
    * The [ClassElement] that is associated with this Polymer custom tag.
    */
@@ -9647,13 +10209,14 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  PolymerTagDartElementImpl(String name, int nameOffset, this.classElement) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitPolymerTagDartElement(this);
+  PolymerTagDartElementImpl(String name, int nameOffset, this.classElement)
+      : super(name, nameOffset);
 
   @override
   ElementKind get kind => ElementKind.POLYMER_TAG_DART;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitPolymerTagDartElement(this);
 }
 
 /**
@@ -9666,9 +10229,11 @@
  */
 abstract class PolymerTagHtmlElement implements PolymerElement {
   /**
-   * An empty array of [PolymerTagHtmlElement]s.
+   * An empty list of [PolymerTagHtmlElement]s.
    */
-  static final List<PolymerTagHtmlElement> EMPTY_ARRAY = new List<PolymerTagHtmlElement>(0);
+  static const List<PolymerTagHtmlElement> EMPTY_ARRAY = const
+      <PolymerTagHtmlElement>[
+      ];
 
   /**
    * Return an array containing all of the attributes declared by this tag.
@@ -9685,7 +10250,8 @@
 /**
  * Implementation of `PolymerTagHtmlElement`.
  */
-class PolymerTagHtmlElementImpl extends PolymerElementImpl implements PolymerTagHtmlElement {
+class PolymerTagHtmlElementImpl extends PolymerElementImpl implements
+    PolymerTagHtmlElement {
   /**
    * The [PolymerTagDartElement] part of this Polymer custom tag. Maybe `null` if it has
    * not been resolved yet or there are no corresponding Dart part defined.
@@ -9695,7 +10261,8 @@
   /**
    * The array containing all of the attributes declared by this tag.
    */
-  List<PolymerAttributeElement> _attributes = PolymerAttributeElement.EMPTY_ARRAY;
+  List<PolymerAttributeElement> _attributes =
+      PolymerAttributeElement.EMPTY_ARRAY;
 
   /**
    * Initialize a newly created HTML part of a Polymer tag to have the given name.
@@ -9704,17 +10271,12 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  PolymerTagHtmlElementImpl(String name, int nameOffset) : super(name, nameOffset);
-
-  @override
-  accept(ElementVisitor visitor) => visitor.visitPolymerTagHtmlElement(this);
+  PolymerTagHtmlElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   @override
   List<PolymerAttributeElement> get attributes => _attributes;
 
-  @override
-  ElementKind get kind => ElementKind.POLYMER_TAG_HTML;
-
   /**
    * Set an array containing all of the attributes declared by this tag.
    *
@@ -9728,6 +10290,12 @@
   }
 
   @override
+  ElementKind get kind => ElementKind.POLYMER_TAG_HTML;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitPolymerTagHtmlElement(this);
+
+  @override
   void visitChildren(ElementVisitor visitor) {
     safelyVisitChildren(_attributes, visitor);
     super.visitChildren(visitor);
@@ -9760,23 +10328,16 @@
  */
 class PrefixElementImpl extends ElementImpl implements PrefixElement {
   /**
+   * An empty list of prefix elements.
+   */
+  static const List<PrefixElement> EMPTY_ARRAY = const <PrefixElement>[];
+
+  /**
    * An array containing all of the libraries that are imported using this prefix.
    */
   List<LibraryElement> _importedLibraries = LibraryElementImpl.EMPTY_ARRAY;
 
   /**
-   * An empty array of prefix elements.
-   */
-  static List<PrefixElement> EMPTY_ARRAY = new List<PrefixElement>(0);
-
-  /**
-   * Initialize a newly created prefix element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  PrefixElementImpl.forNode(Identifier name) : super.forNode(name);
-
-  /**
    * Initialize a newly created method element to have the given name.
    *
    * @param name the name of this element
@@ -9785,18 +10346,23 @@
    */
   PrefixElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitPrefixElement(this);
+  /**
+   * Initialize a newly created prefix element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  PrefixElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
-  LibraryElement get enclosingElement => super.enclosingElement as LibraryElement;
+  LibraryElement get enclosingElement =>
+      super.enclosingElement as LibraryElement;
+
+  @override
+  String get identifier => "_${super.identifier}";
 
   @override
   List<LibraryElement> get importedLibraries => _importedLibraries;
 
-  @override
-  ElementKind get kind => ElementKind.PREFIX;
-
   /**
    * Set the libraries that are imported using this prefix to the given libraries.
    *
@@ -9810,13 +10376,16 @@
   }
 
   @override
+  ElementKind get kind => ElementKind.PREFIX;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitPrefixElement(this);
+
+  @override
   void appendTo(StringBuffer buffer) {
     buffer.write("as ");
     super.appendTo(buffer);
   }
-
-  @override
-  String get identifier => "_${super.identifier}";
 }
 
 /**
@@ -9852,14 +10421,6 @@
   PropertyAccessorElement get correspondingSetter;
 
   /**
-   * Return the field or top-level variable associated with this accessor. If this accessor was
-   * explicitly defined (is not synthetic) then the variable associated with it will be synthetic.
-   *
-   * @return the variable associated with this accessor
-   */
-  PropertyInducingElement get variable;
-
-  /**
    * Return `true` if this accessor is abstract. Accessors are abstract if they are not
    * external and have no body.
    *
@@ -9880,24 +10441,35 @@
    * @return `true` if this accessor represents a setter
    */
   bool get isSetter;
+
+  /**
+   * Return the field or top-level variable associated with this accessor. If this accessor was
+   * explicitly defined (is not synthetic) then the variable associated with it will be synthetic.
+   *
+   * @return the variable associated with this accessor
+   */
+  PropertyInducingElement get variable;
 }
 
 /**
  * Instances of the class `PropertyAccessorElementImpl` implement a
  * `PropertyAccessorElement`.
  */
-class PropertyAccessorElementImpl extends ExecutableElementImpl implements PropertyAccessorElement {
+class PropertyAccessorElementImpl extends ExecutableElementImpl implements
+    PropertyAccessorElement {
+  /**
+   * An empty list of property accessor elements.
+   */
+  static const List<PropertyAccessorElement> EMPTY_ARRAY = const
+      <PropertyAccessorElement>[
+      ];
+
   /**
    * The variable associated with this accessor.
    */
   PropertyInducingElement variable;
 
   /**
-   * An empty array of property accessor elements.
-   */
-  static List<PropertyAccessorElement> EMPTY_ARRAY = new List<PropertyAccessorElement>(0);
-
-  /**
    * Initialize a newly created property accessor element to have the given name.
    *
    * @param name the name of this element
@@ -9910,17 +10482,21 @@
    *
    * @param variable the variable with which this access is associated
    */
-  PropertyAccessorElementImpl.forVariable(PropertyInducingElementImpl variable) : super(variable.name, variable.nameOffset) {
+  PropertyAccessorElementImpl.forVariable(PropertyInducingElementImpl variable)
+      : super(variable.name, variable.nameOffset) {
     this.variable = variable;
     static = variable.isStatic;
     synthetic = true;
   }
 
-  @override
-  accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
-
-  @override
-  bool operator ==(Object object) => super == object && isGetter == (object as PropertyAccessorElement).isGetter;
+  /**
+   * Set whether this accessor is abstract to correspond to the given value.
+   *
+   * @param isAbstract `true` if the accessor is abstract
+   */
+  void set abstract(bool isAbstract) {
+    setModifier(Modifier.ABSTRACT, isAbstract);
+  }
 
   @override
   PropertyAccessorElement get correspondingGetter {
@@ -9938,6 +10514,38 @@
     return variable.setter;
   }
 
+  /**
+   * Set whether this accessor is a getter to correspond to the given value.
+   *
+   * @param isGetter `true` if the accessor is a getter
+   */
+  void set getter(bool isGetter) {
+    setModifier(Modifier.GETTER, isGetter);
+  }
+
+  @override
+  int get hashCode =>
+      ObjectUtilities.combineHashCodes(super.hashCode, isGetter ? 1 : 2);
+
+  @override
+  String get identifier {
+    String name = displayName;
+    String suffix = isGetter ? "?" : "=";
+    return "$name$suffix";
+  }
+
+  @override
+  bool get isAbstract => hasModifier(Modifier.ABSTRACT);
+
+  @override
+  bool get isGetter => hasModifier(Modifier.GETTER);
+
+  @override
+  bool get isSetter => hasModifier(Modifier.SETTER);
+
+  @override
+  bool get isStatic => hasModifier(Modifier.STATIC);
+
   @override
   ElementKind get kind {
     if (isGetter) {
@@ -9968,39 +10576,6 @@
     return null;
   }
 
-  @override
-  int get hashCode => ObjectUtilities.combineHashCodes(super.hashCode, isGetter ? 1 : 2);
-
-  @override
-  bool get isAbstract => hasModifier(Modifier.ABSTRACT);
-
-  @override
-  bool get isGetter => hasModifier(Modifier.GETTER);
-
-  @override
-  bool get isSetter => hasModifier(Modifier.SETTER);
-
-  @override
-  bool get isStatic => hasModifier(Modifier.STATIC);
-
-  /**
-   * Set whether this accessor is abstract to correspond to the given value.
-   *
-   * @param isAbstract `true` if the accessor is abstract
-   */
-  void set abstract(bool isAbstract) {
-    setModifier(Modifier.ABSTRACT, isAbstract);
-  }
-
-  /**
-   * Set whether this accessor is a getter to correspond to the given value.
-   *
-   * @param isGetter `true` if the accessor is a getter
-   */
-  void set getter(bool isGetter) {
-    setModifier(Modifier.GETTER, isGetter);
-  }
-
   /**
    * Set whether this accessor is a setter to correspond to the given value.
    *
@@ -10020,84 +10595,26 @@
   }
 
   @override
+  bool operator ==(Object object) =>
+      super == object && isGetter == (object as PropertyAccessorElement).isGetter;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
+
+  @override
   void appendTo(StringBuffer buffer) {
     buffer.write(isGetter ? "get " : "set ");
     buffer.write(variable.displayName);
     super.appendTo(buffer);
   }
-
-  @override
-  String get identifier {
-    String name = displayName;
-    String suffix = isGetter ? "?" : "=";
-    return "$name$suffix";
-  }
 }
 
 /**
  * Instances of the class `PropertyAccessorMember` represent a property accessor element
  * defined in a parameterized type where the values of the type parameters are known.
  */
-class PropertyAccessorMember extends ExecutableMember implements PropertyAccessorElement {
-  /**
-   * If the given property accessor's type is different when any type parameters from the defining
-   * type's declaration are replaced with the actual type arguments from the defining type, create a
-   * property accessor member representing the given property accessor. Return the member that was
-   * created, or the base accessor if no member was created.
-   *
-   * @param baseAccessor the base property accessor for which a member might be created
-   * @param definingType the type defining the parameters and arguments to be used in the
-   *          substitution
-   * @return the property accessor element that will return the correctly substituted types
-   */
-  static PropertyAccessorElement from(PropertyAccessorElement baseAccessor, InterfaceType definingType) {
-    if (!_isChangedByTypeSubstitution(baseAccessor, definingType)) {
-      return baseAccessor;
-    }
-    // TODO(brianwilkerson) Consider caching the substituted type in the instance. It would use more
-    // memory but speed up some operations. We need to see how often the type is being re-computed.
-    return new PropertyAccessorMember(baseAccessor, definingType);
-  }
-
-  /**
-   * Determine whether the given property accessor's type is changed when type parameters from the
-   * defining type's declaration are replaced with the actual type arguments from the defining type.
-   *
-   * @param baseAccessor the base property accessor
-   * @param definingType the type defining the parameters and arguments to be used in the
-   *          substitution
-   * @return true if the type is changed by type substitution.
-   */
-  static bool _isChangedByTypeSubstitution(PropertyAccessorElement baseAccessor, InterfaceType definingType) {
-    List<DartType> argumentTypes = definingType.typeArguments;
-    if (baseAccessor != null && argumentTypes.length != 0) {
-      FunctionType baseType = baseAccessor.type;
-      if (baseType == null) {
-        AnalysisEngine.instance.logger.logInformation(
-            'Type of $baseAccessor is null in PropertyAccessorMember._isChangedByTypeSubstitution');
-        return false;
-      }
-      List<DartType> parameterTypes = definingType.element.type.typeArguments;
-      FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
-      if (baseType != substitutedType) {
-        return true;
-      }
-      // If this property accessor is based on a field, that field might have a propagated type.
-      // In which case we need to check whether the propagated type of the field needs substitution.
-      PropertyInducingElement field = baseAccessor.variable;
-      if (!field.isSynthetic) {
-        DartType baseFieldType = field.propagatedType;
-        if (baseFieldType != null) {
-          DartType substitutedFieldType = baseFieldType.substitute2(argumentTypes, parameterTypes);
-          if (baseFieldType != substitutedFieldType) {
-            return true;
-          }
-        }
-      }
-    }
-    return false;
-  }
-
+class PropertyAccessorMember extends ExecutableMember implements
+    PropertyAccessorElement {
   /**
    * Initialize a newly created element to represent a property accessor of the given parameterized
    * type.
@@ -10105,24 +10622,38 @@
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType definingType) : super(baseElement, definingType);
+  PropertyAccessorMember(PropertyAccessorElement baseElement,
+      InterfaceType definingType)
+      : super(baseElement, definingType);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
+  PropertyAccessorElement get baseElement =>
+      super.baseElement as PropertyAccessorElement;
 
   @override
-  PropertyAccessorElement get baseElement => super.baseElement as PropertyAccessorElement;
+  PropertyAccessorElement get correspondingGetter =>
+      from(baseElement.correspondingGetter, definingType);
 
   @override
-  PropertyAccessorElement get correspondingGetter => from(baseElement.correspondingGetter, definingType);
+  PropertyAccessorElement get correspondingSetter =>
+      from(baseElement.correspondingSetter, definingType);
 
   @override
-  PropertyAccessorElement get correspondingSetter => from(baseElement.correspondingSetter, definingType);
+  InterfaceType get definingType => super.definingType as InterfaceType;
 
   @override
   Element get enclosingElement => baseElement.enclosingElement;
 
   @override
+  bool get isAbstract => baseElement.isAbstract;
+
+  @override
+  bool get isGetter => baseElement.isGetter;
+
+  @override
+  bool get isSetter => baseElement.isSetter;
+
+  @override
   PropertyInducingElement get variable {
     PropertyInducingElement variable = baseElement.variable;
     if (variable is FieldElement) {
@@ -10132,13 +10663,7 @@
   }
 
   @override
-  bool get isAbstract => baseElement.isAbstract;
-
-  @override
-  bool get isGetter => baseElement.isGetter;
-
-  @override
-  bool get isSetter => baseElement.isSetter;
+  accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
 
   @override
   String toString() {
@@ -10170,8 +10695,70 @@
     return builder.toString();
   }
 
-  @override
-  InterfaceType get definingType => super.definingType as InterfaceType;
+  /**
+   * If the given property accessor's type is different when any type parameters from the defining
+   * type's declaration are replaced with the actual type arguments from the defining type, create a
+   * property accessor member representing the given property accessor. Return the member that was
+   * created, or the base accessor if no member was created.
+   *
+   * @param baseAccessor the base property accessor for which a member might be created
+   * @param definingType the type defining the parameters and arguments to be used in the
+   *          substitution
+   * @return the property accessor element that will return the correctly substituted types
+   */
+  static PropertyAccessorElement from(PropertyAccessorElement baseAccessor,
+      InterfaceType definingType) {
+    if (!_isChangedByTypeSubstitution(baseAccessor, definingType)) {
+      return baseAccessor;
+    }
+    // TODO(brianwilkerson) Consider caching the substituted type in the
+    // instance. It would use more memory but speed up some operations.
+    // We need to see how often the type is being re-computed.
+    return new PropertyAccessorMember(baseAccessor, definingType);
+  }
+
+  /**
+   * Determine whether the given property accessor's type is changed when type parameters from the
+   * defining type's declaration are replaced with the actual type arguments from the defining type.
+   *
+   * @param baseAccessor the base property accessor
+   * @param definingType the type defining the parameters and arguments to be used in the
+   *          substitution
+   * @return true if the type is changed by type substitution.
+   */
+  static bool _isChangedByTypeSubstitution(PropertyAccessorElement baseAccessor,
+      InterfaceType definingType) {
+    List<DartType> argumentTypes = definingType.typeArguments;
+    if (baseAccessor != null && argumentTypes.length != 0) {
+      FunctionType baseType = baseAccessor.type;
+      if (baseType == null) {
+        AnalysisEngine.instance.logger.logInformation(
+            'Type of $baseAccessor is null in PropertyAccessorMember._isChangedByTypeSubstitution');
+        return false;
+      }
+      List<DartType> parameterTypes = definingType.element.type.typeArguments;
+      FunctionType substitutedType =
+          baseType.substitute2(argumentTypes, parameterTypes);
+      if (baseType != substitutedType) {
+        return true;
+      }
+      // If this property accessor is based on a field, that field might have a
+      // propagated type. In which case we need to check whether the propagated
+      // type of the field needs substitution.
+      PropertyInducingElement field = baseAccessor.variable;
+      if (!field.isSynthetic) {
+        DartType baseFieldType = field.propagatedType;
+        if (baseFieldType != null) {
+          DartType substitutedFieldType =
+              baseFieldType.substitute2(argumentTypes, parameterTypes);
+          if (baseFieldType != substitutedFieldType) {
+            return true;
+          }
+        }
+      }
+    }
+    return false;
+  }
 }
 
 /**
@@ -10198,6 +10785,14 @@
   PropertyAccessorElement get getter;
 
   /**
+   * Return `true` if this element is a static element. A static element is an element that is
+   * not associated with a particular instance, but rather with an entire library or class.
+   *
+   * @return `true` if this executable element is a static element
+   */
+  bool get isStatic;
+
+  /**
    * Return the propagated type of this variable, or `null` if type propagation has not been
    * performed, for example because the variable is not final.
    *
@@ -10215,21 +10810,21 @@
    * @return the setter associated with this variable
    */
   PropertyAccessorElement get setter;
-
-  /**
-   * Return `true` if this element is a static element. A static element is an element that is
-   * not associated with a particular instance, but rather with an entire library or class.
-   *
-   * @return `true` if this executable element is a static element
-   */
-  bool get isStatic;
 }
 
 /**
  * Instances of the class `PropertyInducingElementImpl` implement a
  * `PropertyInducingElement`.
  */
-abstract class PropertyInducingElementImpl extends VariableElementImpl implements PropertyInducingElement {
+abstract class PropertyInducingElementImpl extends VariableElementImpl
+    implements PropertyInducingElement {
+  /**
+   * An empty list of elements.
+   */
+  static const List<PropertyInducingElement> EMPTY_ARRAY = const
+      <PropertyInducingElement>[
+      ];
+
   /**
    * The getter associated with this element.
    */
@@ -10248,9 +10843,14 @@
   DartType propagatedType;
 
   /**
-   * An empty array of elements.
+   * Initialize a newly created synthetic element to have the given name.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<PropertyInducingElement> EMPTY_ARRAY = new List<PropertyInducingElement>(0);
+  PropertyInducingElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   /**
    * Initialize a newly created element to have the given name.
@@ -10258,15 +10858,6 @@
    * @param name the name of this element
    */
   PropertyInducingElementImpl.forNode(Identifier name) : super.forNode(name);
-
-  /**
-   * Initialize a newly created synthetic element to have the given name.
-   *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
-   */
-  PropertyInducingElementImpl(String name, int nameOffset) : super(name, nameOffset);
 }
 
 /**
@@ -10566,7 +11157,8 @@
   R visitAngularPropertyElement(AngularPropertyElement element) => null;
 
   @override
-  R visitAngularScopePropertyElement(AngularScopePropertyElement element) => null;
+  R visitAngularScopePropertyElement(AngularScopePropertyElement element) =>
+      null;
 
   @override
   R visitAngularSelectorElement(AngularSelectorElement element) => null;
@@ -10596,7 +11188,8 @@
   R visitFieldElement(FieldElement element) => null;
 
   @override
-  R visitFieldFormalParameterElement(FieldFormalParameterElement element) => null;
+  R visitFieldFormalParameterElement(FieldFormalParameterElement element) =>
+      null;
 
   @override
   R visitFunctionElement(FunctionElement element) => null;
@@ -10657,15 +11250,18 @@
  */
 abstract class ToolkitObjectElement implements Element {
   /**
-   * An empty array of toolkit object elements.
+   * An empty list of toolkit object elements.
    */
-  static final List<ToolkitObjectElement> EMPTY_ARRAY = new List<ToolkitObjectElement>(0);
+  static const List<ToolkitObjectElement> EMPTY_ARRAY = const
+      <ToolkitObjectElement>[
+      ];
 }
 
 /**
  * Instances of the class `ToolkitObjectElementImpl` implement a `ToolkitObjectElement`.
  */
-abstract class ToolkitObjectElementImpl extends ElementImpl implements ToolkitObjectElement {
+abstract class ToolkitObjectElementImpl extends ElementImpl implements
+    ToolkitObjectElement {
   /**
    * Initialize a newly created toolkit object element to have the given name.
    *
@@ -10673,7 +11269,8 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  ToolkitObjectElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  ToolkitObjectElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 }
 
 /**
@@ -10687,18 +11284,14 @@
  * Instances of the class `TopLevelVariableElementImpl` implement a
  * `TopLevelVariableElement`.
  */
-class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements TopLevelVariableElement {
+class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements
+    TopLevelVariableElement {
   /**
-   * An empty array of top-level variable elements.
+   * An empty list of top-level variable elements.
    */
-  static List<TopLevelVariableElement> EMPTY_ARRAY = new List<TopLevelVariableElement>(0);
-
-  /**
-   * Initialize a newly created top-level variable element to have the given name.
-   *
-   * @param name the name of this element
-   */
-  TopLevelVariableElementImpl.forNode(Identifier name) : super.forNode(name);
+  static const List<TopLevelVariableElement> EMPTY_ARRAY = const
+      <TopLevelVariableElement>[
+      ];
 
   /**
    * Initialize a newly created synthetic top-level variable element to have the given name.
@@ -10707,16 +11300,24 @@
    * @param nameOffset the offset of the name of this element in the file that contains the
    *          declaration of this element
    */
-  TopLevelVariableElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  TopLevelVariableElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
+
+  /**
+   * Initialize a newly created top-level variable element to have the given name.
+   *
+   * @param name the name of this element
+   */
+  TopLevelVariableElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
-  accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
+  bool get isStatic => true;
 
   @override
   ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
 
   @override
-  bool get isStatic => true;
+  accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
 }
 
 /**
@@ -10725,52 +11326,9 @@
  */
 abstract class TypeImpl implements DartType {
   /**
-   * Return `true` if corresponding elements of the [first] and [second] lists
-   * of type arguments are all equal. Use the set of [visitedElementPairs] to
-   * prevent infinite loops when the types are recursively defined.
+   * An empty list of types.
    */
-  static bool equalArrays(List<DartType> first, List<DartType> second,
-      Set<ElementPair> visitedElementPairs) {
-    if (first.length != second.length) {
-      return false;
-    }
-    for (int i = 0; i < first.length; i++) {
-      if (first[i] == null) {
-        AnalysisEngine.instance.logger.logInformation(
-            'Found null type argument in TypeImpl.equalArrays');
-        return second[i] == null;
-      } else if (second[i] == null) {
-        AnalysisEngine.instance.logger.logInformation(
-            'Found null type argument in TypeImpl.equalArrays');
-        return false;
-      }
-      if (!(first[i] as TypeImpl).internalEquals(second[i], visitedElementPairs)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * Return an array containing the results of using the given argument types and parameter types to
-   * perform a substitution on all of the given types.
-   *
-   * @param types the types on which a substitution is to be performed
-   * @param argumentTypes the argument types for the substitution
-   * @param parameterTypes the parameter types for the substitution
-   * @return the result of performing the substitution on each of the types
-   */
-  static List<DartType> substitute(List<DartType> types, List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    int length = types.length;
-    if (length == 0) {
-      return types;
-    }
-    List<DartType> newTypes = new List<DartType>(length);
-    for (int i = 0; i < length; i++) {
-      newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes);
-    }
-    return newTypes;
-  }
+  static const List<DartType> EMPTY_ARRAY = const <DartType>[];
 
   /**
    * The element representing the declaration of this type, or `null` if the type has not, or
@@ -10784,11 +11342,6 @@
   final String name;
 
   /**
-   * An empty array of types.
-   */
-  static List<DartType> EMPTY_ARRAY = new List<DartType>(0);
-
-  /**
    * Initialize a newly created type to be declared by the given element and to have the given name.
    *
    * @param element the element representing the declaration of the type
@@ -10803,10 +11356,48 @@
   Element get element => _element;
 
   @override
-  DartType getLeastUpperBound(DartType type) => null;
+  bool get isBottom => false;
 
   @override
-  bool isAssignableTo(DartType type) => isAssignableTo2(type, new HashSet<TypeImpl_TypePair>());
+  bool get isDartCoreFunction => false;
+
+  @override
+  bool get isDynamic => false;
+
+  @override
+  bool get isObject => false;
+
+  @override
+  bool get isUndefined => false;
+
+  @override
+  bool get isVoid => false;
+
+  /**
+   * Append a textual representation of this type to the given [buffer].
+   */
+  void appendTo(StringBuffer buffer) {
+    if (name == null) {
+      buffer.write("<unnamed type>");
+    } else {
+      buffer.write(name);
+    }
+  }
+
+  @override
+  DartType getLeastUpperBound(DartType type) => null;
+
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs);
+
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs);
+
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs);
+
+  @override
+  bool isAssignableTo(DartType type) =>
+      isAssignableTo2(type, new HashSet<TypeImpl_TypePair>());
 
   /**
    * Return `true` if this type is assignable to the given type. A type <i>T</i> may be
@@ -10826,10 +11417,12 @@
     // on the RHS.
     if (this is UnionType) {
       if (AnalysisEngine.instance.strictUnionTypes) {
-        // *Every* element on the LHS must be assignable to the RHS. We recursively fall into
-        // the next case when the RHS is also a union: the order here is important!
+        // *Every* element on the LHS must be assignable to the RHS.
+        // We recursively fall into the next case when the RHS is also a union:
+        // the order here is important!
         for (DartType left in (this as UnionType).elements) {
-          // Would have to cast to [TypeImpl] to call the [visitedTypePairs] version here.
+          // Would have to cast to [TypeImpl] to call the [visitedTypePairs]
+          // version here.
           if (!left.isAssignableTo(type)) {
             return false;
           }
@@ -10838,7 +11431,8 @@
       } else {
         // *Some* element on the LHS must be assignable to the RHS.
         for (DartType left in (this as UnionType).elements) {
-          // Would have to cast to [TypeImpl] to call the [visitedTypePairs] version here.
+          // Would have to cast to [TypeImpl] to call the [visitedTypePairs]
+          // version here.
           if (left.isAssignableTo(type)) {
             return true;
           }
@@ -10846,7 +11440,8 @@
         return false;
       }
     } else if (type is UnionType) {
-      // The LHS, which is not a union, must be assignable to *some* element on the RHS.
+      // The LHS, which is not a union, must be assignable to *some* element
+      // on the RHS.
       for (DartType right in type.elements) {
         if (this.isAssignableTo2(right, visitedTypePairs)) {
           return true;
@@ -10855,21 +11450,14 @@
       return false;
     } else {
       // For non union types we use the language spec definition of [<=>].
-      return isSubtypeOf2(type, visitedTypePairs) || (type as TypeImpl).isSubtypeOf2(this, visitedTypePairs);
+      return isSubtypeOf2(type, visitedTypePairs) ||
+          (type as TypeImpl).isSubtypeOf2(this, visitedTypePairs);
     }
   }
 
   @override
-  bool get isBottom => false;
-
-  @override
-  bool get isDartCoreFunction => false;
-
-  @override
-  bool get isDynamic => false;
-
-  @override
-  bool isMoreSpecificThan(DartType type) => isMoreSpecificThan2(type, false, new HashSet<TypeImpl_TypePair>());
+  bool isMoreSpecificThan(DartType type) =>
+      isMoreSpecificThan2(type, false, new HashSet<TypeImpl_TypePair>());
 
   /**
    * Return `true` if this type is more specific than the given type.
@@ -10883,22 +11471,22 @@
    * @param visitedTypePairs the set of pairs of types used to prevent infinite loops
    * @return `true` if this type is more specific than the given type
    */
-  bool isMoreSpecificThan2(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool isMoreSpecificThan2(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     // If the visitedTypePairs already has the pair (this, type), return false
     TypeImpl_TypePair typePair = new TypeImpl_TypePair(this, type);
     if (!visitedTypePairs.add(typePair)) {
       return false;
     }
-    bool result = internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs);
+    bool result =
+        internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs);
     visitedTypePairs.remove(typePair);
     return result;
   }
 
   @override
-  bool get isObject => false;
-
-  @override
-  bool isSubtypeOf(DartType type) => isSubtypeOf2(type, new HashSet<TypeImpl_TypePair>());
+  bool isSubtypeOf(DartType type) =>
+      isSubtypeOf2(type, new HashSet<TypeImpl_TypePair>());
 
   /**
    * Return `true` if this type is a subtype of the given type.
@@ -10926,12 +11514,6 @@
   bool isSupertypeOf(DartType type) => type.isSubtypeOf(this);
 
   @override
-  bool get isUndefined => false;
-
-  @override
-  bool get isVoid => false;
-
-  @override
   String toString() {
     StringBuffer buffer = new StringBuffer();
     appendTo(buffer);
@@ -10939,21 +11521,55 @@
   }
 
   /**
-   * Append a textual representation of this type to the given [buffer].
+   * Return `true` if corresponding elements of the [first] and [second] lists
+   * of type arguments are all equal. Use the set of [visitedElementPairs] to
+   * prevent infinite loops when the types are recursively defined.
    */
-  void appendTo(StringBuffer buffer) {
-    if (name == null) {
-      buffer.write("<unnamed type>");
-    } else {
-      buffer.write(name);
+  static bool equalArrays(List<DartType> first, List<DartType> second,
+      Set<ElementPair> visitedElementPairs) {
+    if (first.length != second.length) {
+      return false;
     }
+    for (int i = 0; i < first.length; i++) {
+      if (first[i] == null) {
+        AnalysisEngine.instance.logger.logInformation(
+            'Found null type argument in TypeImpl.equalArrays');
+        return second[i] == null;
+      } else if (second[i] == null) {
+        AnalysisEngine.instance.logger.logInformation(
+            'Found null type argument in TypeImpl.equalArrays');
+        return false;
+      }
+      if (!(first[i] as TypeImpl).internalEquals(
+          second[i],
+          visitedElementPairs)) {
+        return false;
+      }
+    }
+    return true;
   }
 
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs);
-
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs);
-
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs);
+  /**
+   * Return an array containing the results of using the given argument types and parameter types to
+   * perform a substitution on all of the given types.
+   *
+   * @param types the types on which a substitution is to be performed
+   * @param argumentTypes the argument types for the substitution
+   * @param parameterTypes the parameter types for the substitution
+   * @return the result of performing the substitution on each of the types
+   */
+  static List<DartType> substitute(List<DartType> types,
+      List<DartType> argumentTypes, List<DartType> parameterTypes) {
+    int length = types.length;
+    if (length == 0) {
+      return types;
+    }
+    List<DartType> newTypes = new List<DartType>(length);
+    for (int i = 0; i < length; i++) {
+      newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes);
+    }
+    return newTypes;
+  }
 }
 
 class TypeImpl_TypePair {
@@ -10961,25 +11577,13 @@
 
   final DartType _secondType;
 
-  int _cachedHashCode = 0;
+  int _cachedHashCode;
 
   TypeImpl_TypePair(this._firstType, this._secondType);
 
   @override
-  bool operator ==(Object object) {
-    if (identical(object, this)) {
-      return true;
-    }
-    if (object is TypeImpl_TypePair) {
-      TypeImpl_TypePair typePair = object;
-      return _firstType == typePair._firstType && _secondType != null && _secondType == typePair._secondType;
-    }
-    return false;
-  }
-
-  @override
   int get hashCode {
-    if (_cachedHashCode == 0) {
+    if (_cachedHashCode == null) {
       int firstHashCode = 0;
       if (_firstType != null) {
         Element firstElement = _firstType.element;
@@ -10994,6 +11598,20 @@
     }
     return _cachedHashCode;
   }
+
+  @override
+  bool operator ==(Object object) {
+    if (identical(object, this)) {
+      return true;
+    }
+    if (object is TypeImpl_TypePair) {
+      TypeImpl_TypePair typePair = object;
+      return _firstType == typePair._firstType &&
+          _secondType != null &&
+          _secondType == typePair._secondType;
+    }
+    return false;
+  }
 }
 
 /**
@@ -11020,7 +11638,15 @@
 /**
  * Instances of the class `TypeParameterElementImpl` implement a [TypeParameterElement].
  */
-class TypeParameterElementImpl extends ElementImpl implements TypeParameterElement {
+class TypeParameterElementImpl extends ElementImpl implements
+    TypeParameterElement {
+  /**
+   * An empty list of type parameter elements.
+   */
+  static const List<TypeParameterElement> EMPTY_ARRAY = const
+      <TypeParameterElement>[
+      ];
+
   /**
    * The type defined by this type parameter.
    */
@@ -11033,9 +11659,14 @@
   DartType bound;
 
   /**
-   * An empty array of type parameter elements.
+   * Initialize a newly created method element to have the given name.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<TypeParameterElement> EMPTY_ARRAY = new List<TypeParameterElement>(0);
+  TypeParameterElementImpl(String name, int nameOffset)
+      : super(name, nameOffset);
 
   /**
    * Initialize a newly created type parameter element to have the given name.
@@ -11044,22 +11675,13 @@
    */
   TypeParameterElementImpl.forNode(Identifier name) : super.forNode(name);
 
-  /**
-   * Initialize a newly created method element to have the given name.
-   *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
-   */
-  TypeParameterElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  @override
+  ElementKind get kind => ElementKind.TYPE_PARAMETER;
 
   @override
   accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this);
 
   @override
-  ElementKind get kind => ElementKind.TYPE_PARAMETER;
-
-  @override
   void appendTo(StringBuffer buffer) {
     buffer.write(displayName);
     if (bound != null) {
@@ -11084,29 +11706,10 @@
  */
 class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType {
   /**
-   * An empty array of type parameter types.
+   * An empty list of type parameter types.
    */
-  static List<TypeParameterType> EMPTY_ARRAY = new List<TypeParameterType>(0);
-
-  /**
-   * Return an array containing the type parameter types defined by the given array of type
-   * parameter elements.
-   *
-   * @param typeParameters the type parameter elements defining the type parameter types to be
-   *          returned
-   * @return the type parameter types defined by the type parameter elements
-   */
-  static List<TypeParameterType> getTypes(List<TypeParameterElement> typeParameters) {
-    int count = typeParameters.length;
-    if (count == 0) {
-      return EMPTY_ARRAY;
-    }
-    List<TypeParameterType> types = new List<TypeParameterType>(count);
-    for (int i = 0; i < count; i++) {
-      types[i] = typeParameters[i].type;
-    }
-    return types;
-  }
+  static const List<TypeParameterType> EMPTY_ARRAY = const <TypeParameterType>[
+      ];
 
   /**
    * Initialize a newly created type parameter type to be declared by the given element and to have
@@ -11114,10 +11717,8 @@
    *
    * @param element the element representing the declaration of the type parameter
    */
-  TypeParameterTypeImpl(TypeParameterElement element) : super(element, element.name);
-
-  @override
-  bool operator ==(Object object) => object is TypeParameterTypeImpl && (element == object.element);
+  TypeParameterTypeImpl(TypeParameterElement element)
+      : super(element, element.name);
 
   @override
   TypeParameterElement get element => super.element as TypeParameterElement;
@@ -11126,24 +11727,19 @@
   int get hashCode => element.hashCode;
 
   @override
-  DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    int length = parameterTypes.length;
-    for (int i = 0; i < length; i++) {
-      if (parameterTypes[i] == this) {
-        return argumentTypes[i];
-      }
-    }
-    return this;
-  }
+  bool operator ==(Object object) =>
+      object is TypeParameterTypeImpl && (element == object.element);
 
   @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => this == object;
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      this == object;
 
   @override
-  bool internalIsMoreSpecificThan(DartType s, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool internalIsMoreSpecificThan(DartType s, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     //
-    // A type T is more specific than a type S, written T << S,  if one of the following conditions
-    // is met:
+    // A type T is more specific than a type S, written T << S,
+    // if one of the following conditions is met:
     //
     // Reflexivity: T is S.
     //
@@ -11155,13 +11751,32 @@
     if (s.isDynamic) {
       return true;
     }
-    return _isMoreSpecificThan(s, new HashSet<DartType>(), withDynamic, visitedTypePairs);
+    return _isMoreSpecificThan(
+        s,
+        new HashSet<DartType>(),
+        withDynamic,
+        visitedTypePairs);
   }
 
   @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) => isMoreSpecificThan2(type, true, new HashSet<TypeImpl_TypePair>());
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      isMoreSpecificThan2(type, true, new HashSet<TypeImpl_TypePair>());
 
-  bool _isMoreSpecificThan(DartType s, Set<DartType> visitedTypes, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  @override
+  DartType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
+    int length = parameterTypes.length;
+    for (int i = 0; i < length; i++) {
+      if (parameterTypes[i] == this) {
+        return argumentTypes[i];
+      }
+    }
+    return this;
+  }
+
+  bool _isMoreSpecificThan(DartType s, Set<DartType> visitedTypes,
+      bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
     //
     // T is a type parameter and S is the upper bound of T.
     //
@@ -11190,10 +11805,38 @@
       }
       visitedTypes.add(bound);
       // Then check upper bound.
-      return boundTypeParameter._isMoreSpecificThan(s, visitedTypes, withDynamic, visitedTypePairs);
+      return boundTypeParameter._isMoreSpecificThan(
+          s,
+          visitedTypes,
+          withDynamic,
+          visitedTypePairs);
     }
     // Check interface type.
-    return (bound as TypeImpl).isMoreSpecificThan2(s, withDynamic, visitedTypePairs);
+    return (bound as TypeImpl).isMoreSpecificThan2(
+        s,
+        withDynamic,
+        visitedTypePairs);
+  }
+
+  /**
+   * Return an array containing the type parameter types defined by the given array of type
+   * parameter elements.
+   *
+   * @param typeParameters the type parameter elements defining the type parameter types to be
+   *          returned
+   * @return the type parameter types defined by the type parameter elements
+   */
+  static List<TypeParameterType>
+      getTypes(List<TypeParameterElement> typeParameters) {
+    int count = typeParameters.length;
+    if (count == 0) {
+      return EMPTY_ARRAY;
+    }
+    List<TypeParameterType> types = new List<TypeParameterType>(count);
+    for (int i = 0; i < count; i++) {
+      types[i] = typeParameters[i].type;
+    }
+    return types;
   }
 }
 
@@ -11233,36 +11876,24 @@
       : super(DynamicElementImpl.instance, Keyword.DYNAMIC.syntax);
 
   @override
-  bool operator ==(Object object) => identical(object, this);
-
-  @override
   int get hashCode => 1;
 
   @override
   bool get isDynamic => true;
 
   @override
-  bool isSupertypeOf(DartType type) => true;
-
-  @override
   bool get isUndefined => true;
 
   @override
-  DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    int length = parameterTypes.length;
-    for (int i = 0; i < length; i++) {
-      if (parameterTypes[i] == this) {
-        return argumentTypes[i];
-      }
-    }
-    return this;
-  }
+  bool operator ==(Object object) => identical(object, this);
 
   @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => identical(object, this);
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      identical(object, this);
 
   @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     // T is S
     if (identical(this, type)) {
       return true;
@@ -11272,7 +11903,24 @@
   }
 
   @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) => true;
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      true;
+
+  @override
+  bool isSupertypeOf(DartType type) => true;
+
+  @override
+  DartType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
+    int length = parameterTypes.length;
+    for (int i = 0; i < length; i++) {
+      if (parameterTypes[i] == this) {
+        return argumentTypes[i];
+      }
+    }
+    return this;
+  }
 }
 
 /**
@@ -11292,6 +11940,181 @@
  */
 class UnionTypeImpl extends TypeImpl implements UnionType {
   /**
+   * The types in this union.
+   */
+  final Set<DartType> _types;
+
+  /**
+   * This constructor should only be called by the `union` factory: it does not check that its
+   * argument `types` contains no union types.
+   *
+   * @param types
+   */
+  UnionTypeImpl(this._types) : super(null, null);
+
+  @override
+  String get displayName {
+    StringBuffer buffer = new StringBuffer();
+    String prefix = "{";
+    for (DartType t in _types) {
+      buffer.write(prefix);
+      buffer.write(t.displayName);
+      prefix = ",";
+    }
+    buffer.write("}");
+    return buffer.toString();
+  }
+
+  @override
+  Set<DartType> get elements => _types;
+
+  @override
+  int get hashCode => _types.hashCode;
+
+  @override
+  bool operator ==(Object other) {
+    if (other == null || other is! UnionType) {
+      return false;
+    } else if (identical(this, other)) {
+      return true;
+    } else {
+      return javaSetEquals(_types, (other as UnionType).elements);
+    }
+  }
+
+  @override
+  void appendTo(StringBuffer buffer) {
+    String prefix = "{";
+    for (DartType type in _types) {
+      buffer.write(prefix);
+      (type as TypeImpl).appendTo(buffer);
+      prefix = ",";
+    }
+    buffer.write("}");
+  }
+
+  @override
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      this == object;
+
+  @override
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    // What version of subtyping do we want? See discussion below in
+    // [internalIsSubtypeOf].
+    if (AnalysisEngine.instance.strictUnionTypes) {
+      // The less unsound version: all.
+      for (DartType t in _types) {
+        if (!(t as TypeImpl).internalIsMoreSpecificThan(
+            type,
+            withDynamic,
+            visitedTypePairs)) {
+          return false;
+        }
+      }
+      return true;
+    } else {
+      // The more unsound version: any.
+      for (DartType t in _types) {
+        if ((t as TypeImpl).internalIsMoreSpecificThan(
+            type,
+            withDynamic,
+            visitedTypePairs)) {
+          return true;
+        }
+      }
+      return false;
+    }
+  }
+
+  @override
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    if (AnalysisEngine.instance.strictUnionTypes) {
+      // The less unsound version: all.
+      //
+      // For this version to make sense we also need to redefine assignment
+      // compatibility [<=>].
+      // See discussion above.
+      for (DartType t in _types) {
+        if (!(t as TypeImpl).internalIsSubtypeOf(type, visitedTypePairs)) {
+          return false;
+        }
+      }
+      return true;
+    } else {
+      // The more unsound version: any.
+      for (DartType t in _types) {
+        if ((t as TypeImpl).internalIsSubtypeOf(type, visitedTypePairs)) {
+          return true;
+        }
+      }
+      return false;
+    }
+  }
+
+  /**
+   * The more-specific-than test for union types on the RHS is uniform in non-union LHSs. So, other
+   * `TypeImpl`s can call this method to implement `internalIsMoreSpecificThan` for
+   * union types.
+   *
+   * @param type
+   * @param visitedTypePairs
+   * @return true if `type` is more specific than this union type
+   */
+  bool internalUnionTypeIsLessSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    // This implementation does not make sense when [type] is a union type,
+    // at least for the "less unsound" version of [internalIsMoreSpecificThan]
+    // above.
+    if (type is UnionType) {
+      throw new IllegalArgumentException("Only non-union types are supported.");
+    }
+    for (DartType t in _types) {
+      if ((type as TypeImpl).internalIsMoreSpecificThan(
+          t,
+          withDynamic,
+          visitedTypePairs)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * The supertype test for union types is uniform in non-union subtypes. So, other `TypeImpl`
+   * s can call this method to implement `internalIsSubtypeOf` for union types.
+   *
+   * @param type
+   * @param visitedTypePairs
+   * @return true if this union type is a super type of `type`
+   */
+  bool internalUnionTypeIsSuperTypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
+    // This implementation does not make sense when [type] is a union type,
+    // at least for the "less unsound" version of [internalIsSubtypeOf] above.
+    if (type is UnionType) {
+      throw new IllegalArgumentException("Only non-union types are supported.");
+    }
+    for (DartType t in _types) {
+      if ((type as TypeImpl).internalIsSubtypeOf(t, visitedTypePairs)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  DartType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) {
+    List<DartType> out = new List<DartType>();
+    for (DartType t in _types) {
+      out.add(t.substitute2(argumentTypes, parameterTypes));
+    }
+    return union(out);
+  }
+
+  /**
    * Any unions in the `types` will be flattened in the returned union. If there is only one
    * type after flattening then it will be returned directly, instead of a singleton union. Nulls
    * are discarded, unless all types are null, in which case an exception is raised.
@@ -11323,163 +12146,6 @@
       return new UnionTypeImpl(set);
     }
   }
-
-  /**
-   * The types in this union.
-   */
-  final Set<DartType> _types;
-
-  /**
-   * This constructor should only be called by the `union` factory: it does not check that its
-   * argument `types` contains no union types.
-   *
-   * @param types
-   */
-  UnionTypeImpl(this._types) : super(null, null);
-
-  @override
-  bool operator ==(Object other) {
-    if (other == null || other is! UnionType) {
-      return false;
-    } else if (identical(this, other)) {
-      return true;
-    } else {
-      return javaSetEquals(_types, (other as UnionType).elements);
-    }
-  }
-
-  @override
-  String get displayName {
-    StringBuffer buffer = new StringBuffer();
-    String prefix = "{";
-    for (DartType t in _types) {
-      buffer.write(prefix);
-      buffer.write(t.displayName);
-      prefix = ",";
-    }
-    buffer.write("}");
-    return buffer.toString();
-  }
-
-  @override
-  Set<DartType> get elements => _types;
-
-  @override
-  int get hashCode => _types.hashCode;
-
-  @override
-  DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) {
-    List<DartType> out = new List<DartType>();
-    for (DartType t in _types) {
-      out.add(t.substitute2(argumentTypes, parameterTypes));
-    }
-    return union(out);
-  }
-
-  @override
-  void appendTo(StringBuffer buffer) {
-    String prefix = "{";
-    for (DartType type in _types) {
-      buffer.write(prefix);
-      (type as TypeImpl).appendTo(buffer);
-      prefix = ",";
-    }
-    buffer.write("}");
-  }
-
-  @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => this == object;
-
-  @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
-    // What version of subtyping do we want? See discussion below in [internalIsSubtypeOf].
-    if (AnalysisEngine.instance.strictUnionTypes) {
-      // The less unsound version: all.
-      for (DartType t in _types) {
-        if (!(t as TypeImpl).internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs)) {
-          return false;
-        }
-      }
-      return true;
-    } else {
-      // The more unsound version: any.
-      for (DartType t in _types) {
-        if ((t as TypeImpl).internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs)) {
-          return true;
-        }
-      }
-      return false;
-    }
-  }
-
-  @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) {
-    if (AnalysisEngine.instance.strictUnionTypes) {
-      // The less unsound version: all.
-      //
-      // For this version to make sense we also need to redefine assignment compatibility [<=>].
-      // See discussion above.
-      for (DartType t in _types) {
-        if (!(t as TypeImpl).internalIsSubtypeOf(type, visitedTypePairs)) {
-          return false;
-        }
-      }
-      return true;
-    } else {
-      // The more unsound version: any.
-      for (DartType t in _types) {
-        if ((t as TypeImpl).internalIsSubtypeOf(type, visitedTypePairs)) {
-          return true;
-        }
-      }
-      return false;
-    }
-  }
-
-  /**
-   * The more-specific-than test for union types on the RHS is uniform in non-union LHSs. So, other
-   * `TypeImpl`s can call this method to implement `internalIsMoreSpecificThan` for
-   * union types.
-   *
-   * @param type
-   * @param visitedTypePairs
-   * @return true if `type` is more specific than this union type
-   */
-  bool internalUnionTypeIsLessSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) {
-    // This implementation does not make sense when [type] is a union type, at least
-    // for the "less unsound" version of [internalIsMoreSpecificThan] above.
-    if (type is UnionType) {
-      throw new IllegalArgumentException("Only non-union types are supported.");
-    }
-    for (DartType t in _types) {
-      if ((type as TypeImpl).internalIsMoreSpecificThan(t, withDynamic, visitedTypePairs)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * The supertype test for union types is uniform in non-union subtypes. So, other `TypeImpl`
-   * s can call this method to implement `internalIsSubtypeOf` for union types.
-   *
-   * @param type
-   * @param visitedTypePairs
-   * @return true if this union type is a super type of `type`
-   */
-  bool internalUnionTypeIsSuperTypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) {
-    // This implementation does not make sense when [type] is a union type, at least
-    // for the "less unsound" version of [internalIsSubtypeOf] above.
-    if (type is UnionType) {
-      throw new IllegalArgumentException("Only non-union types are supported.");
-    }
-    for (DartType t in _types) {
-      if ((type as TypeImpl).internalIsSubtypeOf(t, visitedTypePairs)) {
-        return true;
-      }
-    }
-    return false;
-  }
 }
 
 /**
@@ -11488,6 +12154,14 @@
  */
 abstract class UriReferencedElement implements Element {
   /**
+   * Return the URI that is used to include this element into the enclosing library, or `null`
+   * if this is the defining compilation unit of a library.
+   *
+   * @return the URI that is used to include this element into the enclosing library
+   */
+  String get uri;
+
+  /**
    * Return the offset of the character immediately following the last character of this node's URI,
    * or `-1` for synthetic import.
    *
@@ -11501,21 +12175,14 @@
    * @return the offset of the URI
    */
   int get uriOffset;
-
-  /**
-   * Return the URI that is used to include this element into the enclosing library, or `null`
-   * if this is the defining compilation unit of a library.
-   *
-   * @return the URI that is used to include this element into the enclosing library
-   */
-  String get uri;
 }
 
 /**
  * Instances of the class `UriReferencedElementImpl` implement an [UriReferencedElement]
  * .
  */
-abstract class UriReferencedElementImpl extends ElementImpl implements UriReferencedElement {
+abstract class UriReferencedElementImpl extends ElementImpl implements
+    UriReferencedElement {
   /**
    * The offset of the URI in the file, may be `-1` if synthetic.
    */
@@ -11556,6 +12223,22 @@
   FunctionElement get initializer;
 
   /**
+   * Return `true` if this variable was declared with the 'const' modifier.
+   *
+   * @return `true` if this variable was declared with the 'const' modifier
+   */
+  bool get isConst;
+
+  /**
+   * Return `true` if this variable was declared with the 'final' modifier. Variables that are
+   * declared with the 'const' modifier will return `false` even though they are implicitly
+   * final.
+   *
+   * @return `true` if this variable was declared with the 'final' modifier
+   */
+  bool get isFinal;
+
+  /**
    * Return the resolved [VariableDeclaration] node that declares this [VariableElement]
    * .
    *
@@ -11574,28 +12257,18 @@
    * @return the declared type of this variable
    */
   DartType get type;
-
-  /**
-   * Return `true` if this variable was declared with the 'const' modifier.
-   *
-   * @return `true` if this variable was declared with the 'const' modifier
-   */
-  bool get isConst;
-
-  /**
-   * Return `true` if this variable was declared with the 'final' modifier. Variables that are
-   * declared with the 'const' modifier will return `false` even though they are implicitly
-   * final.
-   *
-   * @return `true` if this variable was declared with the 'final' modifier
-   */
-  bool get isFinal;
 }
 
 /**
  * Instances of the class `VariableElementImpl` implement a `VariableElement`.
  */
-abstract class VariableElementImpl extends ElementImpl implements VariableElement {
+abstract class VariableElementImpl extends ElementImpl implements
+    VariableElement {
+  /**
+   * An empty list of variable elements.
+   */
+  static const List<VariableElement> EMPTY_ARRAY = const <VariableElement>[];
+
   /**
    * The declared type of this variable.
    */
@@ -11608,9 +12281,13 @@
   FunctionElement _initializer;
 
   /**
-   * An empty array of variable elements.
+   * Initialize a newly created variable element to have the given name.
+   *
+   * @param name the name of this element
+   * @param nameOffset the offset of the name of this element in the file that contains the
+   *          declaration of this element
    */
-  static List<VariableElement> EMPTY_ARRAY = new List<VariableElement>(0);
+  VariableElementImpl(String name, int nameOffset) : super(name, nameOffset);
 
   /**
    * Initialize a newly created variable element to have the given name.
@@ -11620,13 +12297,13 @@
   VariableElementImpl.forNode(Identifier name) : super.forNode(name);
 
   /**
-   * Initialize a newly created variable element to have the given name.
+   * Set whether this variable is const to correspond to the given value.
    *
-   * @param name the name of this element
-   * @param nameOffset the offset of the name of this element in the file that contains the
-   *          declaration of this element
+   * @param isConst `true` if the variable is const
    */
-  VariableElementImpl(String name, int nameOffset) : super(name, nameOffset);
+  void set const3(bool isConst) {
+    setModifier(Modifier.CONST, isConst);
+  }
 
   /**
    * Return the result of evaluating this variable's initializer as a compile-time constant
@@ -11637,11 +12314,40 @@
    */
   EvaluationResultImpl get evaluationResult => null;
 
+  /**
+   * Set the result of evaluating this variable's initializer as a compile-time constant expression
+   * to the given result.
+   *
+   * @param result the result of evaluating this variable's initializer
+   */
+  void set evaluationResult(EvaluationResultImpl result) {
+    throw new IllegalStateException(
+        "Invalid attempt to set a compile-time constant result");
+  }
+
+  /**
+   * Set whether this variable is final to correspond to the given value.
+   *
+   * @param isFinal `true` if the variable is final
+   */
+  void set final2(bool isFinal) {
+    setModifier(Modifier.FINAL, isFinal);
+  }
+
   @override
   FunctionElement get initializer => _initializer;
 
-  @override
-  VariableDeclaration get node => getNodeMatching((node) => node is VariableDeclaration);
+  /**
+   * Set the function representing this variable's initializer to the given function.
+   *
+   * @param initializer the function representing this variable's initializer
+   */
+  void set initializer(FunctionElement initializer) {
+    if (initializer != null) {
+      (initializer as FunctionElementImpl).enclosingElement = this;
+    }
+    this._initializer = initializer;
+  }
 
   @override
   bool get isConst => hasModifier(Modifier.CONST);
@@ -11667,51 +12373,9 @@
    */
   bool get isPotentiallyMutatedInScope => false;
 
-  /**
-   * Set whether this variable is const to correspond to the given value.
-   *
-   * @param isConst `true` if the variable is const
-   */
-  void set const3(bool isConst) {
-    setModifier(Modifier.CONST, isConst);
-  }
-
-  /**
-   * Set the result of evaluating this variable's initializer as a compile-time constant expression
-   * to the given result.
-   *
-   * @param result the result of evaluating this variable's initializer
-   */
-  void set evaluationResult(EvaluationResultImpl result) {
-    throw new IllegalStateException("Invalid attempt to set a compile-time constant result");
-  }
-
-  /**
-   * Set whether this variable is final to correspond to the given value.
-   *
-   * @param isFinal `true` if the variable is final
-   */
-  void set final2(bool isFinal) {
-    setModifier(Modifier.FINAL, isFinal);
-  }
-
-  /**
-   * Set the function representing this variable's initializer to the given function.
-   *
-   * @param initializer the function representing this variable's initializer
-   */
-  void set initializer(FunctionElement initializer) {
-    if (initializer != null) {
-      (initializer as FunctionElementImpl).enclosingElement = this;
-    }
-    this._initializer = initializer;
-  }
-
   @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChild(_initializer, visitor);
-  }
+  VariableDeclaration get node =>
+      getNodeMatching((node) => node is VariableDeclaration);
 
   @override
   void appendTo(StringBuffer buffer) {
@@ -11719,6 +12383,12 @@
     buffer.write(" ");
     buffer.write(displayName);
   }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChild(_initializer, visitor);
+  }
 }
 
 /**
@@ -11734,7 +12404,8 @@
    * @param baseElement the element on which the parameterized element was created
    * @param definingType the type in which the element is defined
    */
-  VariableMember(VariableElement baseElement, ParameterizedType definingType) : super(baseElement, definingType);
+  VariableMember(VariableElement baseElement, ParameterizedType definingType)
+      : super(baseElement, definingType);
 
   @override
   VariableElement get baseElement => super.baseElement as VariableElement;
@@ -11742,28 +12413,29 @@
   @override
   FunctionElement get initializer {
     //
-    // Elements within this element should have type parameters substituted, just like this element.
+    // Elements within this element should have type parameters substituted,
+    // just like this element.
     //
     throw new UnsupportedOperationException();
     //    return getBaseElement().getInitializer();
   }
 
   @override
-  VariableDeclaration get node => baseElement.node;
-
-  @override
-  DartType get type => substituteFor(baseElement.type);
-
-  @override
   bool get isConst => baseElement.isConst;
 
   @override
   bool get isFinal => baseElement.isFinal;
 
   @override
+  VariableDeclaration get node => baseElement.node;
+
+  @override
+  DartType get type => substituteFor(baseElement.type);
+
+  @override
   void visitChildren(ElementVisitor visitor) {
-    // TODO(brianwilkerson) We need to finish implementing the accessors used below so that we can
-    // safely invoke them.
+    // TODO(brianwilkerson) We need to finish implementing the accessors used
+    // below so that we can safely invoke them.
     super.visitChildren(visitor);
     safelyVisitChild(baseElement.initializer, visitor);
   }
@@ -11775,7 +12447,8 @@
  */
 abstract class VoidType implements DartType {
   @override
-  VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes);
+  VoidType substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes);
 }
 
 /**
@@ -11800,27 +12473,30 @@
   VoidTypeImpl() : super(null, Keyword.VOID.syntax);
 
   @override
-  bool operator ==(Object object) => identical(object, this);
-
-  @override
   int get hashCode => 2;
 
   @override
   bool get isVoid => true;
 
   @override
-  VoidTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) => this;
+  bool operator ==(Object object) => identical(object, this);
 
   @override
-  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => identical(object, this);
+  bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
+      identical(object, this);
 
   @override
-  bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_TypePair> visitedTypePairs) => isSubtypeOf(type);
+  bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
+      Set<TypeImpl_TypePair> visitedTypePairs) =>
+      isSubtypeOf(type);
 
   @override
-  bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) {
+  bool internalIsSubtypeOf(DartType type,
+      Set<TypeImpl_TypePair> visitedTypePairs) {
     if (type is UnionType) {
-      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visitedTypePairs);
+      return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(
+          this,
+          visitedTypePairs);
     }
     // The only subtype relations that pertain to void are therefore:
     // void <: void (by reflexivity)
@@ -11828,4 +12504,9 @@
     // void <: dynamic (as dynamic is a supertype of all types)
     return identical(type, this) || type.isDynamic;
   }
-}
\ No newline at end of file
+
+  @override
+  VoidTypeImpl substitute2(List<DartType> argumentTypes,
+      List<DartType> parameterTypes) =>
+      this;
+}
diff --git a/pkg/analyzer/lib/src/generated/element_handle.dart b/pkg/analyzer/lib/src/generated/element_handle.dart
index 8f582bb..61afb89 100644
--- a/pkg/analyzer/lib/src/generated/element_handle.dart
+++ b/pkg/analyzer/lib/src/generated/element_handle.dart
@@ -10,10 +10,10 @@
 import 'ast.dart';
 import 'element.dart';
 import 'engine.dart';
-import 'source.dart';
-import 'utilities_dart.dart';
 import 'java_core.dart';
 import 'java_engine.dart';
+import 'source.dart';
+import 'utilities_dart.dart';
 
 /**
  * Instances of the class `ClassElementHandle` implement a handle to a `ClassElement`.
@@ -30,28 +30,49 @@
   List<PropertyAccessorElement> get accessors => actualElement.accessors;
 
   @override
+  ClassElement get actualElement => super.actualElement as ClassElement;
+
+  @override
   List<InterfaceType> get allSupertypes => actualElement.allSupertypes;
 
   @override
   List<ConstructorElement> get constructors => actualElement.constructors;
 
   @override
-  FieldElement getField(String fieldName) => actualElement.getField(fieldName);
-
-  @override
   List<FieldElement> get fields => actualElement.fields;
 
   @override
-  PropertyAccessorElement getGetter(String getterName) => actualElement.getGetter(getterName);
+  bool get hasNonFinalField => actualElement.hasNonFinalField;
+
+  @override
+  bool get hasReferenceToSuper => actualElement.hasReferenceToSuper;
+
+  @override
+  bool get hasStaticMember => actualElement.hasStaticMember;
 
   @override
   List<InterfaceType> get interfaces => actualElement.interfaces;
 
   @override
-  ElementKind get kind => ElementKind.CLASS;
+  bool get isAbstract => actualElement.isAbstract;
 
   @override
-  MethodElement getMethod(String methodName) => actualElement.getMethod(methodName);
+  bool get isEnum => actualElement.isEnum;
+
+  @override
+  bool get isOrInheritsProxy => actualElement.isOrInheritsProxy;
+
+  @override
+  bool get isProxy => actualElement.isProxy;
+
+  @override
+  bool get isTypedef => actualElement.isTypedef;
+
+  @override
+  bool get isValidMixin => actualElement.isValidMixin;
+
+  @override
+  ElementKind get kind => ElementKind.CLASS;
 
   @override
   List<MethodElement> get methods => actualElement.methods;
@@ -60,15 +81,9 @@
   List<InterfaceType> get mixins => actualElement.mixins;
 
   @override
-  ConstructorElement getNamedConstructor(String name) => actualElement.getNamedConstructor(name);
-
-  @override
   ClassDeclaration get node => actualElement.node;
 
   @override
-  PropertyAccessorElement getSetter(String setterName) => actualElement.getSetter(setterName);
-
-  @override
   InterfaceType get supertype => actualElement.supertype;
 
   @override
@@ -84,69 +99,74 @@
   ConstructorElement get unnamedConstructor => actualElement.unnamedConstructor;
 
   @override
-  bool get hasNonFinalField => actualElement.hasNonFinalField;
+  FieldElement getField(String fieldName) => actualElement.getField(fieldName);
 
   @override
-  bool get hasReferenceToSuper => actualElement.hasReferenceToSuper;
+  PropertyAccessorElement getGetter(String getterName) =>
+      actualElement.getGetter(getterName);
 
   @override
-  bool get hasStaticMember => actualElement.hasStaticMember;
+  MethodElement getMethod(String methodName) =>
+      actualElement.getMethod(methodName);
 
   @override
-  bool get isAbstract => actualElement.isAbstract;
+  ConstructorElement getNamedConstructor(String name) =>
+      actualElement.getNamedConstructor(name);
 
   @override
-  bool get isEnum => actualElement.isEnum;
-
-  @override
-  bool get isOrInheritsProxy => actualElement.isOrInheritsProxy;
-
-  @override
-  bool get isProxy => actualElement.isProxy;
+  PropertyAccessorElement getSetter(String setterName) =>
+      actualElement.getSetter(setterName);
 
   @override
   bool isSuperConstructorAccessible(ConstructorElement constructor) =>
       actualElement.isSuperConstructorAccessible(constructor);
 
   @override
-  bool get isTypedef => actualElement.isTypedef;
+  MethodElement lookUpConcreteMethod(String methodName,
+      LibraryElement library) =>
+      actualElement.lookUpConcreteMethod(methodName, library);
 
   @override
-  bool get isValidMixin => actualElement.isValidMixin;
+  PropertyAccessorElement lookUpGetter(String getterName,
+      LibraryElement library) =>
+      actualElement.lookUpGetter(getterName, library);
 
   @override
-  MethodElement lookUpConcreteMethod(String methodName, LibraryElement library) => actualElement.lookUpConcreteMethod(methodName, library);
+  PropertyAccessorElement lookUpInheritedConcreteGetter(String methodName,
+      LibraryElement library) =>
+      actualElement.lookUpInheritedConcreteGetter(methodName, library);
 
   @override
-  PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) => actualElement.lookUpGetter(getterName, library);
+  MethodElement lookUpInheritedConcreteMethod(String methodName,
+      LibraryElement library) =>
+      actualElement.lookUpInheritedConcreteMethod(methodName, library);
 
   @override
-  PropertyAccessorElement lookUpInheritedConcreteGetter(String methodName, LibraryElement library) => actualElement.lookUpInheritedConcreteGetter(methodName, library);
+  PropertyAccessorElement lookUpInheritedConcreteSetter(String methodName,
+      LibraryElement library) =>
+      actualElement.lookUpInheritedConcreteSetter(methodName, library);
 
   @override
-  MethodElement lookUpInheritedConcreteMethod(String methodName, LibraryElement library) => actualElement.lookUpInheritedConcreteMethod(methodName, library);
+  MethodElement lookUpInheritedMethod(String methodName,
+      LibraryElement library) =>
+      actualElement.lookUpInheritedMethod(methodName, library);
 
   @override
-  PropertyAccessorElement lookUpInheritedConcreteSetter(String methodName, LibraryElement library) => actualElement.lookUpInheritedConcreteSetter(methodName, library);
+  MethodElement lookUpMethod(String methodName, LibraryElement library) =>
+      actualElement.lookUpMethod(methodName, library);
 
   @override
-  MethodElement lookUpInheritedMethod(String methodName, LibraryElement library) => actualElement.lookUpInheritedMethod(methodName, library);
-
-  @override
-  MethodElement lookUpMethod(String methodName, LibraryElement library) => actualElement.lookUpMethod(methodName, library);
-
-  @override
-  PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library) => actualElement.lookUpSetter(setterName, library);
-
-  @override
-  ClassElement get actualElement => super.actualElement as ClassElement;
+  PropertyAccessorElement lookUpSetter(String setterName,
+      LibraryElement library) =>
+      actualElement.lookUpSetter(setterName, library);
 }
 
 /**
  * Instances of the class `CompilationUnitElementHandle` implements a handle to a
  * [CompilationUnitElement].
  */
-class CompilationUnitElementHandle extends ElementHandle implements CompilationUnitElement {
+class CompilationUnitElementHandle extends ElementHandle implements
+    CompilationUnitElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -158,13 +178,15 @@
   List<PropertyAccessorElement> get accessors => actualElement.accessors;
 
   @override
+  CompilationUnitElement get actualElement =>
+      super.actualElement as CompilationUnitElement;
+
+  @override
   List<AngularViewElement> get angularViews => actualElement.angularViews;
 
   @override
-  LibraryElement get enclosingElement => super.enclosingElement as LibraryElement;
-
-  @override
-  ClassElement getEnum(String enumName) => actualElement.getEnum(enumName);
+  LibraryElement get enclosingElement =>
+      super.enclosingElement as LibraryElement;
 
   @override
   List<ClassElement> get enums => actualElement.enums;
@@ -173,7 +195,11 @@
   List<FunctionElement> get functions => actualElement.functions;
 
   @override
-  List<FunctionTypeAliasElement> get functionTypeAliases => actualElement.functionTypeAliases;
+  List<FunctionTypeAliasElement> get functionTypeAliases =>
+      actualElement.functionTypeAliases;
+
+  @override
+  bool get hasLoadLibraryFunction => actualElement.hasLoadLibraryFunction;
 
   @override
   ElementKind get kind => ElementKind.COMPILATION_UNIT;
@@ -185,10 +211,8 @@
   Source get source => actualElement.source;
 
   @override
-  List<TopLevelVariableElement> get topLevelVariables => actualElement.topLevelVariables;
-
-  @override
-  ClassElement getType(String className) => actualElement.getType(className);
+  List<TopLevelVariableElement> get topLevelVariables =>
+      actualElement.topLevelVariables;
 
   @override
   List<ClassElement> get types => actualElement.types;
@@ -203,17 +227,18 @@
   int get uriOffset => actualElement.uriOffset;
 
   @override
-  bool get hasLoadLibraryFunction => actualElement.hasLoadLibraryFunction;
+  ClassElement getEnum(String enumName) => actualElement.getEnum(enumName);
 
   @override
-  CompilationUnitElement get actualElement => super.actualElement as CompilationUnitElement;
+  ClassElement getType(String className) => actualElement.getType(className);
 }
 
 /**
  * Instances of the class `ConstructorElementHandle` implement a handle to a
  * `ConstructorElement`.
  */
-class ConstructorElementHandle extends ExecutableElementHandle implements ConstructorElement {
+class ConstructorElementHandle extends ExecutableElementHandle implements
+    ConstructorElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -222,18 +247,13 @@
   ConstructorElementHandle(ConstructorElement element) : super(element);
 
   @override
+  ConstructorElement get actualElement =>
+      super.actualElement as ConstructorElement;
+
+  @override
   ClassElement get enclosingElement => actualElement.enclosingElement;
 
   @override
-  ElementKind get kind => ElementKind.CONSTRUCTOR;
-
-  @override
-  ConstructorDeclaration get node => actualElement.node;
-
-  @override
-  ConstructorElement get redirectedConstructor => actualElement.redirectedConstructor;
-
-  @override
   bool get isConst => actualElement.isConst;
 
   @override
@@ -243,7 +263,14 @@
   bool get isFactory => actualElement.isFactory;
 
   @override
-  ConstructorElement get actualElement => super.actualElement as ConstructorElement;
+  ElementKind get kind => ElementKind.CONSTRUCTOR;
+
+  @override
+  ConstructorDeclaration get node => actualElement.node;
+
+  @override
+  ConstructorElement get redirectedConstructor =>
+      actualElement.redirectedConstructor;
 }
 
 /**
@@ -252,77 +279,6 @@
  */
 abstract class ElementHandle implements Element {
   /**
-   * Return a handle on the given element. If the element is already a handle, then it will be
-   * returned directly, otherwise a handle of the appropriate class will be constructed.
-   *
-   * @param element the element for which a handle is to be constructed
-   * @return a handle on the given element
-   */
-  static Element forElement(Element element) {
-    if (element is ElementHandle) {
-      return element;
-    }
-    while (true) {
-      if (element.kind == ElementKind.CLASS) {
-        return new ClassElementHandle(element as ClassElement);
-      } else if (element.kind == ElementKind.COMPILATION_UNIT) {
-        return new CompilationUnitElementHandle(element as CompilationUnitElement);
-      } else if (element.kind == ElementKind.CONSTRUCTOR) {
-        return new ConstructorElementHandle(element as ConstructorElement);
-      } else if (element.kind == ElementKind.EXPORT) {
-        return new ExportElementHandle(element as ExportElement);
-      } else if (element.kind == ElementKind.FIELD) {
-        return new FieldElementHandle(element as FieldElement);
-      } else if (element.kind == ElementKind.FUNCTION) {
-        return new FunctionElementHandle(element as FunctionElement);
-      } else if (element.kind == ElementKind.GETTER) {
-        return new PropertyAccessorElementHandle(element as PropertyAccessorElement);
-      } else if (element.kind == ElementKind.IMPORT) {
-        return new ImportElementHandle(element as ImportElement);
-      } else if (element.kind == ElementKind.LABEL) {
-        return new LabelElementHandle(element as LabelElement);
-      } else if (element.kind == ElementKind.LIBRARY) {
-        return new LibraryElementHandle(element as LibraryElement);
-      } else if (element.kind == ElementKind.LOCAL_VARIABLE) {
-        return new LocalVariableElementHandle(element as LocalVariableElement);
-      } else if (element.kind == ElementKind.METHOD) {
-        return new MethodElementHandle(element as MethodElement);
-      } else if (element.kind == ElementKind.PARAMETER) {
-        return new ParameterElementHandle(element as ParameterElement);
-      } else if (element.kind == ElementKind.PREFIX) {
-        return new PrefixElementHandle(element as PrefixElement);
-      } else if (element.kind == ElementKind.SETTER) {
-        return new PropertyAccessorElementHandle(element as PropertyAccessorElement);
-      } else if (element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        return new TopLevelVariableElementHandle(element as TopLevelVariableElement);
-      } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
-        return new FunctionTypeAliasElementHandle(element as FunctionTypeAliasElement);
-      } else if (element.kind == ElementKind.TYPE_PARAMETER) {
-        return new TypeParameterElementHandle(element as TypeParameterElement);
-      } else {
-        throw new UnsupportedOperationException();
-      }
-      break;
-    }
-  }
-
-  /**
-   * Return an array of the same size as the given array where each element of the returned array is
-   * a handle for the corresponding element of the given array.
-   *
-   * @param elements the elements for which handles are to be created
-   * @return an array of handles to the given elements
-   */
-  static List<Element> forElements(List<Element> elements) {
-    int length = elements.length;
-    List<Element> handles = new List<Element>.from(elements);
-    for (int i = 0; i < length; i++) {
-      handles[i] = forElement(elements[i]);
-    }
-    return handles;
-  }
-
-  /**
    * The context in which the element is defined.
    */
   AnalysisContext _context;
@@ -350,17 +306,20 @@
     _elementReference = new WeakReference<Element>(element);
   }
 
-  @override
-  accept(ElementVisitor visitor) => actualElement.accept(visitor);
-
-  @override
-  String computeDocumentationComment() => actualElement.computeDocumentationComment();
-
-  @override
-  bool operator ==(Object object) => object is Element && object.location == _location;
-
-  @override
-  Element getAncestor(Predicate<Element> predicate) => actualElement.getAncestor(predicate);
+  /**
+   * Return the element being represented by this handle, reconstituting the element if the
+   * reference has been set to `null`.
+   *
+   * @return the element being represented by this handle
+   */
+  Element get actualElement {
+    Element element = _elementReference.get();
+    if (element == null) {
+      element = _context.getElement(_location);
+      _elementReference = new WeakReference<Element>(element);
+    }
+    return element;
+  }
 
   @override
   AnalysisContext get context => _context;
@@ -372,10 +331,26 @@
   Element get enclosingElement => actualElement.enclosingElement;
 
   @override
-  String getExtendedDisplayName(String shortName) => actualElement.getExtendedDisplayName(shortName);
+  int get hashCode => _location.hashCode;
 
   @override
-  LibraryElement get library => getAncestor((element) => element is LibraryElement);
+  bool get isDeprecated => actualElement.isDeprecated;
+
+  @override
+  bool get isOverride => actualElement.isOverride;
+
+  @override
+  bool get isPrivate => actualElement.isPrivate;
+
+  @override
+  bool get isPublic => actualElement.isPublic;
+
+  @override
+  bool get isSynthetic => actualElement.isSynthetic;
+
+  @override
+  LibraryElement get library =>
+      getAncestor((element) => element is LibraryElement);
 
   @override
   ElementLocation get location => _location;
@@ -399,25 +374,27 @@
   CompilationUnit get unit => actualElement.unit;
 
   @override
-  int get hashCode => _location.hashCode;
+  bool operator ==(Object object) =>
+      object is Element && object.location == _location;
 
   @override
-  bool isAccessibleIn(LibraryElement library) => actualElement.isAccessibleIn(library);
+  accept(ElementVisitor visitor) => actualElement.accept(visitor);
 
   @override
-  bool get isDeprecated => actualElement.isDeprecated;
+  String computeDocumentationComment() =>
+      actualElement.computeDocumentationComment();
 
   @override
-  bool get isOverride => actualElement.isOverride;
+  Element getAncestor(Predicate<Element> predicate) =>
+      actualElement.getAncestor(predicate);
 
   @override
-  bool get isPrivate => actualElement.isPrivate;
+  String getExtendedDisplayName(String shortName) =>
+      actualElement.getExtendedDisplayName(shortName);
 
   @override
-  bool get isPublic => actualElement.isPublic;
-
-  @override
-  bool get isSynthetic => actualElement.isSynthetic;
+  bool isAccessibleIn(LibraryElement library) =>
+      actualElement.isAccessibleIn(library);
 
   @override
   void visitChildren(ElementVisitor visitor) {
@@ -425,18 +402,79 @@
   }
 
   /**
-   * Return the element being represented by this handle, reconstituting the element if the
-   * reference has been set to `null`.
+   * Return a handle on the given element. If the element is already a handle, then it will be
+   * returned directly, otherwise a handle of the appropriate class will be constructed.
    *
-   * @return the element being represented by this handle
+   * @param element the element for which a handle is to be constructed
+   * @return a handle on the given element
    */
-  Element get actualElement {
-    Element element = _elementReference.get();
-    if (element == null) {
-      element = _context.getElement(_location);
-      _elementReference = new WeakReference<Element>(element);
+  static Element forElement(Element element) {
+    if (element is ElementHandle) {
+      return element;
     }
-    return element;
+    while (true) {
+      if (element.kind == ElementKind.CLASS) {
+        return new ClassElementHandle(element as ClassElement);
+      } else if (element.kind == ElementKind.COMPILATION_UNIT) {
+        return new CompilationUnitElementHandle(
+            element as CompilationUnitElement);
+      } else if (element.kind == ElementKind.CONSTRUCTOR) {
+        return new ConstructorElementHandle(element as ConstructorElement);
+      } else if (element.kind == ElementKind.EXPORT) {
+        return new ExportElementHandle(element as ExportElement);
+      } else if (element.kind == ElementKind.FIELD) {
+        return new FieldElementHandle(element as FieldElement);
+      } else if (element.kind == ElementKind.FUNCTION) {
+        return new FunctionElementHandle(element as FunctionElement);
+      } else if (element.kind == ElementKind.GETTER) {
+        return new PropertyAccessorElementHandle(
+            element as PropertyAccessorElement);
+      } else if (element.kind == ElementKind.IMPORT) {
+        return new ImportElementHandle(element as ImportElement);
+      } else if (element.kind == ElementKind.LABEL) {
+        return new LabelElementHandle(element as LabelElement);
+      } else if (element.kind == ElementKind.LIBRARY) {
+        return new LibraryElementHandle(element as LibraryElement);
+      } else if (element.kind == ElementKind.LOCAL_VARIABLE) {
+        return new LocalVariableElementHandle(element as LocalVariableElement);
+      } else if (element.kind == ElementKind.METHOD) {
+        return new MethodElementHandle(element as MethodElement);
+      } else if (element.kind == ElementKind.PARAMETER) {
+        return new ParameterElementHandle(element as ParameterElement);
+      } else if (element.kind == ElementKind.PREFIX) {
+        return new PrefixElementHandle(element as PrefixElement);
+      } else if (element.kind == ElementKind.SETTER) {
+        return new PropertyAccessorElementHandle(
+            element as PropertyAccessorElement);
+      } else if (element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
+        return new TopLevelVariableElementHandle(
+            element as TopLevelVariableElement);
+      } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
+        return new FunctionTypeAliasElementHandle(
+            element as FunctionTypeAliasElement);
+      } else if (element.kind == ElementKind.TYPE_PARAMETER) {
+        return new TypeParameterElementHandle(element as TypeParameterElement);
+      } else {
+        throw new UnsupportedOperationException();
+      }
+      break;
+    }
+  }
+
+  /**
+   * Return an array of the same size as the given array where each element of the returned array is
+   * a handle for the corresponding element of the given array.
+   *
+   * @param elements the elements for which handles are to be created
+   * @return an array of handles to the given elements
+   */
+  static List<Element> forElements(List<Element> elements) {
+    int length = elements.length;
+    List<Element> handles = new List<Element>.from(elements);
+    for (int i = 0; i < length; i++) {
+      handles[i] = forElement(elements[i]);
+    }
+    return handles;
   }
 }
 
@@ -444,7 +482,8 @@
  * The abstract class `ExecutableElementHandle` implements the behavior common to objects that
  * implement a handle to an [ExecutableElement].
  */
-abstract class ExecutableElementHandle extends ElementHandle implements ExecutableElement {
+abstract class ExecutableElementHandle extends ElementHandle implements
+    ExecutableElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -453,24 +492,13 @@
   ExecutableElementHandle(ExecutableElement element) : super(element);
 
   @override
+  ExecutableElement get actualElement =>
+      super.actualElement as ExecutableElement;
+
+  @override
   List<FunctionElement> get functions => actualElement.functions;
 
   @override
-  List<LabelElement> get labels => actualElement.labels;
-
-  @override
-  List<LocalVariableElement> get localVariables => actualElement.localVariables;
-
-  @override
-  List<ParameterElement> get parameters => actualElement.parameters;
-
-  @override
-  DartType get returnType => actualElement.returnType;
-
-  @override
-  FunctionType get type => actualElement.type;
-
-  @override
   bool get isAsynchronous => actualElement.isAsynchronous;
 
   @override
@@ -486,7 +514,19 @@
   bool get isSynchronous => actualElement.isSynchronous;
 
   @override
-  ExecutableElement get actualElement => super.actualElement as ExecutableElement;
+  List<LabelElement> get labels => actualElement.labels;
+
+  @override
+  List<LocalVariableElement> get localVariables => actualElement.localVariables;
+
+  @override
+  List<ParameterElement> get parameters => actualElement.parameters;
+
+  @override
+  DartType get returnType => actualElement.returnType;
+
+  @override
+  FunctionType get type => actualElement.type;
 }
 
 /**
@@ -502,6 +542,9 @@
   ExportElementHandle(ExportElement element) : super(element);
 
   @override
+  ExportElement get actualElement => super.actualElement as ExportElement;
+
+  @override
   List<NamespaceCombinator> get combinators => actualElement.combinators;
 
   @override
@@ -518,15 +561,13 @@
 
   @override
   int get uriOffset => actualElement.uriOffset;
-
-  @override
-  ExportElement get actualElement => super.actualElement as ExportElement;
 }
 
 /**
  * Instances of the class `FieldElementHandle` implement a handle to a `FieldElement`.
  */
-class FieldElementHandle extends PropertyInducingElementHandle implements FieldElement {
+class FieldElementHandle extends PropertyInducingElementHandle implements
+    FieldElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -535,23 +576,24 @@
   FieldElementHandle(FieldElement element) : super(element);
 
   @override
-  ClassElement get enclosingElement => actualElement.enclosingElement;
+  FieldElement get actualElement => super.actualElement as FieldElement;
 
   @override
-  ElementKind get kind => ElementKind.FIELD;
+  ClassElement get enclosingElement => actualElement.enclosingElement;
 
   @override
   bool get isStatic => actualElement.isStatic;
 
   @override
-  FieldElement get actualElement => super.actualElement as FieldElement;
+  ElementKind get kind => ElementKind.FIELD;
 }
 
 /**
  * Instances of the class `FunctionElementHandle` implement a handle to a
  * `FunctionElement`.
  */
-class FunctionElementHandle extends ExecutableElementHandle implements FunctionElement {
+class FunctionElementHandle extends ExecutableElementHandle implements
+    FunctionElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -560,6 +602,9 @@
   FunctionElementHandle(FunctionElement element) : super(element);
 
   @override
+  FunctionElement get actualElement => super.actualElement as FunctionElement;
+
+  @override
   ElementKind get kind => ElementKind.FUNCTION;
 
   @override
@@ -567,25 +612,29 @@
 
   @override
   SourceRange get visibleRange => actualElement.visibleRange;
-
-  @override
-  FunctionElement get actualElement => super.actualElement as FunctionElement;
 }
 
 /**
  * Instances of the class `FunctionTypeAliasElementHandle` implement a handle to a
  * `FunctionTypeAliasElement`.
  */
-class FunctionTypeAliasElementHandle extends ElementHandle implements FunctionTypeAliasElement {
+class FunctionTypeAliasElementHandle extends ElementHandle implements
+    FunctionTypeAliasElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
    * @param element the element being represented
    */
-  FunctionTypeAliasElementHandle(FunctionTypeAliasElement element) : super(element);
+  FunctionTypeAliasElementHandle(FunctionTypeAliasElement element)
+      : super(element);
 
   @override
-  CompilationUnitElement get enclosingElement => super.enclosingElement as CompilationUnitElement;
+  FunctionTypeAliasElement get actualElement =>
+      super.actualElement as FunctionTypeAliasElement;
+
+  @override
+  CompilationUnitElement get enclosingElement =>
+      super.enclosingElement as CompilationUnitElement;
 
   @override
   ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
@@ -604,9 +653,6 @@
 
   @override
   List<TypeParameterElement> get typeParameters => actualElement.typeParameters;
-
-  @override
-  FunctionTypeAliasElement get actualElement => super.actualElement as FunctionTypeAliasElement;
 }
 
 /**
@@ -622,12 +668,18 @@
   ImportElementHandle(ImportElement element) : super(element);
 
   @override
+  ImportElement get actualElement => super.actualElement as ImportElement;
+
+  @override
   List<NamespaceCombinator> get combinators => actualElement.combinators;
 
   @override
   LibraryElement get importedLibrary => actualElement.importedLibrary;
 
   @override
+  bool get isDeferred => actualElement.isDeferred;
+
+  @override
   ElementKind get kind => ElementKind.IMPORT;
 
   @override
@@ -644,12 +696,6 @@
 
   @override
   int get uriOffset => actualElement.uriOffset;
-
-  @override
-  bool get isDeferred => actualElement.isDeferred;
-
-  @override
-  ImportElement get actualElement => super.actualElement as ImportElement;
 }
 
 /**
@@ -664,7 +710,8 @@
   LabelElementHandle(LabelElement element) : super(element);
 
   @override
-  ExecutableElement get enclosingElement => super.enclosingElement as ExecutableElement;
+  ExecutableElement get enclosingElement =>
+      super.enclosingElement as ExecutableElement;
 
   @override
   ElementKind get kind => ElementKind.LABEL;
@@ -683,7 +730,11 @@
   LibraryElementHandle(LibraryElement element) : super(element);
 
   @override
-  CompilationUnitElement get definingCompilationUnit => actualElement.definingCompilationUnit;
+  LibraryElement get actualElement => super.actualElement as LibraryElement;
+
+  @override
+  CompilationUnitElement get definingCompilationUnit =>
+      actualElement.definingCompilationUnit;
 
   @override
   FunctionElement get entryPoint => actualElement.entryPoint;
@@ -695,42 +746,18 @@
   List<ExportElement> get exports => actualElement.exports;
 
   @override
-  List<LibraryElement> get importedLibraries => actualElement.importedLibraries;
-
-  @override
-  List<ImportElement> get imports => actualElement.imports;
-
-  @override
-  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement) => actualElement.getImportsWithPrefix(prefixElement);
-
-  @override
-  ElementKind get kind => ElementKind.LIBRARY;
-
-  @override
-  FunctionElement get loadLibraryFunction => actualElement.loadLibraryFunction;
-
-  @override
-  List<CompilationUnitElement> get parts => actualElement.parts;
-
-  @override
-  List<PrefixElement> get prefixes => actualElement.prefixes;
-
-  @override
-  ClassElement getType(String className) => actualElement.getType(className);
-
-  @override
-  List<CompilationUnitElement> get units => actualElement.units;
-
-  @override
-  List<LibraryElement> get visibleLibraries => actualElement.visibleLibraries;
-
-  @override
   bool get hasExtUri => actualElement.hasExtUri;
 
   @override
   bool get hasLoadLibraryFunction => actualElement.hasLoadLibraryFunction;
 
   @override
+  List<LibraryElement> get importedLibraries => actualElement.importedLibraries;
+
+  @override
+  List<ImportElement> get imports => actualElement.imports;
+
+  @override
   bool get isAngularHtml => actualElement.isAngularHtml;
 
   @override
@@ -743,17 +770,40 @@
   bool get isInSdk => actualElement.isInSdk;
 
   @override
-  bool isUpToDate(int timeStamp) => actualElement.isUpToDate(timeStamp);
+  ElementKind get kind => ElementKind.LIBRARY;
 
   @override
-  LibraryElement get actualElement => super.actualElement as LibraryElement;
+  FunctionElement get loadLibraryFunction => actualElement.loadLibraryFunction;
+
+  @override
+  List<CompilationUnitElement> get parts => actualElement.parts;
+
+  @override
+  List<PrefixElement> get prefixes => actualElement.prefixes;
+
+  @override
+  List<CompilationUnitElement> get units => actualElement.units;
+
+  @override
+  List<LibraryElement> get visibleLibraries => actualElement.visibleLibraries;
+
+  @override
+  List<ImportElement> getImportsWithPrefix(PrefixElement prefixElement) =>
+      actualElement.getImportsWithPrefix(prefixElement);
+
+  @override
+  ClassElement getType(String className) => actualElement.getType(className);
+
+  @override
+  bool isUpToDate(int timeStamp) => actualElement.isUpToDate(timeStamp);
 }
 
 /**
  * Instances of the class `LocalVariableElementHandle` implement a handle to a
  * `LocalVariableElement`.
  */
-class LocalVariableElementHandle extends VariableElementHandle implements LocalVariableElement {
+class LocalVariableElementHandle extends VariableElementHandle implements
+    LocalVariableElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -762,6 +812,10 @@
   LocalVariableElementHandle(LocalVariableElement element) : super(element);
 
   @override
+  LocalVariableElement get actualElement =>
+      super.actualElement as LocalVariableElement;
+
+  @override
   ElementKind get kind => ElementKind.LOCAL_VARIABLE;
 
   @override
@@ -769,15 +823,13 @@
 
   @override
   SourceRange get visibleRange => actualElement.visibleRange;
-
-  @override
-  LocalVariableElement get actualElement => super.actualElement as LocalVariableElement;
 }
 
 /**
  * Instances of the class `MethodElementHandle` implement a handle to a `MethodElement`.
  */
-class MethodElementHandle extends ExecutableElementHandle implements MethodElement {
+class MethodElementHandle extends ExecutableElementHandle implements
+    MethodElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -786,29 +838,30 @@
   MethodElementHandle(MethodElement element) : super(element);
 
   @override
+  MethodElement get actualElement => super.actualElement as MethodElement;
+
+  @override
   ClassElement get enclosingElement => super.enclosingElement as ClassElement;
 
   @override
-  ElementKind get kind => ElementKind.METHOD;
-
-  @override
-  MethodDeclaration get node => actualElement.node;
-
-  @override
   bool get isAbstract => actualElement.isAbstract;
 
   @override
   bool get isStatic => actualElement.isStatic;
 
   @override
-  MethodElement get actualElement => super.actualElement as MethodElement;
+  ElementKind get kind => ElementKind.METHOD;
+
+  @override
+  MethodDeclaration get node => actualElement.node;
 }
 
 /**
  * Instances of the class `ParameterElementHandle` implement a handle to a
  * `ParameterElement`.
  */
-class ParameterElementHandle extends VariableElementHandle implements ParameterElement {
+class ParameterElementHandle extends VariableElementHandle implements
+    ParameterElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -817,9 +870,15 @@
   ParameterElementHandle(ParameterElement element) : super(element);
 
   @override
+  ParameterElement get actualElement => super.actualElement as ParameterElement;
+
+  @override
   String get defaultValueCode => actualElement.defaultValueCode;
 
   @override
+  bool get isInitializingFormal => actualElement.isInitializingFormal;
+
+  @override
   ElementKind get kind => ElementKind.PARAMETER;
 
   @override
@@ -830,12 +889,6 @@
 
   @override
   SourceRange get visibleRange => actualElement.visibleRange;
-
-  @override
-  bool get isInitializingFormal => actualElement.isInitializingFormal;
-
-  @override
-  ParameterElement get actualElement => super.actualElement as ParameterElement;
 }
 
 /**
@@ -850,35 +903,53 @@
   PrefixElementHandle(PrefixElement element) : super(element);
 
   @override
-  LibraryElement get enclosingElement => super.enclosingElement as LibraryElement;
+  PrefixElement get actualElement => super.actualElement as PrefixElement;
+
+  @override
+  LibraryElement get enclosingElement =>
+      super.enclosingElement as LibraryElement;
 
   @override
   List<LibraryElement> get importedLibraries => actualElement.importedLibraries;
 
   @override
   ElementKind get kind => ElementKind.PREFIX;
-
-  @override
-  PrefixElement get actualElement => super.actualElement as PrefixElement;
 }
 
 /**
  * Instances of the class `PropertyAccessorElementHandle` implement a handle to a
  * `PropertyAccessorElement`.
  */
-class PropertyAccessorElementHandle extends ExecutableElementHandle implements PropertyAccessorElement {
+class PropertyAccessorElementHandle extends ExecutableElementHandle implements
+    PropertyAccessorElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
    * @param element the element being represented
    */
-  PropertyAccessorElementHandle(PropertyAccessorElement element) : super(element);
+  PropertyAccessorElementHandle(PropertyAccessorElement element)
+      : super(element);
 
   @override
-  PropertyAccessorElement get correspondingGetter => actualElement.correspondingGetter;
+  PropertyAccessorElement get actualElement =>
+      super.actualElement as PropertyAccessorElement;
 
   @override
-  PropertyAccessorElement get correspondingSetter => actualElement.correspondingSetter;
+  PropertyAccessorElement get correspondingGetter =>
+      actualElement.correspondingGetter;
+
+  @override
+  PropertyAccessorElement get correspondingSetter =>
+      actualElement.correspondingSetter;
+
+  @override
+  bool get isAbstract => actualElement.isAbstract;
+
+  @override
+  bool get isGetter => actualElement.isGetter;
+
+  @override
+  bool get isSetter => actualElement.isSetter;
 
   @override
   ElementKind get kind {
@@ -891,59 +962,52 @@
 
   @override
   PropertyInducingElement get variable => actualElement.variable;
-
-  @override
-  bool get isAbstract => actualElement.isAbstract;
-
-  @override
-  bool get isGetter => actualElement.isGetter;
-
-  @override
-  bool get isSetter => actualElement.isSetter;
-
-  @override
-  PropertyAccessorElement get actualElement => super.actualElement as PropertyAccessorElement;
 }
 
 /**
  * The abstract class `PropertyInducingElementHandle` implements the behavior common to
  * objects that implement a handle to an `PropertyInducingElement`.
  */
-abstract class PropertyInducingElementHandle extends VariableElementHandle implements PropertyInducingElement {
+abstract class PropertyInducingElementHandle extends VariableElementHandle
+    implements PropertyInducingElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
    * @param element the element being represented
    */
-  PropertyInducingElementHandle(PropertyInducingElement element) : super(element);
+  PropertyInducingElementHandle(PropertyInducingElement element)
+      : super(element);
+
+  @override
+  PropertyInducingElement get actualElement =>
+      super.actualElement as PropertyInducingElement;
 
   @override
   PropertyAccessorElement get getter => actualElement.getter;
 
   @override
+  bool get isStatic => actualElement.isStatic;
+
+  @override
   DartType get propagatedType => actualElement.propagatedType;
 
   @override
   PropertyAccessorElement get setter => actualElement.setter;
-
-  @override
-  bool get isStatic => actualElement.isStatic;
-
-  @override
-  PropertyInducingElement get actualElement => super.actualElement as PropertyInducingElement;
 }
 
 /**
  * Instances of the class `TopLevelVariableElementHandle` implement a handle to a
  * `TopLevelVariableElement`.
  */
-class TopLevelVariableElementHandle extends PropertyInducingElementHandle implements TopLevelVariableElement {
+class TopLevelVariableElementHandle extends PropertyInducingElementHandle
+    implements TopLevelVariableElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
    * @param element the element being represented
    */
-  TopLevelVariableElementHandle(TopLevelVariableElement element) : super(element);
+  TopLevelVariableElementHandle(TopLevelVariableElement element)
+      : super(element);
 
   @override
   ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
@@ -953,7 +1017,8 @@
  * Instances of the class `TypeParameterElementHandle` implement a handle to a
  * [TypeParameterElement].
  */
-class TypeParameterElementHandle extends ElementHandle implements TypeParameterElement {
+class TypeParameterElementHandle extends ElementHandle implements
+    TypeParameterElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -962,6 +1027,10 @@
   TypeParameterElementHandle(TypeParameterElement element) : super(element);
 
   @override
+  TypeParameterElement get actualElement =>
+      super.actualElement as TypeParameterElement;
+
+  @override
   DartType get bound => actualElement.bound;
 
   @override
@@ -969,16 +1038,14 @@
 
   @override
   TypeParameterType get type => actualElement.type;
-
-  @override
-  TypeParameterElement get actualElement => super.actualElement as TypeParameterElement;
 }
 
 /**
  * The abstract class `VariableElementHandle` implements the behavior common to objects that
  * implement a handle to an `VariableElement`.
  */
-abstract class VariableElementHandle extends ElementHandle implements VariableElement {
+abstract class VariableElementHandle extends ElementHandle implements
+    VariableElement {
   /**
    * Initialize a newly created element handle to represent the given element.
    *
@@ -987,22 +1054,22 @@
   VariableElementHandle(VariableElement element) : super(element);
 
   @override
+  VariableElement get actualElement => super.actualElement as VariableElement;
+
+  @override
   FunctionElement get initializer => actualElement.initializer;
 
   @override
-  VariableDeclaration get node => actualElement.node;
-
-  @override
-  DartType get type => actualElement.type;
-
-  @override
   bool get isConst => actualElement.isConst;
 
   @override
   bool get isFinal => actualElement.isFinal;
 
   @override
-  VariableElement get actualElement => super.actualElement as VariableElement;
+  VariableDeclaration get node => actualElement.node;
+
+  @override
+  DartType get type => actualElement.type;
 }
 /**
  * TODO(scheglov) invalid implementation
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 886da2a..c1cf5b5 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -6,13 +6,13 @@
 
 import 'dart:collection';
 
-import 'error.dart';
-import 'scanner.dart' as sc;
-import 'utilities_dart.dart';
 import 'ast.dart';
 import 'element.dart';
 import 'engine.dart';
+import 'error.dart';
 import 'resolver.dart';
+import 'scanner.dart' as sc;
+import 'utilities_dart.dart';
 
 /**
  * Instances of the class `ElementResolver` are used by instances of [ResolverVisitor]
@@ -66,164 +66,6 @@
  */
 class ElementResolver extends SimpleAstVisitor<Object> {
   /**
-   * Checks whether the given expression is a reference to a class. If it is then the
-   * [ClassElement] is returned, otherwise `null` is returned.
-   *
-   * @param expression the expression to evaluate
-   * @return the element representing the class
-   */
-  static ClassElementImpl getTypeReference(Expression expression) {
-    if (expression is Identifier) {
-      Element staticElement = expression.staticElement;
-      if (staticElement is ClassElementImpl) {
-        return staticElement;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Helper function for `maybeMergeExecutableElements` that does the actual merging.
-   *
-   * @param elementArrayToMerge non-empty array of elements to merge.
-   * @return
-   */
-  static ExecutableElement _computeMergedExecutableElement(List<ExecutableElement> elementArrayToMerge) {
-    // Flatten methods structurally. Based on
-    // [InheritanceManager.computeMergedExecutableElement] and
-    // [InheritanceManager.createSyntheticExecutableElement].
-    //
-    // However, the approach we take here is much simpler, but expected to work
-    // well in the common case. It degrades gracefully in the uncommon case,
-    // by computing the type [dynamic] for the method, preventing any
-    // hints from being generated (TODO: not done yet).
-    //
-    // The approach is: we require that each [ExecutableElement] has the
-    // same shape: the same number of required, optional positional, and optional named
-    // parameters, in the same positions, and with the named parameters in the
-    // same order. We compute a type by unioning pointwise.
-    ExecutableElement e_0 = elementArrayToMerge[0];
-    List<ParameterElement> ps_0 = e_0.parameters;
-    List<ParameterElementImpl> ps_out = new List<ParameterElementImpl>(ps_0.length);
-    for (int j = 0; j < ps_out.length; j++) {
-      ps_out[j] = new ParameterElementImpl(ps_0[j].name, 0);
-      ps_out[j].synthetic = true;
-      ps_out[j].type = ps_0[j].type;
-      ps_out[j].parameterKind = ps_0[j].parameterKind;
-    }
-    DartType r_out = e_0.returnType;
-    for (int i = 1; i < elementArrayToMerge.length; i++) {
-      ExecutableElement e_i = elementArrayToMerge[i];
-      r_out = UnionTypeImpl.union([r_out, e_i.returnType]);
-      List<ParameterElement> ps_i = e_i.parameters;
-      // Each function must have the same number of params.
-      if (ps_0.length != ps_i.length) {
-        return null;
-        // TODO (collinsn): return an element representing [dynamic] here instead.
-      } else {
-        // Each function must have the same kind of params, with the same names,
-        // in the same order.
-        for (int j = 0; j < ps_i.length; j++) {
-          if (ps_0[j].parameterKind != ps_i[j].parameterKind || !identical(ps_0[j].name, ps_i[j].name)) {
-            return null;
-          } else {
-            // The output parameter type is the union of the input parameter types.
-            ps_out[j].type = UnionTypeImpl.union([ps_out[j].type, ps_i[j].type]);
-          }
-        }
-      }
-    }
-    // TODO (collinsn): this code should work for functions and methods,
-    // so we may want [FunctionElementImpl]
-    // instead here in some cases? And then there are constructors and property accessors.
-    // Maybe the answer is to create a new subclass of [ExecutableElementImpl] which
-    // is used for merged executable elements, in analogy with [MultiplyInheritedMethodElementImpl]
-    // and [MultiplyInheritedPropertyAcessorElementImpl].
-    ExecutableElementImpl e_out = new MethodElementImpl(e_0.name, 0);
-    e_out.synthetic = true;
-    e_out.returnType = r_out;
-    e_out.parameters = ps_out;
-    e_out.type = new FunctionTypeImpl.con1(e_out);
-    // Get NPE in [toString()] w/o this.
-    e_out.enclosingElement = e_0.enclosingElement;
-    return e_out;
-  }
-
-  /**
-   * Return `true` if the given identifier is the return type of a constructor declaration.
-   *
-   * @return `true` if the given identifier is the return type of a constructor declaration.
-   */
-  static bool _isConstructorReturnType(SimpleIdentifier identifier) {
-    AstNode parent = identifier.parent;
-    if (parent is ConstructorDeclaration) {
-      return identical(parent.returnType, identifier);
-    }
-    return false;
-  }
-
-  /**
-   * Return `true` if the given identifier is the return type of a factory constructor.
-   *
-   * @return `true` if the given identifier is the return type of a factory constructor
-   *         declaration.
-   */
-  static bool _isFactoryConstructorReturnType(SimpleIdentifier node) {
-    AstNode parent = node.parent;
-    if (parent is ConstructorDeclaration) {
-      ConstructorDeclaration constructor = parent;
-      return identical(constructor.returnType, node) && constructor.factoryKeyword != null;
-    }
-    return false;
-  }
-
-  /**
-   * Return `true` if the given 'super' expression is used in a valid context.
-   *
-   * @param node the 'super' expression to analyze
-   * @return `true` if the 'super' expression is in a valid context
-   */
-  static bool _isSuperInValidContext(SuperExpression node) {
-    for (AstNode n = node; n != null; n = n.parent) {
-      if (n is CompilationUnit) {
-        return false;
-      }
-      if (n is ConstructorDeclaration) {
-        ConstructorDeclaration constructor = n as ConstructorDeclaration;
-        return constructor.factoryKeyword == null;
-      }
-      if (n is ConstructorFieldInitializer) {
-        return false;
-      }
-      if (n is MethodDeclaration) {
-        MethodDeclaration method = n as MethodDeclaration;
-        return !method.isStatic;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Return a method representing the merge of the given elements. The type of the merged element is
-   * the component-wise union of the types of the given elements. If not all input elements have the
-   * same shape then [null] is returned.
-   *
-   * @param elements the `ExecutableElement`s to merge
-   * @return an `ExecutableElement` representing the merge of `elements`
-   */
-  static ExecutableElement _maybeMergeExecutableElements(Set<ExecutableElement> elements) {
-    List<ExecutableElement> elementArrayToMerge = new List.from(elements);
-    if (elementArrayToMerge.length == 0) {
-      return null;
-    } else if (elementArrayToMerge.length == 1) {
-      // If all methods are equal, don't bother building a new one.
-      return elementArrayToMerge[0];
-    } else {
-      return _computeMergedExecutableElement(elementArrayToMerge);
-    }
-  }
-
-  /**
    * The resolver driving this participant.
    */
   final ResolverVisitor _resolver;
@@ -273,6 +115,17 @@
     _promoteManager = _resolver.promoteManager;
   }
 
+  /**
+   * @return `true` iff current enclosing function is constant constructor declaration.
+   */
+  bool get isInConstConstructor {
+    ExecutableElement function = _resolver.enclosingFunction;
+    if (function is ConstructorElement) {
+      return function.isConst;
+    }
+    return false;
+  }
+
   @override
   Object visitAssignmentExpression(AssignmentExpression node) {
     sc.Token operator = node.operator;
@@ -283,15 +136,27 @@
       if (leftHandSide != null) {
         String methodName = operatorType.lexeme;
         DartType staticType = _getStaticType(leftHandSide);
-        MethodElement staticMethod = _lookUpMethod(leftHandSide, staticType, methodName);
+        MethodElement staticMethod =
+            _lookUpMethod(leftHandSide, staticType, methodName);
         node.staticElement = staticMethod;
         DartType propagatedType = _getPropagatedType(leftHandSide);
-        MethodElement propagatedMethod = _lookUpMethod(leftHandSide, propagatedType, methodName);
+        MethodElement propagatedMethod =
+            _lookUpMethod(leftHandSide, propagatedType, methodName);
         node.propagatedElement = propagatedMethod;
         if (_shouldReportMissingMember(staticType, staticMethod)) {
-          _recordUndefinedToken(staticType.element, StaticTypeWarningCode.UNDEFINED_METHOD, operator, [methodName, staticType.displayName]);
-        } else if (_enableHints && _shouldReportMissingMember(propagatedType, propagatedMethod) && !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
-          _recordUndefinedToken(propagatedType.element, HintCode.UNDEFINED_METHOD, operator, [methodName, propagatedType.displayName]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_METHOD,
+              operator,
+              [methodName, staticType.displayName]);
+        } else if (_enableHints &&
+            _shouldReportMissingMember(propagatedType, propagatedMethod) &&
+            !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
+          _recordUndefinedToken(
+              propagatedType.element,
+              HintCode.UNDEFINED_METHOD,
+              operator,
+              [methodName, propagatedType.displayName]);
         }
       }
     }
@@ -302,28 +167,16 @@
   Object visitBinaryExpression(BinaryExpression node) {
     sc.Token operator = node.operator;
     if (operator.isUserDefinableOperator) {
-      Expression leftOperand = node.leftOperand;
-      if (leftOperand != null) {
-        String methodName = operator.lexeme;
-        DartType staticType = _getStaticType(leftOperand);
-        MethodElement staticMethod = _lookUpMethod(leftOperand, staticType, methodName);
-        node.staticElement = staticMethod;
-        DartType propagatedType = _getPropagatedType(leftOperand);
-        MethodElement propagatedMethod = _lookUpMethod(leftOperand, propagatedType, methodName);
-        node.propagatedElement = propagatedMethod;
-        if (_shouldReportMissingMember(staticType, staticMethod)) {
-          _recordUndefinedToken(staticType.element, StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
-        } else if (_enableHints && _shouldReportMissingMember(propagatedType, propagatedMethod) && !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
-          _recordUndefinedToken(propagatedType.element, HintCode.UNDEFINED_OPERATOR, operator, [methodName, propagatedType.displayName]);
-        }
-      }
+      _resolveBinaryExpression(node, operator.lexeme);
+    } else if (operator.type == sc.TokenType.BANG_EQ) {
+      _resolveBinaryExpression(node, sc.TokenType.EQ_EQ.lexeme);
     }
     return null;
   }
 
   @override
   Object visitBreakStatement(BreakStatement node) {
-    _lookupLabel(node, node.label);
+    node.target = _lookupBreakOrContinueTarget(node, node.label, false);
     return null;
   }
 
@@ -347,7 +200,8 @@
       Element element = _resolveSimpleIdentifier(simpleIdentifier);
       if (element == null) {
         //
-        // This might be a reference to an imported name that is missing the prefix.
+        // This might be a reference to an imported name that is missing the
+        // prefix.
         //
         element = _findImportWithoutPrefix(simpleIdentifier);
         if (element is MultiplyDefinedElement) {
@@ -368,7 +222,8 @@
         simpleIdentifier.staticElement = element;
         if (node.newKeyword != null) {
           if (element is ClassElement) {
-            ConstructorElement constructor = (element as ClassElement).unnamedConstructor;
+            ConstructorElement constructor =
+                (element as ClassElement).unnamedConstructor;
             if (constructor == null) {
               // TODO(brianwilkerson) Report this error.
             } else {
@@ -385,7 +240,7 @@
       SimpleIdentifier name = prefixedIdentifier.identifier;
       Element element = _resolveSimpleIdentifier(prefix);
       if (element == null) {
-        //        resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, prefix, prefix.getName());
+//        resolver.reportError(StaticWarningCode.UNDEFINED_IDENTIFIER, prefix, prefix.getName());
       } else {
         if (element is PrefixElement) {
           prefix.staticElement = element;
@@ -396,23 +251,28 @@
         }
         LibraryElement library = element.library;
         if (library == null) {
-          // TODO(brianwilkerson) We need to understand how the library could ever be null.
-          AnalysisEngine.instance.logger.logError("Found element with null library: ${element.name}");
+          // TODO(brianwilkerson) We need to understand how the library could
+          // ever be null.
+          AnalysisEngine.instance.logger.logError(
+              "Found element with null library: ${element.name}");
         } else if (library != _definingLibrary) {
           // TODO(brianwilkerson) Report this error.
         }
         name.staticElement = element;
         if (node.newKeyword == null) {
           if (element is ClassElement) {
-            Element memberElement = _lookupGetterOrMethod((element as ClassElement).type, name.name);
+            Element memberElement =
+                _lookupGetterOrMethod((element as ClassElement).type, name.name);
             if (memberElement == null) {
-              memberElement = (element as ClassElement).getNamedConstructor(name.name);
+              memberElement =
+                  (element as ClassElement).getNamedConstructor(name.name);
               if (memberElement == null) {
-                memberElement = _lookUpSetter(prefix, (element as ClassElement).type, name.name);
+                memberElement =
+                    _lookUpSetter(prefix, (element as ClassElement).type, name.name);
               }
             }
             if (memberElement == null) {
-              //              reportGetterOrSetterNotFound(prefixedIdentifier, name, element.getDisplayName());
+//              reportGetterOrSetterNotFound(prefixedIdentifier, name, element.getDisplayName());
             } else {
               name.staticElement = memberElement;
             }
@@ -421,7 +281,8 @@
           }
         } else {
           if (element is ClassElement) {
-            ConstructorElement constructor = (element as ClassElement).getNamedConstructor(name.name);
+            ConstructorElement constructor =
+                (element as ClassElement).getNamedConstructor(name.name);
             if (constructor == null) {
               // TODO(brianwilkerson) Report this error.
             } else {
@@ -476,17 +337,17 @@
     if (type != null && type.isDynamic) {
       return null;
     } else if (type is! InterfaceType) {
-      // TODO(brianwilkerson) Report these errors.
-      //      ASTNode parent = node.getParent();
-      //      if (parent instanceof InstanceCreationExpression) {
-      //        if (((InstanceCreationExpression) parent).isConst()) {
-      //          // CompileTimeErrorCode.CONST_WITH_NON_TYPE
-      //        } else {
-      //          // StaticWarningCode.NEW_WITH_NON_TYPE
-      //        }
-      //      } else {
-      //        // This is part of a redirecting factory constructor; not sure which error code to use
-      //      }
+// TODO(brianwilkerson) Report these errors.
+//      ASTNode parent = node.getParent();
+//      if (parent instanceof InstanceCreationExpression) {
+//        if (((InstanceCreationExpression) parent).isConst()) {
+//          // CompileTimeErrorCode.CONST_WITH_NON_TYPE
+//        } else {
+//          // StaticWarningCode.NEW_WITH_NON_TYPE
+//        }
+//      } else {
+//        // This is part of a redirecting factory constructor; not sure which error code to use
+//      }
       return null;
     }
     // look up ConstructorElement
@@ -496,7 +357,8 @@
     if (name == null) {
       constructor = interfaceType.lookUpConstructor(null, _definingLibrary);
     } else {
-      constructor = interfaceType.lookUpConstructor(name.name, _definingLibrary);
+      constructor =
+          interfaceType.lookUpConstructor(name.name, _definingLibrary);
       name.staticElement = constructor;
     }
     node.staticElement = constructor;
@@ -505,7 +367,7 @@
 
   @override
   Object visitContinueStatement(ContinueStatement node) {
-    _lookupLabel(node, node.label);
+    node.target = _lookupBreakOrContinueTarget(node, node.label, true);
     return null;
   }
 
@@ -520,8 +382,8 @@
     ExportElement exportElement = node.element;
     if (exportElement != null) {
       // The element is null when the URI is invalid
-      // TODO(brianwilkerson) Figure out whether the element can ever be something other than an
-      // ExportElement
+      // TODO(brianwilkerson) Figure out whether the element can ever be
+      // something other than an ExportElement
       _resolveCombinators(exportElement.exportedLibrary, node.combinators);
       _setMetadata(exportElement, node);
     }
@@ -548,7 +410,8 @@
       FunctionExpression functionExpression = expression;
       ExecutableElement functionElement = functionExpression.element;
       ArgumentList argumentList = node.argumentList;
-      List<ParameterElement> parameters = _resolveArgumentsToFunction(false, argumentList, functionElement);
+      List<ParameterElement> parameters =
+          _resolveArgumentsToFunction(false, argumentList, functionElement);
       if (parameters != null) {
         argumentList.correspondingStaticParameters = parameters;
       }
@@ -603,39 +466,76 @@
     bool isInSetterContext = node.inSetterContext();
     if (isInGetterContext && isInSetterContext) {
       // lookup setter
-      MethodElement setterStaticMethod = _lookUpMethod(target, staticType, setterMethodName);
-      MethodElement setterPropagatedMethod = _lookUpMethod(target, propagatedType, setterMethodName);
+      MethodElement setterStaticMethod =
+          _lookUpMethod(target, staticType, setterMethodName);
+      MethodElement setterPropagatedMethod =
+          _lookUpMethod(target, propagatedType, setterMethodName);
       // set setter element
       node.staticElement = setterStaticMethod;
       node.propagatedElement = setterPropagatedMethod;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, getterMethodName, setterStaticMethod, setterPropagatedMethod, staticType, propagatedType);
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          getterMethodName,
+          setterStaticMethod,
+          setterPropagatedMethod,
+          staticType,
+          propagatedType);
       // lookup getter method
-      MethodElement getterStaticMethod = _lookUpMethod(target, staticType, getterMethodName);
-      MethodElement getterPropagatedMethod = _lookUpMethod(target, propagatedType, getterMethodName);
+      MethodElement getterStaticMethod =
+          _lookUpMethod(target, staticType, getterMethodName);
+      MethodElement getterPropagatedMethod =
+          _lookUpMethod(target, propagatedType, getterMethodName);
       // set getter element
-      AuxiliaryElements auxiliaryElements = new AuxiliaryElements(getterStaticMethod, getterPropagatedMethod);
+      AuxiliaryElements auxiliaryElements =
+          new AuxiliaryElements(getterStaticMethod, getterPropagatedMethod);
       node.auxiliaryElements = auxiliaryElements;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, getterMethodName, getterStaticMethod, getterPropagatedMethod, staticType, propagatedType);
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          getterMethodName,
+          getterStaticMethod,
+          getterPropagatedMethod,
+          staticType,
+          propagatedType);
     } else if (isInGetterContext) {
       // lookup getter method
-      MethodElement staticMethod = _lookUpMethod(target, staticType, getterMethodName);
-      MethodElement propagatedMethod = _lookUpMethod(target, propagatedType, getterMethodName);
+      MethodElement staticMethod =
+          _lookUpMethod(target, staticType, getterMethodName);
+      MethodElement propagatedMethod =
+          _lookUpMethod(target, propagatedType, getterMethodName);
       // set getter element
       node.staticElement = staticMethod;
       node.propagatedElement = propagatedMethod;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, getterMethodName, staticMethod, propagatedMethod, staticType, propagatedType);
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          getterMethodName,
+          staticMethod,
+          propagatedMethod,
+          staticType,
+          propagatedType);
     } else if (isInSetterContext) {
       // lookup setter method
-      MethodElement staticMethod = _lookUpMethod(target, staticType, setterMethodName);
-      MethodElement propagatedMethod = _lookUpMethod(target, propagatedType, setterMethodName);
+      MethodElement staticMethod =
+          _lookUpMethod(target, staticType, setterMethodName);
+      MethodElement propagatedMethod =
+          _lookUpMethod(target, propagatedType, setterMethodName);
       // set setter element
       node.staticElement = staticMethod;
       node.propagatedElement = propagatedMethod;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, setterMethodName, staticMethod, propagatedMethod, staticType, propagatedType);
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          setterMethodName,
+          staticMethod,
+          propagatedMethod,
+          staticType,
+          propagatedType);
     }
     return null;
   }
@@ -645,7 +545,8 @@
     ConstructorElement invokedConstructor = node.constructorName.staticElement;
     node.staticElement = invokedConstructor;
     ArgumentList argumentList = node.argumentList;
-    List<ParameterElement> parameters = _resolveArgumentsToFunction(node.isConst, argumentList, invokedConstructor);
+    List<ParameterElement> parameters =
+        _resolveArgumentsToFunction(node.isConst, argumentList, invokedConstructor);
     if (parameters != null) {
       argumentList.correspondingStaticParameters = parameters;
     }
@@ -674,9 +575,9 @@
       return null;
     }
     //
-    // We have a method invocation of one of two forms: 'e.m(a1, ..., an)' or 'm(a1, ..., an)'. The
-    // first step is to figure out which executable is being invoked, using both the static and the
-    // propagated type information.
+    // We have a method invocation of one of two forms: 'e.m(a1, ..., an)' or
+    // 'm(a1, ..., an)'. The first step is to figure out which executable is
+    // being invoked, using both the static and the propagated type information.
     //
     Expression target = node.realTarget;
     if (target is SuperExpression && !_isSuperInValidContext(target)) {
@@ -689,7 +590,8 @@
     if (target == null) {
       staticElement = _resolveInvokedElement(methodName);
       propagatedElement = null;
-    } else if (methodName.name == FunctionElement.LOAD_LIBRARY_NAME && _isDeferredPrefix(target)) {
+    } else if (methodName.name == FunctionElement.LOAD_LIBRARY_NAME &&
+        _isDeferredPrefix(target)) {
       LibraryElement importedLibrary = _getImportedLibrary(target);
       methodName.staticElement = importedLibrary.loadLibraryFunction;
       return null;
@@ -697,16 +599,19 @@
       staticType = _getStaticType(target);
       propagatedType = _getPropagatedType(target);
       //
-      // If this method invocation is of the form 'C.m' where 'C' is a class, then we don't call
-      // resolveInvokedElement(..) which walks up the class hierarchy, instead we just look for the
-      // member in the type only.
+      // If this method invocation is of the form 'C.m' where 'C' is a class,
+      // then we don't call resolveInvokedElement(..) which walks up the class
+      // hierarchy, instead we just look for the member in the type only.
       //
       ClassElementImpl typeReference = getTypeReference(target);
       if (typeReference != null) {
-        staticElement = propagatedElement = _resolveElement(typeReference, methodName);
+        staticElement =
+            propagatedElement = _resolveElement(typeReference, methodName);
       } else {
-        staticElement = _resolveInvokedElementWithTarget(target, staticType, methodName);
-        propagatedElement = _resolveInvokedElementWithTarget(target, propagatedType, methodName);
+        staticElement =
+            _resolveInvokedElementWithTarget(target, staticType, methodName);
+        propagatedElement =
+            _resolveInvokedElementWithTarget(target, propagatedType, methodName);
       }
     }
     staticElement = _convertSetterToGetter(staticElement);
@@ -718,13 +623,15 @@
     methodName.propagatedElement = propagatedElement;
     ArgumentList argumentList = node.argumentList;
     if (staticElement != null) {
-      List<ParameterElement> parameters = _computeCorrespondingParameters(argumentList, staticElement);
+      List<ParameterElement> parameters =
+          _computeCorrespondingParameters(argumentList, staticElement);
       if (parameters != null) {
         argumentList.correspondingStaticParameters = parameters;
       }
     }
     if (propagatedElement != null) {
-      List<ParameterElement> parameters = _computeCorrespondingParameters(argumentList, propagatedElement);
+      List<ParameterElement> parameters =
+          _computeCorrespondingParameters(argumentList, propagatedElement);
       if (parameters != null) {
         argumentList.correspondingPropagatedParameters = parameters;
       }
@@ -738,9 +645,14 @@
       // The method lookup may have failed because there were multiple
       // incompatible choices. In this case we don't want to generate a hint.
       if (propagatedElement == null && propagatedType is UnionType) {
-        // TODO(collinsn): an improvement here is to make the propagated type of the method call
-        // the union of the propagated types of all possible calls.
-        if (_lookupMethods(target, propagatedType as UnionType, methodName.name).length > 1) {
+        // TODO(collinsn): an improvement here is to make the propagated type
+        // of the method call the union of the propagated types of all possible
+        // calls.
+        if (_lookupMethods(
+            target,
+            propagatedType as UnionType,
+            methodName.name).length >
+            1) {
           return null;
         }
       }
@@ -759,7 +671,8 @@
         }
         if (classElementContext != null) {
           _subtypeManager.ensureLibraryVisited(_definingLibrary);
-          HashSet<ClassElement> subtypeElements = _subtypeManager.computeAllSubtypes(classElementContext);
+          HashSet<ClassElement> subtypeElements =
+              _subtypeManager.computeAllSubtypes(classElementContext);
           for (ClassElement subtypeElement in subtypeElements) {
             if (subtypeElement.getMethod(methodName.name) != null) {
               errorCode = null;
@@ -772,21 +685,35 @@
     if (errorCode == null) {
       return null;
     }
-    if (identical(errorCode, StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION)) {
-      _resolver.reportErrorForNode(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName, [methodName.name]);
+    if (identical(
+        errorCode,
+        StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION)) {
+      _resolver.reportErrorForNode(
+          StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION,
+          methodName,
+          [methodName.name]);
     } else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
-      _resolver.reportErrorForNode(StaticTypeWarningCode.UNDEFINED_FUNCTION, methodName, [methodName.name]);
+      _resolver.reportErrorForNode(
+          StaticTypeWarningCode.UNDEFINED_FUNCTION,
+          methodName,
+          [methodName.name]);
     } else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_METHOD)) {
       String targetTypeName;
       if (target == null) {
         ClassElement enclosingClass = _resolver.enclosingClass;
         targetTypeName = enclosingClass.displayName;
-        ErrorCode proxyErrorCode = (generatedWithTypePropagation ? HintCode.UNDEFINED_METHOD : StaticTypeWarningCode.UNDEFINED_METHOD);
-        _recordUndefinedNode(_resolver.enclosingClass, proxyErrorCode, methodName, [methodName.name, targetTypeName]);
+        ErrorCode proxyErrorCode = (generatedWithTypePropagation ?
+            HintCode.UNDEFINED_METHOD :
+            StaticTypeWarningCode.UNDEFINED_METHOD);
+        _recordUndefinedNode(
+            _resolver.enclosingClass,
+            proxyErrorCode,
+            methodName,
+            [methodName.name, targetTypeName]);
       } else {
         // ignore Function "call"
-        // (if we are about to create a hint using type propagation, then we can use type
-        // propagation here as well)
+        // (if we are about to create a hint using type propagation,
+        // then we can use type propagation here as well)
         DartType targetType = null;
         if (!generatedWithTypePropagation) {
           targetType = _getStaticType(target);
@@ -797,16 +724,27 @@
             targetType = _getStaticType(target);
           }
         }
-        if (targetType != null && targetType.isDartCoreFunction && methodName.name == FunctionElement.CALL_METHOD_NAME) {
-          // TODO(brianwilkerson) Can we ever resolve the function being invoked?
-          //resolveArgumentsToParameters(node.getArgumentList(), invokedFunction);
+        if (targetType != null &&
+            targetType.isDartCoreFunction &&
+            methodName.name == FunctionElement.CALL_METHOD_NAME) {
+          // TODO(brianwilkerson) Can we ever resolve the function being
+          // invoked?
+//          resolveArgumentsToParameters(node.getArgumentList(), invokedFunction);
           return null;
         }
         targetTypeName = targetType == null ? null : targetType.displayName;
-        ErrorCode proxyErrorCode = (generatedWithTypePropagation ? HintCode.UNDEFINED_METHOD : StaticTypeWarningCode.UNDEFINED_METHOD);
-        _recordUndefinedNode(targetType.element, proxyErrorCode, methodName, [methodName.name, targetTypeName]);
+        ErrorCode proxyErrorCode = (generatedWithTypePropagation ?
+            HintCode.UNDEFINED_METHOD :
+            StaticTypeWarningCode.UNDEFINED_METHOD);
+        _recordUndefinedNode(
+            targetType.element,
+            proxyErrorCode,
+            methodName,
+            [methodName.name, targetTypeName]);
       }
-    } else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_SUPER_METHOD)) {
+    } else if (identical(
+        errorCode,
+        StaticTypeWarningCode.UNDEFINED_SUPER_METHOD)) {
       // Generate the type name.
       // The error code will never be generated via type propagation
       DartType targetType = _getStaticType(target);
@@ -814,7 +752,10 @@
         targetType = (targetType as InterfaceType).superclass;
       }
       String targetTypeName = targetType == null ? null : targetType.name;
-      _resolver.reportErrorForNode(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, methodName, [methodName.name, targetTypeName]);
+      _resolver.reportErrorForNode(
+          StaticTypeWarningCode.UNDEFINED_SUPER_METHOD,
+          methodName,
+          [methodName.name, targetTypeName]);
     }
     return null;
   }
@@ -839,12 +780,31 @@
     MethodElement staticMethod = _lookUpMethod(operand, staticType, methodName);
     node.staticElement = staticMethod;
     DartType propagatedType = _getPropagatedType(operand);
-    MethodElement propagatedMethod = _lookUpMethod(operand, propagatedType, methodName);
+    MethodElement propagatedMethod =
+        _lookUpMethod(operand, propagatedType, methodName);
     node.propagatedElement = propagatedMethod;
     if (_shouldReportMissingMember(staticType, staticMethod)) {
-      _recordUndefinedToken(staticType.element, StaticTypeWarningCode.UNDEFINED_OPERATOR, node.operator, [methodName, staticType.displayName]);
-    } else if (_enableHints && _shouldReportMissingMember(propagatedType, propagatedMethod) && !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
-      _recordUndefinedToken(propagatedType.element, HintCode.UNDEFINED_OPERATOR, node.operator, [methodName, propagatedType.displayName]);
+      if (operand is SuperExpression) {
+        _recordUndefinedToken(
+            staticType.element,
+            StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+            node.operator,
+            [methodName, staticType.displayName]);
+      } else {
+        _recordUndefinedToken(
+            staticType.element,
+            StaticTypeWarningCode.UNDEFINED_OPERATOR,
+            node.operator,
+            [methodName, staticType.displayName]);
+      }
+    } else if (_enableHints &&
+        _shouldReportMissingMember(propagatedType, propagatedMethod) &&
+        !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
+      _recordUndefinedToken(
+          propagatedType.element,
+          HintCode.UNDEFINED_OPERATOR,
+          node.operator,
+          [methodName, propagatedType.displayName]);
     }
     return null;
   }
@@ -856,7 +816,8 @@
     //
     // First, check the "lib.loadLibrary" case
     //
-    if (identifier.name == FunctionElement.LOAD_LIBRARY_NAME && _isDeferredPrefix(prefix)) {
+    if (identifier.name == FunctionElement.LOAD_LIBRARY_NAME &&
+        _isDeferredPrefix(prefix)) {
       LibraryElement importedLibrary = _getImportedLibrary(prefix);
       identifier.staticElement = importedLibrary.loadLibraryFunction;
       return null;
@@ -868,24 +829,33 @@
     if (prefixElement is PrefixElement) {
       Element element = _resolver.nameScope.lookup(node, _definingLibrary);
       if (element == null && identifier.inSetterContext()) {
-        element = _resolver.nameScope.lookup(new SyntheticIdentifier(
-            "${node.name}=", node),
+        element = _resolver.nameScope.lookup(
+            new SyntheticIdentifier("${node.name}=", node),
             _definingLibrary);
       }
       if (element == null) {
         if (identifier.inSetterContext()) {
-          _resolver.reportErrorForNode(StaticWarningCode.UNDEFINED_SETTER, identifier, [identifier.name, prefixElement.name]);
+          _resolver.reportErrorForNode(
+              StaticWarningCode.UNDEFINED_SETTER,
+              identifier,
+              [identifier.name, prefixElement.name]);
         } else if (node.parent is Annotation) {
           Annotation annotation = node.parent as Annotation;
-          _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
+          _resolver.reportErrorForNode(
+              CompileTimeErrorCode.INVALID_ANNOTATION,
+              annotation);
           return null;
         } else {
-          _resolver.reportErrorForNode(StaticWarningCode.UNDEFINED_GETTER, identifier, [identifier.name, prefixElement.name]);
+          _resolver.reportErrorForNode(
+              StaticWarningCode.UNDEFINED_GETTER,
+              identifier,
+              [identifier.name, prefixElement.name]);
         }
         return null;
       }
       if (element is PropertyAccessorElement && identifier.inSetterContext()) {
-        PropertyInducingElement variable = (element as PropertyAccessorElement).variable;
+        PropertyInducingElement variable =
+            (element as PropertyAccessorElement).variable;
         if (variable != null) {
           PropertyAccessorElement setter = variable.setter;
           if (setter != null) {
@@ -893,8 +863,8 @@
           }
         }
       }
-      // TODO(brianwilkerson) The prefix needs to be resolved to the element for the import that
-      // defines the prefix, not the prefix's element.
+      // TODO(brianwilkerson) The prefix needs to be resolved to the element for
+      // the import that defines the prefix, not the prefix's element.
       identifier.staticElement = element;
       // Validate annotation element.
       if (node.parent is Annotation) {
@@ -910,8 +880,8 @@
       _resolveAnnotationElement(annotation);
     }
     //
-    // Otherwise, the prefix is really an expression that happens to be a simple identifier and this
-    // is really equivalent to a property access node.
+    // Otherwise, the prefix is really an expression that happens to be a simple
+    // identifier and this is really equivalent to a property access node.
     //
     _resolvePropertyAccess(prefix, identifier);
     return null;
@@ -921,19 +891,41 @@
   Object visitPrefixExpression(PrefixExpression node) {
     sc.Token operator = node.operator;
     sc.TokenType operatorType = operator.type;
-    if (operatorType.isUserDefinableOperator || operatorType == sc.TokenType.PLUS_PLUS || operatorType == sc.TokenType.MINUS_MINUS) {
+    if (operatorType.isUserDefinableOperator ||
+        operatorType == sc.TokenType.PLUS_PLUS ||
+        operatorType == sc.TokenType.MINUS_MINUS) {
       Expression operand = node.operand;
       String methodName = _getPrefixOperator(node);
       DartType staticType = _getStaticType(operand);
-      MethodElement staticMethod = _lookUpMethod(operand, staticType, methodName);
+      MethodElement staticMethod =
+          _lookUpMethod(operand, staticType, methodName);
       node.staticElement = staticMethod;
       DartType propagatedType = _getPropagatedType(operand);
-      MethodElement propagatedMethod = _lookUpMethod(operand, propagatedType, methodName);
+      MethodElement propagatedMethod =
+          _lookUpMethod(operand, propagatedType, methodName);
       node.propagatedElement = propagatedMethod;
       if (_shouldReportMissingMember(staticType, staticMethod)) {
-        _recordUndefinedToken(staticType.element, StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
-      } else if (_enableHints && _shouldReportMissingMember(propagatedType, propagatedMethod) && !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
-        _recordUndefinedToken(propagatedType.element, HintCode.UNDEFINED_OPERATOR, operator, [methodName, propagatedType.displayName]);
+        if (operand is SuperExpression) {
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+              operator,
+              [methodName, staticType.displayName]);
+        } else {
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_OPERATOR,
+              operator,
+              [methodName, staticType.displayName]);
+        }
+      } else if (_enableHints &&
+          _shouldReportMissingMember(propagatedType, propagatedMethod) &&
+          !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
+        _recordUndefinedToken(
+            propagatedType.element,
+            HintCode.UNDEFINED_OPERATOR,
+            operator,
+            [methodName, propagatedType.displayName]);
       }
     }
     return null;
@@ -951,7 +943,8 @@
   }
 
   @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     ClassElement enclosingClass = _resolver.enclosingClass;
     if (enclosingClass == null) {
       // TODO(brianwilkerson) Report this error.
@@ -965,7 +958,8 @@
       element = enclosingClass.getNamedConstructor(name.name);
     }
     if (element == null) {
-      // TODO(brianwilkerson) Report this error and decide what element to associate with the node.
+      // TODO(brianwilkerson) Report this error and decide what element to
+      // associate with the node.
       return null;
     }
     if (name != null) {
@@ -973,7 +967,8 @@
     }
     node.staticElement = element;
     ArgumentList argumentList = node.argumentList;
-    List<ParameterElement> parameters = _resolveArgumentsToFunction(false, argumentList, element);
+    List<ParameterElement> parameters =
+        _resolveArgumentsToFunction(false, argumentList, element);
     if (parameters != null) {
       argumentList.correspondingStaticParameters = parameters;
     }
@@ -995,14 +990,15 @@
       return null;
     }
     //
-    // We ignore identifiers that have already been resolved, such as identifiers representing the
-    // name in a declaration.
+    // We ignore identifiers that have already been resolved, such as
+    // identifiers representing the name in a declaration.
     //
     if (node.staticElement != null) {
       return null;
     }
     //
-    // The name dynamic denotes a Type object even though dynamic is not a class.
+    // The name dynamic denotes a Type object even though dynamic is not a
+    // class.
     //
     if (node.name == _dynamicType.name) {
       node.staticElement = _dynamicType.element;
@@ -1014,27 +1010,44 @@
     //
     Element element = _resolveSimpleIdentifier(node);
     ClassElement enclosingClass = _resolver.enclosingClass;
-    if (_isFactoryConstructorReturnType(node) && !identical(element, enclosingClass)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, node);
-    } else if (_isConstructorReturnType(node) && !identical(element, enclosingClass)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node);
+    if (_isFactoryConstructorReturnType(node) &&
+        !identical(element, enclosingClass)) {
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS,
+          node);
+    } else if (_isConstructorReturnType(node) &&
+        !identical(element, enclosingClass)) {
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME,
+          node);
       element = null;
-    } else if (element == null || (element is PrefixElement && !_isValidAsPrefix(node))) {
+    } else if (element == null ||
+        (element is PrefixElement && !_isValidAsPrefix(node))) {
       // TODO(brianwilkerson) Recover from this error.
       if (_isConstructorReturnType(node)) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node);
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME,
+            node);
       } else if (node.parent is Annotation) {
         Annotation annotation = node.parent as Annotation;
-        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.INVALID_ANNOTATION,
+            annotation);
       } else {
-        _recordUndefinedNode(_resolver.enclosingClass, StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
+        _recordUndefinedNode(
+            _resolver.enclosingClass,
+            StaticWarningCode.UNDEFINED_IDENTIFIER,
+            node,
+            [node.name]);
       }
     }
     node.staticElement = element;
-    _markElementUsed(element);
-    if (node.inSetterContext() && node.inGetterContext() && enclosingClass != null) {
+    if (node.inSetterContext() &&
+        node.inGetterContext() &&
+        enclosingClass != null) {
       InterfaceType enclosingType = enclosingClass.type;
-      AuxiliaryElements auxiliaryElements = new AuxiliaryElements(_lookUpGetter(null, enclosingType, node.name), null);
+      AuxiliaryElements auxiliaryElements =
+          new AuxiliaryElements(_lookUpGetter(null, enclosingType, node.name), null);
       node.auxiliaryElements = auxiliaryElements;
     }
     //
@@ -1049,7 +1062,7 @@
 
   @override
   Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    ClassElement enclosingClass = _resolver.enclosingClass;
+    ClassElementImpl enclosingClass = _resolver.enclosingClass;
     if (enclosingClass == null) {
       // TODO(brianwilkerson) Report this error.
       return null;
@@ -1061,18 +1074,29 @@
     }
     SimpleIdentifier name = node.constructorName;
     String superName = name != null ? name.name : null;
-    ConstructorElement element = superType.lookUpConstructor(superName, _definingLibrary);
+    ConstructorElement element =
+        superType.lookUpConstructor(superName, _definingLibrary);
     if (element == null ||
-        !enclosingClass.isSuperConstructorAccessible(element)) {
+        (!enclosingClass.mixinErrorsReported &&
+            !enclosingClass.isSuperConstructorAccessible(element))) {
       if (name != null) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, node, [superType.displayName, name]);
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
+            node,
+            [superType.displayName, name]);
       } else {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, node, [superType.displayName]);
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
+            node,
+            [superType.displayName]);
       }
       return null;
     } else {
       if (element.isFactory) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node, [element]);
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+            node,
+            [element]);
       }
     }
     if (name != null) {
@@ -1080,7 +1104,8 @@
     }
     node.staticElement = element;
     ArgumentList argumentList = node.argumentList;
-    List<ParameterElement> parameters = _resolveArgumentsToFunction(isInConstConstructor, argumentList, element);
+    List<ParameterElement> parameters =
+        _resolveArgumentsToFunction(isInConstConstructor, argumentList, element);
     if (parameters != null) {
       argumentList.correspondingStaticParameters = parameters;
     }
@@ -1090,7 +1115,9 @@
   @override
   Object visitSuperExpression(SuperExpression node) {
     if (!_isSuperInValidContext(node)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, node);
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT,
+          node);
     }
     return super.visitSuperExpression(node);
   }
@@ -1114,13 +1141,15 @@
    * @param annotationList the list of elements to which new elements are to be added
    * @param annotations the AST nodes used to generate new elements
    */
-  void _addAnnotations(List<ElementAnnotationImpl> annotationList, NodeList<Annotation> annotations) {
+  void _addAnnotations(List<ElementAnnotationImpl> annotationList,
+      NodeList<Annotation> annotations) {
     int annotationCount = annotations.length;
     for (int i = 0; i < annotationCount; i++) {
       Annotation annotation = annotations[i];
       Element resolvedElement = annotation.element;
       if (resolvedElement != null) {
-        ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(resolvedElement);
+        ElementAnnotationImpl elementAnnotation =
+            new ElementAnnotationImpl(resolvedElement);
         annotation.elementAnnotation = elementAnnotation;
         annotationList.add(elementAnnotation);
       }
@@ -1136,7 +1165,8 @@
    * @param element the element to be invoked
    * @return the error code that should be reported
    */
-  ErrorCode _checkForInvocationError(Expression target, bool useStaticContext, Element element) {
+  ErrorCode _checkForInvocationError(Expression target, bool useStaticContext,
+      Element element) {
     // Prefix is not declared, instead "prefix.id" are declared.
     if (element is PrefixElement) {
       element = null;
@@ -1159,9 +1189,9 @@
       // The error has already been reported
       return null;
     } else if (element == null && target is SuperExpression) {
-      // TODO(jwren) We should split the UNDEFINED_METHOD into two error codes, this one, and
-      // a code that describes the situation where the method was found, but it was not
-      // accessible from the current library.
+      // TODO(jwren) We should split the UNDEFINED_METHOD into two error codes,
+      // this one, and a code that describes the situation where the method was
+      // found, but it was not accessible from the current library.
       return StaticTypeWarningCode.UNDEFINED_SUPER_METHOD;
     } else {
       //
@@ -1188,7 +1218,8 @@
           if (enclosingClass == null) {
             return StaticTypeWarningCode.UNDEFINED_FUNCTION;
           } else if (element == null) {
-            // Proxy-conditional warning, based on state of resolver.getEnclosingClass()
+            // Proxy-conditional warning, based on state of
+            // resolver.getEnclosingClass()
             return StaticTypeWarningCode.UNDEFINED_METHOD;
           } else {
             return StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION;
@@ -1198,14 +1229,16 @@
           if (useStaticContext) {
             targetType = _getStaticType(target);
           } else {
-            // Compute and use the propagated type, if it is null, then it may be the case that
-            // static type is some type, in which the static type should be used.
+            // Compute and use the propagated type, if it is null, then it may
+            // be the case that static type is some type, in which the static
+            // type should be used.
             targetType = target.bestType;
           }
           if (targetType == null) {
             return StaticTypeWarningCode.UNDEFINED_FUNCTION;
           } else if (!targetType.isDynamic && !targetType.isBottom) {
-            // Proxy-conditional warning, based on state of targetType.getElement()
+            // Proxy-conditional warning, based on state of
+            // targetType.getElement()
             return StaticTypeWarningCode.UNDEFINED_METHOD;
           }
         }
@@ -1224,23 +1257,47 @@
    *          index expression
    * @return `true` if and only if an error code is generated on the passed node
    */
-  bool _checkForUndefinedIndexOperator(IndexExpression node, Expression target, String methodName, MethodElement staticMethod, MethodElement propagatedMethod, DartType staticType, DartType propagatedType) {
-    bool shouldReportMissingMember_static = _shouldReportMissingMember(staticType, staticMethod);
-    bool shouldReportMissingMember_propagated = !shouldReportMissingMember_static && _enableHints && _shouldReportMissingMember(propagatedType, propagatedMethod) && !_memberFoundInSubclass(propagatedType.element, methodName, true, false);
-    if (shouldReportMissingMember_static || shouldReportMissingMember_propagated) {
+  bool _checkForUndefinedIndexOperator(IndexExpression node, Expression target,
+      String methodName, MethodElement staticMethod, MethodElement propagatedMethod,
+      DartType staticType, DartType propagatedType) {
+    bool shouldReportMissingMember_static =
+        _shouldReportMissingMember(staticType, staticMethod);
+    bool shouldReportMissingMember_propagated =
+        !shouldReportMissingMember_static &&
+        _enableHints &&
+        _shouldReportMissingMember(propagatedType, propagatedMethod) &&
+        !_memberFoundInSubclass(propagatedType.element, methodName, true, false);
+    if (shouldReportMissingMember_static ||
+        shouldReportMissingMember_propagated) {
       sc.Token leftBracket = node.leftBracket;
       sc.Token rightBracket = node.rightBracket;
-      ErrorCode errorCode = (shouldReportMissingMember_static ? StaticTypeWarningCode.UNDEFINED_OPERATOR : HintCode.UNDEFINED_OPERATOR);
+      ErrorCode errorCode;
+      if (shouldReportMissingMember_static) {
+        if (target is SuperExpression) {
+          errorCode = StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR;
+        } else {
+          errorCode = StaticTypeWarningCode.UNDEFINED_OPERATOR;
+        }
+      } else {
+        errorCode = HintCode.UNDEFINED_OPERATOR;
+      }
+      DartType type =
+          shouldReportMissingMember_static ? staticType : propagatedType;
       if (leftBracket == null || rightBracket == null) {
-        _recordUndefinedNode(shouldReportMissingMember_static ? staticType.element : propagatedType.element, errorCode, node, [
-            methodName,
-            shouldReportMissingMember_static ? staticType.displayName : propagatedType.displayName]);
+        _recordUndefinedNode(
+            type.element,
+            errorCode,
+            node,
+            [methodName, type.displayName]);
       } else {
         int offset = leftBracket.offset;
         int length = rightBracket.offset - offset + 1;
-        _recordUndefinedOffset(shouldReportMissingMember_static ? staticType.element : propagatedType.element, errorCode, offset, length, [
-            methodName,
-            shouldReportMissingMember_static ? staticType.displayName : propagatedType.displayName]);
+        _recordUndefinedOffset(
+            type.element,
+            errorCode,
+            offset,
+            length,
+            [methodName, type.displayName]);
       }
       return true;
     }
@@ -1256,16 +1313,20 @@
    * @param executableElement the element that will be invoked with the arguments
    * @return the parameters that correspond to the arguments
    */
-  List<ParameterElement> _computeCorrespondingParameters(ArgumentList argumentList, Element element) {
+  List<ParameterElement>
+      _computeCorrespondingParameters(ArgumentList argumentList, Element element) {
     if (element is PropertyAccessorElement) {
       //
-      // This is an invocation of the call method defined on the value returned by the getter.
+      // This is an invocation of the call method defined on the value returned
+      // by the getter.
       //
       FunctionType getterType = element.type;
       if (getterType != null) {
         DartType getterReturnType = getterType.returnType;
         if (getterReturnType is InterfaceType) {
-          MethodElement callMethod = getterReturnType.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _definingLibrary);
+          MethodElement callMethod = getterReturnType.lookUpMethod(
+              FunctionElement.CALL_METHOD_NAME,
+              _definingLibrary);
           if (callMethod != null) {
             return _resolveArgumentsToFunction(false, argumentList, callMethod);
           }
@@ -1285,7 +1346,8 @@
         return _resolveArgumentsToParameters(false, argumentList, parameters);
       } else if (type is InterfaceType) {
         // "call" invocation
-        MethodElement callMethod = type.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _definingLibrary);
+        MethodElement callMethod =
+            type.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _definingLibrary);
         if (callMethod != null) {
           List<ParameterElement> parameters = callMethod.parameters;
           return _resolveArgumentsToParameters(false, argumentList, parameters);
@@ -1303,7 +1365,8 @@
    * @return a non-setter element derived from the given element
    */
   Element _convertSetterToGetter(Element element) {
-    // TODO(brianwilkerson) Determine whether and why the element could ever be a setter.
+    // TODO(brianwilkerson) Determine whether and why the element could ever be
+    // a setter.
     if (element is PropertyAccessorElement) {
       return element.variable.getter;
     }
@@ -1318,7 +1381,8 @@
    *         or inherits proxy
    * See [ClassElement.isOrInheritsProxy].
    */
-  bool _doesntHaveProxy(Element element) => !(element is ClassElement && element.isOrInheritsProxy);
+  bool _doesntHaveProxy(Element element) =>
+      !(element is ClassElement && element.isOrInheritsProxy);
 
   /**
    * Look for any declarations of the given identifier that are imported using a prefix. Return the
@@ -1336,12 +1400,16 @@
         Identifier prefixedIdentifier = new SyntheticIdentifier(
             "${prefixElement.name}.${identifier.name}",
             identifier);
-        Element importedElement = nameScope.lookup(prefixedIdentifier, _definingLibrary);
+        Element importedElement =
+            nameScope.lookup(prefixedIdentifier, _definingLibrary);
         if (importedElement != null) {
           if (element == null) {
             element = importedElement;
           } else {
-            element = MultiplyDefinedElementImpl.fromElements(_definingLibrary.context, element, importedElement);
+            element = MultiplyDefinedElementImpl.fromElements(
+                _definingLibrary.context,
+                element,
+                importedElement);
           }
         }
       }
@@ -1357,8 +1425,10 @@
    * @return the library that is being imported by the import associated with the prefix
    */
   LibraryElement _getImportedLibrary(Expression expression) {
-    PrefixElement prefixElement = (expression as SimpleIdentifier).staticElement as PrefixElement;
-    List<ImportElement> imports = prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
+    PrefixElement prefixElement =
+        (expression as SimpleIdentifier).staticElement as PrefixElement;
+    List<ImportElement> imports =
+        prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
     return imports[0].importedLibrary;
   }
 
@@ -1368,7 +1438,10 @@
    * @param node the postfix expression being invoked
    * @return the name of the method invoked by the expression
    */
-  String _getPostfixOperator(PostfixExpression node) => (node.operator.type == sc.TokenType.PLUS_PLUS) ? sc.TokenType.PLUS.lexeme : sc.TokenType.MINUS.lexeme;
+  String _getPostfixOperator(PostfixExpression node) =>
+      (node.operator.type == sc.TokenType.PLUS_PLUS) ?
+          sc.TokenType.PLUS.lexeme :
+          sc.TokenType.MINUS.lexeme;
 
   /**
    * Return the name of the method invoked by the given postfix expression.
@@ -1400,7 +1473,8 @@
     DartType propagatedType = _resolveTypeParameter(expression.propagatedType);
     if (propagatedType is FunctionType) {
       //
-      // All function types are subtypes of 'Function', which is itself a subclass of 'Object'.
+      // All function types are subtypes of 'Function', which is itself a
+      // subclass of 'Object'.
       //
       propagatedType = _resolver.typeProvider.functionType;
     }
@@ -1420,7 +1494,8 @@
     DartType staticType = _resolveTypeParameter(expression.staticType);
     if (staticType is FunctionType) {
       //
-      // All function types are subtypes of 'Function', which is itself a subclass of 'Object'.
+      // All function types are subtypes of 'Function', which is itself a
+      // subclass of 'Object'.
       //
       staticType = _resolver.typeProvider.functionType;
     }
@@ -1442,7 +1517,8 @@
       return false;
     }
     PrefixElement prefixElement = element as PrefixElement;
-    List<ImportElement> imports = prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
+    List<ImportElement> imports =
+        prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
     if (imports.length != 1) {
       return false;
     }
@@ -1457,34 +1533,29 @@
    * @return `true` if the given type represents an object that could be invoked
    */
   bool _isExecutableType(DartType type) {
-    if (type.isDynamic || (type is FunctionType) || type.isDartCoreFunction || type.isObject) {
+    if (type.isDynamic ||
+        (type is FunctionType) ||
+        type.isDartCoreFunction ||
+        type.isObject) {
       return true;
     } else if (type is InterfaceType) {
       ClassElement classElement = type.element;
-      // 16078 from Gilad: If the type is a Functor with the @proxy annotation, treat it as an
-      // executable type.
-      // example code: NonErrorResolverTest.test_invocationOfNonFunction_proxyOnFunctionClass()
-      if (classElement.isProxy && type.isSubtypeOf(_resolver.typeProvider.functionType)) {
+      // 16078 from Gilad: If the type is a Functor with the @proxy annotation,
+      // treat it as an executable type.
+      // example code: NonErrorResolverTest.
+      // test_invocationOfNonFunction_proxyOnFunctionClass()
+      if (classElement.isProxy &&
+          type.isSubtypeOf(_resolver.typeProvider.functionType)) {
         return true;
       }
-      MethodElement methodElement = classElement.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _definingLibrary);
+      MethodElement methodElement =
+          classElement.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _definingLibrary);
       return methodElement != null;
     }
     return false;
   }
 
   /**
-   * @return `true` iff current enclosing function is constant constructor declaration.
-   */
-  bool get isInConstConstructor {
-    ExecutableElement function = _resolver.enclosingFunction;
-    if (function is ConstructorElement) {
-      return function.isConst;
-    }
-    return false;
-  }
-
-  /**
    * Return `true` if the given element is a static element.
    *
    * @param element the element being tested
@@ -1520,6 +1591,52 @@
   }
 
   /**
+   * Return the target of a break or continue statement, and update the static
+   * element of its label (if any).  [parentNode] is the AST node of the break
+   * or continue statement, [labelNode] is the label contained in that
+   * statement (if any), and [isContinue] is true if the node being visited is
+   * a continue statement.
+   */
+  AstNode _lookupBreakOrContinueTarget(AstNode parentNode,
+      SimpleIdentifier labelNode, bool isContinue) {
+    if (labelNode == null) {
+      return _resolver.implicitLabelScope.getTarget(isContinue);
+    } else {
+      LabelScope labelScope = _resolver.labelScope;
+      if (labelScope == null) {
+        // There are no labels in scope, so by definition the label is
+        // undefined.
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.LABEL_UNDEFINED,
+            labelNode,
+            [labelNode.name]);
+        return null;
+      }
+      LabelScope definingScope = labelScope.lookup(labelNode.name);
+      if (definingScope == null) {
+        // No definition of the given label name could be found in any
+        // enclosing scope.
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.LABEL_UNDEFINED,
+            labelNode,
+            [labelNode.name]);
+        return null;
+      }
+      // The target has been found.
+      labelNode.staticElement = definingScope.element;
+      ExecutableElement labelContainer =
+          definingScope.element.getAncestor((element) => element is ExecutableElement);
+      if (!identical(labelContainer, _resolver.enclosingFunction)) {
+        _resolver.reportErrorForNode(
+            CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE,
+            labelNode,
+            [labelNode.name]);
+      }
+      return definingScope.node;
+    }
+  }
+
+  /**
    * Look up the getter with the given name in the given type. Return the element representing the
    * getter that was found, or `null` if there is no getter with the given name.
    *
@@ -1528,20 +1645,26 @@
    * @param getterName the name of the getter being looked up
    * @return the element representing the getter that was found
    */
-  PropertyAccessorElement _lookUpGetter(Expression target, DartType type, String getterName) {
+  PropertyAccessorElement _lookUpGetter(Expression target, DartType type,
+      String getterName) {
     type = _resolveTypeParameter(type);
     if (type is InterfaceType) {
       InterfaceType interfaceType = type;
       PropertyAccessorElement accessor;
       if (target is SuperExpression) {
-        accessor = interfaceType.lookUpGetterInSuperclass(getterName, _definingLibrary);
+        accessor =
+            interfaceType.lookUpGetterInSuperclass(getterName, _definingLibrary);
       } else {
         accessor = interfaceType.lookUpGetter(getterName, _definingLibrary);
       }
       if (accessor != null) {
         return accessor;
       }
-      return _lookUpGetterInInterfaces(interfaceType, false, getterName, new HashSet<ClassElement>());
+      return _lookUpGetterInInterfaces(
+          interfaceType,
+          false,
+          getterName,
+          new HashSet<ClassElement>());
     }
     return null;
   }
@@ -1558,11 +1681,13 @@
    *          to prevent infinite recursion and to optimize the search
    * @return the element representing the getter that was found
    */
-  PropertyAccessorElement _lookUpGetterInInterfaces(InterfaceType targetType, bool includeTargetType, String getterName, HashSet<ClassElement> visitedInterfaces) {
-    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the specification (titled
-    // "Inheritance and Overriding" under "Interfaces") describes a much more complex scheme for
-    // finding the inherited member. We need to follow that scheme. The code below should cover the
-    // 80% case.
+  PropertyAccessorElement _lookUpGetterInInterfaces(InterfaceType targetType,
+      bool includeTargetType, String getterName,
+      HashSet<ClassElement> visitedInterfaces) {
+    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
+    // specification (titled "Inheritance and Overriding" under "Interfaces")
+    // describes a much more complex scheme for finding the inherited member.
+    // We need to follow that scheme. The code below should cover the 80% case.
     ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
@@ -1575,13 +1700,15 @@
       }
     }
     for (InterfaceType interfaceType in targetType.interfaces) {
-      PropertyAccessorElement getter = _lookUpGetterInInterfaces(interfaceType, true, getterName, visitedInterfaces);
+      PropertyAccessorElement getter =
+          _lookUpGetterInInterfaces(interfaceType, true, getterName, visitedInterfaces);
       if (getter != null) {
         return getter;
       }
     }
     for (InterfaceType mixinType in targetType.mixins) {
-      PropertyAccessorElement getter = _lookUpGetterInInterfaces(mixinType, true, getterName, visitedInterfaces);
+      PropertyAccessorElement getter =
+          _lookUpGetterInInterfaces(mixinType, true, getterName, visitedInterfaces);
       if (getter != null) {
         return getter;
       }
@@ -1590,7 +1717,11 @@
     if (superclass == null) {
       return null;
     }
-    return _lookUpGetterInInterfaces(superclass, true, getterName, visitedInterfaces);
+    return _lookUpGetterInInterfaces(
+        superclass,
+        true,
+        getterName,
+        visitedInterfaces);
   }
 
   /**
@@ -1606,7 +1737,8 @@
     type = _resolveTypeParameter(type);
     if (type is InterfaceType) {
       InterfaceType interfaceType = type;
-      ExecutableElement member = interfaceType.lookUpMethod(memberName, _definingLibrary);
+      ExecutableElement member =
+          interfaceType.lookUpMethod(memberName, _definingLibrary);
       if (member != null) {
         return member;
       }
@@ -1614,7 +1746,11 @@
       if (member != null) {
         return member;
       }
-      return _lookUpGetterOrMethodInInterfaces(interfaceType, false, memberName, new HashSet<ClassElement>());
+      return _lookUpGetterOrMethodInInterfaces(
+          interfaceType,
+          false,
+          memberName,
+          new HashSet<ClassElement>());
     }
     return null;
   }
@@ -1631,11 +1767,13 @@
    *          to prevent infinite recursion and to optimize the search
    * @return the element representing the method or getter that was found
    */
-  ExecutableElement _lookUpGetterOrMethodInInterfaces(InterfaceType targetType, bool includeTargetType, String memberName, HashSet<ClassElement> visitedInterfaces) {
-    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the specification (titled
-    // "Inheritance and Overriding" under "Interfaces") describes a much more complex scheme for
-    // finding the inherited member. We need to follow that scheme. The code below should cover the
-    // 80% case.
+  ExecutableElement _lookUpGetterOrMethodInInterfaces(InterfaceType targetType,
+      bool includeTargetType, String memberName,
+      HashSet<ClassElement> visitedInterfaces) {
+    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
+    // specification (titled "Inheritance and Overriding" under "Interfaces")
+    // describes a much more complex scheme for finding the inherited member.
+    // We need to follow that scheme. The code below should cover the 80% case.
     ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
@@ -1652,13 +1790,21 @@
       }
     }
     for (InterfaceType interfaceType in targetType.interfaces) {
-      ExecutableElement member = _lookUpGetterOrMethodInInterfaces(interfaceType, true, memberName, visitedInterfaces);
+      ExecutableElement member = _lookUpGetterOrMethodInInterfaces(
+          interfaceType,
+          true,
+          memberName,
+          visitedInterfaces);
       if (member != null) {
         return member;
       }
     }
     for (InterfaceType mixinType in targetType.mixins) {
-      ExecutableElement member = _lookUpGetterOrMethodInInterfaces(mixinType, true, memberName, visitedInterfaces);
+      ExecutableElement member = _lookUpGetterOrMethodInInterfaces(
+          mixinType,
+          true,
+          memberName,
+          visitedInterfaces);
       if (member != null) {
         return member;
       }
@@ -1667,55 +1813,11 @@
     if (superclass == null) {
       return null;
     }
-    return _lookUpGetterOrMethodInInterfaces(superclass, true, memberName, visitedInterfaces);
-  }
-
-  /**
-   * Find the element corresponding to the given label node in the current label scope.
-   *
-   * @param parentNode the node containing the given label
-   * @param labelNode the node representing the label being looked up
-   * @return the element corresponding to the given label node in the current scope
-   */
-  LabelElementImpl _lookupLabel(AstNode parentNode, SimpleIdentifier labelNode) {
-    LabelScope labelScope = _resolver.labelScope;
-    LabelElementImpl labelElement = null;
-    if (labelNode == null) {
-      if (labelScope == null) {
-        // TODO(brianwilkerson) Do we need to report this error, or is this condition always caught in the parser?
-        // reportError(ResolverErrorCode.BREAK_OUTSIDE_LOOP);
-      } else {
-        labelElement = labelScope.lookup(LabelScope.EMPTY_LABEL) as LabelElementImpl;
-        if (labelElement == null) {
-          // TODO(brianwilkerson) Do we need to report this error, or is this condition always caught in the parser?
-          // reportError(ResolverErrorCode.BREAK_OUTSIDE_LOOP);
-        }
-        //
-        // The label element that was returned was a marker for look-up and isn't stored in the
-        // element model.
-        //
-        labelElement = null;
-      }
-    } else {
-      if (labelScope == null) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.LABEL_UNDEFINED, labelNode, [labelNode.name]);
-      } else {
-        labelElement = labelScope.lookup(labelNode.name) as LabelElementImpl;
-        if (labelElement == null) {
-          _resolver.reportErrorForNode(CompileTimeErrorCode.LABEL_UNDEFINED, labelNode, [labelNode.name]);
-        } else {
-          labelNode.staticElement = labelElement;
-        }
-      }
-    }
-    if (labelElement != null) {
-      ExecutableElement labelContainer = labelElement.getAncestor((element) => element is ExecutableElement);
-      if (!identical(labelContainer, _resolver.enclosingFunction)) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, labelNode, [labelNode.name]);
-        labelElement = null;
-      }
-    }
-    return labelElement;
+    return _lookUpGetterOrMethodInInterfaces(
+        superclass,
+        true,
+        memberName,
+        visitedInterfaces);
   }
 
   /**
@@ -1727,25 +1829,33 @@
    * @param methodName the name of the method being looked up
    * @return the element representing the method that was found
    */
-  MethodElement _lookUpMethod(Expression target, DartType type, String methodName) {
+  MethodElement _lookUpMethod(Expression target, DartType type,
+      String methodName) {
     type = _resolveTypeParameter(type);
     if (type is InterfaceType) {
       InterfaceType interfaceType = type;
       MethodElement method;
       if (target is SuperExpression) {
-        method = interfaceType.lookUpMethodInSuperclass(methodName, _definingLibrary);
+        method =
+            interfaceType.lookUpMethodInSuperclass(methodName, _definingLibrary);
       } else {
         method = interfaceType.lookUpMethod(methodName, _definingLibrary);
       }
       if (method != null) {
         return method;
       }
-      return _lookUpMethodInInterfaces(interfaceType, false, methodName, new HashSet<ClassElement>());
+      return _lookUpMethodInInterfaces(
+          interfaceType,
+          false,
+          methodName,
+          new HashSet<ClassElement>());
     } else if (type is UnionType) {
       // TODO (collinsn): I want [computeMergedExecutableElement] to be general
-      // and work with functions, methods, constructors, and property accessors. However,
-      // I won't be able to assume it returns [MethodElement] here then.
-      return _maybeMergeExecutableElements(_lookupMethods(target, type, methodName)) as MethodElement;
+      // and work with functions, methods, constructors, and property accessors.
+      // However, I won't be able to assume it returns [MethodElement] here
+      // then.
+      return _maybeMergeExecutableElements(
+          _lookupMethods(target, type, methodName)) as MethodElement;
     }
     return null;
   }
@@ -1762,11 +1872,13 @@
    *          to prevent infinite recursion and to optimize the search
    * @return the element representing the method that was found
    */
-  MethodElement _lookUpMethodInInterfaces(InterfaceType targetType, bool includeTargetType, String methodName, HashSet<ClassElement> visitedInterfaces) {
-    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the specification (titled
-    // "Inheritance and Overriding" under "Interfaces") describes a much more complex scheme for
-    // finding the inherited member. We need to follow that scheme. The code below should cover the
-    // 80% case.
+  MethodElement _lookUpMethodInInterfaces(InterfaceType targetType,
+      bool includeTargetType, String methodName,
+      HashSet<ClassElement> visitedInterfaces) {
+    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
+    // specification (titled "Inheritance and Overriding" under "Interfaces")
+    // describes a much more complex scheme for finding the inherited member.
+    // We need to follow that scheme. The code below should cover the 80% case.
     ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
@@ -1779,13 +1891,15 @@
       }
     }
     for (InterfaceType interfaceType in targetType.interfaces) {
-      MethodElement method = _lookUpMethodInInterfaces(interfaceType, true, methodName, visitedInterfaces);
+      MethodElement method =
+          _lookUpMethodInInterfaces(interfaceType, true, methodName, visitedInterfaces);
       if (method != null) {
         return method;
       }
     }
     for (InterfaceType mixinType in targetType.mixins) {
-      MethodElement method = _lookUpMethodInInterfaces(mixinType, true, methodName, visitedInterfaces);
+      MethodElement method =
+          _lookUpMethodInInterfaces(mixinType, true, methodName, visitedInterfaces);
       if (method != null) {
         return method;
       }
@@ -1794,7 +1908,11 @@
     if (superclass == null) {
       return null;
     }
-    return _lookUpMethodInInterfaces(superclass, true, methodName, visitedInterfaces);
+    return _lookUpMethodInInterfaces(
+        superclass,
+        true,
+        methodName,
+        visitedInterfaces);
   }
 
   /**
@@ -1805,7 +1923,8 @@
    * @param methodName
    * @return all methods named `methodName` defined on the union type `type`.
    */
-  Set<ExecutableElement> _lookupMethods(Expression target, UnionType type, String methodName) {
+  Set<ExecutableElement> _lookupMethods(Expression target, UnionType type,
+      String methodName) {
     Set<ExecutableElement> methods = new HashSet<ExecutableElement>();
     bool allElementsHaveMethod = true;
     for (DartType t in type.elements) {
@@ -1816,7 +1935,8 @@
         allElementsHaveMethod = false;
       }
     }
-    // For strict union types we require that all types in the union define the method.
+    // For strict union types we require that all types in the union define the
+    // method.
     if (AnalysisEngine.instance.strictUnionTypes) {
       if (allElementsHaveMethod) {
         return methods;
@@ -1837,20 +1957,26 @@
    * @param setterName the name of the setter being looked up
    * @return the element representing the setter that was found
    */
-  PropertyAccessorElement _lookUpSetter(Expression target, DartType type, String setterName) {
+  PropertyAccessorElement _lookUpSetter(Expression target, DartType type,
+      String setterName) {
     type = _resolveTypeParameter(type);
     if (type is InterfaceType) {
       InterfaceType interfaceType = type;
       PropertyAccessorElement accessor;
       if (target is SuperExpression) {
-        accessor = interfaceType.lookUpSetterInSuperclass(setterName, _definingLibrary);
+        accessor =
+            interfaceType.lookUpSetterInSuperclass(setterName, _definingLibrary);
       } else {
         accessor = interfaceType.lookUpSetter(setterName, _definingLibrary);
       }
       if (accessor != null) {
         return accessor;
       }
-      return _lookUpSetterInInterfaces(interfaceType, false, setterName, new HashSet<ClassElement>());
+      return _lookUpSetterInInterfaces(
+          interfaceType,
+          false,
+          setterName,
+          new HashSet<ClassElement>());
     }
     return null;
   }
@@ -1867,11 +1993,13 @@
    *          to prevent infinite recursion and to optimize the search
    * @return the element representing the setter that was found
    */
-  PropertyAccessorElement _lookUpSetterInInterfaces(InterfaceType targetType, bool includeTargetType, String setterName, HashSet<ClassElement> visitedInterfaces) {
-    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the specification (titled
-    // "Inheritance and Overriding" under "Interfaces") describes a much more complex scheme for
-    // finding the inherited member. We need to follow that scheme. The code below should cover the
-    // 80% case.
+  PropertyAccessorElement _lookUpSetterInInterfaces(InterfaceType targetType,
+      bool includeTargetType, String setterName,
+      HashSet<ClassElement> visitedInterfaces) {
+    // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
+    // specification (titled "Inheritance and Overriding" under "Interfaces")
+    // describes a much more complex scheme for finding the inherited member.
+    // We need to follow that scheme. The code below should cover the 80% case.
     ClassElement targetClass = targetType.element;
     if (visitedInterfaces.contains(targetClass)) {
       return null;
@@ -1884,13 +2012,15 @@
       }
     }
     for (InterfaceType interfaceType in targetType.interfaces) {
-      PropertyAccessorElement setter = _lookUpSetterInInterfaces(interfaceType, true, setterName, visitedInterfaces);
+      PropertyAccessorElement setter =
+          _lookUpSetterInInterfaces(interfaceType, true, setterName, visitedInterfaces);
       if (setter != null) {
         return setter;
       }
     }
     for (InterfaceType mixinType in targetType.mixins) {
-      PropertyAccessorElement setter = _lookUpSetterInInterfaces(mixinType, true, setterName, visitedInterfaces);
+      PropertyAccessorElement setter =
+          _lookUpSetterInInterfaces(mixinType, true, setterName, visitedInterfaces);
       if (setter != null) {
         return setter;
       }
@@ -1899,30 +2029,11 @@
     if (superclass == null) {
       return null;
     }
-    return _lookUpSetterInInterfaces(superclass, true, setterName, visitedInterfaces);
-  }
-
-  /**
-   * Marks [element] as used in its defining library.
-   */
-  void _markElementUsed(Element element) {
-    // only locally defined elements
-    if (element == null) {
-      return;
-    }
-    if (!identical(element.library, _definingLibrary)) {
-      return;
-    }
-    // convert members to base elements
-    if (element is Member) {
-      element = (element as Member).baseElement;
-    }
-    // ignore references to an element from itself
-    if (identical(element, _resolver.enclosingClass)) {
-      return;
-    }
-    // OK, the element is used
-    (element as ElementImpl).markUsed();
+    return _lookUpSetterInInterfaces(
+        superclass,
+        true,
+        setterName,
+        visitedInterfaces);
   }
 
   /**
@@ -1938,14 +2049,18 @@
    *          the subtypes
    * @return `true` if and only if the passed memberName was found in a subtype
    */
-  bool _memberFoundInSubclass(Element element, String memberName, bool asMethod, bool asAccessor) {
+  bool _memberFoundInSubclass(Element element, String memberName, bool asMethod,
+      bool asAccessor) {
     if (element is ClassElement) {
       _subtypeManager.ensureLibraryVisited(_definingLibrary);
-      HashSet<ClassElement> subtypeElements = _subtypeManager.computeAllSubtypes(element);
+      HashSet<ClassElement> subtypeElements =
+          _subtypeManager.computeAllSubtypes(element);
       for (ClassElement subtypeElement in subtypeElements) {
         if (asMethod && subtypeElement.getMethod(memberName) != null) {
           return true;
-        } else if (asAccessor && (subtypeElement.getGetter(memberName) != null || subtypeElement.getSetter(memberName) != null)) {
+        } else if (asAccessor &&
+            (subtypeElement.getGetter(memberName) != null ||
+                subtypeElement.getSetter(memberName) != null)) {
           return true;
         }
       }
@@ -1985,7 +2100,8 @@
         return sc.TokenType.TILDE_SLASH;
       } else {
         // Internal error: Unmapped assignment operator.
-        AnalysisEngine.instance.logger.logError("Failed to map ${operator.lexeme} to it's corresponding operator");
+        AnalysisEngine.instance.logger.logError(
+            "Failed to map ${operator.lexeme} to it's corresponding operator");
         return operator;
       }
       break;
@@ -2001,7 +2117,8 @@
    * @param node the node which is undefined.
    * @param arguments arguments to the error message.
    */
-  void _recordUndefinedNode(Element declaringElement, ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void _recordUndefinedNode(Element declaringElement, ErrorCode errorCode,
+      AstNode node, List<Object> arguments) {
     if (_doesntHaveProxy(declaringElement)) {
       _resolver.reportErrorForNode(errorCode, node, arguments);
     }
@@ -2018,7 +2135,8 @@
    * @param length the length of the text which is undefined.
    * @param arguments arguments to the error message.
    */
-  void _recordUndefinedOffset(Element declaringElement, ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+  void _recordUndefinedOffset(Element declaringElement, ErrorCode errorCode,
+      int offset, int length, List<Object> arguments) {
     if (_doesntHaveProxy(declaringElement)) {
       _resolver.reportErrorForOffset(errorCode, offset, length, arguments);
     }
@@ -2033,20 +2151,23 @@
    * @param token the token which is undefined.
    * @param arguments arguments to the error message.
    */
-  void _recordUndefinedToken(Element declaringElement, ErrorCode errorCode, sc.Token token, List<Object> arguments) {
+  void _recordUndefinedToken(Element declaringElement, ErrorCode errorCode,
+      sc.Token token, List<Object> arguments) {
     if (_doesntHaveProxy(declaringElement)) {
       _resolver.reportErrorForToken(errorCode, token, arguments);
     }
   }
 
-  void _resolveAnnotationConstructorInvocationArguments(Annotation annotation, ConstructorElement constructor) {
+  void _resolveAnnotationConstructorInvocationArguments(Annotation annotation,
+      ConstructorElement constructor) {
     ArgumentList argumentList = annotation.arguments;
     // error will be reported in ConstantVerifier
     if (argumentList == null) {
       return;
     }
     // resolve arguments to parameters
-    List<ParameterElement> parameters = _resolveArgumentsToFunction(true, argumentList, constructor);
+    List<ParameterElement> parameters =
+        _resolveArgumentsToFunction(true, argumentList, constructor);
     if (parameters != null) {
       argumentList.correspondingStaticParameters = parameters;
     }
@@ -2086,7 +2207,8 @@
       // Class(args)
       if (element1 is ClassElement) {
         ClassElement classElement = element1;
-        constructor = new InterfaceTypeImpl.con1(classElement).lookUpConstructor(null, _definingLibrary);
+        constructor = new InterfaceTypeImpl.con1(
+            classElement).lookUpConstructor(null, _definingLibrary);
       }
     }
     //
@@ -2104,7 +2226,9 @@
       if (element2 is PropertyAccessorElement) {
         nameNode2.staticElement = element2;
         annotation.element = element2;
-        _resolveAnnotationElementGetter(annotation, element2 as PropertyAccessorElement);
+        _resolveAnnotationElementGetter(
+            annotation,
+            element2 as PropertyAccessorElement);
         return;
       }
       // prefix.Class()
@@ -2115,7 +2239,8 @@
       // Class.constructor(args)
       if (element1 is ClassElement) {
         ClassElement classElement = element1;
-        constructor = new InterfaceTypeImpl.con1(classElement).lookUpConstructor(nameNode2.name, _definingLibrary);
+        constructor = new InterfaceTypeImpl.con1(
+            classElement).lookUpConstructor(nameNode2.name, _definingLibrary);
         nameNode2.staticElement = constructor;
       }
     }
@@ -2129,7 +2254,8 @@
         ClassElement classElement = element2;
         String name3 = nameNode3.name;
         // prefix.Class.CONST
-        PropertyAccessorElement getter = classElement.lookUpGetter(name3, _definingLibrary);
+        PropertyAccessorElement getter =
+            classElement.lookUpGetter(name3, _definingLibrary);
         if (getter != null) {
           nameNode3.staticElement = getter;
           annotation.element = element2;
@@ -2137,13 +2263,16 @@
           return;
         }
         // prefix.Class.constructor(args)
-        constructor = new InterfaceTypeImpl.con1(classElement).lookUpConstructor(name3, _definingLibrary);
+        constructor = new InterfaceTypeImpl.con1(
+            classElement).lookUpConstructor(name3, _definingLibrary);
         nameNode3.staticElement = constructor;
       }
     }
     // we need constructor
     if (constructor == null) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_ANNOTATION,
+          annotation);
       return;
     }
     // record element
@@ -2152,16 +2281,21 @@
     _resolveAnnotationConstructorInvocationArguments(annotation, constructor);
   }
 
-  void _resolveAnnotationElementGetter(Annotation annotation, PropertyAccessorElement accessorElement) {
+  void _resolveAnnotationElementGetter(Annotation annotation,
+      PropertyAccessorElement accessorElement) {
     // accessor should be synthetic
     if (!accessorElement.isSynthetic) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_ANNOTATION,
+          annotation);
       return;
     }
     // variable should be constant
     VariableElement variableElement = accessorElement.variable;
     if (!variableElement.isConst) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
+      _resolver.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_ANNOTATION,
+          annotation);
     }
     // OK
     return;
@@ -2178,7 +2312,8 @@
    * @param executableElement the element that will be invoked with the arguments
    * @return the parameters that correspond to the arguments
    */
-  List<ParameterElement> _resolveArgumentsToFunction(bool reportError, ArgumentList argumentList, ExecutableElement executableElement) {
+  List<ParameterElement> _resolveArgumentsToFunction(bool reportError,
+      ArgumentList argumentList, ExecutableElement executableElement) {
     if (executableElement == null) {
       return null;
     }
@@ -2197,10 +2332,12 @@
    * @param parameters the of the function that will be invoked with the arguments
    * @return the parameters that correspond to the arguments
    */
-  List<ParameterElement> _resolveArgumentsToParameters(bool reportError, ArgumentList argumentList, List<ParameterElement> parameters) {
+  List<ParameterElement> _resolveArgumentsToParameters(bool reportError,
+      ArgumentList argumentList, List<ParameterElement> parameters) {
     List<ParameterElement> requiredParameters = new List<ParameterElement>();
     List<ParameterElement> positionalParameters = new List<ParameterElement>();
-    HashMap<String, ParameterElement> namedParameters = new HashMap<String, ParameterElement>();
+    HashMap<String, ParameterElement> namedParameters =
+        new HashMap<String, ParameterElement>();
     for (ParameterElement parameter in parameters) {
       ParameterKind kind = parameter.parameterKind;
       if (kind == ParameterKind.REQUIRED) {
@@ -2211,13 +2348,15 @@
         namedParameters[parameter.name] = parameter;
       }
     }
-    List<ParameterElement> unnamedParameters = new List<ParameterElement>.from(requiredParameters);
+    List<ParameterElement> unnamedParameters =
+        new List<ParameterElement>.from(requiredParameters);
     unnamedParameters.addAll(positionalParameters);
     int unnamedParameterCount = unnamedParameters.length;
     int unnamedIndex = 0;
     NodeList<Expression> arguments = argumentList.arguments;
     int argumentCount = arguments.length;
-    List<ParameterElement> resolvedParameters = new List<ParameterElement>(argumentCount);
+    List<ParameterElement> resolvedParameters =
+        new List<ParameterElement>(argumentCount);
     int positionalArgumentCount = 0;
     HashSet<String> usedNames = new HashSet<String>();
     bool noBlankArguments = true;
@@ -2228,14 +2367,19 @@
         String name = nameNode.name;
         ParameterElement element = namedParameters[name];
         if (element == null) {
-          ErrorCode errorCode = (reportError ? CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER : StaticWarningCode.UNDEFINED_NAMED_PARAMETER);
+          ErrorCode errorCode = (reportError ?
+              CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER :
+              StaticWarningCode.UNDEFINED_NAMED_PARAMETER);
           _resolver.reportErrorForNode(errorCode, nameNode, [name]);
         } else {
           resolvedParameters[i] = element;
           nameNode.staticElement = element;
         }
         if (!usedNames.add(name)) {
-          _resolver.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, nameNode, [name]);
+          _resolver.reportErrorForNode(
+              CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT,
+              nameNode,
+              [name]);
         }
       } else {
         if (argument is SimpleIdentifier && argument.name.isEmpty) {
@@ -2247,31 +2391,82 @@
         }
       }
     }
-    if (positionalArgumentCount < requiredParameters.length && noBlankArguments) {
-      ErrorCode errorCode = (reportError ? CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS : StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
-      _resolver.reportErrorForNode(errorCode, argumentList, [requiredParameters.length, positionalArgumentCount]);
-    } else if (positionalArgumentCount > unnamedParameterCount && noBlankArguments) {
-      ErrorCode errorCode = (reportError ? CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS : StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS);
-      _resolver.reportErrorForNode(errorCode, argumentList, [unnamedParameterCount, positionalArgumentCount]);
+    if (positionalArgumentCount < requiredParameters.length &&
+        noBlankArguments) {
+      ErrorCode errorCode = (reportError ?
+          CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS :
+          StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
+      _resolver.reportErrorForNode(
+          errorCode,
+          argumentList,
+          [requiredParameters.length, positionalArgumentCount]);
+    } else if (positionalArgumentCount > unnamedParameterCount &&
+        noBlankArguments) {
+      ErrorCode errorCode = (reportError ?
+          CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS :
+          StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS);
+      _resolver.reportErrorForNode(
+          errorCode,
+          argumentList,
+          [unnamedParameterCount, positionalArgumentCount]);
     }
     return resolvedParameters;
   }
 
+  void _resolveBinaryExpression(BinaryExpression node, String methodName) {
+    Expression leftOperand = node.leftOperand;
+    if (leftOperand != null) {
+      DartType staticType = _getStaticType(leftOperand);
+      MethodElement staticMethod =
+          _lookUpMethod(leftOperand, staticType, methodName);
+      node.staticElement = staticMethod;
+      DartType propagatedType = _getPropagatedType(leftOperand);
+      MethodElement propagatedMethod =
+          _lookUpMethod(leftOperand, propagatedType, methodName);
+      node.propagatedElement = propagatedMethod;
+      if (_shouldReportMissingMember(staticType, staticMethod)) {
+        if (leftOperand is SuperExpression) {
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+              node.operator,
+              [methodName, staticType.displayName]);
+        } else {
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_OPERATOR,
+              node.operator,
+              [methodName, staticType.displayName]);
+        }
+      } else if (_enableHints &&
+          _shouldReportMissingMember(propagatedType, propagatedMethod) &&
+          !_memberFoundInSubclass(propagatedType.element, methodName, true, false)) {
+        _recordUndefinedToken(
+            propagatedType.element,
+            HintCode.UNDEFINED_OPERATOR,
+            node.operator,
+            [methodName, propagatedType.displayName]);
+      }
+    }
+  }
+
   /**
    * Resolve the names in the given combinators in the scope of the given library.
    *
    * @param library the library that defines the names
    * @param combinators the combinators containing the names to be resolved
    */
-  void _resolveCombinators(LibraryElement library, NodeList<Combinator> combinators) {
+  void _resolveCombinators(LibraryElement library,
+      NodeList<Combinator> combinators) {
     if (library == null) {
       //
-      // The library will be null if the directive containing the combinators has a URI that is not
-      // valid.
+      // The library will be null if the directive containing the combinators
+      // has a URI that is not valid.
       //
       return;
     }
-    Namespace namespace = new NamespaceBuilder().createExportNamespaceForLibrary(library);
+    Namespace namespace =
+        new NamespaceBuilder().createExportNamespaceForLibrary(library);
     for (Combinator combinator in combinators) {
       NodeList<SimpleIdentifier> names;
       if (combinator is HideCombinator) {
@@ -2304,7 +2499,8 @@
    * @param classElement the class element
    * @param nameNode the member name node
    */
-  Element _resolveElement(ClassElementImpl classElement, SimpleIdentifier nameNode) {
+  Element _resolveElement(ClassElementImpl classElement,
+      SimpleIdentifier nameNode) {
     String name = nameNode.name;
     Element element = classElement.getMethod(name);
     if (element == null && nameNode.inSetterContext()) {
@@ -2335,8 +2531,8 @@
     Element element = _resolver.nameScope.lookup(methodName, _definingLibrary);
     if (element == null) {
       //
-      // If it isn't defined in the lexical scope, and the invocation is within a class, then look
-      // in the inheritance scope.
+      // If it isn't defined in the lexical scope, and the invocation is within
+      // a class, then look in the inheritance scope.
       //
       ClassElement enclosingClass = _resolver.enclosingClass;
       if (enclosingClass != null) {
@@ -2344,7 +2540,8 @@
         element = _lookUpMethod(null, enclosingType, methodName.name);
         if (element == null) {
           //
-          // If there's no method, then it's possible that 'm' is a getter that returns a function.
+          // If there's no method, then it's possible that 'm' is a getter that
+          // returns a function.
           //
           element = _lookUpGetter(null, enclosingType, methodName.name);
         }
@@ -2365,14 +2562,17 @@
    * @param methodName the name of the method being invoked ('m')
    * @return the element being invoked
    */
-  Element _resolveInvokedElementWithTarget(Expression target, DartType targetType, SimpleIdentifier methodName) {
+  Element _resolveInvokedElementWithTarget(Expression target,
+      DartType targetType, SimpleIdentifier methodName) {
     if (targetType is InterfaceType || targetType is UnionType) {
       Element element = _lookUpMethod(target, targetType, methodName.name);
       if (element == null) {
         //
-        // If there's no method, then it's possible that 'm' is a getter that returns a function.
+        // If there's no method, then it's possible that 'm' is a getter that
+        // returns a function.
         //
-        // TODO (collinsn): need to add union type support here too, in the style of [lookUpMethod].
+        // TODO (collinsn): need to add union type support here too, in the
+        // style of [lookUpMethod].
         element = _lookUpGetter(target, targetType, methodName.name);
       }
       return element;
@@ -2380,15 +2580,18 @@
       Element targetElement = target.staticElement;
       if (targetElement is PrefixElement) {
         //
-        // Look to see whether the name of the method is really part of a prefixed identifier for an
-        // imported top-level function or top-level getter that returns a function.
+        // Look to see whether the name of the method is really part of a
+        // prefixed identifier for an imported top-level function or top-level
+        // getter that returns a function.
         //
         String name = "${target.name}.$methodName";
         Identifier functionName = new SyntheticIdentifier(name, methodName);
-        Element element = _resolver.nameScope.lookup(functionName, _definingLibrary);
+        Element element =
+            _resolver.nameScope.lookup(functionName, _definingLibrary);
         if (element != null) {
-          // TODO(brianwilkerson) This isn't a method invocation, it's a function invocation where
-          // the function name is a prefixed identifier. Consider re-writing the AST.
+          // TODO(brianwilkerson) This isn't a method invocation, it's a
+          // function invocation where the function name is a prefixed
+          // identifier. Consider re-writing the AST.
           return element;
         }
       }
@@ -2406,7 +2609,8 @@
    * @param propertyName the name of the property being accessed
    * @return the element that represents the property
    */
-  ExecutableElement _resolveProperty(Expression target, DartType targetType, SimpleIdentifier propertyName) {
+  ExecutableElement _resolveProperty(Expression target, DartType targetType,
+      SimpleIdentifier propertyName) {
     ExecutableElement memberElement = null;
     if (propertyName.inSetterContext()) {
       memberElement = _lookUpSetter(target, targetType, propertyName.name);
@@ -2420,23 +2624,27 @@
     return memberElement;
   }
 
-  void _resolvePropertyAccess(Expression target, SimpleIdentifier propertyName) {
+  void _resolvePropertyAccess(Expression target,
+      SimpleIdentifier propertyName) {
     DartType staticType = _getStaticType(target);
     DartType propagatedType = _getPropagatedType(target);
     Element staticElement = null;
     Element propagatedElement = null;
     //
-    // If this property access is of the form 'C.m' where 'C' is a class, then we don't call
-    // resolveProperty(..) which walks up the class hierarchy, instead we just look for the
-    // member in the type only.
+    // If this property access is of the form 'C.m' where 'C' is a class,
+    // then we don't call resolveProperty(..) which walks up the class
+    // hierarchy, instead we just look for the member in the type only.
     //
     ClassElementImpl typeReference = getTypeReference(target);
     if (typeReference != null) {
-      // TODO(brianwilkerson) Why are we setting the propagated element here? It looks wrong.
-      staticElement = propagatedElement = _resolveElement(typeReference, propertyName);
+      // TODO(brianwilkerson) Why are we setting the propagated element here?
+      // It looks wrong.
+      staticElement =
+          propagatedElement = _resolveElement(typeReference, propertyName);
     } else {
       staticElement = _resolveProperty(target, staticType, propertyName);
-      propagatedElement = _resolveProperty(target, propagatedType, propertyName);
+      propagatedElement =
+          _resolveProperty(target, propagatedType, propertyName);
     }
     // May be part of annotation, record property element only if exists.
     // Error was already reported in validateAnnotationElement().
@@ -2448,43 +2656,106 @@
     }
     propertyName.staticElement = staticElement;
     propertyName.propagatedElement = propagatedElement;
-    bool shouldReportMissingMember_static = _shouldReportMissingMember(staticType, staticElement);
-    bool shouldReportMissingMember_propagated = !shouldReportMissingMember_static && _enableHints && _shouldReportMissingMember(propagatedType, propagatedElement) && !_memberFoundInSubclass(propagatedType.element, propertyName.name, false, true);
+    bool shouldReportMissingMember_static =
+        _shouldReportMissingMember(staticType, staticElement);
+    bool shouldReportMissingMember_propagated =
+        !shouldReportMissingMember_static &&
+        _enableHints &&
+        _shouldReportMissingMember(propagatedType, propagatedElement) &&
+        !_memberFoundInSubclass(propagatedType.element, propertyName.name, false, true);
     // TODO(collinsn): add support for errors on union types by extending
-    // [lookupGetter] and [lookupSetter] in analogy with the earlier [lookupMethod] extensions.
+    // [lookupGetter] and [lookupSetter] in analogy with the earlier
+    // [lookupMethod] extensions.
     if (propagatedType is UnionType) {
       shouldReportMissingMember_propagated = false;
     }
-    if (shouldReportMissingMember_static || shouldReportMissingMember_propagated) {
-      Element staticOrPropagatedEnclosingElt = shouldReportMissingMember_static ? staticType.element : propagatedType.element;
+    if (shouldReportMissingMember_static ||
+        shouldReportMissingMember_propagated) {
+      DartType staticOrPropagatedType =
+          shouldReportMissingMember_static ? staticType : propagatedType;
+      Element staticOrPropagatedEnclosingElt = staticOrPropagatedType.element;
       bool isStaticProperty = _isStatic(staticOrPropagatedEnclosingElt);
-      String displayName = staticOrPropagatedEnclosingElt != null ? staticOrPropagatedEnclosingElt.displayName : propagatedType != null ? propagatedType.displayName : staticType.displayName;
+      DartType displayType = staticOrPropagatedType != null ?
+          staticOrPropagatedType :
+          propagatedType != null ? propagatedType : staticType;
       // Special getter cases.
       if (propertyName.inGetterContext()) {
-        if (!isStaticProperty && staticOrPropagatedEnclosingElt is ClassElement) {
+        if (!isStaticProperty &&
+            staticOrPropagatedEnclosingElt is ClassElement) {
           ClassElement classElement = staticOrPropagatedEnclosingElt;
           InterfaceType targetType = classElement.type;
-          if (targetType != null && targetType.isDartCoreFunction && propertyName.name == FunctionElement.CALL_METHOD_NAME) {
-            // TODO(brianwilkerson) Can we ever resolve the function being invoked?
-            //resolveArgumentsToParameters(node.getArgumentList(), invokedFunction);
+          if (targetType != null &&
+              targetType.isDartCoreFunction &&
+              propertyName.name == FunctionElement.CALL_METHOD_NAME) {
+            // TODO(brianwilkerson) Can we ever resolve the function being
+            // invoked?
+//            resolveArgumentsToParameters(node.getArgumentList(), invokedFunction);
             return;
           } else if (classElement.isEnum && propertyName.name == "_name") {
-            _resolver.reportErrorForNode(CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD, propertyName, [propertyName.name]);
+            _resolver.reportErrorForNode(
+                CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD,
+                propertyName,
+                [propertyName.name]);
             return;
           }
         }
       }
-      Element declaringElement = staticType.isVoid ? null : staticOrPropagatedEnclosingElt;
+      Element declaringElement =
+          staticType.isVoid ? null : staticOrPropagatedEnclosingElt;
       if (propertyName.inSetterContext()) {
-        ErrorCode staticErrorCode = (isStaticProperty && !staticType.isVoid ? StaticWarningCode.UNDEFINED_SETTER : StaticTypeWarningCode.UNDEFINED_SETTER);
-        ErrorCode errorCode = shouldReportMissingMember_static ? staticErrorCode : HintCode.UNDEFINED_SETTER;
-        _recordUndefinedNode(declaringElement, errorCode, propertyName, [propertyName.name, displayName]);
+        ErrorCode errorCode;
+        if (shouldReportMissingMember_static) {
+          if (target is SuperExpression) {
+            if (isStaticProperty && !staticType.isVoid) {
+              errorCode = StaticWarningCode.UNDEFINED_SUPER_SETTER;
+            } else {
+              errorCode = StaticTypeWarningCode.UNDEFINED_SUPER_SETTER;
+            }
+          } else {
+            if (isStaticProperty && !staticType.isVoid) {
+              errorCode = StaticWarningCode.UNDEFINED_SETTER;
+            } else {
+              errorCode = StaticTypeWarningCode.UNDEFINED_SETTER;
+            }
+          }
+        } else {
+          errorCode = HintCode.UNDEFINED_SETTER;
+        }
+        _recordUndefinedNode(
+            declaringElement,
+            errorCode,
+            propertyName,
+            [propertyName.name, displayType.displayName]);
       } else if (propertyName.inGetterContext()) {
-        ErrorCode staticErrorCode = (isStaticProperty && !staticType.isVoid ? StaticWarningCode.UNDEFINED_GETTER : StaticTypeWarningCode.UNDEFINED_GETTER);
-        ErrorCode errorCode = shouldReportMissingMember_static ? staticErrorCode : HintCode.UNDEFINED_GETTER;
-        _recordUndefinedNode(declaringElement, errorCode, propertyName, [propertyName.name, displayName]);
+        ErrorCode errorCode;
+        if (shouldReportMissingMember_static) {
+          if (target is SuperExpression) {
+            if (isStaticProperty && !staticType.isVoid) {
+              errorCode = StaticWarningCode.UNDEFINED_SUPER_GETTER;
+            } else {
+              errorCode = StaticTypeWarningCode.UNDEFINED_SUPER_GETTER;
+            }
+          } else {
+            if (isStaticProperty && !staticType.isVoid) {
+              errorCode = StaticWarningCode.UNDEFINED_GETTER;
+            } else {
+              errorCode = StaticTypeWarningCode.UNDEFINED_GETTER;
+            }
+          }
+        } else {
+          errorCode = HintCode.UNDEFINED_GETTER;
+        }
+        _recordUndefinedNode(
+            declaringElement,
+            errorCode,
+            propertyName,
+            [propertyName.name, displayType.displayName]);
       } else {
-        _recordUndefinedNode(declaringElement, StaticWarningCode.UNDEFINED_IDENTIFIER, propertyName, [propertyName.name]);
+        _recordUndefinedNode(
+            declaringElement,
+            StaticWarningCode.UNDEFINED_IDENTIFIER,
+            propertyName,
+            [propertyName.name]);
       }
     }
   }
@@ -2500,12 +2771,14 @@
   Element _resolveSimpleIdentifier(SimpleIdentifier node) {
     Element element = _resolver.nameScope.lookup(node, _definingLibrary);
     if (element is PropertyAccessorElement && node.inSetterContext()) {
-      PropertyInducingElement variable = (element as PropertyAccessorElement).variable;
+      PropertyInducingElement variable =
+          (element as PropertyAccessorElement).variable;
       if (variable != null) {
         PropertyAccessorElement setter = variable.setter;
         if (setter == null) {
           //
-          // Check to see whether there might be a locally defined getter and an inherited setter.
+          // Check to see whether there might be a locally defined getter and
+          // an inherited setter.
           //
           ClassElement enclosingClass = _resolver.enclosingClass;
           if (enclosingClass != null) {
@@ -2516,8 +2789,8 @@
           element = setter;
         }
       }
-    } else if (element == null
-        && (node.inSetterContext() || node.parent is CommentReference)) {
+    } else if (element == null &&
+        (node.inSetterContext() || node.parent is CommentReference)) {
       element = _resolver.nameScope.lookup(
           new SyntheticIdentifier("${node.name}=", node),
           _definingLibrary);
@@ -2525,7 +2798,8 @@
     ClassElement enclosingClass = _resolver.enclosingClass;
     if (element == null && enclosingClass != null) {
       InterfaceType enclosingType = enclosingClass.type;
-      if (element == null && (node.inSetterContext() || node.parent is CommentReference)) {
+      if (element == null &&
+          (node.inSetterContext() || node.parent is CommentReference)) {
         element = _lookUpSetter(null, enclosingType, node.name);
       }
       if (element == null && node.inGetterContext()) {
@@ -2569,7 +2843,8 @@
     if (element is! ElementImpl) {
       return;
     }
-    List<ElementAnnotationImpl> annotationList = new List<ElementAnnotationImpl>();
+    List<ElementAnnotationImpl> annotationList =
+        new List<ElementAnnotationImpl>();
     _addAnnotations(annotationList, node.metadata);
     if (node is VariableDeclaration && node.parent is VariableDeclarationList) {
       VariableDeclarationList list = node.parent as VariableDeclarationList;
@@ -2578,7 +2853,8 @@
         FieldDeclaration fieldDeclaration = list.parent as FieldDeclaration;
         _addAnnotations(annotationList, fieldDeclaration.metadata);
       } else if (list.parent is TopLevelVariableDeclaration) {
-        TopLevelVariableDeclaration variableDeclaration = list.parent as TopLevelVariableDeclaration;
+        TopLevelVariableDeclaration variableDeclaration =
+            list.parent as TopLevelVariableDeclaration;
         _addAnnotations(annotationList, variableDeclaration.metadata);
       }
     }
@@ -2599,7 +2875,8 @@
     if (element is! ElementImpl) {
       return;
     }
-    List<ElementAnnotationImpl> annotationList = new List<ElementAnnotationImpl>();
+    List<ElementAnnotationImpl> annotationList =
+        new List<ElementAnnotationImpl>();
     _addAnnotations(annotationList, node.metadata);
     if (!annotationList.isEmpty) {
       (element as ElementImpl).metadata = annotationList;
@@ -2620,6 +2897,174 @@
     }
     return true;
   }
+
+  /**
+   * Checks whether the given expression is a reference to a class. If it is then the
+   * [ClassElement] is returned, otherwise `null` is returned.
+   *
+   * @param expression the expression to evaluate
+   * @return the element representing the class
+   */
+  static ClassElementImpl getTypeReference(Expression expression) {
+    if (expression is Identifier) {
+      Element staticElement = expression.staticElement;
+      if (staticElement is ClassElementImpl) {
+        return staticElement;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Helper function for `maybeMergeExecutableElements` that does the actual merging.
+   *
+   * @param elementArrayToMerge non-empty array of elements to merge.
+   * @return
+   */
+  static ExecutableElement
+      _computeMergedExecutableElement(List<ExecutableElement> elementArrayToMerge) {
+    // Flatten methods structurally. Based on
+    // [InheritanceManager.computeMergedExecutableElement] and
+    // [InheritanceManager.createSyntheticExecutableElement].
+    //
+    // However, the approach we take here is much simpler, but expected to work
+    // well in the common case. It degrades gracefully in the uncommon case,
+    // by computing the type [dynamic] for the method, preventing any
+    // hints from being generated (TODO: not done yet).
+    //
+    // The approach is: we require that each [ExecutableElement] has the
+    // same shape: the same number of required, optional positional, and
+    // optional named parameters, in the same positions, and with the named
+    // parameters in the same order. We compute a type by unioning pointwise.
+    ExecutableElement e_0 = elementArrayToMerge[0];
+    List<ParameterElement> ps_0 = e_0.parameters;
+    List<ParameterElementImpl> ps_out =
+        new List<ParameterElementImpl>(ps_0.length);
+    for (int j = 0; j < ps_out.length; j++) {
+      ps_out[j] = new ParameterElementImpl(ps_0[j].name, 0);
+      ps_out[j].synthetic = true;
+      ps_out[j].type = ps_0[j].type;
+      ps_out[j].parameterKind = ps_0[j].parameterKind;
+    }
+    DartType r_out = e_0.returnType;
+    for (int i = 1; i < elementArrayToMerge.length; i++) {
+      ExecutableElement e_i = elementArrayToMerge[i];
+      r_out = UnionTypeImpl.union([r_out, e_i.returnType]);
+      List<ParameterElement> ps_i = e_i.parameters;
+      // Each function must have the same number of params.
+      if (ps_0.length != ps_i.length) {
+        return null;
+        // TODO (collinsn): return an element representing [dynamic] here
+        // instead.
+      } else {
+        // Each function must have the same kind of params, with the same names,
+        // in the same order.
+        for (int j = 0; j < ps_i.length; j++) {
+          if (ps_0[j].parameterKind != ps_i[j].parameterKind ||
+              !identical(ps_0[j].name, ps_i[j].name)) {
+            return null;
+          } else {
+            // The output parameter type is the union of the input parameter
+            // types.
+            ps_out[j].type =
+                UnionTypeImpl.union([ps_out[j].type, ps_i[j].type]);
+          }
+        }
+      }
+    }
+    // TODO (collinsn): this code should work for functions and methods,
+    // so we may want [FunctionElementImpl]
+    // instead here in some cases?
+    // And then there are constructors and property accessors.
+    // Maybe the answer is to create a new subclass of [ExecutableElementImpl]
+    // which is used for merged executable elements, in analogy with
+    // [MultiplyInheritedMethodElementImpl] and
+    // [MultiplyInheritedPropertyAcessorElementImpl].
+    ExecutableElementImpl e_out = new MethodElementImpl(e_0.name, 0);
+    e_out.synthetic = true;
+    e_out.returnType = r_out;
+    e_out.parameters = ps_out;
+    e_out.type = new FunctionTypeImpl.con1(e_out);
+    // Get NPE in [toString()] w/o this.
+    e_out.enclosingElement = e_0.enclosingElement;
+    return e_out;
+  }
+
+  /**
+   * Return `true` if the given identifier is the return type of a constructor declaration.
+   *
+   * @return `true` if the given identifier is the return type of a constructor declaration.
+   */
+  static bool _isConstructorReturnType(SimpleIdentifier identifier) {
+    AstNode parent = identifier.parent;
+    if (parent is ConstructorDeclaration) {
+      return identical(parent.returnType, identifier);
+    }
+    return false;
+  }
+
+  /**
+   * Return `true` if the given identifier is the return type of a factory constructor.
+   *
+   * @return `true` if the given identifier is the return type of a factory constructor
+   *         declaration.
+   */
+  static bool _isFactoryConstructorReturnType(SimpleIdentifier node) {
+    AstNode parent = node.parent;
+    if (parent is ConstructorDeclaration) {
+      ConstructorDeclaration constructor = parent;
+      return identical(constructor.returnType, node) &&
+          constructor.factoryKeyword != null;
+    }
+    return false;
+  }
+
+  /**
+   * Return `true` if the given 'super' expression is used in a valid context.
+   *
+   * @param node the 'super' expression to analyze
+   * @return `true` if the 'super' expression is in a valid context
+   */
+  static bool _isSuperInValidContext(SuperExpression node) {
+    for (AstNode n = node; n != null; n = n.parent) {
+      if (n is CompilationUnit) {
+        return false;
+      }
+      if (n is ConstructorDeclaration) {
+        ConstructorDeclaration constructor = n as ConstructorDeclaration;
+        return constructor.factoryKeyword == null;
+      }
+      if (n is ConstructorFieldInitializer) {
+        return false;
+      }
+      if (n is MethodDeclaration) {
+        MethodDeclaration method = n as MethodDeclaration;
+        return !method.isStatic;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Return a method representing the merge of the given elements. The type of the merged element is
+   * the component-wise union of the types of the given elements. If not all input elements have the
+   * same shape then [null] is returned.
+   *
+   * @param elements the `ExecutableElement`s to merge
+   * @return an `ExecutableElement` representing the merge of `elements`
+   */
+  static ExecutableElement
+      _maybeMergeExecutableElements(Set<ExecutableElement> elements) {
+    List<ExecutableElement> elementArrayToMerge = new List.from(elements);
+    if (elementArrayToMerge.length == 0) {
+      return null;
+    } else if (elementArrayToMerge.length == 1) {
+      // If all methods are equal, don't bother building a new one.
+      return elementArrayToMerge[0];
+    } else {
+      return _computeMergedExecutableElement(elementArrayToMerge);
+    }
+  }
 }
 
 /**
@@ -2647,9 +3092,6 @@
   SyntheticIdentifier(this.name, this.targetIdentifier);
 
   @override
-  accept(AstVisitor visitor) => null;
-
-  @override
   sc.Token get beginToken => null;
 
   @override
@@ -2674,6 +3116,9 @@
   Element get staticElement => null;
 
   @override
+  accept(AstVisitor visitor) => null;
+
+  @override
   void visitChildren(AstVisitor visitor) {
   }
 }
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 9164e8e..7266577 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -7,27 +7,31 @@
 
 library engine;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:async';
+import 'dart:collection';
 
 import 'package:analyzer/src/task/task_dart.dart';
 
-import 'java_core.dart';
-import 'java_engine.dart';
-import 'utilities_collection.dart';
-import 'utilities_general.dart';
-import 'instrumentation.dart';
-import 'error.dart';
-import 'error_verifier.dart';
-import 'source.dart';
-import 'scanner.dart';
 import 'ast.dart';
-import 'parser.dart' show Parser, IncrementalParser;
-import 'sdk.dart' show DartSdk;
 import 'constant.dart';
 import 'element.dart';
-import 'resolver.dart';
+import 'error.dart';
+import 'error_verifier.dart';
 import 'html.dart' as ht;
+import 'incremental_resolver.dart' show IncrementalResolver,
+    PoorMansIncrementalResolver;
+import 'incremental_scanner.dart';
+import 'instrumentation.dart';
+import 'java_core.dart';
+import 'java_engine.dart';
+import 'parser.dart' show Parser, IncrementalParser;
+import 'resolver.dart';
+import 'scanner.dart';
+import 'sdk.dart' show DartSdk;
+import 'source.dart';
+import 'utilities_collection.dart';
+import 'utilities_general.dart';
 
 /**
  * Instances of the class `AnalysisCache` implement an LRU cache of information related to
@@ -35,17 +39,17 @@
  */
 class AnalysisCache {
   /**
-   * An array containing the partitions of which this cache is comprised.
-   */
-  final List<CachePartition> _partitions;
-
-  /**
    * A flag used to control whether trace information should be produced when the content of the
    * cache is modified.
    */
   static bool _TRACE_CHANGES = false;
 
   /**
+   * An array containing the partitions of which this cache is comprised.
+   */
+  final List<CachePartition> _partitions;
+
+  /**
    * Initialize a newly created cache to have the given partitions. The partitions will be searched
    * in the order in which they appear in the array, so the most specific partition (usually an
    * [SdkCachePartition]) should be first and the most general (usually a
@@ -56,6 +60,31 @@
   AnalysisCache(this._partitions);
 
   /**
+   * Return the number of entries in this cache that have an AST associated with them.
+   *
+   * @return the number of entries in this cache that have an AST associated with them
+   */
+  int get astSize => _partitions[_partitions.length - 1].astSize;
+
+  /**
+   * Return information about each of the partitions in this cache.
+   *
+   * @return information about each of the partitions in this cache
+   */
+  List<AnalysisContextStatistics_PartitionData> get partitionData {
+    int count = _partitions.length;
+    List<AnalysisContextStatistics_PartitionData> data =
+        new List<AnalysisContextStatistics_PartitionData>(count);
+    for (int i = 0; i < count; i++) {
+      CachePartition partition = _partitions[i];
+      data[i] = new AnalysisContextStatisticsImpl_PartitionDataImpl(
+          partition.astSize,
+          partition.map.length);
+    }
+    return data;
+  }
+
+  /**
    * Record that the AST associated with the given source was just read from the cache.
    *
    * @param source the source whose AST was accessed
@@ -84,21 +113,14 @@
       }
     }
     //
-    // We should never get to this point because the last partition should always be a universal
-    // partition, except in the case of the SDK context, in which case the source should always be
-    // part of the SDK.
+    // We should never get to this point because the last partition should
+    // always be a universal partition, except in the case of the SDK context,
+    // in which case the source should always be part of the SDK.
     //
     return null;
   }
 
   /**
-   * Return the number of entries in this cache that have an AST associated with them.
-   *
-   * @return the number of entries in this cache that have an AST associated with them
-   */
-  int get astSize => _partitions[_partitions.length - 1].astSize;
-
-  /**
    * Return context that owns the given source.
    *
    * @param source the source whose context is to be returned
@@ -123,21 +145,6 @@
   }
 
   /**
-   * Return information about each of the partitions in this cache.
-   *
-   * @return information about each of the partitions in this cache
-   */
-  List<AnalysisContextStatistics_PartitionData> get partitionData {
-    int count = _partitions.length;
-    List<AnalysisContextStatistics_PartitionData> data = new List<AnalysisContextStatistics_PartitionData>(count);
-    for (int i = 0; i < count; i++) {
-      CachePartition partition = _partitions[i];
-      data[i] = new AnalysisContextStatisticsImpl_PartitionDataImpl(partition.astSize, partition.map.length);
-    }
-    return data;
-  }
-
-  /**
    * Return an iterator returning all of the map entries mapping sources to cache entries.
    *
    * @return an iterator returning all of the map entries mapping sources to cache entries
@@ -166,9 +173,11 @@
           try {
             SourceEntry oldEntry = _partitions[i].get(source);
             if (oldEntry == null) {
-              AnalysisEngine.instance.logger.logInformation("Added a cache entry for '${source.fullName}'.");
+              AnalysisEngine.instance.logger.logInformation(
+                  "Added a cache entry for '${source.fullName}'.");
             } else {
-              AnalysisEngine.instance.logger.logInformation("Modified the cache entry for ${source.fullName}'. Diff = ${entry.getDiff(oldEntry)}");
+              AnalysisEngine.instance.logger.logInformation(
+                  "Modified the cache entry for ${source.fullName}'. Diff = ${entry.getDiff(oldEntry)}");
             }
           } catch (exception) {
             // Ignored
@@ -192,7 +201,8 @@
       if (_partitions[i].contains(source)) {
         if (_TRACE_CHANGES) {
           try {
-            AnalysisEngine.instance.logger.logInformation("Removed the cache entry for ${source.fullName}'.");
+            AnalysisEngine.instance.logger.logInformation(
+                "Removed the cache entry for ${source.fullName}'.");
           } catch (exception) {
             // Ignored
             JavaSystem.currentTimeMillis();
@@ -284,6 +294,127 @@
  * proposed future state, such as the state after a refactoring.
  */
 abstract class AnalysisContext {
+
+  /**
+   * An empty list of contexts.
+   */
+  static const List<AnalysisContext> EMPTY_LIST = const <AnalysisContext>[];
+
+  /**
+   * Return the set of analysis options controlling the behavior of this context. Clients should not
+   * modify the returned set of options. The options should only be set by invoking the method
+   * [setAnalysisOptions].
+   *
+   * @return the set of analysis options controlling the behavior of this context
+   */
+  AnalysisOptions get analysisOptions;
+
+  /**
+   * Set the set of analysis options controlling the behavior of this context to the given options.
+   * Clients can safely assume that all necessary analysis results have been invalidated.
+   *
+   * @param options the set of analysis options that will control the behavior of this context
+   */
+  void set analysisOptions(AnalysisOptions options);
+
+  /**
+   * Set the order in which sources will be analyzed by [performAnalysisTask] to match the
+   * order of the sources in the given list. If a source that needs to be analyzed is not contained
+   * in the list, then it will be treated as if it were at the end of the list. If the list is empty
+   * (or `null`) then no sources will be given priority over other sources.
+   *
+   * Changes made to the list after this method returns will <b>not</b> be reflected in the priority
+   * order.
+   *
+   * @param sources the sources to be given priority over other sources
+   */
+  void set analysisPriorityOrder(List<Source> sources);
+
+  /**
+   * Return the set of declared variables used when computing constant values.
+   *
+   * @return the set of declared variables used when computing constant values
+   */
+  DeclaredVariables get declaredVariables;
+
+  /**
+   * Return an array containing all of the sources known to this context that represent HTML files.
+   * The contents of the array can be incomplete.
+   *
+   * @return the sources known to this context that represent HTML files
+   */
+  List<Source> get htmlSources;
+
+  /**
+   * Returns `true` if this context was disposed using [dispose].
+   *
+   * @return `true` if this context was disposed
+   */
+  bool get isDisposed;
+
+  /**
+   * Return an array containing all of the sources known to this context that represent the defining
+   * compilation unit of a library that can be run within a browser. The sources that are returned
+   * represent libraries that have a 'main' method and are either referenced by an HTML file or
+   * import, directly or indirectly, a client-only library. The contents of the array can be
+   * incomplete.
+   *
+   * @return the sources known to this context that represent the defining compilation unit of a
+   *         library that can be run within a browser
+   */
+  List<Source> get launchableClientLibrarySources;
+
+  /**
+   * Return an array containing all of the sources known to this context that represent the defining
+   * compilation unit of a library that can be run outside of a browser. The contents of the array
+   * can be incomplete.
+   *
+   * @return the sources known to this context that represent the defining compilation unit of a
+   *         library that can be run outside of a browser
+   */
+  List<Source> get launchableServerLibrarySources;
+
+  /**
+   * Return an array containing all of the sources known to this context that represent the defining
+   * compilation unit of a library. The contents of the array can be incomplete.
+   *
+   * @return the sources known to this context that represent the defining compilation unit of a
+   *         library
+   */
+  List<Source> get librarySources;
+
+  /**
+   * The stream that is notified when sources have been added or removed,
+   * or the source's content has changed.
+   */
+  Stream<SourcesChangedEvent> get onSourcesChanged;
+
+  /**
+   * Return an array containing all of the sources known to this context and their resolution state
+   * is not valid or flush. So, these sources are not safe to update during refactoring, because we
+   * may be don't know all the references in them.
+   *
+   * @return the sources known to this context and are not safe for refactoring
+   */
+  List<Source> get refactoringUnsafeSources;
+
+  /**
+   * Return the source factory used to create the sources that can be analyzed in this context.
+   *
+   * @return the source factory used to create the sources that can be analyzed in this context
+   */
+  SourceFactory get sourceFactory;
+
+  /**
+   * Set the source factory used to create the sources that can be analyzed in this context to the
+   * given source factory. Clients can safely assume that all analysis results have been
+   * invalidated.
+   *
+   * @param factory the source factory used to create the sources that can be analyzed in this
+   *          context
+   */
+  void set sourceFactory(SourceFactory factory);
+
   /**
    * Add the given listener to the list of objects that are to be notified when various analysis
    * results are produced in this context.
@@ -419,15 +550,6 @@
   bool exists(Source source);
 
   /**
-   * Return the set of analysis options controlling the behavior of this context. Clients should not
-   * modify the returned set of options. The options should only be set by invoking the method
-   * [setAnalysisOptions].
-   *
-   * @return the set of analysis options controlling the behavior of this context
-   */
-  AnalysisOptions get analysisOptions;
-
-  /**
    * Return the Angular application that contains the HTML file defined by the given source, or
    * `null` if the source does not represent an HTML file, the Angular application containing
    * the file has not yet been resolved, or the analysis of the HTML file failed for some reason.
@@ -447,7 +569,8 @@
    *          compilation unit
    * @return the element model corresponding to the compilation unit defined by the given source
    */
-  CompilationUnitElement getCompilationUnitElement(Source unitSource, Source librarySource);
+  CompilationUnitElement getCompilationUnitElement(Source unitSource,
+      Source librarySource);
 
   /**
    * Get the contents and timestamp of the given source.
@@ -462,13 +585,6 @@
   TimestampedData<String> getContents(Source source);
 
   /**
-   * Return the set of declared variables used when computing constant values.
-   *
-   * @return the set of declared variables used when computing constant values
-   */
-  DeclaredVariables get declaredVariables;
-
-  /**
    * Return the element referenced by the given location, or `null` if the element is not
    * immediately available or if there is no element with the given location. The latter condition
    * can occur, for example, if the location describes an element from a different context or if the
@@ -514,14 +630,6 @@
   List<Source> getHtmlFilesReferencing(Source source);
 
   /**
-   * Return an array containing all of the sources known to this context that represent HTML files.
-   * The contents of the array can be incomplete.
-   *
-   * @return the sources known to this context that represent HTML files
-   */
-  List<Source> get htmlSources;
-
-  /**
    * Return the kind of the given source, or `null` if the kind is not known to this context.
    *
    * @param source the source whose kind is to be returned
@@ -531,28 +639,6 @@
   SourceKind getKindOf(Source source);
 
   /**
-   * Return an array containing all of the sources known to this context that represent the defining
-   * compilation unit of a library that can be run within a browser. The sources that are returned
-   * represent libraries that have a 'main' method and are either referenced by an HTML file or
-   * import, directly or indirectly, a client-only library. The contents of the array can be
-   * incomplete.
-   *
-   * @return the sources known to this context that represent the defining compilation unit of a
-   *         library that can be run within a browser
-   */
-  List<Source> get launchableClientLibrarySources;
-
-  /**
-   * Return an array containing all of the sources known to this context that represent the defining
-   * compilation unit of a library that can be run outside of a browser. The contents of the array
-   * can be incomplete.
-   *
-   * @return the sources known to this context that represent the defining compilation unit of a
-   *         library that can be run outside of a browser
-   */
-  List<Source> get launchableServerLibrarySources;
-
-  /**
    * Return the sources for the defining compilation units of any libraries of which the given
    * source is a part. The array will normally contain a single library because most Dart sources
    * are only included in a single library, but it is possible to have a part that is contained in
@@ -596,15 +682,6 @@
   LibraryElement getLibraryElement(Source source);
 
   /**
-   * Return an array containing all of the sources known to this context that represent the defining
-   * compilation unit of a library. The contents of the array can be incomplete.
-   *
-   * @return the sources known to this context that represent the defining compilation unit of a
-   *         library
-   */
-  List<Source> get librarySources;
-
-  /**
    * Return the line information for the given source, or `null` if the line information is
    * not known. The line information is used to map offsets from the beginning of the source to line
    * and column pairs.
@@ -631,15 +708,6 @@
   int getModificationStamp(Source source);
 
   /**
-   * Return an array containing all of the sources known to this context and their resolution state
-   * is not valid or flush. So, these sources are not safe to update during refactoring, because we
-   * may be don't know all the references in them.
-   *
-   * @return the sources known to this context and are not safe for refactoring
-   */
-  List<Source> get refactoringUnsafeSources;
-
-  /**
    * Return a fully resolved AST for a single compilation unit within the given library, or
    * `null` if the resolved AST is not already computed.
    *
@@ -648,7 +716,8 @@
    * @return a fully resolved AST for the compilation unit
    * See [resolveCompilationUnit].
    */
-  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library);
+  CompilationUnit getResolvedCompilationUnit(Source unitSource,
+      LibraryElement library);
 
   /**
    * Return a fully resolved AST for a single compilation unit within the given library, or
@@ -660,7 +729,8 @@
    * @return a fully resolved AST for the compilation unit
    * See [resolveCompilationUnit].
    */
-  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource);
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource,
+      Source librarySource);
 
   /**
    * Return a fully resolved HTML unit, or `null` if the resolved unit is not already
@@ -673,13 +743,6 @@
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource);
 
   /**
-   * Return the source factory used to create the sources that can be analyzed in this context.
-   *
-   * @return the source factory used to create the sources that can be analyzed in this context
-   */
-  SourceFactory get sourceFactory;
-
-  /**
    * Return `true` if the given source is known to be the defining compilation unit of a
    * library that can be run on a client (references 'dart:html', either directly or indirectly).
    *
@@ -693,13 +756,6 @@
   bool isClientLibrary(Source librarySource);
 
   /**
-   * Returns `true` if this context was disposed using [dispose].
-   *
-   * @return `true` if this context was disposed
-   */
-  bool get isDisposed;
-
-  /**
    * Return `true` if the given source is known to be the defining compilation unit of a
    * library that can be run on the server (does not reference 'dart:html', either directly or
    * indirectly).
@@ -768,7 +824,8 @@
    * @throws AnalysisException if the analysis could not be performed
    * See [getResolvedCompilationUnit].
    */
-  CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library);
+  CompilationUnit resolveCompilationUnit(Source unitSource,
+      LibraryElement library);
 
   /**
    * Parse and resolve a single source within the given context to produce a fully resolved AST.
@@ -785,7 +842,8 @@
    * @throws AnalysisException if the analysis could not be performed
    * See [getResolvedCompilationUnit].
    */
-  CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource);
+  CompilationUnit resolveCompilationUnit2(Source unitSource,
+      Source librarySource);
 
   /**
    * Parse and resolve a single source within the given context to produce a fully resolved AST.
@@ -799,27 +857,6 @@
   ht.HtmlUnit resolveHtmlUnit(Source htmlSource);
 
   /**
-   * Set the set of analysis options controlling the behavior of this context to the given options.
-   * Clients can safely assume that all necessary analysis results have been invalidated.
-   *
-   * @param options the set of analysis options that will control the behavior of this context
-   */
-  void set analysisOptions(AnalysisOptions options);
-
-  /**
-   * Set the order in which sources will be analyzed by [performAnalysisTask] to match the
-   * order of the sources in the given list. If a source that needs to be analyzed is not contained
-   * in the list, then it will be treated as if it were at the end of the list. If the list is empty
-   * (or `null`) then no sources will be given priority over other sources.
-   *
-   * Changes made to the list after this method returns will <b>not</b> be reflected in the priority
-   * order.
-   *
-   * @param sources the sources to be given priority over other sources
-   */
-  void set analysisPriorityOrder(List<Source> sources);
-
-  /**
    * Set the contents of the given source to the given contents and mark the source as having
    * changed. The additional offset and length information is used by the context to determine what
    * reanalysis is necessary.
@@ -830,7 +867,8 @@
    * @param oldLength the number of characters in the original contents that were replaced
    * @param newLength the number of characters in the replacement text
    */
-  void setChangedContents(Source source, String contents, int offset, int oldLength, int newLength);
+  void setChangedContents(Source source, String contents, int offset,
+      int oldLength, int newLength);
 
   /**
    * Set the contents of the given source to the given contents and mark the source as having
@@ -841,16 +879,6 @@
    * @param contents the new contents of the source
    */
   void setContents(Source source, String contents);
-
-  /**
-   * Set the source factory used to create the sources that can be analyzed in this context to the
-   * given source factory. Clients can safely assume that all analysis results have been
-   * invalidated.
-   *
-   * @param factory the source factory used to create the sources that can be analyzed in this
-   *          context
-   */
-  void set sourceFactory(SourceFactory factory);
 }
 
 /**
@@ -932,17 +960,8 @@
    * A table mapping sources to the change notices that are waiting to be returned related to that
    * source.
    */
-  HashMap<Source, ChangeNoticeImpl> _pendingNotices = new HashMap<Source, ChangeNoticeImpl>();
-
-  /**
-   * The object used to synchronize access to all of the caches. The rules related to the use of
-   * this lock object are
-   * * no analysis work is done while holding the lock, and
-   * * no analysis results can be recorded unless we have obtained the lock and validated that the
-   * results are for the same version (modification time) of the source as our current cache
-   * content.
-   */
-  static Object _cacheLock = new Object();
+  HashMap<Source, ChangeNoticeImpl> _pendingNotices =
+      new HashMap<Source, ChangeNoticeImpl>();
 
   /**
    * The object used to record the results of performing an analysis task.
@@ -966,6 +985,11 @@
   Set<AngularApplication> _angularApplications = new Set();
 
   /**
+   * The controller for sending [SourcesChangedEvent]s.
+   */
+  StreamController<SourcesChangedEvent> _onSourcesChangedController;
+
+  /**
    * The listeners that are to be notified when various analysis results are produced in this
    * context.
    */
@@ -976,8 +1000,327 @@
    */
   AnalysisContextImpl() {
     _resultRecorder = new AnalysisContextImpl_AnalysisTaskResultRecorder(this);
-    _privatePartition = new UniversalCachePartition(this, AnalysisOptionsImpl.DEFAULT_CACHE_SIZE, new AnalysisContextImpl_ContextRetentionPolicy(this));
+    _privatePartition = new UniversalCachePartition(
+        this,
+        AnalysisOptionsImpl.DEFAULT_CACHE_SIZE,
+        new AnalysisContextImpl_ContextRetentionPolicy(this));
     _cache = createCacheFromSourceFactory(null);
+    _onSourcesChangedController =
+        new StreamController<SourcesChangedEvent>.broadcast();
+  }
+
+  @override
+  AnalysisOptions get analysisOptions => _options;
+
+  @override
+  void set analysisOptions(AnalysisOptions options) {
+    bool needsRecompute =
+        this._options.analyzeAngular != options.analyzeAngular ||
+        this._options.analyzeFunctionBodies != options.analyzeFunctionBodies ||
+        this._options.generateSdkErrors != options.generateSdkErrors ||
+        this._options.enableAsync != options.enableAsync ||
+        this._options.enableDeferredLoading != options.enableDeferredLoading ||
+        this._options.enableEnum != options.enableEnum ||
+        this._options.dart2jsHint != options.dart2jsHint ||
+        (this._options.hint && !options.hint) ||
+        this._options.preserveComments != options.preserveComments;
+    int cacheSize = options.cacheSize;
+    if (this._options.cacheSize != cacheSize) {
+      this._options.cacheSize = cacheSize;
+      //cache.setMaxCacheSize(cacheSize);
+      _privatePartition.maxCacheSize = cacheSize;
+      //
+      // Cap the size of the priority list to being less than the cache size.
+      // Failure to do so can result in an infinite loop in
+      // performAnalysisTask() because re-caching one AST structure
+      // can cause another priority source's AST structure to be flushed.
+      //
+      int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA;
+      if (_priorityOrder.length > maxPriorityOrderSize) {
+        List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize);
+        JavaSystem.arraycopy(
+            _priorityOrder,
+            0,
+            newPriorityOrder,
+            0,
+            maxPriorityOrderSize);
+        _priorityOrder = newPriorityOrder;
+      }
+    }
+    this._options.analyzeAngular = options.analyzeAngular;
+    this._options.analyzeFunctionBodies = options.analyzeFunctionBodies;
+    this._options.generateSdkErrors = options.generateSdkErrors;
+    this._options.enableAsync = options.enableAsync;
+    this._options.enableDeferredLoading = options.enableDeferredLoading;
+    this._options.enableEnum = options.enableEnum;
+    this._options.dart2jsHint = options.dart2jsHint;
+    this._options.hint = options.hint;
+    this._options.incremental = options.incremental;
+    this._options.preserveComments = options.preserveComments;
+    _generateSdkErrors = options.generateSdkErrors;
+    if (needsRecompute) {
+      _invalidateAllLocalResolutionInformation(false);
+    }
+  }
+
+  @override
+  void set analysisPriorityOrder(List<Source> sources) {
+    if (sources == null || sources.isEmpty) {
+      _priorityOrder = Source.EMPTY_ARRAY;
+    } else {
+      while (sources.remove(null)) {
+        // Nothing else to do.
+      }
+      if (sources.isEmpty) {
+        _priorityOrder = Source.EMPTY_ARRAY;
+      }
+      //
+      // Cap the size of the priority list to being less than the cache size.
+      // Failure to do so can result in an infinite loop in
+      // performAnalysisTask() because re-caching one AST structure
+      // can cause another priority source's AST structure to be flushed.
+      //
+      int count =
+          math.min(sources.length, _options.cacheSize - _PRIORITY_ORDER_SIZE_DELTA);
+      _priorityOrder = new List<Source>(count);
+      for (int i = 0; i < count; i++) {
+        _priorityOrder[i] = sources[i];
+      }
+    }
+  }
+
+  @override
+  DeclaredVariables get declaredVariables => _declaredVariables;
+
+  @override
+  List<Source> get htmlSources => _getSources(SourceKind.HTML);
+
+  @override
+  bool get isDisposed => _disposed;
+
+  @override
+  List<Source> get launchableClientLibrarySources {
+    // TODO(brianwilkerson) This needs to filter out libraries that do not
+    // reference dart:html, either directly or indirectly.
+    List<Source> sources = new List<Source>();
+    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+    while (iterator.moveNext()) {
+      Source source = iterator.key;
+      SourceEntry sourceEntry = iterator.value;
+      if (sourceEntry.kind == SourceKind.LIBRARY && !source.isInSystemLibrary) {
+//          DartEntry dartEntry = (DartEntry) sourceEntry;
+//          if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && dartEntry.getValue(DartEntry.IS_CLIENT)) {
+        sources.add(source);
+//          }
+      }
+    }
+    return sources;
+  }
+
+  @override
+  List<Source> get launchableServerLibrarySources {
+    // TODO(brianwilkerson) This needs to filter out libraries that reference
+    // dart:html, either directly or indirectly.
+    List<Source> sources = new List<Source>();
+    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+    while (iterator.moveNext()) {
+      Source source = iterator.key;
+      SourceEntry sourceEntry = iterator.value;
+      if (sourceEntry.kind == SourceKind.LIBRARY && !source.isInSystemLibrary) {
+//          DartEntry dartEntry = (DartEntry) sourceEntry;
+//          if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && !dartEntry.getValue(DartEntry.IS_CLIENT)) {
+        sources.add(source);
+//          }
+      }
+    }
+    return sources;
+  }
+
+  @override
+  List<Source> get librarySources => _getSources(SourceKind.LIBRARY);
+
+  /**
+   * Look through the cache for a task that needs to be performed. Return the task that was found,
+   * or `null` if there is no more work to be done.
+   *
+   * @return the next task that needs to be performed
+   */
+  AnalysisTask get nextAnalysisTask {
+    bool hintsEnabled = _options.hint;
+    bool hasBlockedTask = false;
+    //
+    // Look for incremental analysis
+    //
+    if (_incrementalAnalysisCache != null &&
+        _incrementalAnalysisCache.hasWork) {
+      AnalysisTask task =
+          new IncrementalAnalysisTask(this, _incrementalAnalysisCache);
+      _incrementalAnalysisCache = null;
+      return task;
+    }
+    //
+    // Look for a priority source that needs to be analyzed.
+    //
+    int priorityCount = _priorityOrder.length;
+    for (int i = 0; i < priorityCount; i++) {
+      Source source = _priorityOrder[i];
+      AnalysisContextImpl_TaskData taskData =
+          _getNextAnalysisTaskForSource(source, _cache.get(source), true, hintsEnabled);
+      AnalysisTask task = taskData.task;
+      if (task != null) {
+        return task;
+      } else if (taskData.isBlocked) {
+        hasBlockedTask = true;
+      }
+    }
+    if (_neededForResolution != null) {
+      List<Source> sourcesToRemove = new List<Source>();
+      for (Source source in _neededForResolution) {
+        SourceEntry sourceEntry = _cache.get(source);
+        if (sourceEntry is DartEntry) {
+          DartEntry dartEntry = sourceEntry;
+          if (!dartEntry.hasResolvableCompilationUnit) {
+            if (dartEntry.getState(DartEntry.PARSED_UNIT) == CacheState.ERROR) {
+              sourcesToRemove.add(source);
+            } else {
+              AnalysisContextImpl_TaskData taskData =
+                  _createParseDartTask(source, dartEntry);
+              AnalysisTask task = taskData.task;
+              if (task != null) {
+                return task;
+              } else if (taskData.isBlocked) {
+                hasBlockedTask = true;
+              }
+            }
+          }
+        }
+      }
+      int count = sourcesToRemove.length;
+      for (int i = 0; i < count; i++) {
+        _neededForResolution.remove(sourcesToRemove[i]);
+      }
+    }
+    //
+    // Look for a non-priority source that needs to be analyzed.
+    //
+    List<Source> sourcesToRemove = new List<Source>();
+    WorkManager_WorkIterator sources = _workManager.iterator();
+    try {
+      while (sources.hasNext) {
+        Source source = sources.next();
+        AnalysisContextImpl_TaskData taskData =
+            _getNextAnalysisTaskForSource(source, _cache.get(source), false, hintsEnabled);
+        AnalysisTask task = taskData.task;
+        if (task != null) {
+          return task;
+        } else if (taskData.isBlocked) {
+          hasBlockedTask = true;
+        } else {
+          sourcesToRemove.add(source);
+        }
+      }
+    } finally {
+      int count = sourcesToRemove.length;
+      for (int i = 0; i < count; i++) {
+        _workManager.remove(sourcesToRemove[i]);
+      }
+    }
+    if (hasBlockedTask) {
+      // All of the analysis work is blocked waiting for an asynchronous task
+      // to complete.
+      return WaitForAsyncTask.instance;
+    }
+    return null;
+  }
+
+  @override
+  Stream<SourcesChangedEvent> get onSourcesChanged =>
+      _onSourcesChangedController.stream;
+
+  @override
+  List<Source> get prioritySources => _priorityOrder;
+
+  @override
+  List<Source> get refactoringUnsafeSources {
+    List<Source> sources = new List<Source>();
+    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+    while (iterator.moveNext()) {
+      SourceEntry sourceEntry = iterator.value;
+      if (sourceEntry is DartEntry) {
+        Source source = iterator.key;
+        if (!source.isInSystemLibrary && !sourceEntry.isRefactoringSafe) {
+          sources.add(source);
+        }
+      }
+    }
+    return sources;
+  }
+
+  @override
+  SourceFactory get sourceFactory => _sourceFactory;
+
+  @override
+  void set sourceFactory(SourceFactory factory) {
+    if (identical(_sourceFactory, factory)) {
+      return;
+    } else if (factory.context != null) {
+      throw new IllegalStateException(
+          "Source factories cannot be shared between contexts");
+    }
+    if (_sourceFactory != null) {
+      _sourceFactory.context = null;
+    }
+    factory.context = this;
+    _sourceFactory = factory;
+    _coreLibrarySource = _sourceFactory.forUri(DartSdk.DART_CORE);
+    _cache = createCacheFromSourceFactory(factory);
+    _invalidateAllLocalResolutionInformation(true);
+  }
+
+  /**
+   * Return a list of the sources that would be processed by [performAnalysisTask]. This
+   * method duplicates, and must therefore be kept in sync with, [getNextAnalysisTask].
+   * This method is intended to be used for testing purposes only.
+   *
+   * @return a list of the sources that would be processed by [performAnalysisTask]
+   */
+  List<Source> get sourcesNeedingProcessing {
+    HashSet<Source> sources = new HashSet<Source>();
+    bool hintsEnabled = _options.hint;
+    //
+    // Look for priority sources that need to be analyzed.
+    //
+    for (Source source in _priorityOrder) {
+      _getSourcesNeedingProcessing(
+          source,
+          _cache.get(source),
+          true,
+          hintsEnabled,
+          sources);
+    }
+    //
+    // Look for non-priority sources that need to be analyzed.
+    //
+    WorkManager_WorkIterator iterator = _workManager.iterator();
+    while (iterator.hasNext) {
+      Source source = iterator.next();
+      _getSourcesNeedingProcessing(
+          source,
+          _cache.get(source),
+          false,
+          hintsEnabled,
+          sources);
+    }
+    return new List<Source>.from(sources);
+  }
+
+  @override
+  AnalysisContextStatistics get statistics {
+    AnalysisContextStatisticsImpl statistics =
+        new AnalysisContextStatisticsImpl();
+    visitCacheItems(statistics._internalPutCacheItem);
+    statistics.partitionData = _cache.partitionData;
+    return statistics;
   }
 
   IncrementalAnalysisCache get test_incrementalAnalysisCache {
@@ -991,6 +1334,19 @@
   List<Source> get test_priorityOrder => _priorityOrder;
 
   @override
+  TypeProvider get typeProvider {
+    Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
+    if (coreSource == null) {
+      throw new AnalysisException("Could not create a source for dart:core");
+    }
+    LibraryElement coreElement = computeLibraryElement(coreSource);
+    if (coreElement == null) {
+      throw new AnalysisException("Could not create an element for dart:core");
+    }
+    return new TypeProviderImpl(coreElement);
+  }
+
+  @override
   void addListener(AnalysisListener listener) {
     if (!_listeners.contains(listener)) {
       _listeners.add(listener);
@@ -999,8 +1355,9 @@
 
   @override
   void addSourceInfo(Source source, SourceEntry info) {
-    // This implementation assumes that the access to the cache does not need to be synchronized
-    // because no other object can have access to this context while this method is being invoked.
+    // This implementation assumes that the access to the cache does not need to
+    // be synchronized because no other object can have access to this context
+    // while this method is being invoked.
     _cache.put(source, info);
   }
 
@@ -1025,7 +1382,8 @@
     //
     // First, compute the list of sources that have been removed.
     //
-    List<Source> removedSources = new List<Source>.from(changeSet.removedSources);
+    List<Source> removedSources =
+        new List<Source>.from(changeSet.removedSources);
     for (SourceContainer container in changeSet.removedContainers) {
       _addSourcesInContainer(removedSources, container);
     }
@@ -1040,17 +1398,19 @@
     }
     for (Source source in changeSet.changedSources) {
       if (_contentCache.getContents(source) != null) {
-        // This source is overridden in the content cache, so the change will have no effect.
-        // Just ignore it to avoid wasting time doing re-analysis.
+        // This source is overridden in the content cache, so the change will
+        // have no effect. Just ignore it to avoid wasting time doing
+        // re-analysis.
         continue;
       }
       _sourceChanged(source);
     }
     changeSet.changedContents.forEach((Source key, String value) {
-      setContents(key, value);
+      _contentsChanged(key, value);
     });
-    changeSet.changedRanges.forEach((Source source, ChangeSet_ContentChange change) {
-      setChangedContents(
+    changeSet.changedRanges.forEach(
+        (Source source, ChangeSet_ContentChange change) {
+      _contentRangeChanged(
           source,
           change.contents,
           change.offset,
@@ -1064,17 +1424,19 @@
       _sourceRemoved(source);
     }
     if (addedDartSource) {
-      // TODO(brianwilkerson) This is hugely inefficient, but we need to re-analyze any libraries
-      // that might have been referencing the not-yet-existing source that was just added. Longer
-      // term we need to keep track of which libraries are referencing non-existing sources and
+      // TODO(brianwilkerson) This is hugely inefficient, but we need to
+      // re-analyze any libraries that might have been referencing the
+      // not-yet-existing source that was just added. Longer term we need to
+      // keep track of which libraries are referencing non-existing sources and
       // only re-analyze those libraries.
-      //        logInformation("Added Dart sources, invalidating all resolution information");
+//      logInformation("Added Dart sources, invalidating all resolution information");
       List<Source> sourcesToInvalidate = new List<Source>();
       MapIterator<Source, SourceEntry> iterator = _cache.iterator();
       while (iterator.moveNext()) {
         Source source = iterator.key;
         SourceEntry sourceEntry = iterator.value;
-        if (!source.isInSystemLibrary && (sourceEntry is DartEntry || sourceEntry is HtmlEntry)) {
+        if (!source.isInSystemLibrary &&
+            (sourceEntry is DartEntry || sourceEntry is HtmlEntry)) {
           sourcesToInvalidate.add(source);
         }
       }
@@ -1091,6 +1453,7 @@
         }
       }
     }
+    _onSourcesChangedController.add(new SourcesChangedEvent(changeSet));
   }
 
   @override
@@ -1137,27 +1500,55 @@
       List<AnalysisError> errors = new List<AnalysisError>();
       try {
         DartEntry dartEntry = sourceEntry;
-        ListUtilities.addAll(errors, _getDartScanData(source, dartEntry, DartEntry.SCAN_ERRORS));
+        ListUtilities.addAll(
+            errors,
+            _getDartScanData(source, dartEntry, DartEntry.SCAN_ERRORS));
         dartEntry = _getReadableDartEntry(source);
-        ListUtilities.addAll(errors, _getDartParseData(source, dartEntry, DartEntry.PARSE_ERRORS));
+        ListUtilities.addAll(
+            errors,
+            _getDartParseData(source, dartEntry, DartEntry.PARSE_ERRORS));
         dartEntry = _getReadableDartEntry(source);
         if (dartEntry.getValue(DartEntry.SOURCE_KIND) == SourceKind.LIBRARY) {
-          ListUtilities.addAll(errors, _getDartResolutionData(source, source, dartEntry, DartEntry.RESOLUTION_ERRORS));
+          ListUtilities.addAll(
+              errors,
+              _getDartResolutionData(source, source, dartEntry, DartEntry.RESOLUTION_ERRORS));
           dartEntry = _getReadableDartEntry(source);
-          ListUtilities.addAll(errors, _getDartVerificationData(source, source, dartEntry, DartEntry.VERIFICATION_ERRORS));
+          ListUtilities.addAll(
+              errors,
+              _getDartVerificationData(
+                  source,
+                  source,
+                  dartEntry,
+                  DartEntry.VERIFICATION_ERRORS));
           if (enableHints) {
             dartEntry = _getReadableDartEntry(source);
-            ListUtilities.addAll(errors, _getDartHintData(source, source, dartEntry, DartEntry.HINTS));
+            ListUtilities.addAll(
+                errors,
+                _getDartHintData(source, source, dartEntry, DartEntry.HINTS));
           }
         } else {
           List<Source> libraries = getLibrariesContaining(source);
           for (Source librarySource in libraries) {
-            ListUtilities.addAll(errors, _getDartResolutionData(source, librarySource, dartEntry, DartEntry.RESOLUTION_ERRORS));
+            ListUtilities.addAll(
+                errors,
+                _getDartResolutionData(
+                    source,
+                    librarySource,
+                    dartEntry,
+                    DartEntry.RESOLUTION_ERRORS));
             dartEntry = _getReadableDartEntry(source);
-            ListUtilities.addAll(errors, _getDartVerificationData(source, librarySource, dartEntry, DartEntry.VERIFICATION_ERRORS));
+            ListUtilities.addAll(
+                errors,
+                _getDartVerificationData(
+                    source,
+                    librarySource,
+                    dartEntry,
+                    DartEntry.VERIFICATION_ERRORS));
             if (enableHints) {
               dartEntry = _getReadableDartEntry(source);
-              ListUtilities.addAll(errors, _getDartHintData(source, librarySource, dartEntry, DartEntry.HINTS));
+              ListUtilities.addAll(
+                  errors,
+                  _getDartHintData(source, librarySource, dartEntry, DartEntry.HINTS));
             }
           }
         }
@@ -1173,7 +1564,10 @@
     } else if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       try {
-        return _getHtmlResolutionData2(source, htmlEntry, HtmlEntry.RESOLUTION_ERRORS);
+        return _getHtmlResolutionData2(
+            source,
+            htmlEntry,
+            HtmlEntry.RESOLUTION_ERRORS);
       } on ObsoleteSourceAnalysisException catch (exception, stackTrace) {
         AnalysisEngine.instance.logger.logInformation(
             "Could not compute errors",
@@ -1184,13 +1578,16 @@
   }
 
   @override
-  List<Source> computeExportedLibraries(Source source) => _getDartParseData2(source, DartEntry.EXPORTED_LIBRARIES, Source.EMPTY_ARRAY);
+  List<Source> computeExportedLibraries(Source source) =>
+      _getDartParseData2(source, DartEntry.EXPORTED_LIBRARIES, Source.EMPTY_ARRAY);
 
   @override
-  HtmlElement computeHtmlElement(Source source) => _getHtmlResolutionData(source, HtmlEntry.ELEMENT, null);
+  HtmlElement computeHtmlElement(Source source) =>
+      _getHtmlResolutionData(source, HtmlEntry.ELEMENT, null);
 
   @override
-  List<Source> computeImportedLibraries(Source source) => _getDartParseData2(source, DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
+  List<Source> computeImportedLibraries(Source source) =>
+      _getDartParseData2(source, DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
 
   @override
   SourceKind computeKindOf(Source source) {
@@ -1208,7 +1605,8 @@
   }
 
   @override
-  LibraryElement computeLibraryElement(Source source) => _getDartResolutionData2(source, source, DartEntry.ELEMENT, null);
+  LibraryElement computeLibraryElement(Source source) =>
+      _getDartResolutionData2(source, source, DartEntry.ELEMENT, null);
 
   @override
   LineInfo computeLineInfo(Source source) {
@@ -1231,16 +1629,39 @@
   CompilationUnit computeResolvableCompilationUnit(Source source) {
     DartEntry dartEntry = _getReadableDartEntry(source);
     if (dartEntry == null) {
-      throw new AnalysisException("computeResolvableCompilationUnit for non-Dart: ${source.fullName}");
+      throw new AnalysisException(
+          "computeResolvableCompilationUnit for non-Dart: ${source.fullName}");
     }
     dartEntry = _cacheDartParseData(source, dartEntry, DartEntry.PARSED_UNIT);
     CompilationUnit unit = dartEntry.resolvableCompilationUnit;
     if (unit == null) {
-      throw new AnalysisException("Internal error: computeResolvableCompilationUnit could not parse ${source.fullName}", new CaughtException(dartEntry.exception, null));
+      throw new AnalysisException(
+          "Internal error: computeResolvableCompilationUnit could not parse ${source.fullName}",
+          new CaughtException(dartEntry.exception, null));
     }
     return unit;
   }
 
+  /**
+   * Create an analysis cache based on the given source factory.
+   *
+   * @param factory the source factory containing the information needed to create the cache
+   * @return the cache that was created
+   */
+  AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
+    if (factory == null) {
+      return new AnalysisCache(<CachePartition>[_privatePartition]);
+    }
+    DartSdk sdk = factory.dartSdk;
+    if (sdk == null) {
+      return new AnalysisCache(<CachePartition>[_privatePartition]);
+    }
+    return new AnalysisCache(
+        <CachePartition>[
+            AnalysisEngine.instance.partitionManager.forSdk(sdk),
+            _privatePartition]);
+  }
+
   @override
   void dispose() {
     _disposed = true;
@@ -1258,14 +1679,12 @@
   }
 
   @override
-  AnalysisOptions get analysisOptions => _options;
-
-  @override
   AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(htmlSource);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
     if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
-      AngularApplication application = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
+      AngularApplication application =
+          htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
       if (application != null) {
         return application;
       }
@@ -1275,11 +1694,13 @@
   }
 
   @override
-  CompilationUnitElement getCompilationUnitElement(Source unitSource, Source librarySource) {
+  CompilationUnitElement getCompilationUnitElement(Source unitSource,
+      Source librarySource) {
     LibraryElement libraryElement = getLibraryElement(librarySource);
     if (libraryElement != null) {
       // try defining unit
-      CompilationUnitElement definingUnit = libraryElement.definingCompilationUnit;
+      CompilationUnitElement definingUnit =
+          libraryElement.definingCompilationUnit;
       if (definingUnit.source == unitSource) {
         return definingUnit;
       }
@@ -1297,7 +1718,9 @@
   TimestampedData<String> getContents(Source source) {
     String contents = _contentCache.getContents(source);
     if (contents != null) {
-      return new TimestampedData<String>(_contentCache.getModificationStamp(source), contents);
+      return new TimestampedData<String>(
+          _contentCache.getModificationStamp(source),
+          contents);
     }
     return source.contents;
   }
@@ -1309,9 +1732,6 @@
   }
 
   @override
-  DeclaredVariables get declaredVariables => _declaredVariables;
-
-  @override
   Element getElement(ElementLocation location) {
     // TODO(brianwilkerson) This should not be a "get" method.
     try {
@@ -1338,20 +1758,24 @@
 
   @override
   AnalysisErrorInfo getErrors(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
-      return new AnalysisErrorInfoImpl(dartEntry.allErrors, dartEntry.getValue(SourceEntry.LINE_INFO));
+      return new AnalysisErrorInfoImpl(
+          dartEntry.allErrors,
+          dartEntry.getValue(SourceEntry.LINE_INFO));
     } else if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
-      return new AnalysisErrorInfoImpl(htmlEntry.allErrors, htmlEntry.getValue(SourceEntry.LINE_INFO));
+      return new AnalysisErrorInfoImpl(
+          htmlEntry.allErrors,
+          htmlEntry.getValue(SourceEntry.LINE_INFO));
     }
     return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null);
   }
 
   @override
   HtmlElement getHtmlElement(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry is HtmlEntry) {
       return sourceEntry.getValue(HtmlEntry.ELEMENT);
     }
@@ -1372,7 +1796,8 @@
         while (partIterator.moveNext()) {
           SourceEntry sourceEntry = partIterator.value;
           if (sourceEntry.kind == SourceKind.HTML) {
-            List<Source> referencedLibraries = (sourceEntry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
+            List<Source> referencedLibraries =
+                (sourceEntry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
             if (_containsAny(referencedLibraries, librarySources)) {
               htmlSources.add(partIterator.key);
             }
@@ -1383,7 +1808,8 @@
         while (iterator.moveNext()) {
           SourceEntry sourceEntry = iterator.value;
           if (sourceEntry.kind == SourceKind.HTML) {
-            List<Source> referencedLibraries = (sourceEntry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
+            List<Source> referencedLibraries =
+                (sourceEntry as HtmlEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
             if (_contains(referencedLibraries, source)) {
               htmlSources.add(iterator.key);
             }
@@ -1399,11 +1825,8 @@
   }
 
   @override
-  List<Source> get htmlSources => _getSources(SourceKind.HTML);
-
-  @override
   SourceKind getKindOf(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry == null) {
       return SourceKind.UNKNOWN;
     }
@@ -1411,46 +1834,8 @@
   }
 
   @override
-  List<Source> get launchableClientLibrarySources {
-    // TODO(brianwilkerson) This needs to filter out libraries that do not reference dart:html,
-    // either directly or indirectly.
-    List<Source> sources = new List<Source>();
-    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
-    while (iterator.moveNext()) {
-      Source source = iterator.key;
-      SourceEntry sourceEntry = iterator.value;
-      if (sourceEntry.kind == SourceKind.LIBRARY && !source.isInSystemLibrary) {
-        //          DartEntry dartEntry = (DartEntry) sourceEntry;
-        //          if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && dartEntry.getValue(DartEntry.IS_CLIENT)) {
-        sources.add(source);
-        //          }
-      }
-    }
-    return sources;
-  }
-
-  @override
-  List<Source> get launchableServerLibrarySources {
-    // TODO(brianwilkerson) This needs to filter out libraries that reference dart:html, either
-    // directly or indirectly.
-    List<Source> sources = new List<Source>();
-    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
-    while (iterator.moveNext()) {
-      Source source = iterator.key;
-      SourceEntry sourceEntry = iterator.value;
-      if (sourceEntry.kind == SourceKind.LIBRARY && !source.isInSystemLibrary) {
-        //          DartEntry dartEntry = (DartEntry) sourceEntry;
-        //          if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && !dartEntry.getValue(DartEntry.IS_CLIENT)) {
-        sources.add(source);
-        //          }
-      }
-    }
-    return sources;
-  }
-
-  @override
   List<Source> getLibrariesContaining(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry is DartEntry) {
       return sourceEntry.containingLibraries;
     }
@@ -1464,10 +1849,14 @@
     while (iterator.moveNext()) {
       SourceEntry sourceEntry = iterator.value;
       if (sourceEntry.kind == SourceKind.LIBRARY) {
-        if (_contains((sourceEntry as DartEntry).getValue(DartEntry.EXPORTED_LIBRARIES), librarySource)) {
+        if (_contains(
+            (sourceEntry as DartEntry).getValue(DartEntry.EXPORTED_LIBRARIES),
+            librarySource)) {
           dependentLibraries.add(iterator.key);
         }
-        if (_contains((sourceEntry as DartEntry).getValue(DartEntry.IMPORTED_LIBRARIES), librarySource)) {
+        if (_contains(
+            (sourceEntry as DartEntry).getValue(DartEntry.IMPORTED_LIBRARIES),
+            librarySource)) {
           dependentLibraries.add(iterator.key);
         }
       }
@@ -1480,7 +1869,7 @@
 
   @override
   List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(htmlSource);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
     if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       return htmlEntry.getValue(HtmlEntry.REFERENCED_LIBRARIES);
@@ -1490,7 +1879,7 @@
 
   @override
   LibraryElement getLibraryElement(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry is DartEntry) {
       return sourceEntry.getValue(DartEntry.ELEMENT);
     }
@@ -1498,11 +1887,8 @@
   }
 
   @override
-  List<Source> get librarySources => _getSources(SourceKind.LIBRARY);
-
-  @override
   LineInfo getLineInfo(Source source) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
     if (sourceEntry != null) {
       return sourceEntry.getValue(SourceEntry.LINE_INFO);
     }
@@ -1519,12 +1905,9 @@
   }
 
   @override
-  List<Source> get prioritySources => _priorityOrder;
-
-  @override
   Namespace getPublicNamespace(LibraryElement library) {
-    // TODO(brianwilkerson) Rename this to not start with 'get'. Note that this is not part of the
-    // API of the interface.
+    // TODO(brianwilkerson) Rename this to not start with 'get'.
+    // Note that this is not part of the API of the interface.
     Source source = library.definingCompilationUnit.source;
     DartEntry dartEntry = _getReadableDartEntry(source);
     if (dartEntry == null) {
@@ -1552,24 +1935,18 @@
     return namespace;
   }
 
-  @override
-  List<Source> get refactoringUnsafeSources {
-    List<Source> sources = new List<Source>();
-    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
-    while (iterator.moveNext()) {
-      SourceEntry sourceEntry = iterator.value;
-      if (sourceEntry is DartEntry) {
-        Source source = iterator.key;
-        if (!source.isInSystemLibrary && !sourceEntry.isRefactoringSafe) {
-          sources.add(source);
-        }
-      }
-    }
-    return sources;
-  }
+  /**
+   * Return the cache entry associated with the given source, or `null` if there is no entry
+   * associated with the source.
+   *
+   * @param source the source for which a cache entry is being sought
+   * @return the source cache entry associated with the given source
+   */
+  SourceEntry getReadableSourceEntryOrNull(Source source) => _cache.get(source);
 
   @override
-  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
+  CompilationUnit getResolvedCompilationUnit(Source unitSource,
+      LibraryElement library) {
     if (library == null) {
       return null;
     }
@@ -1577,17 +1954,20 @@
   }
 
   @override
-  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(unitSource);
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource,
+      Source librarySource) {
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(unitSource);
     if (sourceEntry is DartEntry) {
-      return sourceEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+      return sourceEntry.getValueInLibrary(
+          DartEntry.RESOLVED_UNIT,
+          librarySource);
     }
     return null;
   }
 
   @override
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
-    SourceEntry sourceEntry = _getReadableSourceEntryOrNull(htmlSource);
+    SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
     if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       return htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT);
@@ -1596,170 +1976,34 @@
   }
 
   @override
-  SourceFactory get sourceFactory => _sourceFactory;
-
-  /**
-   * Return a list of the sources that would be processed by [performAnalysisTask]. This
-   * method duplicates, and must therefore be kept in sync with, [getNextAnalysisTask].
-   * This method is intended to be used for testing purposes only.
-   *
-   * @return a list of the sources that would be processed by [performAnalysisTask]
-   */
-  List<Source> get sourcesNeedingProcessing {
-    HashSet<Source> sources = new HashSet<Source>();
-    bool hintsEnabled = _options.hint;
-    //
-    // Look for priority sources that need to be analyzed.
-    //
-    for (Source source in _priorityOrder) {
-      _getSourcesNeedingProcessing(source, _cache.get(source), true, hintsEnabled, sources);
-    }
-    //
-    // Look for non-priority sources that need to be analyzed.
-    //
-    WorkManager_WorkIterator iterator = _workManager.iterator();
-    while (iterator.hasNext) {
-      Source source = iterator.next();
-      _getSourcesNeedingProcessing(source, _cache.get(source), false, hintsEnabled, sources);
-    }
-    return new List<Source>.from(sources);
-  }
-
-  @override
-  void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
-                                     DataDescriptor rowDesc,
-                                     CacheState state)) {
-    void handleCacheItem(Source source, SourceEntry dartEntry,
-                         DataDescriptor descriptor) {
-      callback(source, dartEntry, descriptor, dartEntry.getState(descriptor));
-    }
-    void handleCacheItemInLibrary(DartEntry dartEntry, Source librarySource,
-                                  DataDescriptor descriptor) {
-      callback(librarySource, dartEntry, descriptor,
-          dartEntry.getStateInLibrary(descriptor, librarySource));
-    }
-
-    bool hintsEnabled = _options.hint;
-    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
-    while (iterator.moveNext()) {
-      Source source = iterator.key;
-      SourceEntry sourceEntry = iterator.value;
-      if (sourceEntry is DartEntry) {
-        DartEntry dartEntry = sourceEntry;
-        SourceKind kind = dartEntry.getValue(DartEntry.SOURCE_KIND);
-        // get library independent values
-        handleCacheItem(source, dartEntry, SourceEntry.CONTENT);
-        handleCacheItem(source, dartEntry, SourceEntry.LINE_INFO);
-        // The list of containing libraries is always valid, so the state isn't
-        // interesting.
-//        handleCacheItem(source, dartEntry, DartEntry.CONTAINING_LIBRARIES);
-        handleCacheItem(source, dartEntry, DartEntry.PARSE_ERRORS);
-        handleCacheItem(source, dartEntry, DartEntry.PARSED_UNIT);
-        handleCacheItem(source, dartEntry, DartEntry.SCAN_ERRORS);
-        handleCacheItem(source, dartEntry, DartEntry.SOURCE_KIND);
-        handleCacheItem(source, dartEntry, DartEntry.TOKEN_STREAM);
-        if (kind == SourceKind.LIBRARY) {
-          handleCacheItem(source, dartEntry, DartEntry.ELEMENT);
-          handleCacheItem(source, dartEntry, DartEntry.EXPORTED_LIBRARIES);
-          handleCacheItem(source, dartEntry, DartEntry.IMPORTED_LIBRARIES);
-          handleCacheItem(source, dartEntry, DartEntry.INCLUDED_PARTS);
-          handleCacheItem(source, dartEntry, DartEntry.IS_CLIENT);
-          handleCacheItem(source, dartEntry, DartEntry.IS_LAUNCHABLE);
-          // The public namespace isn't computed by performAnalysisTask()
-          // and therefore isn't interesting.
-          //handleCacheItem(key, dartEntry, DartEntry.PUBLIC_NAMESPACE);
-        }
-        // get library-specific values
-        List<Source> librarySources = getLibrariesContaining(source);
-        for (Source librarySource in librarySources) {
-          // These values are not currently being computed, so their state is
-          // not interesting.
-//          handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.ANGULAR_ERRORS);
-//          handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.BUILT_ELEMENT);
-//          handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.BUILT_UNIT);
-          handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.RESOLUTION_ERRORS);
-          handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.RESOLVED_UNIT);
-          if (_generateSdkErrors || !source.isInSystemLibrary) {
-            handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.VERIFICATION_ERRORS);
-            if (hintsEnabled) {
-              handleCacheItemInLibrary(dartEntry, librarySource, DartEntry.HINTS);
-            }
-          }
-        }
-      } else if (sourceEntry is HtmlEntry) {
-        HtmlEntry htmlEntry = sourceEntry;
-        handleCacheItem(source, htmlEntry, SourceEntry.CONTENT);
-        handleCacheItem(source, htmlEntry, SourceEntry.LINE_INFO);
-        // These values are not currently being computed, so their state is
-        // not interesting.
-//        handleCacheItem(source, htmlEntry, HtmlEntry.ANGULAR_APPLICATION);
-//        handleCacheItem(source, htmlEntry, HtmlEntry.ANGULAR_COMPONENT);
-//        handleCacheItem(source, htmlEntry, HtmlEntry.ANGULAR_ENTRY);
-//        handleCacheItem(source, htmlEntry, HtmlEntry.ANGULAR_ERRORS);
-        handleCacheItem(source, htmlEntry, HtmlEntry.ELEMENT);
-        handleCacheItem(source, htmlEntry, HtmlEntry.PARSE_ERRORS);
-        handleCacheItem(source, htmlEntry, HtmlEntry.PARSED_UNIT);
-        // These values are not currently being computed, so their state is
-        // not interesting.
-//        handleCacheItem(source, htmlEntry, HtmlEntry.POLYMER_BUILD_ERRORS);
-//        handleCacheItem(source, htmlEntry, HtmlEntry.POLYMER_RESOLUTION_ERRORS);
-        handleCacheItem(source, htmlEntry, HtmlEntry.RESOLUTION_ERRORS);
-        handleCacheItem(source, htmlEntry, HtmlEntry.RESOLVED_UNIT);
-        // We are not currently recording any hints related to HTML.
-//        handleCacheItem(key, htmlEntry, HtmlEntry.HINTS);
-      }
-    }
-  }
-
-  @override
-  AnalysisContextStatistics get statistics {
-    AnalysisContextStatisticsImpl statistics = new AnalysisContextStatisticsImpl();
-    visitCacheItems(statistics._internalPutCacheItem);
-    statistics.partitionData = _cache.partitionData;
-    return statistics;
-  }
-
-  @override
-  TypeProvider get typeProvider {
-    Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
-    if (coreSource == null) {
-      throw new AnalysisException("Could not create a source for dart:core");
-    }
-    LibraryElement coreElement = computeLibraryElement(coreSource);
-    if (coreElement == null) {
-      throw new AnalysisException("Could not create an element for dart:core");
-    }
-    return new TypeProviderImpl(coreElement);
-  }
-
-  @override
   bool isClientLibrary(Source librarySource) {
     SourceEntry sourceEntry = _getReadableSourceEntry(librarySource);
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
-      return dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
+      return dartEntry.getValue(DartEntry.IS_CLIENT) &&
+          dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
     }
     return false;
   }
 
   @override
-  bool get isDisposed => _disposed;
-
-  @override
   bool isServerLibrary(Source librarySource) {
     SourceEntry sourceEntry = _getReadableSourceEntry(librarySource);
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
-      return !dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
+      return !dartEntry.getValue(DartEntry.IS_CLIENT) &&
+          dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
     }
     return false;
   }
 
   @override
-  CompilationUnit parseCompilationUnit(Source source) => _getDartParseData2(source, DartEntry.PARSED_UNIT, null);
+  CompilationUnit parseCompilationUnit(Source source) =>
+      _getDartParseData2(source, DartEntry.PARSED_UNIT, null);
 
   @override
-  ht.HtmlUnit parseHtmlUnit(Source source) => _getHtmlParseData(source, HtmlEntry.PARSED_UNIT, null);
+  ht.HtmlUnit parseHtmlUnit(Source source) =>
+      _getHtmlParseData(source, HtmlEntry.PARSED_UNIT, null);
 
   @override
   AnalysisResult performAnalysisTask() {
@@ -1773,7 +2017,11 @@
       task = nextAnalysisTask;
     }
     if (task == null) {
-      return new AnalysisResult(_getChangeNotices(true), getEnd - getStart, null, -1);
+      return new AnalysisResult(
+          _getChangeNotices(true),
+          getEnd - getStart,
+          null,
+          -1);
     }
     String taskDescription = task.toString();
     _notifyAboutToPerformTask(taskDescription);
@@ -1800,9 +2048,10 @@
     for (int i = 0; i < noticeCount; i++) {
       ChangeNotice notice = notices[i];
       Source source = notice.source;
-      // TODO(brianwilkerson) Figure out whether the compilation unit is always resolved, or whether
-      // we need to decide whether to invoke the "parsed" or "resolved" method. This might be better
-      // done when recording task results in order to reduce the chance of errors.
+      // TODO(brianwilkerson) Figure out whether the compilation unit is always
+      // resolved, or whether we need to decide whether to invoke the "parsed"
+      // or "resolved" method. This might be better done when recording task
+      // results in order to reduce the chance of errors.
       //      if (notice.getCompilationUnit() != null) {
       //        notifyResolvedDart(source, notice.getCompilationUnit());
       //      } else if (notice.getHtmlUnit() != null) {
@@ -1810,7 +2059,11 @@
       //      }
       _notifyErrors(source, notice.errors, notice.lineInfo);
     }
-    return new AnalysisResult(notices, getEnd - getStart, task.runtimeType.toString(), performEnd - performStart);
+    return new AnalysisResult(
+        notices,
+        getEnd - getStart,
+        task.runtimeType.toString(),
+        performEnd - performStart);
   }
 
   @override
@@ -1824,7 +2077,7 @@
       if (dartEntry != null) {
         _recordElementData(dartEntry, library, library.source, htmlSource);
         dartEntry.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
-        dartEntry.setValue(SourceEntry.LINE_INFO, new LineInfo(<int> [0]));
+        dartEntry.setValue(SourceEntry.LINE_INFO, new LineInfo(<int>[0]));
         dartEntry.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
         // DartEntry.ELEMENT - set in recordElementData
         dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, Source.EMPTY_ARRAY);
@@ -1838,177 +2091,32 @@
         dartEntry.setValue(DartEntry.SCAN_ERRORS, AnalysisError.NO_ERRORS);
         dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.LIBRARY);
         dartEntry.setState(DartEntry.TOKEN_STREAM, CacheState.FLUSHED);
-        dartEntry.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource, AnalysisError.NO_ERRORS);
-        dartEntry.setStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource, CacheState.FLUSHED);
-        dartEntry.setValueInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource, AnalysisError.NO_ERRORS);
-        dartEntry.setValueInLibrary(DartEntry.HINTS, librarySource, AnalysisError.NO_ERRORS);
+        dartEntry.setValueInLibrary(
+            DartEntry.RESOLUTION_ERRORS,
+            librarySource,
+            AnalysisError.NO_ERRORS);
+        dartEntry.setStateInLibrary(
+            DartEntry.RESOLVED_UNIT,
+            librarySource,
+            CacheState.FLUSHED);
+        dartEntry.setValueInLibrary(
+            DartEntry.VERIFICATION_ERRORS,
+            librarySource,
+            AnalysisError.NO_ERRORS);
+        dartEntry.setValueInLibrary(
+            DartEntry.HINTS,
+            librarySource,
+            AnalysisError.NO_ERRORS);
       }
     });
   }
 
-  @override
-  void removeListener(AnalysisListener listener) {
-    _listeners.remove(listener);
-  }
-
-  @override
-  CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library) {
-    if (library == null) {
-      return null;
-    }
-    return resolveCompilationUnit2(unitSource, library.source);
-  }
-
-  @override
-  CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) => _getDartResolutionData2(unitSource, librarySource, DartEntry.RESOLVED_UNIT, null);
-
-  @override
-  ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
-    computeHtmlElement(htmlSource);
-    return parseHtmlUnit(htmlSource);
-  }
-
-  @override
-  void set analysisOptions(AnalysisOptions options) {
-    bool needsRecompute = this._options.analyzeAngular != options.analyzeAngular || this._options.analyzeFunctionBodies != options.analyzeFunctionBodies || this._options.generateSdkErrors != options.generateSdkErrors || this._options.enableAsync != options.enableAsync || this._options.enableDeferredLoading != options.enableDeferredLoading || this._options.enableEnum != options.enableEnum || this._options.dart2jsHint != options.dart2jsHint || (this._options.hint && !options.hint) || this._options.preserveComments != options.preserveComments;
-    int cacheSize = options.cacheSize;
-    if (this._options.cacheSize != cacheSize) {
-      this._options.cacheSize = cacheSize;
-      //cache.setMaxCacheSize(cacheSize);
-      _privatePartition.maxCacheSize = cacheSize;
-      //
-      // Cap the size of the priority list to being less than the cache size. Failure to do so can
-      // result in an infinite loop in performAnalysisTask() because re-caching one AST structure
-      // can cause another priority source's AST structure to be flushed.
-      //
-      int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA;
-      if (_priorityOrder.length > maxPriorityOrderSize) {
-        List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize);
-        JavaSystem.arraycopy(_priorityOrder, 0, newPriorityOrder, 0, maxPriorityOrderSize);
-        _priorityOrder = newPriorityOrder;
-      }
-    }
-    this._options.analyzeAngular = options.analyzeAngular;
-    this._options.analyzeFunctionBodies = options.analyzeFunctionBodies;
-    this._options.generateSdkErrors = options.generateSdkErrors;
-    this._options.enableAsync = options.enableAsync;
-    this._options.enableDeferredLoading = options.enableDeferredLoading;
-    this._options.enableEnum = options.enableEnum;
-    this._options.dart2jsHint = options.dart2jsHint;
-    this._options.hint = options.hint;
-    this._options.incremental = options.incremental;
-    this._options.preserveComments = options.preserveComments;
-    _generateSdkErrors = options.generateSdkErrors;
-    if (needsRecompute) {
-      _invalidateAllLocalResolutionInformation(false);
-    }
-  }
-
-  @override
-  void set analysisPriorityOrder(List<Source> sources) {
-    if (sources == null || sources.isEmpty) {
-      _priorityOrder = Source.EMPTY_ARRAY;
-    } else {
-      while (sources.remove(null)) {
-        // Nothing else to do.
-      }
-      if (sources.isEmpty) {
-        _priorityOrder = Source.EMPTY_ARRAY;
-      }
-      //
-      // Cap the size of the priority list to being less than the cache size. Failure to do so can
-      // result in an infinite loop in performAnalysisTask() because re-caching one AST structure
-      // can cause another priority source's AST structure to be flushed.
-      //
-      int count = math.min(sources.length, _options.cacheSize - _PRIORITY_ORDER_SIZE_DELTA);
-      _priorityOrder = new List<Source>(count);
-      for (int i = 0; i < count; i++) {
-        _priorityOrder[i] = sources[i];
-      }
-    }
-  }
-
-  @override
-  void setChangedContents(Source source, String contents, int offset, int oldLength, int newLength) {
-    String originalContents = _contentCache.setContents(source, contents);
-    if (contents != null) {
-      if (contents != originalContents) {
-        if (_options.incremental) {
-          _incrementalAnalysisCache = IncrementalAnalysisCache.update(_incrementalAnalysisCache, source, originalContents, contents, offset, oldLength, newLength, _getReadableSourceEntry(source));
-        }
-        _sourceChanged(source);
-        SourceEntry sourceEntry = _cache.get(source);
-        if (sourceEntry != null) {
-          sourceEntry.modificationTime = _contentCache.getModificationStamp(source);
-          sourceEntry.setValue(SourceEntry.CONTENT, contents);
-        }
-      }
-    } else if (originalContents != null) {
-      _incrementalAnalysisCache = IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
-      _sourceChanged(source);
-    }
-  }
-
-  @override
-  void setContents(Source source, String contents) {
-    String originalContents = _contentCache.setContents(source, contents);
-    if (contents != null) {
-      if (contents != originalContents) {
-        _incrementalAnalysisCache = IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
-        _sourceChanged(source);
-        SourceEntry sourceEntry = _cache.get(source);
-        if (sourceEntry != null) {
-          sourceEntry.modificationTime = _contentCache.getModificationStamp(source);
-          sourceEntry.setValue(SourceEntry.CONTENT, contents);
-        }
-      }
-    } else if (originalContents != null) {
-      _incrementalAnalysisCache = IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
-      _sourceChanged(source);
-    }
-  }
-
-  @override
-  void set sourceFactory(SourceFactory factory) {
-    if (identical(_sourceFactory, factory)) {
-      return;
-    } else if (factory.context != null) {
-      throw new IllegalStateException("Source factories cannot be shared between contexts");
-    }
-    if (_sourceFactory != null) {
-      _sourceFactory.context = null;
-    }
-    factory.context = this;
-    _sourceFactory = factory;
-    _coreLibrarySource = _sourceFactory.forUri(DartSdk.DART_CORE);
-    _cache = createCacheFromSourceFactory(factory);
-    _invalidateAllLocalResolutionInformation(true);
-  }
-
-  /**
-   * Create an analysis cache based on the given source factory.
-   *
-   * @param factory the source factory containing the information needed to create the cache
-   * @return the cache that was created
-   */
-  AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
-    if (factory == null) {
-      return new AnalysisCache(<CachePartition> [_privatePartition]);
-    }
-    DartSdk sdk = factory.dartSdk;
-    if (sdk == null) {
-      return new AnalysisCache(<CachePartition> [_privatePartition]);
-    }
-    return new AnalysisCache(<CachePartition> [
-        AnalysisEngine.instance.partitionManager.forSdk(sdk),
-        _privatePartition]);
-  }
-
   /**
    * Record the results produced by performing a [task] and return the cache
    * entry associated with the results.
    */
-  DartEntry recordResolveDartLibraryCycleTaskResults(ResolveDartLibraryCycleTask task) {
+  DartEntry
+      recordResolveDartLibraryCycleTaskResults(ResolveDartLibraryCycleTask task) {
     LibraryResolver2 resolver = task.libraryResolver;
     CaughtException thrownException = task.exception;
     Source unitSource = task.unitSource;
@@ -2025,11 +2133,11 @@
         // during resolution.
         //
         if (thrownException == null) {
-          var message = "In recordResolveDartLibraryCycleTaskResults, "
-              "resolvedLibraries was null and there was no thrown exception";
-          unitEntry.recordResolutionError(new CaughtException(
-              new AnalysisException(message),
-              null));
+          var message =
+              "In recordResolveDartLibraryCycleTaskResults, "
+                  "resolvedLibraries was null and there was no thrown exception";
+          unitEntry.recordResolutionError(
+              new CaughtException(new AnalysisException(message), null));
         } else {
           unitEntry.recordResolutionError(thrownException);
         }
@@ -2062,7 +2170,8 @@
               _recordElementData(
                   dartEntry,
                   library.libraryElement,
-                  librarySource, htmlSource);
+                  librarySource,
+                  htmlSource);
             }
             _cache.storedAst(source);
           } else {
@@ -2106,11 +2215,11 @@
         // during resolution.
         //
         if (thrownException == null) {
-          String message = "In recordResolveDartLibraryTaskResults, "
-              "resolvedLibraries was null and there was no thrown exception";
-          unitEntry.recordResolutionError(new CaughtException(
-              new AnalysisException(message),
-              null));
+          String message =
+              "In recordResolveDartLibraryTaskResults, "
+                  "resolvedLibraries was null and there was no thrown exception";
+          unitEntry.recordResolutionError(
+              new CaughtException(new AnalysisException(message), null));
         } else {
           unitEntry.recordResolutionError(thrownException);
         }
@@ -2144,7 +2253,8 @@
               _recordElementData(
                   dartEntry,
                   library.libraryElement,
-                  librarySource, htmlSource);
+                  librarySource,
+                  htmlSource);
             }
             _cache.storedAst(source);
           } else {
@@ -2168,6 +2278,126 @@
     return unitEntry;
   }
 
+  @override
+  void removeListener(AnalysisListener listener) {
+    _listeners.remove(listener);
+  }
+
+  @override
+  CompilationUnit resolveCompilationUnit(Source unitSource,
+      LibraryElement library) {
+    if (library == null) {
+      return null;
+    }
+    return resolveCompilationUnit2(unitSource, library.source);
+  }
+
+  @override
+  CompilationUnit resolveCompilationUnit2(Source unitSource,
+      Source librarySource) =>
+      _getDartResolutionData2(
+          unitSource,
+          librarySource,
+          DartEntry.RESOLVED_UNIT,
+          null);
+
+  @override
+  ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
+    computeHtmlElement(htmlSource);
+    return parseHtmlUnit(htmlSource);
+  }
+
+  @override
+  void setChangedContents(Source source, String contents, int offset,
+      int oldLength, int newLength) {
+    if (_contentRangeChanged(source, contents, offset, oldLength, newLength)) {
+      _onSourcesChangedController.add(
+          new SourcesChangedEvent.changedRange(
+              source,
+              contents,
+              offset,
+              oldLength,
+              newLength));
+    }
+  }
+
+  @override
+  void setContents(Source source, String contents) {
+    if (_contentsChanged(source, contents)) {
+      _onSourcesChangedController.add(
+          new SourcesChangedEvent.changedContent(source, contents));
+    }
+  }
+
+  @override
+  void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
+      DataDescriptor rowDesc, CacheState state)) {
+    bool hintsEnabled = _options.hint;
+    MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+    while (iterator.moveNext()) {
+      Source source = iterator.key;
+      SourceEntry sourceEntry = iterator.value;
+      for (DataDescriptor descriptor in sourceEntry.descriptors) {
+        if (descriptor == DartEntry.SOURCE_KIND) {
+          // The source kind is always valid, so the state isn't interesting.
+          continue;
+        } else if (descriptor == DartEntry.CONTAINING_LIBRARIES) {
+          // The list of containing libraries is always valid, so the state isn't
+          // interesting.
+          continue;
+        } else if (descriptor == DartEntry.PUBLIC_NAMESPACE) {
+          // The public namespace isn't computed by performAnalysisTask()
+          // and therefore isn't interesting.
+          continue;
+        } else if (descriptor == HtmlEntry.ANGULAR_APPLICATION ||
+            descriptor == HtmlEntry.ANGULAR_COMPONENT ||
+            descriptor == HtmlEntry.ANGULAR_ENTRY ||
+            descriptor == HtmlEntry.ANGULAR_ERRORS ||
+            descriptor == HtmlEntry.POLYMER_BUILD_ERRORS ||
+            descriptor == HtmlEntry.POLYMER_RESOLUTION_ERRORS) {
+          // These values are not currently being computed, so their state is
+          // not interesting.
+          continue;
+        } else if (descriptor == HtmlEntry.HINTS) {
+          // We are not currently recording any hints related to HTML.
+          continue;
+        }
+        callback(
+            source,
+            sourceEntry,
+            descriptor,
+            sourceEntry.getState(descriptor));
+      }
+      if (sourceEntry is DartEntry) {
+        // get library-specific values
+        List<Source> librarySources = getLibrariesContaining(source);
+        for (Source librarySource in librarySources) {
+          for (DataDescriptor descriptor in sourceEntry.libraryDescriptors) {
+            if (descriptor == DartEntry.ANGULAR_ERRORS ||
+                descriptor == DartEntry.BUILT_ELEMENT ||
+                descriptor == DartEntry.BUILT_UNIT) {
+              // These values are not currently being computed, so their state is
+              // not interesting.
+              continue;
+            } else if (source.isInSystemLibrary &&
+                !_generateSdkErrors &&
+                (descriptor == DartEntry.VERIFICATION_ERRORS ||
+                    descriptor == DartEntry.HINTS)) {
+              continue;
+            } else if (!hintsEnabled && descriptor == DartEntry.HINTS) {
+              continue;
+            }
+            callback(
+                librarySource,
+                sourceEntry,
+                descriptor,
+                sourceEntry.getStateInLibrary(descriptor, librarySource));
+          }
+        }
+      }
+    }
+  }
+
   /**
    * Record that we have accessed the AST structure associated with the given source. At the moment,
    * there is no differentiation between the parsed and resolved forms of the AST.
@@ -2211,35 +2441,51 @@
    * @return a cache entry containing the required data
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  DartEntry _cacheDartHintData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
+  DartEntry _cacheDartHintData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
     //
     // Check to see whether we already have the information being requested.
     //
     CacheState state = dartEntry.getStateInLibrary(descriptor, librarySource);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information.
+      // Unless the modification date of the source continues to change,
+      // this loop will eventually terminate.
       //
       DartEntry libraryEntry = _getReadableDartEntry(librarySource);
-      libraryEntry = _cacheDartResolutionData(librarySource, librarySource, libraryEntry, DartEntry.ELEMENT);
+      libraryEntry = _cacheDartResolutionData(
+          librarySource,
+          librarySource,
+          libraryEntry,
+          DartEntry.ELEMENT);
       LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
-      CompilationUnitElement definingUnit = libraryElement.definingCompilationUnit;
+      CompilationUnitElement definingUnit =
+          libraryElement.definingCompilationUnit;
       List<CompilationUnitElement> parts = libraryElement.parts;
-      List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(parts.length + 1);
+      List<TimestampedData<CompilationUnit>> units =
+          new List<TimestampedData>(parts.length + 1);
       units[0] = _getResolvedUnit(definingUnit, librarySource);
       if (units[0] == null) {
         Source source = definingUnit.source;
-        units[0] = new TimestampedData<CompilationUnit>(getModificationStamp(source), resolveCompilationUnit(source, libraryElement));
+        units[0] = new TimestampedData<CompilationUnit>(
+            getModificationStamp(source),
+            resolveCompilationUnit(source, libraryElement));
       }
       for (int i = 0; i < parts.length; i++) {
         units[i + 1] = _getResolvedUnit(parts[i], librarySource);
         if (units[i + 1] == null) {
           Source source = parts[i].source;
-          units[i + 1] = new TimestampedData<CompilationUnit>(getModificationStamp(source), resolveCompilationUnit(source, libraryElement));
+          units[i +
+              1] = new TimestampedData<CompilationUnit>(
+                  getModificationStamp(source),
+                  resolveCompilationUnit(source, libraryElement));
         }
       }
-      dartEntry = new GenerateDartHintsTask(this, units, getLibraryElement(librarySource)).perform(_resultRecorder) as DartEntry;
+      dartEntry = new GenerateDartHintsTask(
+          this,
+          units,
+          getLibraryElement(librarySource)).perform(_resultRecorder) as DartEntry;
       state = dartEntry.getStateInLibrary(descriptor, librarySource);
     }
     return dartEntry;
@@ -2258,7 +2504,8 @@
    * @return a cache entry containing the required data
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  DartEntry _cacheDartParseData(Source source, DartEntry dartEntry, DataDescriptor descriptor) {
+  DartEntry _cacheDartParseData(Source source, DartEntry dartEntry,
+      DataDescriptor descriptor) {
     if (identical(descriptor, DartEntry.PARSED_UNIT)) {
       if (dartEntry.hasResolvableCompilationUnit) {
         return dartEntry;
@@ -2270,11 +2517,16 @@
     CacheState state = dartEntry.getState(descriptor);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
       dartEntry = _cacheDartScanData(source, dartEntry, DartEntry.TOKEN_STREAM);
-      dartEntry = new ParseDartTask(this, source, dartEntry.getValue(DartEntry.TOKEN_STREAM), dartEntry.getValue(SourceEntry.LINE_INFO)).perform(_resultRecorder) as DartEntry;
+      dartEntry = new ParseDartTask(
+          this,
+          source,
+          dartEntry.getValue(DartEntry.TOKEN_STREAM),
+          dartEntry.getValue(
+              SourceEntry.LINE_INFO)).perform(_resultRecorder) as DartEntry;
       state = dartEntry.getState(descriptor);
     }
     return dartEntry;
@@ -2295,20 +2547,29 @@
    * @return a cache entry containing the required data
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  DartEntry _cacheDartResolutionData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
+  DartEntry _cacheDartResolutionData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
     //
     // Check to see whether we already have the information being requested.
     //
-    CacheState state = (identical(descriptor, DartEntry.ELEMENT)) ? dartEntry.getState(descriptor) : dartEntry.getStateInLibrary(descriptor, librarySource);
+    CacheState state = (identical(descriptor, DartEntry.ELEMENT)) ?
+        dartEntry.getState(descriptor) :
+        dartEntry.getStateInLibrary(descriptor, librarySource);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
-      // TODO(brianwilkerson) As an optimization, if we already have the element model for the
-      // library we can use ResolveDartUnitTask to produce the resolved AST structure much faster.
-      dartEntry = new ResolveDartLibraryTask(this, unitSource, librarySource).perform(_resultRecorder) as DartEntry;
-      state = (identical(descriptor, DartEntry.ELEMENT)) ? dartEntry.getState(descriptor) : dartEntry.getStateInLibrary(descriptor, librarySource);
+      // TODO(brianwilkerson) As an optimization, if we already have the
+      // element model for the library we can use ResolveDartUnitTask to produce
+      // the resolved AST structure much faster.
+      dartEntry = new ResolveDartLibraryTask(
+          this,
+          unitSource,
+          librarySource).perform(_resultRecorder) as DartEntry;
+      state = (identical(descriptor, DartEntry.ELEMENT)) ?
+          dartEntry.getState(descriptor) :
+          dartEntry.getStateInLibrary(descriptor, librarySource);
     }
     return dartEntry;
   }
@@ -2327,25 +2588,32 @@
    * @return a cache entry containing the required data
    * @throws AnalysisException if data could not be returned because the source could not be scanned
    */
-  DartEntry _cacheDartScanData(Source source, DartEntry dartEntry, DataDescriptor descriptor) {
+  DartEntry _cacheDartScanData(Source source, DartEntry dartEntry,
+      DataDescriptor descriptor) {
     //
     // Check to see whether we already have the information being requested.
     //
     CacheState state = dartEntry.getState(descriptor);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
       try {
         if (dartEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
-          dartEntry = new GetContentTask(this, source).perform(_resultRecorder) as DartEntry;
+          dartEntry =
+              new GetContentTask(this, source).perform(_resultRecorder) as DartEntry;
         }
-        dartEntry = new ScanDartTask(this, source, dartEntry.getValue(SourceEntry.CONTENT)).perform(_resultRecorder) as DartEntry;
+        dartEntry = new ScanDartTask(
+            this,
+            source,
+            dartEntry.getValue(SourceEntry.CONTENT)).perform(_resultRecorder) as DartEntry;
       } on AnalysisException catch (exception) {
         throw exception;
       } catch (exception, stackTrace) {
-        throw new AnalysisException("Exception", new CaughtException(exception, stackTrace));
+        throw new AnalysisException(
+            "Exception",
+            new CaughtException(exception, stackTrace));
       }
       state = dartEntry.getState(descriptor);
     }
@@ -2367,22 +2635,28 @@
    * @return a cache entry containing the required data
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  DartEntry _cacheDartVerificationData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
+  DartEntry _cacheDartVerificationData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
     //
     // Check to see whether we already have the information being requested.
     //
     CacheState state = dartEntry.getStateInLibrary(descriptor, librarySource);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
       LibraryElement library = computeLibraryElement(librarySource);
       CompilationUnit unit = resolveCompilationUnit(unitSource, library);
       if (unit == null) {
-        throw new AnalysisException("Could not resolve compilation unit ${unitSource.fullName} in ${librarySource.fullName}");
+        throw new AnalysisException(
+            "Could not resolve compilation unit ${unitSource.fullName} in ${librarySource.fullName}");
       }
-      dartEntry = new GenerateDartErrorsTask(this, unitSource, unit, library).perform(_resultRecorder) as DartEntry;
+      dartEntry = new GenerateDartErrorsTask(
+          this,
+          unitSource,
+          unit,
+          library).perform(_resultRecorder) as DartEntry;
       state = dartEntry.getStateInLibrary(descriptor, librarySource);
     }
     return dartEntry;
@@ -2403,7 +2677,8 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  HtmlEntry _cacheHtmlParseData(Source source, HtmlEntry htmlEntry, DataDescriptor descriptor) {
+  HtmlEntry _cacheHtmlParseData(Source source, HtmlEntry htmlEntry,
+      DataDescriptor descriptor) {
     if (identical(descriptor, HtmlEntry.PARSED_UNIT)) {
       ht.HtmlUnit unit = htmlEntry.anyParsedUnit;
       if (unit != null) {
@@ -2416,18 +2691,24 @@
     CacheState state = htmlEntry.getState(descriptor);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
       try {
         if (htmlEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
-          htmlEntry = new GetContentTask(this, source).perform(_resultRecorder) as HtmlEntry;
+          htmlEntry =
+              new GetContentTask(this, source).perform(_resultRecorder) as HtmlEntry;
         }
-        htmlEntry = new ParseHtmlTask(this, source, htmlEntry.getValue(SourceEntry.CONTENT)).perform(_resultRecorder) as HtmlEntry;
+        htmlEntry = new ParseHtmlTask(
+            this,
+            source,
+            htmlEntry.getValue(SourceEntry.CONTENT)).perform(_resultRecorder) as HtmlEntry;
       } on AnalysisException catch (exception) {
         throw exception;
       } catch (exception, stackTrace) {
-        throw new AnalysisException("Exception", new CaughtException(exception, stackTrace));
+        throw new AnalysisException(
+            "Exception",
+            new CaughtException(exception, stackTrace));
       }
       state = htmlEntry.getState(descriptor);
     }
@@ -2449,18 +2730,24 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  HtmlEntry _cacheHtmlResolutionData(Source source, HtmlEntry htmlEntry, DataDescriptor descriptor) {
+  HtmlEntry _cacheHtmlResolutionData(Source source, HtmlEntry htmlEntry,
+      DataDescriptor descriptor) {
     //
     // Check to see whether we already have the information being requested.
     //
     CacheState state = htmlEntry.getState(descriptor);
     while (state != CacheState.ERROR && state != CacheState.VALID) {
       //
-      // If not, compute the information. Unless the modification date of the source continues to
-      // change, this loop will eventually terminate.
+      // If not, compute the information. Unless the modification date of the
+      // source continues to change, this loop will eventually terminate.
       //
       htmlEntry = _cacheHtmlParseData(source, htmlEntry, HtmlEntry.PARSED_UNIT);
-      htmlEntry = new ResolveHtmlTask(this, source, htmlEntry.modificationTime, htmlEntry.getValue(HtmlEntry.PARSED_UNIT)).perform(_resultRecorder) as HtmlEntry;
+      htmlEntry = new ResolveHtmlTask(
+          this,
+          source,
+          htmlEntry.modificationTime,
+          htmlEntry.getValue(
+              HtmlEntry.PARSED_UNIT)).perform(_resultRecorder) as HtmlEntry;
       state = htmlEntry.getState(descriptor);
     }
     return htmlEntry;
@@ -2473,10 +2760,13 @@
    * @param library the library on which the other libraries depend
    * @param librariesToInvalidate the libraries that depend on the given library
    */
-  void _computeAllLibrariesDependingOn(Source library, HashSet<Source> librariesToInvalidate) {
+  void _computeAllLibrariesDependingOn(Source library,
+      HashSet<Source> librariesToInvalidate) {
     if (librariesToInvalidate.add(library)) {
       for (Source dependentLibrary in getLibrariesDependingOn(library)) {
-        _computeAllLibrariesDependingOn(dependentLibrary, librariesToInvalidate);
+        _computeAllLibrariesDependingOn(
+            dependentLibrary,
+            librariesToInvalidate);
       }
     }
   }
@@ -2504,7 +2794,8 @@
    * @param encoding the encoded form of a source
    * @return the source represented by the encoding
    */
-  Source _computeSourceFromEncoding(String encoding) => _sourceFactory.fromEncoding(encoding);
+  Source _computeSourceFromEncoding(String encoding) =>
+      _sourceFactory.fromEncoding(encoding);
 
   /**
    * Return `true` if the given array of sources contains the given source.
@@ -2539,16 +2830,101 @@
   }
 
   /**
-   * Create a [BuildUnitElementTask] for the given [source].
+   * Set the contents of the given source to the given contents and mark the source as having
+   * changed. The additional offset and length information is used by the context to determine what
+   * reanalysis is necessary. [setChangedContents] triggers a source changed event
+   * where as this method does not.
+   *
+   * @param source the source whose contents are being overridden
+   * @param contents the text to replace the range in the current contents
+   * @param offset the offset into the current contents
+   * @param oldLength the number of characters in the original contents that were replaced
+   * @param newLength the number of characters in the replacement text
    */
-  AnalysisContextImpl_TaskData _createBuildUnitElementTask(Source source, DartEntry dartEntry, Source librarySource) {
-    CompilationUnit unit = dartEntry.resolvableCompilationUnit;
-    if (unit == null) {
-      return _createParseDartTask(source, dartEntry);
+  bool _contentRangeChanged(Source source, String contents, int offset,
+      int oldLength, int newLength) {
+    bool changed = false;
+    String originalContents = _contentCache.setContents(source, contents);
+    if (contents != null) {
+      if (contents != originalContents) {
+        if (_options.incremental) {
+          _incrementalAnalysisCache = IncrementalAnalysisCache.update(
+              _incrementalAnalysisCache,
+              source,
+              originalContents,
+              contents,
+              offset,
+              oldLength,
+              newLength,
+              _getReadableSourceEntry(source));
+        }
+        _sourceChanged(source);
+        changed = true;
+        SourceEntry sourceEntry = _cache.get(source);
+        if (sourceEntry != null) {
+          sourceEntry.modificationTime =
+              _contentCache.getModificationStamp(source);
+          sourceEntry.setValue(SourceEntry.CONTENT, contents);
+        }
+      }
+    } else if (originalContents != null) {
+      _incrementalAnalysisCache =
+          IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+      _sourceChanged(source);
+      changed = true;
     }
-    return new AnalysisContextImpl_TaskData(
-        new BuildUnitElementTask(this, source, librarySource, unit),
-        false);
+    return changed;
+  }
+
+//  /**
+//   * Create a [BuildUnitElementTask] for the given [source].
+//   */
+//  AnalysisContextImpl_TaskData _createBuildUnitElementTask(Source source,
+//      DartEntry dartEntry, Source librarySource) {
+//    CompilationUnit unit = dartEntry.resolvableCompilationUnit;
+//    if (unit == null) {
+//      return _createParseDartTask(source, dartEntry);
+//    }
+//    return new AnalysisContextImpl_TaskData(
+//        new BuildUnitElementTask(this, source, librarySource, unit),
+//        false);
+//  }
+
+  /**
+   * Set the contents of the given source to the given contents and mark the source as having
+   * changed. This has the effect of overriding the default contents of the source. If the contents
+   * are `null` the override is removed so that the default contents will be returned.
+   * [setContents] triggers a source changed event where as this method does not.
+   *
+   * @param source the source whose contents are being overridden
+   * @param contents the new contents of the source
+   */
+  bool _contentsChanged(Source source, String contents) {
+    bool changed = false;
+    String originalContents = _contentCache.setContents(source, contents);
+    if (contents != null) {
+      if (contents != originalContents) {
+        _incrementalAnalysisCache =
+            IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+        if (!analysisOptions.incremental ||
+            !_tryPoorMansIncrementalResolution(source, contents)) {
+          _sourceChanged(source);
+        }
+        changed = true;
+        SourceEntry sourceEntry = _cache.get(source);
+        if (sourceEntry != null) {
+          sourceEntry.modificationTime =
+              _contentCache.getModificationStamp(source);
+          sourceEntry.setValue(SourceEntry.CONTENT, contents);
+        }
+      }
+    } else if (originalContents != null) {
+      _incrementalAnalysisCache =
+          IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
+      _sourceChanged(source);
+      changed = true;
+    }
+    return changed;
   }
 
   /**
@@ -2562,22 +2938,34 @@
    * @param libraryEntry the entry for the library
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createGenerateDartErrorsTask(Source unitSource, DartEntry unitEntry, Source librarySource, DartEntry libraryEntry) {
-    if (unitEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) != CacheState.VALID || libraryEntry.getState(DartEntry.ELEMENT) != CacheState.VALID) {
+  AnalysisContextImpl_TaskData _createGenerateDartErrorsTask(Source unitSource,
+      DartEntry unitEntry, Source librarySource, DartEntry libraryEntry) {
+    if (unitEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) !=
+        CacheState.VALID ||
+        libraryEntry.getState(DartEntry.ELEMENT) != CacheState.VALID) {
       return _createResolveDartLibraryTask(librarySource, libraryEntry);
     }
-    CompilationUnit unit = unitEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+    CompilationUnit unit =
+        unitEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
     if (unit == null) {
       CaughtException exception = new CaughtException(
-          new AnalysisException("Entry has VALID state for RESOLVED_UNIT but null value for ${unitSource.fullName} in ${librarySource.fullName}"),
+          new AnalysisException(
+              "Entry has VALID state for RESOLVED_UNIT but null value for ${unitSource.fullName} in ${librarySource.fullName}"),
           null);
-      AnalysisEngine.instance.logger.logInformation(exception.toString(), exception);
+      AnalysisEngine.instance.logger.logInformation(
+          exception.toString(),
+          exception);
       unitEntry.recordResolutionError(exception);
       return new AnalysisContextImpl_TaskData(null, false);
     }
     LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
-    unitEntry.setStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new GenerateDartErrorsTask(this, unitSource, unit, libraryElement), false);
+    unitEntry.setStateInLibrary(
+        DartEntry.VERIFICATION_ERRORS,
+        librarySource,
+        CacheState.IN_PROCESS);
+    return new AnalysisContextImpl_TaskData(
+        new GenerateDartErrorsTask(this, unitSource, unit, libraryElement),
+        false);
   }
 
   /**
@@ -2590,30 +2978,38 @@
    * @param libraryEntry the entry for the library
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createGenerateDartHintsTask(Source source, DartEntry dartEntry, Source librarySource, DartEntry libraryEntry) {
+  AnalysisContextImpl_TaskData _createGenerateDartHintsTask(Source source,
+      DartEntry dartEntry, Source librarySource, DartEntry libraryEntry) {
     if (libraryEntry.getState(DartEntry.ELEMENT) != CacheState.VALID) {
       return _createResolveDartLibraryTask(librarySource, libraryEntry);
     }
     LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
-    CompilationUnitElement definingUnit = libraryElement.definingCompilationUnit;
+    CompilationUnitElement definingUnit =
+        libraryElement.definingCompilationUnit;
     List<CompilationUnitElement> parts = libraryElement.parts;
-    List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(parts.length + 1);
+    List<TimestampedData<CompilationUnit>> units =
+        new List<TimestampedData>(parts.length + 1);
     units[0] = _getResolvedUnit(definingUnit, librarySource);
     if (units[0] == null) {
-      // TODO(brianwilkerson) We should return a ResolveDartUnitTask (unless there are multiple ASTs
-      // that need to be resolved.
+      // TODO(brianwilkerson) We should return a ResolveDartUnitTask
+      // (unless there are multiple ASTs that need to be resolved).
       return _createResolveDartLibraryTask(librarySource, libraryEntry);
     }
     for (int i = 0; i < parts.length; i++) {
       units[i + 1] = _getResolvedUnit(parts[i], librarySource);
       if (units[i + 1] == null) {
-        // TODO(brianwilkerson) We should return a ResolveDartUnitTask (unless there are multiple
-        // ASTs that need to be resolved.
+        // TODO(brianwilkerson) We should return a ResolveDartUnitTask
+        // (unless there are multiple ASTs that need to be resolved).
         return _createResolveDartLibraryTask(librarySource, libraryEntry);
       }
     }
-    dartEntry.setStateInLibrary(DartEntry.HINTS, librarySource, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new GenerateDartHintsTask(this, units, libraryElement), false);
+    dartEntry.setStateInLibrary(
+        DartEntry.HINTS,
+        librarySource,
+        CacheState.IN_PROCESS);
+    return new AnalysisContextImpl_TaskData(
+        new GenerateDartHintsTask(this, units, libraryElement),
+        false);
   }
 
   /**
@@ -2623,35 +3019,49 @@
    * @param sourceEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createGetContentTask(Source source, SourceEntry sourceEntry) {
+  AnalysisContextImpl_TaskData _createGetContentTask(Source source,
+      SourceEntry sourceEntry) {
     sourceEntry.setState(SourceEntry.CONTENT, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new GetContentTask(this, source), false);
+    return new AnalysisContextImpl_TaskData(
+        new GetContentTask(this, source),
+        false);
   }
 
   /**
    * Create a [ParseDartTask] for the given [source].
    */
-  AnalysisContextImpl_TaskData _createParseDartTask(Source source, DartEntry dartEntry) {
-    if (dartEntry.getState(DartEntry.TOKEN_STREAM) != CacheState.VALID || dartEntry.getState(SourceEntry.LINE_INFO) != CacheState.VALID) {
+  AnalysisContextImpl_TaskData _createParseDartTask(Source source,
+      DartEntry dartEntry) {
+    if (dartEntry.getState(DartEntry.TOKEN_STREAM) != CacheState.VALID ||
+        dartEntry.getState(SourceEntry.LINE_INFO) != CacheState.VALID) {
       return _createScanDartTask(source, dartEntry);
     }
     Token tokenStream = dartEntry.getValue(DartEntry.TOKEN_STREAM);
     dartEntry.setState(DartEntry.TOKEN_STREAM, CacheState.FLUSHED);
     dartEntry.setState(DartEntry.PARSE_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ParseDartTask(this, source, tokenStream, dartEntry.getValue(SourceEntry.LINE_INFO)), false);
+    return new AnalysisContextImpl_TaskData(
+        new ParseDartTask(
+            this,
+            source,
+            tokenStream,
+            dartEntry.getValue(SourceEntry.LINE_INFO)),
+        false);
   }
 
   /**
    * Create a [ParseHtmlTask] for the given [source].
    */
-  AnalysisContextImpl_TaskData _createParseHtmlTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData _createParseHtmlTask(Source source,
+      HtmlEntry htmlEntry) {
     if (htmlEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
       return _createGetContentTask(source, htmlEntry);
     }
     String content = htmlEntry.getValue(SourceEntry.CONTENT);
     htmlEntry.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
     htmlEntry.setState(HtmlEntry.PARSE_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ParseHtmlTask(this, source, content), false);
+    return new AnalysisContextImpl_TaskData(
+        new ParseHtmlTask(this, source, content),
+        false);
   }
 
   /**
@@ -2662,12 +3072,19 @@
    * @param htmlEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createPolymerBuildHtmlTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData _createPolymerBuildHtmlTask(Source source,
+      HtmlEntry htmlEntry) {
     if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
       return _createResolveHtmlTask(source, htmlEntry);
     }
     htmlEntry.setState(HtmlEntry.POLYMER_BUILD_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new PolymerBuildHtmlTask(this, source, htmlEntry.getValue(SourceEntry.LINE_INFO), htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)), false);
+    return new AnalysisContextImpl_TaskData(
+        new PolymerBuildHtmlTask(
+            this,
+            source,
+            htmlEntry.getValue(SourceEntry.LINE_INFO),
+            htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
+        false);
   }
 
   /**
@@ -2678,12 +3095,21 @@
    * @param htmlEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createPolymerResolveHtmlTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData _createPolymerResolveHtmlTask(Source source,
+      HtmlEntry htmlEntry) {
     if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
       return _createResolveHtmlTask(source, htmlEntry);
     }
-    htmlEntry.setState(HtmlEntry.POLYMER_RESOLUTION_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new PolymerResolveHtmlTask(this, source, htmlEntry.getValue(SourceEntry.LINE_INFO), htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)), false);
+    htmlEntry.setState(
+        HtmlEntry.POLYMER_RESOLUTION_ERRORS,
+        CacheState.IN_PROCESS);
+    return new AnalysisContextImpl_TaskData(
+        new PolymerResolveHtmlTask(
+            this,
+            source,
+            htmlEntry.getValue(SourceEntry.LINE_INFO),
+            htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
+        false);
   }
 
   /**
@@ -2694,14 +3120,24 @@
    * @param htmlEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createResolveAngularComponentTemplateTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData
+      _createResolveAngularComponentTemplateTask(Source source, HtmlEntry htmlEntry) {
     if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
       return _createResolveHtmlTask(source, htmlEntry);
     }
-    AngularApplication application = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
-    AngularComponentElement component = htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
+    AngularApplication application =
+        htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
+    AngularComponentElement component =
+        htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
     htmlEntry.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ResolveAngularComponentTemplateTask(this, source, htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT), component, application), false);
+    return new AnalysisContextImpl_TaskData(
+        new ResolveAngularComponentTemplateTask(
+            this,
+            source,
+            htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT),
+            component,
+            application),
+        false);
   }
 
   /**
@@ -2712,12 +3148,18 @@
    * @param htmlEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createResolveAngularEntryHtmlTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData _createResolveAngularEntryHtmlTask(Source source,
+      HtmlEntry htmlEntry) {
     if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
       return _createResolveHtmlTask(source, htmlEntry);
     }
     htmlEntry.setState(HtmlEntry.ANGULAR_ENTRY, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ResolveAngularEntryHtmlTask(this, source, htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)), false);
+    return new AnalysisContextImpl_TaskData(
+        new ResolveAngularEntryHtmlTask(
+            this,
+            source,
+            htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT)),
+        false);
   }
 
   /**
@@ -2727,17 +3169,22 @@
    * @param dartEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createResolveDartLibraryTask(Source source, DartEntry dartEntry) {
+  AnalysisContextImpl_TaskData _createResolveDartLibraryTask(Source source,
+      DartEntry dartEntry) {
     try {
-      AnalysisContextImpl_CycleBuilder builder = new AnalysisContextImpl_CycleBuilder(this);
+      AnalysisContextImpl_CycleBuilder builder =
+          new AnalysisContextImpl_CycleBuilder(this);
       builder.computeCycleContaining(source);
       AnalysisContextImpl_TaskData taskData = builder.taskData;
       if (taskData != null) {
         return taskData;
       }
-      return new AnalysisContextImpl_TaskData(new ResolveDartLibraryCycleTask(this, source, source, builder.librariesInCycle), false);
+      return new AnalysisContextImpl_TaskData(
+          new ResolveDartLibraryCycleTask(this, source, source, builder.librariesInCycle),
+          false);
     } on AnalysisException catch (exception, stackTrace) {
-      dartEntry.recordResolutionError(new CaughtException(exception, stackTrace));
+      dartEntry.recordResolutionError(
+          new CaughtException(exception, stackTrace));
       AnalysisEngine.instance.logger.logError(
           "Internal error trying to create a ResolveDartLibraryTask",
           new CaughtException(exception, stackTrace));
@@ -2753,12 +3200,19 @@
    * @param htmlEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createResolveHtmlTask(Source source, HtmlEntry htmlEntry) {
+  AnalysisContextImpl_TaskData _createResolveHtmlTask(Source source,
+      HtmlEntry htmlEntry) {
     if (htmlEntry.getState(HtmlEntry.PARSED_UNIT) != CacheState.VALID) {
       return _createParseHtmlTask(source, htmlEntry);
     }
     htmlEntry.setState(HtmlEntry.RESOLVED_UNIT, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ResolveHtmlTask(this, source, htmlEntry.modificationTime, htmlEntry.getValue(HtmlEntry.PARSED_UNIT)), false);
+    return new AnalysisContextImpl_TaskData(
+        new ResolveHtmlTask(
+            this,
+            source,
+            htmlEntry.modificationTime,
+            htmlEntry.getValue(HtmlEntry.PARSED_UNIT)),
+        false);
   }
 
   /**
@@ -2769,14 +3223,17 @@
    * @param dartEntry the entry for the source
    * @return task data representing the created task
    */
-  AnalysisContextImpl_TaskData _createScanDartTask(Source source, DartEntry dartEntry) {
+  AnalysisContextImpl_TaskData _createScanDartTask(Source source,
+      DartEntry dartEntry) {
     if (dartEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
       return _createGetContentTask(source, dartEntry);
     }
     String content = dartEntry.getValue(SourceEntry.CONTENT);
     dartEntry.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
     dartEntry.setState(DartEntry.SCAN_ERRORS, CacheState.IN_PROCESS);
-    return new AnalysisContextImpl_TaskData(new ScanDartTask(this, source, content), false);
+    return new AnalysisContextImpl_TaskData(
+        new ScanDartTask(this, source, content),
+        false);
   }
 
   /**
@@ -2805,15 +3262,6 @@
   }
 
   /**
-   * Return a string with debugging information about the given source (the full name and
-   * modification stamp of the source).
-   *
-   * @param source the source for which a debugging string is to be produced
-   * @return debugging information about the given source
-   */
-  String _debuggingString(Source source) => "'${source.fullName}' [${getModificationStamp(source)}]";
-
-  /**
    * Return an array containing all of the change notices that are waiting to be returned. If there
    * are no notices, then return either `null` or an empty array, depending on the value of
    * the argument.
@@ -2848,8 +3296,10 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getDartHintData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
-    dartEntry = _cacheDartHintData(unitSource, librarySource, dartEntry, descriptor);
+  Object _getDartHintData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
+    dartEntry =
+        _cacheDartHintData(unitSource, librarySource, dartEntry, descriptor);
     if (identical(descriptor, DartEntry.ELEMENT)) {
       return dartEntry.getValue(descriptor);
     }
@@ -2869,7 +3319,8 @@
    * @return the requested data about the given source
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  Object _getDartParseData(Source source, DartEntry dartEntry, DataDescriptor descriptor) {
+  Object _getDartParseData(Source source, DartEntry dartEntry,
+      DataDescriptor descriptor) {
     dartEntry = _cacheDartParseData(source, dartEntry, descriptor);
     if (identical(descriptor, DartEntry.PARSED_UNIT)) {
       _accessedAst(source);
@@ -2891,7 +3342,8 @@
    * @return the requested data about the given source
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  Object _getDartParseData2(Source source, DataDescriptor descriptor, Object defaultValue) {
+  Object _getDartParseData2(Source source, DataDescriptor descriptor,
+      Object defaultValue) {
     DartEntry dartEntry = _getReadableDartEntry(source);
     if (dartEntry == null) {
       return defaultValue;
@@ -2921,8 +3373,10 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getDartResolutionData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
-    dartEntry = _cacheDartResolutionData(unitSource, librarySource, dartEntry, descriptor);
+  Object _getDartResolutionData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
+    dartEntry =
+        _cacheDartResolutionData(unitSource, librarySource, dartEntry, descriptor);
     if (identical(descriptor, DartEntry.ELEMENT)) {
       return dartEntry.getValue(descriptor);
     } else if (identical(descriptor, DartEntry.RESOLVED_UNIT)) {
@@ -2947,13 +3401,18 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getDartResolutionData2(Source unitSource, Source librarySource, DataDescriptor descriptor, Object defaultValue) {
+  Object _getDartResolutionData2(Source unitSource, Source librarySource,
+      DataDescriptor descriptor, Object defaultValue) {
     DartEntry dartEntry = _getReadableDartEntry(unitSource);
     if (dartEntry == null) {
       return defaultValue;
     }
     try {
-      return _getDartResolutionData(unitSource, librarySource, dartEntry, descriptor);
+      return _getDartResolutionData(
+          unitSource,
+          librarySource,
+          dartEntry,
+          descriptor);
     } on ObsoleteSourceAnalysisException catch (exception, stackTrace) {
       AnalysisEngine.instance.logger.logInformation(
           "Could not compute $descriptor",
@@ -2975,7 +3434,8 @@
    * @return the requested data about the given source
    * @throws AnalysisException if data could not be returned because the source could not be scanned
    */
-  Object _getDartScanData(Source source, DartEntry dartEntry, DataDescriptor descriptor) {
+  Object _getDartScanData(Source source, DartEntry dartEntry,
+      DataDescriptor descriptor) {
     dartEntry = _cacheDartScanData(source, dartEntry, descriptor);
     return dartEntry.getValue(descriptor);
   }
@@ -2994,7 +3454,8 @@
    * @return the requested data about the given source
    * @throws AnalysisException if data could not be returned because the source could not be scanned
    */
-  Object _getDartScanData2(Source source, DataDescriptor descriptor, Object defaultValue) {
+  Object _getDartScanData2(Source source, DataDescriptor descriptor,
+      Object defaultValue) {
     DartEntry dartEntry = _getReadableDartEntry(source);
     if (dartEntry == null) {
       return defaultValue;
@@ -3024,8 +3485,10 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getDartVerificationData(Source unitSource, Source librarySource, DartEntry dartEntry, DataDescriptor descriptor) {
-    dartEntry = _cacheDartVerificationData(unitSource, librarySource, dartEntry, descriptor);
+  Object _getDartVerificationData(Source unitSource, Source librarySource,
+      DartEntry dartEntry, DataDescriptor descriptor) {
+    dartEntry =
+        _cacheDartVerificationData(unitSource, librarySource, dartEntry, descriptor);
     return dartEntry.getValueInLibrary(descriptor, librarySource);
   }
 
@@ -3042,7 +3505,8 @@
    * @return the requested data about the given source
    * @throws AnalysisException if data could not be returned because the source could not be parsed
    */
-  Object _getHtmlParseData(Source source, DataDescriptor descriptor, Object defaultValue) {
+  Object _getHtmlParseData(Source source, DataDescriptor descriptor,
+      Object defaultValue) {
     HtmlEntry htmlEntry = _getReadableHtmlEntry(source);
     if (htmlEntry == null) {
       return defaultValue;
@@ -3070,7 +3534,8 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getHtmlResolutionData(Source source, DataDescriptor descriptor, Object defaultValue) {
+  Object _getHtmlResolutionData(Source source, DataDescriptor descriptor,
+      Object defaultValue) {
     HtmlEntry htmlEntry = _getReadableHtmlEntry(source);
     if (htmlEntry == null) {
       return defaultValue;
@@ -3099,7 +3564,8 @@
    * @throws AnalysisException if data could not be returned because the source could not be
    *           resolved
    */
-  Object _getHtmlResolutionData2(Source source, HtmlEntry htmlEntry, DataDescriptor descriptor) {
+  Object _getHtmlResolutionData2(Source source, HtmlEntry htmlEntry,
+      DataDescriptor descriptor) {
     htmlEntry = _cacheHtmlResolutionData(source, htmlEntry, descriptor);
     if (identical(descriptor, HtmlEntry.RESOLVED_UNIT)) {
       _accessedAst(source);
@@ -3108,94 +3574,6 @@
   }
 
   /**
-   * Look through the cache for a task that needs to be performed. Return the task that was found,
-   * or `null` if there is no more work to be done.
-   *
-   * @return the next task that needs to be performed
-   */
-  AnalysisTask get nextAnalysisTask {
-    bool hintsEnabled = _options.hint;
-    bool hasBlockedTask = false;
-    //
-    // Look for incremental analysis
-    //
-    if (_incrementalAnalysisCache != null && _incrementalAnalysisCache.hasWork) {
-      AnalysisTask task = new IncrementalAnalysisTask(this, _incrementalAnalysisCache);
-      _incrementalAnalysisCache = null;
-      return task;
-    }
-    //
-    // Look for a priority source that needs to be analyzed.
-    //
-    int priorityCount = _priorityOrder.length;
-    for (int i = 0; i < priorityCount; i++) {
-      Source source = _priorityOrder[i];
-      AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(source, _cache.get(source), true, hintsEnabled);
-      AnalysisTask task = taskData.task;
-      if (task != null) {
-        return task;
-      } else if (taskData.isBlocked) {
-        hasBlockedTask = true;
-      }
-    }
-    if (_neededForResolution != null) {
-      List<Source> sourcesToRemove = new List<Source>();
-      for (Source source in _neededForResolution) {
-        SourceEntry sourceEntry = _cache.get(source);
-        if (sourceEntry is DartEntry) {
-          DartEntry dartEntry = sourceEntry;
-          if (!dartEntry.hasResolvableCompilationUnit) {
-            if (dartEntry.getState(DartEntry.PARSED_UNIT) == CacheState.ERROR) {
-              sourcesToRemove.add(source);
-            } else {
-              AnalysisContextImpl_TaskData taskData = _createParseDartTask(source, dartEntry);
-              AnalysisTask task = taskData.task;
-              if (task != null) {
-                return task;
-              } else if (taskData.isBlocked) {
-                hasBlockedTask = true;
-              }
-            }
-          }
-        }
-      }
-      int count = sourcesToRemove.length;
-      for (int i = 0; i < count; i++) {
-        _neededForResolution.remove(sourcesToRemove[i]);
-      }
-    }
-    //
-    // Look for a non-priority source that needs to be analyzed.
-    //
-    List<Source> sourcesToRemove = new List<Source>();
-    WorkManager_WorkIterator sources = _workManager.iterator();
-    try {
-      while (sources.hasNext) {
-        Source source = sources.next();
-        AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(source, _cache.get(source), false, hintsEnabled);
-        AnalysisTask task = taskData.task;
-        if (task != null) {
-          return task;
-        } else if (taskData.isBlocked) {
-          hasBlockedTask = true;
-        } else {
-          sourcesToRemove.add(source);
-        }
-      }
-    } finally {
-      int count = sourcesToRemove.length;
-      for (int i = 0; i < count; i++) {
-        _workManager.remove(sourcesToRemove[i]);
-      }
-    }
-    if (hasBlockedTask) {
-      // All of the analysis work is blocked waiting for an asynchronous task to complete.
-      return WaitForAsyncTask.instance;
-    }
-    return null;
-  }
-
-  /**
    * Look at the given source to see whether a task needs to be performed related to it. Return the
    * task that should be performed, or `null` if there is no more work to be done for the
    * source.
@@ -3208,10 +3586,12 @@
    * @param hintsEnabled `true` if hints are currently enabled
    * @return the next task that needs to be performed for the given source
    */
-  AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source, SourceEntry sourceEntry, bool isPriority, bool hintsEnabled) {
+  AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source,
+      SourceEntry sourceEntry, bool isPriority, bool hintsEnabled) {
     // Refuse to generate tasks for html based files that are above 1500 KB
     if (_isTooBigHtmlSourceEntry(source, sourceEntry)) {
-      // TODO (jwren) we still need to report an error of some kind back to the client.
+      // TODO (jwren) we still need to report an error of some kind back to the
+      // client.
       return new AnalysisContextImpl_TaskData(null, false);
     }
     if (sourceEntry == null) {
@@ -3221,21 +3601,24 @@
     if (contentState == CacheState.INVALID) {
       return _createGetContentTask(source, sourceEntry);
     } else if (contentState == CacheState.IN_PROCESS) {
-      // We are already in the process of getting the content. There's nothing else we can do with
-      // this source until that's complete.
+      // We are already in the process of getting the content.
+      // There's nothing else we can do with this source until that's complete.
       return new AnalysisContextImpl_TaskData(null, true);
     } else if (contentState == CacheState.ERROR) {
-      // We have done all of the analysis we can for this source because we cannot get its content.
+      // We have done all of the analysis we can for this source because we
+      // cannot get its content.
       return new AnalysisContextImpl_TaskData(null, false);
     }
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
       CacheState scanErrorsState = dartEntry.getState(DartEntry.SCAN_ERRORS);
-      if (scanErrorsState == CacheState.INVALID || (isPriority && scanErrorsState == CacheState.FLUSHED)) {
+      if (scanErrorsState == CacheState.INVALID ||
+          (isPriority && scanErrorsState == CacheState.FLUSHED)) {
         return _createScanDartTask(source, dartEntry);
       }
       CacheState parseErrorsState = dartEntry.getState(DartEntry.PARSE_ERRORS);
-      if (parseErrorsState == CacheState.INVALID || (isPriority && parseErrorsState == CacheState.FLUSHED)) {
+      if (parseErrorsState == CacheState.INVALID ||
+          (isPriority && parseErrorsState == CacheState.FLUSHED)) {
         return _createParseDartTask(source, dartEntry);
       }
       if (isPriority && parseErrorsState != CacheState.ERROR) {
@@ -3258,35 +3641,60 @@
         if (librarySourceEntry is DartEntry) {
           DartEntry libraryEntry = librarySourceEntry;
           CacheState elementState = libraryEntry.getState(DartEntry.ELEMENT);
-          if (elementState == CacheState.INVALID || (isPriority && elementState == CacheState.FLUSHED)) {
-            //return createResolveDartLibraryTask(librarySource, (DartEntry) libraryEntry);
+          if (elementState == CacheState.INVALID ||
+              (isPriority && elementState == CacheState.FLUSHED)) {
+//            return createResolveDartLibraryTask(librarySource, (DartEntry) libraryEntry);
             libraryEntry.setState(DartEntry.ELEMENT, CacheState.IN_PROCESS);
-            return new AnalysisContextImpl_TaskData(new ResolveDartLibraryTask(this, source, librarySource), false);
+            return new AnalysisContextImpl_TaskData(
+                new ResolveDartLibraryTask(this, source, librarySource),
+                false);
           }
-          CacheState resolvedUnitState = dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
-          if (resolvedUnitState == CacheState.INVALID || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
+          CacheState resolvedUnitState =
+              dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+          if (resolvedUnitState == CacheState.INVALID ||
+              (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
             //
-            // The commented out lines below are an optimization that doesn't quite work yet. The
-            // problem is that if the source was not resolved because it wasn't part of any library,
-            // then there won't be any elements in the element model that we can use to resolve it.
+            // The commented out lines below are an optimization that doesn't
+            // quite work yet. The problem is that if the source was not
+            // resolved because it wasn't part of any library, then there won't
+            // be any elements in the element model that we can use to resolve
+            // it.
             //
-            //LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
-            //if (libraryElement != null) {
-            //  return new ResolveDartUnitTask(this, source, libraryElement);
-            //}
-            // Possibly replace with: return createResolveDartLibraryTask(librarySource, (DartEntry) libraryEntry);
-            dartEntry.setStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource, CacheState.IN_PROCESS);
-            return new AnalysisContextImpl_TaskData(new ResolveDartLibraryTask(this, source, librarySource), false);
+//            LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+//            if (libraryElement != null) {
+//              return new ResolveDartUnitTask(this, source, libraryElement);
+//            }
+            // Possibly replace with:
+//             return createResolveDartLibraryTask(librarySource, (DartEntry) libraryEntry);
+            dartEntry.setStateInLibrary(
+                DartEntry.RESOLVED_UNIT,
+                librarySource,
+                CacheState.IN_PROCESS);
+            return new AnalysisContextImpl_TaskData(
+                new ResolveDartLibraryTask(this, source, librarySource),
+                false);
           }
           if (_generateSdkErrors || !source.isInSystemLibrary) {
-            CacheState verificationErrorsState = dartEntry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource);
-            if (verificationErrorsState == CacheState.INVALID || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
-              return _createGenerateDartErrorsTask(source, dartEntry, librarySource, libraryEntry);
+            CacheState verificationErrorsState =
+                dartEntry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource);
+            if (verificationErrorsState == CacheState.INVALID ||
+                (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
+              return _createGenerateDartErrorsTask(
+                  source,
+                  dartEntry,
+                  librarySource,
+                  libraryEntry);
             }
             if (hintsEnabled) {
-              CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
-              if (hintsState == CacheState.INVALID || (isPriority && hintsState == CacheState.FLUSHED)) {
-                return _createGenerateDartHintsTask(source, dartEntry, librarySource, libraryEntry);
+              CacheState hintsState =
+                  dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
+              if (hintsState == CacheState.INVALID ||
+                  (isPriority && hintsState == CacheState.FLUSHED)) {
+                return _createGenerateDartHintsTask(
+                    source,
+                    dartEntry,
+                    librarySource,
+                    libraryEntry);
               }
             }
           }
@@ -3295,7 +3703,8 @@
     } else if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       CacheState parseErrorsState = htmlEntry.getState(HtmlEntry.PARSE_ERRORS);
-      if (parseErrorsState == CacheState.INVALID || (isPriority && parseErrorsState == CacheState.FLUSHED)) {
+      if (parseErrorsState == CacheState.INVALID ||
+          (isPriority && parseErrorsState == CacheState.FLUSHED)) {
         return _createParseHtmlTask(source, htmlEntry);
       }
       if (isPriority && parseErrorsState != CacheState.ERROR) {
@@ -3304,8 +3713,10 @@
           return _createParseHtmlTask(source, htmlEntry);
         }
       }
-      CacheState resolvedUnitState = htmlEntry.getState(HtmlEntry.RESOLVED_UNIT);
-      if (resolvedUnitState == CacheState.INVALID || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
+      CacheState resolvedUnitState =
+          htmlEntry.getState(HtmlEntry.RESOLVED_UNIT);
+      if (resolvedUnitState == CacheState.INVALID ||
+          (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
         return _createResolveHtmlTask(source, htmlEntry);
       }
       //
@@ -3313,13 +3724,17 @@
       //
       if (_options.analyzeAngular) {
         // Try to resolve the HTML as an Angular entry point.
-        CacheState angularEntryState = htmlEntry.getState(HtmlEntry.ANGULAR_ENTRY);
-        if (angularEntryState == CacheState.INVALID || (isPriority && angularEntryState == CacheState.FLUSHED)) {
+        CacheState angularEntryState =
+            htmlEntry.getState(HtmlEntry.ANGULAR_ENTRY);
+        if (angularEntryState == CacheState.INVALID ||
+            (isPriority && angularEntryState == CacheState.FLUSHED)) {
           return _createResolveAngularEntryHtmlTask(source, htmlEntry);
         }
         // Try to resolve the HTML as an Angular application part.
-        CacheState angularErrorsState = htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
-        if (angularErrorsState == CacheState.INVALID || (isPriority && angularErrorsState == CacheState.FLUSHED)) {
+        CacheState angularErrorsState =
+            htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
+        if (angularErrorsState == CacheState.INVALID ||
+            (isPriority && angularErrorsState == CacheState.FLUSHED)) {
           return _createResolveAngularComponentTemplateTask(source, htmlEntry);
         }
       }
@@ -3328,13 +3743,17 @@
       //
       if (_options.analyzePolymer) {
         // Build elements.
-        CacheState polymerBuildErrorsState = htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
-        if (polymerBuildErrorsState == CacheState.INVALID || (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
+        CacheState polymerBuildErrorsState =
+            htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
+        if (polymerBuildErrorsState == CacheState.INVALID ||
+            (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
           return _createPolymerBuildHtmlTask(source, htmlEntry);
         }
         // Resolve references.
-        CacheState polymerResolutionErrorsState = htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
-        if (polymerResolutionErrorsState == CacheState.INVALID || (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
+        CacheState polymerResolutionErrorsState =
+            htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
+        if (polymerResolutionErrorsState == CacheState.INVALID ||
+            (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
           return _createPolymerResolveHtmlTask(source, htmlEntry);
         }
       }
@@ -3408,15 +3827,6 @@
   }
 
   /**
-   * Return the cache entry associated with the given source, or `null` if there is no entry
-   * associated with the source.
-   *
-   * @param source the source for which a cache entry is being sought
-   * @return the source cache entry associated with the given source
-   */
-  SourceEntry _getReadableSourceEntryOrNull(Source source) => _cache.get(source);
-
-  /**
    * Return a resolved compilation unit corresponding to the given element in the given library, or
    * `null` if the information is not cached.
    *
@@ -3424,12 +3834,16 @@
    * @param librarySource the source representing the library containing the unit
    * @return the specified resolved compilation unit
    */
-  TimestampedData<CompilationUnit> _getResolvedUnit(CompilationUnitElement element, Source librarySource) {
+  TimestampedData<CompilationUnit>
+      _getResolvedUnit(CompilationUnitElement element, Source librarySource) {
     SourceEntry sourceEntry = _cache.get(element.source);
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
-      if (dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) == CacheState.VALID) {
-        return new TimestampedData<CompilationUnit>(dartEntry.modificationTime, dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource));
+      if (dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) ==
+          CacheState.VALID) {
+        return new TimestampedData<CompilationUnit>(
+            dartEntry.modificationTime,
+            dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource));
       }
     }
     return null;
@@ -3467,16 +3881,19 @@
    * @param hintsEnabled `true` if hints are currently enabled
    * @param sources the set to which sources should be added
    */
-  void _getSourcesNeedingProcessing(Source source, SourceEntry sourceEntry, bool isPriority, bool hintsEnabled, HashSet<Source> sources) {
+  void _getSourcesNeedingProcessing(Source source, SourceEntry sourceEntry,
+      bool isPriority, bool hintsEnabled, HashSet<Source> sources) {
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
       CacheState scanErrorsState = dartEntry.getState(DartEntry.SCAN_ERRORS);
-      if (scanErrorsState == CacheState.INVALID || (isPriority && scanErrorsState == CacheState.FLUSHED)) {
+      if (scanErrorsState == CacheState.INVALID ||
+          (isPriority && scanErrorsState == CacheState.FLUSHED)) {
         sources.add(source);
         return;
       }
       CacheState parseErrorsState = dartEntry.getState(DartEntry.PARSE_ERRORS);
-      if (parseErrorsState == CacheState.INVALID || (isPriority && parseErrorsState == CacheState.FLUSHED)) {
+      if (parseErrorsState == CacheState.INVALID ||
+          (isPriority && parseErrorsState == CacheState.FLUSHED)) {
         sources.add(source);
         return;
       }
@@ -3490,31 +3907,41 @@
         SourceEntry libraryEntry = _cache.get(librarySource);
         if (libraryEntry is DartEntry) {
           CacheState elementState = libraryEntry.getState(DartEntry.ELEMENT);
-          if (elementState == CacheState.INVALID || (isPriority && elementState == CacheState.FLUSHED)) {
+          if (elementState == CacheState.INVALID ||
+              (isPriority && elementState == CacheState.FLUSHED)) {
             sources.add(source);
             return;
           }
-          CacheState resolvedUnitState = dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
-          if (resolvedUnitState == CacheState.INVALID || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
-            LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+          CacheState resolvedUnitState =
+              dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+          if (resolvedUnitState == CacheState.INVALID ||
+              (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
+            LibraryElement libraryElement =
+                libraryEntry.getValue(DartEntry.ELEMENT);
             if (libraryElement != null) {
               sources.add(source);
               return;
             }
           }
           if (_generateSdkErrors || !source.isInSystemLibrary) {
-            CacheState verificationErrorsState = dartEntry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource);
-            if (verificationErrorsState == CacheState.INVALID || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
-              LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+            CacheState verificationErrorsState =
+                dartEntry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource);
+            if (verificationErrorsState == CacheState.INVALID ||
+                (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
+              LibraryElement libraryElement =
+                  libraryEntry.getValue(DartEntry.ELEMENT);
               if (libraryElement != null) {
                 sources.add(source);
                 return;
               }
             }
             if (hintsEnabled) {
-              CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
-              if (hintsState == CacheState.INVALID || (isPriority && hintsState == CacheState.FLUSHED)) {
-                LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
+              CacheState hintsState =
+                  dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
+              if (hintsState == CacheState.INVALID ||
+                  (isPriority && hintsState == CacheState.FLUSHED)) {
+                LibraryElement libraryElement =
+                    libraryEntry.getValue(DartEntry.ELEMENT);
                 if (libraryElement != null) {
                   sources.add(source);
                   return;
@@ -3527,27 +3954,35 @@
     } else if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       CacheState parsedUnitState = htmlEntry.getState(HtmlEntry.PARSED_UNIT);
-      if (parsedUnitState == CacheState.INVALID || (isPriority && parsedUnitState == CacheState.FLUSHED)) {
+      if (parsedUnitState == CacheState.INVALID ||
+          (isPriority && parsedUnitState == CacheState.FLUSHED)) {
         sources.add(source);
         return;
       }
-      CacheState resolvedUnitState = htmlEntry.getState(HtmlEntry.RESOLVED_UNIT);
-      if (resolvedUnitState == CacheState.INVALID || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
+      CacheState resolvedUnitState =
+          htmlEntry.getState(HtmlEntry.RESOLVED_UNIT);
+      if (resolvedUnitState == CacheState.INVALID ||
+          (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
         sources.add(source);
         return;
       }
       // Angular
       if (_options.analyzeAngular) {
-        CacheState angularErrorsState = htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
-        if (angularErrorsState == CacheState.INVALID || (isPriority && angularErrorsState == CacheState.FLUSHED)) {
-          AngularApplication entryInfo = htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
+        CacheState angularErrorsState =
+            htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
+        if (angularErrorsState == CacheState.INVALID ||
+            (isPriority && angularErrorsState == CacheState.FLUSHED)) {
+          AngularApplication entryInfo =
+              htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
           if (entryInfo != null) {
             sources.add(source);
             return;
           }
-          AngularApplication applicationInfo = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
+          AngularApplication applicationInfo =
+              htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
           if (applicationInfo != null) {
-            AngularComponentElement component = htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
+            AngularComponentElement component =
+                htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
             if (component != null) {
               sources.add(source);
               return;
@@ -3558,13 +3993,17 @@
       // Polymer
       if (_options.analyzePolymer) {
         // Elements building.
-        CacheState polymerBuildErrorsState = htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
-        if (polymerBuildErrorsState == CacheState.INVALID || (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
+        CacheState polymerBuildErrorsState =
+            htmlEntry.getState(HtmlEntry.POLYMER_BUILD_ERRORS);
+        if (polymerBuildErrorsState == CacheState.INVALID ||
+            (isPriority && polymerBuildErrorsState == CacheState.FLUSHED)) {
           sources.add(source);
         }
         // Resolution.
-        CacheState polymerResolutionErrorsState = htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
-        if (polymerResolutionErrorsState == CacheState.INVALID || (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
+        CacheState polymerResolutionErrorsState =
+            htmlEntry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS);
+        if (polymerResolutionErrorsState == CacheState.INVALID ||
+            (isPriority && polymerResolutionErrorsState == CacheState.FLUSHED)) {
           sources.add(source);
         }
       }
@@ -3580,7 +4019,8 @@
    *          should also be invalidated.
    */
   void _invalidateAllLocalResolutionInformation(bool invalidateUris) {
-    HashMap<Source, List<Source>> oldPartMap = new HashMap<Source, List<Source>>();
+    HashMap<Source, List<Source>> oldPartMap =
+        new HashMap<Source, List<Source>>();
     MapIterator<Source, SourceEntry> iterator = _privatePartition.iterator();
     while (iterator.moveNext()) {
       Source source = iterator.key;
@@ -3613,7 +4053,8 @@
    * @param entryCopy the [HtmlEntry] of the (maybe) Angular entry point being invalidated
    */
   void _invalidateAngularResolution(HtmlEntry entryCopy) {
-    AngularApplication application = entryCopy.getValue(HtmlEntry.ANGULAR_ENTRY);
+    AngularApplication application =
+        entryCopy.getValue(HtmlEntry.ANGULAR_ENTRY);
     if (application == null) {
       return;
     }
@@ -3642,7 +4083,9 @@
       dartEntry.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
       // notify about (disappeared) Angular errors
       ChangeNoticeImpl notice = _getNotice(elementSource);
-      notice.setErrors(dartEntry.allErrors, dartEntry.getValue(SourceEntry.LINE_INFO));
+      notice.setErrors(
+          dartEntry.allErrors,
+          dartEntry.getValue(SourceEntry.LINE_INFO));
     }
   }
 
@@ -3658,12 +4101,14 @@
    * @param librarySource the source of the library being invalidated
    */
   void _invalidateLibraryResolution(Source librarySource) {
-    // TODO(brianwilkerson) This could be optimized. There's no need to flush all of these entries
-    // if the public namespace hasn't changed, which will be a fairly common case. The question is
-    // whether we can afford the time to compute the namespace to look for differences.
+    // TODO(brianwilkerson) This could be optimized. There's no need to flush
+    // all of these entries if the public namespace hasn't changed, which will
+    // be a fairly common case. The question is whether we can afford the time
+    // to compute the namespace to look for differences.
     DartEntry libraryEntry = _getReadableDartEntry(librarySource);
     if (libraryEntry != null) {
-      List<Source> includedParts = libraryEntry.getValue(DartEntry.INCLUDED_PARTS);
+      List<Source> includedParts =
+          libraryEntry.getValue(DartEntry.INCLUDED_PARTS);
       libraryEntry.invalidateAllResolutionInformation(false);
       _workManager.add(librarySource, SourcePriority.LIBRARY);
       for (Source partSource in includedParts) {
@@ -3693,7 +4138,8 @@
    *          infinite recursion
    * @return `true` if this library is, or depends on, dart:html
    */
-  bool _isClient(LibraryElement library, Source htmlSource, HashSet<LibraryElement> visitedLibraries) {
+  bool _isClient(LibraryElement library, Source htmlSource,
+      HashSet<LibraryElement> visitedLibraries) {
     if (visitedLibraries.contains(library)) {
       return false;
     }
@@ -3714,7 +4160,8 @@
     return false;
   }
 
-  bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) => false;
+  bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) =>
+      false;
 
   /**
    * Log the given debugging information.
@@ -3745,96 +4192,98 @@
    * @param errors the errors that were computed
    * @param lineInfo the line information associated with the source
    */
-  void _notifyErrors(Source source, List<AnalysisError> errors, LineInfo lineInfo) {
+  void _notifyErrors(Source source, List<AnalysisError> errors,
+      LineInfo lineInfo) {
     int count = _listeners.length;
     for (int i = 0; i < count; i++) {
       _listeners[i].computedErrors(this, source, errors, lineInfo);
     }
   }
 
-  /**
-   * Notify all of the analysis listeners that the given source is no longer included in the set of
-   * sources that are being analyzed.
-   *
-   * @param source the source that is no longer being analyzed
-   */
-  void _notifyExcludedSource(Source source) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].excludedSource(this, source);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given source is no longer included in the set of
+//   * sources that are being analyzed.
+//   *
+//   * @param source the source that is no longer being analyzed
+//   */
+//  void _notifyExcludedSource(Source source) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].excludedSource(this, source);
+//    }
+//  }
 
-  /**
-   * Notify all of the analysis listeners that the given source is now included in the set of
-   * sources that are being analyzed.
-   *
-   * @param source the source that is now being analyzed
-   */
-  void _notifyIncludedSource(Source source) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].includedSource(this, source);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given source is now included in the set of
+//   * sources that are being analyzed.
+//   *
+//   * @param source the source that is now being analyzed
+//   */
+//  void _notifyIncludedSource(Source source) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].includedSource(this, source);
+//    }
+//  }
 
-  /**
-   * Notify all of the analysis listeners that the given Dart source was parsed.
-   *
-   * @param source the source that was parsed
-   * @param unit the result of parsing the source
-   */
-  void _notifyParsedDart(Source source, CompilationUnit unit) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].parsedDart(this, source, unit);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given Dart source was parsed.
+//   *
+//   * @param source the source that was parsed
+//   * @param unit the result of parsing the source
+//   */
+//  void _notifyParsedDart(Source source, CompilationUnit unit) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].parsedDart(this, source, unit);
+//    }
+//  }
 
-  /**
-   * Notify all of the analysis listeners that the given HTML source was parsed.
-   *
-   * @param source the source that was parsed
-   * @param unit the result of parsing the source
-   */
-  void _notifyParsedHtml(Source source, ht.HtmlUnit unit) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].parsedHtml(this, source, unit);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given HTML source was parsed.
+//   *
+//   * @param source the source that was parsed
+//   * @param unit the result of parsing the source
+//   */
+//  void _notifyParsedHtml(Source source, ht.HtmlUnit unit) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].parsedHtml(this, source, unit);
+//    }
+//  }
 
-  /**
-   * Notify all of the analysis listeners that the given Dart source was resolved.
-   *
-   * @param source the source that was resolved
-   * @param unit the result of resolving the source
-   */
-  void _notifyResolvedDart(Source source, CompilationUnit unit) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].resolvedDart(this, source, unit);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given Dart source was resolved.
+//   *
+//   * @param source the source that was resolved
+//   * @param unit the result of resolving the source
+//   */
+//  void _notifyResolvedDart(Source source, CompilationUnit unit) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].resolvedDart(this, source, unit);
+//    }
+//  }
 
-  /**
-   * Notify all of the analysis listeners that the given HTML source was resolved.
-   *
-   * @param source the source that was resolved
-   * @param unit the result of resolving the source
-   */
-  void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].resolvedHtml(this, source, unit);
-    }
-  }
+//  /**
+//   * Notify all of the analysis listeners that the given HTML source was resolved.
+//   *
+//   * @param source the source that was resolved
+//   * @param unit the result of resolving the source
+//   */
+//  void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) {
+//    int count = _listeners.length;
+//    for (int i = 0; i < count; i++) {
+//      _listeners[i].resolvedHtml(this, source, unit);
+//    }
+//  }
 
   /**
    * Updates [HtmlEntry]s that correspond to the previously known and new Angular application
    * information.
    */
-  void _recordAngularEntryPoint(HtmlEntry entry, ResolveAngularEntryHtmlTask task) {
+  void _recordAngularEntryPoint(HtmlEntry entry,
+      ResolveAngularEntryHtmlTask task) {
     AngularApplication application = task.application;
     if (application != null) {
       _angularApplications.add(application);
@@ -3862,7 +4311,9 @@
       List<Source> newElementSources = application.elementSources;
       for (Source elementSource in newElementSources) {
         DartEntry dartEntry = _getReadableDartEntry(elementSource);
-        dartEntry.setValue(DartEntry.ANGULAR_ERRORS, task.getErrors(elementSource));
+        dartEntry.setValue(
+            DartEntry.ANGULAR_ERRORS,
+            task.getErrors(elementSource));
         // notify about Dart errors
         ChangeNoticeImpl notice = _getNotice(elementSource);
         notice.setErrors(dartEntry.allErrors, computeLineInfo(elementSource));
@@ -3886,7 +4337,10 @@
       throw new AnalysisException('<rethrow>', thrownException);
     }
     dartEntry.setValueInLibrary(DartEntry.BUILT_UNIT, library, task.unit);
-    dartEntry.setValueInLibrary(DartEntry.BUILT_ELEMENT, library, task.unitElement);
+    dartEntry.setValueInLibrary(
+        DartEntry.BUILT_ELEMENT,
+        library,
+        task.unitElement);
     ChangeNoticeImpl notice = _getNotice(source);
     LineInfo lineInfo = dartEntry.getValue(SourceEntry.LINE_INFO);
     notice.setErrors(dartEntry.allErrors, lineInfo);
@@ -3902,10 +4356,13 @@
    * @param librarySource the source for the library used to record information
    * @param htmlSource the source for the HTML library
    */
-  void _recordElementData(DartEntry dartEntry, LibraryElement library, Source librarySource, Source htmlSource) {
+  void _recordElementData(DartEntry dartEntry, LibraryElement library,
+      Source librarySource, Source htmlSource) {
     dartEntry.setValue(DartEntry.ELEMENT, library);
     dartEntry.setValue(DartEntry.IS_LAUNCHABLE, library.entryPoint != null);
-    dartEntry.setValue(DartEntry.IS_CLIENT, _isClient(library, htmlSource, new HashSet<LibraryElement>()));
+    dartEntry.setValue(
+        DartEntry.IS_CLIENT,
+        _isClient(library, htmlSource, new HashSet<LibraryElement>()));
   }
 
   /**
@@ -3918,7 +4375,9 @@
     Source librarySource = task.libraryElement.source;
     CaughtException thrownException = task.exception;
     if (thrownException != null) {
-      dartEntry.recordVerificationErrorInLibrary(librarySource, thrownException);
+      dartEntry.recordVerificationErrorInLibrary(
+          librarySource,
+          thrownException);
       throw new AnalysisException('<rethrow>', thrownException);
     }
     dartEntry.setValueInLibrary(
@@ -3945,9 +4404,11 @@
       // other than the library source.
       DartEntry libraryEntry = _cache.get(librarySource);
       if (thrownException == null) {
-        String message = "GenerateDartHintsTask returned a null hint map "
-            "without throwing an exception: ${librarySource.fullName}";
-        thrownException = new CaughtException(new AnalysisException(message), null);
+        String message =
+            "GenerateDartHintsTask returned a null hint map "
+                "without throwing an exception: ${librarySource.fullName}";
+        thrownException =
+            new CaughtException(new AnalysisException(message), null);
       }
       libraryEntry.recordHintErrorInLibrary(librarySource, thrownException);
       throw new AnalysisException('<rethrow>', thrownException);
@@ -4000,14 +4461,14 @@
    * @return an entry containing the computed results
    * @throws AnalysisException if the results could not be recorded
    */
-  DartEntry _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) {
+  DartEntry
+      _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) {
     CompilationUnit unit = task.compilationUnit;
     if (unit != null) {
       ChangeNoticeImpl notice = _getNotice(task.source);
       notice.compilationUnit = unit;
-      _incrementalAnalysisCache = IncrementalAnalysisCache.cacheResult(
-          task.cache,
-          unit);
+      _incrementalAnalysisCache =
+          IncrementalAnalysisCache.cacheResult(task.cache, unit);
     }
     return null;
   }
@@ -4038,9 +4499,8 @@
     } else {
       // The file contains no directives.
       List<Source> containingLibraries = dartEntry.containingLibraries;
-      if (containingLibraries.length > 1
-          || (containingLibraries.length == 1
-              && containingLibraries[0] != source)) {
+      if (containingLibraries.length > 1 ||
+          (containingLibraries.length == 1 && containingLibraries[0] != source)) {
         dartEntry.setValue(DartEntry.SOURCE_KIND, SourceKind.PART);
         dartEntry.removeContainingLibrary(source);
         _workManager.add(source, SourcePriority.NORMAL_PART);
@@ -4094,7 +4554,9 @@
     htmlEntry.setValue(SourceEntry.LINE_INFO, lineInfo);
     htmlEntry.setValue(HtmlEntry.PARSED_UNIT, task.htmlUnit);
     htmlEntry.setValue(HtmlEntry.PARSE_ERRORS, task.errors);
-    htmlEntry.setValue(HtmlEntry.REFERENCED_LIBRARIES, task.referencedLibraries);
+    htmlEntry.setValue(
+        HtmlEntry.REFERENCED_LIBRARIES,
+        task.referencedLibraries);
     _cache.storedAst(source);
     ChangeNoticeImpl notice = _getNotice(source);
     notice.setErrors(htmlEntry.allErrors, lineInfo);
@@ -4145,7 +4607,8 @@
    * Record the results produced by performing a [task] and return the cache
    * entry associated with the results.
    */
-  HtmlEntry _recordResolveAngularComponentTemplateTaskResults(ResolveAngularComponentTemplateTask task) {
+  HtmlEntry
+      _recordResolveAngularComponentTemplateTaskResults(ResolveAngularComponentTemplateTask task) {
     Source source = task.source;
     HtmlEntry htmlEntry = _cache.get(source);
     CaughtException thrownException = task.exception;
@@ -4166,7 +4629,8 @@
    * Record the results produced by performing a [task] and return the cache
    * entry associated with the results.
    */
-  HtmlEntry _recordResolveAngularEntryHtmlTaskResults(ResolveAngularEntryHtmlTask task) {
+  HtmlEntry
+      _recordResolveAngularEntryHtmlTaskResults(ResolveAngularEntryHtmlTask task) {
     Source source = task.source;
     HtmlEntry htmlEntry = _cache.get(source);
     CaughtException thrownException = task.exception;
@@ -4294,7 +4758,8 @@
           DartEntry partEntry = _getReadableDartEntry(partSource);
           if (partEntry != null) {
             partEntry.removeContainingLibrary(librarySource);
-            if (partEntry.containingLibraries.length == 0 && !exists(partSource)) {
+            if (partEntry.containingLibraries.length == 0 &&
+                !exists(partSource)) {
               _cache.remove(partSource);
             }
           }
@@ -4353,9 +4818,11 @@
    */
   void _sourceChanged(Source source) {
     SourceEntry sourceEntry = _cache.get(source);
-    if (sourceEntry == null || sourceEntry.modificationTime == getModificationStamp(source)) {
-      // Either we have removed this source, in which case we don't care that it is changed, or we
-      // have already invalidated the cache and don't need to invalidate it again.
+    if (sourceEntry == null ||
+        sourceEntry.modificationTime == getModificationStamp(source)) {
+      // Either we have removed this source, in which case we don't care that
+      // it is changed, or we have already invalidated the cache and don't need
+      // to invalidate it again.
       return;
     }
     if (sourceEntry is HtmlEntry) {
@@ -4369,7 +4836,9 @@
       List<Source> containingLibraries = getLibrariesContaining(source);
       HashSet<Source> librariesToInvalidate = new HashSet<Source>();
       for (Source containingLibrary in containingLibraries) {
-        _computeAllLibrariesDependingOn(containingLibrary, librariesToInvalidate);
+        _computeAllLibrariesDependingOn(
+            containingLibrary,
+            librariesToInvalidate);
       }
       for (Source library in librariesToInvalidate) {
         _invalidateLibraryResolution(library);
@@ -4393,20 +4862,27 @@
     if (sourceEntry is HtmlEntry) {
       HtmlEntry htmlEntry = sourceEntry;
       _invalidateAngularResolution(htmlEntry);
-      htmlEntry.recordContentError(new CaughtException(new AnalysisException("This source was marked as being deleted"), null));
+      htmlEntry.recordContentError(
+          new CaughtException(
+              new AnalysisException("This source was marked as being deleted"),
+              null));
     } else if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
       HashSet<Source> libraries = new HashSet<Source>();
       for (Source librarySource in getLibrariesContaining(source)) {
         libraries.add(librarySource);
-        for (Source dependentLibrary in getLibrariesDependingOn(librarySource)) {
+        for (Source dependentLibrary in getLibrariesDependingOn(
+            librarySource)) {
           libraries.add(dependentLibrary);
         }
       }
       for (Source librarySource in libraries) {
         _invalidateLibraryResolution(librarySource);
       }
-      dartEntry.recordContentError(new CaughtException(new AnalysisException("This source was marked as being deleted"), null));
+      dartEntry.recordContentError(
+          new CaughtException(
+              new AnalysisException("This source was marked as being deleted"),
+              null));
     }
     _workManager.remove(source);
     _removeFromPriorityOrder(source);
@@ -4425,7 +4901,8 @@
       HashSet<Source> libraries = new HashSet<Source>();
       for (Source librarySource in getLibrariesContaining(source)) {
         libraries.add(librarySource);
-        for (Source dependentLibrary in getLibrariesDependingOn(librarySource)) {
+        for (Source dependentLibrary in getLibrariesDependingOn(
+            librarySource)) {
           libraries.add(dependentLibrary);
         }
       }
@@ -4439,6 +4916,43 @@
   }
 
   /**
+   * TODO(scheglov) A hackish, limited incremental resolution implementation.
+   */
+  bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) {
+    DartEntry dartEntry = _cache.get(unitSource);
+    if (dartEntry == null) {
+      return false;
+    }
+    // prepare the (only) library
+    List<Source> librarySources = getLibrariesContaining(unitSource);
+    if (librarySources.length != 1) {
+      return false;
+    }
+    // do resolution
+    Source librarySource = librarySources[0];
+    CompilationUnit oldUnit =
+        getResolvedCompilationUnit2(unitSource, librarySource);
+    PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
+        typeProvider,
+        unitSource,
+        librarySource,
+        dartEntry);
+    bool success = resolver.resolve(oldUnit, newCode);
+    if (!success) {
+      return false;
+    }
+    // prepare notice
+    ChangeNoticeImpl notice = _getNotice(unitSource);
+    notice.compilationUnit = oldUnit;
+    // TODO(scheglov) apply updated errors
+    {
+      LineInfo lineInfo = getLineInfo(unitSource);
+      notice.setErrors(dartEntry.allErrors, lineInfo);
+    }
+    return true;
+  }
+
+  /**
    * Check the cache for any invalid entries (entries whose modification time does not match the
    * modification time of the source associated with the entry). Invalid entries will be marked as
    * invalid so that the source will be re-analyzed.
@@ -4495,77 +5009,83 @@
  * An `AnalysisTaskResultRecorder` is used by an analysis context to record the
  * results of a task.
  */
-class AnalysisContextImpl_AnalysisTaskResultRecorder implements AnalysisTaskVisitor<SourceEntry> {
+class AnalysisContextImpl_AnalysisTaskResultRecorder implements
+    AnalysisTaskVisitor<SourceEntry> {
   final AnalysisContextImpl AnalysisContextImpl_this;
 
   AnalysisContextImpl_AnalysisTaskResultRecorder(this.AnalysisContextImpl_this);
 
   @override
-  DartEntry visitBuildUnitElementTask(BuildUnitElementTask task)
-      => AnalysisContextImpl_this._recordBuildUnitElementTask(task);
+  DartEntry visitBuildUnitElementTask(BuildUnitElementTask task) =>
+      AnalysisContextImpl_this._recordBuildUnitElementTask(task);
 
   @override
-  DartEntry visitGenerateDartErrorsTask(GenerateDartErrorsTask task)
-      => AnalysisContextImpl_this._recordGenerateDartErrorsTask(task);
+  DartEntry visitGenerateDartErrorsTask(GenerateDartErrorsTask task) =>
+      AnalysisContextImpl_this._recordGenerateDartErrorsTask(task);
 
   @override
-  DartEntry visitGenerateDartHintsTask(GenerateDartHintsTask task)
-      => AnalysisContextImpl_this._recordGenerateDartHintsTask(task);
+  DartEntry visitGenerateDartHintsTask(GenerateDartHintsTask task) =>
+      AnalysisContextImpl_this._recordGenerateDartHintsTask(task);
 
   @override
-  SourceEntry visitGetContentTask(GetContentTask task)
-      => AnalysisContextImpl_this._recordGetContentsTask(task);
+  SourceEntry visitGetContentTask(GetContentTask task) =>
+      AnalysisContextImpl_this._recordGetContentsTask(task);
 
   @override
-  DartEntry visitIncrementalAnalysisTask(IncrementalAnalysisTask task)
-      => AnalysisContextImpl_this._recordIncrementalAnalysisTaskResults(task);
+  DartEntry visitIncrementalAnalysisTask(IncrementalAnalysisTask task) =>
+      AnalysisContextImpl_this._recordIncrementalAnalysisTaskResults(task);
 
   @override
-  DartEntry visitParseDartTask(ParseDartTask task)
-      => AnalysisContextImpl_this._recordParseDartTaskResults(task);
+  DartEntry visitParseDartTask(ParseDartTask task) =>
+      AnalysisContextImpl_this._recordParseDartTaskResults(task);
 
   @override
-  HtmlEntry visitParseHtmlTask(ParseHtmlTask task)
-      => AnalysisContextImpl_this._recordParseHtmlTaskResults(task);
+  HtmlEntry visitParseHtmlTask(ParseHtmlTask task) =>
+      AnalysisContextImpl_this._recordParseHtmlTaskResults(task);
 
   @override
-  HtmlEntry visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task)
-      => AnalysisContextImpl_this._recordPolymerBuildHtmlTaskResults(task);
+  HtmlEntry visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task) =>
+      AnalysisContextImpl_this._recordPolymerBuildHtmlTaskResults(task);
 
   @override
-  HtmlEntry visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task)
-      => AnalysisContextImpl_this._recordPolymerResolveHtmlTaskResults(task);
+  HtmlEntry visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task) =>
+      AnalysisContextImpl_this._recordPolymerResolveHtmlTaskResults(task);
 
   @override
-  HtmlEntry visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task)
-      => AnalysisContextImpl_this._recordResolveAngularComponentTemplateTaskResults(task);
+  HtmlEntry
+      visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task) =>
+      AnalysisContextImpl_this._recordResolveAngularComponentTemplateTaskResults(
+          task);
 
   @override
-  HtmlEntry visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task)
-      => AnalysisContextImpl_this._recordResolveAngularEntryHtmlTaskResults(task);
+  HtmlEntry
+      visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task) =>
+      AnalysisContextImpl_this._recordResolveAngularEntryHtmlTaskResults(task);
 
   @override
-  DartEntry visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task)
-      => AnalysisContextImpl_this.recordResolveDartLibraryCycleTaskResults(task);
+  DartEntry
+      visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task) =>
+      AnalysisContextImpl_this.recordResolveDartLibraryCycleTaskResults(task);
 
   @override
-  DartEntry visitResolveDartLibraryTask(ResolveDartLibraryTask task)
-      => AnalysisContextImpl_this.recordResolveDartLibraryTaskResults(task);
+  DartEntry visitResolveDartLibraryTask(ResolveDartLibraryTask task) =>
+      AnalysisContextImpl_this.recordResolveDartLibraryTaskResults(task);
 
   @override
-  DartEntry visitResolveDartUnitTask(ResolveDartUnitTask task)
-      => AnalysisContextImpl_this._recordResolveDartUnitTaskResults(task);
+  DartEntry visitResolveDartUnitTask(ResolveDartUnitTask task) =>
+      AnalysisContextImpl_this._recordResolveDartUnitTaskResults(task);
 
   @override
-  HtmlEntry visitResolveHtmlTask(ResolveHtmlTask task)
-      => AnalysisContextImpl_this._recordResolveHtmlTaskResults(task);
+  HtmlEntry visitResolveHtmlTask(ResolveHtmlTask task) =>
+      AnalysisContextImpl_this._recordResolveHtmlTaskResults(task);
 
   @override
-  DartEntry visitScanDartTask(ScanDartTask task)
-      => AnalysisContextImpl_this._recordScanDartTaskResults(task);
+  DartEntry visitScanDartTask(ScanDartTask task) =>
+      AnalysisContextImpl_this._recordScanDartTaskResults(task);
 }
 
-class AnalysisContextImpl_ContextRetentionPolicy implements CacheRetentionPolicy {
+class AnalysisContextImpl_ContextRetentionPolicy implements CacheRetentionPolicy
+    {
   final AnalysisContextImpl AnalysisContextImpl_this;
 
   AnalysisContextImpl_ContextRetentionPolicy(this.AnalysisContextImpl_this);
@@ -4578,7 +5098,8 @@
         return RetentionPriority.HIGH;
       }
     }
-    if (AnalysisContextImpl_this._neededForResolution != null && AnalysisContextImpl_this._neededForResolution.contains(source)) {
+    if (AnalysisContextImpl_this._neededForResolution != null &&
+        AnalysisContextImpl_this._neededForResolution.contains(source)) {
       return RetentionPriority.HIGH;
     }
     if (sourceEntry is DartEntry) {
@@ -4590,7 +5111,10 @@
     return RetentionPriority.LOW;
   }
 
-  bool _astIsNeeded(DartEntry dartEntry) => dartEntry.hasInvalidData(DartEntry.HINTS) || dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) || dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
+  bool _astIsNeeded(DartEntry dartEntry) =>
+      dartEntry.hasInvalidData(DartEntry.HINTS) ||
+          dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) ||
+          dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
 }
 
 /**
@@ -4604,7 +5128,8 @@
    * A table mapping the sources of the defining compilation units of libraries to the
    * representation of the library that has the information needed to resolve the library.
    */
-  HashMap<Source, ResolvableLibrary> _libraryMap = new HashMap<Source, ResolvableLibrary>();
+  HashMap<Source, ResolvableLibrary> _libraryMap =
+      new HashMap<Source, ResolvableLibrary>();
 
   /**
    * The dependency graph used to compute the libraries in the cycle.
@@ -4628,6 +5153,23 @@
   AnalysisContextImpl_CycleBuilder(this.AnalysisContextImpl_this) : super();
 
   /**
+   * Return a list containing the libraries that are ready to be resolved (assuming that
+   * [getTaskData] returns `null`).
+   *
+   * @return the libraries that are ready to be resolved
+   */
+  List<ResolvableLibrary> get librariesInCycle => _librariesInCycle;
+
+  /**
+   * Return a representation of an analysis task that needs to be performed before the cycle of
+   * libraries can be resolved, or `null` if the libraries are ready to be resolved.
+   *
+   * @return the analysis task that needs to be performed before the cycle of libraries can be
+   *         resolved
+   */
+  AnalysisContextImpl_TaskData get taskData => _taskData;
+
+  /**
    * Compute a list of the libraries that need to be resolved together in order to resolve the
    * given library.
    *
@@ -4653,10 +5195,13 @@
     //
     _ensureImportsAndExports();
     if (_taskData != null) {
-      // At least one imported library needs to be resolved before the target library.
+      // At least one imported library needs to be resolved before the target
+      // library.
       AnalysisTask task = _taskData.task;
       if (task is ResolveDartLibraryTask) {
-        AnalysisContextImpl_this._workManager.addFirst(task.librarySource, SourcePriority.LIBRARY);
+        AnalysisContextImpl_this._workManager.addFirst(
+            task.librarySource,
+            SourcePriority.LIBRARY);
       }
       return;
     }
@@ -4665,29 +5210,13 @@
       // At least one part needs to be parsed.
       return;
     }
-    // All of the AST's necessary to perform a resolution of the library cycle have been
-    // gathered, so it is no longer necessary to retain them in the cache.
+    // All of the AST's necessary to perform a resolution of the library cycle
+    // have been gathered, so it is no longer necessary to retain them in the
+    // cache.
     AnalysisContextImpl_this._neededForResolution = null;
   }
 
   /**
-   * Return a list containing the libraries that are ready to be resolved (assuming that
-   * [getTaskData] returns `null`).
-   *
-   * @return the libraries that are ready to be resolved
-   */
-  List<ResolvableLibrary> get librariesInCycle => _librariesInCycle;
-
-  /**
-   * Return a representation of an analysis task that needs to be performed before the cycle of
-   * libraries can be resolved, or `null` if the libraries are ready to be resolved.
-   *
-   * @return the analysis task that needs to be performed before the cycle of libraries can be
-   *         resolved
-   */
-  AnalysisContextImpl_TaskData get taskData => _taskData;
-
-  /**
    * Recursively traverse the libraries reachable from the given library, creating instances of
    * the class [Library] to represent them, and record the references in the library
    * objects.
@@ -4697,16 +5226,22 @@
    */
   void _computeLibraryDependencies(ResolvableLibrary library) {
     Source librarySource = library.librarySource;
-    DartEntry dartEntry = AnalysisContextImpl_this._getReadableDartEntry(librarySource);
-    List<Source> importedSources = _getSources(librarySource, dartEntry, DartEntry.IMPORTED_LIBRARIES);
+    DartEntry dartEntry =
+        AnalysisContextImpl_this._getReadableDartEntry(librarySource);
+    List<Source> importedSources =
+        _getSources(librarySource, dartEntry, DartEntry.IMPORTED_LIBRARIES);
     if (_taskData != null) {
       return;
     }
-    List<Source> exportedSources = _getSources(librarySource, dartEntry, DartEntry.EXPORTED_LIBRARIES);
+    List<Source> exportedSources =
+        _getSources(librarySource, dartEntry, DartEntry.EXPORTED_LIBRARIES);
     if (_taskData != null) {
       return;
     }
-    _computeLibraryDependenciesFromDirectives(library, importedSources, exportedSources);
+    _computeLibraryDependenciesFromDirectives(
+        library,
+        importedSources,
+        exportedSources);
   }
 
   /**
@@ -4720,7 +5255,8 @@
    * @param exportedSources an array containing the sources that are exported from the given
    *          library
    */
-  void _computeLibraryDependenciesFromDirectives(ResolvableLibrary library, List<Source> importedSources, List<Source> exportedSources) {
+  void _computeLibraryDependenciesFromDirectives(ResolvableLibrary library,
+      List<Source> importedSources, List<Source> exportedSources) {
     int importCount = importedSources.length;
     if (importCount > 0) {
       List<ResolvableLibrary> importedLibraries = new List<ResolvableLibrary>();
@@ -4746,10 +5282,13 @@
         }
       }
       library.explicitlyImportsCore = explicitlyImportsCore;
-      if (!explicitlyImportsCore && AnalysisContextImpl_this._coreLibrarySource != library.librarySource) {
-        ResolvableLibrary importedLibrary = _libraryMap[AnalysisContextImpl_this._coreLibrarySource];
+      if (!explicitlyImportsCore &&
+          AnalysisContextImpl_this._coreLibrarySource != library.librarySource) {
+        ResolvableLibrary importedLibrary =
+            _libraryMap[AnalysisContextImpl_this._coreLibrarySource];
         if (importedLibrary == null) {
-          importedLibrary = _createLibraryOrNull(AnalysisContextImpl_this._coreLibrarySource);
+          importedLibrary =
+              _createLibraryOrNull(AnalysisContextImpl_this._coreLibrarySource);
           if (importedLibrary != null) {
             _computeLibraryDependencies(importedLibrary);
             if (_taskData != null) {
@@ -4765,9 +5304,11 @@
       library.importedLibraries = importedLibraries;
     } else {
       library.explicitlyImportsCore = false;
-      ResolvableLibrary importedLibrary = _libraryMap[AnalysisContextImpl_this._coreLibrarySource];
+      ResolvableLibrary importedLibrary =
+          _libraryMap[AnalysisContextImpl_this._coreLibrarySource];
       if (importedLibrary == null) {
-        importedLibrary = _createLibraryOrNull(AnalysisContextImpl_this._coreLibrarySource);
+        importedLibrary =
+            _createLibraryOrNull(AnalysisContextImpl_this._coreLibrarySource);
         if (importedLibrary != null) {
           _computeLibraryDependencies(importedLibrary);
           if (_taskData != null) {
@@ -4777,7 +5318,7 @@
       }
       if (importedLibrary != null) {
         _dependencyGraph.addEdge(library, importedLibrary);
-        library.importedLibraries = <ResolvableLibrary> [importedLibrary];
+        library.importedLibraries = <ResolvableLibrary>[importedLibrary];
       }
     }
     int exportCount = exportedSources.length;
@@ -4813,14 +5354,17 @@
    */
   void _computePartsInCycle(Source librarySource) {
     int count = _librariesInCycle.length;
-    List<CycleBuilder_LibraryPair> libraryData = new List<CycleBuilder_LibraryPair>();
+    List<CycleBuilder_LibraryPair> libraryData =
+        new List<CycleBuilder_LibraryPair>();
     for (int i = 0; i < count; i++) {
       ResolvableLibrary library = _librariesInCycle[i];
-      libraryData.add(new CycleBuilder_LibraryPair(library, _ensurePartsInLibrary(library)));
+      libraryData.add(
+          new CycleBuilder_LibraryPair(library, _ensurePartsInLibrary(library)));
     }
     AnalysisContextImpl_this._neededForResolution = _gatherSources(libraryData);
     if (AnalysisContextImpl._TRACE_PERFORM_TASK) {
-      print("  preserve resolution data for ${AnalysisContextImpl_this._neededForResolution.length} sources while resolving ${librarySource.fullName}");
+      print(
+          "  preserve resolution data for ${AnalysisContextImpl_this._neededForResolution.length} sources while resolving ${librarySource.fullName}");
     }
     if (_taskData != null) {
       return;
@@ -4841,12 +5385,14 @@
     ResolvableLibrary library = libraryPair.library;
     List<CycleBuilder_SourceEntryPair> entryPairs = libraryPair.entryPairs;
     int count = entryPairs.length;
-    List<ResolvableCompilationUnit> units = new List<ResolvableCompilationUnit>(count);
+    List<ResolvableCompilationUnit> units =
+        new List<ResolvableCompilationUnit>(count);
     for (int i = 0; i < count; i++) {
       CycleBuilder_SourceEntryPair entryPair = entryPairs[i];
       Source source = entryPair.source;
       DartEntry dartEntry = entryPair.entry;
-      units[i] = new ResolvableCompilationUnit(source, dartEntry.resolvableCompilationUnit);
+      units[i] =
+          new ResolvableCompilationUnit(source, dartEntry.resolvableCompilationUnit);
     }
     library.resolvableCompilationUnits = units;
   }
@@ -4860,9 +5406,11 @@
    */
   ResolvableLibrary _createLibrary(Source librarySource) {
     ResolvableLibrary library = new ResolvableLibrary(librarySource);
-    SourceEntry sourceEntry = AnalysisContextImpl_this._cache.get(librarySource);
+    SourceEntry sourceEntry =
+        AnalysisContextImpl_this._cache.get(librarySource);
     if (sourceEntry is DartEntry) {
-      LibraryElementImpl libraryElement = sourceEntry.getValue(DartEntry.ELEMENT) as LibraryElementImpl;
+      LibraryElementImpl libraryElement =
+          sourceEntry.getValue(DartEntry.ELEMENT) as LibraryElementImpl;
       if (libraryElement != null) {
         library.libraryElement = libraryElement;
       }
@@ -4880,9 +5428,11 @@
    */
   ResolvableLibrary _createLibraryOrNull(Source librarySource) {
     ResolvableLibrary library = new ResolvableLibrary(librarySource);
-    SourceEntry sourceEntry = AnalysisContextImpl_this._cache.get(librarySource);
+    SourceEntry sourceEntry =
+        AnalysisContextImpl_this._cache.get(librarySource);
     if (sourceEntry is DartEntry) {
-      LibraryElementImpl libraryElement = sourceEntry.getValue(DartEntry.ELEMENT) as LibraryElementImpl;
+      LibraryElementImpl libraryElement =
+          sourceEntry.getValue(DartEntry.ELEMENT) as LibraryElementImpl;
       if (libraryElement != null) {
         library.libraryElement = libraryElement;
       }
@@ -4899,11 +5449,17 @@
    */
   void _ensureElementModel(ResolvableLibrary library) {
     Source librarySource = library.librarySource;
-    DartEntry libraryEntry = AnalysisContextImpl_this._getReadableDartEntry(librarySource);
-    if (libraryEntry != null && libraryEntry.getState(DartEntry.PARSED_UNIT) != CacheState.ERROR) {
-      AnalysisContextImpl_this._workManager.addFirst(librarySource, SourcePriority.LIBRARY);
+    DartEntry libraryEntry =
+        AnalysisContextImpl_this._getReadableDartEntry(librarySource);
+    if (libraryEntry != null &&
+        libraryEntry.getState(DartEntry.PARSED_UNIT) != CacheState.ERROR) {
+      AnalysisContextImpl_this._workManager.addFirst(
+          librarySource,
+          SourcePriority.LIBRARY);
       if (_taskData == null) {
-        _taskData = AnalysisContextImpl_this._createResolveDartLibraryTask(librarySource, libraryEntry);
+        _taskData = AnalysisContextImpl_this._createResolveDartLibraryTask(
+            librarySource,
+            libraryEntry);
       }
     }
   }
@@ -4915,12 +5471,14 @@
    *
    * @param library the library being tested
    */
-  void _ensureExports(ResolvableLibrary library, HashSet<Source> visitedLibraries) {
+  void _ensureExports(ResolvableLibrary library,
+      HashSet<Source> visitedLibraries) {
     List<ResolvableLibrary> dependencies = library.exports;
     int dependencyCount = dependencies.length;
     for (int i = 0; i < dependencyCount; i++) {
       ResolvableLibrary dependency = dependencies[i];
-      if (!_librariesInCycle.contains(dependency) && visitedLibraries.add(dependency.librarySource)) {
+      if (!_librariesInCycle.contains(dependency) &&
+          visitedLibraries.add(dependency.librarySource)) {
         if (dependency.libraryElement == null) {
           _ensureElementModel(dependency);
         } else {
@@ -4945,7 +5503,8 @@
     int dependencyCount = dependencies.length;
     for (int i = 0; i < dependencyCount; i++) {
       ResolvableLibrary dependency = dependencies[i];
-      if (!_librariesInCycle.contains(dependency) && dependency.libraryElement == null) {
+      if (!_librariesInCycle.contains(dependency) &&
+          dependency.libraryElement == null) {
         _ensureElementModel(dependency);
         if (_taskData != null) {
           return;
@@ -4981,28 +5540,39 @@
    * @param library the library for which resolvable compilation units must be available
    * @return a list of (source, entry) pairs for all of the compilation units in the library
    */
-  List<CycleBuilder_SourceEntryPair> _ensurePartsInLibrary(ResolvableLibrary library) {
-    List<CycleBuilder_SourceEntryPair> pairs = new List<CycleBuilder_SourceEntryPair>();
+  List<CycleBuilder_SourceEntryPair>
+      _ensurePartsInLibrary(ResolvableLibrary library) {
+    List<CycleBuilder_SourceEntryPair> pairs =
+        new List<CycleBuilder_SourceEntryPair>();
     Source librarySource = library.librarySource;
-    DartEntry libraryEntry = AnalysisContextImpl_this._getReadableDartEntry(librarySource);
+    DartEntry libraryEntry =
+        AnalysisContextImpl_this._getReadableDartEntry(librarySource);
     if (libraryEntry == null) {
-      throw new AnalysisException("Cannot find entry for ${librarySource.fullName}");
-    } else if (libraryEntry.getState(DartEntry.PARSED_UNIT) == CacheState.ERROR) {
-      String message = "Cannot compute parsed unit for ${librarySource.fullName}";
+      throw new AnalysisException(
+          "Cannot find entry for ${librarySource.fullName}");
+    } else if (libraryEntry.getState(DartEntry.PARSED_UNIT) ==
+        CacheState.ERROR) {
+      String message =
+          "Cannot compute parsed unit for ${librarySource.fullName}";
       CaughtException exception = libraryEntry.exception;
       if (exception == null) {
         throw new AnalysisException(message);
       }
-      throw new AnalysisException(message, new CaughtException(exception, null));
+      throw new AnalysisException(
+          message,
+          new CaughtException(exception, null));
     }
     _ensureResolvableCompilationUnit(librarySource, libraryEntry);
     pairs.add(new CycleBuilder_SourceEntryPair(librarySource, libraryEntry));
-    List<Source> partSources = _getSources(librarySource, libraryEntry, DartEntry.INCLUDED_PARTS);
+    List<Source> partSources =
+        _getSources(librarySource, libraryEntry, DartEntry.INCLUDED_PARTS);
     int count = partSources.length;
     for (int i = 0; i < count; i++) {
       Source partSource = partSources[i];
-      DartEntry partEntry = AnalysisContextImpl_this._getReadableDartEntry(partSource);
-      if (partEntry != null && partEntry.getState(DartEntry.PARSED_UNIT) != CacheState.ERROR) {
+      DartEntry partEntry =
+          AnalysisContextImpl_this._getReadableDartEntry(partSource);
+      if (partEntry != null &&
+          partEntry.getState(DartEntry.PARSED_UNIT) != CacheState.ERROR) {
         _ensureResolvableCompilationUnit(partSource, partEntry);
         pairs.add(new CycleBuilder_SourceEntryPair(partSource, partEntry));
       }
@@ -5020,7 +5590,8 @@
     // The entry will be null if the source represents a non-Dart file.
     if (dartEntry != null && !dartEntry.hasResolvableCompilationUnit) {
       if (_taskData == null) {
-        _taskData = AnalysisContextImpl_this._createParseDartTask(source, dartEntry);
+        _taskData =
+            AnalysisContextImpl_this._createParseDartTask(source, dartEntry);
       }
     }
   }
@@ -5046,7 +5617,8 @@
    * @param descriptor the descriptor indicating which sources are to be returned
    * @return the sources described by the given descriptor
    */
-  List<Source> _getSources(Source source, DartEntry dartEntry, DataDescriptor<List<Source>> descriptor) {
+  List<Source> _getSources(Source source, DartEntry dartEntry,
+      DataDescriptor<List<Source>> descriptor) {
     if (dartEntry == null) {
       return Source.EMPTY_ARRAY;
     }
@@ -5055,7 +5627,8 @@
       return Source.EMPTY_ARRAY;
     } else if (exportState != CacheState.VALID) {
       if (_taskData == null) {
-        _taskData = AnalysisContextImpl_this._createParseDartTask(source, dartEntry);
+        _taskData =
+            AnalysisContextImpl_this._createParseDartTask(source, dartEntry);
       }
       return Source.EMPTY_ARRAY;
     }
@@ -5140,115 +5713,6 @@
 }
 
 /**
- * Implementation of the [AnalysisContextStatistics].
- */
-class AnalysisContextStatisticsImpl implements AnalysisContextStatistics {
-  Map<String, AnalysisContextStatistics_CacheRow> _dataMap = new HashMap<String, AnalysisContextStatistics_CacheRow>();
-
-  List<Source> _sources = new List<Source>();
-
-  HashSet<CaughtException> _exceptions = new HashSet<CaughtException>();
-
-  List<AnalysisContextStatistics_PartitionData> _partitionData;
-
-  void addSource(Source source) {
-    _sources.add(source);
-  }
-
-  @override
-  List<AnalysisContextStatistics_CacheRow> get cacheRows
-      => _dataMap.values.toList();
-
-  @override
-  List<CaughtException> get exceptions => new List.from(_exceptions);
-
-  @override
-  List<AnalysisContextStatistics_PartitionData> get partitionData => _partitionData;
-
-  @override
-  List<Source> get sources => _sources;
-
-  /**
-   * Set the partition data returned by this object to the given data.
-   */
-  void set partitionData(List<AnalysisContextStatistics_PartitionData> data) {
-    _partitionData = data;
-  }
-
-  void _internalPutCacheItem(Source source, SourceEntry dartEntry,
-                             DataDescriptor rowDesc, CacheState state) {
-    String rowName = rowDesc.toString();
-    AnalysisContextStatisticsImpl_CacheRowImpl row = _dataMap[rowName] as AnalysisContextStatisticsImpl_CacheRowImpl;
-    if (row == null) {
-      row = new AnalysisContextStatisticsImpl_CacheRowImpl(rowName);
-      _dataMap[rowName] = row;
-    }
-    row._incState(state);
-    if (state == CacheState.ERROR) {
-      CaughtException exception = dartEntry.exception;
-      if (exception != null) {
-        _exceptions.add(exception);
-      }
-    }
-  }
-}
-
-class AnalysisContextStatisticsImpl_CacheRowImpl implements AnalysisContextStatistics_CacheRow {
-  final String name;
-
-  Map<CacheState, int> _counts = <CacheState, int>{};
-
-  AnalysisContextStatisticsImpl_CacheRowImpl(this.name);
-
-  @override
-  bool operator ==(Object obj) => obj is AnalysisContextStatisticsImpl_CacheRowImpl && obj.name == name;
-
-  @override
-  int get errorCount => getCount(CacheState.ERROR);
-
-  @override
-  int get flushedCount => getCount(CacheState.FLUSHED);
-
-  @override
-  int get inProcessCount => getCount(CacheState.IN_PROCESS);
-
-  @override
-  int get invalidCount => getCount(CacheState.INVALID);
-
-  @override
-  int get validCount => getCount(CacheState.VALID);
-
-  @override
-  int get hashCode => name.hashCode;
-
-  @override
-  int getCount(CacheState state) {
-    int count = _counts[state];
-    if (count != null) {
-      return count;
-    } else {
-      return 0;
-    }
-  }
-
-  void _incState(CacheState state) {
-    if (_counts[state] == null) {
-      _counts[state] = 1;
-    } else {
-      _counts[state]++;
-    }
-  }
-}
-
-class AnalysisContextStatisticsImpl_PartitionDataImpl implements AnalysisContextStatistics_PartitionData {
-  final int astCount;
-
-  final int totalCount;
-
-  AnalysisContextStatisticsImpl_PartitionDataImpl(this.astCount, this.totalCount);
-}
-
-/**
  * Information about single piece of data in the cache.
  */
 abstract class AnalysisContextStatistics_CacheRow {
@@ -5256,13 +5720,11 @@
    * List of possible states which can be queried.
    */
   static const List<CacheState> STATES = const <CacheState>[
-      CacheState.ERROR, CacheState.FLUSHED, CacheState.IN_PROCESS,
-      CacheState.INVALID, CacheState.VALID];
-
-  /**
-   * Return the number of entries whose state is [state].
-   */
-  int getCount(CacheState state);
+      CacheState.ERROR,
+      CacheState.FLUSHED,
+      CacheState.IN_PROCESS,
+      CacheState.INVALID,
+      CacheState.VALID];
 
   /**
    * Return the number of entries whose state is [CacheState.ERROR].
@@ -5293,6 +5755,11 @@
    * Return the number of entries whose state is [CacheState.VALID].
    */
   int get validCount;
+
+  /**
+   * Return the number of entries whose state is [state].
+   */
+  int getCount(CacheState state);
 }
 
 /**
@@ -5312,6 +5779,122 @@
 }
 
 /**
+ * Implementation of the [AnalysisContextStatistics].
+ */
+class AnalysisContextStatisticsImpl implements AnalysisContextStatistics {
+  Map<String, AnalysisContextStatistics_CacheRow> _dataMap =
+      new HashMap<String, AnalysisContextStatistics_CacheRow>();
+
+  List<Source> _sources = new List<Source>();
+
+  HashSet<CaughtException> _exceptions = new HashSet<CaughtException>();
+
+  List<AnalysisContextStatistics_PartitionData> _partitionData;
+
+  @override
+  List<AnalysisContextStatistics_CacheRow> get cacheRows =>
+      _dataMap.values.toList();
+
+  @override
+  List<CaughtException> get exceptions => new List.from(_exceptions);
+
+  @override
+  List<AnalysisContextStatistics_PartitionData> get partitionData =>
+      _partitionData;
+
+  /**
+   * Set the partition data returned by this object to the given data.
+   */
+  void set partitionData(List<AnalysisContextStatistics_PartitionData> data) {
+    _partitionData = data;
+  }
+
+  @override
+  List<Source> get sources => _sources;
+
+  void addSource(Source source) {
+    _sources.add(source);
+  }
+
+  void _internalPutCacheItem(Source source, SourceEntry dartEntry,
+      DataDescriptor rowDesc, CacheState state) {
+    String rowName = rowDesc.toString();
+    AnalysisContextStatisticsImpl_CacheRowImpl row =
+        _dataMap[rowName] as AnalysisContextStatisticsImpl_CacheRowImpl;
+    if (row == null) {
+      row = new AnalysisContextStatisticsImpl_CacheRowImpl(rowName);
+      _dataMap[rowName] = row;
+    }
+    row._incState(state);
+    if (state == CacheState.ERROR) {
+      CaughtException exception = dartEntry.exception;
+      if (exception != null) {
+        _exceptions.add(exception);
+      }
+    }
+  }
+}
+
+class AnalysisContextStatisticsImpl_CacheRowImpl implements
+    AnalysisContextStatistics_CacheRow {
+  final String name;
+
+  Map<CacheState, int> _counts = <CacheState, int>{};
+
+  AnalysisContextStatisticsImpl_CacheRowImpl(this.name);
+
+  @override
+  int get errorCount => getCount(CacheState.ERROR);
+
+  @override
+  int get flushedCount => getCount(CacheState.FLUSHED);
+
+  @override
+  int get hashCode => name.hashCode;
+
+  @override
+  int get inProcessCount => getCount(CacheState.IN_PROCESS);
+
+  @override
+  int get invalidCount => getCount(CacheState.INVALID);
+
+  @override
+  int get validCount => getCount(CacheState.VALID);
+
+  @override
+  bool operator ==(Object obj) =>
+      obj is AnalysisContextStatisticsImpl_CacheRowImpl && obj.name == name;
+
+  @override
+  int getCount(CacheState state) {
+    int count = _counts[state];
+    if (count != null) {
+      return count;
+    } else {
+      return 0;
+    }
+  }
+
+  void _incState(CacheState state) {
+    if (_counts[state] == null) {
+      _counts[state] = 1;
+    } else {
+      _counts[state]++;
+    }
+  }
+}
+
+class AnalysisContextStatisticsImpl_PartitionDataImpl implements
+    AnalysisContextStatistics_PartitionData {
+  final int astCount;
+
+  final int totalCount;
+
+  AnalysisContextStatisticsImpl_PartitionDataImpl(this.astCount,
+      this.totalCount);
+}
+
+/**
  * Instances of the class `AnalysisDelta` indicate changes to the types of analysis that
  * should be performed.
  */
@@ -5319,7 +5902,8 @@
   /**
    * A mapping from source to what type of analysis should be performed on that source.
    */
-  HashMap<Source, AnalysisLevel> _analysisMap = new HashMap<Source, AnalysisLevel>();
+  HashMap<Source, AnalysisLevel> _analysisMap =
+      new HashMap<Source, AnalysisLevel>();
 
   /**
    * Return a collection of the sources that have been added. This is equivalent to calling
@@ -5359,7 +5943,8 @@
   String toString() {
     StringBuffer buffer = new StringBuffer();
     bool needsSeparator = _appendSources(buffer, false, AnalysisLevel.ALL);
-    needsSeparator = _appendSources(buffer, needsSeparator, AnalysisLevel.RESOLVED);
+    needsSeparator =
+        _appendSources(buffer, needsSeparator, AnalysisLevel.RESOLVED);
     _appendSources(buffer, needsSeparator, AnalysisLevel.NONE);
     return buffer.toString();
   }
@@ -5368,7 +5953,8 @@
    * Appendto the given [builder] all sources with the given analysis [level],
    * prefixed with a label and a separator if [needsSeparator] is `true`.
    */
-  bool _appendSources(StringBuffer buffer, bool needsSeparator, AnalysisLevel level) {
+  bool _appendSources(StringBuffer buffer, bool needsSeparator,
+      AnalysisLevel level) {
     bool first = true;
     _analysisMap.forEach((Source source, AnalysisLevel sourceLevel) {
       if (sourceLevel == level) {
@@ -5422,33 +6008,6 @@
   static AnalysisEngine get instance => _UniqueInstance;
 
   /**
-   * Return `true` if the given file name is assumed to contain Dart source code.
-   *
-   * @param fileName the name of the file being tested
-   * @return `true` if the given file name is assumed to contain Dart source code
-   */
-  static bool isDartFileName(String fileName) {
-    if (fileName == null) {
-      return false;
-    }
-    return javaStringEqualsIgnoreCase(FileNameUtilities.getExtension(fileName), SUFFIX_DART);
-  }
-
-  /**
-   * Return `true` if the given file name is assumed to contain HTML.
-   *
-   * @param fileName the name of the file being tested
-   * @return `true` if the given file name is assumed to contain HTML
-   */
-  static bool isHtmlFileName(String fileName) {
-    if (fileName == null) {
-      return false;
-    }
-    String extension = FileNameUtilities.getExtension(fileName);
-    return javaStringEqualsIgnoreCase(extension, SUFFIX_HTML) || javaStringEqualsIgnoreCase(extension, SUFFIX_HTM);
-  }
-
-  /**
    * The logger that should receive information about errors within the analysis engine.
    */
   Logger _logger = Logger.NULL;
@@ -5470,29 +6029,6 @@
   bool strictUnionTypes = false;
 
   /**
-   * Clear any caches holding on to analysis results so that a full re-analysis will be performed
-   * the next time an analysis context is created.
-   */
-  void clearCaches() {
-    partitionManager.clearCache();
-  }
-
-  /**
-   * Create a new context in which analysis can be performed.
-   *
-   * @return the analysis context that was created
-   */
-  AnalysisContext createAnalysisContext() {
-    //
-    // If instrumentation is ignoring data, return an uninstrumented analysis context.
-    //
-    if (Instrumentation.isNullLogger) {
-      return new AnalysisContextImpl();
-    }
-    return new InstrumentedAnalysisContextImpl.con1(new AnalysisContextImpl());
-  }
-
-  /**
    * Return the logger that should receive information about errors within the analysis engine.
    *
    * @return the logger that should receive information about errors within the analysis engine
@@ -5509,6 +6045,60 @@
   void set logger(Logger logger) {
     this._logger = logger == null ? Logger.NULL : logger;
   }
+
+  /**
+   * Clear any caches holding on to analysis results so that a full re-analysis will be performed
+   * the next time an analysis context is created.
+   */
+  void clearCaches() {
+    partitionManager.clearCache();
+  }
+
+  /**
+   * Create a new context in which analysis can be performed.
+   *
+   * @return the analysis context that was created
+   */
+  AnalysisContext createAnalysisContext() {
+    //
+    // If instrumentation is ignoring data, return an uninstrumented analysis
+    // context.
+    //
+    if (Instrumentation.isNullLogger) {
+      return new AnalysisContextImpl();
+    }
+    return new InstrumentedAnalysisContextImpl.con1(new AnalysisContextImpl());
+  }
+
+  /**
+   * Return `true` if the given file name is assumed to contain Dart source code.
+   *
+   * @param fileName the name of the file being tested
+   * @return `true` if the given file name is assumed to contain Dart source code
+   */
+  static bool isDartFileName(String fileName) {
+    if (fileName == null) {
+      return false;
+    }
+    return javaStringEqualsIgnoreCase(
+        FileNameUtilities.getExtension(fileName),
+        SUFFIX_DART);
+  }
+
+  /**
+   * Return `true` if the given file name is assumed to contain HTML.
+   *
+   * @param fileName the name of the file being tested
+   * @return `true` if the given file name is assumed to contain HTML
+   */
+  static bool isHtmlFileName(String fileName) {
+    if (fileName == null) {
+      return false;
+    }
+    String extension = FileNameUtilities.getExtension(fileName);
+    return javaStringEqualsIgnoreCase(extension, SUFFIX_HTML) ||
+        javaStringEqualsIgnoreCase(extension, SUFFIX_HTM);
+  }
 }
 
 /**
@@ -5608,7 +6198,8 @@
    * @param errors the errors that were computed
    * @param lineInfo the line information associated with the source
    */
-  void computedErrors(AnalysisContext context, Source source, List<AnalysisError> errors, LineInfo lineInfo);
+  void computedErrors(AnalysisContext context, Source source,
+      List<AnalysisError> errors, LineInfo lineInfo);
 
   /**
    * Reports that the given source is no longer included in the set of sources that are being
@@ -5653,7 +6244,8 @@
    * @param source the source that was resolved
    * @param unit the result of resolving the source in the given context
    */
-  void resolvedDart(AnalysisContext context, Source source, CompilationUnit unit);
+  void resolvedDart(AnalysisContext context, Source source,
+      CompilationUnit unit);
 
   /**
    * Reports that the given HTML source was resolved in the given context.
@@ -5918,7 +6510,8 @@
    * @param taskClassName the name of the class of the task that was performed
    * @param performTime the number of milliseconds required to perform the task
    */
-  AnalysisResult(this._notices, this.getTime, this.taskClassName, this.performTime);
+  AnalysisResult(this._notices, this.getTime, this.taskClassName,
+      this.performTime);
 
   /**
    * Return the change notices associated with this result, or `null` if there were no changes
@@ -5960,6 +6553,21 @@
   AnalysisTask(this.context);
 
   /**
+   * Return the exception that was thrown while performing this task, or `null` if the task
+   * completed successfully.
+   *
+   * @return the exception that was thrown while performing this task
+   */
+  CaughtException get exception => _thrownException;
+
+  /**
+   * Return a textual description of this task.
+   *
+   * @return a textual description of this task
+   */
+  String get taskDescription;
+
+  /**
    * Use the given visitor to visit this task.
    *
    * @param visitor the visitor that should be used to visit this task
@@ -5969,12 +6577,11 @@
   accept(AnalysisTaskVisitor visitor);
 
   /**
-   * Return the exception that was thrown while performing this task, or `null` if the task
-   * completed successfully.
+   * Perform this analysis task, protected by an exception handler.
    *
-   * @return the exception that was thrown while performing this task
+   * @throws AnalysisException if an exception occurs while performing the task
    */
-  CaughtException get exception => _thrownException;
+  void internalPerform();
 
   /**
    * Perform this analysis task and use the given visitor to visit this task after it has completed.
@@ -5999,20 +6606,6 @@
   String toString() => taskDescription;
 
   /**
-   * Return a textual description of this task.
-   *
-   * @return a textual description of this task
-   */
-  String get taskDescription;
-
-  /**
-   * Perform this analysis task, protected by an exception handler.
-   *
-   * @throws AnalysisException if an exception occurs while performing the task
-   */
-  void internalPerform();
-
-  /**
    * Perform this analysis task, ensuring that all exceptions are wrapped in an
    * [AnalysisException].
    *
@@ -6024,7 +6617,9 @@
     } on AnalysisException catch (exception) {
       throw exception;
     } catch (exception, stackTrace) {
-      throw new AnalysisException(exception.toString(), new CaughtException(exception, stackTrace));
+      throw new AnalysisException(
+          exception.toString(),
+          new CaughtException(exception, stackTrace));
     }
   }
 }
@@ -6063,7 +6658,8 @@
    * Visit the given [task], returning the result of the visit. This method will
    * throw an AnalysisException if the visitor throws an exception.
    */
-  E visitIncrementalAnalysisTask(IncrementalAnalysisTask incrementalAnalysisTask);
+  E
+      visitIncrementalAnalysisTask(IncrementalAnalysisTask incrementalAnalysisTask);
 
   /**
    * Visit the given [task], returning the result of the visit. This method will
@@ -6093,7 +6689,8 @@
    * Visit the given [task], returning the result of the visit. This method will
    * throw an AnalysisException if the visitor throws an exception.
    */
-  E visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task);
+  E
+      visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateTask task);
 
   /**
    * Visit the given [task], returning the result of the visit. This method will
@@ -6243,118 +6840,6 @@
 class AngularHtmlUnitResolver extends ht.RecursiveXmlVisitor<Object> {
   static String _NG_APP = "ng-app";
 
-  /**
-   * Checks if given [Element] is an artificial local variable and returns corresponding
-   * [AngularElement], or `null` otherwise.
-   */
-  static AngularElement getAngularElement(Element element) {
-    // may be artificial local variable, replace with AngularElement
-    if (element is LocalVariableElement) {
-      LocalVariableElement local = element;
-      List<ToolkitObjectElement> toolkitObjects = local.toolkitObjects;
-      if (toolkitObjects.length == 1 && toolkitObjects[0] is AngularElement) {
-        return toolkitObjects[0] as AngularElement;
-      }
-    }
-    // not a special Element
-    return null;
-  }
-
-  /**
-   * @return `true` if the given [HtmlUnit] has <code>ng-app</code> annotation.
-   */
-  static bool hasAngularAnnotation(ht.HtmlUnit htmlUnit) {
-    try {
-      htmlUnit.accept(new RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation());
-    } on AngularHtmlUnitResolver_FoundAppError catch (e) {
-      return true;
-    }
-    return false;
-  }
-
-  static SimpleIdentifier _createIdentifier(String name, int offset) {
-    StringToken token = _createStringToken(name, offset);
-    return new SimpleIdentifier(token);
-  }
-
-  /**
-   * Adds [AngularElement] declared by the given top-level [Element].
-   *
-   * @param angularElements the list to fill with top-level [AngularElement]s
-   * @param classElement the [ClassElement] to get [AngularElement]s from
-   */
-  static void _addAngularElementsFromClass(Set<AngularElement> angularElements, ClassElement classElement) {
-    for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
-      if (toolkitObject is AngularElement) {
-        angularElements.add(toolkitObject);
-      }
-    }
-  }
-
-  /**
-   * Returns the array of all top-level Angular elements that could be used in this library.
-   *
-   * @param libraryElement the [LibraryElement] to analyze
-   * @return the array of all top-level Angular elements that could be used in this library
-   */
-  static void _addAngularElementsFromLibrary(Set<AngularElement> angularElements, LibraryElement library, Set<LibraryElement> visited) {
-    if (library == null) {
-      return;
-    }
-    if (!visited.add(library)) {
-      return;
-    }
-    // add Angular elements from current library
-    for (CompilationUnitElement unit in library.units) {
-      angularElements.addAll(unit.angularViews);
-      for (ClassElement type in unit.types) {
-        _addAngularElementsFromClass(angularElements, type);
-      }
-    }
-    // handle imports
-    for (ImportElement importElement in library.imports) {
-      LibraryElement importedLibrary = importElement.importedLibrary;
-      _addAngularElementsFromLibrary(angularElements, importedLibrary, visited);
-    }
-  }
-
-  static StringToken _createStringToken(String name, int offset) => new StringToken(TokenType.IDENTIFIER, name, offset);
-
-  /**
-   * Returns the array of all top-level Angular elements that could be used in this library.
-   *
-   * @param libraryElement the [LibraryElement] to analyze
-   * @return the array of all top-level Angular elements that could be used in this library
-   */
-  static List<AngularElement> _getAngularElements(Set<LibraryElement> libraries, LibraryElement libraryElement) {
-    Set<AngularElement> angularElements = new Set();
-    _addAngularElementsFromLibrary(angularElements, libraryElement, libraries);
-    return new List.from(angularElements);
-  }
-
-  /**
-   * Returns the external Dart [CompilationUnit] referenced by the given [HtmlUnit].
-   */
-  static CompilationUnit _getDartUnit(AnalysisContext context, ht.HtmlUnit unit) {
-    for (HtmlScriptElement script in unit.element.scripts) {
-      if (script is ExternalHtmlScriptElement) {
-        Source scriptSource = script.scriptSource;
-        if (scriptSource != null) {
-          return context.resolveCompilationUnit2(scriptSource, scriptSource);
-        }
-      }
-    }
-    return null;
-  }
-
-  static Set<Source> _getLibrarySources(Set<LibraryElement> libraries) {
-    Set<Source> sources = new Set();
-    for (LibraryElement library in libraries) {
-      sources.add(library.source);
-    }
-    return sources;
-  }
-
   final InternalAnalysisContext _context;
 
   TypeProvider _typeProvider;
@@ -6367,7 +6852,7 @@
 
   final ht.HtmlUnit _unit;
 
-  List<AngularElement> _angularElements;
+//  List<AngularElement> _angularElements;
 
   List<NgProcessor> _processors = <NgProcessor>[];
 
@@ -6381,7 +6866,8 @@
 
   bool _isAngular = false;
 
-  List<LocalVariableElementImpl> _definedVariables = <LocalVariableElementImpl>[];
+  List<LocalVariableElementImpl> _definedVariables = <LocalVariableElementImpl>[
+      ];
 
   Set<LibraryElement> _injectedLibraries = new Set();
 
@@ -6389,12 +6875,19 @@
 
   Scope _nameScope;
 
-  AngularHtmlUnitResolver(this._context, AnalysisErrorListener errorListener, this._source, this._lineInfo, this._unit) {
+  AngularHtmlUnitResolver(this._context, AnalysisErrorListener errorListener,
+      this._source, this._lineInfo, this._unit) {
     this._typeProvider = _context.typeProvider;
-    this._errorListener = new AngularHtmlUnitResolver_FilteringAnalysisErrorListener(errorListener);
+    this._errorListener =
+        new AngularHtmlUnitResolver_FilteringAnalysisErrorListener(errorListener);
   }
 
   /**
+   * @return the [TypeProvider] of the [AnalysisContext].
+   */
+  TypeProvider get typeProvider => _typeProvider;
+
+  /**
    * The [AngularApplication] for the Web application with this entry point, may be
    * `null` if not an entry point.
    */
@@ -6411,7 +6904,8 @@
     // prepare accessible Angular elements
     LibraryElement libraryElement = dartUnit.element.library;
     Set<LibraryElement> libraries = new Set();
-    List<AngularElement> angularElements = _getAngularElements(libraries, libraryElement);
+    List<AngularElement> angularElements =
+        _getAngularElements(libraries, libraryElement);
     // resolve AngularComponentElement template URIs
     // TODO(scheglov) resolve to HtmlElement to allow F3 ?
     Set<Source> angularElementsSources = new Set();
@@ -6424,11 +6918,19 @@
           continue;
         }
         try {
-          Source templateSource = _context.sourceFactory.forUri2(_source.resolveRelativeUri(parseUriWithException(templateUri)));
+          Source templateSource = _context.sourceFactory.forUri2(
+              _source.resolveRelativeUri(parseUriWithException(templateUri)));
           if (!_context.exists(templateSource)) {
-            templateSource = _context.sourceFactory.resolveUri(_source, "package:$templateUri");
+            templateSource =
+                _context.sourceFactory.resolveUri(_source, "package:$templateUri");
             if (!_context.exists(templateSource)) {
-              _errorListener.onError(new AnalysisError.con2(angularElement.source, hasTemplate.templateUriOffset, templateUri.length, AngularCode.URI_DOES_NOT_EXIST, [templateUri]));
+              _errorListener.onError(
+                  new AnalysisError.con2(
+                      angularElement.source,
+                      hasTemplate.templateUriOffset,
+                      templateUri.length,
+                      AngularCode.URI_DOES_NOT_EXIST,
+                      [templateUri]));
               continue;
             }
           }
@@ -6442,12 +6944,22 @@
             hasTemplate.templateSource = templateSource;
           }
         } on URISyntaxException catch (exception) {
-          _errorListener.onError(new AnalysisError.con2(angularElement.source, hasTemplate.templateUriOffset, templateUri.length, AngularCode.INVALID_URI, [templateUri]));
+          _errorListener.onError(
+              new AnalysisError.con2(
+                  angularElement.source,
+                  hasTemplate.templateUriOffset,
+                  templateUri.length,
+                  AngularCode.INVALID_URI,
+                  [templateUri]));
         }
       }
     }
     // create AngularApplication
-    AngularApplication application = new AngularApplication(_source, _getLibrarySources(libraries), angularElements, new List.from(angularElementsSources));
+    AngularApplication application = new AngularApplication(
+        _source,
+        _getLibrarySources(libraries),
+        angularElements,
+        new List.from(angularElementsSources));
     // set AngularApplication for each AngularElement
     for (AngularElement angularElement in angularElements) {
       (angularElement as AngularElementImpl).application = application;
@@ -6462,7 +6974,8 @@
    * @param application the Angular application we are resolving for
    * @param component the [AngularComponentElement] to resolve template for, not `null`
    */
-  void resolveComponentTemplate(AngularApplication application, AngularComponentElement component) {
+  void resolveComponentTemplate(AngularApplication application,
+      AngularComponentElement component) {
     _isAngular = true;
     _resolveInternal(application.elements, component);
   }
@@ -6517,14 +7030,36 @@
   }
 
   /**
+   * Puts into [libraryElement] an artificial [LibraryElementImpl] for this HTML
+   * [Source].
+   */
+  void _createLibraryElement() {
+    // create CompilationUnitElementImpl
+    String unitName = _source.shortName;
+    _unitElement = new CompilationUnitElementImpl(unitName);
+    _unitElement.source = _source;
+    // create LibraryElementImpl
+    _libraryElement =
+        new LibraryElementImpl.forNode(_context.getContextFor(_source), null);
+    _libraryElement.definingCompilationUnit = _unitElement;
+    _libraryElement.angularHtml = true;
+    _injectedLibraries.add(_libraryElement);
+    // create FunctionElementImpl
+    _functionElement = new FunctionElementImpl.forOffset(0);
+    _unitElement.functions = <FunctionElement>[_functionElement];
+  }
+
+  /**
    * Creates new [LocalVariableElementImpl] with given type and identifier.
    *
    * @param type the [Type] of the variable
    * @param identifier the identifier to create variable for
    * @return the new [LocalVariableElementImpl]
    */
-  LocalVariableElementImpl _createLocalVariableFromIdentifier(DartType type, SimpleIdentifier identifier) {
-    LocalVariableElementImpl variable = new LocalVariableElementImpl.forNode(identifier);
+  LocalVariableElementImpl _createLocalVariableFromIdentifier(DartType type,
+      SimpleIdentifier identifier) {
+    LocalVariableElementImpl variable =
+        new LocalVariableElementImpl.forNode(identifier);
     _definedVariables.add(variable);
     variable.type = type;
     return variable;
@@ -6537,12 +7072,56 @@
    * @param name the name of the variable
    * @return the new [LocalVariableElementImpl]
    */
-  LocalVariableElementImpl _createLocalVariableWithName(DartType type, String name) {
+  LocalVariableElementImpl _createLocalVariableWithName(DartType type,
+      String name) {
     SimpleIdentifier identifier = _createIdentifier(name, 0);
     return _createLocalVariableFromIdentifier(type, identifier);
   }
 
   /**
+   * Creates new [NgProcessor] for the given [AngularElement], maybe `null` if not
+   * supported.
+   */
+  NgProcessor _createProcessor(AngularElement element) {
+    if (element is AngularComponentElement) {
+      AngularComponentElement component = element;
+      return new NgComponentElementProcessor(component);
+    }
+    if (element is AngularControllerElement) {
+      AngularControllerElement controller = element;
+      return new NgControllerElementProcessor(controller);
+    }
+    if (element is AngularDecoratorElement) {
+      AngularDecoratorElement directive = element;
+      return new NgDecoratorElementProcessor(directive);
+    }
+    return null;
+  }
+
+  /**
+   * Puts into [resolver] an [ResolverVisitor] to resolve [Expression]s in
+   * [source].
+   */
+  void _createResolver() {
+    InheritanceManager inheritanceManager =
+        new InheritanceManager(_libraryElement);
+    _resolver = new ResolverVisitor.con2(
+        _libraryElement,
+        _source,
+        _typeProvider,
+        inheritanceManager,
+        _errorListener);
+    _topNameScope = _resolver.pushNameScope();
+    // add Scope variables - no type, no location, just to avoid warnings
+    {
+      DartType type = _typeProvider.dynamicType;
+      _topNameScope.define(_createLocalVariableWithName(type, "\$id"));
+      _topNameScope.define(_createLocalVariableWithName(type, "\$parent"));
+      _topNameScope.define(_createLocalVariableWithName(type, "\$root"));
+    }
+  }
+
+  /**
    * Declares the given [LocalVariableElementImpl] in the [topNameScope].
    */
   void _defineTopVariable(LocalVariableElementImpl variable) {
@@ -6552,6 +7131,31 @@
   }
 
   /**
+   * Defines variable for the given [AngularElement] with type of the enclosing
+   * [ClassElement].
+   */
+  void _defineTopVariable_forClassElement(AngularElement element) {
+    ClassElement classElement = element.enclosingElement as ClassElement;
+    InterfaceType type = classElement.type;
+    LocalVariableElementImpl variable =
+        _createLocalVariableWithName(type, element.name);
+    _defineTopVariable(variable);
+    variable.toolkitObjects = <AngularElement>[element];
+  }
+
+  /**
+   * Defines variable for the given [AngularScopePropertyElement].
+   */
+  void
+      _defineTopVariable_forScopeProperty(AngularScopePropertyElement element) {
+    DartType type = element.type;
+    LocalVariableElementImpl variable =
+        _createLocalVariableWithName(type, element.name);
+    _defineTopVariable(variable);
+    variable.toolkitObjects = <AngularElement>[element];
+  }
+
+  /**
    * Declares the given [LocalVariableElementImpl] in the current [nameScope].
    */
   void _defineVariable(LocalVariableElementImpl variable) {
@@ -6560,27 +7164,23 @@
     _recordTypeLibraryInjected(variable);
   }
 
-  /**
-   * @return the [AngularElement] with the given name, maybe `null`.
-   */
-  AngularElement _findAngularElement(String name) {
-    for (AngularElement element in _angularElements) {
-      if (name == element.name) {
-        return element;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * @return the [TypeProvider] of the [AnalysisContext].
-   */
-  TypeProvider get typeProvider => _typeProvider;
+//  /**
+//   * @return the [AngularElement] with the given name, maybe `null`.
+//   */
+//  AngularElement _findAngularElement(String name) {
+//    for (AngularElement element in _angularElements) {
+//      if (name == element.name) {
+//        return element;
+//      }
+//    }
+//    return null;
+//  }
 
   /**
    * Parses given [String] as an [AngularExpression] at the given offset.
    */
-  AngularExpression _parseAngularExpression(String contents, int startIndex, int endIndex, int offset) {
+  AngularExpression _parseAngularExpression(String contents, int startIndex,
+      int endIndex, int offset) {
     Token token = _scanDart(contents, startIndex, endIndex, offset);
     return _parseAngularExpressionInToken(token);
   }
@@ -6625,142 +7225,20 @@
     return new AngularExpression(mainExpression, formatters);
   }
 
-  /**
-   * Parses given [String] as an [Expression] at the given offset.
-   */
-  Expression _parseDartExpression(String contents, int startIndex, int endIndex, int offset) {
-    Token token = _scanDart(contents, startIndex, endIndex, offset);
-    return _parseDartExpressionInToken(token);
-  }
+//  /**
+//   * Parses given [String] as an [Expression] at the given offset.
+//   */
+//  Expression _parseDartExpression(String contents, int startIndex, int endIndex,
+//      int offset) {
+//    Token token = _scanDart(contents, startIndex, endIndex, offset);
+//    return _parseDartExpressionInToken(token);
+//  }
 
   Expression _parseDartExpressionInToken(Token token) {
     Parser parser = new Parser(_source, _errorListener);
     return parser.parseExpression(token);
   }
 
-  void _popNameScope() {
-    _nameScope = _resolver.popNameScope();
-  }
-
-  void _pushNameScope() {
-    _nameScope = _resolver.pushNameScope();
-  }
-
-  /**
-   * Reports given [ErrorCode] at the given [AstNode].
-   */
-  void _reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
-    _reportErrorForOffset(errorCode, node.offset, node.length, arguments);
-  }
-
-  /**
-   * Reports given [ErrorCode] at the given position.
-   */
-  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
-  }
-
-  /**
-   * Reports given [ErrorCode] at the given [Token].
-   */
-  void _reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
-    _reportErrorForOffset(errorCode, token.offset, token.length, arguments);
-  }
-
-  void _resolveExpression(AngularExpression angularExpression) {
-    List<Expression> dartExpressions = angularExpression.expressions;
-    for (Expression dartExpression in dartExpressions) {
-      _resolveNode(dartExpression);
-    }
-  }
-
-  /**
-   * Resolves given [AstNode] using [resolver].
-   */
-  void _resolveNode(AstNode node) {
-    node.accept(_resolver);
-  }
-
-  Token _scanDart(String contents, int startIndex, int endIndex, int offset) => ht.HtmlParser.scanDartSource(_source, _lineInfo, contents.substring(startIndex, endIndex), offset + startIndex, _errorListener);
-
-  /**
-   * Puts into [libraryElement] an artificial [LibraryElementImpl] for this HTML
-   * [Source].
-   */
-  void _createLibraryElement() {
-    // create CompilationUnitElementImpl
-    String unitName = _source.shortName;
-    _unitElement = new CompilationUnitElementImpl(unitName);
-    _unitElement.source = _source;
-    // create LibraryElementImpl
-    _libraryElement = new LibraryElementImpl.forNode(_context.getContextFor(_source), null);
-    _libraryElement.definingCompilationUnit = _unitElement;
-    _libraryElement.angularHtml = true;
-    _injectedLibraries.add(_libraryElement);
-    // create FunctionElementImpl
-    _functionElement = new FunctionElementImpl.forOffset(0);
-    _unitElement.functions = <FunctionElement> [_functionElement];
-  }
-
-  /**
-   * Creates new [NgProcessor] for the given [AngularElement], maybe `null` if not
-   * supported.
-   */
-  NgProcessor _createProcessor(AngularElement element) {
-    if (element is AngularComponentElement) {
-      AngularComponentElement component = element;
-      return new NgComponentElementProcessor(component);
-    }
-    if (element is AngularControllerElement) {
-      AngularControllerElement controller = element;
-      return new NgControllerElementProcessor(controller);
-    }
-    if (element is AngularDecoratorElement) {
-      AngularDecoratorElement directive = element;
-      return new NgDecoratorElementProcessor(directive);
-    }
-    return null;
-  }
-
-  /**
-   * Puts into [resolver] an [ResolverVisitor] to resolve [Expression]s in
-   * [source].
-   */
-  void _createResolver() {
-    InheritanceManager inheritanceManager = new InheritanceManager(_libraryElement);
-    _resolver = new ResolverVisitor.con2(_libraryElement, _source, _typeProvider, inheritanceManager, _errorListener);
-    _topNameScope = _resolver.pushNameScope();
-    // add Scope variables - no type, no location, just to avoid warnings
-    {
-      DartType type = _typeProvider.dynamicType;
-      _topNameScope.define(_createLocalVariableWithName(type, "\$id"));
-      _topNameScope.define(_createLocalVariableWithName(type, "\$parent"));
-      _topNameScope.define(_createLocalVariableWithName(type, "\$root"));
-    }
-  }
-
-  /**
-   * Defines variable for the given [AngularElement] with type of the enclosing
-   * [ClassElement].
-   */
-  void _defineTopVariable_forClassElement(AngularElement element) {
-    ClassElement classElement = element.enclosingElement as ClassElement;
-    InterfaceType type = classElement.type;
-    LocalVariableElementImpl variable = _createLocalVariableWithName(type, element.name);
-    _defineTopVariable(variable);
-    variable.toolkitObjects = <AngularElement> [element];
-  }
-
-  /**
-   * Defines variable for the given [AngularScopePropertyElement].
-   */
-  void _defineTopVariable_forScopeProperty(AngularScopePropertyElement element) {
-    DartType type = element.type;
-    LocalVariableElementImpl variable = _createLocalVariableWithName(type, element.name);
-    _defineTopVariable(variable);
-    variable.toolkitObjects = <AngularElement> [element];
-  }
-
   /**
    * Parse the value of the given token for embedded expressions, and add any embedded expressions
    * that are found to the given list of expressions.
@@ -6768,28 +7246,49 @@
    * @param expressions the list to which embedded expressions are to be added
    * @param token the token whose value is to be parsed
    */
-  void _parseEmbeddedExpressions(List<AngularMoustacheXmlExpression> expressions, ht.Token token) {
+  void
+      _parseEmbeddedExpressions(List<AngularMoustacheXmlExpression> expressions,
+      ht.Token token) {
     // prepare Token information
     String lexeme = token.lexeme;
     int offset = token.offset;
     // find expressions between {{ and }}
-    int startIndex = StringUtilities.indexOf2(lexeme, 0, AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR, AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
+    int startIndex = StringUtilities.indexOf2(
+        lexeme,
+        0,
+        AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR,
+        AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
     while (startIndex >= 0) {
-      int endIndex = StringUtilities.indexOf2(lexeme, startIndex + AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH, AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR, AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR);
+      int endIndex = StringUtilities.indexOf2(
+          lexeme,
+          startIndex + AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH,
+          AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR,
+          AngularMoustacheXmlExpression.CLOSING_DELIMITER_CHAR);
       if (endIndex < 0) {
-        // TODO(brianwilkerson) Should we report this error or will it be reported by something else?
+        // TODO(brianwilkerson) Should we report this error or will it be
+        // reported by something else?
         return;
-      } else if (startIndex + AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH < endIndex) {
+      } else if (startIndex +
+          AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH <
+          endIndex) {
         startIndex += AngularMoustacheXmlExpression.OPENING_DELIMITER_LENGTH;
-        AngularExpression expression = _parseAngularExpression(lexeme, startIndex, endIndex, offset);
-        expressions.add(new AngularMoustacheXmlExpression(startIndex, endIndex, expression));
+        AngularExpression expression =
+            _parseAngularExpression(lexeme, startIndex, endIndex, offset);
+        expressions.add(
+            new AngularMoustacheXmlExpression(startIndex, endIndex, expression));
       }
-      startIndex = StringUtilities.indexOf2(lexeme, endIndex + AngularMoustacheXmlExpression.CLOSING_DELIMITER_LENGTH, AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR, AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
+      startIndex = StringUtilities.indexOf2(
+          lexeme,
+          endIndex + AngularMoustacheXmlExpression.CLOSING_DELIMITER_LENGTH,
+          AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR,
+          AngularMoustacheXmlExpression.OPENING_DELIMITER_CHAR);
     }
   }
 
   void _parseEmbeddedExpressionsInAttribute(ht.XmlAttributeNode node) {
-    List<AngularMoustacheXmlExpression> expressions = <AngularMoustacheXmlExpression>[];
+    List<AngularMoustacheXmlExpression> expressions =
+        <AngularMoustacheXmlExpression>[
+        ];
     _parseEmbeddedExpressions(expressions, node.valueToken);
     if (!expressions.isEmpty) {
       node.expressions = expressions;
@@ -6797,7 +7296,9 @@
   }
 
   void _parseEmbeddedExpressionsInTag(ht.XmlTagNode node) {
-    List<AngularMoustacheXmlExpression> expressions = <AngularMoustacheXmlExpression>[];
+    List<AngularMoustacheXmlExpression> expressions =
+        <AngularMoustacheXmlExpression>[
+        ];
     ht.Token token = node.attributeEnd;
     ht.Token endToken = node.endToken;
     bool inChild = false;
@@ -6820,6 +7321,14 @@
     node.expressions = expressions;
   }
 
+  void _popNameScope() {
+    _nameScope = _resolver.popNameScope();
+  }
+
+  void _pushNameScope() {
+    _nameScope = _resolver.pushNameScope();
+  }
+
   void _recordDefinedVariable(LocalVariableElementImpl variable) {
     _definedVariables.add(variable);
     _functionElement.localVariables = new List.from(_definedVariables);
@@ -6833,6 +7342,38 @@
     _injectedLibraries.add(typeLibrary);
   }
 
+  /**
+   * Reports given [ErrorCode] at the given [AstNode].
+   */
+  void _reportErrorForNode(ErrorCode errorCode, AstNode node,
+      [List<Object> arguments]) {
+    _reportErrorForOffset(errorCode, node.offset, node.length, arguments);
+  }
+
+  /**
+   * Reports given [ErrorCode] at the given position.
+   */
+  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+  }
+
+  /**
+   * Reports given [ErrorCode] at the given [Token].
+   */
+  void _reportErrorForToken(ErrorCode errorCode, Token token,
+      [List<Object> arguments]) {
+    _reportErrorForOffset(errorCode, token.offset, token.length, arguments);
+  }
+
+  void _resolveExpression(AngularExpression angularExpression) {
+    List<Expression> dartExpressions = angularExpression.expressions;
+    for (Expression dartExpression in dartExpressions) {
+      _resolveNode(dartExpression);
+    }
+  }
+
   void _resolveExpressions(List<ht.XmlExpression> expressions) {
     for (ht.XmlExpression xmlExpression in expressions) {
       if (xmlExpression is AngularXmlExpression) {
@@ -6850,8 +7391,9 @@
    * @param component the [AngularComponentElement] to resolve template for, maybe
    *          `null` if not a component template
    */
-  void _resolveInternal(List<AngularElement> angularElements, AngularComponentElement component) {
-    this._angularElements = angularElements;
+  void _resolveInternal(List<AngularElement> angularElements,
+      AngularComponentElement component) {
+//    this._angularElements = angularElements;
     // add built-in processors
     _processors.add(NgModelProcessor.INSTANCE);
     // _processors.add(NgRepeatProcessor.INSTANCE);
@@ -6867,7 +7409,8 @@
     // maybe resolving component template
     if (component != null) {
       _defineTopVariable_forClassElement(component);
-      for (AngularScopePropertyElement scopeProperty in component.scopeProperties) {
+      for (AngularScopePropertyElement scopeProperty in
+          component.scopeProperties) {
         _defineTopVariable_forScopeProperty(scopeProperty);
       }
     }
@@ -6898,11 +7441,26 @@
     }
   }
 
+  /**
+   * Resolves given [AstNode] using [resolver].
+   */
+  void _resolveNode(AstNode node) {
+    node.accept(_resolver);
+  }
+
   void _resolveXmlExpression(AngularXmlExpression angularXmlExpression) {
     AngularExpression angularExpression = angularXmlExpression.expression;
     _resolveExpression(angularExpression);
   }
 
+  Token _scanDart(String contents, int startIndex, int endIndex, int offset) =>
+      ht.HtmlParser.scanDartSource(
+          _source,
+          _lineInfo,
+          contents.substring(startIndex, endIndex),
+          offset + startIndex,
+          _errorListener);
+
   List<Token> _splitAtBar(Token token) {
     List<Token> tokens = <Token>[];
     tokens.add(token);
@@ -6923,11 +7481,131 @@
    * found [NG_APP] context.
    */
   void _visitModelDirectives(ht.XmlTagNode appNode) {
-    appNode.accept(new RecursiveXmlVisitor_AngularHtmlUnitResolver_visitModelDirectives(this));
+    appNode.accept(new _AngularHtmlUnitResolver_visitModelDirectives(this));
+  }
+
+  /**
+   * Checks if given [Element] is an artificial local variable and returns corresponding
+   * [AngularElement], or `null` otherwise.
+   */
+  static AngularElement getAngularElement(Element element) {
+    // may be artificial local variable, replace with AngularElement
+    if (element is LocalVariableElement) {
+      LocalVariableElement local = element;
+      List<ToolkitObjectElement> toolkitObjects = local.toolkitObjects;
+      if (toolkitObjects.length == 1 && toolkitObjects[0] is AngularElement) {
+        return toolkitObjects[0] as AngularElement;
+      }
+    }
+    // not a special Element
+    return null;
+  }
+
+  /**
+   * @return `true` if the given [HtmlUnit] has <code>ng-app</code> annotation.
+   */
+  static bool hasAngularAnnotation(ht.HtmlUnit htmlUnit) {
+    try {
+      htmlUnit.accept(
+          new RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation());
+    } on AngularHtmlUnitResolver_FoundAppError catch (e) {
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Adds [AngularElement] declared by the given top-level [Element].
+   *
+   * @param angularElements the list to fill with top-level [AngularElement]s
+   * @param classElement the [ClassElement] to get [AngularElement]s from
+   */
+  static void _addAngularElementsFromClass(Set<AngularElement> angularElements,
+      ClassElement classElement) {
+    for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
+      if (toolkitObject is AngularElement) {
+        angularElements.add(toolkitObject);
+      }
+    }
+  }
+
+  /**
+   * Returns the array of all top-level Angular elements that could be used in this library.
+   *
+   * @param libraryElement the [LibraryElement] to analyze
+   * @return the array of all top-level Angular elements that could be used in this library
+   */
+  static void
+      _addAngularElementsFromLibrary(Set<AngularElement> angularElements,
+      LibraryElement library, Set<LibraryElement> visited) {
+    if (library == null) {
+      return;
+    }
+    if (!visited.add(library)) {
+      return;
+    }
+    // add Angular elements from current library
+    for (CompilationUnitElement unit in library.units) {
+      angularElements.addAll(unit.angularViews);
+      for (ClassElement type in unit.types) {
+        _addAngularElementsFromClass(angularElements, type);
+      }
+    }
+    // handle imports
+    for (ImportElement importElement in library.imports) {
+      LibraryElement importedLibrary = importElement.importedLibrary;
+      _addAngularElementsFromLibrary(angularElements, importedLibrary, visited);
+    }
+  }
+
+  static SimpleIdentifier _createIdentifier(String name, int offset) {
+    StringToken token = _createStringToken(name, offset);
+    return new SimpleIdentifier(token);
+  }
+
+  static StringToken _createStringToken(String name, int offset) =>
+      new StringToken(TokenType.IDENTIFIER, name, offset);
+
+  /**
+   * Returns the array of all top-level Angular elements that could be used in this library.
+   *
+   * @param libraryElement the [LibraryElement] to analyze
+   * @return the array of all top-level Angular elements that could be used in this library
+   */
+  static List<AngularElement> _getAngularElements(Set<LibraryElement> libraries,
+      LibraryElement libraryElement) {
+    Set<AngularElement> angularElements = new Set();
+    _addAngularElementsFromLibrary(angularElements, libraryElement, libraries);
+    return new List.from(angularElements);
+  }
+
+  /**
+   * Returns the external Dart [CompilationUnit] referenced by the given [HtmlUnit].
+   */
+  static CompilationUnit _getDartUnit(AnalysisContext context,
+      ht.HtmlUnit unit) {
+    for (HtmlScriptElement script in unit.element.scripts) {
+      if (script is ExternalHtmlScriptElement) {
+        Source scriptSource = script.scriptSource;
+        if (scriptSource != null) {
+          return context.resolveCompilationUnit2(scriptSource, scriptSource);
+        }
+      }
+    }
+    return null;
+  }
+
+  static Set<Source> _getLibrarySources(Set<LibraryElement> libraries) {
+    Set<Source> sources = new Set();
+    for (LibraryElement library in libraries) {
+      sources.add(library.source);
+    }
+    return sources;
   }
 }
 
-class AngularHtmlUnitResolver_FilteringAnalysisErrorListener implements AnalysisErrorListener {
+class AngularHtmlUnitResolver_FilteringAnalysisErrorListener implements
+    AnalysisErrorListener {
   final AnalysisErrorListener _listener;
 
   AngularHtmlUnitResolver_FilteringAnalysisErrorListener(this._listener);
@@ -6935,7 +7613,9 @@
   @override
   void onError(AnalysisError error) {
     ErrorCode errorCode = error.errorCode;
-    if (identical(errorCode, StaticWarningCode.UNDEFINED_GETTER) || identical(errorCode, StaticWarningCode.UNDEFINED_IDENTIFIER) || identical(errorCode, StaticTypeWarningCode.UNDEFINED_GETTER)) {
+    if (identical(errorCode, StaticWarningCode.UNDEFINED_GETTER) ||
+        identical(errorCode, StaticWarningCode.UNDEFINED_IDENTIFIER) ||
+        identical(errorCode, StaticTypeWarningCode.UNDEFINED_GETTER)) {
       return;
     }
     _listener.onError(error);
@@ -6972,7 +7652,9 @@
    */
   final int _closingOffset;
 
-  AngularMoustacheXmlExpression(this._openingOffset, this._closingOffset, AngularExpression expression) : super(expression);
+  AngularMoustacheXmlExpression(this._openingOffset, this._closingOffset,
+      AngularExpression expression)
+      : super(expression);
 
   @override
   int get end => _closingOffset + CLOSING_DELIMITER_LENGTH;
@@ -7015,7 +7697,8 @@
   @override
   ht.XmlExpression_Reference getReference(int offset) {
     // main expression
-    ht.XmlExpression_Reference reference = _getReferenceAtNode(expression.expression, offset);
+    ht.XmlExpression_Reference reference =
+        _getReferenceAtNode(expression.expression, offset);
     if (reference != null) {
       return reference;
     }
@@ -7052,6 +7735,32 @@
 }
 
 /**
+ * A `CachedResult` is a single analysis result that is stored in a
+ * [SourceEntry].
+ */
+class CachedResult<E> {
+  /**
+   * The state of the cached value.
+   */
+  CacheState state;
+
+  /**
+   * The value being cached, or `null` if there is no value (for example, when
+   * the [state] is [CacheState.INVALID].
+   */
+  E value;
+
+  /**
+   * Initialize a newly created result holder to represent the value of data
+   * described by the given [descriptor].
+   */
+  CachedResult(DataDescriptor descriptor) {
+    state = CacheState.INVALID;
+    value = descriptor.defaultValue;
+  }
+}
+
+/**
  * Instances of the class `CachePartition` implement a single partition in an LRU cache of
  * information related to analysis.
  */
@@ -7101,40 +7810,6 @@
   }
 
   /**
-   * Record that the AST associated with the given source was just read from the cache.
-   *
-   * @param source the source whose AST was accessed
-   */
-  void accessedAst(Source source) {
-    if (_recentlyUsed.remove(source)) {
-      _recentlyUsed.add(source);
-      return;
-    }
-    while (_recentlyUsed.length >= _maxCacheSize) {
-      if (!_flushAstFromCache()) {
-        break;
-      }
-    }
-    _recentlyUsed.add(source);
-  }
-
-  /**
-   * Return `true` if the given source is contained in this partition.
-   *
-   * @param source the source being tested
-   * @return `true` if the source is contained in this partition
-   */
-  bool contains(Source source);
-
-  /**
-   * Return the entry associated with the given source.
-   *
-   * @param source the source whose entry is to be returned
-   * @return the entry associated with the given source
-   */
-  SourceEntry get(Source source) => _sourceMap[source];
-
-  /**
    * Return the number of entries in this partition that have an AST associated with them.
    *
    * @return the number of entries in this partition that have an AST associated with them
@@ -7171,11 +7846,60 @@
   Map<Source, SourceEntry> get map => _sourceMap;
 
   /**
+   * Set the maximum size of the cache to the given size.
+   *
+   * @param size the maximum number of sources for which AST structures should be kept in the cache
+   */
+  void set maxCacheSize(int size) {
+    _maxCacheSize = size;
+    while (_recentlyUsed.length > _maxCacheSize) {
+      if (!_flushAstFromCache()) {
+        break;
+      }
+    }
+  }
+
+  /**
+   * Record that the AST associated with the given source was just read from the cache.
+   *
+   * @param source the source whose AST was accessed
+   */
+  void accessedAst(Source source) {
+    if (_recentlyUsed.remove(source)) {
+      _recentlyUsed.add(source);
+      return;
+    }
+    while (_recentlyUsed.length >= _maxCacheSize) {
+      if (!_flushAstFromCache()) {
+        break;
+      }
+    }
+    _recentlyUsed.add(source);
+  }
+
+  /**
+   * Return `true` if the given source is contained in this partition.
+   *
+   * @param source the source being tested
+   * @return `true` if the source is contained in this partition
+   */
+  bool contains(Source source);
+
+  /**
+   * Return the entry associated with the given source.
+   *
+   * @param source the source whose entry is to be returned
+   * @return the entry associated with the given source
+   */
+  SourceEntry get(Source source) => _sourceMap[source];
+
+  /**
    * Return an iterator returning all of the map entries mapping sources to cache entries.
    *
    * @return an iterator returning all of the map entries mapping sources to cache entries
    */
-  MapIterator<Source, SourceEntry> iterator() => new SingleMapIterator<Source, SourceEntry>(_sourceMap);
+  MapIterator<Source, SourceEntry> iterator() =>
+      new SingleMapIterator<Source, SourceEntry>(_sourceMap);
 
   /**
    * Associate the given entry with the given source.
@@ -7208,20 +7932,6 @@
   }
 
   /**
-   * Set the maximum size of the cache to the given size.
-   *
-   * @param size the maximum number of sources for which AST structures should be kept in the cache
-   */
-  void set maxCacheSize(int size) {
-    _maxCacheSize = size;
-    while (_recentlyUsed.length > _maxCacheSize) {
-      if (!_flushAstFromCache()) {
-        break;
-      }
-    }
-  }
-
-  /**
    * Return the number of sources that are mapped to cache entries.
    *
    * @return the number of sources that are mapped to cache entries
@@ -7277,7 +7987,8 @@
     int sourceToRemove = -1;
     for (int i = 0; i < _recentlyUsed.length; i++) {
       Source source = _recentlyUsed[i];
-      RetentionPriority priority = _retentionPolicy.getAstPriority(source, _sourceMap[source]);
+      RetentionPriority priority =
+          _retentionPolicy.getAstPriority(source, _sourceMap[source]);
       if (priority == RetentionPriority.LOW) {
         return _recentlyUsed.removeAt(i);
       } else if (priority == RetentionPriority.MEDIUM && sourceToRemove < 0) {
@@ -7285,9 +7996,10 @@
       }
     }
     if (sourceToRemove < 0) {
-      // This happens if the retention policy returns a priority of HIGH for all of the sources that
-      // have been recently used. This is the case, for example, when the list of priority sources
-      // is bigger than the current cache size.
+      // This happens if the retention policy returns a priority of HIGH for all
+      // of the sources that have been recently used. This is the case, for
+      // example, when the list of priority sources is bigger than the current
+      // cache size.
       return null;
     }
     return _recentlyUsed.removeAt(sourceToRemove);
@@ -7358,38 +8070,17 @@
    */
   static const CacheState VALID = const CacheState('VALID', 4);
 
-  static const List<CacheState> values = const [ERROR, FLUSHED, IN_PROCESS, INVALID, VALID];
+  static const List<CacheState> values = const [
+      ERROR,
+      FLUSHED,
+      IN_PROCESS,
+      INVALID,
+      VALID];
 
   const CacheState(String name, int ordinal) : super(name, ordinal);
 }
 
 /**
- * A `CachedResult` is a single analysis result that is stored in a
- * [SourceEntry].
- */
-class CachedResult<E> {
-  /**
-   * The state of the cached value.
-   */
-  CacheState state;
-
-  /**
-   * The value being cached, or `null` if there is no value (for example, when
-   * the [state] is [CacheState.INVALID].
-   */
-  E value;
-
-  /**
-   * Initialize a newly created result holder to represent the value of data
-   * described by the given [descriptor].
-   */
-  CachedResult(DataDescriptor descriptor) {
-    state = CacheState.INVALID;
-    value = descriptor.defaultValue;
-  }
-}
-
-/**
  * The interface `ChangeNotice` defines the behavior of objects that represent a change to the
  * analysis results associated with a given source.
  */
@@ -7424,6 +8115,11 @@
  */
 class ChangeNoticeImpl implements ChangeNotice {
   /**
+   * An empty list of change notices.
+   */
+  static const List<ChangeNoticeImpl> EMPTY_ARRAY = const <ChangeNoticeImpl>[];
+
+  /**
    * The source for which the result is being reported.
    */
   final Source source;
@@ -7452,11 +8148,6 @@
   LineInfo _lineInfo;
 
   /**
-   * An empty array of change notices.
-   */
-  static List<ChangeNoticeImpl> EMPTY_ARRAY = new List<ChangeNoticeImpl>(0);
-
-  /**
    * Initialize a newly created notice associated with the given source.
    *
    * @param source the source for which the change is being reported
@@ -7521,7 +8212,8 @@
    * A table mapping the sources whose content has been changed within a single range to the current
    * content of those sources and information about the affected range.
    */
-  final HashMap<Source, ChangeSet_ContentChange> changedRanges = new HashMap<Source, ChangeSet_ContentChange>();
+  final HashMap<Source, ChangeSet_ContentChange> changedRanges =
+      new HashMap<Source, ChangeSet_ContentChange>();
 
   /**
    * A list containing the sources that have been removed.
@@ -7539,6 +8231,29 @@
   final List<Source> deletedSources = new List<Source>();
 
   /**
+   * Return a table mapping the sources whose content has been changed to the current content of
+   * those sources.
+   *
+   * @return a table mapping the sources whose content has been changed to the current content of
+   *         those sources
+   */
+  Map<Source, String> get changedContents => _changedContent;
+
+  /**
+   * Return `true` if this change set does not contain any changes.
+   *
+   * @return `true` if this change set does not contain any changes
+   */
+  bool get isEmpty =>
+      addedSources.isEmpty &&
+          changedSources.isEmpty &&
+          _changedContent.isEmpty &&
+          changedRanges.isEmpty &&
+          removedSources.isEmpty &&
+          removedContainers.isEmpty &&
+          deletedSources.isEmpty;
+
+  /**
    * Record that the specified source has been added and that its content is the default contents of
    * the source.
    *
@@ -7568,8 +8283,10 @@
    * @param oldLength the number of characters in the original contents that were replaced
    * @param newLength the number of characters in the replacement text
    */
-  void changedRange(Source source, String contents, int offset, int oldLength, int newLength) {
-    changedRanges[source] = new ChangeSet_ContentChange(contents, offset, oldLength, newLength);
+  void changedRange(Source source, String contents, int offset, int oldLength,
+      int newLength) {
+    changedRanges[source] =
+        new ChangeSet_ContentChange(contents, offset, oldLength, newLength);
   }
 
   /**
@@ -7593,22 +8310,6 @@
   }
 
   /**
-   * Return a table mapping the sources whose content has been changed to the current content of
-   * those sources.
-   *
-   * @return a table mapping the sources whose content has been changed to the current content of
-   *         those sources
-   */
-  Map<Source, String> get changedContents => _changedContent;
-
-  /**
-   * Return `true` if this change set does not contain any changes.
-   *
-   * @return `true` if this change set does not contain any changes
-   */
-  bool get isEmpty => addedSources.isEmpty && changedSources.isEmpty && _changedContent.isEmpty && changedRanges.isEmpty && removedSources.isEmpty && removedContainers.isEmpty && deletedSources.isEmpty;
-
-  /**
    * Record that the specified source container has been removed.
    *
    * @param container the source container that was removed
@@ -7633,12 +8334,18 @@
   @override
   String toString() {
     StringBuffer buffer = new StringBuffer();
-    bool needsSeparator = _appendSources(buffer, addedSources, false, "addedSources");
-    needsSeparator = _appendSources(buffer, changedSources, needsSeparator, "changedSources");
-    needsSeparator = _appendSources2(buffer, _changedContent, needsSeparator, "changedContent");
-    needsSeparator = _appendSources2(buffer, changedRanges, needsSeparator, "changedRanges");
-    needsSeparator = _appendSources(buffer, deletedSources, needsSeparator, "deletedSources");
-    needsSeparator = _appendSources(buffer, removedSources, needsSeparator, "removedSources");
+    bool needsSeparator =
+        _appendSources(buffer, addedSources, false, "addedSources");
+    needsSeparator =
+        _appendSources(buffer, changedSources, needsSeparator, "changedSources");
+    needsSeparator =
+        _appendSources2(buffer, _changedContent, needsSeparator, "changedContent");
+    needsSeparator =
+        _appendSources2(buffer, changedRanges, needsSeparator, "changedRanges");
+    needsSeparator =
+        _appendSources(buffer, deletedSources, needsSeparator, "deletedSources");
+    needsSeparator =
+        _appendSources(buffer, removedSources, needsSeparator, "removedSources");
     int count = removedContainers.length;
     if (count > 0) {
       if (removedSources.isEmpty) {
@@ -7667,7 +8374,8 @@
    * @param label the label used to prefix the sources
    * @return `true` if future lists of sources will need a separator
    */
-  bool _appendSources(StringBuffer buffer, List<Source> sources, bool needsSeparator, String label) {
+  bool _appendSources(StringBuffer buffer, List<Source> sources,
+      bool needsSeparator, String label) {
     if (sources.isEmpty) {
       return needsSeparator;
     }
@@ -7694,7 +8402,8 @@
    * @param label the label used to prefix the sources
    * @return `true` if future lists of sources will need a separator
    */
-  bool _appendSources2(StringBuffer buffer, HashMap<Source, dynamic> sources, bool needsSeparator, String label) {
+  bool _appendSources2(StringBuffer buffer, HashMap<Source, dynamic> sources,
+      bool needsSeparator, String label) {
     if (sources.isEmpty) {
       return needsSeparator;
     }
@@ -7744,7 +8453,8 @@
    * @param oldLength the number of characters in the original contents that were replaced
    * @param newLength the number of characters in the replacement text
    */
-  ChangeSet_ContentChange(this.contents, this.offset, this.oldLength, this.newLength);
+  ChangeSet_ContentChange(this.contents, this.offset, this.oldLength,
+      this.newLength);
 }
 
 /**
@@ -7769,7 +8479,8 @@
    * @param entryPairs the (source, entry) pairs representing the compilation units in the
    *          library
    */
-  CycleBuilder_LibraryPair(ResolvableLibrary library, List<CycleBuilder_SourceEntryPair> entryPairs) {
+  CycleBuilder_LibraryPair(ResolvableLibrary library,
+      List<CycleBuilder_SourceEntryPair> entryPairs) {
     this.library = library;
     this.entryPairs = entryPairs;
   }
@@ -7803,13 +8514,176 @@
   }
 }
 
-
 /**
  * A `DartEntry` maintains the information cached by an analysis context about
  * an individual Dart file.
  */
 class DartEntry extends SourceEntry {
   /**
+   * The data descriptor representing the errors reported during Angular
+   * resolution.
+   */
+  static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.ANGULAR_ERRORS",
+          AnalysisError.NO_ERRORS);
+
+  /**
+   * The data descriptor representing the element model representing a single
+   * compilation unit. This model is incomplete and should not be used except as
+   * input to another task.
+   */
+  static final DataDescriptor<List<AnalysisError>> BUILT_ELEMENT =
+      new DataDescriptor<List<AnalysisError>>("DartEntry.BUILT_ELEMENT");
+
+  /**
+   * The data descriptor representing the AST structure after the element model
+   * has been built (and declarations are resolved) but before other resolution
+   * has been performed.
+   */
+  static final DataDescriptor<CompilationUnit> BUILT_UNIT =
+      new DataDescriptor<CompilationUnit>("DartEntry.BUILT_UNIT");
+
+  /**
+   * The data descriptor representing the list of libraries that contain this
+   * compilation unit.
+   */
+  static final DataDescriptor<List<Source>> CONTAINING_LIBRARIES =
+      new DataDescriptor<List<Source>>(
+          "DartEntry.CONTAINING_LIBRARIES",
+          Source.EMPTY_ARRAY);
+
+  /**
+   * The data descriptor representing the library element for the library. This
+   * data is only available for Dart files that are the defining compilation
+   * unit of a library.
+   */
+  static final DataDescriptor<LibraryElement> ELEMENT =
+      new DataDescriptor<LibraryElement>("DartEntry.ELEMENT");
+
+  /**
+   * The data descriptor representing the list of exported libraries. This data
+   * is only available for Dart files that are the defining compilation unit of
+   * a library.
+   */
+  static final DataDescriptor<List<Source>> EXPORTED_LIBRARIES =
+      new DataDescriptor<List<Source>>(
+          "DartEntry.EXPORTED_LIBRARIES",
+          Source.EMPTY_ARRAY);
+
+  /**
+   * The data descriptor representing the hints resulting from auditing the
+   * source.
+   */
+  static final DataDescriptor<List<AnalysisError>> HINTS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.HINTS",
+          AnalysisError.NO_ERRORS);
+
+  /**
+   * The data descriptor representing the list of imported libraries. This data
+   * is only available for Dart files that are the defining compilation unit of
+   * a library.
+   */
+  static final DataDescriptor<List<Source>> IMPORTED_LIBRARIES =
+      new DataDescriptor<List<Source>>(
+          "DartEntry.IMPORTED_LIBRARIES",
+          Source.EMPTY_ARRAY);
+
+  /**
+   * The data descriptor representing the list of included parts. This data is
+   * only available for Dart files that are the defining compilation unit of a
+   * library.
+   */
+  static final DataDescriptor<List<Source>> INCLUDED_PARTS =
+      new DataDescriptor<List<Source>>(
+          "DartEntry.INCLUDED_PARTS",
+          Source.EMPTY_ARRAY);
+
+  /**
+   * The data descriptor representing the client flag. This data is only
+   * available for Dart files that are the defining compilation unit of a
+   * library.
+   */
+  static final DataDescriptor<bool> IS_CLIENT =
+      new DataDescriptor<bool>("DartEntry.IS_CLIENT", false);
+
+  /**
+   * The data descriptor representing the launchable flag. This data is only
+   * available for Dart files that are the defining compilation unit of a
+   * library.
+   */
+  static final DataDescriptor<bool> IS_LAUNCHABLE =
+      new DataDescriptor<bool>("DartEntry.IS_LAUNCHABLE", false);
+
+  /**
+   * The data descriptor representing the errors resulting from parsing the
+   * source.
+   */
+  static final DataDescriptor<List<AnalysisError>> PARSE_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.PARSE_ERRORS",
+          AnalysisError.NO_ERRORS);
+
+  /**
+   * The data descriptor representing the parsed AST structure.
+   */
+  static final DataDescriptor<CompilationUnit> PARSED_UNIT =
+      new DataDescriptor<CompilationUnit>("DartEntry.PARSED_UNIT");
+
+  /**
+   * The data descriptor representing the public namespace of the library. This
+   * data is only available for Dart files that are the defining compilation
+   * unit of a library.
+   */
+  static final DataDescriptor<Namespace> PUBLIC_NAMESPACE =
+      new DataDescriptor<Namespace>("DartEntry.PUBLIC_NAMESPACE");
+
+  /**
+   * The data descriptor representing the errors resulting from resolving the
+   * source.
+   */
+  static final DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.RESOLUTION_ERRORS",
+          AnalysisError.NO_ERRORS);
+
+  /**
+   * The data descriptor representing the resolved AST structure.
+   */
+  static final DataDescriptor<CompilationUnit> RESOLVED_UNIT =
+      new DataDescriptor<CompilationUnit>("DartEntry.RESOLVED_UNIT");
+
+  /**
+   * The data descriptor representing the token stream.
+   */
+  static final DataDescriptor<List<AnalysisError>> SCAN_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.SCAN_ERRORS",
+          AnalysisError.NO_ERRORS);
+
+  /**
+   * The data descriptor representing the source kind.
+   */
+  static final DataDescriptor<SourceKind> SOURCE_KIND =
+      new DataDescriptor<SourceKind>("DartEntry.SOURCE_KIND", SourceKind.UNKNOWN);
+
+  /**
+   * The data descriptor representing the token stream.
+   */
+  static final DataDescriptor<Token> TOKEN_STREAM =
+      new DataDescriptor<Token>("DartEntry.TOKEN_STREAM");
+
+  /**
+   * The data descriptor representing the errors resulting from verifying the
+   * source.
+   */
+  static final DataDescriptor<List<AnalysisError>> VERIFICATION_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "DartEntry.VERIFICATION_ERRORS",
+          AnalysisError.NO_ERRORS);
+
+  /**
    * The list of libraries that contain this compilation unit. The list will be
    * empty if there are no known libraries that contain this compilation unit.
    */
@@ -7820,169 +8694,7 @@
    * part of the library that contains this unit. This field will never be
    * `null`.
    */
-  ResolutionState _resolutionState
-      = new ResolutionState();
-
-  /**
-   * The data descriptor representing the errors reported during Angular
-   * resolution.
-   */
-  static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.ANGULAR_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * The data descriptor representing the element model representing a single
-   * compilation unit. This model is incomplete and should not be used except as
-   * input to another task.
-   */
-  static final DataDescriptor<List<AnalysisError>> BUILT_ELEMENT
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.BUILT_ELEMENT");
-
-  /**
-   * The data descriptor representing the AST structure after the element model
-   * has been built (and declarations are resolved) but before other resolution
-   * has been performed.
-   */
-  static final DataDescriptor<CompilationUnit> BUILT_UNIT
-      = new DataDescriptor<CompilationUnit>("DartEntry.BUILT_UNIT");
-
-  /**
-   * The data descriptor representing the list of libraries that contain this
-   * compilation unit.
-   */
-  static final DataDescriptor<List<Source>> CONTAINING_LIBRARIES
-      = new DataDescriptor<List<Source>>("DartEntry.CONTAINING_LIBRARIES", Source.EMPTY_ARRAY);
-
-  /**
-   * The data descriptor representing the library element for the library. This
-   * data is only available for Dart files that are the defining compilation
-   * unit of a library.
-   */
-  static final DataDescriptor<LibraryElement> ELEMENT
-      = new DataDescriptor<LibraryElement>("DartEntry.ELEMENT");
-
-  /**
-   * The data descriptor representing the list of exported libraries. This data
-   * is only available for Dart files that are the defining compilation unit of
-   * a library.
-   */
-  static final DataDescriptor<List<Source>> EXPORTED_LIBRARIES
-      = new DataDescriptor<List<Source>>("DartEntry.EXPORTED_LIBRARIES", Source.EMPTY_ARRAY);
-
-  /**
-   * The data descriptor representing the hints resulting from auditing the
-   * source.
-   */
-  static final DataDescriptor<List<AnalysisError>> HINTS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.HINTS", AnalysisError.NO_ERRORS);
-
-  /**
-   * The data descriptor representing the list of imported libraries. This data
-   * is only available for Dart files that are the defining compilation unit of
-   * a library.
-   */
-  static final DataDescriptor<List<Source>> IMPORTED_LIBRARIES
-      = new DataDescriptor<List<Source>>("DartEntry.IMPORTED_LIBRARIES", Source.EMPTY_ARRAY);
-
-  /**
-   * The data descriptor representing the list of included parts. This data is
-   * only available for Dart files that are the defining compilation unit of a
-   * library.
-   */
-  static final DataDescriptor<List<Source>> INCLUDED_PARTS
-      = new DataDescriptor<List<Source>>("DartEntry.INCLUDED_PARTS", Source.EMPTY_ARRAY);
-
-  /**
-   * The data descriptor representing the client flag. This data is only
-   * available for Dart files that are the defining compilation unit of a
-   * library.
-   */
-  static final DataDescriptor<bool> IS_CLIENT
-      = new DataDescriptor<bool>("DartEntry.IS_CLIENT", false);
-
-  /**
-   * The data descriptor representing the launchable flag. This data is only
-   * available for Dart files that are the defining compilation unit of a
-   * library.
-   */
-  static final DataDescriptor<bool> IS_LAUNCHABLE
-      = new DataDescriptor<bool>("DartEntry.IS_LAUNCHABLE", false);
-
-  /**
-   * The data descriptor representing the errors resulting from parsing the
-   * source.
-   */
-  static final DataDescriptor<List<AnalysisError>> PARSE_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.PARSE_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * The data descriptor representing the parsed AST structure.
-   */
-  static final DataDescriptor<CompilationUnit> PARSED_UNIT
-      = new DataDescriptor<CompilationUnit>("DartEntry.PARSED_UNIT");
-
-  /**
-   * The data descriptor representing the public namespace of the library. This
-   * data is only available for Dart files that are the defining compilation
-   * unit of a library.
-   */
-  static final DataDescriptor<Namespace> PUBLIC_NAMESPACE
-      = new DataDescriptor<Namespace>("DartEntry.PUBLIC_NAMESPACE");
-
-  /**
-   * The data descriptor representing the errors resulting from resolving the
-   * source.
-   */
-  static final DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.RESOLUTION_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * The data descriptor representing the resolved AST structure.
-   */
-  static final DataDescriptor<CompilationUnit> RESOLVED_UNIT
-      = new DataDescriptor<CompilationUnit>("DartEntry.RESOLVED_UNIT");
-
-  /**
-   * The data descriptor representing the token stream.
-   */
-  static final DataDescriptor<List<AnalysisError>> SCAN_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.SCAN_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * The data descriptor representing the source kind.
-   */
-  static final DataDescriptor<SourceKind> SOURCE_KIND
-      = new DataDescriptor<SourceKind>("DartEntry.SOURCE_KIND", SourceKind.UNKNOWN);
-
-  /**
-   * The data descriptor representing the token stream.
-   */
-  static final DataDescriptor<Token> TOKEN_STREAM
-      = new DataDescriptor<Token>("DartEntry.TOKEN_STREAM");
-
-  /**
-   * The data descriptor representing the errors resulting from verifying the
-   * source.
-   */
-  static final DataDescriptor<List<AnalysisError>> VERIFICATION_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("DartEntry.VERIFICATION_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * Add the given [librarySource] to the list of libraries that contain this
-   * part. This method should only be invoked on entries that represent a part.
-   */
-  void addContainingLibrary(Source librarySource) {
-    _containingLibraries.add(librarySource);
-  }
-
-  /**
-   * Flush any AST structures being maintained by this entry.
-   */
-  void flushAstStructures() {
-    _flush(TOKEN_STREAM);
-    _flush(PARSED_UNIT);
-    _resolutionState.flushAstStructures();
-  }
+  ResolutionState _resolutionState = new ResolutionState();
 
   /**
    * Return all of the errors associated with the compilation unit that are
@@ -8022,7 +8734,7 @@
       }
       state = state._nextState;
     }
-    ;
+
     return anyResolvedCompilationUnit;
   }
 
@@ -8046,6 +8758,82 @@
    */
   List<Source> get containingLibraries => _containingLibraries;
 
+  /**
+   * Set the list of libraries that contain this compilation unit to contain
+   * only the given source. This method should only be invoked on entries that
+   * represent a library.
+   *
+   * @param librarySource the source of the single library that the list should contain
+   */
+  void set containingLibrary(Source librarySource) {
+    _containingLibraries.clear();
+    _containingLibraries.add(librarySource);
+  }
+
+  @override
+  List<DataDescriptor> get descriptors {
+    List<DataDescriptor> result = super.descriptors;
+    result.addAll(
+        <DataDescriptor>[
+            DartEntry.SOURCE_KIND,
+            DartEntry.CONTAINING_LIBRARIES,
+            DartEntry.PARSE_ERRORS,
+            DartEntry.PARSED_UNIT,
+            DartEntry.SCAN_ERRORS,
+            DartEntry.SOURCE_KIND,
+            DartEntry.TOKEN_STREAM]);
+    SourceKind kind = getValue(DartEntry.SOURCE_KIND);
+    if (kind == SourceKind.LIBRARY) {
+      result.addAll(
+          <DataDescriptor>[
+              DartEntry.ELEMENT,
+              DartEntry.EXPORTED_LIBRARIES,
+              DartEntry.IMPORTED_LIBRARIES,
+              DartEntry.INCLUDED_PARTS,
+              DartEntry.IS_CLIENT,
+              DartEntry.IS_LAUNCHABLE,
+              DartEntry.PUBLIC_NAMESPACE]);
+    }
+    return result;
+  }
+
+  /**
+   * Return `true` if this entry has an AST structure that can be resolved, even
+   * if it needs to be copied. Returning `true` implies that the method
+   * [resolvableCompilationUnit] will return a non-`null` result.
+   */
+  bool get hasResolvableCompilationUnit {
+    if (getState(PARSED_UNIT) == CacheState.VALID) {
+      return true;
+    }
+    ResolutionState state = _resolutionState;
+    while (state != null) {
+      if (state.getState(BUILT_UNIT) == CacheState.VALID ||
+          state.getState(RESOLVED_UNIT) == CacheState.VALID) {
+        return true;
+      }
+      state = state._nextState;
+    }
+
+    return false;
+  }
+
+  /**
+   * Return `true` if this data is safe to use in refactoring.
+   */
+  bool get isRefactoringSafe {
+    ResolutionState state = _resolutionState;
+    while (state != null) {
+      CacheState resolvedState = state.getState(RESOLVED_UNIT);
+      if (resolvedState != CacheState.VALID &&
+          resolvedState != CacheState.FLUSHED) {
+        return false;
+      }
+      state = state._nextState;
+    }
+    return true;
+  }
+
   @override
   SourceKind get kind => getValue(SOURCE_KIND);
 
@@ -8065,6 +8853,21 @@
   }
 
   /**
+   * Get a list of all the library-dependent descriptors for which values may
+   * be stored in this SourceEntry.
+   */
+  List<DataDescriptor> get libraryDescriptors {
+    return <DataDescriptor>[
+        DartEntry.ANGULAR_ERRORS,
+        DartEntry.BUILT_ELEMENT,
+        DartEntry.BUILT_UNIT,
+        DartEntry.RESOLUTION_ERRORS,
+        DartEntry.RESOLVED_UNIT,
+        DartEntry.VERIFICATION_ERRORS,
+        DartEntry.HINTS];
+  }
+
+  /**
    * A compilation unit that has not been accessed by any other client and can
    * therefore safely be modified by the reconciler, or `null` if the source has
    * not been parsed.
@@ -8091,10 +8894,28 @@
   }
 
   /**
+   * Add the given [librarySource] to the list of libraries that contain this
+   * part. This method should only be invoked on entries that represent a part.
+   */
+  void addContainingLibrary(Source librarySource) {
+    _containingLibraries.add(librarySource);
+  }
+
+  /**
+   * Flush any AST structures being maintained by this entry.
+   */
+  void flushAstStructures() {
+    _flush(TOKEN_STREAM);
+    _flush(PARSED_UNIT);
+    _resolutionState.flushAstStructures();
+  }
+
+  /**
    * Return the state of the data represented by the given [descriptor] in the
    * context of the given [librarySource].
    */
-  CacheState getStateInLibrary(DataDescriptor descriptor, Source librarySource) {
+  CacheState getStateInLibrary(DataDescriptor descriptor,
+      Source librarySource) {
     if (!_isValidLibraryDescriptor(descriptor)) {
       throw new ArgumentError("Invalid descriptor: $descriptor");
     }
@@ -8148,27 +8969,6 @@
     return false;
   }
 
-  /**
-   * Return `true` if this entry has an AST structure that can be resolved, even
-   * if it needs to be copied. Returning `true` implies that the method
-   * [resolvableCompilationUnit] will return a non-`null` result.
-   */
-  bool get hasResolvableCompilationUnit {
-    if (getState(PARSED_UNIT) == CacheState.VALID) {
-      return true;
-    }
-    ResolutionState state = _resolutionState;
-    while (state != null) {
-      if (state.getState(BUILT_UNIT) == CacheState.VALID
-          || state.getState(RESOLVED_UNIT) == CacheState.VALID) {
-        return true;
-      }
-      state = state._nextState;
-    }
-    ;
-    return false;
-  }
-
   @override
   void invalidateAllInformation() {
     super.invalidateAllInformation();
@@ -8205,28 +9005,13 @@
   }
 
   /**
-   * Return `true` if this data is safe to use in refactoring.
-   */
-  bool get isRefactoringSafe {
-    ResolutionState state = _resolutionState;
-    while (state != null) {
-      CacheState resolvedState = state.getState(RESOLVED_UNIT);
-      if (resolvedState != CacheState.VALID
-          && resolvedState != CacheState.FLUSHED) {
-        return false;
-      }
-      state = state._nextState;
-    }
-    return true;
-  }
-
-  /**
    * Record that an [exception] occurred while attempting to build the element
    * model for the source represented by this entry in the context of the given
    * [library]. This will set the state of all resolution-based information as
    * being in error, but will not change the state of any parse results.
    */
-  void recordBuildElementErrorInLibrary(Source librarySource, CaughtException exception) {
+  void recordBuildElementErrorInLibrary(Source librarySource,
+      CaughtException exception) {
     setStateInLibrary(BUILT_ELEMENT, librarySource, CacheState.ERROR);
     setStateInLibrary(BUILT_UNIT, librarySource, CacheState.ERROR);
     recordResolutionErrorInLibrary(librarySource, exception);
@@ -8246,7 +9031,8 @@
    * @param librarySource the source of the library in which hints were being generated
    * @param exception the exception that shows where the error occurred
    */
-  void recordHintErrorInLibrary(Source librarySource, CaughtException exception) {
+  void recordHintErrorInLibrary(Source librarySource,
+      CaughtException exception) {
     this.exception = exception;
     ResolutionState state = _getOrCreateResolutionState(librarySource);
     state.recordHintError();
@@ -8292,7 +9078,8 @@
    * @param librarySource the source of the library in which resolution was being performed
    * @param exception the exception that shows where the error occurred
    */
-  void recordResolutionErrorInLibrary(Source librarySource, CaughtException exception) {
+  void recordResolutionErrorInLibrary(Source librarySource,
+      CaughtException exception) {
     this.exception = exception;
     setState(ELEMENT, CacheState.ERROR);
     setState(IS_CLIENT, CacheState.ERROR);
@@ -8323,7 +9110,8 @@
    * @param librarySource the source of the library in which verification was being performed
    * @param exception the exception that shows where the error occurred
    */
-  void recordVerificationErrorInLibrary(Source librarySource, CaughtException exception) {
+  void recordVerificationErrorInLibrary(Source librarySource,
+      CaughtException exception) {
     this.exception = exception;
     ResolutionState state = _getOrCreateResolutionState(librarySource);
     state.recordVerificationError();
@@ -8368,18 +9156,6 @@
   }
 
   /**
-   * Set the list of libraries that contain this compilation unit to contain
-   * only the given source. This method should only be invoked on entries that
-   * represent a library.
-   *
-   * @param librarySource the source of the single library that the list should contain
-   */
-  void set containingLibrary(Source librarySource) {
-    _containingLibraries.clear();
-    _containingLibraries.add(librarySource);
-  }
-
-  /**
    * Set the state of the data represented by the given descriptor in the context of the given
    * library to the given state.
    *
@@ -8388,7 +9164,8 @@
    *          context for the data
    * @param cacheState the new state of the data represented by the given descriptor
    */
-  void setStateInLibrary(DataDescriptor descriptor, Source librarySource, CacheState cacheState) {
+  void setStateInLibrary(DataDescriptor descriptor, Source librarySource,
+      CacheState cacheState) {
     if (!_isValidLibraryDescriptor(descriptor)) {
       throw new ArgumentError("Invalid descriptor: $descriptor");
     }
@@ -8405,7 +9182,8 @@
    *          context for the data
    * @param value the new value of the data represented by the given descriptor and library
    */
-  void setValueInLibrary(DataDescriptor descriptor, Source librarySource, Object value) {
+  void setValueInLibrary(DataDescriptor descriptor, Source librarySource,
+      Object value) {
     if (!_isValidLibraryDescriptor(descriptor)) {
       throw new ArgumentError("Invalid descriptor: $descriptor");
     }
@@ -8413,104 +9191,6 @@
     state.setValue(descriptor, value);
   }
 
-  @override
-  bool _writeDiffOn(StringBuffer buffer, SourceEntry oldEntry) {
-    bool needsSeparator = super._writeDiffOn(buffer, oldEntry);
-    if (oldEntry is! DartEntry) {
-      if (needsSeparator) {
-        buffer.write("; ");
-      }
-      buffer.write("entry type changed; was ");
-      buffer.write(oldEntry.runtimeType.toString());
-      return true;
-    }
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "tokenStream", DartEntry.TOKEN_STREAM, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "scanErrors", DartEntry.SCAN_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "sourceKind", DartEntry.SOURCE_KIND, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "parsedUnit", DartEntry.PARSED_UNIT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "parseErrors", DartEntry.PARSE_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "importedLibraries", DartEntry.IMPORTED_LIBRARIES, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "exportedLibraries", DartEntry.EXPORTED_LIBRARIES, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "includedParts", DartEntry.INCLUDED_PARTS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "element", DartEntry.ELEMENT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "publicNamespace", DartEntry.PUBLIC_NAMESPACE, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "clientServer", DartEntry.IS_CLIENT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "launchable", DartEntry.IS_LAUNCHABLE, oldEntry);
-    // TODO(brianwilkerson) Add better support for containingLibraries. It would be nice to be able
-    // to report on size-preserving changes.
-    int oldLibraryCount = (oldEntry as DartEntry)._containingLibraries.length;
-    int libraryCount = _containingLibraries.length;
-    if (oldLibraryCount != libraryCount) {
-      if (needsSeparator) {
-        buffer.write("; ");
-      }
-      buffer.write("containingLibraryCount = ");
-      buffer.write(oldLibraryCount);
-      buffer.write(" -> ");
-      buffer.write(libraryCount);
-      needsSeparator = true;
-    }
-    //
-    // Report change to the per-library state.
-    //
-    HashMap<Source, ResolutionState> oldStateMap = new HashMap<Source, ResolutionState>();
-    ResolutionState state = (oldEntry as DartEntry)._resolutionState;
-    while (state != null) {
-      Source librarySource = state._librarySource;
-      if (librarySource != null) {
-        oldStateMap[librarySource] = state;
-      }
-      state = state._nextState;
-    }
-    state = _resolutionState;
-    while (state != null) {
-      Source librarySource = state._librarySource;
-      if (librarySource != null) {
-        ResolutionState oldState = oldStateMap.remove(librarySource);
-        if (oldState == null) {
-          if (needsSeparator) {
-            buffer.write("; ");
-          }
-          buffer.write("added resolution for ");
-          buffer.write(librarySource.fullName);
-          needsSeparator = true;
-        } else {
-          needsSeparator = oldState._writeDiffOn(buffer, needsSeparator, oldEntry as DartEntry);
-        }
-      }
-      state = state._nextState;
-    }
-    for (Source librarySource in oldStateMap.keys.toSet()) {
-      if (needsSeparator) {
-        buffer.write("; ");
-      }
-      buffer.write("removed resolution for ");
-      buffer.write(librarySource.fullName);
-      needsSeparator = true;
-    }
-    return needsSeparator;
-  }
-
-  @override
-  void _writeOn(StringBuffer buffer) {
-    buffer.write("Dart: ");
-    super._writeOn(buffer);
-    _writeStateOn(buffer, "tokenStream", TOKEN_STREAM);
-    _writeStateOn(buffer, "scanErrors", SCAN_ERRORS);
-    _writeStateOn(buffer, "sourceKind", SOURCE_KIND);
-    _writeStateOn(buffer, "parsedUnit", PARSED_UNIT);
-    _writeStateOn(buffer, "parseErrors", PARSE_ERRORS);
-    _writeStateOn(buffer, "exportedLibraries", EXPORTED_LIBRARIES);
-    _writeStateOn(buffer, "importedLibraries", IMPORTED_LIBRARIES);
-    _writeStateOn(buffer, "includedParts", INCLUDED_PARTS);
-    _writeStateOn(buffer, "element", ELEMENT);
-    _writeStateOn(buffer, "publicNamespace", PUBLIC_NAMESPACE);
-    _writeStateOn(buffer, "clientServer", IS_CLIENT);
-    _writeStateOn(buffer, "launchable", IS_LAUNCHABLE);
-    _writeStateOn(buffer, "angularErrors", ANGULAR_ERRORS);
-    _resolutionState._writeOn(buffer);
-  }
-
   /**
    * Invalidate all of the resolution information associated with the compilation unit.
    *
@@ -8556,21 +9236,21 @@
 
   @override
   bool _isValidDescriptor(DataDescriptor descriptor) {
-    return descriptor == ANGULAR_ERRORS
-        || descriptor == CONTAINING_LIBRARIES
-        || descriptor == ELEMENT
-        || descriptor == EXPORTED_LIBRARIES
-        || descriptor == IMPORTED_LIBRARIES
-        || descriptor == INCLUDED_PARTS
-        || descriptor == IS_CLIENT
-        || descriptor == IS_LAUNCHABLE
-        || descriptor == PARSED_UNIT
-        || descriptor == PARSE_ERRORS
-        || descriptor == PUBLIC_NAMESPACE
-        || descriptor == SCAN_ERRORS
-        || descriptor == SOURCE_KIND
-        || descriptor == TOKEN_STREAM
-        || super._isValidDescriptor(descriptor);
+    return descriptor == ANGULAR_ERRORS ||
+        descriptor == CONTAINING_LIBRARIES ||
+        descriptor == ELEMENT ||
+        descriptor == EXPORTED_LIBRARIES ||
+        descriptor == IMPORTED_LIBRARIES ||
+        descriptor == INCLUDED_PARTS ||
+        descriptor == IS_CLIENT ||
+        descriptor == IS_LAUNCHABLE ||
+        descriptor == PARSED_UNIT ||
+        descriptor == PARSE_ERRORS ||
+        descriptor == PUBLIC_NAMESPACE ||
+        descriptor == SCAN_ERRORS ||
+        descriptor == SOURCE_KIND ||
+        descriptor == TOKEN_STREAM ||
+        super._isValidDescriptor(descriptor);
   }
 
   /**
@@ -8578,35 +9258,177 @@
    * relative to a library.
    */
   bool _isValidLibraryDescriptor(DataDescriptor descriptor) {
-    return descriptor == ANGULAR_ERRORS
-        || descriptor == BUILT_ELEMENT
-        || descriptor == BUILT_UNIT
-        || descriptor == HINTS
-        || descriptor == RESOLUTION_ERRORS
-        || descriptor == RESOLVED_UNIT
-        || descriptor == VERIFICATION_ERRORS;
+    return descriptor == ANGULAR_ERRORS ||
+        descriptor == BUILT_ELEMENT ||
+        descriptor == BUILT_UNIT ||
+        descriptor == HINTS ||
+        descriptor == RESOLUTION_ERRORS ||
+        descriptor == RESOLVED_UNIT ||
+        descriptor == VERIFICATION_ERRORS;
   }
 
-  /**
-   * Given that the specified flag is being transitioned to the given state, set the value of the
-   * flag to the value that should be kept in the cache.
-   *
-   * @param index the index of the flag whose state is being set
-   * @param state the state to which the value is being transitioned
-   */
-  void _updateValueOfFlag(int index, CacheState state) {
-    if (state == CacheState.VALID) {
-      throw new IllegalArgumentException("Use setValue() to set the state to VALID");
-    } else if (state != CacheState.IN_PROCESS) {
-      //
-      // If the value is in process, we can leave the current value in the cache for any 'get'
-      // methods to access.
-      //
-      _setFlag(index, false);
+  @override
+  bool _writeDiffOn(StringBuffer buffer, SourceEntry oldEntry) {
+    bool needsSeparator = super._writeDiffOn(buffer, oldEntry);
+    if (oldEntry is! DartEntry) {
+      if (needsSeparator) {
+        buffer.write("; ");
+      }
+      buffer.write("entry type changed; was ");
+      buffer.write(oldEntry.runtimeType.toString());
+      return true;
     }
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "tokenStream",
+        DartEntry.TOKEN_STREAM,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "scanErrors",
+        DartEntry.SCAN_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "sourceKind",
+        DartEntry.SOURCE_KIND,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "parsedUnit",
+        DartEntry.PARSED_UNIT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "parseErrors",
+        DartEntry.PARSE_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "importedLibraries",
+        DartEntry.IMPORTED_LIBRARIES,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "exportedLibraries",
+        DartEntry.EXPORTED_LIBRARIES,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "includedParts",
+        DartEntry.INCLUDED_PARTS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "element",
+        DartEntry.ELEMENT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "publicNamespace",
+        DartEntry.PUBLIC_NAMESPACE,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "clientServer",
+        DartEntry.IS_CLIENT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "launchable",
+        DartEntry.IS_LAUNCHABLE,
+        oldEntry);
+    // TODO(brianwilkerson) Add better support for containingLibraries.
+    // It would be nice to be able to report on size-preserving changes.
+    int oldLibraryCount = (oldEntry as DartEntry)._containingLibraries.length;
+    int libraryCount = _containingLibraries.length;
+    if (oldLibraryCount != libraryCount) {
+      if (needsSeparator) {
+        buffer.write("; ");
+      }
+      buffer.write("containingLibraryCount = ");
+      buffer.write(oldLibraryCount);
+      buffer.write(" -> ");
+      buffer.write(libraryCount);
+      needsSeparator = true;
+    }
+    //
+    // Report change to the per-library state.
+    //
+    HashMap<Source, ResolutionState> oldStateMap =
+        new HashMap<Source, ResolutionState>();
+    ResolutionState state = (oldEntry as DartEntry)._resolutionState;
+    while (state != null) {
+      Source librarySource = state._librarySource;
+      if (librarySource != null) {
+        oldStateMap[librarySource] = state;
+      }
+      state = state._nextState;
+    }
+    state = _resolutionState;
+    while (state != null) {
+      Source librarySource = state._librarySource;
+      if (librarySource != null) {
+        ResolutionState oldState = oldStateMap.remove(librarySource);
+        if (oldState == null) {
+          if (needsSeparator) {
+            buffer.write("; ");
+          }
+          buffer.write("added resolution for ");
+          buffer.write(librarySource.fullName);
+          needsSeparator = true;
+        } else {
+          needsSeparator =
+              oldState._writeDiffOn(buffer, needsSeparator, oldEntry as DartEntry);
+        }
+      }
+      state = state._nextState;
+    }
+    for (Source librarySource in oldStateMap.keys.toSet()) {
+      if (needsSeparator) {
+        buffer.write("; ");
+      }
+      buffer.write("removed resolution for ");
+      buffer.write(librarySource.fullName);
+      needsSeparator = true;
+    }
+    return needsSeparator;
+  }
+
+  @override
+  void _writeOn(StringBuffer buffer) {
+    buffer.write("Dart: ");
+    super._writeOn(buffer);
+    _writeStateOn(buffer, "tokenStream", TOKEN_STREAM);
+    _writeStateOn(buffer, "scanErrors", SCAN_ERRORS);
+    _writeStateOn(buffer, "sourceKind", SOURCE_KIND);
+    _writeStateOn(buffer, "parsedUnit", PARSED_UNIT);
+    _writeStateOn(buffer, "parseErrors", PARSE_ERRORS);
+    _writeStateOn(buffer, "exportedLibraries", EXPORTED_LIBRARIES);
+    _writeStateOn(buffer, "importedLibraries", IMPORTED_LIBRARIES);
+    _writeStateOn(buffer, "includedParts", INCLUDED_PARTS);
+    _writeStateOn(buffer, "element", ELEMENT);
+    _writeStateOn(buffer, "publicNamespace", PUBLIC_NAMESPACE);
+    _writeStateOn(buffer, "clientServer", IS_CLIENT);
+    _writeStateOn(buffer, "launchable", IS_LAUNCHABLE);
+    _writeStateOn(buffer, "angularErrors", ANGULAR_ERRORS);
+    _resolutionState._writeOn(buffer);
   }
 }
 
+
 /**
  * Instances of the class `DataDescriptor` are immutable constants representing data that can
  * be stored in the cache.
@@ -8643,6 +9465,18 @@
    */
   static DefaultRetentionPolicy POLICY = new DefaultRetentionPolicy();
 
+  /**
+   * Return `true` if there is analysis information in the given entry that needs to be
+   * computed, where the computation is dependent on having the AST.
+   *
+   * @param dartEntry the entry being tested
+   * @return `true` if there is analysis information that needs to be computed from the AST
+   */
+  bool astIsNeeded(DartEntry dartEntry) =>
+      dartEntry.hasInvalidData(DartEntry.HINTS) ||
+          dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) ||
+          dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
+
   @override
   RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) {
     if (sourceEntry is DartEntry) {
@@ -8653,15 +9487,6 @@
     }
     return RetentionPriority.LOW;
   }
-
-  /**
-   * Return `true` if there is analysis information in the given entry that needs to be
-   * computed, where the computation is dependent on having the AST.
-   *
-   * @param dartEntry the entry being tested
-   * @return `true` if there is analysis information that needs to be computed from the AST
-   */
-  bool astIsNeeded(DartEntry dartEntry) => dartEntry.hasInvalidData(DartEntry.HINTS) || dartEntry.hasInvalidData(DartEntry.VERIFICATION_ERRORS) || dartEntry.hasInvalidData(DartEntry.RESOLUTION_ERRORS);
 }
 
 /**
@@ -8694,7 +9519,8 @@
     for (ht.XmlExpression xmlExpression in expressions) {
       if (xmlExpression is AngularXmlExpression) {
         AngularXmlExpression angularXmlExpression = xmlExpression;
-        List<Expression> dartExpressions = angularXmlExpression.expression.expressions;
+        List<Expression> dartExpressions =
+            angularXmlExpression.expression.expressions;
         for (Expression dartExpression in dartExpressions) {
           visitExpression(dartExpression);
         }
@@ -8713,48 +9539,6 @@
  */
 class GenerateDartErrorsTask extends AnalysisTask {
   /**
-   * Check each directive in the given compilation unit to see if the referenced source exists and
-   * report an error if it does not.
-   *
-   * @param context the context in which the library exists
-   * @param librarySource the source representing the library containing the directives
-   * @param unit the compilation unit containing the directives to be validated
-   * @param errorListener the error listener to which errors should be reported
-   */
-  static void validateDirectives(AnalysisContext context, Source librarySource, CompilationUnit unit, AnalysisErrorListener errorListener) {
-    for (Directive directive in unit.directives) {
-      if (directive is UriBasedDirective) {
-        validateReferencedSource(context, librarySource, directive, errorListener);
-      }
-    }
-  }
-
-  /**
-   * Check the given directive to see if the referenced source exists and report an error if it does
-   * not.
-   *
-   * @param context the context in which the library exists
-   * @param librarySource the source representing the library containing the directive
-   * @param directive the directive to be verified
-   * @param errorListener the error listener to which errors should be reported
-   */
-  static void validateReferencedSource(AnalysisContext context, Source librarySource, UriBasedDirective directive, AnalysisErrorListener errorListener) {
-    Source source = directive.source;
-    if (source != null) {
-      if (context.exists(source)) {
-        return;
-      }
-    } else {
-      // Don't report errors already reported by ParseDartTask.resolveDirective
-      if (directive.validate() != null) {
-        return;
-      }
-    }
-    StringLiteral uriLiteral = directive.uri;
-    errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_DOES_NOT_EXIST, [directive.uriContent]));
-  }
-
-  /**
    * The source for which errors and warnings are to be produced.
    */
   final Source source;
@@ -8782,10 +9566,9 @@
    * @param unit the compilation unit used to resolve the dependencies
    * @param libraryElement the element model for the library containing the source
    */
-  GenerateDartErrorsTask(InternalAnalysisContext context, this.source, this._unit, this.libraryElement) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitGenerateDartErrorsTask(this);
+  GenerateDartErrorsTask(InternalAnalysisContext context, this.source,
+      this._unit, this.libraryElement)
+      : super(context);
 
   /**
    * Return the errors that were generated for the source.
@@ -8795,11 +9578,17 @@
   List<AnalysisError> get errors => _errors;
 
   @override
-  String get taskDescription => "generate errors and warnings for ${source.fullName}";
+  String get taskDescription =>
+      "generate errors and warnings for ${source.fullName}";
+
+  @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitGenerateDartErrorsTask(this);
 
   @override
   void internalPerform() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.errors.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.errors.start();
     try {
       RecordingErrorListener errorListener = new RecordingErrorListener();
       ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
@@ -8809,25 +9598,85 @@
       //
       validateDirectives(context, source, _unit, errorListener);
       //
-      // Use the ConstantVerifier to verify the use of constants. This needs to happen before using
-      // the ErrorVerifier because some error codes need the computed constant values.
+      // Use the ConstantVerifier to verify the use of constants.
+      // This needs to happen before using the ErrorVerifier because some error
+      // codes need the computed constant values.
       //
       // TODO(paulberry): as a temporary workaround for issue 21572,
       // ConstantVerifier is being run right after ConstantValueComputer, so we
       // don't need to run it here.  Once issue 21572 is fixed, re-enable the
       // call to ConstantVerifier.
-      // ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, libraryElement, typeProvider);
-      // _unit.accept(constantVerifier);
+//      ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, libraryElement, typeProvider);
+//      _unit.accept(constantVerifier);
       //
       // Use the ErrorVerifier to compute the rest of the errors.
       //
-      ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, libraryElement, typeProvider, new InheritanceManager(libraryElement));
+      ErrorVerifier errorVerifier = new ErrorVerifier(
+          errorReporter,
+          libraryElement,
+          typeProvider,
+          new InheritanceManager(libraryElement));
       _unit.accept(errorVerifier);
       _errors = errorListener.getErrorsForSource(source);
     } finally {
       timeCounter.stop();
     }
   }
+
+  /**
+   * Check each directive in the given compilation unit to see if the referenced source exists and
+   * report an error if it does not.
+   *
+   * @param context the context in which the library exists
+   * @param librarySource the source representing the library containing the directives
+   * @param unit the compilation unit containing the directives to be validated
+   * @param errorListener the error listener to which errors should be reported
+   */
+  static void validateDirectives(AnalysisContext context, Source librarySource,
+      CompilationUnit unit, AnalysisErrorListener errorListener) {
+    for (Directive directive in unit.directives) {
+      if (directive is UriBasedDirective) {
+        validateReferencedSource(
+            context,
+            librarySource,
+            directive,
+            errorListener);
+      }
+    }
+  }
+
+  /**
+   * Check the given directive to see if the referenced source exists and report an error if it does
+   * not.
+   *
+   * @param context the context in which the library exists
+   * @param librarySource the source representing the library containing the directive
+   * @param directive the directive to be verified
+   * @param errorListener the error listener to which errors should be reported
+   */
+  static void validateReferencedSource(AnalysisContext context,
+      Source librarySource, UriBasedDirective directive,
+      AnalysisErrorListener errorListener) {
+    Source source = directive.source;
+    if (source != null) {
+      if (context.exists(source)) {
+        return;
+      }
+    } else {
+      // Don't report errors already reported by ParseDartTask.resolveDirective
+      if (directive.validate() != null) {
+        return;
+      }
+    }
+    StringLiteral uriLiteral = directive.uri;
+    errorListener.onError(
+        new AnalysisError.con2(
+            librarySource,
+            uriLiteral.offset,
+            uriLiteral.length,
+            CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+            [directive.uriContent]));
+  }
 }
 
 /**
@@ -8859,10 +9708,9 @@
    *          unit appearing first in the array
    * @param libraryElement the element model for the library being analyzed
    */
-  GenerateDartHintsTask(InternalAnalysisContext context, this._units, this.libraryElement) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitGenerateDartHintsTask(this);
+  GenerateDartHintsTask(InternalAnalysisContext context, this._units,
+      this.libraryElement)
+      : super(context);
 
   /**
    * Return a table mapping the sources that were analyzed to the hints that were generated for the
@@ -8884,12 +9732,17 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitGenerateDartHintsTask(this);
+
+  @override
   void internalPerform() {
     //
     // Gather the compilation units.
     //
     int unitCount = _units.length;
-    List<CompilationUnit> compilationUnits = new List<CompilationUnit>(unitCount);
+    List<CompilationUnit> compilationUnits =
+        new List<CompilationUnit>(unitCount);
     for (int i = 0; i < unitCount; i++) {
       compilationUnits[i] = _units[i].data;
     }
@@ -8897,7 +9750,8 @@
     // Analyze all of the units.
     //
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    HintGenerator hintGenerator = new HintGenerator(compilationUnits, context, errorListener);
+    HintGenerator hintGenerator =
+        new HintGenerator(compilationUnits, context, errorListener);
     hintGenerator.generateForLibrary();
     //
     // Store the results.
@@ -8941,15 +9795,13 @@
    * @param source the source to be parsed
    * @param contentData the time-stamped contents of the source
    */
-  GetContentTask(InternalAnalysisContext context, this.source) : super(context) {
+  GetContentTask(InternalAnalysisContext context, this.source)
+      : super(context) {
     if (source == null) {
       throw new IllegalArgumentException("Cannot get contents of null source");
     }
   }
 
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitGetContentTask(this);
-
   /**
    * Return the contents of the source, or `null` if the task has not completed or if there
    * was an exception while getting the contents.
@@ -8959,14 +9811,6 @@
   String get content => _content;
 
   /**
-   * Return the time at which the contents of the source that was parsed were last modified, or a
-   * negative value if the task has not yet been performed or if an exception occurred.
-   *
-   * @return the time at which the contents of the source that was parsed were last modified
-   */
-  int get modificationTime => _modificationTime;
-
-  /**
    * Return `true` if this task is complete. Unlike most tasks, this task is allowed to be
    * visited more than once in order to support asynchronous IO. If the task is not complete when it
    * is visited synchronously as part of the [AnalysisTask.perform]
@@ -8977,10 +9821,21 @@
    */
   bool get isComplete => _complete;
 
+  /**
+   * Return the time at which the contents of the source that was parsed were last modified, or a
+   * negative value if the task has not yet been performed or if an exception occurred.
+   *
+   * @return the time at which the contents of the source that was parsed were last modified
+   */
+  int get modificationTime => _modificationTime;
+
   @override
   String get taskDescription => "get contents of ${source.fullName}";
 
   @override
+  accept(AnalysisTaskVisitor visitor) => visitor.visitGetContentTask(this);
+
+  @override
   void internalPerform() {
     _complete = true;
     try {
@@ -8988,7 +9843,9 @@
       _content = data.data;
       _modificationTime = data.modificationTime;
     } catch (exception, stackTrace) {
-      throw new AnalysisException("Could not get contents of $source", new CaughtException(exception, stackTrace));
+      throw new AnalysisException(
+          "Could not get contents of $source",
+          new CaughtException(exception, stackTrace));
     }
   }
 }
@@ -9002,98 +9859,102 @@
    * The data descriptor representing the information about an Angular
    * application this source is used in.
    */
-  static final DataDescriptor<AngularApplication> ANGULAR_APPLICATION
-      = new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_APPLICATION");
+  static final DataDescriptor<AngularApplication> ANGULAR_APPLICATION =
+      new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_APPLICATION");
 
   /**
    * The data descriptor representing the information about an Angular component
    * this source is used as template for.
    */
-  static final DataDescriptor<AngularComponentElement> ANGULAR_COMPONENT
-      = new DataDescriptor<AngularComponentElement>("HtmlEntry.ANGULAR_COMPONENT");
+  static final DataDescriptor<AngularComponentElement> ANGULAR_COMPONENT =
+      new DataDescriptor<AngularComponentElement>("HtmlEntry.ANGULAR_COMPONENT");
 
   /**
    * The data descriptor representing the information about an Angular
    * application for which this source is an entry point.
    */
-  static final DataDescriptor<AngularApplication> ANGULAR_ENTRY
-      = new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_ENTRY");
+  static final DataDescriptor<AngularApplication> ANGULAR_ENTRY =
+      new DataDescriptor<AngularApplication>("HtmlEntry.ANGULAR_ENTRY");
 
   /**
    * The data descriptor representing the errors reported during Angular
    * resolution.
    */
-  static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.ANGULAR_ERRORS", AnalysisError.NO_ERRORS);
+  static final DataDescriptor<List<AnalysisError>> ANGULAR_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.ANGULAR_ERRORS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * The data descriptor representing the HTML element.
    */
-  static final DataDescriptor<HtmlElement> ELEMENT
-      = new DataDescriptor<HtmlElement>("HtmlEntry.ELEMENT");
+  static final DataDescriptor<HtmlElement> ELEMENT =
+      new DataDescriptor<HtmlElement>("HtmlEntry.ELEMENT");
 
   /**
    * The data descriptor representing the hints resulting from auditing the
    * source.
    */
-  static final DataDescriptor<List<AnalysisError>> HINTS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.HINTS", AnalysisError.NO_ERRORS);
+  static final DataDescriptor<List<AnalysisError>> HINTS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.HINTS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * The data descriptor representing the errors resulting from parsing the
    * source.
    */
-  static final DataDescriptor<List<AnalysisError>> PARSE_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.PARSE_ERRORS", AnalysisError.NO_ERRORS);
+  static final DataDescriptor<List<AnalysisError>> PARSE_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.PARSE_ERRORS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * The data descriptor representing the parsed AST structure.
    */
-  static final DataDescriptor<ht.HtmlUnit> PARSED_UNIT
-      = new DataDescriptor<ht.HtmlUnit>("HtmlEntry.PARSED_UNIT");
+  static final DataDescriptor<ht.HtmlUnit> PARSED_UNIT =
+      new DataDescriptor<ht.HtmlUnit>("HtmlEntry.PARSED_UNIT");
 
   /**
    * The data descriptor representing the resolved AST structure.
    */
-  static final DataDescriptor<ht.HtmlUnit> RESOLVED_UNIT
-      = new DataDescriptor<ht.HtmlUnit>("HtmlEntry.RESOLVED_UNIT");
+  static final DataDescriptor<ht.HtmlUnit> RESOLVED_UNIT =
+      new DataDescriptor<ht.HtmlUnit>("HtmlEntry.RESOLVED_UNIT");
 
   /**
    * The data descriptor representing the list of referenced libraries.
    */
-  static final DataDescriptor<List<Source>> REFERENCED_LIBRARIES
-      = new DataDescriptor<List<Source>>("HtmlEntry.REFERENCED_LIBRARIES", Source.EMPTY_ARRAY);
+  static final DataDescriptor<List<Source>> REFERENCED_LIBRARIES =
+      new DataDescriptor<List<Source>>(
+          "HtmlEntry.REFERENCED_LIBRARIES",
+          Source.EMPTY_ARRAY);
 
   /**
    * The data descriptor representing the errors resulting from resolving the
    * source.
    */
-  static final DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.RESOLUTION_ERRORS", AnalysisError.NO_ERRORS);
+  static final DataDescriptor<List<AnalysisError>> RESOLUTION_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.RESOLUTION_ERRORS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * The data descriptor representing the status of Polymer elements in the
    * source.
    */
-  static final DataDescriptor<List<AnalysisError>> POLYMER_BUILD_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.POLYMER_BUILD_ERRORS", AnalysisError.NO_ERRORS);
+  static final DataDescriptor<List<AnalysisError>> POLYMER_BUILD_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.POLYMER_BUILD_ERRORS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * The data descriptor representing the errors reported during Polymer
    * resolution.
    */
-  static final DataDescriptor<List<AnalysisError>> POLYMER_RESOLUTION_ERRORS
-      = new DataDescriptor<List<AnalysisError>>("HtmlEntry.POLYMER_RESOLUTION_ERRORS", AnalysisError.NO_ERRORS);
-
-  /**
-   * Flush any AST structures being maintained by this entry.
-   */
-  void flushAstStructures() {
-    _flush(PARSED_UNIT);
-    _flush(RESOLVED_UNIT);
-    _flush(ANGULAR_ENTRY);
-    _flush(ANGULAR_ERRORS);
-  }
+  static final DataDescriptor<List<AnalysisError>> POLYMER_RESOLUTION_ERRORS =
+      new DataDescriptor<List<AnalysisError>>(
+          "HtmlEntry.POLYMER_RESOLUTION_ERRORS",
+          AnalysisError.NO_ERRORS);
 
   /**
    * Return all of the errors associated with the HTML file that are currently
@@ -9129,8 +9990,38 @@
   }
 
   @override
+  List<DataDescriptor> get descriptors {
+    List<DataDescriptor> result = super.descriptors;
+    result.addAll(
+        [
+            HtmlEntry.ANGULAR_APPLICATION,
+            HtmlEntry.ANGULAR_COMPONENT,
+            HtmlEntry.ANGULAR_ENTRY,
+            HtmlEntry.ANGULAR_ERRORS,
+            HtmlEntry.ELEMENT,
+            HtmlEntry.PARSE_ERRORS,
+            HtmlEntry.PARSED_UNIT,
+            HtmlEntry.POLYMER_BUILD_ERRORS,
+            HtmlEntry.POLYMER_RESOLUTION_ERRORS,
+            HtmlEntry.RESOLUTION_ERRORS,
+            HtmlEntry.RESOLVED_UNIT,
+            HtmlEntry.HINTS]);
+    return result;
+  }
+
+  @override
   SourceKind get kind => SourceKind.HTML;
 
+  /**
+   * Flush any AST structures being maintained by this entry.
+   */
+  void flushAstStructures() {
+    _flush(PARSED_UNIT);
+    _flush(RESOLVED_UNIT);
+    _flush(ANGULAR_ENTRY);
+    _flush(ANGULAR_ERRORS);
+  }
+
   @override
   void invalidateAllInformation() {
     super.invalidateAllInformation();
@@ -9169,7 +10060,8 @@
    * source associated with this entry.
    */
   void recordParseError(CaughtException exception) {
-    // If the scanning and parsing of HTML are separated, the following line can be removed.
+    // If the scanning and parsing of HTML are separated,
+    // the following line can be removed.
     recordScanError(exception);
     setState(PARSE_ERRORS, CacheState.ERROR);
     setState(PARSED_UNIT, CacheState.ERROR);
@@ -9194,20 +10086,20 @@
 
   @override
   bool _isValidDescriptor(DataDescriptor descriptor) {
-    return descriptor == ANGULAR_APPLICATION
-        || descriptor == ANGULAR_COMPONENT
-        || descriptor == ANGULAR_ENTRY
-        || descriptor == ANGULAR_ERRORS
-        || descriptor == ELEMENT
-        || descriptor == HINTS
-        || descriptor == PARSED_UNIT
-        || descriptor == PARSE_ERRORS
-        || descriptor == POLYMER_BUILD_ERRORS
-        || descriptor == POLYMER_RESOLUTION_ERRORS
-        || descriptor == REFERENCED_LIBRARIES
-        || descriptor == RESOLUTION_ERRORS
-        || descriptor == RESOLVED_UNIT
-        || super._isValidDescriptor(descriptor);
+    return descriptor == ANGULAR_APPLICATION ||
+        descriptor == ANGULAR_COMPONENT ||
+        descriptor == ANGULAR_ENTRY ||
+        descriptor == ANGULAR_ERRORS ||
+        descriptor == ELEMENT ||
+        descriptor == HINTS ||
+        descriptor == PARSED_UNIT ||
+        descriptor == PARSE_ERRORS ||
+        descriptor == POLYMER_BUILD_ERRORS ||
+        descriptor == POLYMER_RESOLUTION_ERRORS ||
+        descriptor == REFERENCED_LIBRARIES ||
+        descriptor == RESOLUTION_ERRORS ||
+        descriptor == RESOLVED_UNIT ||
+        super._isValidDescriptor(descriptor);
   }
 
   @override
@@ -9221,18 +10113,78 @@
       buffer.write(oldEntry.runtimeType);
       return true;
     }
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "parseErrors", HtmlEntry.PARSE_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "parsedUnit", HtmlEntry.PARSED_UNIT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "resolvedUnit", HtmlEntry.RESOLVED_UNIT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "resolutionErrors", HtmlEntry.RESOLUTION_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "referencedLibraries", HtmlEntry.REFERENCED_LIBRARIES, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "element", HtmlEntry.ELEMENT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "angularApplicationState", HtmlEntry.ANGULAR_APPLICATION, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "angularComponent", HtmlEntry.ANGULAR_COMPONENT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "angularEntry", HtmlEntry.ANGULAR_ENTRY, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "angularErrors", HtmlEntry.ANGULAR_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "polymerBuildErrors", HtmlEntry.POLYMER_BUILD_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "polymerResolutionErrors", HtmlEntry.POLYMER_RESOLUTION_ERRORS, oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "parseErrors",
+        HtmlEntry.PARSE_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "parsedUnit",
+        HtmlEntry.PARSED_UNIT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "resolvedUnit",
+        HtmlEntry.RESOLVED_UNIT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "resolutionErrors",
+        HtmlEntry.RESOLUTION_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "referencedLibraries",
+        HtmlEntry.REFERENCED_LIBRARIES,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "element",
+        HtmlEntry.ELEMENT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "angularApplicationState",
+        HtmlEntry.ANGULAR_APPLICATION,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "angularComponent",
+        HtmlEntry.ANGULAR_COMPONENT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "angularEntry",
+        HtmlEntry.ANGULAR_ENTRY,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "angularErrors",
+        HtmlEntry.ANGULAR_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "polymerBuildErrors",
+        HtmlEntry.POLYMER_BUILD_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "polymerResolutionErrors",
+        HtmlEntry.POLYMER_RESOLUTION_ERRORS,
+        oldEntry);
     return needsSeparator;
   }
 
@@ -9262,112 +10214,6 @@
  * See [AnalysisContextImpl.setChangedContents].
  */
 class IncrementalAnalysisCache {
-  /**
-   * Determine if the incremental analysis result can be cached for the next incremental analysis.
-   *
-   * @param cache the prior incremental analysis cache
-   * @param unit the incrementally updated compilation unit
-   * @return the cache used for incremental analysis or `null` if incremental analysis results
-   *         cannot be cached for the next incremental analysis
-   */
-  static IncrementalAnalysisCache cacheResult(IncrementalAnalysisCache cache, CompilationUnit unit) {
-    if (cache != null && unit != null) {
-      return new IncrementalAnalysisCache(cache.librarySource, cache.source, unit, cache._newContents, cache._newContents, 0, 0, 0);
-    }
-    return null;
-  }
-
-  /**
-   * Determine if the cache should be cleared.
-   *
-   * @param cache the prior cache or `null` if none
-   * @param source the source being updated (not `null`)
-   * @return the cache used for incremental analysis or `null` if incremental analysis cannot
-   *         be performed
-   */
-  static IncrementalAnalysisCache clear(IncrementalAnalysisCache cache, Source source) {
-    if (cache == null || cache.source == source) {
-      return null;
-    }
-    return cache;
-  }
-
-  /**
-   * Determine if incremental analysis can be performed from the given information.
-   *
-   * @param cache the prior cache or `null` if none
-   * @param source the source being updated (not `null`)
-   * @param oldContents the original source contents prior to this update (may be `null`)
-   * @param newContents the new contents after this incremental change (not `null`)
-   * @param offset the offset at which the change occurred
-   * @param oldLength the length of the text being replaced
-   * @param newLength the length of the replacement text
-   * @param sourceEntry the cached entry for the given source or `null` if none
-   * @return the cache used for incremental analysis or `null` if incremental analysis cannot
-   *         be performed
-   */
-  static IncrementalAnalysisCache update(IncrementalAnalysisCache cache, Source source, String oldContents, String newContents, int offset, int oldLength, int newLength, SourceEntry sourceEntry) {
-    // Determine the cache resolved unit
-    Source librarySource = null;
-    CompilationUnit unit = null;
-    if (sourceEntry is DartEntry) {
-      DartEntry dartEntry = sourceEntry;
-      List<Source> librarySources = dartEntry.librariesContaining;
-      if (librarySources.length == 1) {
-        librarySource = librarySources[0];
-        if (librarySource != null) {
-          unit = dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
-        }
-      }
-    }
-    // Create a new cache if there is not an existing cache or the source is different
-    // or a new resolved compilation unit is available
-    if (cache == null || cache.source != source || unit != null) {
-      if (unit == null) {
-        return null;
-      }
-      if (oldContents == null) {
-        if (oldLength != 0) {
-          return null;
-        }
-        oldContents = "${newContents.substring(0, offset)}${newContents.substring(offset + newLength)}";
-      }
-      return new IncrementalAnalysisCache(librarySource, source, unit, oldContents, newContents, offset, oldLength, newLength);
-    }
-    // Update the existing cache if the change is contiguous
-    if (cache._oldLength == 0 && cache._newLength == 0) {
-      cache._offset = offset;
-      cache._oldLength = oldLength;
-      cache._newLength = newLength;
-    } else {
-      if (cache._offset > offset || offset > cache._offset + cache._newLength) {
-        return null;
-      }
-      cache._newLength += newLength - oldLength;
-    }
-    cache._newContents = newContents;
-    return cache;
-  }
-
-  /**
-   * Verify that the incrementally parsed and resolved unit in the incremental cache is structurally
-   * equivalent to the fully parsed unit.
-   *
-   * @param cache the prior cache or `null` if none
-   * @param source the source of the compilation unit that was parsed (not `null`)
-   * @param unit the compilation unit that was just parsed
-   * @return the cache used for incremental analysis or `null` if incremental analysis results
-   *         cannot be cached for the next incremental analysis
-   */
-  static IncrementalAnalysisCache verifyStructure(IncrementalAnalysisCache cache, Source source, CompilationUnit unit) {
-    if (cache != null && unit != null && cache.source == source) {
-      if (!AstComparator.equalNodes(cache.resolvedUnit, unit)) {
-        return null;
-      }
-    }
-    return cache;
-  }
-
   final Source librarySource;
 
   final Source source;
@@ -9384,7 +10230,9 @@
 
   int _newLength = 0;
 
-  IncrementalAnalysisCache(this.librarySource, this.source, this.resolvedUnit, this.oldContents, String newContents, int offset, int oldLength, int newLength) {
+  IncrementalAnalysisCache(this.librarySource, this.source, this.resolvedUnit,
+      this.oldContents, String newContents, int offset, int oldLength, int newLength)
+      {
     this._newContents = newContents;
     this._offset = offset;
     this._oldLength = oldLength;
@@ -9392,6 +10240,13 @@
   }
 
   /**
+   * Determine if the cache contains source changes that need to be analyzed
+   *
+   * @return `true` if the cache contains changes to be analyzed, else `false`
+   */
+  bool get hasWork => _oldLength > 0 || _newLength > 0;
+
+  /**
    * Return the current contents for the receiver's source.
    *
    * @return the contents (not `null`)
@@ -9420,11 +10275,134 @@
   int get oldLength => _oldLength;
 
   /**
-   * Determine if the cache contains source changes that need to be analyzed
+   * Determine if the incremental analysis result can be cached for the next incremental analysis.
    *
-   * @return `true` if the cache contains changes to be analyzed, else `false`
+   * @param cache the prior incremental analysis cache
+   * @param unit the incrementally updated compilation unit
+   * @return the cache used for incremental analysis or `null` if incremental analysis results
+   *         cannot be cached for the next incremental analysis
    */
-  bool get hasWork => _oldLength > 0 || _newLength > 0;
+  static IncrementalAnalysisCache cacheResult(IncrementalAnalysisCache cache,
+      CompilationUnit unit) {
+    if (cache != null && unit != null) {
+      return new IncrementalAnalysisCache(
+          cache.librarySource,
+          cache.source,
+          unit,
+          cache._newContents,
+          cache._newContents,
+          0,
+          0,
+          0);
+    }
+    return null;
+  }
+
+  /**
+   * Determine if the cache should be cleared.
+   *
+   * @param cache the prior cache or `null` if none
+   * @param source the source being updated (not `null`)
+   * @return the cache used for incremental analysis or `null` if incremental analysis cannot
+   *         be performed
+   */
+  static IncrementalAnalysisCache clear(IncrementalAnalysisCache cache,
+      Source source) {
+    if (cache == null || cache.source == source) {
+      return null;
+    }
+    return cache;
+  }
+
+  /**
+   * Determine if incremental analysis can be performed from the given information.
+   *
+   * @param cache the prior cache or `null` if none
+   * @param source the source being updated (not `null`)
+   * @param oldContents the original source contents prior to this update (may be `null`)
+   * @param newContents the new contents after this incremental change (not `null`)
+   * @param offset the offset at which the change occurred
+   * @param oldLength the length of the text being replaced
+   * @param newLength the length of the replacement text
+   * @param sourceEntry the cached entry for the given source or `null` if none
+   * @return the cache used for incremental analysis or `null` if incremental analysis cannot
+   *         be performed
+   */
+  static IncrementalAnalysisCache update(IncrementalAnalysisCache cache,
+      Source source, String oldContents, String newContents, int offset,
+      int oldLength, int newLength, SourceEntry sourceEntry) {
+    // Determine the cache resolved unit
+    Source librarySource = null;
+    CompilationUnit unit = null;
+    if (sourceEntry is DartEntry) {
+      DartEntry dartEntry = sourceEntry;
+      List<Source> librarySources = dartEntry.librariesContaining;
+      if (librarySources.length == 1) {
+        librarySource = librarySources[0];
+        if (librarySource != null) {
+          unit =
+              dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
+        }
+      }
+    }
+    // Create a new cache if there is not an existing cache or the source is
+    // different or a new resolved compilation unit is available.
+    if (cache == null || cache.source != source || unit != null) {
+      if (unit == null) {
+        return null;
+      }
+      if (oldContents == null) {
+        if (oldLength != 0) {
+          return null;
+        }
+        oldContents =
+            "${newContents.substring(0, offset)}${newContents.substring(offset + newLength)}";
+      }
+      return new IncrementalAnalysisCache(
+          librarySource,
+          source,
+          unit,
+          oldContents,
+          newContents,
+          offset,
+          oldLength,
+          newLength);
+    }
+    // Update the existing cache if the change is contiguous
+    if (cache._oldLength == 0 && cache._newLength == 0) {
+      cache._offset = offset;
+      cache._oldLength = oldLength;
+      cache._newLength = newLength;
+    } else {
+      if (cache._offset > offset || offset > cache._offset + cache._newLength) {
+        return null;
+      }
+      cache._newLength += newLength - oldLength;
+    }
+    cache._newContents = newContents;
+    return cache;
+  }
+
+  /**
+   * Verify that the incrementally parsed and resolved unit in the incremental cache is structurally
+   * equivalent to the fully parsed unit.
+   *
+   * @param cache the prior cache or `null` if none
+   * @param source the source of the compilation unit that was parsed (not `null`)
+   * @param unit the compilation unit that was just parsed
+   * @return the cache used for incremental analysis or `null` if incremental analysis results
+   *         cannot be cached for the next incremental analysis
+   */
+  static IncrementalAnalysisCache
+      verifyStructure(IncrementalAnalysisCache cache, Source source,
+      CompilationUnit unit) {
+    if (cache != null && unit != null && cache.source == source) {
+      if (!AstComparator.equalNodes(cache.resolvedUnit, unit)) {
+        return null;
+      }
+    }
+    return cache;
+  }
 }
 
 /**
@@ -9447,10 +10425,8 @@
    * @param context the context in which the task is to be performed
    * @param cache the incremental analysis cache used to perform the analysis
    */
-  IncrementalAnalysisTask(InternalAnalysisContext context, this.cache) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitIncrementalAnalysisTask(this);
+  IncrementalAnalysisTask(InternalAnalysisContext context, this.cache)
+      : super(context);
 
   /**
    * Return the compilation unit that was produced by incrementally updating the existing
@@ -9469,41 +10445,8 @@
   Source get source => cache != null ? cache.source : null;
 
   @override
-  String get taskDescription => "incremental analysis ${cache != null ? cache.source : "null"}";
-
-  @override
-  void internalPerform() {
-    if (cache == null) {
-      return;
-    }
-    // Only handle small changes
-    if (cache.oldLength > 0 || cache.newLength > 30) {
-      return;
-    }
-    // Produce an updated token stream
-    CharacterReader reader = new CharSequenceReader(cache.newContents);
-    BooleanErrorListener errorListener = new BooleanErrorListener();
-    IncrementalScanner scanner = new IncrementalScanner(cache.source, reader, errorListener);
-    scanner.rescan(cache.resolvedUnit.beginToken, cache.offset, cache.oldLength, cache.newLength);
-    if (errorListener.errorReported) {
-      return;
-    }
-    // Produce an updated AST
-    IncrementalParser parser = new IncrementalParser(cache.source, scanner.tokenMap, AnalysisErrorListener.NULL_LISTENER);
-    _updatedUnit = parser.reparse(cache.resolvedUnit, scanner.leftToken, scanner.rightToken, cache.offset, cache.offset + cache.oldLength);
-    // Update the resolution
-    TypeProvider typeProvider = this.typeProvider;
-    if (_updatedUnit != null && typeProvider != null) {
-      CompilationUnitElement element = _updatedUnit.element;
-      if (element != null) {
-        LibraryElement library = element.library;
-        if (library != null) {
-          IncrementalResolver resolver = new IncrementalResolver(library, cache.source, typeProvider, errorListener);
-          resolver.resolve(parser.updatedNode);
-        }
-      }
-    }
-  }
+  String get taskDescription =>
+      "incremental analysis ${cache != null ? cache.source : "null"}";
 
   /**
    * Return the type provider used for incremental resolution.
@@ -9517,6 +10460,64 @@
       return null;
     }
   }
+
+  @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitIncrementalAnalysisTask(this);
+
+  @override
+  void internalPerform() {
+    if (cache == null) {
+      return;
+    }
+    // Only handle small changes
+    if (cache.oldLength > 0 || cache.newLength > 30) {
+      return;
+    }
+    // Produce an updated token stream
+    CharacterReader reader = new CharSequenceReader(cache.newContents);
+    BooleanErrorListener errorListener = new BooleanErrorListener();
+    IncrementalScanner scanner =
+        new IncrementalScanner(cache.source, reader, errorListener);
+    scanner.rescan(
+        cache.resolvedUnit.beginToken,
+        cache.offset,
+        cache.oldLength,
+        cache.newLength);
+    if (errorListener.errorReported) {
+      return;
+    }
+    // Produce an updated AST
+    IncrementalParser parser = new IncrementalParser(
+        cache.source,
+        scanner.tokenMap,
+        AnalysisErrorListener.NULL_LISTENER);
+    _updatedUnit = parser.reparse(
+        cache.resolvedUnit,
+        scanner.leftToken,
+        scanner.rightToken,
+        cache.offset,
+        cache.offset + cache.oldLength);
+    // Update the resolution
+    TypeProvider typeProvider = this.typeProvider;
+    if (_updatedUnit != null && typeProvider != null) {
+      CompilationUnitElement element = _updatedUnit.element;
+      if (element != null) {
+        LibraryElement library = element.library;
+        if (library != null) {
+          IncrementalResolver resolver = new IncrementalResolver(
+              typeProvider,
+              library,
+              element,
+              cache.source,
+              cache.offset,
+              cache.oldLength,
+              cache.newLength);
+          resolver.resolve(parser.updatedNode);
+        }
+      }
+    }
+  }
 }
 
 /**
@@ -9526,25 +10527,6 @@
  */
 class InstrumentedAnalysisContextImpl implements InternalAnalysisContext {
   /**
-   * If the current thread is the UI thread, then note this in the specified instrumentation and
-   * append this information to the log.
-   *
-   * @param instrumentation the instrumentation, not `null`
-   */
-  static void _checkThread(InstrumentationBuilder instrumentation) {
-  }
-
-  /**
-   * Record an exception that was thrown during analysis.
-   *
-   * @param instrumentation the instrumentation builder being used to record the exception
-   * @param exception the exception being reported
-   */
-  static void _recordAnalysisException(InstrumentationBuilder instrumentation, CaughtException exception) {
-    instrumentation.record(exception);
-  }
-
-  /**
    * The unique identifier used to identify this analysis context in the instrumentation data.
    */
   String _contextId = UUID.randomUUID().toString();
@@ -9571,159 +10553,9 @@
   }
 
   @override
-  void addListener(AnalysisListener listener) {
-    _basis.addListener(listener);
-  }
-
-  @override
-  void addSourceInfo(Source source, SourceEntry info) {
-    _basis.addSourceInfo(source, info);
-  }
-
-  @override
-  void applyAnalysisDelta(AnalysisDelta delta) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-updateAnalysis");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.applyAnalysisDelta(delta);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  void applyChanges(ChangeSet changeSet) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-applyChanges");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.applyChanges(changeSet);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  String computeDocumentationComment(Element element) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeDocumentationComment");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.computeDocumentationComment(element);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  List<AnalysisError> computeErrors(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeErrors");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      List<AnalysisError> errors = _basis.computeErrors(source);
-      instrumentation.metric2("Errors-count", errors.length);
-      return errors;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  List<Source> computeExportedLibraries(Source source) => _basis.computeExportedLibraries(source);
-
-  @override
-  HtmlElement computeHtmlElement(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeHtmlElement");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.computeHtmlElement(source);
-    } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
-      throw e;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  List<Source> computeImportedLibraries(Source source) => _basis.computeImportedLibraries(source);
-
-  @override
-  SourceKind computeKindOf(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeKindOf");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.computeKindOf(source);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  LibraryElement computeLibraryElement(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeLibraryElement");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.computeLibraryElement(source);
-    } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
-      throw e;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  LineInfo computeLineInfo(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-computeLineInfo");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.computeLineInfo(source);
-    } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
-      throw e;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  CompilationUnit computeResolvableCompilationUnit(Source source)
-      => _basis.computeResolvableCompilationUnit(source);
-
-  @override
-  void dispose() {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-dispose");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.dispose();
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  bool exists(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-exists");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.exists(source);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
   AnalysisOptions get analysisOptions {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getAnalysisOptions");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getAnalysisOptions");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9734,12 +10566,26 @@
   }
 
   @override
-  AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getAngularApplication");
+  void set analysisOptions(AnalysisOptions options) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-setAnalysisOptions");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
-      return _basis.getAngularApplicationWithHtml(htmlSource);
+      _basis.analysisOptions = options;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  void set analysisPriorityOrder(List<Source> sources) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-setAnalysisPriorityOrder");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.analysisPriorityOrder = sources;
     } finally {
       instrumentation.log();
     }
@@ -9751,94 +10597,12 @@
   AnalysisContext get basis => _basis;
 
   @override
-  CompilationUnitElement getCompilationUnitElement(Source unitSource, Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getCompilationUnitElement");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.getCompilationUnitElement(unitSource, librarySource);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  TimestampedData<String> getContents(Source source) => _basis.getContents(source);
-
-  @override
-  InternalAnalysisContext getContextFor(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getContextFor");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.getContextFor(source);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
   DeclaredVariables get declaredVariables => _basis.declaredVariables;
 
   @override
-  Element getElement(ElementLocation location) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getElement");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.getElement(location);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  AnalysisErrorInfo getErrors(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getErrors");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      AnalysisErrorInfo ret = _basis.getErrors(source);
-      if (ret != null) {
-        instrumentation.metric2("Errors-count", ret.errors.length);
-      }
-      return ret;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  HtmlElement getHtmlElement(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlElement");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.getHtmlElement(source);
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  List<Source> getHtmlFilesReferencing(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlFilesReferencing");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      List<Source> ret = _basis.getHtmlFilesReferencing(source);
-      if (ret != null) {
-        instrumentation.metric2("Source-count", ret.length);
-      }
-      return ret;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
   List<Source> get htmlSources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getHtmlSources");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getHtmlSources");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9853,12 +10617,13 @@
   }
 
   @override
-  SourceKind getKindOf(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getKindOf");
+  bool get isDisposed {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-isDisposed");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
-      return _basis.getKindOf(source);
+      return _basis.isDisposed;
     } finally {
       instrumentation.log();
     }
@@ -9866,7 +10631,8 @@
 
   @override
   List<Source> get launchableClientLibrarySources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLaunchableClientLibrarySources");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLaunchableClientLibrarySources");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9882,7 +10648,8 @@
 
   @override
   List<Source> get launchableServerLibrarySources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLaunchableServerLibrarySources");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLaunchableServerLibrarySources");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9897,8 +10664,373 @@
   }
 
   @override
+  List<Source> get librarySources {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLibrarySources");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.librarySources;
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  Stream<SourcesChangedEvent> get onSourcesChanged => _basis.onSourcesChanged;
+
+  @override
+  List<Source> get prioritySources {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getPrioritySources");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.prioritySources;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  List<Source> get refactoringUnsafeSources {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getRefactoringUnsafeSources");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.refactoringUnsafeSources;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  SourceFactory get sourceFactory {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getSourceFactory");
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.sourceFactory;
+    } finally {
+      instrumentation.log2(2);
+      //Log if over 1ms
+    }
+  }
+
+  @override
+  void set sourceFactory(SourceFactory factory) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-setSourceFactory");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.sourceFactory = factory;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  AnalysisContextStatistics get statistics => _basis.statistics;
+
+  @override
+  TypeProvider get typeProvider => _basis.typeProvider;
+
+  @override
+  void addListener(AnalysisListener listener) {
+    _basis.addListener(listener);
+  }
+
+  @override
+  void addSourceInfo(Source source, SourceEntry info) {
+    _basis.addSourceInfo(source, info);
+  }
+
+  @override
+  void applyAnalysisDelta(AnalysisDelta delta) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-updateAnalysis");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.applyAnalysisDelta(delta);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  void applyChanges(ChangeSet changeSet) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-applyChanges");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.applyChanges(changeSet);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  String computeDocumentationComment(Element element) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeDocumentationComment");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeDocumentationComment(element);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  List<AnalysisError> computeErrors(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeErrors");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<AnalysisError> errors = _basis.computeErrors(source);
+      instrumentation.metric2("Errors-count", errors.length);
+      return errors;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  List<Source> computeExportedLibraries(Source source) =>
+      _basis.computeExportedLibraries(source);
+
+  @override
+  HtmlElement computeHtmlElement(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeHtmlElement");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeHtmlElement(source);
+    } on AnalysisException catch (e, stackTrace) {
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  List<Source> computeImportedLibraries(Source source) =>
+      _basis.computeImportedLibraries(source);
+
+  @override
+  SourceKind computeKindOf(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeKindOf");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeKindOf(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  LibraryElement computeLibraryElement(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeLibraryElement");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeLibraryElement(source);
+    } on AnalysisException catch (e, stackTrace) {
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  LineInfo computeLineInfo(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-computeLineInfo");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.computeLineInfo(source);
+    } on AnalysisException catch (e, stackTrace) {
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
+      throw e;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  CompilationUnit computeResolvableCompilationUnit(Source source) =>
+      _basis.computeResolvableCompilationUnit(source);
+
+  @override
+  void dispose() {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-dispose");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      _basis.dispose();
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  bool exists(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-exists");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.exists(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getAngularApplication");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getAngularApplicationWithHtml(htmlSource);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  CompilationUnitElement getCompilationUnitElement(Source unitSource,
+      Source librarySource) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getCompilationUnitElement");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getCompilationUnitElement(unitSource, librarySource);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  TimestampedData<String> getContents(Source source) =>
+      _basis.getContents(source);
+
+  @override
+  InternalAnalysisContext getContextFor(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getContextFor");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getContextFor(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  Element getElement(ElementLocation location) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getElement");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getElement(location);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  AnalysisErrorInfo getErrors(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getErrors");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      AnalysisErrorInfo ret = _basis.getErrors(source);
+      if (ret != null) {
+        instrumentation.metric2("Errors-count", ret.errors.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  HtmlElement getHtmlElement(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getHtmlElement");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getHtmlElement(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  List<Source> getHtmlFilesReferencing(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getHtmlFilesReferencing");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      List<Source> ret = _basis.getHtmlFilesReferencing(source);
+      if (ret != null) {
+        instrumentation.metric2("Source-count", ret.length);
+      }
+      return ret;
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
+  SourceKind getKindOf(Source source) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getKindOf");
+    _checkThread(instrumentation);
+    try {
+      instrumentation.metric3("contextId", _contextId);
+      return _basis.getKindOf(source);
+    } finally {
+      instrumentation.log();
+    }
+  }
+
+  @override
   List<Source> getLibrariesContaining(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrariesContaining");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLibrariesContaining");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9915,7 +11047,8 @@
 
   @override
   List<Source> getLibrariesDependingOn(Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrariesDependingOn");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLibrariesDependingOn");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9931,7 +11064,8 @@
 
   @override
   List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrariesReferencedFromHtml");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLibrariesReferencedFromHtml");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9943,7 +11077,8 @@
 
   @override
   LibraryElement getLibraryElement(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibraryElement");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLibraryElement");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9954,24 +11089,9 @@
   }
 
   @override
-  List<Source> get librarySources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLibrarySources");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      List<Source> ret = _basis.librarySources;
-      if (ret != null) {
-        instrumentation.metric2("Source-count", ret.length);
-      }
-      return ret;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
   LineInfo getLineInfo(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getLineInfo");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getLineInfo");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9983,7 +11103,8 @@
 
   @override
   int getModificationStamp(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getModificationStamp");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getModificationStamp");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -9994,35 +11115,14 @@
   }
 
   @override
-  List<Source> get prioritySources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getPrioritySources");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.prioritySources;
-    } finally {
-      instrumentation.log();
-    }
-  }
+  Namespace getPublicNamespace(LibraryElement library) =>
+      _basis.getPublicNamespace(library);
 
   @override
-  Namespace getPublicNamespace(LibraryElement library) => _basis.getPublicNamespace(library);
-
-  @override
-  List<Source> get refactoringUnsafeSources {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getRefactoringUnsafeSources");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.refactoringUnsafeSources;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
+  CompilationUnit getResolvedCompilationUnit(Source unitSource,
+      LibraryElement library) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10033,8 +11133,10 @@
   }
 
   @override
-  CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
+  CompilationUnit getResolvedCompilationUnit2(Source unitSource,
+      Source librarySource) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10047,7 +11149,8 @@
 
   @override
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getResolvedHtmlUnit");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-getResolvedHtmlUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10059,26 +11162,9 @@
   }
 
   @override
-  SourceFactory get sourceFactory {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getSourceFactory");
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.sourceFactory;
-    } finally {
-      instrumentation.log2(2);
-      //Log if over 1ms
-    }
-  }
-
-  @override
-  AnalysisContextStatistics get statistics => _basis.statistics;
-
-  @override
-  TypeProvider get typeProvider => _basis.typeProvider;
-
-  @override
   bool isClientLibrary(Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-isClientLibrary");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-isClientLibrary");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10089,20 +11175,9 @@
   }
 
   @override
-  bool get isDisposed {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-isDisposed");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      return _basis.isDisposed;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
   bool isServerLibrary(Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-isServerLibrary");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-isServerLibrary");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10114,13 +11189,16 @@
 
   @override
   CompilationUnit parseCompilationUnit(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-parseCompilationUnit");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-parseCompilationUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       return _basis.parseCompilationUnit(source);
     } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
       throw e;
     } finally {
       instrumentation.log();
@@ -10129,13 +11207,16 @@
 
   @override
   ht.HtmlUnit parseHtmlUnit(Source source) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-parseHtmlUnit");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-parseHtmlUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       return _basis.parseHtmlUnit(source);
     } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
       throw e;
     } finally {
       instrumentation.log();
@@ -10144,13 +11225,16 @@
 
   @override
   AnalysisResult performAnalysisTask() {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-performAnalysisTask");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-performAnalysisTask");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       AnalysisResult result = _basis.performAnalysisTask();
       if (result.changeNotices != null) {
-        instrumentation.metric2("ChangeNotice-count", result.changeNotices.length);
+        instrumentation.metric2(
+            "ChangeNotice-count",
+            result.changeNotices.length);
       }
       return result;
     } finally {
@@ -10170,14 +11254,18 @@
   }
 
   @override
-  CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveCompilationUnit");
+  CompilationUnit resolveCompilationUnit(Source unitSource,
+      LibraryElement library) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-resolveCompilationUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       return _basis.resolveCompilationUnit(unitSource, library);
     } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
       throw e;
     } finally {
       instrumentation.log();
@@ -10185,14 +11273,18 @@
   }
 
   @override
-  CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveCompilationUnit");
+  CompilationUnit resolveCompilationUnit2(Source unitSource,
+      Source librarySource) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-resolveCompilationUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       return _basis.resolveCompilationUnit2(unitSource, librarySource);
     } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
       throw e;
     } finally {
       instrumentation.log();
@@ -10201,13 +11293,16 @@
 
   @override
   ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-resolveHtmlUnit");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-resolveHtmlUnit");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
       return _basis.resolveHtmlUnit(htmlSource);
     } on AnalysisException catch (e, stackTrace) {
-      _recordAnalysisException(instrumentation, new CaughtException(e, stackTrace));
+      _recordAnalysisException(
+          instrumentation,
+          new CaughtException(e, stackTrace));
       throw e;
     } finally {
       instrumentation.log();
@@ -10215,32 +11310,10 @@
   }
 
   @override
-  void set analysisOptions(AnalysisOptions options) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setAnalysisOptions");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.analysisOptions = options;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  void set analysisPriorityOrder(List<Source> sources) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setAnalysisPriorityOrder");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.analysisPriorityOrder = sources;
-    } finally {
-      instrumentation.log();
-    }
-  }
-
-  @override
-  void setChangedContents(Source source, String contents, int offset, int oldLength, int newLength) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setChangedContents");
+  void setChangedContents(Source source, String contents, int offset,
+      int oldLength, int newLength) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-setChangedContents");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10252,7 +11325,8 @@
 
   @override
   void setContents(Source source, String contents) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setContents");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("Analysis-setContents");
     _checkThread(instrumentation);
     try {
       instrumentation.metric3("contextId", _contextId);
@@ -10263,22 +11337,29 @@
   }
 
   @override
-  void set sourceFactory(SourceFactory factory) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-setSourceFactory");
-    _checkThread(instrumentation);
-    try {
-      instrumentation.metric3("contextId", _contextId);
-      _basis.sourceFactory = factory;
-    } finally {
-      instrumentation.log();
-    }
+  void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
+      DataDescriptor rowDesc, CacheState state)) {
+    _basis.visitCacheItems(callback);
   }
 
-  @override
-  void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
-                                     DataDescriptor rowDesc,
-                                     CacheState state)) {
-    _basis.visitCacheItems(callback);
+  /**
+   * If the current thread is the UI thread, then note this in the specified instrumentation and
+   * append this information to the log.
+   *
+   * @param instrumentation the instrumentation, not `null`
+   */
+  static void _checkThread(InstrumentationBuilder instrumentation) {
+  }
+
+  /**
+   * Record an exception that was thrown during analysis.
+   *
+   * @param instrumentation the instrumentation builder being used to record the exception
+   * @param exception the exception being reported
+   */
+  static void _recordAnalysisException(InstrumentationBuilder instrumentation,
+      CaughtException exception) {
+    instrumentation.record(exception);
   }
 }
 
@@ -10288,6 +11369,28 @@
  */
 abstract class InternalAnalysisContext implements AnalysisContext {
   /**
+   * Return an array containing all of the sources that have been marked as priority sources.
+   * Clients must not modify the returned array.
+   *
+   * @return the sources that have been marked as priority sources
+   */
+  List<Source> get prioritySources;
+
+  /**
+   * Returns a statistics about this context.
+   */
+  AnalysisContextStatistics get statistics;
+
+  /**
+   * Returns a type provider for this context or throws an exception if dart:core cannot be
+   * resolved.
+   *
+   * @return the type provider (not `null`)
+   * @throws AnalysisException if dart:core cannot be resolved
+   */
+  TypeProvider get typeProvider;
+
+  /**
    * Add the given source with the given information to this context.
    *
    * @param source the source to be added
@@ -10339,14 +11442,6 @@
   InternalAnalysisContext getContextFor(Source source);
 
   /**
-   * Return an array containing all of the sources that have been marked as priority sources.
-   * Clients must not modify the returned array.
-   *
-   * @return the sources that have been marked as priority sources
-   */
-  List<Source> get prioritySources;
-
-  /**
    * Return a namespace containing mappings for all of the public names defined by the given
    * library.
    *
@@ -10356,20 +11451,6 @@
   Namespace getPublicNamespace(LibraryElement library);
 
   /**
-   * Returns a statistics about this context.
-   */
-  AnalysisContextStatistics get statistics;
-
-  /**
-   * Returns a type provider for this context or throws an exception if dart:core cannot be
-   * resolved.
-   *
-   * @return the type provider (not `null`)
-   * @throws AnalysisException if dart:core cannot be resolved
-   */
-  TypeProvider get typeProvider;
-
-  /**
    * Given a table mapping the source for the libraries represented by the corresponding elements to
    * the elements representing the libraries, record those mappings.
    *
@@ -10382,8 +11463,7 @@
    * Call the given callback function for eache cache item in the context.
    */
   void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
-                                     DataDescriptor rowDesc,
-                                     CacheState state));
+      DataDescriptor rowDesc, CacheState state));
 }
 
 /**
@@ -10433,27 +11513,6 @@
 }
 
 /**
- * An implementation of [Logger] that does nothing.
- */
-class NullLogger implements Logger {
-  @override
-  void logError(String message, [CaughtException exception]) {
-  }
-
-  @override
-  void logError2(String message, Object exception) {
-  }
-
-  @override
-  void logInformation(String message, [CaughtException exception]) {
-  }
-
-  @override
-  void logInformation2(String message, Object exception) {
-  }
-}
-
-/**
  * [NgComponentElementProcessor] applies [AngularComponentElement] by parsing mapped
  * attributes as expressions.
  */
@@ -10472,7 +11531,8 @@
         attribute.element = property;
         // resolve if binding
         if (property.propertyKind != AngularPropertyKind.ATTR) {
-          AngularExpression expression = parseAngularExpression(resolver, attribute);
+          AngularExpression expression =
+              parseAngularExpression(resolver, attribute);
           resolver._resolveExpression(expression);
           setAngularExpression(attribute, expression);
         }
@@ -10496,9 +11556,10 @@
   void apply(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
     InterfaceType type = (_element.enclosingElement as ClassElement).type;
     String name = _element.name;
-    LocalVariableElementImpl variable = resolver._createLocalVariableWithName(type, name);
+    LocalVariableElementImpl variable =
+        resolver._createLocalVariableWithName(type, name);
     resolver._defineVariable(variable);
-    variable.toolkitObjects = <AngularElement> [_element];
+    variable.toolkitObjects = <AngularElement>[_element];
   }
 
   @override
@@ -10522,7 +11583,8 @@
       if (selector is HasAttributeSelectorElementImpl) {
         selectorAttributeName = selector.name;
         // resolve attribute expression
-        ht.XmlAttributeNode attribute = node.getAttribute(selectorAttributeName);
+        ht.XmlAttributeNode attribute =
+            node.getAttribute(selectorAttributeName);
         if (attribute != null) {
           attribute.element = selector;
         }
@@ -10553,7 +11615,8 @@
         resolver._pushNameScope();
         try {
           _onNgEventDirective(resolver);
-          AngularExpression expression = parseAngularExpression(resolver, attribute);
+          AngularExpression expression =
+              parseAngularExpression(resolver, attribute);
           resolver._resolveExpression(expression);
           setAngularExpression(attribute, expression);
         } finally {
@@ -10572,7 +11635,8 @@
   void _onNgEventDirective(AngularHtmlUnitResolver resolver) {
     if (_element.isClass("NgEventDirective")) {
       DartType dynamicType = resolver.typeProvider.dynamicType;
-      resolver._defineVariable(resolver._createLocalVariableWithName(dynamicType, "\$event"));
+      resolver._defineVariable(
+          resolver._createLocalVariableWithName(dynamicType, "\$event"));
     }
   }
 }
@@ -10581,21 +11645,14 @@
  * [NgDirectiveProcessor] describes any <code>Directive</code> annotation instance.
  */
 abstract class NgDirectiveProcessor extends NgProcessor {
-  static bool hasValue(ht.XmlAttributeNode attribute) {
-    ht.Token valueToken = attribute.valueToken;
-    return valueToken != null && !valueToken.isSynthetic;
-  }
-
-  static AngularRawXmlExpression newAngularRawXmlExpression(AngularExpression e) => new AngularRawXmlExpression(e);
-
-  static ht.RawXmlExpression newRawXmlExpression(Expression e) => new ht.RawXmlExpression(e);
-
-  AngularExpression parseAngularExpression(AngularHtmlUnitResolver resolver, ht.XmlAttributeNode attribute) {
+  AngularExpression parseAngularExpression(AngularHtmlUnitResolver resolver,
+      ht.XmlAttributeNode attribute) {
     Token token = _scanAttribute(resolver, attribute);
     return resolver._parseAngularExpressionInToken(token);
   }
 
-  Expression parseDartExpression(AngularHtmlUnitResolver resolver, ht.XmlAttributeNode attribute) {
+  Expression parseDartExpression(AngularHtmlUnitResolver resolver,
+      ht.XmlAttributeNode attribute) {
     Token token = _scanAttribute(resolver, attribute);
     return resolver._parseDartExpressionInToken(token);
   }
@@ -10603,7 +11660,8 @@
   /**
    * Sets single [AngularExpression] for [XmlAttributeNode].
    */
-  void setAngularExpression(ht.XmlAttributeNode attribute, AngularExpression expression) {
+  void setAngularExpression(ht.XmlAttributeNode attribute,
+      AngularExpression expression) {
     _setExpression(attribute, newAngularRawXmlExpression(expression));
   }
 
@@ -10614,19 +11672,34 @@
     _setExpression(attribute, newRawXmlExpression(expression));
   }
 
-  void setExpressions(ht.XmlAttributeNode attribute, List<ht.XmlExpression> xmlExpressions) {
+  void setExpressions(ht.XmlAttributeNode attribute,
+      List<ht.XmlExpression> xmlExpressions) {
     attribute.expressions = new List.from(xmlExpressions);
   }
 
-  Token _scanAttribute(AngularHtmlUnitResolver resolver, ht.XmlAttributeNode attribute) {
+  Token _scanAttribute(AngularHtmlUnitResolver resolver,
+      ht.XmlAttributeNode attribute) {
     int offset = attribute.valueToken.offset + 1;
     String value = attribute.text;
     return resolver._scanDart(value, 0, value.length, offset);
   }
 
-  void _setExpression(ht.XmlAttributeNode attribute, ht.XmlExpression xmlExpression) {
-    attribute.expressions = <ht.XmlExpression> [xmlExpression];
+  void _setExpression(ht.XmlAttributeNode attribute,
+      ht.XmlExpression xmlExpression) {
+    attribute.expressions = <ht.XmlExpression>[xmlExpression];
   }
+
+  static bool hasValue(ht.XmlAttributeNode attribute) {
+    ht.Token valueToken = attribute.valueToken;
+    return valueToken != null && !valueToken.isSynthetic;
+  }
+
+  static AngularRawXmlExpression
+      newAngularRawXmlExpression(AngularExpression e) =>
+      new AngularRawXmlExpression(e);
+
+  static ht.RawXmlExpression newRawXmlExpression(Expression e) =>
+      new ht.RawXmlExpression(e);
 }
 
 /**
@@ -10658,7 +11731,8 @@
    * This method is used to define top-level [VariableElement]s for each "ng-model" with
    * simple identifier model.
    */
-  void _applyTopDeclarations(AngularHtmlUnitResolver resolver, ht.XmlTagNode node) {
+  void _applyTopDeclarations(AngularHtmlUnitResolver resolver,
+      ht.XmlTagNode node) {
     ht.XmlAttributeNode attribute = node.getAttribute(_NG_MODEL);
     Expression expression = parseDartExpression(resolver, attribute);
     // if not identifier, then not a top-level model, delay until "apply"
@@ -10668,7 +11742,8 @@
     SimpleIdentifier identifier = expression as SimpleIdentifier;
     // define variable Element
     InterfaceType type = resolver.typeProvider.stringType;
-    LocalVariableElementImpl element = resolver._createLocalVariableFromIdentifier(type, identifier);
+    LocalVariableElementImpl element =
+        resolver._createLocalVariableFromIdentifier(type, identifier);
     resolver._defineTopVariable(element);
     // remember expression
     identifier.staticElement = element;
@@ -10699,6 +11774,27 @@
 }
 
 /**
+ * An implementation of [Logger] that does nothing.
+ */
+class NullLogger implements Logger {
+  @override
+  void logError(String message, [CaughtException exception]) {
+  }
+
+  @override
+  void logError2(String message, Object exception) {
+  }
+
+  @override
+  void logInformation(String message, [CaughtException exception]) {
+  }
+
+  @override
+  void logInformation2(String message, Object exception) {
+  }
+}
+
+/**
  * Instances of the class `ObsoleteSourceAnalysisException` represent an analysis attempt that
  * failed because a source was deleted between the time the analysis started and the time the
  * results of the analysis were ready to be recorded.
@@ -10714,7 +11810,9 @@
    *
    * @param source the source that was removed while it was being analyzed
    */
-  ObsoleteSourceAnalysisException(Source source) : super("The source '${source.fullName}' was removed while it was being analyzed") {
+  ObsoleteSourceAnalysisException(Source source)
+      : super(
+          "The source '${source.fullName}' was removed while it was being analyzed") {
     this._source = source;
   }
 
@@ -10731,44 +11829,6 @@
  */
 class ParseDartTask extends AnalysisTask {
   /**
-   * Return the result of resolving the URI of the given URI-based directive against the URI of the
-   * given library, or `null` if the URI is not valid.
-   *
-   * @param context the context in which the resolution is to be performed
-   * @param librarySource the source representing the library containing the directive
-   * @param directive the directive which URI should be resolved
-   * @param errorListener the error listener to which errors should be reported
-   * @return the result of resolving the URI against the URI of the library
-   */
-  static Source resolveDirective(AnalysisContext context, Source librarySource, UriBasedDirective directive, AnalysisErrorListener errorListener) {
-    StringLiteral uriLiteral = directive.uri;
-    String uriContent = uriLiteral.stringValue;
-    if (uriContent != null) {
-      uriContent = uriContent.trim();
-      directive.uriContent = uriContent;
-    }
-    UriValidationCode code = directive.validate();
-    if (code == null) {
-      String encodedUriContent = Uri.encodeFull(uriContent);
-      Source source = context.sourceFactory.resolveUri(librarySource, encodedUriContent);
-      directive.source = source;
-      return source;
-    }
-    if (code == UriValidationCode.URI_WITH_DART_EXT_SCHEME) {
-      return null;
-    }
-    if (code == UriValidationCode.URI_WITH_INTERPOLATION) {
-      errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION));
-      return null;
-    }
-    if (code == UriValidationCode.INVALID_URI) {
-      errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.INVALID_URI, [uriContent]));
-      return null;
-    }
-    throw new RuntimeException(message: "Failed to handle validation code: $code");
-  }
-
-  /**
    * The source to be parsed.
    */
   final Source source;
@@ -10826,10 +11886,9 @@
    * @param tokenStream the head of the token stream used for parsing
    * @param lineInfo the line information associated with the source
    */
-  ParseDartTask(InternalAnalysisContext context, this.source, this._tokenStream, this.lineInfo) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitParseDartTask(this);
+  ParseDartTask(InternalAnalysisContext context, this.source, this._tokenStream,
+      this.lineInfo)
+      : super(context);
 
   /**
    * Return the compilation unit that was produced by parsing the source, or `null` if the
@@ -10856,22 +11915,6 @@
   List<Source> get exportedSources => _toArray(_exportedSources);
 
   /**
-   * Return an array containing the sources referenced by 'import' directives, or an empty array if
-   * the task has not yet been performed or if an exception occurred.
-   *
-   * @return an array containing the sources referenced by 'import' directives
-   */
-  List<Source> get importedSources => _toArray(_importedSources);
-
-  /**
-   * Return an array containing the sources referenced by 'part' directives, or an empty array if
-   * the task has not yet been performed or if an exception occurred.
-   *
-   * @return an array containing the sources referenced by 'part' directives
-   */
-  List<Source> get includedSources => _toArray(_includedSources);
-
-  /**
    * Return `true` if the source contains any directive other than a 'part of' directive, or
    * `false` if the task has not yet been performed or if an exception occurred.
    *
@@ -10887,6 +11930,22 @@
    */
   bool get hasPartOfDirective => _containsPartOfDirective;
 
+  /**
+   * Return an array containing the sources referenced by 'import' directives, or an empty array if
+   * the task has not yet been performed or if an exception occurred.
+   *
+   * @return an array containing the sources referenced by 'import' directives
+   */
+  List<Source> get importedSources => _toArray(_importedSources);
+
+  /**
+   * Return an array containing the sources referenced by 'part' directives, or an empty array if
+   * the task has not yet been performed or if an exception occurred.
+   *
+   * @return an array containing the sources referenced by 'part' directives
+   */
+  List<Source> get includedSources => _toArray(_includedSources);
+
   @override
   String get taskDescription {
     if (source == null) {
@@ -10896,11 +11955,15 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) => visitor.visitParseDartTask(this);
+
+  @override
   void internalPerform() {
     //
     // Then parse the token stream.
     //
-    TimeCounter_TimeCounterHandle timeCounterParse = PerformanceStatistics.parse.start();
+    TimeCounter_TimeCounterHandle timeCounterParse =
+        PerformanceStatistics.parse.start();
     try {
       RecordingErrorListener errorListener = new RecordingErrorListener();
       Parser parser = new Parser(source, errorListener);
@@ -10918,7 +11981,8 @@
         } else {
           _containsNonPartOfDirective = true;
           if (directive is UriBasedDirective) {
-            Source referencedSource = resolveDirective(analysisContext, source, directive, errorListener);
+            Source referencedSource =
+                resolveDirective(analysisContext, source, directive, errorListener);
             if (referencedSource != null) {
               if (directive is ExportDirective) {
                 _exportedSources.add(referencedSource);
@@ -10929,7 +11993,8 @@
                   _includedSources.add(referencedSource);
                 }
               } else {
-                throw new AnalysisException("$runtimeType failed to handle a ${directive.runtimeType}");
+                throw new AnalysisException(
+                    "$runtimeType failed to handle a ${directive.runtimeType}");
               }
             }
           }
@@ -10954,6 +12019,58 @@
     }
     return new List.from(sources);
   }
+
+  /**
+   * Return the result of resolving the URI of the given URI-based directive against the URI of the
+   * given library, or `null` if the URI is not valid.
+   *
+   * @param context the context in which the resolution is to be performed
+   * @param librarySource the source representing the library containing the directive
+   * @param directive the directive which URI should be resolved
+   * @param errorListener the error listener to which errors should be reported
+   * @return the result of resolving the URI against the URI of the library
+   */
+  static Source resolveDirective(AnalysisContext context, Source librarySource,
+      UriBasedDirective directive, AnalysisErrorListener errorListener) {
+    StringLiteral uriLiteral = directive.uri;
+    String uriContent = uriLiteral.stringValue;
+    if (uriContent != null) {
+      uriContent = uriContent.trim();
+      directive.uriContent = uriContent;
+    }
+    UriValidationCode code = directive.validate();
+    if (code == null) {
+      String encodedUriContent = Uri.encodeFull(uriContent);
+      Source source =
+          context.sourceFactory.resolveUri(librarySource, encodedUriContent);
+      directive.source = source;
+      return source;
+    }
+    if (code == UriValidationCode.URI_WITH_DART_EXT_SCHEME) {
+      return null;
+    }
+    if (code == UriValidationCode.URI_WITH_INTERPOLATION) {
+      errorListener.onError(
+          new AnalysisError.con2(
+              librarySource,
+              uriLiteral.offset,
+              uriLiteral.length,
+              CompileTimeErrorCode.URI_WITH_INTERPOLATION));
+      return null;
+    }
+    if (code == UriValidationCode.INVALID_URI) {
+      errorListener.onError(
+          new AnalysisError.con2(
+              librarySource,
+              uriLiteral.offset,
+              uriLiteral.length,
+              CompileTimeErrorCode.INVALID_URI,
+              [uriContent]));
+      return null;
+    }
+    throw new RuntimeException(
+        message: "Failed to handle validation code: $code");
+  }
 }
 
 /**
@@ -10961,6 +12078,16 @@
  */
 class ParseHtmlTask extends AnalysisTask {
   /**
+   * The name of the 'src' attribute in a HTML tag.
+   */
+  static String _ATTRIBUTE_SRC = "src";
+
+  /**
+   * The name of the 'script' tag in an HTML file.
+   */
+  static String _TAG_SCRIPT = "script";
+
+  /**
    * The source to be parsed.
    */
   final Source source;
@@ -10991,26 +12118,14 @@
   List<Source> _referencedLibraries = Source.EMPTY_ARRAY;
 
   /**
-   * The name of the 'src' attribute in a HTML tag.
-   */
-  static String _ATTRIBUTE_SRC = "src";
-
-  /**
-   * The name of the 'script' tag in an HTML file.
-   */
-  static String _TAG_SCRIPT = "script";
-
-  /**
    * Initialize a newly created task to perform analysis within the given context.
    *
    * @param context the context in which the task is to be performed
    * @param source the source to be parsed
    * @param content the contents of the source
    */
-  ParseHtmlTask(InternalAnalysisContext context, this.source, this._content) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitParseHtmlTask(this);
+  ParseHtmlTask(InternalAnalysisContext context, this.source, this._content)
+      : super(context);
 
   /**
    * Return the errors that were produced by scanning and parsing the source, or `null` if the
@@ -11028,6 +12143,20 @@
   ht.HtmlUnit get htmlUnit => _unit;
 
   /**
+   * Return the sources of libraries that are referenced in the specified HTML file.
+   *
+   * @return the sources of libraries that are referenced in the HTML file
+   */
+  List<Source> get librarySources {
+    List<Source> libraries = new List<Source>();
+    _unit.accept(new ParseHtmlTask_getLibrarySources(this, libraries));
+    if (libraries.isEmpty) {
+      return Source.EMPTY_ARRAY;
+    }
+    return libraries;
+  }
+
+  /**
    * Return the line information that was produced, or `null` if the task has not yet been
    * performed or if an exception occurred.
    *
@@ -11051,68 +12180,100 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) => visitor.visitParseHtmlTask(this);
+
+  @override
   void internalPerform() {
     try {
       ht.AbstractScanner scanner = new ht.StringScanner(source, _content);
-      scanner.passThroughElements = <String> [_TAG_SCRIPT];
+      scanner.passThroughElements = <String>[_TAG_SCRIPT];
       ht.Token token = scanner.tokenize();
       _lineInfo = new LineInfo(scanner.lineStarts);
       RecordingErrorListener errorListener = new RecordingErrorListener();
       _unit = new ht.HtmlParser(source, errorListener).parse(token, _lineInfo);
-      _unit.accept(new RecursiveXmlVisitor_ParseHtmlTask_internalPerform(this, errorListener));
+      _unit.accept(
+          new RecursiveXmlVisitor_ParseHtmlTask_internalPerform(this, errorListener));
       _errors = errorListener.getErrorsForSource(source);
       _referencedLibraries = librarySources;
     } catch (exception, stackTrace) {
-      throw new AnalysisException("Exception", new CaughtException(exception, stackTrace));
+      throw new AnalysisException(
+          "Exception",
+          new CaughtException(exception, stackTrace));
     }
   }
 
   /**
-   * Return the sources of libraries that are referenced in the specified HTML file.
-   *
-   * @return the sources of libraries that are referenced in the HTML file
-   */
-  List<Source> get librarySources {
-    List<Source> libraries = new List<Source>();
-    _unit.accept(new ParseHtmlTask_getLibrarySources(this, libraries));
-    if (libraries.isEmpty) {
-      return Source.EMPTY_ARRAY;
-    }
-    return libraries;
-  }
-
-  /**
    * Resolves directives in the given [CompilationUnit].
    */
-  void _resolveScriptDirectives(CompilationUnit script, AnalysisErrorListener errorListener) {
+  void _resolveScriptDirectives(CompilationUnit script,
+      AnalysisErrorListener errorListener) {
     if (script == null) {
       return;
     }
     AnalysisContext analysisContext = context;
     for (Directive directive in script.directives) {
       if (directive is UriBasedDirective) {
-        ParseDartTask.resolveDirective(analysisContext, source, directive, errorListener);
+        ParseDartTask.resolveDirective(
+            analysisContext,
+            source,
+            directive,
+            errorListener);
       }
     }
   }
 }
 
+class ParseHtmlTask_getLibrarySources extends ht.RecursiveXmlVisitor<Object> {
+  final ParseHtmlTask _task;
+
+  List<Source> libraries;
+
+  ParseHtmlTask_getLibrarySources(this._task, this.libraries) : super();
+
+  @override
+  Object visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
+    ht.XmlAttributeNode scriptAttribute = null;
+    for (ht.XmlAttributeNode attribute in node.attributes) {
+      if (javaStringEqualsIgnoreCase(
+          attribute.name,
+          ParseHtmlTask._ATTRIBUTE_SRC)) {
+        scriptAttribute = attribute;
+      }
+    }
+    if (scriptAttribute != null) {
+      try {
+        Uri uri = new Uri(path: scriptAttribute.text);
+        String fileName = uri.path;
+        Source librarySource =
+            _task.context.sourceFactory.resolveUri(_task.source, fileName);
+        if (_task.context.exists(librarySource)) {
+          libraries.add(librarySource);
+        }
+      } on FormatException catch (e) {
+        // ignored - invalid URI reported during resolution phase
+      }
+    }
+    return super.visitHtmlScriptTagNode(node);
+  }
+}
+
 /**
  * Instances of the class `PartitionManager` manage the partitions that can be shared between
  * analysis contexts.
  */
 class PartitionManager {
   /**
-   * A table mapping SDK's to the partitions used for those SDK's.
-   */
-  HashMap<DartSdk, SdkCachePartition> _sdkPartitions = new HashMap<DartSdk, SdkCachePartition>();
-
-  /**
    * The default cache size for a Dart SDK partition.
    */
   static int _DEFAULT_SDK_CACHE_SIZE = 256;
 
   /**
+   * A table mapping SDK's to the partitions used for those SDK's.
+   */
+  HashMap<DartSdk, SdkCachePartition> _sdkPartitions =
+      new HashMap<DartSdk, SdkCachePartition>();
+
+  /**
    * Clear any cached data being maintained by this manager.
    */
   void clearCache() {
@@ -11233,10 +12394,9 @@
    * @param lineInfo the line information associated with the source
    * @param unit the HTML unit to build Polymer elements for
    */
-  PolymerBuildHtmlTask(InternalAnalysisContext context, this.source, this._lineInfo, this._unit) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitPolymerBuildHtmlTask(this);
+  PolymerBuildHtmlTask(InternalAnalysisContext context, this.source,
+      this._lineInfo, this._unit)
+      : super(context);
 
   List<AnalysisError> get errors => _errors;
 
@@ -11244,9 +12404,14 @@
   String get taskDescription => "build Polymer elements ${source.fullName}";
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitPolymerBuildHtmlTask(this);
+
+  @override
   void internalPerform() {
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    PolymerHtmlUnitBuilder resolver = new PolymerHtmlUnitBuilder(context, errorListener, source, _lineInfo, _unit);
+    PolymerHtmlUnitBuilder resolver =
+        new PolymerHtmlUnitBuilder(context, errorListener, source, _lineInfo, _unit);
     resolver.build();
     _errors = errorListener.getErrorsForSource(source);
   }
@@ -11263,6 +12428,293 @@
    */
   static Set<String> _FORBIDDEN_TAG_NAMES = new Set();
 
+  final InternalAnalysisContext _context;
+
+  TypeProvider _typeProvider;
+
+  final AnalysisErrorListener _errorListener;
+
+  final Source _source;
+
+  final LineInfo _lineInfo;
+
+  final ht.HtmlUnit _unit;
+
+  List<PolymerTagHtmlElement> _tagHtmlElements = <PolymerTagHtmlElement>[];
+
+  ht.XmlTagNode _elementNode;
+
+  String _elementName;
+
+  PolymerTagHtmlElementImpl _htmlElement;
+
+  PolymerTagDartElementImpl _dartElement;
+
+  PolymerHtmlUnitBuilder(this._context, this._errorListener, this._source,
+      this._lineInfo, this._unit) {
+    this._typeProvider = _context.typeProvider;
+  }
+
+  /**
+   * Returns the only [LibraryElement] referenced by a direct `script` child. Maybe
+   * `null` if none.
+   */
+  LibraryElement get dartUnitElement {
+    // TODO(scheglov) Maybe check if more than one "script".
+    for (ht.XmlTagNode child in _elementNode.tagNodes) {
+      if (child is ht.HtmlScriptTagNode) {
+        HtmlScriptElement scriptElement = child.scriptElement;
+        if (scriptElement is ExternalHtmlScriptElement) {
+          Source scriptSource = scriptElement.scriptSource;
+          if (scriptSource != null) {
+            return _context.getLibraryElement(scriptSource);
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Builds Polymer specific HTML elements.
+   */
+  void build() {
+    _unit.accept(this);
+    // set Polymer tags
+    HtmlElementImpl unitElement = _unit.element as HtmlElementImpl;
+    unitElement.polymerTags = new List.from(_tagHtmlElements);
+  }
+
+  @override
+  Object visitXmlTagNode(ht.XmlTagNode node) {
+    if (node.tag == "polymer-element") {
+      _createTagHtmlElement(node);
+    }
+    // visit children
+    return super.visitXmlTagNode(node);
+  }
+
+  void _createAttributeElements() {
+    // prepare "attributes" attribute
+    ht.XmlAttributeNode attributesAttribute =
+        _elementNode.getAttribute("attributes");
+    if (attributesAttribute == null) {
+      return;
+    }
+    // check if there is a Dart part to resolve against it
+    if (_dartElement == null) {
+      // TODO(scheglov) maybe report error (if it is allowed at all to have
+      // element without Dart part)
+      return;
+    }
+    // prepare value of the "attributes" attribute
+    String attributesText = attributesAttribute.text;
+    if (attributesText.trim().isEmpty) {
+      _reportErrorForAttribute(
+          attributesAttribute,
+          PolymerCode.EMPTY_ATTRIBUTES);
+      return;
+    }
+    // prepare attribute name tokens
+    List<PolymerHtmlUnitBuilder_NameToken> nameTokens =
+        <PolymerHtmlUnitBuilder_NameToken>[
+        ];
+    {
+      int index = 0;
+      int textOffset = attributesAttribute.textOffset;
+      int nameOffset = -1;
+      StringBuffer nameBuffer = new StringBuffer();
+      while (index < attributesText.length) {
+        int c = attributesText.codeUnitAt(index++);
+        if (Character.isWhitespace(c)) {
+          if (nameOffset != -1) {
+            nameTokens.add(
+                new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
+            nameBuffer = new StringBuffer();
+            nameOffset = -1;
+          }
+          continue;
+        }
+        if (nameOffset == -1) {
+          nameOffset = textOffset + index - 1;
+        }
+        nameBuffer.writeCharCode(c);
+      }
+      if (nameOffset != -1) {
+        nameTokens.add(
+            new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
+        nameBuffer = new StringBuffer();
+      }
+    }
+    // create attributes for name tokens
+    List<PolymerAttributeElement> attributes = <PolymerAttributeElement>[];
+    Set<String> definedNames = new Set();
+    ClassElement classElement = _dartElement.classElement;
+    for (PolymerHtmlUnitBuilder_NameToken nameToken in nameTokens) {
+      int offset = nameToken._offset;
+      // prepare name
+      String name = nameToken._value;
+      if (!isValidAttributeName(name)) {
+        _reportErrorForNameToken(
+            nameToken,
+            PolymerCode.INVALID_ATTRIBUTE_NAME,
+            [name]);
+        continue;
+      }
+      if (!definedNames.add(name)) {
+        _reportErrorForNameToken(
+            nameToken,
+            PolymerCode.DUPLICATE_ATTRIBUTE_DEFINITION,
+            [name]);
+        continue;
+      }
+      // create attribute
+      PolymerAttributeElementImpl attribute =
+          new PolymerAttributeElementImpl(name, offset);
+      attributes.add(attribute);
+      // resolve field
+      FieldElement field = classElement.getField(name);
+      if (field == null) {
+        _reportErrorForNameToken(
+            nameToken,
+            PolymerCode.UNDEFINED_ATTRIBUTE_FIELD,
+            [name, classElement.displayName]);
+        continue;
+      }
+      if (!_isPublishedField(field)) {
+        _reportErrorForNameToken(
+            nameToken,
+            PolymerCode.ATTRIBUTE_FIELD_NOT_PUBLISHED,
+            [name, classElement.displayName]);
+      }
+      attribute.field = field;
+    }
+    _htmlElement.attributes = attributes;
+  }
+
+  void _createTagHtmlElement(ht.XmlTagNode node) {
+    this._elementNode = node;
+    this._elementName = null;
+    this._htmlElement = null;
+    this._dartElement = null;
+    // prepare 'name' attribute
+    ht.XmlAttributeNode nameAttribute = node.getAttribute("name");
+    if (nameAttribute == null) {
+      _reportErrorForToken(node.tagToken, PolymerCode.MISSING_TAG_NAME);
+      return;
+    }
+    // prepare name
+    _elementName = nameAttribute.text;
+    if (!isValidTagName(_elementName)) {
+      _reportErrorForAttributeValue(
+          nameAttribute,
+          PolymerCode.INVALID_TAG_NAME,
+          [_elementName]);
+      return;
+    }
+    // TODO(scheglov) Maybe check that at least one of "template" or "script"
+    // children.
+    // TODO(scheglov) Maybe check if more than one top-level "template".
+    // create HTML element
+    int nameOffset = nameAttribute.textOffset;
+    _htmlElement = new PolymerTagHtmlElementImpl(_elementName, nameOffset);
+    // bind to the corresponding Dart element
+    _dartElement = _findTagDartElement();
+    if (_dartElement != null) {
+      _htmlElement.dartElement = _dartElement;
+      _dartElement.htmlElement = _htmlElement;
+    }
+    // TODO(scheglov) create attributes
+    _createAttributeElements();
+    // done
+    _tagHtmlElements.add(_htmlElement);
+  }
+
+  /**
+   * Returns the [PolymerTagDartElement] that corresponds to the Polymer custom tag declared
+   * by the given [XmlTagNode].
+   */
+  PolymerTagDartElementImpl _findTagDartElement() {
+    LibraryElement dartLibraryElement = dartUnitElement;
+    if (dartLibraryElement == null) {
+      return null;
+    }
+    return _findTagDartElement_inLibrary(dartLibraryElement);
+  }
+
+  /**
+   * Returns the [PolymerTagDartElementImpl] declared in the given [LibraryElement] with
+   * the [elementName]. Maybe `null`.
+   */
+  PolymerTagDartElementImpl
+      _findTagDartElement_inLibrary(LibraryElement library) {
+    try {
+      library.accept(new _PolymerHtmlUnitBuilder_findTagDartElement(this));
+    } on PolymerHtmlUnitBuilder_FoundTagDartElementError catch (e) {
+      return e._result;
+    }
+    return null;
+  }
+
+  bool _isPublishedAnnotation(ElementAnnotation annotation) {
+    Element element = annotation.element;
+    if (element != null && element.name == "published") {
+      return true;
+    }
+    return false;
+  }
+
+  bool _isPublishedField(FieldElement field) {
+    List<ElementAnnotation> annotations = field.metadata;
+    for (ElementAnnotation annotation in annotations) {
+      if (_isPublishedAnnotation(annotation)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Reports an error on the attribute's value, or (if absent) on the attribute's name.
+   */
+  void _reportErrorForAttribute(ht.XmlAttributeNode node, ErrorCode errorCode,
+      [List<Object> arguments]) {
+    _reportErrorForOffset(node.offset, node.length, errorCode, arguments);
+  }
+
+  /**
+   * Reports an error on the attribute's value, or (if absent) on the attribute's name.
+   */
+  void _reportErrorForAttributeValue(ht.XmlAttributeNode node,
+      ErrorCode errorCode, [List<Object> arguments]) {
+    ht.Token valueToken = node.valueToken;
+    if (valueToken == null || valueToken.isSynthetic) {
+      _reportErrorForAttribute(node, errorCode, arguments);
+    } else {
+      _reportErrorForToken(valueToken, errorCode, arguments);
+    }
+  }
+
+  void _reportErrorForNameToken(PolymerHtmlUnitBuilder_NameToken token,
+      ErrorCode errorCode, [List<Object> arguments]) {
+    int offset = token._offset;
+    int length = token._value.length;
+    _reportErrorForOffset(offset, length, errorCode, arguments);
+  }
+
+  void _reportErrorForOffset(int offset, int length, ErrorCode errorCode,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+  }
+
+  void _reportErrorForToken(ht.Token token, ErrorCode errorCode,
+      [List<Object> arguments]) {
+    int offset = token.offset;
+    int length = token.length;
+    _reportErrorForOffset(offset, length, errorCode, arguments);
+  }
+
   static bool isValidAttributeName(String name) {
     // cannot be empty
     if (name.isEmpty) {
@@ -11322,260 +12774,6 @@
     }
     return true;
   }
-
-  final InternalAnalysisContext _context;
-
-  TypeProvider _typeProvider;
-
-  final AnalysisErrorListener _errorListener;
-
-  final Source _source;
-
-  final LineInfo _lineInfo;
-
-  final ht.HtmlUnit _unit;
-
-  List<PolymerTagHtmlElement> _tagHtmlElements = <PolymerTagHtmlElement>[];
-
-  ht.XmlTagNode _elementNode;
-
-  String _elementName;
-
-  PolymerTagHtmlElementImpl _htmlElement;
-
-  PolymerTagDartElementImpl _dartElement;
-
-  PolymerHtmlUnitBuilder(this._context, this._errorListener, this._source, this._lineInfo, this._unit) {
-    this._typeProvider = _context.typeProvider;
-  }
-
-  /**
-   * Builds Polymer specific HTML elements.
-   */
-  void build() {
-    _unit.accept(this);
-    // set Polymer tags
-    HtmlElementImpl unitElement = _unit.element as HtmlElementImpl;
-    unitElement.polymerTags = new List.from(_tagHtmlElements);
-  }
-
-  @override
-  Object visitXmlTagNode(ht.XmlTagNode node) {
-    if (node.tag == "polymer-element") {
-      _createTagHtmlElement(node);
-    }
-    // visit children
-    return super.visitXmlTagNode(node);
-  }
-
-  void _createAttributeElements() {
-    // prepare "attributes" attribute
-    ht.XmlAttributeNode attributesAttribute = _elementNode.getAttribute("attributes");
-    if (attributesAttribute == null) {
-      return;
-    }
-    // check if there is a Dart part to resolve against it
-    if (_dartElement == null) {
-      // TODO(scheglov) maybe report error (if it is allowed at all to have element without Dart part)
-      return;
-    }
-    // prepare value of the "attributes" attribute
-    String attributesText = attributesAttribute.text;
-    if (attributesText.trim().isEmpty) {
-      _reportErrorForAttribute(attributesAttribute, PolymerCode.EMPTY_ATTRIBUTES);
-      return;
-    }
-    // prepare attribute name tokens
-    List<PolymerHtmlUnitBuilder_NameToken> nameTokens = <PolymerHtmlUnitBuilder_NameToken>[];
-    {
-      int index = 0;
-      int textOffset = attributesAttribute.textOffset;
-      int nameOffset = -1;
-      StringBuffer nameBuffer = new StringBuffer();
-      while (index < attributesText.length) {
-        int c = attributesText.codeUnitAt(index++);
-        if (Character.isWhitespace(c)) {
-          if (nameOffset != -1) {
-            nameTokens.add(new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
-            nameBuffer = new StringBuffer();
-            nameOffset = -1;
-          }
-          continue;
-        }
-        if (nameOffset == -1) {
-          nameOffset = textOffset + index - 1;
-        }
-        nameBuffer.writeCharCode(c);
-      }
-      if (nameOffset != -1) {
-        nameTokens.add(new PolymerHtmlUnitBuilder_NameToken(nameOffset, nameBuffer.toString()));
-        nameBuffer = new StringBuffer();
-      }
-    }
-    // create attributes for name tokens
-    List<PolymerAttributeElement> attributes = <PolymerAttributeElement>[];
-    Set<String> definedNames = new Set();
-    ClassElement classElement = _dartElement.classElement;
-    for (PolymerHtmlUnitBuilder_NameToken nameToken in nameTokens) {
-      int offset = nameToken._offset;
-      // prepare name
-      String name = nameToken._value;
-      if (!isValidAttributeName(name)) {
-        _reportErrorForNameToken(nameToken, PolymerCode.INVALID_ATTRIBUTE_NAME, [name]);
-        continue;
-      }
-      if (!definedNames.add(name)) {
-        _reportErrorForNameToken(nameToken, PolymerCode.DUPLICATE_ATTRIBUTE_DEFINITION, [name]);
-        continue;
-      }
-      // create attribute
-      PolymerAttributeElementImpl attribute = new PolymerAttributeElementImpl(name, offset);
-      attributes.add(attribute);
-      // resolve field
-      FieldElement field = classElement.getField(name);
-      if (field == null) {
-        _reportErrorForNameToken(nameToken, PolymerCode.UNDEFINED_ATTRIBUTE_FIELD, [name, classElement.displayName]);
-        continue;
-      }
-      if (!_isPublishedField(field)) {
-        _reportErrorForNameToken(nameToken, PolymerCode.ATTRIBUTE_FIELD_NOT_PUBLISHED, [name, classElement.displayName]);
-      }
-      attribute.field = field;
-    }
-    _htmlElement.attributes = attributes;
-  }
-
-  void _createTagHtmlElement(ht.XmlTagNode node) {
-    this._elementNode = node;
-    this._elementName = null;
-    this._htmlElement = null;
-    this._dartElement = null;
-    // prepare 'name' attribute
-    ht.XmlAttributeNode nameAttribute = node.getAttribute("name");
-    if (nameAttribute == null) {
-      _reportErrorForToken(node.tagToken, PolymerCode.MISSING_TAG_NAME);
-      return;
-    }
-    // prepare name
-    _elementName = nameAttribute.text;
-    if (!isValidTagName(_elementName)) {
-      _reportErrorForAttributeValue(nameAttribute, PolymerCode.INVALID_TAG_NAME, [_elementName]);
-      return;
-    }
-    // TODO(scheglov) Maybe check that at least one of "template" or "script" children.
-    // TODO(scheglov) Maybe check if more than one top-level "template".
-    // create HTML element
-    int nameOffset = nameAttribute.textOffset;
-    _htmlElement = new PolymerTagHtmlElementImpl(_elementName, nameOffset);
-    // bind to the corresponding Dart element
-    _dartElement = _findTagDartElement();
-    if (_dartElement != null) {
-      _htmlElement.dartElement = _dartElement;
-      _dartElement.htmlElement = _htmlElement;
-    }
-    // TODO(scheglov) create attributes
-    _createAttributeElements();
-    // done
-    _tagHtmlElements.add(_htmlElement);
-  }
-
-  /**
-   * Returns the [PolymerTagDartElement] that corresponds to the Polymer custom tag declared
-   * by the given [XmlTagNode].
-   */
-  PolymerTagDartElementImpl _findTagDartElement() {
-    LibraryElement dartLibraryElement = dartUnitElement;
-    if (dartLibraryElement == null) {
-      return null;
-    }
-    return _findTagDartElement_inLibrary(dartLibraryElement);
-  }
-
-  /**
-   * Returns the [PolymerTagDartElementImpl] declared in the given [LibraryElement] with
-   * the [elementName]. Maybe `null`.
-   */
-  PolymerTagDartElementImpl _findTagDartElement_inLibrary(LibraryElement library) {
-    try {
-      library.accept(new RecursiveElementVisitor_PolymerHtmlUnitBuilder_findTagDartElement_inLibrary(this));
-    } on PolymerHtmlUnitBuilder_FoundTagDartElementError catch (e) {
-      return e._result;
-    }
-    return null;
-  }
-
-  /**
-   * Returns the only [LibraryElement] referenced by a direct `script` child. Maybe
-   * `null` if none.
-   */
-  LibraryElement get dartUnitElement {
-    // TODO(scheglov) Maybe check if more than one "script".
-    for (ht.XmlTagNode child in _elementNode.tagNodes) {
-      if (child is ht.HtmlScriptTagNode) {
-        HtmlScriptElement scriptElement = child.scriptElement;
-        if (scriptElement is ExternalHtmlScriptElement) {
-          Source scriptSource = scriptElement.scriptSource;
-          if (scriptSource != null) {
-            return _context.getLibraryElement(scriptSource);
-          }
-        }
-      }
-    }
-    return null;
-  }
-
-  bool _isPublishedAnnotation(ElementAnnotation annotation) {
-    Element element = annotation.element;
-    if (element != null && element.name == "published") {
-      return true;
-    }
-    return false;
-  }
-
-  bool _isPublishedField(FieldElement field) {
-    List<ElementAnnotation> annotations = field.metadata;
-    for (ElementAnnotation annotation in annotations) {
-      if (_isPublishedAnnotation(annotation)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Reports an error on the attribute's value, or (if absent) on the attribute's name.
-   */
-  void _reportErrorForAttribute(ht.XmlAttributeNode node, ErrorCode errorCode, [List<Object> arguments]) {
-    _reportErrorForOffset(node.offset, node.length, errorCode, arguments);
-  }
-
-  /**
-   * Reports an error on the attribute's value, or (if absent) on the attribute's name.
-   */
-  void _reportErrorForAttributeValue(ht.XmlAttributeNode node, ErrorCode errorCode, [List<Object> arguments]) {
-    ht.Token valueToken = node.valueToken;
-    if (valueToken == null || valueToken.isSynthetic) {
-      _reportErrorForAttribute(node, errorCode, arguments);
-    } else {
-      _reportErrorForToken(valueToken, errorCode, arguments);
-    }
-  }
-
-  void _reportErrorForNameToken(PolymerHtmlUnitBuilder_NameToken token, ErrorCode errorCode, [List<Object> arguments]) {
-    int offset = token._offset;
-    int length = token._value.length;
-    _reportErrorForOffset(offset, length, errorCode, arguments);
-  }
-
-  void _reportErrorForOffset(int offset, int length, ErrorCode errorCode, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
-  }
-
-  void _reportErrorForToken(ht.Token token, ErrorCode errorCode, [List<Object> arguments]) {
-    int offset = token.offset;
-    int length = token.length;
-    _reportErrorForOffset(offset, length, errorCode, arguments);
-  }
 }
 
 class PolymerHtmlUnitBuilder_FoundTagDartElementError extends Error {
@@ -11611,7 +12809,8 @@
 
   final ht.HtmlUnit _unit;
 
-  PolymerHtmlUnitResolver(this._context, this._errorListener, this._source, this._lineInfo, this._unit) {
+  PolymerHtmlUnitResolver(this._context, this._errorListener, this._source,
+      this._lineInfo, this._unit) {
     this._typeProvider = _context.typeProvider;
   }
 
@@ -11624,7 +12823,8 @@
   }
 
   @override
-  Object visitXmlAttributeNode(ht.XmlAttributeNode node) => super.visitXmlAttributeNode(node);
+  Object visitXmlAttributeNode(ht.XmlAttributeNode node) =>
+      super.visitXmlAttributeNode(node);
 
   @override
   Object visitXmlTagNode(ht.XmlTagNode node) => super.visitXmlTagNode(node);
@@ -11664,10 +12864,9 @@
    * @param source the source to be resolved
    * @param unit the HTML unit to be resolved
    */
-  PolymerResolveHtmlTask(InternalAnalysisContext context, this.source, this._lineInfo, this._unit) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitPolymerResolveHtmlTask(this);
+  PolymerResolveHtmlTask(InternalAnalysisContext context, this.source,
+      this._lineInfo, this._unit)
+      : super(context);
 
   List<AnalysisError> get errors => _errors;
 
@@ -11675,9 +12874,14 @@
   String get taskDescription => "resolve as Polymer ${source.fullName}";
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitPolymerResolveHtmlTask(this);
+
+  @override
   void internalPerform() {
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    PolymerHtmlUnitResolver resolver = new PolymerHtmlUnitResolver(context, errorListener, source, _lineInfo, _unit);
+    PolymerHtmlUnitResolver resolver =
+        new PolymerHtmlUnitResolver(context, errorListener, source, _lineInfo, _unit);
     resolver.resolveUnit();
     _errors = errorListener.getErrorsForSource(source);
   }
@@ -11692,18 +12896,8 @@
   /**
    * A HashMap of lists containing the errors that were collected, keyed by each [Source].
    */
-  Map<Source, HashSet<AnalysisError>> _errors = new HashMap<Source, HashSet<AnalysisError>>();
-
-  /**
-   * Add all of the errors recorded by the given listener to this listener.
-   *
-   * @param listener the listener that has recorded the errors to be added
-   */
-  void addAll(RecordingErrorListener listener) {
-    for (AnalysisError error in listener.errors) {
-      onError(error);
-    }
-  }
+  Map<Source, HashSet<AnalysisError>> _errors =
+      new HashMap<Source, HashSet<AnalysisError>>();
 
   /**
    * Answer the errors collected by the listener.
@@ -11723,6 +12917,17 @@
   }
 
   /**
+   * Add all of the errors recorded by the given listener to this listener.
+   *
+   * @param listener the listener that has recorded the errors to be added
+   */
+  void addAll(RecordingErrorListener listener) {
+    for (AnalysisError error in listener.errors) {
+      onError(error);
+    }
+  }
+
+  /**
    * Answer the errors collected by the listener for some passed [Source].
    *
    * @param source some [Source] for which the caller wants the set of [AnalysisError]s
@@ -11750,21 +12955,8 @@
   }
 }
 
-class RecursiveElementVisitor_PolymerHtmlUnitBuilder_findTagDartElement_inLibrary extends RecursiveElementVisitor<Object> {
-  final PolymerHtmlUnitBuilder PolymerHtmlUnitBuilder_this;
-
-  RecursiveElementVisitor_PolymerHtmlUnitBuilder_findTagDartElement_inLibrary(this.PolymerHtmlUnitBuilder_this) : super();
-
-  @override
-  Object visitPolymerTagDartElement(PolymerTagDartElement element) {
-    if (element.name == PolymerHtmlUnitBuilder_this._elementName) {
-      throw new PolymerHtmlUnitBuilder_FoundTagDartElementError(element as PolymerTagDartElementImpl);
-    }
-    return null;
-  }
-}
-
-class RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation extends ht.RecursiveXmlVisitor<Object> {
+class RecursiveXmlVisitor_AngularHtmlUnitResolver_hasAngularAnnotation extends
+    ht.RecursiveXmlVisitor<Object> {
   @override
   Object visitXmlTagNode(ht.XmlTagNode node) {
     if (node.getAttribute(AngularHtmlUnitResolver._NG_APP) != null) {
@@ -11774,58 +12966,15 @@
   }
 }
 
-class RecursiveXmlVisitor_AngularHtmlUnitResolver_visitModelDirectives extends ht.RecursiveXmlVisitor<Object> {
-  final AngularHtmlUnitResolver AngularHtmlUnitResolver_this;
-
-  RecursiveXmlVisitor_AngularHtmlUnitResolver_visitModelDirectives(this.AngularHtmlUnitResolver_this) : super();
-
-  @override
-  Object visitXmlTagNode(ht.XmlTagNode node) {
-    NgModelProcessor directive = NgModelProcessor.INSTANCE;
-    if (directive.canApply(node)) {
-      directive._applyTopDeclarations(AngularHtmlUnitResolver_this, node);
-    }
-    return super.visitXmlTagNode(node);
-  }
-}
-
-class ParseHtmlTask_getLibrarySources extends ht.RecursiveXmlVisitor<Object> {
-  final ParseHtmlTask _task;
-
-  List<Source> libraries;
-
-  ParseHtmlTask_getLibrarySources(this._task, this.libraries) : super();
-
-  @override
-  Object visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
-    ht.XmlAttributeNode scriptAttribute = null;
-    for (ht.XmlAttributeNode attribute in node.attributes) {
-      if (javaStringEqualsIgnoreCase(attribute.name, ParseHtmlTask._ATTRIBUTE_SRC)) {
-        scriptAttribute = attribute;
-      }
-    }
-    if (scriptAttribute != null) {
-      try {
-        Uri uri = new Uri(path: scriptAttribute.text);
-        String fileName = uri.path;
-        Source librarySource = _task.context.sourceFactory.resolveUri(_task.source, fileName);
-        if (_task.context.exists(librarySource)) {
-          libraries.add(librarySource);
-        }
-      } on FormatException catch (e) {
-        // ignored - invalid URI reported during resolution phase
-      }
-    }
-    return super.visitHtmlScriptTagNode(node);
-  }
-}
-
-class RecursiveXmlVisitor_ParseHtmlTask_internalPerform extends ht.RecursiveXmlVisitor<Object> {
+class RecursiveXmlVisitor_ParseHtmlTask_internalPerform extends
+    ht.RecursiveXmlVisitor<Object> {
   final ParseHtmlTask ParseHtmlTask_this;
 
   RecordingErrorListener errorListener;
 
-  RecursiveXmlVisitor_ParseHtmlTask_internalPerform(this.ParseHtmlTask_this, this.errorListener) : super();
+  RecursiveXmlVisitor_ParseHtmlTask_internalPerform(this.ParseHtmlTask_this,
+      this.errorListener)
+      : super();
 
   @override
   Object visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
@@ -11834,18 +12983,25 @@
   }
 }
 
-class RecursiveXmlVisitor_ResolveHtmlTask_internalPerform extends ht.RecursiveXmlVisitor<Object> {
+class RecursiveXmlVisitor_ResolveHtmlTask_internalPerform extends
+    ht.RecursiveXmlVisitor<Object> {
   final ResolveHtmlTask ResolveHtmlTask_this;
 
   RecordingErrorListener errorListener;
 
-  RecursiveXmlVisitor_ResolveHtmlTask_internalPerform(this.ResolveHtmlTask_this, this.errorListener) : super();
+  RecursiveXmlVisitor_ResolveHtmlTask_internalPerform(this.ResolveHtmlTask_this,
+      this.errorListener)
+      : super();
 
   @override
   Object visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
     CompilationUnit script = node.script;
     if (script != null) {
-      GenerateDartErrorsTask.validateDirectives(ResolveHtmlTask_this.context, ResolveHtmlTask_this.source, script, errorListener);
+      GenerateDartErrorsTask.validateDirectives(
+          ResolveHtmlTask_this.context,
+          ResolveHtmlTask_this.source,
+          script,
+          errorListener);
     }
     return null;
   }
@@ -11856,13 +13012,6 @@
  * structure when used to visit that structure.
  */
 class ResolutionEraser extends GeneralizingAstVisitor<Object> {
-  /**
-   * Remove any resolution information from the given AST structure.
-   */
-  static void erase(AstNode node) {
-    node.accept(new ResolutionEraser());
-  }
-
   @override
   Object visitAssignmentExpression(AssignmentExpression node) {
     node.staticElement = null;
@@ -11878,6 +13027,12 @@
   }
 
   @override
+  Object visitBreakStatement(BreakStatement node) {
+    node.target = null;
+    return super.visitBreakStatement(node);
+  }
+
+  @override
   Object visitCompilationUnit(CompilationUnit node) {
     node.element = null;
     return super.visitCompilationUnit(node);
@@ -11896,6 +13051,12 @@
   }
 
   @override
+  Object visitContinueStatement(ContinueStatement node) {
+    node.target = null;
+    return super.visitContinueStatement(node);
+  }
+
+  @override
   Object visitDirective(Directive node) {
     node.element = null;
     return super.visitDirective(node);
@@ -11949,7 +13110,8 @@
   }
 
   @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     node.staticElement = null;
     return super.visitRedirectingConstructorInvocation(node);
   }
@@ -11966,6 +13128,13 @@
     node.staticElement = null;
     return super.visitSuperConstructorInvocation(node);
   }
+
+  /**
+   * Remove any resolution information from the given AST structure.
+   */
+  static void erase(AstNode node) {
+    node.accept(new ResolutionEraser());
+  }
 }
 
 /**
@@ -11990,8 +13159,8 @@
    * If there is no entry for a given descriptor then the state is implicitly
    * [CacheState.INVALID] and the value is implicitly the default value.
    */
-  Map<DataDescriptor, CachedResult> resultMap
-      = new HashMap<DataDescriptor, CachedResult>();
+  Map<DataDescriptor, CachedResult> resultMap =
+      new HashMap<DataDescriptor, CachedResult>();
 
   /**
    * Flush any AST structures being maintained by this state.
@@ -12019,7 +13188,7 @@
    * Return the value of the data represented by the given [descriptor], or
    * `null` if the data represented by the descriptor is not valid.
    */
-  /*<V>*/ dynamic /*V*/ getValue(DataDescriptor/*<V>*/ descriptor) {
+  /*<V>*/ dynamic /*V*/ getValue(DataDescriptor /*<V>*/ descriptor) {
     CachedResult result = resultMap[descriptor];
     if (result == null) {
       return descriptor.defaultValue;
@@ -12116,14 +13285,13 @@
     if (state == CacheState.INVALID) {
       resultMap.remove(descriptor);
     } else {
-      CachedResult result = resultMap.putIfAbsent(
-          descriptor,
-          () => new CachedResult(descriptor));
+      CachedResult result =
+          resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
       result.state = state;
       if (state != CacheState.IN_PROCESS) {
         //
-        // If the state is in-process, we can leave the current value in the cache
-        // for any 'get' methods to access.
+        // If the state is in-process, we can leave the current value in the
+        // cache for any 'get' methods to access.
         //
         result.value = descriptor.defaultValue;
       }
@@ -12134,10 +13302,9 @@
    * Set the value of the data represented by the given [descriptor] to the
    * given [value].
    */
-  void setValue(DataDescriptor/*<V>*/ descriptor, dynamic /*V*/ value) {
-    CachedResult result = resultMap.putIfAbsent(
-        descriptor,
-        () => new CachedResult(descriptor));
+  void setValue(DataDescriptor /*<V>*/ descriptor, dynamic /*V*/ value) {
+    CachedResult result =
+        resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
     result.state = CacheState.VALID;
     result.value = value == null ? descriptor.defaultValue : value;
   }
@@ -12161,11 +13328,28 @@
    * @param oldEntry the entry that was replaced by this entry
    * @return `true` if some difference was written
    */
-  bool _writeDiffOn(StringBuffer buffer, bool needsSeparator, DartEntry oldEntry) {
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "resolvedUnit", DartEntry.RESOLVED_UNIT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "resolutionErrors", DartEntry.RESOLUTION_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "verificationErrors", DartEntry.VERIFICATION_ERRORS, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "hints", DartEntry.HINTS, oldEntry);
+  bool _writeDiffOn(StringBuffer buffer, bool needsSeparator,
+      DartEntry oldEntry) {
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "resolvedUnit",
+        DartEntry.RESOLVED_UNIT,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "resolutionErrors",
+        DartEntry.RESOLUTION_ERRORS,
+        oldEntry);
+    needsSeparator = _writeStateDiffOn(
+        buffer,
+        needsSeparator,
+        "verificationErrors",
+        DartEntry.VERIFICATION_ERRORS,
+        oldEntry);
+    needsSeparator =
+        _writeStateDiffOn(buffer, needsSeparator, "hints", DartEntry.HINTS, oldEntry);
     return needsSeparator;
   }
 
@@ -12181,7 +13365,10 @@
       _writeStateOn(buffer, "builtUnit", DartEntry.BUILT_UNIT);
       _writeStateOn(buffer, "resolvedUnit", DartEntry.RESOLVED_UNIT);
       _writeStateOn(buffer, "resolutionErrors", DartEntry.RESOLUTION_ERRORS);
-      _writeStateOn(buffer, "verificationErrors", DartEntry.VERIFICATION_ERRORS);
+      _writeStateOn(
+          buffer,
+          "verificationErrors",
+          DartEntry.VERIFICATION_ERRORS);
       _writeStateOn(buffer, "hints", DartEntry.HINTS);
       if (_nextState != null) {
         _nextState._writeOn(buffer);
@@ -12195,7 +13382,7 @@
    * entry to the given [buffer]. Return `true` if some difference was written.
    */
   bool _writeStateDiffOn(StringBuffer buffer, bool needsSeparator, String label,
-        DataDescriptor descriptor, SourceEntry oldEntry) {
+      DataDescriptor descriptor, SourceEntry oldEntry) {
     CacheState oldState = oldEntry.getState(descriptor);
     CacheState newState = getState(descriptor);
     if (oldState != newState) {
@@ -12217,7 +13404,8 @@
    * given [descriptor] to the given bugger, prefixed by the given [label] to
    * the given [buffer].
    */
-  void _writeStateOn(StringBuffer buffer, String label, DataDescriptor descriptor) {
+  void _writeStateOn(StringBuffer buffer, String label,
+      DataDescriptor descriptor) {
     CachedResult result = resultMap[descriptor];
     buffer.write("; ");
     buffer.write(label);
@@ -12294,10 +13482,9 @@
    * @param component the component that uses this HTML template, not `null`
    * @param application the Angular application to resolve in context of
    */
-  ResolveAngularComponentTemplateTask(InternalAnalysisContext context, this.source, this._unit, this._component, this._application) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveAngularComponentTemplateTask(this);
+  ResolveAngularComponentTemplateTask(InternalAnalysisContext context,
+      this.source, this._unit, this._component, this._application)
+      : super(context);
 
   List<AnalysisError> get resolutionErrors => _resolutionErrors;
 
@@ -12312,6 +13499,10 @@
   String get taskDescription => "resolve as Angular template $source";
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitResolveAngularComponentTemplateTask(this);
+
+  @override
   void internalPerform() {
     //
     // Prepare for resolution.
@@ -12322,7 +13513,8 @@
     // Perform resolution.
     //
     if (_application != null) {
-      AngularHtmlUnitResolver resolver = new AngularHtmlUnitResolver(context, errorListener, source, lineInfo, _unit);
+      AngularHtmlUnitResolver resolver =
+          new AngularHtmlUnitResolver(context, errorListener, source, lineInfo, _unit);
       resolver.resolveComponentTemplate(_application, _component);
       _resolvedUnit = _unit;
     }
@@ -12375,10 +13567,9 @@
    * @param source the source to be resolved
    * @param unit the HTML unit to be resolved
    */
-  ResolveAngularEntryHtmlTask(InternalAnalysisContext context, this.source, this._unit) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveAngularEntryHtmlTask(this);
+  ResolveAngularEntryHtmlTask(InternalAnalysisContext context, this.source,
+      this._unit)
+      : super(context);
 
   /**
    * Returns the [AngularApplication] for the Web application with this Angular entry point,
@@ -12391,12 +13582,8 @@
   /**
    * The resolution errors that were discovered while resolving the source.
    */
-  List<AnalysisError> get entryErrors => _errorListener.getErrorsForSource(source);
-
-  /**
-   * Returns [AnalysisError]s recorded for the given [Source].
-   */
-  List<AnalysisError> getErrors(Source source) => _errorListener.getErrorsForSource(source);
+  List<AnalysisError> get entryErrors =>
+      _errorListener.getErrorsForSource(source);
 
   /**
    * Return the [HtmlUnit] that was resolved by this task.
@@ -12414,6 +13601,16 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitResolveAngularEntryHtmlTask(this);
+
+  /**
+   * Returns [AnalysisError]s recorded for the given [Source].
+   */
+  List<AnalysisError> getErrors(Source source) =>
+      _errorListener.getErrorsForSource(source);
+
+  @override
   void internalPerform() {
     //
     // Prepare for resolution.
@@ -12422,12 +13619,22 @@
     //
     // Try to resolve as an Angular entry point.
     //
-    _application = new AngularHtmlUnitResolver(context, _errorListener, source, lineInfo, _unit).calculateAngularApplication();
+    _application = new AngularHtmlUnitResolver(
+        context,
+        _errorListener,
+        source,
+        lineInfo,
+        _unit).calculateAngularApplication();
     //
     // Perform resolution.
     //
     if (_application != null) {
-      new AngularHtmlUnitResolver(context, _errorListener, source, lineInfo, _unit).resolveEntryPoint(_application);
+      new AngularHtmlUnitResolver(
+          context,
+          _errorListener,
+          source,
+          lineInfo,
+          _unit).resolveEntryPoint(_application);
     }
     //
     // Remember the resolved unit.
@@ -12470,10 +13677,9 @@
    * @param librariesInCycle the libraries that are part of the cycle containing the library to be
    *          resolved
    */
-  ResolveDartLibraryCycleTask(InternalAnalysisContext context, this.unitSource, this.librarySource, this._librariesInCycle) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveDartLibraryCycleTask(this);
+  ResolveDartLibraryCycleTask(InternalAnalysisContext context, this.unitSource,
+      this.librarySource, this._librariesInCycle)
+      : super(context);
 
   /**
    * Return the library resolver holding information about the libraries that were resolved.
@@ -12491,6 +13697,10 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitResolveDartLibraryCycleTask(this);
+
+  @override
   void internalPerform() {
     _resolver = new LibraryResolver2(context);
     _resolver.resolveLibrary(librarySource, _librariesInCycle);
@@ -12523,10 +13733,9 @@
    * @param unitSource the source representing the file whose compilation unit is to be returned
    * @param librarySource the source representing the library to be resolved
    */
-  ResolveDartLibraryTask(InternalAnalysisContext context, this.unitSource, this.librarySource) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveDartLibraryTask(this);
+  ResolveDartLibraryTask(InternalAnalysisContext context, this.unitSource,
+      this.librarySource)
+      : super(context);
 
   /**
    * Return the library resolver holding information about the libraries that were resolved.
@@ -12544,6 +13753,10 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) =>
+      visitor.visitResolveDartLibraryTask(this);
+
+  @override
   void internalPerform() {
     _resolver = new LibraryResolver(context);
     _resolver.resolveLibrary(librarySource, true);
@@ -12577,10 +13790,9 @@
    * @param source the source to be parsed
    * @param libraryElement the element model for the library containing the source
    */
-  ResolveDartUnitTask(InternalAnalysisContext context, this.source, this._libraryElement) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveDartUnitTask(this);
+  ResolveDartUnitTask(InternalAnalysisContext context, this.source,
+      this._libraryElement)
+      : super(context);
 
   /**
    * Return the source for the library containing the source that is to be resolved.
@@ -12606,11 +13818,16 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveDartUnitTask(this);
+
+  @override
   void internalPerform() {
-    TypeProvider typeProvider = (_libraryElement.context as InternalAnalysisContext).typeProvider;
+    TypeProvider typeProvider =
+        (_libraryElement.context as InternalAnalysisContext).typeProvider;
     CompilationUnit unit = context.computeResolvableCompilationUnit(source);
     if (unit == null) {
-      throw new AnalysisException("Internal error: computeResolvableCompilationUnit returned a value without a parsed Dart unit");
+      throw new AnalysisException(
+          "Internal error: computeResolvableCompilationUnit returned a value without a parsed Dart unit");
     }
     //
     // Resolve names in declarations.
@@ -12620,28 +13837,43 @@
     // Resolve the type names.
     //
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor.con2(_libraryElement, source, typeProvider, errorListener);
+    TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor.con2(
+        _libraryElement,
+        source,
+        typeProvider,
+        errorListener);
     unit.accept(typeResolverVisitor);
     //
     // Resolve the rest of the structure
     //
-    InheritanceManager inheritanceManager = new InheritanceManager(_libraryElement);
-    ResolverVisitor resolverVisitor = new ResolverVisitor.con2(_libraryElement, source, typeProvider, inheritanceManager, errorListener);
+    InheritanceManager inheritanceManager =
+        new InheritanceManager(_libraryElement);
+    ResolverVisitor resolverVisitor = new ResolverVisitor.con2(
+        _libraryElement,
+        source,
+        typeProvider,
+        inheritanceManager,
+        errorListener);
     unit.accept(resolverVisitor);
     //
     // Perform additional error checking.
     //
-    TimeCounter_TimeCounterHandle counterHandleErrors = PerformanceStatistics.errors.start();
+    TimeCounter_TimeCounterHandle counterHandleErrors =
+        PerformanceStatistics.errors.start();
     try {
       ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
-      ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, _libraryElement, typeProvider, inheritanceManager);
+      ErrorVerifier errorVerifier = new ErrorVerifier(
+          errorReporter,
+          _libraryElement,
+          typeProvider,
+          inheritanceManager);
       unit.accept(errorVerifier);
       // TODO(paulberry): as a temporary workaround for issue 21572,
       // ConstantVerifier is being run right after ConstantValueComputer, so we
       // don't need to run it here.  Once issue 21572 is fixed, re-enable the
       // call to ConstantVerifier.
-      // ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _libraryElement, typeProvider);
-      // unit.accept(constantVerifier);
+//       ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _libraryElement, typeProvider);
+//       unit.accept(constantVerifier);
     } finally {
       counterHandleErrors.stop();
     }
@@ -12660,7 +13892,8 @@
    * @param unitSource the source for the compilation unit whose element is to be returned
    * @return the element representing the compilation unit
    */
-  CompilationUnitElement _find(LibraryElement libraryElement, Source unitSource) {
+  CompilationUnitElement _find(LibraryElement libraryElement,
+      Source unitSource) {
     CompilationUnitElement element = libraryElement.definingCompilationUnit;
     if (element.source == unitSource) {
       return element;
@@ -12716,10 +13949,9 @@
    * @param modificationTime the time at which the contents of the source were last modified
    * @param unit the HTML unit to be resolved
    */
-  ResolveHtmlTask(InternalAnalysisContext context, this.source, this.modificationTime, this._unit) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveHtmlTask(this);
+  ResolveHtmlTask(InternalAnalysisContext context, this.source,
+      this.modificationTime, this._unit)
+      : super(context);
 
   HtmlElement get element => _element;
 
@@ -12741,17 +13973,21 @@
   }
 
   @override
+  accept(AnalysisTaskVisitor visitor) => visitor.visitResolveHtmlTask(this);
+
+  @override
   void internalPerform() {
     //
     // Build the standard HTML element.
     //
     HtmlUnitBuilder builder = new HtmlUnitBuilder(context);
-    _element = builder.buildHtmlElement(source, modificationTime, _unit);
+    _element = builder.buildHtmlElement(source, _unit);
     RecordingErrorListener errorListener = builder.errorListener;
     //
     // Validate the directives
     //
-    _unit.accept(new RecursiveXmlVisitor_ResolveHtmlTask_internalPerform(this, errorListener));
+    _unit.accept(
+        new RecursiveXmlVisitor_ResolveHtmlTask_internalPerform(this, errorListener));
     //
     // Record all resolution errors.
     //
@@ -12828,10 +14064,8 @@
    * @param source the source to be parsed
    * @param content the contents of the source
    */
-  ScanDartTask(InternalAnalysisContext context, this.source, this._content) : super(context);
-
-  @override
-  accept(AnalysisTaskVisitor visitor) => visitor.visitScanDartTask(this);
+  ScanDartTask(InternalAnalysisContext context, this.source, this._content)
+      : super(context);
 
   /**
    * Return the errors that were produced by scanning the source, or `null` if the task has
@@ -12849,6 +14083,14 @@
    */
   LineInfo get lineInfo => _lineInfo;
 
+  @override
+  String get taskDescription {
+    if (source == null) {
+      return "scan as dart null source";
+    }
+    return "scan as dart ${source.fullName}";
+  }
+
   /**
    * Return the token stream that was produced by scanning the source, or `null` if the task
    * has not yet been performed or if an exception occurred.
@@ -12858,25 +14100,24 @@
   Token get tokenStream => _tokenStream;
 
   @override
-  String get taskDescription {
-    if (source == null) {
-      return "scan as dart null source";
-    }
-    return "scan as dart ${source.fullName}";
-  }
+  accept(AnalysisTaskVisitor visitor) => visitor.visitScanDartTask(this);
 
   @override
   void internalPerform() {
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    TimeCounter_TimeCounterHandle timeCounterScan = PerformanceStatistics.scan.start();
+    TimeCounter_TimeCounterHandle timeCounterScan =
+        PerformanceStatistics.scan.start();
     try {
-      Scanner scanner = new Scanner(source, new CharSequenceReader(_content), errorListener);
+      Scanner scanner =
+          new Scanner(source, new CharSequenceReader(_content), errorListener);
       scanner.preserveComments = context.analysisOptions.preserveComments;
       _tokenStream = scanner.tokenize();
       _lineInfo = new LineInfo(scanner.lineStarts);
       _errors = errorListener.getErrorsForSource(source);
     } catch (exception, stackTrace) {
-      throw new AnalysisException("Exception", new CaughtException(exception, stackTrace));
+      throw new AnalysisException(
+          "Exception",
+          new CaughtException(exception, stackTrace));
     } finally {
       timeCounterScan.stop();
     }
@@ -12895,9 +14136,11 @@
     }
     DartSdk sdk = factory.dartSdk;
     if (sdk == null) {
-      throw new IllegalArgumentException("The source factory for an SDK analysis context must have a DartUriResolver");
+      throw new IllegalArgumentException(
+          "The source factory for an SDK analysis context must have a DartUriResolver");
     }
-    return new AnalysisCache(<CachePartition> [AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
+    return new AnalysisCache(
+        <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
   }
 }
 
@@ -12913,7 +14156,8 @@
    * @param maxCacheSize the maximum number of sources for which AST structures should be kept in
    *          the cache
    */
-  SdkCachePartition(InternalAnalysisContext context, int maxCacheSize) : super(context, maxCacheSize, DefaultRetentionPolicy.POLICY);
+  SdkCachePartition(InternalAnalysisContext context, int maxCacheSize)
+      : super(context, maxCacheSize, DefaultRetentionPolicy.POLICY);
 
   @override
   bool contains(Source source) => source.isInSystemLibrary;
@@ -12925,6 +14169,25 @@
  */
 abstract class SourceEntry {
   /**
+   * The data descriptor representing the contents of the source.
+   */
+  static final DataDescriptor<String> CONTENT =
+      new DataDescriptor<String>("SourceEntry.CONTENT");
+
+  /**
+   * The data descriptor representing the line information.
+   */
+  static final DataDescriptor<LineInfo> LINE_INFO =
+      new DataDescriptor<LineInfo>("SourceEntry.LINE_INFO");
+
+  /**
+   * The index of the flag indicating whether the source was explicitly added to
+   * the context or whether the source was implicitly added because it was
+   * referenced by another source.
+   */
+  static int _EXPLICITLY_ADDED_FLAG = 0;
+
+  /**
    * The most recent time at which the state of the source matched the state
    * represented by this entry.
    */
@@ -12945,27 +14208,16 @@
    * A table mapping data descriptors to the cached results for those
    * descriptors.
    */
-  Map<DataDescriptor, CachedResult> resultMap
-      = new HashMap<DataDescriptor, CachedResult>();
+  Map<DataDescriptor, CachedResult> resultMap =
+      new HashMap<DataDescriptor, CachedResult>();
 
   /**
-   * The data descriptor representing the contents of the source.
+   * Get a list of all the library-independent descriptors for which values may
+   * be stored in this SourceEntry.
    */
-  static final DataDescriptor<String> CONTENT
-      = new DataDescriptor<String>("SourceEntry.CONTENT");
-
-  /**
-   * The data descriptor representing the line information.
-   */
-  static final DataDescriptor<LineInfo> LINE_INFO
-      = new DataDescriptor<LineInfo>("SourceEntry.LINE_INFO");
-
-  /**
-   * The index of the flag indicating whether the source was explicitly added to
-   * the context or whether the source was implicitly added because it was
-   * referenced by another source.
-   */
-  static int _EXPLICITLY_ADDED_FLAG = 0;
+  List<DataDescriptor> get descriptors {
+    return <DataDescriptor>[SourceEntry.CONTENT, SourceEntry.LINE_INFO];
+  }
 
   /**
    * Return `true` if the source was explicitly added to the context or `false`
@@ -12983,6 +14235,12 @@
   }
 
   /**
+   * Return the kind of the source, or `null` if the kind is not currently
+   * cached.
+   */
+  SourceKind get kind;
+
+  /**
    * Fix the state of the [exception] to match the current state of the entry.
    */
   void fixExceptionState() {
@@ -13029,7 +14287,7 @@
    * Return the value of the data represented by the given [descriptor], or
    * `null` if the data represented by the descriptor is not valid.
    */
-  /*<V>*/ dynamic /*V*/ getValue(DataDescriptor/*<V>*/ descriptor) {
+  /*<V>*/ dynamic /*V*/ getValue(DataDescriptor /*<V>*/ descriptor) {
     if (!_isValidDescriptor(descriptor)) {
       throw new ArgumentError("Invalid descriptor: $descriptor");
     }
@@ -13061,12 +14319,6 @@
   }
 
   /**
-   * Return the kind of the source, or `null` if the kind is not currently
-   * cached.
-   */
-  SourceKind get kind;
-
-  /**
    * Record that an [exception] occurred while attempting to get the contents of
    * the source represented by this entry. This will set the state of all
    * information, including any resolution-based information, as being in error.
@@ -13101,9 +14353,8 @@
     if (state == CacheState.INVALID) {
       resultMap.remove(descriptor);
     } else {
-      CachedResult result = resultMap.putIfAbsent(
-          descriptor,
-          () => new CachedResult(descriptor));
+      CachedResult result =
+          resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
       result.state = state;
       if (state != CacheState.IN_PROCESS) {
         //
@@ -13119,14 +14370,13 @@
    * Set the value of the data represented by the given [descriptor] to the
    * given [value].
    */
-  void setValue(DataDescriptor/*<V>*/ descriptor, dynamic /*V*/ value) {
+  void setValue(DataDescriptor /*<V>*/ descriptor, dynamic /*V*/ value) {
     if (!_isValidDescriptor(descriptor)) {
       throw new ArgumentError("Invalid descriptor: $descriptor");
     }
     _validateStateChange(descriptor, CacheState.VALID);
-    CachedResult result = resultMap.putIfAbsent(
-        descriptor,
-        () => new CachedResult(descriptor));
+    CachedResult result =
+        resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
     result.state = CacheState.VALID;
     result.value = value == null ? descriptor.defaultValue : value;
   }
@@ -13139,15 +14389,6 @@
   }
 
   /**
-   * Set the value of all of the flags with the given [indexes] to false.
-   */
-  void _clearFlags(List<int> indexes) {
-    for (int i = 0; i < indexes.length; i++) {
-      _flags = BooleanArray.set(_flags, indexes[i], false);
-    }
-  }
-
-  /**
    * Flush the value of the data described by the [descriptor].
    */
   void _flush(DataDescriptor descriptor) {
@@ -13168,8 +14409,7 @@
    * Return `true` if the [descriptor] is valid for this entry.
    */
   bool _isValidDescriptor(DataDescriptor descriptor) {
-    return descriptor == CONTENT
-        || descriptor == LINE_INFO;
+    return descriptor == CONTENT || descriptor == LINE_INFO;
   }
 
   /**
@@ -13180,6 +14420,28 @@
   }
 
   /**
+   * If the state of the value described by the given [descriptor] is changing
+   * from ERROR to anything else, capture the information. This is an attempt to
+   * discover the underlying cause of a long-standing bug.
+   */
+  void _validateStateChange(DataDescriptor descriptor, CacheState newState) {
+    if (descriptor != CONTENT) {
+      return;
+    }
+    CachedResult result = resultMap[CONTENT];
+    if (result != null && result.state == CacheState.ERROR) {
+      String message =
+          "contentState changing from ${result.state} to $newState";
+      InstrumentationBuilder builder =
+          Instrumentation.builder2("SourceEntry-validateStateChange");
+      builder.data3("message", message);
+      //builder.data("source", source.getFullName());
+      builder.record(new CaughtException(new AnalysisException(message), null));
+      builder.log();
+    }
+  }
+
+  /**
    * Write a textual representation of the difference between the [oldEntry] and
    * this entry to the given string [buffer]. Return `true` if some difference
    * was written.
@@ -13205,8 +14467,10 @@
       buffer.write(modificationTime);
       needsSeparator = true;
     }
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "content", CONTENT, oldEntry);
-    needsSeparator = _writeStateDiffOn(buffer, needsSeparator, "lineInfo", LINE_INFO, oldEntry);
+    needsSeparator =
+        _writeStateDiffOn(buffer, needsSeparator, "content", CONTENT, oldEntry);
+    needsSeparator =
+        _writeStateDiffOn(buffer, needsSeparator, "lineInfo", LINE_INFO, oldEntry);
     return needsSeparator;
   }
 
@@ -13227,7 +14491,7 @@
    * entry to the given [buffer]. Return `true` if some difference was written.
    */
   bool _writeStateDiffOn(StringBuffer buffer, bool needsSeparator, String label,
-        DataDescriptor descriptor, SourceEntry oldEntry) {
+      DataDescriptor descriptor, SourceEntry oldEntry) {
     CacheState oldState = oldEntry.getState(descriptor);
     CacheState newState = getState(descriptor);
     if (oldState != newState) {
@@ -13249,33 +14513,14 @@
    * given [descriptor] to the given bugger, prefixed by the given [label] to
    * the given [buffer].
    */
-  void _writeStateOn(StringBuffer buffer, String label, DataDescriptor descriptor) {
+  void _writeStateOn(StringBuffer buffer, String label,
+      DataDescriptor descriptor) {
     CachedResult result = resultMap[descriptor];
     buffer.write("; ");
     buffer.write(label);
     buffer.write(" = ");
     buffer.write(result == null ? CacheState.INVALID : result.state);
   }
-
-  /**
-   * If the state of the value described by the given [descriptor] is changing
-   * from ERROR to anything else, capture the information. This is an attempt to
-   * discover the underlying cause of a long-standing bug.
-   */
-  void _validateStateChange(DataDescriptor descriptor, CacheState newState) {
-    if (descriptor != CONTENT) {
-      return;
-    }
-    CachedResult result = resultMap[CONTENT];
-    if (result != null && result.state == CacheState.ERROR) {
-      String message = "contentState changing from ${result.state} to $newState";
-      InstrumentationBuilder builder = Instrumentation.builder2("SourceEntry-validateStateChange");
-      builder.data3("message", message);
-      //builder.data("source", source.getFullName());
-      builder.record(new CaughtException(new AnalysisException(message), null));
-      builder.log();
-    }
-  }
 }
 
 /**
@@ -13288,7 +14533,8 @@
    * resolved. These parts are given a higher priority because there is a high probability that
    * their AST structure is still in the cache and therefore would not need to be re-created.
    */
-  static const SourcePriority PRIORITY_PART = const SourcePriority('PRIORITY_PART', 0);
+  static const SourcePriority PRIORITY_PART =
+      const SourcePriority('PRIORITY_PART', 0);
 
   /**
    * Used for a Dart source that is known to be a library.
@@ -13303,19 +14549,85 @@
   /**
    * Used for a Dart source that is known to be a part but whose library has not yet been resolved.
    */
-  static const SourcePriority NORMAL_PART = const SourcePriority('NORMAL_PART', 3);
+  static const SourcePriority NORMAL_PART =
+      const SourcePriority('NORMAL_PART', 3);
 
   /**
    * Used for an HTML source.
    */
   static const SourcePriority HTML = const SourcePriority('HTML', 4);
 
-  static const List<SourcePriority> values = const [PRIORITY_PART, LIBRARY, UNKNOWN, NORMAL_PART, HTML];
+  static const List<SourcePriority> values = const [
+      PRIORITY_PART,
+      LIBRARY,
+      UNKNOWN,
+      NORMAL_PART,
+      HTML];
 
   const SourcePriority(String name, int ordinal) : super(name, ordinal);
 }
 
 /**
+ * [SourcesChangedEvent] indicates which sources have been added, removed,
+ * or whose contents have changed.
+ */
+class SourcesChangedEvent {
+
+  /**
+   * The internal representation of what has changed.
+   * Clients should not access this field directly.
+   */
+  final ChangeSet _changeSet;
+
+  /**
+   * Construct an instance representing the given changes.
+   */
+  SourcesChangedEvent(ChangeSet changeSet) : _changeSet = changeSet;
+
+  /**
+   * Construct an instance representing a source content change.
+   */
+  factory SourcesChangedEvent.changedContent(Source source, String contents) {
+    ChangeSet changeSet = new ChangeSet();
+    changeSet.changedContent(source, contents);
+    return new SourcesChangedEvent(changeSet);
+  }
+
+  /**
+   * Construct an instance representing a source content change.
+   */
+  factory SourcesChangedEvent.changedRange(Source source, String contents,
+      int offset, int oldLength, int newLength) {
+    ChangeSet changeSet = new ChangeSet();
+    changeSet.changedRange(source, contents, offset, oldLength, newLength);
+    return new SourcesChangedEvent(changeSet);
+  }
+
+  /**
+   * Return the collection of sources for which content has changed.
+   */
+  Iterable<Source> get changedSources {
+    List<Source> changedSources = new List.from(_changeSet.changedSources);
+    changedSources.addAll(_changeSet.changedContents.keys);
+    changedSources.addAll(_changeSet.changedRanges.keys);
+    return changedSources;
+  }
+
+  /**
+   * Return `true` if any sources were added.
+   */
+  bool get wereSourcesAdded => _changeSet.addedSources.length > 0;
+
+  /**
+   * Return `true` if any sources were removed or deleted.
+   */
+  bool get wereSourcesRemovedOrDeleted =>
+      _changeSet.removedSources.length > 0 ||
+          _changeSet.removedContainers.length > 0 ||
+          _changeSet.deletedSources.length > 0;
+}
+
+/**
  * Instances of the class `TimestampedData` represent analysis data for which we have a
  * modification time.
  */
@@ -13353,7 +14665,9 @@
    * @param retentionPolicy the policy used to determine which pieces of data to remove from the
    *          cache
    */
-  UniversalCachePartition(InternalAnalysisContext context, int maxCacheSize, CacheRetentionPolicy retentionPolicy) : super(context, maxCacheSize, retentionPolicy);
+  UniversalCachePartition(InternalAnalysisContext context, int maxCacheSize,
+      CacheRetentionPolicy retentionPolicy)
+      : super(context, maxCacheSize, retentionPolicy);
 
   @override
   bool contains(Source source) => true;
@@ -13383,10 +14697,10 @@
   WaitForAsyncTask() : super(null);
 
   @override
-  accept(AnalysisTaskVisitor visitor) => null;
+  String get taskDescription => "Waiting for async analysis";
 
   @override
-  String get taskDescription => "Waiting for async analysis";
+  accept(AnalysisTaskVisitor visitor) => null;
 
   @override
   void internalPerform() {
@@ -13570,9 +14884,44 @@
     if (_index >= _manager._workQueues[_queueIndex].length) {
       _index = 0;
       _queueIndex++;
-      while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_queueIndex].isEmpty) {
+      while (_queueIndex < _manager._workQueues.length &&
+          _manager._workQueues[_queueIndex].isEmpty) {
         _queueIndex++;
       }
     }
   }
 }
+
+class _AngularHtmlUnitResolver_visitModelDirectives extends
+    ht.RecursiveXmlVisitor<Object> {
+  final AngularHtmlUnitResolver resolver;
+
+  _AngularHtmlUnitResolver_visitModelDirectives(this.resolver)
+      : super();
+
+  @override
+  Object visitXmlTagNode(ht.XmlTagNode node) {
+    NgModelProcessor directive = NgModelProcessor.INSTANCE;
+    if (directive.canApply(node)) {
+      directive._applyTopDeclarations(resolver, node);
+    }
+    return super.visitXmlTagNode(node);
+  }
+}
+
+class _PolymerHtmlUnitBuilder_findTagDartElement extends
+    RecursiveElementVisitor<Object> {
+  final PolymerHtmlUnitBuilder PolymerHtmlUnitBuilder_this;
+
+  _PolymerHtmlUnitBuilder_findTagDartElement(this.PolymerHtmlUnitBuilder_this)
+      : super();
+
+  @override
+  Object visitPolymerTagDartElement(PolymerTagDartElement element) {
+    if (element.name == PolymerHtmlUnitBuilder_this._elementName) {
+      throw new PolymerHtmlUnitBuilder_FoundTagDartElementError(
+          element as PolymerTagDartElementImpl);
+    }
+    return null;
+  }
+}
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 86f83ad..e34d07f 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -5,11 +5,12 @@
 library engine.error;
 
 import 'dart:collection';
-import 'java_core.dart';
-import 'source.dart';
-import 'scanner.dart' show Token;
+
 import 'ast.dart' show AstNode;
 import 'element.dart';
+import 'java_core.dart';
+import 'scanner.dart' show Token;
+import 'source.dart';
 
 /**
  * Instances of the class `AnalysisError` represent an error discovered during the analysis of
@@ -27,13 +28,16 @@
    * A [Comparator] that sorts by the name of the file that the [AnalysisError] was
    * found.
    */
-  static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName);
+  static Comparator<AnalysisError> FILE_COMPARATOR =
+      (AnalysisError o1, AnalysisError o2) =>
+          o1.source.shortName.compareTo(o2.source.shortName);
 
   /**
    * A [Comparator] that sorts error codes first by their severity (errors first, warnings
    * second), and then by the the error code type.
    */
-  static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1, AnalysisError o2) {
+  static Comparator<AnalysisError> ERROR_CODE_COMPARATOR =
+      (AnalysisError o1, AnalysisError o2) {
     ErrorCode errorCode1 = o1.errorCode;
     ErrorCode errorCode2 = o2.errorCode;
     ErrorSeverity errorSeverity1 = errorCode1.errorSeverity;
@@ -69,9 +73,10 @@
   Source source;
 
   /**
-   * The character offset from the beginning of the source (zero based) where the error occurred.
+   * The character offset from the beginning of the source (zero based) where
+   * the error occurred.
    */
-  int _offset = 0;
+  int offset = 0;
 
   /**
    * The number of characters from the offset to the end of the source which encompasses the
@@ -106,8 +111,8 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisError.con2(this.source, int offset, int length, this.errorCode, [List<Object> arguments]) {
-    this._offset = offset;
+  AnalysisError.con2(this.source, this.offset, int length, this.errorCode,
+      [List<Object> arguments]) {
     this._length = length;
     this._message = formatList(errorCode.message, arguments);
     String correctionTemplate = errorCode.correction;
@@ -116,37 +121,6 @@
     }
   }
 
-  @override
-  bool operator ==(Object obj) {
-    if (identical(obj, this)) {
-      return true;
-    }
-    // prepare other AnalysisError
-    if (obj is! AnalysisError) {
-      return false;
-    }
-    AnalysisError other = obj as AnalysisError;
-    // Quick checks.
-    if (!identical(errorCode, other.errorCode)) {
-      return false;
-    }
-    if (_offset != other._offset || _length != other._length) {
-      return false;
-    }
-    if (isStaticOnly != other.isStaticOnly) {
-      return false;
-    }
-    // Deep checks.
-    if (_message != other._message) {
-      return false;
-    }
-    if (source != other.source) {
-      return false;
-    }
-    // OK
-    return true;
-  }
-
   /**
    * Return the correction to be displayed for this error, or `null` if there is no correction
    * information for this error. The correction should indicate how the user can fix the error.
@@ -155,6 +129,14 @@
    */
   String get correction => _correction;
 
+  @override
+  int get hashCode {
+    int hashCode = offset;
+    hashCode ^= (_message != null) ? _message.hashCode : 0;
+    hashCode ^= (source != null) ? source.hashCode : 0;
+    return hashCode;
+  }
+
   /**
    * Return the number of characters from the offset to the end of the source which encompasses the
    * compilation error.
@@ -171,13 +153,36 @@
    */
   String get message => _message;
 
-  /**
-   * Return the character offset from the beginning of the source (zero based) where the error
-   * occurred.
-   *
-   * @return the offset to the start of the error location
-   */
-  int get offset => _offset;
+  @override
+  bool operator ==(Object obj) {
+    if (identical(obj, this)) {
+      return true;
+    }
+    // prepare other AnalysisError
+    if (obj is! AnalysisError) {
+      return false;
+    }
+    AnalysisError other = obj as AnalysisError;
+    // Quick checks.
+    if (!identical(errorCode, other.errorCode)) {
+      return false;
+    }
+    if (offset != other.offset || _length != other._length) {
+      return false;
+    }
+    if (isStaticOnly != other.isStaticOnly) {
+      return false;
+    }
+    // Deep checks.
+    if (_message != other._message) {
+      return false;
+    }
+    if (source != other.source) {
+      return false;
+    }
+    // OK
+    return true;
+  }
 
   /**
    * Return the value of the given property, or `null` if the given property is not defined
@@ -189,21 +194,13 @@
   Object getProperty(ErrorProperty property) => null;
 
   @override
-  int get hashCode {
-    int hashCode = _offset;
-    hashCode ^= (_message != null) ? _message.hashCode : 0;
-    hashCode ^= (source != null) ? source.hashCode : 0;
-    return hashCode;
-  }
-
-  @override
   String toString() {
     StringBuffer buffer = new StringBuffer();
     buffer.write((source != null) ? source.fullName : "<unknown source>");
     buffer.write("(");
-    buffer.write(_offset);
+    buffer.write(offset);
     buffer.write("..");
-    buffer.write(_offset + _length - 1);
+    buffer.write(offset + _length - 1);
     buffer.write("): ");
     //buffer.write("(" + lineNumber + ":" + columnNumber + "): ");
     buffer.write(_message);
@@ -219,7 +216,8 @@
   /**
    * An error listener that ignores errors that are reported to it.
    */
-  static final AnalysisErrorListener NULL_LISTENER = new AnalysisErrorListener_NULL_LISTENER();
+  static final AnalysisErrorListener NULL_LISTENER =
+      new AnalysisErrorListener_NULL_LISTENER();
 
   /**
    * This method is invoked when an error has been found by the analysis engine.
@@ -243,7 +241,8 @@
   /**
    * The properties associated with this error.
    */
-  HashMap<ErrorProperty, Object> _propertyMap = new HashMap<ErrorProperty, Object>();
+  HashMap<ErrorProperty, Object> _propertyMap =
+      new HashMap<ErrorProperty, Object>();
 
   /**
    * Initialize a newly created analysis error for the specified source. The error has no location
@@ -253,7 +252,9 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode, List<Object> arguments) : super.con1(source, errorCode, arguments);
+  AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode,
+      List<Object> arguments)
+      : super.con1(source, errorCode, arguments);
 
   /**
    * Initialize a newly created analysis error for the specified source at the given location.
@@ -264,7 +265,9 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisErrorWithProperties.con2(Source source, int offset, int length, ErrorCode errorCode, List<Object> arguments) : super.con2(source, offset, length, errorCode, arguments);
+  AnalysisErrorWithProperties.con2(Source source, int offset, int length,
+      ErrorCode errorCode, List<Object> arguments)
+      : super.con2(source, offset, length, errorCode, arguments);
 
   @override
   Object getProperty(ErrorProperty property) => _propertyMap[property];
@@ -285,80 +288,60 @@
  * The enumeration `AngularCode` defines Angular specific problems.
  */
 class AngularCode extends ErrorCode {
-  static const AngularCode CANNOT_PARSE_SELECTOR
-      = const AngularCode(
-          'CANNOT_PARSE_SELECTOR',
-          "The selector '{0}' cannot be parsed");
+  static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode(
+      'CANNOT_PARSE_SELECTOR',
+      "The selector '{0}' cannot be parsed");
 
-  static const AngularCode INVALID_FORMATTER_NAME
-      = const AngularCode(
-          'INVALID_FORMATTER_NAME',
-          "Formatter name must be a simple identifier");
+  static const AngularCode INVALID_FORMATTER_NAME = const AngularCode(
+      'INVALID_FORMATTER_NAME',
+      "Formatter name must be a simple identifier");
 
-  static const AngularCode INVALID_PROPERTY_KIND
-      = const AngularCode(
-          'INVALID_PROPERTY_KIND',
-          "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
+  static const AngularCode INVALID_PROPERTY_KIND = const AngularCode(
+      'INVALID_PROPERTY_KIND',
+      "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
 
-  static const AngularCode INVALID_PROPERTY_FIELD
-      = const AngularCode(
-          'INVALID_PROPERTY_FIELD',
-          "Unknown property field '{0}'");
+  static const AngularCode INVALID_PROPERTY_FIELD =
+      const AngularCode('INVALID_PROPERTY_FIELD', "Unknown property field '{0}'");
 
-  static const AngularCode INVALID_PROPERTY_MAP
-      = const AngularCode(
-          'INVALID_PROPERTY_MAP',
-          "Argument 'map' must be a constant map literal");
+  static const AngularCode INVALID_PROPERTY_MAP = const AngularCode(
+      'INVALID_PROPERTY_MAP',
+      "Argument 'map' must be a constant map literal");
 
-  static const AngularCode INVALID_PROPERTY_NAME
-      = const AngularCode(
-          'INVALID_PROPERTY_NAME',
-          "Property name must be a string literal");
+  static const AngularCode INVALID_PROPERTY_NAME = const AngularCode(
+      'INVALID_PROPERTY_NAME',
+      "Property name must be a string literal");
 
-  static const AngularCode INVALID_PROPERTY_SPEC
-      = const AngularCode(
-          'INVALID_PROPERTY_SPEC',
-          "Property binding specification must be a string literal");
+  static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode(
+      'INVALID_PROPERTY_SPEC',
+      "Property binding specification must be a string literal");
 
-  static const AngularCode INVALID_REPEAT_SYNTAX
-      = const AngularCode(
-          'INVALID_REPEAT_SYNTAX',
-          "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
+  static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode(
+      'INVALID_REPEAT_SYNTAX',
+      "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
 
-  static const AngularCode INVALID_REPEAT_ITEM_SYNTAX
-      = const AngularCode(
-          'INVALID_REPEAT_ITEM_SYNTAX',
-          "Item must by identifier or in '(_key_, _value_)' pair.");
+  static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode(
+      'INVALID_REPEAT_ITEM_SYNTAX',
+      "Item must by identifier or in '(_key_, _value_)' pair.");
 
-  static const AngularCode INVALID_URI
-      = const AngularCode(
-          'INVALID_URI',
-          "Invalid URI syntax: '{0}'");
+  static const AngularCode INVALID_URI =
+      const AngularCode('INVALID_URI', "Invalid URI syntax: '{0}'");
 
-  static const AngularCode MISSING_FORMATTER_COLON
-      = const AngularCode(
-          'MISSING_FORMATTER_COLON',
-          "Missing ':' before formatter argument");
+  static const AngularCode MISSING_FORMATTER_COLON = const AngularCode(
+      'MISSING_FORMATTER_COLON',
+      "Missing ':' before formatter argument");
 
-  static const AngularCode MISSING_NAME
-      = const AngularCode(
-          'MISSING_NAME',
-          "Argument 'name' must be provided");
+  static const AngularCode MISSING_NAME =
+      const AngularCode('MISSING_NAME', "Argument 'name' must be provided");
 
-  static const AngularCode MISSING_PUBLISH_AS
-      = const AngularCode(
-          'MISSING_PUBLISH_AS',
-          "Argument 'publishAs' must be provided");
+  static const AngularCode MISSING_PUBLISH_AS = const AngularCode(
+      'MISSING_PUBLISH_AS',
+      "Argument 'publishAs' must be provided");
 
-  static const AngularCode MISSING_SELECTOR
-      = const AngularCode(
-          'MISSING_SELECTOR',
-          "Argument 'selector' must be provided");
+  static const AngularCode MISSING_SELECTOR =
+      const AngularCode('MISSING_SELECTOR', "Argument 'selector' must be provided");
 
-  static const AngularCode URI_DOES_NOT_EXIST
-      = const AngularCode(
-          'URI_DOES_NOT_EXIST',
-          "Target of URI does not exist: '{0}'");
+  static const AngularCode URI_DOES_NOT_EXIST =
+      const AngularCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -419,8 +402,9 @@
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode
+      CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH =
+      const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH',
           "The object type '{0}' cannot be assigned to the field '{1}', which has type '{2}'");
 
@@ -428,8 +412,9 @@
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode
+      CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH =
+      const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH',
           "The object type '{0}' cannot be assigned to a parameter of type '{1}'");
 
@@ -444,8 +429,9 @@
    * @param initializerType the name of the type of the initializer expression
    * @param fieldType the name of the type of the field
    */
-  static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode
+      CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE =
+      const CheckedModeCompileTimeErrorCode(
           'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE',
           "The initializer type '{0}' cannot be assigned to the field type '{1}'");
 
@@ -463,7 +449,8 @@
    * 1 &lt;= j &lt;= m</i>.
    */
   static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-      = const CheckedModeCompileTimeErrorCode(
+      =
+      const CheckedModeCompileTimeErrorCode(
           'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
           "The element type '{0}' cannot be assigned to the list type '{1}'");
 
@@ -482,8 +469,8 @@
    * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
    * &lt;= j &lt;= m</i>.
    */
-  static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE =
+      const CheckedModeCompileTimeErrorCode(
           'MAP_KEY_TYPE_NOT_ASSIGNABLE',
           "The element type '{0}' cannot be assigned to the map key type '{1}'");
 
@@ -502,8 +489,8 @@
    * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
    * &lt;= j &lt;= m</i>.
    */
-  static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE =
+      const CheckedModeCompileTimeErrorCode(
           'MAP_VALUE_TYPE_NOT_ASSIGNABLE',
           "The element type '{0}' cannot be assigned to the map value type '{1}'");
 
@@ -511,8 +498,8 @@
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH
-      = const CheckedModeCompileTimeErrorCode(
+  static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH =
+      const CheckedModeCompileTimeErrorCode(
           'VARIABLE_TYPE_MISMATCH',
           "The object type '{0}' cannot be assigned to a variable of type '{1}'");
 
@@ -522,11 +509,13 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const CheckedModeCompileTimeErrorCode(String name, String message, [String correction])
+  const CheckedModeCompileTimeErrorCode(String name, String message,
+      [String correction])
       : super(name, message, correction);
 
   @override
-  ErrorSeverity get errorSeverity => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.severity;
+  ErrorSeverity get errorSeverity =>
+      ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.severity;
 
   @override
   ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR;
@@ -544,7 +533,10 @@
    * Enum proposal: It is also a compile-time error to explicitly instantiate an
    * enum via 'new' or 'const' or to access its private fields.
    */
-  static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTimeErrorCode('ACCESS_PRIVATE_ENUM_FIELD', "The private fields of an enum cannot be accessed, even within the same library");
+  static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD =
+      const CompileTimeErrorCode(
+          'ACCESS_PRIVATE_ENUM_FIELD',
+          "The private fields of an enum cannot be accessed, even within the same library");
 
   /**
    * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
@@ -558,7 +550,10 @@
    * @param secondLibraryName the name of the second library that the type is
    *        found
    */
-  static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCode('AMBIGUOUS_EXPORT', "The name '{0}' is defined in the libraries '{1}' and '{2}'");
+  static const CompileTimeErrorCode AMBIGUOUS_EXPORT =
+      const CompileTimeErrorCode(
+          'AMBIGUOUS_EXPORT',
+          "The name '{0}' is defined in the libraries '{1}' and '{2}'");
 
   /**
    * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
@@ -567,59 +562,84 @@
    * @param the name of the identifier in the argument definition test that is
    *        not a parameter
    */
-  static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = const CompileTimeErrorCode('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter");
+  static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER =
+      const CompileTimeErrorCode(
+          'ARGUMENT_DEFINITION_TEST_NON_PARAMETER',
+          "'{0}' is not a parameter");
 
   /**
    * ?? Asynchronous For-in: It is a compile-time error if an asynchronous
    * for-in statement appears inside a synchronous function.
    */
-  static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = const CompileTimeErrorCode('ASYNC_FOR_IN_WRONG_CONTEXT', "The asynchronous for-in can only be used in a function marked with async or async*");
+  static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT =
+      const CompileTimeErrorCode(
+          'ASYNC_FOR_IN_WRONG_CONTEXT',
+          "The asynchronous for-in can only be used in a function marked with async or async*");
 
   /**
    * ??: It is a compile-time error if the function immediately enclosing a is
    * not declared asynchronous.
    */
-  static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = const CompileTimeErrorCode('AWAIT_IN_WRONG_CONTEXT', "The await expression can only be used in a function marked as async or async*");
+  static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT =
+      const CompileTimeErrorCode(
+          'AWAIT_IN_WRONG_CONTEXT',
+          "The await expression can only be used in a function marked as async or async*");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error to use a built-in
    * identifier other than dynamic as a type annotation.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE', "The built-in identifier '{0}' cannot be as a type");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE =
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE',
+          "The built-in identifier '{0}' cannot be as a type");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', "The built-in identifier '{0}' cannot be used as a type name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME =
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE_NAME',
+          "The built-in identifier '{0}' cannot be used as a type name");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', "The built-in identifier '{0}' cannot be used as a type alias name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME =
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME',
+          "The built-in identifier '{0}' cannot be used as a type alias name");
 
   /**
    * 12.30 Identifier Reference: It is a compile-time error if a built-in
    * identifier is used as the declared name of a class, type parameter or type
    * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', "The built-in identifier '{0}' cannot be used as a type parameter name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME =
+      const CompileTimeErrorCode(
+          'BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME',
+          "The built-in identifier '{0}' cannot be used as a type parameter name");
 
   /**
    * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements
    * the operator <i>==</i>.
    */
-  static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The switch case expression type '{0}' cannot override the == operator");
+  static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS =
+      const CompileTimeErrorCode(
+          'CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS',
+          "The switch case expression type '{0}' cannot override the == operator");
 
   /**
    * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
    * constant would raise
    * an exception.
    */
-  static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = const CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', "");
+  static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION =
+      const CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', "");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -627,7 +647,10 @@
    * getter is defined explicitly or implicitly, or whether the getter or the
    * method are inherited or not.
    */
-  static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const CompileTimeErrorCode('CONFLICTING_GETTER_AND_METHOD', "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name");
+  static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD =
+      const CompileTimeErrorCode(
+          'CONFLICTING_GETTER_AND_METHOD',
+          "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -635,7 +658,10 @@
    * getter is defined explicitly or implicitly, or whether the getter or the
    * method are inherited or not.
    */
-  static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const CompileTimeErrorCode('CONFLICTING_METHOD_AND_GETTER', "Class '{0}' cannot have both method '{1}.{2}' and getter with the same name");
+  static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER =
+      const CompileTimeErrorCode(
+          'CONFLICTING_METHOD_AND_GETTER',
+          "Class '{0}' cannot have both method '{1}.{2}' and getter with the same name");
 
   /**
    * 7.6 Constructors: A constructor name always begins with the name of its
@@ -643,7 +669,10 @@
    * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
    * of a member declared in the immediately enclosing class.
    */
-  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', "'{0}' cannot be used to name a constructor and a field in this class");
+  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD =
+      const CompileTimeErrorCode(
+          'CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD',
+          "'{0}' cannot be used to name a constructor and a field in this class");
 
   /**
    * 7.6 Constructors: A constructor name always begins with the name of its
@@ -651,34 +680,50 @@
    * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
    * of a member declared in the immediately enclosing class.
    */
-  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', "'{0}' cannot be used to name a constructor and a method in this class");
+  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD =
+      const CompileTimeErrorCode(
+          'CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD',
+          "'{0}' cannot be used to name a constructor and a method in this class");
 
   /**
    * 7. Classes: It is a compile time error if a generic class declares a type
    * variable with the same name as the class or any of its members or
    * constructors.
    */
-  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_CLASS', "'{0}' cannot be used to name a type varaible in a class with the same name");
+  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS =
+      const CompileTimeErrorCode(
+          'CONFLICTING_TYPE_VARIABLE_AND_CLASS',
+          "'{0}' cannot be used to name a type varaible in a class with the same name");
 
   /**
    * 7. Classes: It is a compile time error if a generic class declares a type
    * variable with the same name as the class or any of its members or
    * constructors.
    */
-  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' cannot be used to name a type varaible and member in this class");
+  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER =
+      const CompileTimeErrorCode(
+          'CONFLICTING_TYPE_VARIABLE_AND_MEMBER',
+          "'{0}' cannot be used to name a type varaible and member in this class");
 
   /**
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const CompileTimeErrorCode('CONST_CONSTRUCTOR_THROWS_EXCEPTION', "'const' constructors cannot throw exceptions");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION =
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_THROWS_EXCEPTION',
+          "'const' constructors cannot throw exceptions");
 
   /**
    * 10.6.3 Constant Constructors: It is a compile-time error if a constant
    * constructor is declared by a class C if any instance variable declared in C
    * is initialized with an expression that is not a constant expression.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST', "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
+  static const CompileTimeErrorCode
+      CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST =
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST',
+          "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
 
   /**
    * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
@@ -689,7 +734,10 @@
    * 9 Mixins: For each generative constructor named ... an implicitly declared
    * constructor named ... is declared.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_MIXIN', "Constant constructor cannot be declared for a class with a mixin");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN =
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_MIXIN',
+          "Constant constructor cannot be declared for a class with a mixin");
 
   /**
    * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
@@ -697,7 +745,10 @@
    * specify a constant constructor of the superclass of the immediately
    * enclosing class or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', "Constant constructor cannot call non-constant super constructor of '{0}'");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER =
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER',
+          "Constant constructor cannot call non-constant super constructor of '{0}'");
 
   /**
    * 7.6.3 Constant Constructors: It is a compile-time error if a constant
@@ -705,24 +756,36 @@
    *
    * The above refers to both locally declared and inherited instance variables.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', "Cannot define the 'const' constructor for a class with non-final fields");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD =
+      const CompileTimeErrorCode(
+          'CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD',
+          "Cannot define the 'const' constructor for a class with non-final fields");
 
   /**
    * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
    */
-  static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErrorCode('CONST_DEFERRED_CLASS', "Deferred classes cannot be created with 'const'");
+  static const CompileTimeErrorCode CONST_DEFERRED_CLASS =
+      const CompileTimeErrorCode(
+          'CONST_DEFERRED_CLASS',
+          "Deferred classes cannot be created with 'const'");
 
   /**
    * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
    * declared as a constant variable.
    */
-  static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeErrorCode('CONST_FORMAL_PARAMETER', "Parameters cannot be 'const'");
+  static const CompileTimeErrorCode CONST_FORMAL_PARAMETER =
+      const CompileTimeErrorCode(
+          'CONST_FORMAL_PARAMETER',
+          "Parameters cannot be 'const'");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
    * constant or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', "'const' variables must be constant value");
+  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE =
+      const CompileTimeErrorCode(
+          'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE',
+          "'const' variables must be constant value");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
@@ -731,20 +794,31 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used to initialized a 'const' variable");
+  static const CompileTimeErrorCode
+      CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used to initialized a 'const' variable");
 
   /**
    * 7.5 Instance Variables: It is a compile-time error if an instance variable
    * is declared to be constant.
    */
-  static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErrorCode('CONST_INSTANCE_FIELD', "Only static fields can be declared as 'const'");
+  static const CompileTimeErrorCode CONST_INSTANCE_FIELD =
+      const CompileTimeErrorCode(
+          'CONST_INSTANCE_FIELD',
+          "Only static fields can be declared as 'const'");
 
   /**
    * 12.8 Maps: It is a compile-time error if the key of an entry in a constant
    * map literal is an instance of a class that implements the operator
    * <i>==</i> unless the key is a string or integer.
    */
-  static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The constant map entry key expression type '{0}' cannot override the == operator");
+  static const CompileTimeErrorCode
+      CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS =
+      const CompileTimeErrorCode(
+          'CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS',
+          "The constant map entry key expression type '{0}' cannot override the == operator");
 
   /**
    * 5 Variables: A constant variable must be initialized to a compile-time
@@ -752,28 +826,40 @@
    *
    * @param name the name of the uninitialized final variable
    */
-  static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErrorCode('CONST_NOT_INITIALIZED', "The const variable '{0}' must be initialized");
+  static const CompileTimeErrorCode CONST_NOT_INITIALIZED =
+      const CompileTimeErrorCode(
+          'CONST_NOT_INITIALIZED',
+          "The const variable '{0}' must be initialized");
 
   /**
    * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
    * where e, e1 and e2 are constant expressions that evaluate to a boolean
    * value.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL', "An expression of type 'bool' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_BOOL',
+          "An expression of type 'bool' was expected");
 
   /**
    * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
    * e1 and e2 are constant expressions that evaluate to a numeric, string or
    * boolean value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING', "An expression of type 'bool', 'num', 'String' or 'null' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_BOOL_NUM_STRING',
+          "An expression of type 'bool', 'num', 'String' or 'null' was expected");
 
   /**
    * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
    * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions
    * that evaluate to an integer value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeErrorCode('CONST_EVAL_TYPE_INT', "An expression of type 'int' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_INT =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_INT',
+          "An expression of type 'int' was expected");
 
   /**
    * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
@@ -781,19 +867,28 @@
    * where e, e1 and e2 are constant expressions that evaluate to a numeric
    * value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeErrorCode('CONST_EVAL_TYPE_NUM', "An expression of type 'num' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_TYPE_NUM',
+          "An expression of type 'num' was expected");
 
   /**
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', "Evaluation of this constant expression causes exception");
+  static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_THROWS_EXCEPTION',
+          "Evaluation of this constant expression causes exception");
 
   /**
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
    * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeErrorCode('CONST_EVAL_THROWS_IDBZE', "Evaluation of this constant expression throws IntegerDivisionByZeroException");
+  static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE =
+      const CompileTimeErrorCode(
+          'CONST_EVAL_THROWS_IDBZE',
+          "Evaluation of this constant expression throws IntegerDivisionByZeroException");
 
   /**
    * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
@@ -806,7 +901,10 @@
    * See [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS], and
    * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
-  static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+  static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS =
+      const CompileTimeErrorCode(
+          'CONST_WITH_INVALID_TYPE_PARAMETERS',
+          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
    * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
@@ -815,14 +913,20 @@
    * type <i>T</i> does not declare a constant constructor with the same name as
    * the declaration of <i>T</i>.
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErrorCode('CONST_WITH_NON_CONST', "The constructor being called is not a 'const' constructor");
+  static const CompileTimeErrorCode CONST_WITH_NON_CONST =
+      const CompileTimeErrorCode(
+          'CONST_WITH_NON_CONST',
+          "The constructor being called is not a 'const' constructor");
 
   /**
    * 12.11.2 Const: In all of the above cases, it is a compile-time error if
    * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n + k</i>, is not a compile-time constant
    * expression.
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const CompileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', "Arguments of a constant creation must be constant expressions");
+  static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT =
+      const CompileTimeErrorCode(
+          'CONST_WITH_NON_CONSTANT_ARGUMENT',
+          "Arguments of a constant creation must be constant expressions");
 
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
@@ -836,13 +940,19 @@
    *
    * @param name the name of the non-type element
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeErrorCode('CONST_WITH_NON_TYPE', "The name '{0}' is not a class");
+  static const CompileTimeErrorCode CONST_WITH_NON_TYPE =
+      const CompileTimeErrorCode(
+          'CONST_WITH_NON_TYPE',
+          "The name '{0}' is not a class");
 
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type
    * parameters.
    */
-  static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS', "The constant creation cannot use a type parameter");
+  static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS =
+      const CompileTimeErrorCode(
+          'CONST_WITH_TYPE_PARAMETERS',
+          "The constant creation cannot use a type parameter");
 
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
@@ -851,7 +961,10 @@
    * @param typeName the name of the type
    * @param constructorName the name of the requested constant constructor
    */
-  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a constant constructor '{1}'");
+  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'CONST_WITH_UNDEFINED_CONSTRUCTOR',
+          "The class '{0}' does not have a constant constructor '{1}'");
 
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
@@ -859,13 +972,19 @@
    *
    * @param typeName the name of the type
    */
-  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' does not have a default constant constructor");
+  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
+      const CompileTimeErrorCode(
+          'CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
+          "The class '{0}' does not have a default constant constructor");
 
   /**
    * 15.3.1 Typedef: It is a compile-time error if any default values are
    * specified in the signature of a function type alias.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', "Default values aren't allowed in typedefs");
+  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS =
+      const CompileTimeErrorCode(
+          'DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS',
+          "Default values aren't allowed in typedefs");
 
   /**
    * 6.2.1 Required Formals: By means of a function signature that names the
@@ -873,19 +992,29 @@
    * error if any default values are specified in the signature of such a
    * function type.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', "Default values aren't allowed in function type parameters");
+  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER =
+      const CompileTimeErrorCode(
+          'DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER',
+          "Default values aren't allowed in function type parameters");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly
    * specifies a default value for an optional parameter.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', "Default values aren't allowed in factory constructors that redirect to another constructor");
+  static const CompileTimeErrorCode
+      DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR',
+          "Default values aren't allowed in factory constructors that redirect to another constructor");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
    * with the same name declared in the same scope.
    */
-  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT', "The default constructor is already defined");
+  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT =
+      const CompileTimeErrorCode(
+          'DUPLICATE_CONSTRUCTOR_DEFAULT',
+          "The default constructor is already defined");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
@@ -893,7 +1022,10 @@
    *
    * @param duplicateName the name of the duplicate entity
    */
-  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_NAME', "The constructor with name '{0}' is already defined");
+  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME =
+      const CompileTimeErrorCode(
+          'DUPLICATE_CONSTRUCTOR_NAME',
+          "The constructor with name '{0}' is already defined");
 
   /**
    * 3.1 Scoping: It is a compile-time error if there is more than one entity
@@ -907,7 +1039,10 @@
    *
    * @param duplicateName the name of the duplicate entity
    */
-  static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErrorCode('DUPLICATE_DEFINITION', "The name '{0}' is already defined");
+  static const CompileTimeErrorCode DUPLICATE_DEFINITION =
+      const CompileTimeErrorCode(
+          'DUPLICATE_DEFINITION',
+          "The name '{0}' is already defined");
 
   /**
    * 7. Classes: It is a compile-time error if a class has an instance member
@@ -921,21 +1056,30 @@
    * @param name the name of the conflicting members
    * See [DUPLICATE_DEFINITION].
    */
-  static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const CompileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', "The name '{0}' is already defined in '{1}'");
+  static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE =
+      const CompileTimeErrorCode(
+          'DUPLICATE_DEFINITION_INHERITANCE',
+          "The name '{0}' is already defined in '{1}'");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a compile-time error if
    * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where
    * <i>q<sub>i</sub></i> is the label for a named argument].
    */
-  static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0}' was already specified");
+  static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT =
+      const CompileTimeErrorCode(
+          'DUPLICATE_NAMED_ARGUMENT',
+          "The argument for the named parameter '{0}' was already specified");
 
   /**
    * SDK implementation libraries can be exported only by other SDK libraries.
    *
    * @param uri the uri pointing to a library
    */
-  static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode('EXPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be exported");
+  static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY =
+      const CompileTimeErrorCode(
+          'EXPORT_INTERNAL_LIBRARY',
+          "The library '{0}' is internal and cannot be exported");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -943,13 +1087,17 @@
    *
    * @param uri the uri pointing to a non-library declaration
    */
-  static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY', "The exported library '{0}' must not have a part-of directive");
+  static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY =
+      const CompileTimeErrorCode(
+          'EXPORT_OF_NON_LIBRARY',
+          "The exported library '{0}' must not have a part-of directive");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
    * an enum.
    */
-  static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode('EXTENDS_ENUM', "Classes cannot extend an enum");
+  static const CompileTimeErrorCode EXTENDS_ENUM =
+      const CompileTimeErrorCode('EXTENDS_ENUM', "Classes cannot extend an enum");
 
   /**
    * 7.9 Superclasses: It is a compile-time error if the extends clause of a
@@ -958,7 +1106,10 @@
    *
    * @param typeName the name of the superclass that was not found
    */
-  static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCode('EXTENDS_NON_CLASS', "Classes can only extend other classes");
+  static const CompileTimeErrorCode EXTENDS_NON_CLASS =
+      const CompileTimeErrorCode(
+          'EXTENDS_NON_CLASS',
+          "Classes can only extend other classes");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -983,7 +1134,10 @@
    * @param typeName the name of the type that cannot be extended
    * See [IMPLEMENTS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTimeErrorCode('EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'");
+  static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS =
+      const CompileTimeErrorCode(
+          'EXTENDS_DISALLOWED_CLASS',
+          "Classes cannot extend '{0}'");
 
   /**
    * 7.9 Superclasses: It is a compile-time error if the extends clause of a
@@ -992,7 +1146,10 @@
    * @param typeName the name of the type that cannot be extended
    * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeErrorCode('EXTENDS_DEFERRED_CLASS', "This class cannot extend the deferred class '{0}'");
+  static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS =
+      const CompileTimeErrorCode(
+          'EXTENDS_DEFERRED_CLASS',
+          "This class cannot extend the deferred class '{0}'");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
@@ -1004,14 +1161,20 @@
    * @param requiredCount the maximum number of positional arguments
    * @param argumentCount the actual number of positional arguments given
    */
-  static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTimeErrorCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found");
+  static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS =
+      const CompileTimeErrorCode(
+          'EXTRA_POSITIONAL_ARGUMENTS',
+          "{0} positional arguments expected, but {1} found");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
    * is a compile time error if more than one initializer corresponding to a
    * given instance variable appears in <i>k</i>'s list.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', "The field '{0}' cannot be initialized twice in the same constructor");
+  static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS =
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS',
+          "The field '{0}' cannot be initialized twice in the same constructor");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -1019,7 +1182,11 @@
    * initializer for a variable that is initialized by means of an initializing
    * formal of <i>k</i>.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = const CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', "Fields cannot be initialized in both the parameter list and the initializers");
+  static const CompileTimeErrorCode
+      FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER =
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER',
+          "Fields cannot be initialized in both the parameter list and the initializers");
 
   /**
    * 5 Variables: It is a compile-time error if a final instance variable that
@@ -1028,21 +1195,30 @@
    *
    * @param name the name of the field in question
    */
-  static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', "'{0}' is a final field and so can only be set once");
+  static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES =
+      const CompileTimeErrorCode(
+          'FINAL_INITIALIZED_MULTIPLE_TIMES',
+          "'{0}' is a final field and so can only be set once");
 
   /**
    * 7.6.1 Generative Constructors: It is a compile-time error if an
    * initializing formal is used by a function other than a non-redirecting
    * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', "Initializing formal fields cannot be used in factory constructors");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_FACTORY_CONSTRUCTOR',
+          "Initializing formal fields cannot be used in factory constructors");
 
   /**
    * 7.6.1 Generative Constructors: It is a compile-time error if an
    * initializing formal is used by a function other than a non-redirecting
    * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Initializing formal fields can only be used in constructors");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
+          "Initializing formal fields can only be used in constructors");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -1052,7 +1228,10 @@
    * initializing formal is used by a function other than a non-redirecting
    * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', "The redirecting constructor cannot have a field initializer");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR',
+          "The redirecting constructor cannot have a field initializer");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -1060,7 +1239,10 @@
    *
    * @param name the conflicting name of the getter and method
    */
-  static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', "'{0}' cannot be used to name a getter, there is already a method with the same name");
+  static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME =
+      const CompileTimeErrorCode(
+          'GETTER_AND_METHOD_WITH_SAME_NAME',
+          "'{0}' cannot be used to name a getter, there is already a method with the same name");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
@@ -1070,7 +1252,10 @@
    * @param typeName the name of the type that cannot be extended
    * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTimeErrorCode('IMPLEMENTS_DEFERRED_CLASS', "This class cannot implement the deferred class '{0}'");
+  static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_DEFERRED_CLASS',
+          "This class cannot implement the deferred class '{0}'");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -1095,19 +1280,28 @@
    * @param typeName the name of the type that cannot be implemented
    * See [EXTENDS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileTimeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'");
+  static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_DISALLOWED_CLASS',
+          "Classes cannot implement '{0}'");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
    * of a class includes type dynamic.
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorCode('IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'");
+  static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_DYNAMIC',
+          "Classes cannot implement 'dynamic'");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
    * an enum.
    */
-  static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode('IMPLEMENTS_ENUM', "Classes cannot implement an enum");
+  static const CompileTimeErrorCode IMPLEMENTS_ENUM =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_ENUM',
+          "Classes cannot implement an enum");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the implements clause
@@ -1116,7 +1310,10 @@
    *
    * @param typeName the name of the interface that was not found
    */
-  static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErrorCode('IMPLEMENTS_NON_CLASS', "Classes can only implement other classes");
+  static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_NON_CLASS',
+          "Classes can only implement other classes");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
@@ -1124,7 +1321,10 @@
    *
    * @param className the name of the class that is implemented more than once
    */
-  static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeErrorCode('IMPLEMENTS_REPEATED', "'{0}' can only be implemented once");
+  static const CompileTimeErrorCode IMPLEMENTS_REPEATED =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_REPEATED',
+          "'{0}' can only be implemented once");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the superclass of a
@@ -1133,7 +1333,10 @@
    * @param className the name of the class that appears in both "extends" and
    *        "implements" clauses
    */
-  static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeErrorCode('IMPLEMENTS_SUPER_CLASS', "'{0}' cannot be used in both 'extends' and 'implements' clauses");
+  static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS =
+      const CompileTimeErrorCode(
+          'IMPLEMENTS_SUPER_CLASS',
+          "'{0}' cannot be used in both 'extends' and 'implements' clauses");
 
   /**
    * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
@@ -1146,14 +1349,20 @@
    *
    * @param name the name of the type in question
    */
-  static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = const CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', "Only static members can be accessed in initializers");
+  static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER =
+      const CompileTimeErrorCode(
+          'IMPLICIT_THIS_REFERENCE_IN_INITIALIZER',
+          "Only static members can be accessed in initializers");
 
   /**
    * SDK implementation libraries can be imported only by other SDK libraries.
    *
    * @param uri the uri pointing to a library
    */
-  static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode('IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be imported");
+  static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY =
+      const CompileTimeErrorCode(
+          'IMPORT_INTERNAL_LIBRARY',
+          "The library '{0}' is internal and cannot be imported");
 
   /**
    * 14.1 Imports: It is a compile-time error if the specified URI of an
@@ -1162,7 +1371,10 @@
    * @param uri the uri pointing to a non-library declaration
    * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY].
    */
-  static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of directive");
+  static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY =
+      const CompileTimeErrorCode(
+          'IMPORT_OF_NON_LIBRARY',
+          "The imported library '{0}' must not have a part-of directive");
 
   /**
    * 13.9 Switch: It is a compile-time error if values of the expressions
@@ -1173,7 +1385,10 @@
    *        type
    * @param expectedType the name of the expected type
    */
-  static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must have the same types, '{0}' is not a '{1}'");
+  static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES =
+      const CompileTimeErrorCode(
+          'INCONSISTENT_CASE_EXPRESSION_TYPES',
+          "Case expressions must have the same types, '{0}' is not a '{1}'");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -1185,7 +1400,10 @@
    *        variable in the immediately enclosing class
    * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variable in the enclosing class");
+  static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD =
+      const CompileTimeErrorCode(
+          'INITIALIZER_FOR_NON_EXISTENT_FIELD',
+          "'{0}' is not a variable in the enclosing class");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
@@ -1197,7 +1415,10 @@
    *        the immediately enclosing class
    * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
+  static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD =
+      const CompileTimeErrorCode(
+          'INITIALIZER_FOR_STATIC_FIELD',
+          "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -1209,7 +1430,10 @@
    * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD], and
    * [INITIALIZER_FOR_NON_EXISTENT_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variable in the enclosing class");
+  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD =
+      const CompileTimeErrorCode(
+          'INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD',
+          "'{0}' is not a variable in the enclosing class");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -1220,25 +1444,35 @@
    *        the immediately enclosing class
    * See [INITIALIZER_FOR_STATIC_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
+  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD =
+      const CompileTimeErrorCode(
+          'INITIALIZING_FORMAL_FOR_STATIC_FIELD',
+          "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
 
   /**
    * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
    * extraction <b>this</b>.<i>id</i>.
    */
-  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members cannot be accessed from a factory constructor");
+  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY =
+      const CompileTimeErrorCode(
+          'INSTANCE_MEMBER_ACCESS_FROM_FACTORY',
+          "Instance members cannot be accessed from a factory constructor");
 
   /**
    * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
    * extraction <b>this</b>.<i>id</i>.
    */
-  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_STATIC', "Instance members cannot be accessed from a static method");
+  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC =
+      const CompileTimeErrorCode(
+          'INSTANCE_MEMBER_ACCESS_FROM_STATIC',
+          "Instance members cannot be accessed from a static method");
 
   /**
    * Enum proposal: It is also a compile-time error to explicitly instantiate an
    * enum via 'new' or 'const' or to access its private fields.
    */
-  static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCode('INSTANTIATE_ENUM', "Enums cannot be instantiated");
+  static const CompileTimeErrorCode INSTANTIATE_ENUM =
+      const CompileTimeErrorCode('INSTANTIATE_ENUM', "Enums cannot be instantiated");
 
   /**
    * 11 Metadata: Metadata consists of a series of annotations, each of which
@@ -1246,7 +1480,10 @@
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
    */
-  static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorCode('INVALID_ANNOTATION', "Annotation can be only constant variable or constant constructor invocation");
+  static const CompileTimeErrorCode INVALID_ANNOTATION =
+      const CompileTimeErrorCode(
+          'INVALID_ANNOTATION',
+          "Annotation can be only constant variable or constant constructor invocation");
 
   /**
    * 11 Metadata: Metadata consists of a series of annotations, each of which
@@ -1257,26 +1494,38 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as annotations");
+  static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as annotations");
 
   /**
    * 15.31 Identifier Reference: It is a compile-time error if any of the
    * identifiers async, await or yield is used as an identifier in a function
    * body marked with either async, async* or sync*.
    */
-  static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileTimeErrorCode('INVALID_IDENTIFIER_IN_ASYNC', "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
+  static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC =
+      const CompileTimeErrorCode(
+          'INVALID_IDENTIFIER_IN_ASYNC',
+          "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
 
   /**
    * 9. Functions: It is a compile-time error if an async, async* or sync*
    * modifier is attached to the body of a setter or constructor.
    */
-  static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const CompileTimeErrorCode('INVALID_MODIFIER_ON_CONSTRUCTOR', "The modifier '{0}' cannot be applied to the body of a constructor");
+  static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'INVALID_MODIFIER_ON_CONSTRUCTOR',
+          "The modifier '{0}' cannot be applied to the body of a constructor");
 
   /**
    * 9. Functions: It is a compile-time error if an async, async* or sync*
    * modifier is attached to the body of a setter or constructor.
    */
-  static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTimeErrorCode('INVALID_MODIFIER_ON_SETTER', "The modifier '{0}' cannot be applied to the body of a setter");
+  static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER =
+      const CompileTimeErrorCode(
+          'INVALID_MODIFIER_ON_SETTER',
+          "The modifier '{0}' cannot be applied to the body of a setter");
 
   /**
    * TODO(brianwilkerson) Remove this when we have decided on how to report
@@ -1285,19 +1534,26 @@
    *
    * See TODOs in ConstantVisitor
    */
-  static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCode('INVALID_CONSTANT', "Invalid constant value");
+  static const CompileTimeErrorCode INVALID_CONSTANT =
+      const CompileTimeErrorCode('INVALID_CONSTANT', "Invalid constant value");
 
   /**
    * 7.6 Constructors: It is a compile-time error if the name of a constructor
    * is not a constructor name.
    */
-  static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTimeErrorCode('INVALID_CONSTRUCTOR_NAME', "Invalid constructor name");
+  static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME =
+      const CompileTimeErrorCode(
+          'INVALID_CONSTRUCTOR_NAME',
+          "Invalid constructor name");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
    * the immediately enclosing class.
    */
-  static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const CompileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', "The name of the immediately enclosing class expected");
+  static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS =
+      const CompileTimeErrorCode(
+          'INVALID_FACTORY_NAME_NOT_A_CLASS',
+          "The name of the immediately enclosing class expected");
 
   /**
    * 12.10 This: It is a compile-time error if this appears in a top-level
@@ -1305,7 +1561,10 @@
    * method or variable initializer, or in the initializer of an instance
    * variable.
    */
-  static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS', "Invalid reference to 'this' expression");
+  static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS =
+      const CompileTimeErrorCode(
+          'INVALID_REFERENCE_TO_THIS',
+          "Invalid reference to 'this' expression");
 
   /**
    * 12.6 Lists: It is a compile time error if the type argument of a constant
@@ -1313,7 +1572,10 @@
    *
    * @name the name of the type parameter
    */
-  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', "Constant list literals cannot include a type parameter as a type argument, such as '{0}'");
+  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST =
+      const CompileTimeErrorCode(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_LIST',
+          "Constant list literals cannot include a type parameter as a type argument, such as '{0}'");
 
   /**
    * 12.7 Maps: It is a compile time error if the type arguments of a constant
@@ -1321,7 +1583,10 @@
    *
    * @name the name of the type parameter
    */
-  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
+  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP =
+      const CompileTimeErrorCode(
+          'INVALID_TYPE_ARGUMENT_IN_CONST_MAP',
+          "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -1336,7 +1601,8 @@
    * @param uri the URI that is invalid
    * See [URI_DOES_NOT_EXIST].
    */
-  static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'");
+  static const CompileTimeErrorCode INVALID_URI =
+      const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'");
 
   /**
    * 13.13 Break: It is a compile-time error if no such statement
@@ -1349,7 +1615,10 @@
    *
    * @param labelName the name of the unresolvable label
    */
-  static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE', "Cannot reference label '{0}' declared in an outer method");
+  static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE =
+      const CompileTimeErrorCode(
+          'LABEL_IN_OUTER_SCOPE',
+          "Cannot reference label '{0}' declared in an outer method");
 
   /**
    * 13.13 Break: It is a compile-time error if no such statement
@@ -1362,13 +1631,19 @@
    *
    * @param labelName the name of the unresolvable label
    */
-  static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode('LABEL_UNDEFINED', "Cannot reference undefined label '{0}'");
+  static const CompileTimeErrorCode LABEL_UNDEFINED =
+      const CompileTimeErrorCode(
+          'LABEL_UNDEFINED',
+          "Cannot reference undefined label '{0}'");
 
   /**
    * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
    * with the same name as <i>C</i>.
    */
-  static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME', "Class members cannot have the same name as the enclosing class");
+  static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME =
+      const CompileTimeErrorCode(
+          'MEMBER_WITH_CLASS_NAME',
+          "Class members cannot have the same name as the enclosing class");
 
   /**
    * 7.2 Getters: It is a compile-time error if a class has both a getter and a
@@ -1376,17 +1651,26 @@
    *
    * @param name the conflicting name of the getter and method
    */
-  static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const CompileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME', "'{0}' cannot be used to name a method, there is already a getter with the same name");
+  static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME =
+      const CompileTimeErrorCode(
+          'METHOD_AND_GETTER_WITH_SAME_NAME',
+          "'{0}' cannot be used to name a method, there is already a getter with the same name");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant list literal.
    */
-  static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const CompileTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL', "List literals must be prefixed with 'const' when used as a constant expression");
+  static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL =
+      const CompileTimeErrorCode(
+          'MISSING_CONST_IN_LIST_LITERAL',
+          "List literals must be prefixed with 'const' when used as a constant expression");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant map literal.
    */
-  static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const CompileTimeErrorCode('MISSING_CONST_IN_MAP_LITERAL', "Map literals must be prefixed with 'const' when used as a constant expression");
+  static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL =
+      const CompileTimeErrorCode(
+          'MISSING_CONST_IN_MAP_LITERAL',
+          "Map literals must be prefixed with 'const' when used as a constant expression");
 
   /**
    * Enum proposal: It is a static warning if all of the following conditions
@@ -1399,7 +1683,11 @@
    *
    * @param constantName the name of the constant that is missing
    */
-  static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const CompileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH', "Missing case clause for '{0}'", "Add a case clause for the missing constant or add a default clause.");
+  static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH =
+      const CompileTimeErrorCode(
+          'MISSING_ENUM_CONSTANT_IN_SWITCH',
+          "Missing case clause for '{0}'",
+          "Add a case clause for the missing constant or add a default clause.");
 
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin
@@ -1407,7 +1695,10 @@
    *
    * @param typeName the name of the mixin that is invalid
    */
-  static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR', "The class '{0}' cannot be used as a mixin because it declares a constructor");
+  static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'MIXIN_DECLARES_CONSTRUCTOR',
+          "The class '{0}' cannot be used as a mixin because it declares a constructor");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if the with clause of a
@@ -1416,7 +1707,10 @@
    * @param typeName the name of the type that cannot be extended
    * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErrorCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'");
+  static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS =
+      const CompileTimeErrorCode(
+          'MIXIN_DEFERRED_CLASS',
+          "This class cannot mixin the deferred class '{0}'");
 
   /**
    * Not yet in the spec, but consistent with VM behavior.  It is a
@@ -1426,9 +1720,10 @@
    * https://code.google.com/p/dart/issues/detail?id=15101#c4
    */
   static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS =
-      const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS',
+      const CompileTimeErrorCode(
+          'MIXIN_HAS_NO_CONSTRUCTORS',
           "This mixin application is invalid because all of the constructors "
-          "in the base class '{0}' have optional parameters.");
+              "in the base class '{0}' have optional parameters.");
 
   /**
    * 9 Mixins: It is a compile-time error if a mixin is derived from a class
@@ -1436,7 +1731,10 @@
    *
    * @param typeName the name of the mixin that is invalid
    */
-  static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
+  static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT =
+      const CompileTimeErrorCode(
+          'MIXIN_INHERITS_FROM_NOT_OBJECT',
+          "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
 
   /**
    * 12.2 Null: It is a compile-time error for a class to attempt to extend or
@@ -1460,44 +1758,64 @@
    * @param typeName the name of the type that cannot be extended
    * See [IMPLEMENTS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTimeErrorCode('MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'");
+  static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS =
+      const CompileTimeErrorCode(
+          'MIXIN_OF_DISALLOWED_CLASS',
+          "Classes cannot mixin '{0}'");
 
   /**
    * Enum proposal: It is a compile-time error to subclass, mix-in or implement
    * an enum.
    */
-  static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode('MIXIN_OF_ENUM', "Classes cannot mixin an enum");
+  static const CompileTimeErrorCode MIXIN_OF_ENUM =
+      const CompileTimeErrorCode('MIXIN_OF_ENUM', "Classes cannot mixin an enum");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not
    * denote a class or mixin available in the immediately enclosing scope.
    */
-  static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorCode('MIXIN_OF_NON_CLASS', "Classes can only mixin other classes");
+  static const CompileTimeErrorCode MIXIN_OF_NON_CLASS =
+      const CompileTimeErrorCode(
+          'MIXIN_OF_NON_CLASS',
+          "Classes can only mixin other classes");
 
   /**
    * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
    * to super.
    */
-  static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeErrorCode('MIXIN_REFERENCES_SUPER', "The class '{0}' cannot be used as a mixin because it references 'super'");
+  static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER =
+      const CompileTimeErrorCode(
+          'MIXIN_REFERENCES_SUPER',
+          "The class '{0}' cannot be used as a mixin because it references 'super'");
 
   /**
    * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
    * denote a class available in the immediately enclosing scope.
    */
-  static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const CompileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', "Mixin can only be applied to class");
+  static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS =
+      const CompileTimeErrorCode(
+          'MIXIN_WITH_NON_CLASS_SUPERCLASS',
+          "Mixin can only be applied to class");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
    * in which case its only action is to invoke another generative constructor.
    */
-  static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', "Constructor may have at most one 'this' redirection");
+  static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
+      =
+      const CompileTimeErrorCode(
+          'MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS',
+          "Constructor may have at most one 'this' redirection");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor.
    * Then <i>k</i> may include at most one superinitializer in its initializer
    * list or a compile time error occurs.
    */
-  static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileTimeErrorCode('MULTIPLE_SUPER_INITIALIZERS', "Constructor may have at most one 'super' initializer");
+  static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS =
+      const CompileTimeErrorCode(
+          'MULTIPLE_SUPER_INITIALIZERS',
+          "Constructor may have at most one 'super' initializer");
 
   /**
    * 11 Metadata: Metadata consists of a series of annotations, each of which
@@ -1505,7 +1823,10 @@
    * either a reference to a compile-time constant variable, or a call to a
    * constant constructor.
    */
-  static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', "Annotation creation must have arguments");
+  static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS =
+      const CompileTimeErrorCode(
+          'NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS',
+          "Annotation creation must have arguments");
 
   /**
    * 7.6.1 Generative Constructors: If no superinitializer is provided, an
@@ -1517,7 +1838,10 @@
    * does not declare a generative constructor named <i>S</i> (respectively
    * <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', "The class '{0}' does not have a default constructor");
+  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT =
+      const CompileTimeErrorCode(
+          'NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT',
+          "The class '{0}' does not have a default constructor");
 
   /**
    * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
@@ -1528,14 +1852,20 @@
    * does not declare a generative constructor named <i>S</i> (respectively
    * <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', "The class '{0}' does not have a default constructor");
+  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT =
+      const CompileTimeErrorCode(
+          'NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT',
+          "The class '{0}' does not have a default constructor");
 
   /**
    * 13.2 Expression Statements: It is a compile-time error if a non-constant
    * map literal that has no explicit type arguments appears in a place where a
    * statement is expected.
    */
-  static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = const CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', "A non-constant map literal without type arguments cannot be used as an expression statement");
+  static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT =
+      const CompileTimeErrorCode(
+          'NON_CONST_MAP_AS_EXPRESSION_STATEMENT',
+          "A non-constant map literal without type arguments cannot be used as an expression statement");
 
   /**
    * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
@@ -1548,7 +1878,10 @@
    * compile-time error if the expressions <i>e<sub>k</sub></i> are not
    * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_CASE_EXPRESSION',
+          "Case expressions must be constant");
 
   /**
    * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
@@ -1564,13 +1897,20 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as a case expression");
+  static const CompileTimeErrorCode
+      NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as a case expression");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the default value of
    * an optional parameter is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE', "Default values of an optional parameter must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_DEFAULT_VALUE',
+          "Default values of an optional parameter must be constant");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the default value of
@@ -1579,13 +1919,20 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as a default parameter value");
+  static const CompileTimeErrorCode
+      NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as a default parameter value");
 
   /**
    * 12.6 Lists: It is a compile time error if an element of a constant list
    * literal is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT', "'const' lists must have all constant values");
+  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_LIST_ELEMENT',
+          "'const' lists must have all constant values");
 
   /**
    * 12.6 Lists: It is a compile time error if an element of a constant list
@@ -1594,13 +1941,20 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as values in a 'const' list");
+  static const CompileTimeErrorCode
+      NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as values in a 'const' list");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
    * entry in a constant map literal is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY', "The keys in a map must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_KEY',
+          "The keys in a map must be constant");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
@@ -1609,13 +1963,19 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as keys in a map");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as keys in a map");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
    * entry in a constant map literal is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE', "The values in a 'const' map must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_VALUE',
+          "The values in a 'const' map must be constant");
 
   /**
    * 12.7 Maps: It is a compile time error if either a key or a value of an
@@ -1624,7 +1984,11 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as values in a 'const' map");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
+      =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as values in a 'const' map");
 
   /**
    * 11 Metadata: Metadata consists of a series of annotations, each of which
@@ -1635,14 +1999,20 @@
    * "From deferred library" case is covered by
    * [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
    */
-  static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation can use only 'const' constructor");
+  static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_ANNOTATION_CONSTRUCTOR',
+          "Annotation creation can use only 'const' constructor");
 
   /**
    * 7.6.3 Constant Constructors: Any expression that appears within the
    * initializer list of a constant constructor must be a potentially constant
    * expression, or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', "Initializer expressions in constant constructors must be constants");
+  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_VALUE_IN_INITIALIZER',
+          "Initializer expressions in constant constructors must be constants");
 
   /**
    * 7.6.3 Constant Constructors: Any expression that appears within the
@@ -1652,7 +2022,11 @@
    * 12.1 Constants: A qualified reference to a static constant variable that is
    * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as constant initializers");
+  static const CompileTimeErrorCode
+      NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY =
+      const CompileTimeErrorCode(
+          'NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY',
+          "Constant values from a deferred library cannot be used as constant initializers");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
@@ -1664,7 +2038,10 @@
    * @param requiredCount the expected number of required arguments
    * @param argumentCount the actual number of positional arguments given
    */
-  static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const CompileTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, but {1} found");
+  static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
+      const CompileTimeErrorCode(
+          'NOT_ENOUGH_REQUIRED_ARGUMENTS',
+          "{0} required argument(s) expected, but {1} found");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -1673,19 +2050,26 @@
    * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('NON_GENERATIVE_CONSTRUCTOR', "The generative constructor '{0}' expected, but factory found");
+  static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'NON_GENERATIVE_CONSTRUCTOR',
+          "The generative constructor '{0}' expected, but factory found");
 
   /**
    * 7.9 Superclasses: It is a compile-time error to specify an extends clause
    * for class Object.
    */
-  static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "");
+  static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS =
+      const CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "");
 
   /**
    * 7.1.1 Operators: It is a compile-time error to declare an optional
    * parameter in an operator.
    */
-  static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', "Optional parameters are not allowed when defining an operator");
+  static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR =
+      const CompileTimeErrorCode(
+          'OPTIONAL_PARAMETER_IN_OPERATOR',
+          "Optional parameters are not allowed when defining an operator");
 
   /**
    * 14.3 Parts: It is a compile time error if the contents of the URI are not a
@@ -1693,25 +2077,35 @@
    *
    * @param uri the uri pointing to a non-library declaration
    */
-  static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCode('PART_OF_NON_PART', "The included part '{0}' must have a part-of directive");
+  static const CompileTimeErrorCode PART_OF_NON_PART =
+      const CompileTimeErrorCode(
+          'PART_OF_NON_PART',
+          "The included part '{0}' must have a part-of directive");
 
   /**
    * 14.1 Imports: It is a compile-time error if the current library declares a
    * top-level member named <i>p</i>.
    */
-  static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = const CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', "The name '{0}' is already used as an import prefix and cannot be used to name a top-level element");
+  static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER =
+      const CompileTimeErrorCode(
+          'PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER',
+          "The name '{0}' is already used as an import prefix and cannot be used to name a top-level element");
 
   /**
    * 6.2.2 Optional Formals: It is a compile-time error if the name of a named
    * optional parameter begins with an '_' character.
    */
-  static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', "Named optional parameters cannot start with an underscore");
+  static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER =
+      const CompileTimeErrorCode(
+          'PRIVATE_OPTIONAL_PARAMETER',
+          "Named optional parameters cannot start with an underscore");
 
   /**
    * 12.1 Constants: It is a compile-time error if the value of a compile-time
    * constant expression depends on itself.
    */
-  static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', "");
+  static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT =
+      const CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', "");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
@@ -1723,14 +2117,20 @@
    *
    * https://code.google.com/p/dart/issues/detail?id=954
    */
-  static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const CompileTimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT', "Cycle in redirecting generative constructors");
+  static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT =
+      const CompileTimeErrorCode(
+          'RECURSIVE_CONSTRUCTOR_REDIRECT',
+          "Cycle in redirecting generative constructors");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if a redirecting factory
    * constructor redirects to itself, either directly or indirectly via a
    * sequence of redirections.
    */
-  static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTimeErrorCode('RECURSIVE_FACTORY_REDIRECT', "Cycle in redirecting factory constructors");
+  static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT =
+      const CompileTimeErrorCode(
+          'RECURSIVE_FACTORY_REDIRECT',
+          "Cycle in redirecting factory constructors");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1745,7 +2145,10 @@
    * @param className the name of the class that implements itself recursively
    * @param strImplementsPath a string representation of the implements loop
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', "'{0}' cannot be a superinterface of itself: {1}");
+  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE =
+      const CompileTimeErrorCode(
+          'RECURSIVE_INTERFACE_INHERITANCE',
+          "'{0}' cannot be a superinterface of itself: {1}");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1759,7 +2162,11 @@
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', "'{0}' cannot extend itself");
+  static const CompileTimeErrorCode
+      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS =
+      const CompileTimeErrorCode(
+          'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS',
+          "'{0}' cannot extend itself");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1773,7 +2180,11 @@
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', "'{0}' cannot implement itself");
+  static const CompileTimeErrorCode
+      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS =
+      const CompileTimeErrorCode(
+          'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS',
+          "'{0}' cannot implement itself");
 
   /**
    * 7.10 Superinterfaces: It is a compile-time error if the interface of a
@@ -1787,70 +2198,105 @@
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH', "'{0}' cannot use itself as a mixin");
+  static const CompileTimeErrorCode
+      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH =
+      const CompileTimeErrorCode(
+          'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH',
+          "'{0}' cannot use itself as a mixin");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
+  static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' could not be found in '{1}'");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErrorCode('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
+  static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS =
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_NON_CLASS',
+          "The name '{0}' is not a type and cannot be used in a redirected constructor");
 
   /**
    * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
    * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', "Constant factory constructor cannot delegate to a non-constant constructor");
+  static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'REDIRECT_TO_NON_CONST_CONSTRUCTOR',
+          "Constant factory constructor cannot delegate to a non-constant constructor");
 
   /**
    * 7.6.1 Generative constructors: A generative constructor may be
    * <i>redirecting</i>, in which case its only action is to invoke another
    * generative constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
+  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' could not be found in '{1}'");
 
   /**
    * 7.6.1 Generative constructors: A generative constructor may be
    * <i>redirecting</i>, in which case its only action is to invoke another
    * generative constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR', "Generative constructor cannot redirect to a factory constructor");
+  static const CompileTimeErrorCode
+      REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR',
+          "Generative constructor cannot redirect to a factory constructor");
 
   /**
    * 5 Variables: A local variable may only be referenced at a source code
    * location that is after its initializer, if any, is complete, or a
    * compile-time error occurs.
    */
-  static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const CompileTimeErrorCode('REFERENCED_BEFORE_DECLARATION', "Local variables cannot be referenced before they are declared");
+  static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION =
+      const CompileTimeErrorCode(
+          'REFERENCED_BEFORE_DECLARATION',
+          "Local variables cannot be referenced before they are declared");
 
   /**
    * 12.8.1 Rethrow: It is a compile-time error if an expression of the form
    * <i>rethrow;</i> is not enclosed within a on-catch clause.
    */
-  static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErrorCode('RETHROW_OUTSIDE_CATCH', "rethrow must be inside of a catch clause");
+  static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH =
+      const CompileTimeErrorCode(
+          'RETHROW_OUTSIDE_CATCH',
+          "rethrow must be inside of a catch clause");
 
   /**
    * 13.12 Return: It is a compile-time error if a return statement of the form
    * <i>return e;</i> appears in a generative constructor.
    */
-  static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', "Constructors cannot return a value");
+  static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'RETURN_IN_GENERATIVE_CONSTRUCTOR',
+          "Constructors cannot return a value");
 
   /**
    * 13.12 Return: It is a compile-time error if a return statement of the form
    * <i>return e;</i> appears in a generator function.
    */
-  static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeErrorCode('RETURN_IN_GENERATOR', "Cannot return a value from a generator function (one marked with either 'async*' or 'sync*')");
+  static const CompileTimeErrorCode RETURN_IN_GENERATOR =
+      const CompileTimeErrorCode(
+          'RETURN_IN_GENERATOR',
+          "Cannot return a value from a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
    * 14.1 Imports: It is a compile-time error if a prefix used in a deferred
    * import is used in another import clause.
    */
-  static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeErrorCode('SHARED_DEFERRED_PREFIX', "The prefix of a deferred import cannot be used in other import directives");
+  static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX =
+      const CompileTimeErrorCode(
+          'SHARED_DEFERRED_PREFIX',
+          "The prefix of a deferred import cannot be used in other import directives");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -1861,20 +2307,27 @@
    * initializer list, in class Object, in a factory constructor, or in a static
    * method or variable initializer.
    */
-  static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTimeErrorCode('SUPER_IN_INVALID_CONTEXT', "Invalid context for 'super' invocation");
+  static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT =
+      const CompileTimeErrorCode(
+          'SUPER_IN_INVALID_CONTEXT',
+          "Invalid context for 'super' invocation");
 
   /**
    * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
    * in which case its only action is to invoke another generative constructor.
    */
-  static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode('SUPER_IN_REDIRECTING_CONSTRUCTOR', "The redirecting constructor cannot have a 'super' initializer");
+  static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR =
+      const CompileTimeErrorCode(
+          'SUPER_IN_REDIRECTING_CONSTRUCTOR',
+          "The redirecting constructor cannot have a 'super' initializer");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
    * is a compile-time error if a generative constructor of class Object
    * includes a superinitializer.
    */
-  static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', "");
+  static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT =
+      const CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', "");
 
   /**
    * 12.11 Instance Creation: It is a static type warning if any of the type
@@ -1894,19 +2347,26 @@
    * @param boundingTypeName the name of the bounding type
    * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
-  static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const CompileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
+  static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
+      const CompileTimeErrorCode(
+          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS',
+          "'{0}' does not extend '{1}'");
 
   /**
    * 15.3.1 Typedef: Any self reference, either directly, or recursively via
    * another typedef, is a compile time error.
    */
-  static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const CompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Type alias cannot reference itself directly or recursively via another typedef");
+  static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF =
+      const CompileTimeErrorCode(
+          'TYPE_ALIAS_CANNOT_REFERENCE_ITSELF',
+          "Type alias cannot reference itself directly or recursively via another typedef");
 
   /**
    * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
    * accessible in the current scope, optionally followed by type arguments.
    */
-  static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode('UNDEFINED_CLASS', "Undefined class '{0}'");
+  static const CompileTimeErrorCode UNDEFINED_CLASS =
+      const CompileTimeErrorCode('UNDEFINED_CLASS', "Undefined class '{0}'");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -1915,7 +2375,10 @@
    * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', "The class '{0}' does not have a generative constructor '{1}'");
+  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER =
+      const CompileTimeErrorCode(
+          'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER',
+          "The class '{0}' does not have a generative constructor '{1}'");
 
   /**
    * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
@@ -1924,7 +2387,11 @@
    * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', "The class '{0}' does not have a default generative constructor");
+  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
+      =
+      const CompileTimeErrorCode(
+          'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT',
+          "The class '{0}' does not have a default generative constructor");
 
   /**
    * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
@@ -1937,7 +2404,10 @@
    *
    * @param name the name of the requested named parameter
    */
-  static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not defined");
+  static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER =
+      const CompileTimeErrorCode(
+          'UNDEFINED_NAMED_PARAMETER',
+          "The named parameter '{0}' is not defined");
 
   /**
    * 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -1952,7 +2422,10 @@
    * @param uri the URI pointing to a non-existent file
    * See [INVALID_URI].
    */
-  static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
+  static const CompileTimeErrorCode URI_DOES_NOT_EXIST =
+      const CompileTimeErrorCode(
+          'URI_DOES_NOT_EXIST',
+          "Target of URI does not exist: '{0}'");
 
   /**
    * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
@@ -1965,7 +2438,10 @@
    * describes a URI is not a compile-time constant, or if <i>x</i> involves
    * string interpolation.
    */
-  static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeErrorCode('URI_WITH_INTERPOLATION', "URIs cannot use string interpolation");
+  static const CompileTimeErrorCode URI_WITH_INTERPOLATION =
+      const CompileTimeErrorCode(
+          'URI_WITH_INTERPOLATION',
+          "URIs cannot use string interpolation");
 
   /**
    * 7.1.1 Operators: It is a compile-time error if the arity of the
@@ -1981,7 +2457,10 @@
    * @param actualNumberOfParameters the number of parameters found in the
    *        operator declaration
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', "Operator '{0}' should declare exactly {1} parameter(s), but {2} found");
+  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR =
+      const CompileTimeErrorCode(
+          'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR',
+          "Operator '{0}' should declare exactly {1} parameter(s), but {2} found");
 
   /**
    * 7.1.1 Operators: It is a compile time error if the arity of the
@@ -1990,25 +2469,38 @@
    * @param actualNumberOfParameters the number of parameters found in the
    *        operator declaration
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', "Operator '-' should declare 0 or 1 parameter, but {0} found");
+  static const CompileTimeErrorCode
+      WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS =
+      const CompileTimeErrorCode(
+          'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS',
+          "Operator '-' should declare 0 or 1 parameter, but {0} found");
 
   /**
    * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
    * does not include exactly one required formal parameter <i>p</i>.
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', "Setters should declare exactly one required parameter");
+  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER =
+      const CompileTimeErrorCode(
+          'WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER',
+          "Setters should declare exactly one required parameter");
 
   /**
    * ?? Yield: It is a compile-time error if a yield statement appears in a
    * function that is not a generator function.
    */
-  static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileTimeErrorCode('YIELD_EACH_IN_NON_GENERATOR', "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
+  static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR =
+      const CompileTimeErrorCode(
+          'YIELD_EACH_IN_NON_GENERATOR',
+          "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
    * ?? Yield: It is a compile-time error if a yield statement appears in a
    * function that is not a generator function.
    */
-  static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeErrorCode('YIELD_IN_NON_GENERATOR', "Yield statements must be in a generator function (one marked with either 'async*' or 'sync*')");
+  static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR =
+      const CompileTimeErrorCode(
+          'YIELD_IN_NON_GENERATOR',
+          "Yield statements must be in a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -2016,7 +2508,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const CompileTimeErrorCode(String name, String message, [String correction]) : super(name, message, correction);
+  const CompileTimeErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
@@ -2038,6 +2531,11 @@
  */
 abstract class ErrorCode {
   /**
+   * An empty list of error codes.
+   */
+  static const List<ErrorCode> EMPTY_LIST = const <ErrorCode>[];
+
+  /**
    * The name of the error code.
    */
   final String name;
@@ -2056,11 +2554,6 @@
   final String correction;
 
   /**
-   * An empty list of error codes.
-   */
-  static const List<ErrorCode> EMPTY_LIST = const <ErrorCode>[];
-
-  /**
    * Initialize a newly created error code to have the given [name]. The message
    * associated with the error will be created from the given [message]
    * template. The correction associated with the error will be created from the
@@ -2093,7 +2586,8 @@
    * A property whose value is an array of [ExecutableElement] that should
    * be but are not implemented by a concrete class.
    */
-  static const ErrorProperty UNIMPLEMENTED_METHODS = const ErrorProperty('UNIMPLEMENTED_METHODS', 0);
+  static const ErrorProperty UNIMPLEMENTED_METHODS =
+      const ErrorProperty('UNIMPLEMENTED_METHODS', 0);
 
   static const List<ErrorProperty> values = const [UNIMPLEMENTED_METHODS];
 
@@ -2138,13 +2632,30 @@
   Source get source => _source;
 
   /**
+   * Set the source to be used when reporting errors. Setting the source to `null` will cause
+   * the default source to be used.
+   *
+   * @param source the source to be used when reporting errors
+   */
+  void set source(Source source) {
+    this._source = source == null ? _defaultSource : source;
+  }
+
+  /**
    * Creates an error with properties with the given error code and arguments.
    *
    * @param errorCode the error code of the error to be reported
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode, AstNode node, List<Object> arguments) => new AnalysisErrorWithProperties.con2(_source, node.offset, node.length, errorCode, arguments);
+  AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode,
+      AstNode node, List<Object> arguments) =>
+      new AnalysisErrorWithProperties.con2(
+          _source,
+          node.offset,
+          node.length,
+          errorCode,
+          arguments);
 
   /**
    * Report a passed error.
@@ -2162,8 +2673,13 @@
    * @param element the element which name should be used as the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForElement(ErrorCode errorCode, Element element, List<Object> arguments) {
-    reportErrorForOffset(errorCode, element.nameOffset, element.displayName.length, arguments);
+  void reportErrorForElement(ErrorCode errorCode, Element element,
+      List<Object> arguments) {
+    reportErrorForOffset(
+        errorCode,
+        element.nameOffset,
+        element.displayName.length,
+        arguments);
   }
 
   /**
@@ -2177,7 +2693,8 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
+  void reportErrorForNode(ErrorCode errorCode, AstNode node,
+      [List<Object> arguments]) {
     reportErrorForOffset(errorCode, node.offset, node.length, arguments);
   }
 
@@ -2189,8 +2706,10 @@
    * @param length the length of the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+  void reportErrorForOffset(ErrorCode errorCode, int offset, int length,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(_source, offset, length, errorCode, arguments));
   }
 
   /**
@@ -2200,7 +2719,8 @@
    * @param token the token specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
+  void reportErrorForToken(ErrorCode errorCode, Token token,
+      [List<Object> arguments]) {
     reportErrorForOffset(errorCode, token.offset, token.length, arguments);
   }
 
@@ -2217,22 +2737,13 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportTypeErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void reportTypeErrorForNode(ErrorCode errorCode, AstNode node,
+      List<Object> arguments) {
     _convertTypeNames(arguments);
     reportErrorForOffset(errorCode, node.offset, node.length, arguments);
   }
 
   /**
-   * Set the source to be used when reporting errors. Setting the source to `null` will cause
-   * the default source to be used.
-   *
-   * @param source the source to be used when reporting errors
-   */
-  void set source(Source source) {
-    this._source = source == null ? _defaultSource : source;
-  }
-
-  /**
    * Given an array of arguments that is expected to contain two or more types, convert the types
    * into strings by using the display names of the types, unless there are two or more types with
    * the same names, in which case the extended display names of the types will be used in order to
@@ -2278,7 +2789,8 @@
     int count = arguments.length;
     HashSet<String> typeNames = new HashSet<String>();
     for (int i = 0; i < count; i++) {
-      if (arguments[i] is DartType && !typeNames.add((arguments[i] as DartType).displayName)) {
+      if (arguments[i] is DartType &&
+          !typeNames.add((arguments[i] as DartType).displayName)) {
         return true;
       }
     }
@@ -2306,12 +2818,14 @@
    * The severity representing a warning. Warnings can become errors if the `-Werror` command
    * line flag is specified.
    */
-  static const ErrorSeverity WARNING = const ErrorSeverity('WARNING', 2, "W", "warning");
+  static const ErrorSeverity WARNING =
+      const ErrorSeverity('WARNING', 2, "W", "warning");
 
   /**
    * The severity representing an error.
    */
-  static const ErrorSeverity ERROR = const ErrorSeverity('ERROR', 3, "E", "error");
+  static const ErrorSeverity ERROR =
+      const ErrorSeverity('ERROR', 3, "E", "error");
 
   static const List<ErrorSeverity> values = const [NONE, INFO, WARNING, ERROR];
 
@@ -2331,7 +2845,9 @@
    * @param machineCode the name of the severity used when producing machine output
    * @param displayName the name of the severity used when producing readable output
    */
-  const ErrorSeverity(String name, int ordinal, this.machineCode, this.displayName) : super(name, ordinal);
+  const ErrorSeverity(String name, int ordinal, this.machineCode,
+      this.displayName)
+      : super(name, ordinal);
 
   /**
    * Return the severity constant that represents the greatest severity.
@@ -2339,7 +2855,8 @@
    * @param severity the severity being compared against
    * @return the most sever of this or the given severity
    */
-  ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal ? this : severity;
+  ErrorSeverity max(ErrorSeverity severity) =>
+      this.ordinal >= severity.ordinal ? this : severity;
 }
 
 /**
@@ -2361,39 +2878,46 @@
    * Compile-time errors are errors that preclude execution. A compile time error must be reported
    * by a Dart compiler before the erroneous code is executed.
    */
-  static const ErrorType COMPILE_TIME_ERROR = const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
+  static const ErrorType COMPILE_TIME_ERROR =
+      const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
 
   /**
    * Checked mode compile-time errors are errors that preclude execution in checked mode.
    */
-  static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType('CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR);
+  static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR =
+      const ErrorType('CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR);
 
   /**
    * Static warnings are those warnings reported by the static checker. They have no effect on
    * execution. Static warnings must be provided by Dart compilers used during development.
    */
-  static const ErrorType STATIC_WARNING = const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
+  static const ErrorType STATIC_WARNING =
+      const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
 
   /**
    * Many, but not all, static warnings relate to types, in which case they are known as static type
    * warnings.
    */
-  static const ErrorType STATIC_TYPE_WARNING = const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
+  static const ErrorType STATIC_TYPE_WARNING =
+      const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
 
   /**
    * Syntactic errors are errors produced as a result of input that does not conform to the grammar.
    */
-  static const ErrorType SYNTACTIC_ERROR = const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
+  static const ErrorType SYNTACTIC_ERROR =
+      const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
 
   /**
    * Angular specific semantic problems.
    */
-  static const ErrorType ANGULAR = const ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
+  static const ErrorType ANGULAR =
+      const ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
 
   /**
    * Polymer specific semantic problems.
    */
-  static const ErrorType POLYMER = const ErrorType('POLYMER', 8, ErrorSeverity.INFO);
+  static const ErrorType POLYMER =
+      const ErrorType('POLYMER', 8, ErrorSeverity.INFO);
 
   static const List<ErrorType> values = const [
       TODO,
@@ -2416,7 +2940,8 @@
    *
    * @param severity the severity of this type of error
    */
-  const ErrorType(String name, int ordinal, this.severity) : super(name, ordinal);
+  const ErrorType(String name, int ordinal, this.severity)
+      : super(name, ordinal);
 
   String get displayName => name.toLowerCase().replaceAll('_', ' ');
 }
@@ -2434,7 +2959,9 @@
    * @param actualType the name of the actual argument type
    * @param expectedType the name of the expected type
    */
-  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
+  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode(
+      'ARGUMENT_TYPE_NOT_ASSIGNABLE',
+      "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
 
   /**
    * Dead code is code that is never reached, this can happen for instance if a
@@ -2446,7 +2973,9 @@
    * Dead code is code that is never reached. This case covers cases where the
    * user has catch clauses after `catch (e)` or `on Object catch (e)`.
    */
-  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode('DEAD_CODE_CATCH_FOLLOWING_CATCH', "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
+  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode(
+      'DEAD_CODE_CATCH_FOLLOWING_CATCH',
+      "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
 
   /**
    * Dead code is code that is never reached. This case covers cases where the
@@ -2456,49 +2985,66 @@
    * @param subtypeName name of the subtype
    * @param supertypeName name of the supertype
    */
-  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode('DEAD_CODE_ON_CATCH_SUBTYPE', "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'");
+  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode(
+      'DEAD_CODE_ON_CATCH_SUBTYPE',
+      "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'");
 
   /**
    * Deprecated members should not be invoked or used.
    *
    * @param memberName the name of the member
    */
-  static const HintCode DEPRECATED_MEMBER_USE = const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated");
+  static const HintCode DEPRECATED_MEMBER_USE =
+      const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated");
 
   /**
    * Duplicate imports.
    */
-  static const HintCode DUPLICATE_IMPORT = const HintCode('DUPLICATE_IMPORT', "Duplicate import");
+  static const HintCode DUPLICATE_IMPORT =
+      const HintCode('DUPLICATE_IMPORT', "Duplicate import");
 
   /**
    * Hint to use the ~/ operator.
    */
-  static const HintCode DIVISION_OPTIMIZATION = const HintCode('DIVISION_OPTIMIZATION', "The operator x ~/ y is more efficient than (x / y).toInt()");
+  static const HintCode DIVISION_OPTIMIZATION = const HintCode(
+      'DIVISION_OPTIMIZATION',
+      "The operator x ~/ y is more efficient than (x / y).toInt()");
 
   /**
    * Hint for the `x is double` type checks.
    */
-  static const HintCode IS_DOUBLE = const HintCode('IS_DOUBLE', "When compiled to JS, this test might return true when the left hand side is an int");
+  static const HintCode IS_DOUBLE = const HintCode(
+      'IS_DOUBLE',
+      "When compiled to JS, this test might return true when the left hand side is an int");
 
   /**
    * Hint for the `x is int` type checks.
    */
-  static const HintCode IS_INT = const HintCode('IS_INT', "When compiled to JS, this test might return true when the left hand side is a double");
+  static const HintCode IS_INT = const HintCode(
+      'IS_INT',
+      "When compiled to JS, this test might return true when the left hand side is a double");
 
   /**
    * Hint for the `x is! double` type checks.
    */
-  static const HintCode IS_NOT_DOUBLE = const HintCode('IS_NOT_DOUBLE', "When compiled to JS, this test might return false when the left hand side is an int");
+  static const HintCode IS_NOT_DOUBLE = const HintCode(
+      'IS_NOT_DOUBLE',
+      "When compiled to JS, this test might return false when the left hand side is an int");
 
   /**
    * Hint for the `x is! int` type checks.
    */
-  static const HintCode IS_NOT_INT = const HintCode('IS_NOT_INT', "When compiled to JS, this test might return false when the left hand side is a double");
+  static const HintCode IS_NOT_INT = const HintCode(
+      'IS_NOT_INT',
+      "When compiled to JS, this test might return false when the left hand side is a double");
 
   /**
    * Deferred libraries shouldn't define a top level function 'loadLibrary'.
    */
-  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintCode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
+  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION =
+      const HintCode(
+          'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION',
+          "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
 
   /**
    * This hint is generated anywhere where the
@@ -2507,9 +3053,10 @@
    *
    * @param rhsTypeName the name of the right hand side type
    * @param lhsTypeName the name of the left hand side type
-   * See [StaticTypeWarningCode.INVALID_ASSIGNMENT].
    */
-  static const HintCode INVALID_ASSIGNMENT = const HintCode('INVALID_ASSIGNMENT', "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
+  static const HintCode INVALID_ASSIGNMENT = const HintCode(
+      'INVALID_ASSIGNMENT',
+      "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
 
   /**
    * Generate a hint for methods or functions that have a return type, but do
@@ -2519,39 +3066,54 @@
    *
    * @param returnType the name of the declared return type
    */
-  static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN', "This function declares a return type of '{0}', but does not end with a return statement", "Either add a return statement or change the return type to 'void'");
+  static const HintCode MISSING_RETURN = const HintCode(
+      'MISSING_RETURN',
+      "This function declares a return type of '{0}', but does not end with a return statement",
+      "Either add a return statement or change the return type to 'void'");
 
   /**
    * A getter with the override annotation does not override an existing getter.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode('OVERRIDE_ON_NON_OVERRIDING_GETTER', "Getter does not override an inherited getter");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_GETTER',
+      "Getter does not override an inherited getter");
 
   /**
    * A method with the override annotation does not override an existing method.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode('OVERRIDE_ON_NON_OVERRIDING_METHOD', "Method does not override an inherited method");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_METHOD',
+      "Method does not override an inherited method");
 
   /**
    * A setter with the override annotation does not override an existing setter.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode('OVERRIDE_ON_NON_OVERRIDING_SETTER', "Setter does not override an inherited setter");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode(
+      'OVERRIDE_ON_NON_OVERRIDING_SETTER',
+      "Setter does not override an inherited setter");
 
   /**
    * Hint for classes that override equals, but not hashCode.
    *
    * @param className the name of the current class
    */
-  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', "The class '{0}' overrides 'operator==', but not 'get hashCode'");
+  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode(
+      'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE',
+      "The class '{0}' overrides 'operator==', but not 'get hashCode'");
 
   /**
    * Type checks of the type `x is! Null` should be done with `x != null`.
    */
-  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode('TYPE_CHECK_IS_NOT_NULL', "Tests for non-null should be done with '!= null'");
+  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode(
+      'TYPE_CHECK_IS_NOT_NULL',
+      "Tests for non-null should be done with '!= null'");
 
   /**
    * Type checks of the type `x is Null` should be done with `x == null`.
    */
-  static const HintCode TYPE_CHECK_IS_NULL = const HintCode('TYPE_CHECK_IS_NULL', "Tests for null should be done with '== null'");
+  static const HintCode TYPE_CHECK_IS_NULL = const HintCode(
+      'TYPE_CHECK_IS_NULL',
+      "Tests for null should be done with '== null'");
 
   /**
    * This hint is generated anywhere where the
@@ -2562,10 +3124,10 @@
    * @param getterName the name of the getter
    * @param enclosingType the name of the enclosing type where the getter is
    *        being looked for
-   * See [StaticTypeWarningCode.UNDEFINED_GETTER], and
-   * [StaticWarningCode.UNDEFINED_GETTER].
    */
-  static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
+  static const HintCode UNDEFINED_GETTER = const HintCode(
+      'UNDEFINED_GETTER',
+      "The getter '{0}' is not defined for the class '{1}'");
 
   /**
    * This hint is generated anywhere where the
@@ -2575,9 +3137,10 @@
    * @param methodName the name of the method that is undefined
    * @param typeName the resolved type name that the method lookup is happening
    *        on
-   * See [StaticTypeWarningCode.UNDEFINED_METHOD].
    */
-  static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', "The method '{0}' is not defined for the class '{1}'");
+  static const HintCode UNDEFINED_METHOD = const HintCode(
+      'UNDEFINED_METHOD',
+      "The method '{0}' is not defined for the class '{1}'");
 
   /**
    * This hint is generated anywhere where the
@@ -2587,9 +3150,10 @@
    * @param operator the name of the operator
    * @param enclosingType the name of the enclosing type where the operator is
    *        being looked for
-   * See [StaticTypeWarningCode.UNDEFINED_OPERATOR].
    */
-  static const HintCode UNDEFINED_OPERATOR = const HintCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'");
+  static const HintCode UNDEFINED_OPERATOR = const HintCode(
+      'UNDEFINED_OPERATOR',
+      "The operator '{0}' is not defined for the class '{1}'");
 
   /**
    * This hint is generated anywhere where the
@@ -2600,40 +3164,55 @@
    * @param setterName the name of the setter
    * @param enclosingType the name of the enclosing type where the setter is
    *        being looked for
-   * See [StaticTypeWarningCode.UNDEFINED_SETTER], and
-   * [StaticWarningCode.UNDEFINED_SETTER].
    */
-  static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
+  static const HintCode UNDEFINED_SETTER = const HintCode(
+      'UNDEFINED_SETTER',
+      "The setter '{0}' is not defined for the class '{1}'");
 
   /**
    * Unnecessary cast.
    */
-  static const HintCode UNNECESSARY_CAST = const HintCode('UNNECESSARY_CAST', "Unnecessary cast");
+  static const HintCode UNNECESSARY_CAST =
+      const HintCode('UNNECESSARY_CAST', "Unnecessary cast");
 
   /**
    * Unnecessary type checks, the result is always true.
    */
-  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode('UNNECESSARY_TYPE_CHECK_FALSE', "Unnecessary type check, the result is always false");
+  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode(
+      'UNNECESSARY_TYPE_CHECK_FALSE',
+      "Unnecessary type check, the result is always false");
 
   /**
    * Unnecessary type checks, the result is always false.
    */
-  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode('UNNECESSARY_TYPE_CHECK_TRUE', "Unnecessary type check, the result is always true");
+  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode(
+      'UNNECESSARY_TYPE_CHECK_TRUE',
+      "Unnecessary type check, the result is always true");
 
   /**
    * See [Modifier.IS_USED_IN_LIBRARY].
    */
-  static const HintCode UNUSED_ELEMENT = const HintCode('UNUSED_ELEMENT', "The {0} '{1}' is not used");
+  static const HintCode UNUSED_ELEMENT =
+      const HintCode('UNUSED_ELEMENT', "The {0} '{1}' is not used");
+
+  /**
+   * Unused fields are fields which are never read.
+   */
+  static const HintCode UNUSED_FIELD =
+      const HintCode('UNUSED_FIELD', "The value of the field '{0}' is not used");
 
   /**
    * Unused imports are imports which are never used.
    */
-  static const HintCode UNUSED_IMPORT = const HintCode('UNUSED_IMPORT', "Unused import");
+  static const HintCode UNUSED_IMPORT =
+      const HintCode('UNUSED_IMPORT', "Unused import");
 
   /**
    * Unused local variables are local varaibles which are never read.
    */
-  static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode('UNUSED_LOCAL_VARIABLE', "The value of the local variable '{0}' is not used");
+  static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode(
+      'UNUSED_LOCAL_VARIABLE',
+      "The value of the local variable '{0}' is not used");
 
   /**
    * Hint for cases where the source expects a method or function to return a
@@ -2641,7 +3220,9 @@
    *
    * @param name the name of the method or function that returns void
    */
-  static const HintCode USE_OF_VOID_RESULT = const HintCode('USE_OF_VOID_RESULT', "The result of '{0}' is being used, even though it is declared to be 'void'");
+  static const HintCode USE_OF_VOID_RESULT = const HintCode(
+      'USE_OF_VOID_RESULT',
+      "The result of '{0}' is being used, even though it is declared to be 'void'");
 
   /**
    * It is a bad practice for a source file in a package "lib" directory
@@ -2650,7 +3231,10 @@
    * `import '../web/some.dart'` which references a file outside the lib
    * directory.
    */
-  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const HintCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
+  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE =
+      const HintCode(
+          'FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE',
+          "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
 
   /**
    * It is a bad practice for a source file ouside a package "lib" directory
@@ -2659,7 +3243,10 @@
    * `import '../lib/some.dart'` which references a file inside the lib
    * directory.
    */
-  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const HintCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
+  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE =
+      const HintCode(
+          'FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE',
+          "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
 
   /**
    * It is a bad practice for a package import to reference anything outside the
@@ -2667,7 +3254,9 @@
    * to contain a "..". For example, a source file should not contain a
    * directive such as `import 'package:foo/../some.dart'`.
    */
-  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode('PACKAGE_IMPORT_CONTAINS_DOT_DOT', "A package import should not contain '..'");
+  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode(
+      'PACKAGE_IMPORT_CONTAINS_DOT_DOT',
+      "A package import should not contain '..'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -2675,7 +3264,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const HintCode(String name, String message, [String correction]) : super(name, message, correction);
+  const HintCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
@@ -2698,7 +3288,8 @@
    *
    * @param uri the URI that is invalid
    */
-  static const HtmlWarningCode INVALID_URI = const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'");
+  static const HtmlWarningCode INVALID_URI =
+      const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'");
 
   /**
    * An error code indicating that the value of the 'src' attribute of a Dart
@@ -2706,7 +3297,9 @@
    *
    * @param uri the URI pointing to a non-existent file
    */
-  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
+  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode(
+      'URI_DOES_NOT_EXIST',
+      "Target of URI does not exist: '{0}'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -2714,7 +3307,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const HtmlWarningCode(String name, String message, [String correction]) : super(name, message, correction);
+  const HtmlWarningCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
@@ -2727,19 +3321,33 @@
  * The enumeration `PolymerCode` defines Polymer specific problems.
  */
 class PolymerCode extends ErrorCode {
-  static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('ATTRIBUTE_FIELD_NOT_PUBLISHED', "Field '{0}' in '{1}' must be @published");
+  static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode(
+      'ATTRIBUTE_FIELD_NOT_PUBLISHED',
+      "Field '{0}' in '{1}' must be @published");
 
-  static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('DUPLICATE_ATTRIBUTE_DEFINITION', "The attribute '{0}' is already defined");
+  static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode(
+      'DUPLICATE_ATTRIBUTE_DEFINITION',
+      "The attribute '{0}' is already defined");
 
-  static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTES', "Empty 'attributes' attribute is useless");
+  static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode(
+      'EMPTY_ATTRIBUTES',
+      "Empty 'attributes' attribute is useless");
 
-  static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_ATTRIBUTE_NAME', "'{0}' is not a valid name for a custom element attribute");
+  static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode(
+      'INVALID_ATTRIBUTE_NAME',
+      "'{0}' is not a valid name for a custom element attribute");
 
-  static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAME', "'{0}' is not a valid name for a custom element");
+  static const PolymerCode INVALID_TAG_NAME = const PolymerCode(
+      'INVALID_TAG_NAME',
+      "'{0}' is not a valid name for a custom element");
 
-  static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAME', "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'");
+  static const PolymerCode MISSING_TAG_NAME = const PolymerCode(
+      'MISSING_TAG_NAME',
+      "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'");
 
-  static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFINED_ATTRIBUTE_FIELD', "There is no such field '{0}' in '{1}'");
+  static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode(
+      'UNDEFINED_ATTRIBUTE_FIELD',
+      "There is no such field '{0}' in '{1}'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -2747,7 +3355,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const PolymerCode(String name, String message, [String correction]) : super(name, message, correction);
+  const PolymerCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
@@ -2770,7 +3379,10 @@
    *
    * @param numTypeArgument the number of provided type arguments
    */
-  static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', "List literal requires exactly one type arguments or none, but {0} found");
+  static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS =
+      const StaticTypeWarningCode(
+          'EXPECTED_ONE_LIST_TYPE_ARGUMENTS',
+          "List literal requires exactly one type arguments or none, but {0} found");
 
   /**
    * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
@@ -2778,7 +3390,10 @@
    *
    * @param numTypeArgument the number of provided type arguments
    */
-  static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literal requires exactly two type arguments or none, but {0} found");
+  static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS =
+      const StaticTypeWarningCode(
+          'EXPECTED_TWO_MAP_TYPE_ARGUMENTS',
+          "Map literal requires exactly two type arguments or none, but {0} found");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
@@ -2787,7 +3402,8 @@
    *
    * See [UNDEFINED_SETTER].
    */
-  static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarningCode('INACCESSIBLE_SETTER', "");
+  static const StaticTypeWarningCode INACCESSIBLE_SETTER =
+      const StaticTypeWarningCode('INACCESSIBLE_SETTER', "");
 
   /**
    * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
@@ -2817,7 +3433,10 @@
    * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;,
    *   m<sub>k</sub></i> is inherited.
    */
-  static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
+  static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE =
+      const StaticTypeWarningCode(
+          'INCONSISTENT_METHOD_INHERITANCE',
+          "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
 
   /**
    * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
@@ -2826,7 +3445,10 @@
    * @param memberName the name of the static member
    * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
    */
-  static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', "Static member '{0}' cannot be accessed using instance access");
+  static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER =
+      const StaticTypeWarningCode(
+          'INSTANCE_ACCESS_TO_STATIC_MEMBER',
+          "Static member '{0}' cannot be accessed using instance access");
 
   /**
    * 12.18 Assignment: It is a static type warning if the static type of
@@ -2844,7 +3466,10 @@
    * @param rhsTypeName the name of the right hand side type
    * @param lhsTypeName the name of the left hand side type
    */
-  static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarningCode('INVALID_ASSIGNMENT', "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
+  static const StaticTypeWarningCode INVALID_ASSIGNMENT =
+      const StaticTypeWarningCode(
+          'INVALID_ASSIGNMENT',
+          "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
 
   /**
    * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
@@ -2870,7 +3495,10 @@
    * @param nonFunctionIdentifier the name of the identifier that is not a
    *        function type
    */
-  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method");
+  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION =
+      const StaticTypeWarningCode(
+          'INVOCATION_OF_NON_FUNCTION',
+          "'{0}' is not a method");
 
   /**
    * 12.14.4 Function Expression Invocation: A function expression invocation
@@ -2881,7 +3509,10 @@
    * It is a static type warning if the static type <i>F</i> of
    * <i>e<sub>f</sub></i> may not be assigned to a function type.
    */
-  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION', "Cannot invoke a non-function");
+  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION =
+      const StaticTypeWarningCode(
+          'INVOCATION_OF_NON_FUNCTION_EXPRESSION',
+          "Cannot invoke a non-function");
 
   /**
    * 12.20 Conditional: It is a static type warning if the type of
@@ -2896,13 +3527,19 @@
    * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be
    * assigned to bool.
    */
-  static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarningCode('NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'");
+  static const StaticTypeWarningCode NON_BOOL_CONDITION =
+      const StaticTypeWarningCode(
+          'NON_BOOL_CONDITION',
+          "Conditions must have a static type of 'bool'");
 
   /**
    * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not
    * be assigned to either bool or () &rarr; bool
    */
-  static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarningCode('NON_BOOL_EXPRESSION', "Assertions must be on either a 'bool' or '() -> bool'");
+  static const StaticTypeWarningCode NON_BOOL_EXPRESSION =
+      const StaticTypeWarningCode(
+          'NON_BOOL_EXPRESSION',
+          "Assertions must be on either a 'bool' or '() -> bool'");
 
   /**
    * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the
@@ -2911,7 +3548,10 @@
    * 12.20 Conditional: It is a static type warning if the type of
    * <i>e<sub>1</sub></i> may not be assigned to bool.
    */
-  static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', "Negation argument must have a static type of 'bool'");
+  static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION =
+      const StaticTypeWarningCode(
+          'NON_BOOL_NEGATION_EXPRESSION',
+          "Negation argument must have a static type of 'bool'");
 
   /**
    * 12.21 Logical Boolean Expressions: It is a static type warning if the
@@ -2920,13 +3560,19 @@
    *
    * @param operator the lexeme of the logical operator
    */
-  static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningCode('NON_BOOL_OPERAND', "The operands of the '{0}' operator must be assignable to 'bool'");
+  static const StaticTypeWarningCode NON_BOOL_OPERAND =
+      const StaticTypeWarningCode(
+          'NON_BOOL_OPERAND',
+          "The operands of the '{0}' operator must be assignable to 'bool'");
 
   /**
    * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
    * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope.
    */
-  static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', "The name '{0}' is not a type and cannot be used as a parameterized type");
+  static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT =
+      const StaticTypeWarningCode(
+          'NON_TYPE_AS_TYPE_ARGUMENT',
+          "The name '{0}' is not a type and cannot be used as a parameterized type");
 
   /**
    * 13.11 Return: It is a static type warning if the type of <i>e</i> may not
@@ -2937,7 +3583,10 @@
    * @param expectedReturnType the expected return type as defined by the method
    * @param methodName the name of the method
    */
-  static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', "The return type '{0}' is not a '{1}', as defined by the method '{2}'");
+  static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE =
+      const StaticTypeWarningCode(
+          'RETURN_OF_INVALID_TYPE',
+          "The return type '{0}' is not a '{1}', as defined by the method '{2}'");
 
   /**
    * 12.11 Instance Creation: It is a static type warning if any of the type
@@ -2966,7 +3615,10 @@
    * @param boundingTypeName the name of the bounding type
    * See [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND].
    */
-  static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const StaticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
+  static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
+      const StaticTypeWarningCode(
+          'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS',
+          "'{0}' does not extend '{1}'");
 
   /**
    * 10 Generics: It is a static type warning if a type parameter is a supertype
@@ -2975,7 +3627,10 @@
    * @param typeParameterName the name of the type parameter
    * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
-  static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = const StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' cannot be a supertype of its upper bound");
+  static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND =
+      const StaticTypeWarningCode(
+          'TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND',
+          "'{0}' cannot be a supertype of its upper bound");
 
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class
@@ -2986,7 +3641,10 @@
    *        defined
    * @param enumName the name of the enumeration used to access the constant
    */
-  static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', "There is no constant named '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT =
+      const StaticTypeWarningCode(
+          'UNDEFINED_ENUM_CONSTANT',
+          "There is no constant named '{0}' in '{1}'");
 
   /**
    * 12.15.3 Unqualified Invocation: If there exists a lexically visible
@@ -2999,7 +3657,10 @@
    *
    * @param methodName the name of the method that is undefined
    */
-  static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarningCode('UNDEFINED_FUNCTION', "The function '{0}' is not defined");
+  static const StaticTypeWarningCode UNDEFINED_FUNCTION =
+      const StaticTypeWarningCode(
+          'UNDEFINED_FUNCTION',
+          "The function '{0}' is not defined");
 
   /**
    * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
@@ -3009,7 +3670,10 @@
    * @param enclosingType the name of the enclosing type where the getter is
    *        being looked for
    */
-  static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_GETTER =
+      const StaticTypeWarningCode(
+          'UNDEFINED_GETTER',
+          "The getter '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
@@ -3020,7 +3684,10 @@
    * @param typeName the resolved type name that the method lookup is happening
    *        on
    */
-  static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningCode('UNDEFINED_METHOD', "The method '{0}' is not defined for the class '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_METHOD =
+      const StaticTypeWarningCode(
+          'UNDEFINED_METHOD',
+          "The method '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.18 Assignment: Evaluation of an assignment of the form
@@ -3042,7 +3709,10 @@
    * @param enclosingType the name of the enclosing type where the operator is
    *        being looked for
    */
-  static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarningCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_OPERATOR =
+      const StaticTypeWarningCode(
+          'UNDEFINED_OPERATOR',
+          "The operator '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
@@ -3054,7 +3724,23 @@
    *        being looked for
    * See [INACCESSIBLE_SETTER].
    */
-  static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_SETTER =
+      const StaticTypeWarningCode(
+          'UNDEFINED_SETTER',
+          "The setter '{0}' is not defined for the class '{1}'");
+
+  /**
+   * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
+   * a static type warning if <i>T</i> does not have a getter named <i>m</i>.
+   *
+   * @param getterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the getter is
+   *        being looked for
+   */
+  static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER =
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_GETTER',
+          "The getter '{0}' is not defined in a superclass of '{1}'");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -3067,7 +3753,50 @@
    * @param typeName the resolved type name that the method lookup is happening
    *        on
    */
-  static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', "There is no such method '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD =
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_METHOD',
+          "The method '{0}' is not defined in a superclass of '{1}'");
+
+  /**
+   * 12.18 Assignment: Evaluation of an assignment of the form
+   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
+   * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
+   * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
+   * <i>e<sub>2</sub></i>).
+   *
+   * 12.29 Assignable Expressions: An assignable expression of the form
+   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
+   * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
+   * <i>e<sub>2</sub></i>.
+   *
+   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance member named <i>m</i>.
+   *
+   * @param operator the name of the operator
+   * @param enclosingType the name of the enclosing type where the operator is
+   *        being looked for
+   */
+  static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR =
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_OPERATOR',
+          "The operator '{0}' is not defined in a superclass of '{1}'");
+
+  /**
+   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance setter named <i>v=</i>.
+   *
+   * @param setterName the name of the setter
+   * @param enclosingType the name of the enclosing type where the setter is
+   *        being looked for
+   * See [INACCESSIBLE_SETTER].
+   */
+  static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER =
+      const StaticTypeWarningCode(
+          'UNDEFINED_SUPER_SETTER',
+          "The setter '{0}' is not defined in a superclass of '{1}'");
 
   /**
    * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
@@ -3077,7 +3806,11 @@
    * when we are able to find the name defined in a supertype. It exists to
    * provide a more informative error message.
    */
-  static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', "Static members from supertypes must be qualified by the name of the defining type");
+  static const StaticTypeWarningCode
+      UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER =
+      const StaticTypeWarningCode(
+          'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER',
+          "Static members from supertypes must be qualified by the name of the defining type");
 
   /**
    * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
@@ -3089,7 +3822,10 @@
    * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
    * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
    */
-  static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+  static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS =
+      const StaticTypeWarningCode(
+          'WRONG_NUMBER_OF_TYPE_ARGUMENTS',
+          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -3097,7 +3833,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const StaticTypeWarningCode(String name, String message, [String correction]) : super(name, message, correction);
+  const StaticTypeWarningCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
@@ -3129,7 +3866,9 @@
    * @param secondLibraryName the name of the second library that the type is
    *        found
    */
-  static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode('AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}");
+  static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode(
+      'AMBIGUOUS_IMPORT',
+      "The name '{0}' is defined in the libraries {1}");
 
   /**
    * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
@@ -3159,7 +3898,10 @@
    * @param actualType the name of the actual argument type
    * @param expectedType the name of the expected type
    */
-  static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
+  static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'ARGUMENT_TYPE_NOT_ASSIGNABLE',
+          "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
@@ -3168,21 +3910,28 @@
    *
    * A constant variable is always implicitly final.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode('ASSIGNMENT_TO_CONST', "Constant variables cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode(
+      'ASSIGNMENT_TO_CONST',
+      "Constant variables cannot be assigned a value");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
    * a NoSuchMethodError to be thrown, because no setter is defined for it. The
    * assignment will also give rise to a static warning for the same reason.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode('ASSIGNMENT_TO_FINAL', "'{0}' cannot be used as a setter, it is final");
+  static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode(
+      'ASSIGNMENT_TO_FINAL',
+      "'{0}' cannot be used as a setter, it is final");
 
   /**
    * 5 Variables: Attempting to assign to a final variable elsewhere will cause
    * a NoSuchMethodError to be thrown, because no setter is defined for it. The
    * assignment will also give rise to a static warning for the same reason.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWarningCode('ASSIGNMENT_TO_FINAL_NO_SETTER', "No setter named '{0}' in class '{1}'");
+  static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER =
+      const StaticWarningCode(
+          'ASSIGNMENT_TO_FINAL_NO_SETTER',
+          "No setter named '{0}' in class '{1}'");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -3191,33 +3940,46 @@
    * local variable declaration with name <i>v</i> nor setter declaration with
    * name <i>v=</i> in the lexical scope enclosing the assignment.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCode('ASSIGNMENT_TO_FUNCTION', "Functions cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_FUNCTION =
+      const StaticWarningCode(
+          'ASSIGNMENT_TO_FUNCTION',
+          "Functions cannot be assigned a value");
 
   /**
    * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>
    * It is a static type warning if <i>T</i> does not have an accessible
    * instance setter named <i>v=</i>.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode('ASSIGNMENT_TO_METHOD', "Methods cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode(
+      'ASSIGNMENT_TO_METHOD',
+      "Methods cannot be assigned a value");
 
   /**
    * 13.9 Switch: It is a static warning if the last statement of the statement
    * sequence <i>s<sub>k</sub></i> is not a break, continue, return or throw
    * statement.
    */
-  static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarningCode('CASE_BLOCK_NOT_TERMINATED', "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
+  static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED =
+      const StaticWarningCode(
+          'CASE_BLOCK_NOT_TERMINATED',
+          "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
 
   /**
    * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
    * available in the current lexical scope.
    */
-  static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode('CAST_TO_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'as' expression");
+  static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode(
+      'CAST_TO_NON_TYPE',
+      "The name '{0}' is not a type and cannot be used in an 'as' expression");
 
   /**
    * 7.4 Abstract Instance Members: It is a static warning if an abstract member
    * is declared or inherited in a concrete class.
    */
-  static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const StaticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' is not abstract");
+  static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER =
+      const StaticWarningCode(
+          'CONCRETE_CLASS_WITH_ABSTRACT_MEMBER',
+          "'{0}' must have a method body because '{1}' is not abstract");
 
   /**
    * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
@@ -3233,7 +3995,10 @@
    * @param otherLibraryName the name of the non-dart: library that the element
    *        is found
    */
-  static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCode('CONFLICTING_DART_IMPORT', "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
+  static const StaticWarningCode CONFLICTING_DART_IMPORT =
+      const StaticWarningCode(
+          'CONFLICTING_DART_IMPORT',
+          "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
 
   /**
    * 7.2 Getters: It is a static warning if a class <i>C</i> declares an
@@ -3242,19 +4007,29 @@
    *
    * @param superName the name of the super class declaring a static member
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', "Superclass '{0}' declares static member with the same name");
+  static const StaticWarningCode
+      CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER =
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER',
+          "Superclass '{0}' declares static member with the same name");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
    * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER', "Class '{0}' declares instance method '{1}', but also has a setter with the same name from '{2}'");
+  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER =
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_METHOD_SETTER',
+          "Class '{0}' declares instance method '{1}', but also has a setter with the same name from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
    * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2', "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
+  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 =
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_METHOD_SETTER2',
+          "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
 
   /**
    * 7.3 Setters: It is a static warning if a class <i>C</i> declares an
@@ -3263,19 +4038,29 @@
    *
    * @param superName the name of the super class declaring a static member
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', "Superclass '{0}' declares static member with the same name");
+  static const StaticWarningCode
+      CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER =
+      const StaticWarningCode(
+          'CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER',
+          "Superclass '{0}' declares static member with the same name");
 
   /**
    * 7.2 Getters: It is a static warning if a class declares a static getter
    * named <i>v</i> and also has a non-static setter named <i>v=</i>.
    */
-  static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', "Class '{0}' declares non-static setter with the same name");
+  static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
+      const StaticWarningCode(
+          'CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER',
+          "Class '{0}' declares non-static setter with the same name");
 
   /**
    * 7.3 Setters: It is a static warning if a class declares a static setter
    * named <i>v=</i> and also has a non-static member named <i>v</i>.
    */
-  static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', "Class '{0}' declares non-static member with the same name");
+  static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
+      const StaticWarningCode(
+          'CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER',
+          "Class '{0}' declares non-static member with the same name");
 
   /**
    * 12.11.2 Const: Given an instance creation expression of the form <i>const
@@ -3283,13 +4068,17 @@
    * <i>q</i> is the constructor of an abstract class but <i>q</i> is not a
    * factory constructor.
    */
-  static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarningCode('CONST_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'const' expression");
+  static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS =
+      const StaticWarningCode(
+          'CONST_WITH_ABSTRACT_CLASS',
+          "Abstract classes cannot be created with a 'const' expression");
 
   /**
    * 12.7 Maps: It is a static warning if the values of any two keys in a map
    * literal are equal.
    */
-  static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode('EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
+  static const StaticWarningCode EQUAL_KEYS_IN_MAP =
+      const StaticWarningCode('EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
 
   /**
    * 14.2 Exports: It is a static warning to export two different libraries with
@@ -3299,8 +4088,8 @@
    * @param uri2 the uri pointing to a second library
    * @param name the shared name of the exported libraries
    */
-  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED
-      = const StaticWarningCode(
+  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED =
+      const StaticWarningCode(
           'EXPORT_DUPLICATED_LIBRARY_NAMED',
           "The exported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
@@ -3311,8 +4100,8 @@
    * @param uri1 the uri pointing to a first library
    * @param uri2 the uri pointing to a second library
    */
-  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED
-      = const StaticWarningCode(
+  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED =
+      const StaticWarningCode(
           'EXPORT_DUPLICATED_LIBRARY_UNNAMED',
           "The exported libraries '{0}' and '{1}' cannot both be unnamed");
 
@@ -3324,14 +4113,21 @@
    * @param argumentCount the actual number of positional arguments given
    * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
    */
-  static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarningCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found");
+  static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS =
+      const StaticWarningCode(
+          'EXTRA_POSITIONAL_ARGUMENTS',
+          "{0} positional arguments expected, but {1} found");
 
   /**
    * 5. Variables: It is a static warning if a final instance variable that has
    * been initialized at its point of declaration is also initialized in a
    * constructor.
    */
-  static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = const StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', "Values cannot be set in the constructor if they are final, and have already been set");
+  static const StaticWarningCode
+      FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION =
+      const StaticWarningCode(
+          'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION',
+          "Values cannot be set in the constructor if they are final, and have already been set");
 
   /**
    * 5. Variables: It is a static warning if a final instance variable that has
@@ -3340,7 +4136,11 @@
    *
    * @param name the name of the field in question
    */
-  static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = const StaticWarningCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
+  static const StaticWarningCode
+      FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR =
+      const StaticWarningCode(
+          'FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR',
+          "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
 
   /**
    * 7.6.1 Generative Constructors: Execution of an initializer of the form
@@ -3358,7 +4158,10 @@
    * @param initializerType the name of the type of the initializer expression
    * @param fieldType the name of the type of the field
    */
-  static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const StaticWarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE', "The initializer type '{0}' cannot be assigned to the field type '{1}'");
+  static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'FIELD_INITIALIZER_NOT_ASSIGNABLE',
+          "The initializer type '{0}' cannot be assigned to the field type '{1}'");
 
   /**
    * 7.6.1 Generative Constructors: An initializing formal has the form
@@ -3368,7 +4171,10 @@
    * @param parameterType the name of the type of the field formal parameter
    * @param fieldType the name of the type of the field
    */
-  static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = const StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', "The parameter type '{0}' is incompatable with the field type '{1}'");
+  static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE',
+          "The parameter type '{0}' is incompatable with the field type '{1}'");
 
   /**
    * 5 Variables: It is a static warning if a library, static or local variable
@@ -3385,13 +4191,19 @@
    *
    * @param name the name of the uninitialized final variable
    */
-  static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode('FINAL_NOT_INITIALIZED', "The final variable '{0}' must be initialized");
+  static const StaticWarningCode FINAL_NOT_INITIALIZED =
+      const StaticWarningCode(
+          'FINAL_NOT_INITIALIZED',
+          "The final variable '{0}' must be initialized");
 
   /**
    * 15.5 Function Types: It is a static warning if a concrete class implements
    * Function and does not have a concrete method named call().
    */
-  static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode('FUNCTION_WITHOUT_CALL', "Concrete classes that implement Function must implement the method call()");
+  static const StaticWarningCode FUNCTION_WITHOUT_CALL =
+      const StaticWarningCode(
+          'FUNCTION_WITHOUT_CALL',
+          "Concrete classes that implement Function must implement the method call()");
 
   /**
    * 14.1 Imports: It is a static warning to import two different libraries with
@@ -3401,8 +4213,8 @@
    * @param uri2 the uri pointing to a second library
    * @param name the shared name of the imported libraries
    */
-  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED
-      = const StaticWarningCode(
+  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED =
+      const StaticWarningCode(
           'IMPORT_DUPLICATED_LIBRARY_NAMED',
           "The imported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
@@ -3413,8 +4225,8 @@
    * @param uri1 the uri pointing to a first library
    * @param uri2 the uri pointing to a second library
    */
-  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED
-      = const StaticWarningCode(
+  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED =
+      const StaticWarningCode(
           'IMPORT_DUPLICATED_LIBRARY_UNNAMED',
           "The imported libraries '{0}' and '{1}' cannot both be unnamed");
 
@@ -3425,7 +4237,10 @@
    * @param uri the uri pointing to a non-library declaration
    * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY].
    */
-  static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of directive");
+  static const StaticWarningCode IMPORT_OF_NON_LIBRARY =
+      const StaticWarningCode(
+          'IMPORT_OF_NON_LIBRARY',
+          "The imported library '{0}' must not have a part-of directive");
 
   /**
    * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
@@ -3438,7 +4253,11 @@
    * getters none of the <i>m<sub>i</sub></i> are inherited, and a static
    * warning is issued.
    */
-  static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD = const StaticWarningCode('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', "'{0}' is inherited as a getter and also a method");
+  static const StaticWarningCode
+      INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD =
+      const StaticWarningCode(
+          'INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD',
+          "'{0}' is inherited as a getter and also a method");
 
   /**
    * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
@@ -3449,7 +4268,11 @@
    * @param superclassName the name of the enclosing class that has the static
    *        member
    */
-  static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC = const StaticWarningCode('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', "'{0}' collides with a static member in the superclass '{1}'");
+  static const StaticWarningCode
+      INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC =
+      const StaticWarningCode(
+          'INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC',
+          "'{0}' collides with a static member in the superclass '{1}'");
 
   /**
    * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a
@@ -3463,7 +4286,10 @@
    *        declared
    * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE].
    */
-  static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const StaticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE =
+      const StaticWarningCode(
+          'INVALID_GETTER_OVERRIDE_RETURN_TYPE',
+          "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3476,7 +4302,10 @@
    * @param className the name of the class where the overridden method is
    *        declared
    */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE =
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE',
+          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3490,7 +4319,10 @@
    *        declared
    * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE].
    */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE =
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE',
+          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3503,7 +4335,10 @@
    * @param className the name of the class where the overridden method is
    *        declared
    */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE =
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE',
+          "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3517,7 +4352,10 @@
    *        declared
    * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE].
    */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE =
+      const StaticWarningCode(
+          'INVALID_METHOD_OVERRIDE_RETURN_TYPE',
+          "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3526,7 +4364,11 @@
    * <i>p</i> and the signature of <i>m1</i> specifies a different default value
    * for <i>p</i>.
    */
-  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', "Parameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
+  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED
+      =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED',
+          "Parameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3535,7 +4377,11 @@
    * <i>p</i> and the signature of <i>m1</i> specifies a different default value
    * for <i>p</i>.
    */
-  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', "Parameters cannot override default values, this method overrides '{0}.{1}' where this positional parameter has a different value");
+  static const StaticWarningCode
+      INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL',
+          "Parameters cannot override default values, this method overrides '{0}.{1}' where this positional parameter has a different value");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3545,7 +4391,10 @@
    * @param paramCount the number of named parameters in the overridden member
    * @param className the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCode('INVALID_OVERRIDE_NAMED', "Missing the named parameter '{0}' to match the overridden method from '{1}'");
+  static const StaticWarningCode INVALID_OVERRIDE_NAMED =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_NAMED',
+          "Missing the named parameter '{0}' to match the overridden method from '{1}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3556,7 +4405,10 @@
    *        member
    * @param className the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarningCode('INVALID_OVERRIDE_POSITIONAL', "Must have at least {0} parameters to match the overridden method from '{1}'");
+  static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_POSITIONAL',
+          "Must have at least {0} parameters to match the overridden method from '{1}'");
 
   /**
    * 7.1 Instance Methods: It is a static warning if an instance method
@@ -3567,7 +4419,10 @@
    *        member
    * @param className the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarningCode('INVALID_OVERRIDE_REQUIRED', "Must have {0} required parameters or less to match the overridden method from '{1}'");
+  static const StaticWarningCode INVALID_OVERRIDE_REQUIRED =
+      const StaticWarningCode(
+          'INVALID_OVERRIDE_REQUIRED',
+          "Must have {0} required parameters or less to match the overridden method from '{1}'");
 
   /**
    * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a
@@ -3581,7 +4436,10 @@
    *        declared
    * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE].
    */
-  static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE =
+      const StaticWarningCode(
+          'INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE',
+          "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'");
 
   /**
    * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
@@ -3596,7 +4454,10 @@
    * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
    * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the list type '{1}'");
+  static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the list type '{1}'");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -3613,7 +4474,10 @@
    * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
    * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('MAP_KEY_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the map key type '{1}'");
+  static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'MAP_KEY_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the map key type '{1}'");
 
   /**
    * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
@@ -3630,34 +4494,49 @@
    * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
    * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the map value type '{1}'");
+  static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'MAP_VALUE_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the map value type '{1}'");
 
   /**
    * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
    * with argument type <i>T</i> and a getter named <i>v</i> with return type
    * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
    */
-  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}')");
+  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES =
+      const StaticWarningCode(
+          'MISMATCHED_GETTER_AND_SETTER_TYPES',
+          "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}')");
 
   /**
    * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
    * with argument type <i>T</i> and a getter named <i>v</i> with return type
    * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
    */
-  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE = const StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE', "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'");
+  static const StaticWarningCode
+      MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE =
+      const StaticWarningCode(
+          'MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE',
+          "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'");
 
   /**
    * 13.12 Return: It is a static warning if a function contains both one or
    * more return statements of the form <i>return;</i> and one or more return
    * statements of the form <i>return e;</i>.
    */
-  static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode('MIXED_RETURN_TYPES', "Methods and functions cannot use return both with and without values");
+  static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode(
+      'MIXED_RETURN_TYPES',
+      "Methods and functions cannot use return both with and without values");
 
   /**
    * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an
    * abstract class and <i>q</i> is not a factory constructor.
    */
-  static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCode('NEW_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'new' expression");
+  static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS =
+      const StaticWarningCode(
+          'NEW_WITH_ABSTRACT_CLASS',
+          "Abstract classes cannot be created with a 'new' expression");
 
   /**
    * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a
@@ -3669,7 +4548,10 @@
    * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
    * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
-  static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const StaticWarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+  static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS =
+      const StaticWarningCode(
+          'NEW_WITH_INVALID_TYPE_PARAMETERS',
+          "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
    * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible
@@ -3677,7 +4559,8 @@
    *
    * @param name the name of the non-type element
    */
-  static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode('NEW_WITH_NON_TYPE', "The name '{0}' is not a class");
+  static const StaticWarningCode NEW_WITH_NON_TYPE =
+      const StaticWarningCode('NEW_WITH_NON_TYPE', "The name '{0}' is not a class");
 
   /**
    * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
@@ -3692,7 +4575,10 @@
    * a<sub>n+kM/sub>)</i> it is a static warning if the type <i>T</i> does not
    * declare a constructor with the same name as the declaration of <i>T</i>.
    */
-  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a constructor '{1}'");
+  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR =
+      const StaticWarningCode(
+          'NEW_WITH_UNDEFINED_CONSTRUCTOR',
+          "The class '{0}' does not have a constructor '{1}'");
 
   /**
    * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
@@ -3706,7 +4592,10 @@
    * static warning if the type <i>T</i> does not declare a constructor with the
    * same name as the declaration of <i>T</i>.
    */
-  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' does not have a default constructor");
+  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
+      const StaticWarningCode(
+          'NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
+          "The class '{0}' does not have a default constructor");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -3729,7 +4618,11 @@
    * @param additionalCount the number of additional missing members that aren't
    *        listed
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
+  static const StaticWarningCode
+      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS =
+      const StaticWarningCode(
+          'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS',
+          "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -3750,7 +4643,11 @@
    * @param memberName the name of the third member
    * @param memberName the name of the fourth member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', "Missing concrete implementation of {0}, {1}, {2} and {3}");
+  static const StaticWarningCode
+      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR =
+      const StaticWarningCode(
+          'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR',
+          "Missing concrete implementation of {0}, {1}, {2} and {3}");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -3768,7 +4665,11 @@
    *
    * @param memberName the name of the member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', "Missing concrete implementation of {0}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
+      =
+      const StaticWarningCode(
+          'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
+          "Missing concrete implementation of {0}");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -3788,7 +4689,11 @@
    * @param memberName the name of the second member
    * @param memberName the name of the third member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', "Missing concrete implementation of {0}, {1} and {2}");
+  static const StaticWarningCode
+      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE =
+      const StaticWarningCode(
+          'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE',
+          "Missing concrete implementation of {0}, {1} and {2}");
 
   /**
    * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
@@ -3807,7 +4712,11 @@
    * @param memberName the name of the first member
    * @param memberName the name of the second member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', "Missing concrete implementation of {0} and {1}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
+      =
+      const StaticWarningCode(
+          'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
+          "Missing concrete implementation of {0} and {1}");
 
   /**
    * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>,
@@ -3818,19 +4727,28 @@
    *
    * @param name the name of the non-type element
    */
-  static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', "The name '{0}' is not a type and cannot be used in an on-catch clause");
+  static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE =
+      const StaticWarningCode(
+          'NON_TYPE_IN_CATCH_CLAUSE',
+          "The name '{0}' is not a type and cannot be used in an on-catch clause");
 
   /**
    * 7.1.1 Operators: It is a static warning if the return type of the
    * user-declared operator []= is explicitly declared and not void.
    */
-  static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR', "The return type of the operator []= must be 'void'");
+  static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR =
+      const StaticWarningCode(
+          'NON_VOID_RETURN_FOR_OPERATOR',
+          "The return type of the operator []= must be 'void'");
 
   /**
    * 7.3 Setters: It is a static warning if a setter declares a return type
    * other than void.
    */
-  static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarningCode('NON_VOID_RETURN_FOR_SETTER', "The return type of the setter must be 'void'");
+  static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER =
+      const StaticWarningCode(
+          'NON_VOID_RETURN_FOR_SETTER',
+          "The return type of the setter must be 'void'");
 
   /**
    * 15.1 Static Types: A type <i>T</i> is malformed iff:
@@ -3846,7 +4764,8 @@
    *
    * @param nonTypeName the name that is not a type
    */
-  static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode('NOT_A_TYPE', "{0} is not a type");
+  static const StaticWarningCode NOT_A_TYPE =
+      const StaticWarningCode('NOT_A_TYPE', "{0} is not a type");
 
   /**
    * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
@@ -3856,7 +4775,10 @@
    * @param argumentCount the actual number of positional arguments given
    * See [EXTRA_POSITIONAL_ARGUMENTS].
    */
-  static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, but {1} found");
+  static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
+      const StaticWarningCode(
+          'NOT_ENOUGH_REQUIRED_ARGUMENTS',
+          "{0} required argument(s) expected, but {1} found");
 
   /**
    * 14.3 Parts: It is a static warning if the referenced part declaration
@@ -3867,7 +4789,10 @@
    * @param actualLibraryName the non-matching actual library name from the
    *        "part of" declaration
    */
-  static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', "Expected this library to be part of '{0}', not '{1}'");
+  static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY =
+      const StaticWarningCode(
+          'PART_OF_DIFFERENT_LIBRARY',
+          "Expected this library to be part of '{0}', not '{1}'");
 
   /**
    * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
@@ -3876,7 +4801,10 @@
    * @param redirectedName the name of the redirected constructor
    * @param redirectingName the name of the redirecting constructor
    */
-  static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', "The redirected constructor '{0}' has incompatible parameters with '{1}'");
+  static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE =
+      const StaticWarningCode(
+          'REDIRECT_TO_INVALID_FUNCTION_TYPE',
+          "The redirected constructor '{0}' has incompatible parameters with '{1}'");
 
   /**
    * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
@@ -3885,7 +4813,10 @@
    * @param redirectedName the name of the redirected constructor return type
    * @param redirectingName the name of the redirecting constructor return type
    */
-  static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
+  static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE =
+      const StaticWarningCode(
+          'REDIRECT_TO_INVALID_RETURN_TYPE',
+          "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
 
   /**
    * 7.6.2 Factories: It is a static warning if type does not denote a class
@@ -3893,7 +4824,10 @@
    * it is a static warning if the referenced constructor (be it <i>type</i> or
    * <i>type.id</i>) is not a constructor of <i>C</i>.
    */
-  static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticWarningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
+  static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR =
+      const StaticWarningCode(
+          'REDIRECT_TO_MISSING_CONSTRUCTOR',
+          "The constructor '{0}' could not be found in '{1}'");
 
   /**
    * 7.6.2 Factories: It is a static warning if type does not denote a class
@@ -3901,7 +4835,10 @@
    * it is a static warning if the referenced constructor (be it <i>type</i> or
    * <i>type.id</i>) is not a constructor of <i>C</i>.
    */
-  static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
+  static const StaticWarningCode REDIRECT_TO_NON_CLASS =
+      const StaticWarningCode(
+          'REDIRECT_TO_NON_CLASS',
+          "The name '{0}' is not a type and cannot be used in a redirected constructor");
 
   /**
    * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return
@@ -3910,7 +4847,9 @@
    * * <i>f</i> is not a generative constructor.
    * * The return type of <i>f</i> may not be assigned to void.
    */
-  static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode('RETURN_WITHOUT_VALUE', "Missing return value after 'return'");
+  static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode(
+      'RETURN_WITHOUT_VALUE',
+      "Missing return value after 'return'");
 
   /**
    * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
@@ -3918,13 +4857,19 @@
    *
    * @param memberName the name of the instance member
    */
-  static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', "Instance member '{0}' cannot be accessed using static access");
+  static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER =
+      const StaticWarningCode(
+          'STATIC_ACCESS_TO_INSTANCE_MEMBER',
+          "Instance member '{0}' cannot be accessed using static access");
 
   /**
    * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be
    * assigned to the type of <i>e<sub>k</sub></i>.
    */
-  static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', "Type '{0}' of the switch expression is not assignable to the type '{1}' of case expressions");
+  static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE =
+      const StaticWarningCode(
+          'SWITCH_EXPRESSION_NOT_ASSIGNABLE',
+          "Type '{0}' of the switch expression is not assignable to the type '{1}' of case expressions");
 
   /**
    * 15.1 Static Types: It is a static warning to use a deferred type in a type
@@ -3933,13 +4878,28 @@
    * @param name the name of the type that is deferred and being used in a type
    *        annotation
    */
-  static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWarningCode('TYPE_ANNOTATION_DEFERRED_CLASS', "The deferred type '{0}' cannot be used in a declaration, cast or type test");
+  static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS =
+      const StaticWarningCode(
+          'TYPE_ANNOTATION_DEFERRED_CLASS',
+          "The deferred type '{0}' cannot be used in a declaration, cast or type test");
 
   /**
    * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
    * available in the current lexical scope.
    */
-  static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode('TYPE_TEST_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'is' expression");
+  static const StaticWarningCode TYPE_TEST_WITH_NON_TYPE =
+      const StaticWarningCode(
+          'TYPE_TEST_WITH_NON_TYPE',
+          "The name '{0}' is not a type and cannot be used in an 'is' expression");
+
+  /**
+   * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
+   * available in the current lexical scope.
+   */
+  static const StaticWarningCode TYPE_TEST_WITH_UNDEFINED_NAME =
+      const StaticWarningCode(
+          'TYPE_TEST_WITH_UNDEFINED_NAME',
+          "The name '{0}' is not defined and cannot be used in an 'is' expression");
 
   /**
    * 10 Generics: However, a type parameter is considered to be a malformed type
@@ -3949,7 +4909,10 @@
    * warning. A malformed type is then interpreted as dynamic by the static type
    * checker and the runtime.
    */
-  static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const StaticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC', "Static members cannot reference type parameters");
+  static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC =
+      const StaticWarningCode(
+          'TYPE_PARAMETER_REFERENCED_BY_STATIC',
+          "Static members cannot reference type parameters");
 
   /**
    * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
@@ -3959,12 +4922,16 @@
    *
    * @param undefinedClassName the name of the undefined class
    */
-  static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'");
+  static const StaticWarningCode UNDEFINED_CLASS =
+      const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'");
 
   /**
    * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
    */
-  static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', "Undefined class 'boolean'; did you mean 'bool'?");
+  static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN =
+      const StaticWarningCode(
+          'UNDEFINED_CLASS_BOOLEAN',
+          "Undefined class 'boolean'; did you mean 'bool'?");
 
   /**
    * 12.17 Getter Invocation: It is a static warning if there is no class
@@ -3975,7 +4942,9 @@
    * @param enclosingType the name of the enclosing type where the getter is
    *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode(
+      'UNDEFINED_GETTER',
+      "The getter '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.30 Identifier Reference: It is as static warning if an identifier
@@ -3986,7 +4955,8 @@
    *
    * @param name the name of the identifier
    */
-  static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
+  static const StaticWarningCode UNDEFINED_IDENTIFIER =
+      const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
 
   /**
    * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
@@ -3996,7 +4966,10 @@
    *
    * @param name the name of the requested named parameter
    */
-  static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarningCode('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not defined");
+  static const StaticWarningCode UNDEFINED_NAMED_PARAMETER =
+      const StaticWarningCode(
+          'UNDEFINED_NAMED_PARAMETER',
+          "The named parameter '{0}' is not defined");
 
   /**
    * 12.18 Assignment: It is as static warning if an assignment of the form
@@ -4013,7 +4986,9 @@
    * @param enclosingType the name of the enclosing type where the setter is
    *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode(
+      'UNDEFINED_SETTER',
+      "The setter '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
@@ -4023,12 +4998,52 @@
    * @param enclosingType the name of the enclosing type where the method is
    *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', "There is no such static method, getter or setter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER =
+      const StaticWarningCode(
+          'UNDEFINED_STATIC_METHOD_OR_GETTER',
+          "The static method, getter or setter '{0}' is not defined for the class '{1}'");
+
+  /**
+   * 12.17 Getter Invocation: It is a static warning if there is no class
+   * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
+   * not declare, implicitly or explicitly, a getter named <i>m</i>.
+   *
+   * @param getterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the getter is
+   *        being looked for
+   */
+  static const StaticWarningCode UNDEFINED_SUPER_GETTER =
+      const StaticWarningCode(
+          'UNDEFINED_SUPER_GETTER',
+          "The getter '{0}' is not defined in a superclass of '{1}'");
+
+  /**
+   * 12.18 Assignment: It is as static warning if an assignment of the form
+   * <i>v = e</i> occurs inside a top level or static function (be it function,
+   * method, getter, or setter) or variable initializer and there is no
+   * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the
+   * assignment.
+   *
+   * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in
+   * the enclosing lexical scope of the assignment, or if <i>C</i> does not
+   * declare, implicitly or explicitly, a setter <i>v=</i>.
+   *
+   * @param setterName the name of the getter
+   * @param enclosingType the name of the enclosing type where the setter is
+   *        being looked for
+   */
+  static const StaticWarningCode UNDEFINED_SUPER_SETTER =
+      const StaticWarningCode(
+          'UNDEFINED_SUPER_SETTER',
+          "The setter '{0}' is not defined in a superclass of '{1}'");
 
   /**
    * 7.2 Getters: It is a static warning if the return type of a getter is void.
    */
-  static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCode('VOID_RETURN_FOR_GETTER', "The return type of the getter must not be 'void'");
+  static const StaticWarningCode VOID_RETURN_FOR_GETTER =
+      const StaticWarningCode(
+          'VOID_RETURN_FOR_GETTER',
+          "The return type of the getter must not be 'void'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -4036,7 +5051,8 @@
    * template. The correction associated with the error will be created from the
    * given [correction] template.
    */
-  const StaticWarningCode(String name, String message, [String correction]) : super(name, message, correction);
+  const StaticWarningCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
@@ -4067,7 +5083,8 @@
    * * todo
    * * TODOS
    */
-  static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
+  static RegExp TODO_REGEX =
+      new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
 
   /**
    * Initialize a newly created error code to have the given [name].
@@ -4079,4 +5096,4 @@
 
   @override
   ErrorType get type => ErrorType.TODO;
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index ec2f4e3..4b83983c 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -4,20 +4,20 @@
 
 library engine.resolver.error_verifier;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:collection';
 
-import 'java_engine.dart';
-import 'error.dart';
-import 'scanner.dart' as sc;
-import 'utilities_dart.dart';
 import 'ast.dart';
-import 'parser.dart' show Parser, ParserErrorCode;
-import 'sdk.dart' show DartSdk, SdkLibrary;
-import 'element.dart';
 import 'constant.dart';
-import 'resolver.dart';
+import 'element.dart';
 import 'element_resolver.dart';
+import 'error.dart';
+import 'java_engine.dart';
+import 'parser.dart' show Parser, ParserErrorCode;
+import 'resolver.dart';
+import 'scanner.dart' as sc;
+import 'sdk.dart' show DartSdk, SdkLibrary;
+import 'utilities_dart.dart';
 
 /**
  * Instances of the class `ErrorVerifier` traverse an AST structure looking for additional
@@ -25,36 +25,22 @@
  */
 class ErrorVerifier extends RecursiveAstVisitor<Object> {
   /**
-   * Return the static type of the given expression that is to be used for type analysis.
+   * Static final string with value `"getter "` used in the construction of the
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
+   * code messages.
    *
-   * @param expression the expression whose type is to be returned
-   * @return the static type of the given expression
+   * See [_checkForNonAbstractClassInheritsAbstractMember].
    */
-  static DartType getStaticType(Expression expression) {
-    DartType type = expression.staticType;
-    if (type == null) {
-      // TODO(brianwilkerson) This should never happen.
-      return DynamicTypeImpl.instance;
-    }
-    return type;
-  }
+  static String _GETTER_SPACE = "getter ";
 
   /**
-   * Return the variable element represented by the given expression, or `null` if there is no
-   * such element.
+   * Static final string with value `"setter "` used in the construction of the
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
+   * code messages.
    *
-   * @param expression the expression whose element is to be returned
-   * @return the variable element represented by the expression
+   * See [_checkForNonAbstractClassInheritsAbstractMember].
    */
-  static VariableElement getVariableElement(Expression expression) {
-    if (expression is Identifier) {
-      Element element = expression.staticElement;
-      if (element is VariableElement) {
-        return element;
-      }
-    }
-    return null;
-  }
+  static String _SETTER_SPACE = "setter ";
 
   /**
    * The error reporter by which errors will be reported.
@@ -234,12 +220,14 @@
   /**
    * A table mapping name of the library to the export directive which export this library.
    */
-  HashMap<String, LibraryElement> _nameToExportElement = new HashMap<String, LibraryElement>();
+  HashMap<String, LibraryElement> _nameToExportElement =
+      new HashMap<String, LibraryElement>();
 
   /**
    * A table mapping name of the library to the import directive which import this library.
    */
-  HashMap<String, LibraryElement> _nameToImportElement = new HashMap<String, LibraryElement>();
+  HashMap<String, LibraryElement> _nameToImportElement =
+      new HashMap<String, LibraryElement>();
 
   /**
    * A table mapping names to the exported elements.
@@ -249,7 +237,8 @@
   /**
    * A set of the names of the variable initializers we are visiting now.
    */
-  HashSet<String> _namesForReferenceToDeclaredVariableInInitializer = new HashSet<String>();
+  HashSet<String> _namesForReferenceToDeclaredVariableInInitializer =
+      new HashSet<String>();
 
   /**
    * A list of types used by the [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS] and
@@ -258,27 +247,10 @@
   List<InterfaceType> _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT;
 
   /**
-   * Static final string with value `"getter "` used in the construction of the
-   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
-   * code messages.
-   *
-   * See [_checkForNonAbstractClassInheritsAbstractMember].
-   */
-  static String _GETTER_SPACE = "getter ";
-
-  /**
-   * Static final string with value `"setter "` used in the construction of the
-   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
-   * code messages.
-   *
-   * See [_checkForNonAbstractClassInheritsAbstractMember].
-   */
-  static String _SETTER_SPACE = "setter ";
-
-  /**
    * Initialize the [ErrorVerifier] visitor.
    */
-  ErrorVerifier(this._errorReporter, this._currentLibrary, this._typeProvider, this._inheritanceManager) {
+  ErrorVerifier(this._errorReporter, this._currentLibrary, this._typeProvider,
+      this._inheritanceManager) {
     this._isInSystemLibrary = _currentLibrary.source.isInSystemLibrary;
     this._hasExtUri = _currentLibrary.hasExtUri;
     _isEnclosingConstructorConst = false;
@@ -290,7 +262,7 @@
     _isInStaticMethod = false;
     _boolType = _typeProvider.boolType;
     _intType = _typeProvider.intType;
-    _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT = <InterfaceType> [
+    _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT = <InterfaceType>[
         _typeProvider.nullType,
         _typeProvider.numType,
         _intType,
@@ -341,7 +313,9 @@
   @override
   Object visitAwaitExpression(AwaitExpression node) {
     if (!_inAsync) {
-      _errorReporter.reportErrorForToken(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, node.awaitKeyword);
+      _errorReporter.reportErrorForToken(
+          CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT,
+          node.awaitKeyword);
     }
     return super.visitAwaitExpression(node);
   }
@@ -350,10 +324,19 @@
   Object visitBinaryExpression(BinaryExpression node) {
     sc.Token operator = node.operator;
     sc.TokenType type = operator.type;
-    if (type == sc.TokenType.AMPERSAND_AMPERSAND || type == sc.TokenType.BAR_BAR) {
+    if (type == sc.TokenType.AMPERSAND_AMPERSAND ||
+        type == sc.TokenType.BAR_BAR) {
       String lexeme = operator.lexeme;
-      _checkForAssignability(node.leftOperand, _boolType, StaticTypeWarningCode.NON_BOOL_OPERAND, [lexeme]);
-      _checkForAssignability(node.rightOperand, _boolType, StaticTypeWarningCode.NON_BOOL_OPERAND, [lexeme]);
+      _checkForAssignability(
+          node.leftOperand,
+          _boolType,
+          StaticTypeWarningCode.NON_BOOL_OPERAND,
+          [lexeme]);
+      _checkForAssignability(
+          node.rightOperand,
+          _boolType,
+          StaticTypeWarningCode.NON_BOOL_OPERAND,
+          [lexeme]);
     } else {
       _checkForArgumentTypeNotAssignableForArgument(node.rightOperand);
     }
@@ -391,7 +374,9 @@
     if (labelNode != null) {
       Element labelElement = labelNode.staticElement;
       if (labelElement is LabelElementImpl && labelElement.isOnSwitchMember) {
-        _errorReporter.reportErrorForNode(ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, labelNode);
+        _errorReporter.reportErrorForNode(
+            ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER,
+            labelNode);
       }
     }
     return null;
@@ -418,15 +403,22 @@
       ExtendsClause extendsClause = node.extendsClause;
       ImplementsClause implementsClause = node.implementsClause;
       WithClause withClause = node.withClause;
-      _checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
+      _checkForBuiltInIdentifierAsName(
+          node.name,
+          CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
       _checkForMemberWithClassName();
       _checkForNoDefaultSuperConstructorImplicit(node);
       _checkForConflictingTypeVariableErrorCodes(node);
       // Only do error checks on the clause nodes if there is a non-null clause
-      if (implementsClause != null || extendsClause != null || withClause != null) {
-        // Only check for all of the inheritance logic around clauses if there isn't an error code
-        // such as "Cannot extend double" already on the class.
-        if (!_checkForImplementsDisallowedClass(implementsClause) && !_checkForExtendsDisallowedClass(extendsClause) && !_checkForAllMixinErrorCodes(withClause)) {
+      if (implementsClause != null ||
+          extendsClause != null ||
+          withClause != null) {
+        // Only check for all of the inheritance logic around clauses if there
+        // isn't an error code such as "Cannot extend double" already on the
+        // class.
+        if (!_checkForImplementsDisallowedClass(implementsClause) &&
+            !_checkForExtendsDisallowedClass(extendsClause) &&
+            !_checkForAllMixinErrorCodes(withClause)) {
           _checkForExtendsDeferredClass(extendsClause);
           _checkForImplementsDeferredClass(implementsClause);
           _checkForNonAbstractClassInheritsAbstractMember(node.name);
@@ -438,16 +430,7 @@
           _checkImplementsFunctionWithoutCall(node);
         }
       }
-      // initialize initialFieldElementsMap
-      if (_enclosingClass != null) {
-        List<FieldElement> fieldElements = _enclosingClass.fields;
-        _initialFieldElementsMap = new HashMap<FieldElement, INIT_STATE>();
-        for (FieldElement fieldElement in fieldElements) {
-          if (!fieldElement.isSynthetic) {
-            _initialFieldElementsMap[fieldElement] = fieldElement.initializer == null ? INIT_STATE.NOT_INIT : INIT_STATE.INIT_IN_DECLARATION;
-          }
-        }
-      }
+      visitClassDeclarationIncrementally(node);
       _checkForFinalNotInitializedInClass(node);
       _checkForDuplicateDefinitionInheritance();
       _checkForConflictingInstanceMethodSetter(node);
@@ -459,16 +442,43 @@
     }
   }
 
+  /**
+   * Implementation of this method should be synchronized with
+   * [visitClassDeclaration].
+   */
+  visitClassDeclarationIncrementally(ClassDeclaration node) {
+    _isInNativeClass = node.nativeClause != null;
+    _enclosingClass = node.element;
+    // initialize initialFieldElementsMap
+    if (_enclosingClass != null) {
+      List<FieldElement> fieldElements = _enclosingClass.fields;
+      _initialFieldElementsMap = new HashMap<FieldElement, INIT_STATE>();
+      for (FieldElement fieldElement in fieldElements) {
+        if (!fieldElement.isSynthetic) {
+          _initialFieldElementsMap[fieldElement] =
+              fieldElement.initializer == null ?
+                  INIT_STATE.NOT_INIT :
+                  INIT_STATE.INIT_IN_DECLARATION;
+        }
+      }
+    }
+  }
+
   @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
-    _checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME);
+    _checkForBuiltInIdentifierAsName(
+        node.name,
+        CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME);
     ClassElement outerClassElement = _enclosingClass;
     try {
       _enclosingClass = node.element;
       ImplementsClause implementsClause = node.implementsClause;
-      // Only check for all of the inheritance logic around clauses if there isn't an error code
-      // such as "Cannot extend double" already on the class.
-      if (!_checkForExtendsDisallowedClassInTypeAlias(node) && !_checkForImplementsDisallowedClass(implementsClause) && !_checkForAllMixinErrorCodes(node.withClause)) {
+      // Only check for all of the inheritance logic around clauses if there
+      // isn't an error code such as "Cannot extend double" already on the
+      // class.
+      if (!_checkForExtendsDisallowedClassInTypeAlias(node) &&
+          !_checkForImplementsDisallowedClass(implementsClause) &&
+          !_checkForAllMixinErrorCodes(node.withClause)) {
         _checkForExtendsDeferredClassInTypeAlias(node);
         _checkForImplementsDeferredClass(implementsClause);
         _checkForRecursiveInterfaceInheritance(_enclosingClass);
@@ -510,7 +520,9 @@
       _enclosingFunction = constructorElement;
       _isEnclosingConstructorConst = node.constKeyword != null;
       _isInFactory = node.factoryKeyword != null;
-      _checkForInvalidModifierOnBody(node.body, CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR);
+      _checkForInvalidModifierOnBody(
+          node.body,
+          CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR);
       _checkForConstConstructorWithNonFinalField(node, constructorElement);
       _checkForConstConstructorWithNonConstSuper(node);
       _checkForConflictingConstructorNameAndMember(node, constructorElement);
@@ -551,8 +563,11 @@
     SimpleIdentifier labelNode = node.label;
     if (labelNode != null) {
       Element labelElement = labelNode.staticElement;
-      if (labelElement is LabelElementImpl && labelElement.isOnSwitchStatement) {
-        _errorReporter.reportErrorForNode(ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH, labelNode);
+      if (labelElement is LabelElementImpl &&
+          labelElement.isOnSwitchStatement) {
+        _errorReporter.reportErrorForNode(
+            ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH,
+            labelNode);
       }
     }
     return null;
@@ -590,8 +605,10 @@
     try {
       _inAsync = node.isAsynchronous;
       _inGenerator = node.isGenerator;
-      FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
-      DartType expectedReturnType = functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
+      FunctionType functionType =
+          _enclosingFunction == null ? null : _enclosingFunction.type;
+      DartType expectedReturnType =
+          functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
       _checkForReturnOfInvalidType(node.expression, expectedReturnType);
       return super.visitExpressionFunctionBody(node);
     } finally {
@@ -607,7 +624,9 @@
     if (_isInInstanceVariableDeclaration) {
       VariableDeclarationList variables = node.fields;
       if (variables.isConst) {
-        _errorReporter.reportErrorForToken(CompileTimeErrorCode.CONST_INSTANCE_FIELD, variables.keyword);
+        _errorReporter.reportErrorForToken(
+            CompileTimeErrorCode.CONST_INSTANCE_FIELD,
+            variables.keyword);
       }
     }
     try {
@@ -645,13 +664,17 @@
         if (node.isSetter) {
           FunctionExpression functionExpression = node.functionExpression;
           if (functionExpression != null) {
-            _checkForWrongNumberOfParametersForSetter(identifier, functionExpression.parameters);
+            _checkForWrongNumberOfParametersForSetter(
+                identifier,
+                functionExpression.parameters);
           }
           _checkForNonVoidReturnTypeForSetter(returnType);
         }
       }
       if (node.isSetter) {
-        _checkForInvalidModifierOnBody(node.functionExpression.body, CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER);
+        _checkForInvalidModifierOnBody(
+            node.functionExpression.body,
+            CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER);
       }
       _checkForTypeAnnotationDeferredClass(returnType);
       return super.visitFunctionDeclaration(node);
@@ -662,8 +685,8 @@
 
   @override
   Object visitFunctionExpression(FunctionExpression node) {
-    // If this function expression is wrapped in a function declaration, don't change the
-    // enclosingFunction field.
+    // If this function expression is wrapped in a function declaration, don't
+    // change the enclosingFunction field.
     if (node.parent is! FunctionDeclaration) {
       ExecutableElement outerFunction = _enclosingFunction;
       try {
@@ -682,14 +705,18 @@
     Expression functionExpression = node.function;
     DartType expressionType = functionExpression.staticType;
     if (!_isFunctionType(expressionType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, functionExpression);
+      _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION,
+          functionExpression);
     }
     return super.visitFunctionExpressionInvocation(node);
   }
 
   @override
   Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    _checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME);
+    _checkForBuiltInIdentifierAsName(
+        node.name,
+        CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME);
     _checkForDefaultValueInFunctionTypeAlias(node);
     _checkForTypeAliasCannotReferenceItself_function(node);
     return super.visitFunctionTypeAlias(node);
@@ -743,7 +770,10 @@
         _checkForConstOrNewWithEnum(node, typeName, interfaceType);
         if (_isInConstInstanceCreation) {
           _checkForConstWithNonConst(node);
-          _checkForConstWithUndefinedConstructor(node, constructorName, typeName);
+          _checkForConstWithUndefinedConstructor(
+              node,
+              constructorName,
+              typeName);
           _checkForConstWithTypeParameters(typeName);
           _checkForConstDeferredClass(node, constructorName, typeName);
         } else {
@@ -769,7 +799,9 @@
       if (node.constKeyword != null) {
         NodeList<TypeName> arguments = typeArguments.arguments;
         if (arguments.length != 0) {
-          _checkForInvalidTypeArgumentInConstTypedLiteral(arguments, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
+          _checkForInvalidTypeArgumentInConstTypedLiteral(
+              arguments,
+              CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
         }
       }
       _checkForExpectedOneListTypeArgument(node, typeArguments);
@@ -785,7 +817,9 @@
       NodeList<TypeName> arguments = typeArguments.arguments;
       if (arguments.length != 0) {
         if (node.constKeyword != null) {
-          _checkForInvalidTypeArgumentInConstTypedLiteral(arguments, CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
+          _checkForInvalidTypeArgumentInConstTypedLiteral(
+              arguments,
+              CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
         }
       }
       _checkExpectedTwoMapTypeArguments(typeArguments);
@@ -814,7 +848,9 @@
         _checkForVoidReturnType(node);
         _checkForConflictingStaticGetterAndInstanceSetter(node);
       } else if (node.isSetter) {
-        _checkForInvalidModifierOnBody(node.body, CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER);
+        _checkForInvalidModifierOnBody(
+            node.body,
+            CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER);
         _checkForWrongNumberOfParametersForSetter(node.name, node.parameters);
         _checkForNonVoidReturnTypeForSetter(returnTypeName);
         _checkForConflictingStaticSetterAndInstanceMember(node);
@@ -849,9 +885,12 @@
 
   @override
   Object visitNativeClause(NativeClause node) {
-    // TODO(brianwilkerson) Figure out the right rule for when 'native' is allowed.
+    // TODO(brianwilkerson) Figure out the right rule for when 'native' is
+    // allowed.
     if (!_isInSystemLibrary) {
-      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, node);
+      _errorReporter.reportErrorForNode(
+          ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE,
+          node);
     }
     return super.visitNativeClause(node);
   }
@@ -872,7 +911,8 @@
   @override
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
     if (node.parent is! Annotation) {
-      ClassElement typeReference = ElementResolver.getTypeReference(node.prefix);
+      ClassElement typeReference =
+          ElementResolver.getTypeReference(node.prefix);
       SimpleIdentifier name = node.identifier;
       _checkForStaticAccessToInstanceMember(typeReference, name);
       _checkForInstanceAccessToStaticMember(typeReference, name);
@@ -895,7 +935,8 @@
 
   @override
   Object visitPropertyAccess(PropertyAccess node) {
-    ClassElement typeReference = ElementResolver.getTypeReference(node.realTarget);
+    ClassElement typeReference =
+        ElementResolver.getTypeReference(node.realTarget);
     SimpleIdentifier propertyName = node.propertyName;
     _checkForStaticAccessToInstanceMember(typeReference, propertyName);
     _checkForInstanceAccessToStaticMember(typeReference, propertyName);
@@ -903,7 +944,8 @@
   }
 
   @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     _isInConstructorInitializer = true;
     try {
       return super.visitRedirectingConstructorInvocation(node);
@@ -1000,7 +1042,9 @@
 
   @override
   Object visitTypeParameter(TypeParameter node) {
-    _checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME);
+    _checkForBuiltInIdentifierAsName(
+        node.name,
+        CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME);
     _checkForTypeParameterSupertypeOfItsBound(node);
     _checkForTypeAnnotationDeferredClass(node.bound);
     return super.visitTypeParameter(node);
@@ -1077,7 +1121,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, typeArguments, [num]);
+    _errorReporter.reportErrorForNode(
+        StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
+        typeArguments,
+        [num]);
     return true;
   }
 
@@ -1092,7 +1139,9 @@
    * and [CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES].
    */
   bool _checkForAllFinalInitializedErrorCodes(ConstructorDeclaration node) {
-    if (node.factoryKeyword != null || node.redirectedConstructor != null || node.externalKeyword != null) {
+    if (node.factoryKeyword != null ||
+        node.redirectedConstructor != null ||
+        node.externalKeyword != null) {
       return false;
     }
     // Ignore if native class.
@@ -1100,7 +1149,8 @@
       return false;
     }
     bool foundError = false;
-    HashMap<FieldElement, INIT_STATE> fieldElementsMap = new HashMap<FieldElement, INIT_STATE>.from(_initialFieldElementsMap);
+    HashMap<FieldElement, INIT_STATE> fieldElementsMap =
+        new HashMap<FieldElement, INIT_STATE>.from(_initialFieldElementsMap);
     // Visit all of the field formal parameters
     NodeList<FormalParameter> formalParameters = node.parameters.parameters;
     for (FormalParameter formalParameter in formalParameters) {
@@ -1109,18 +1159,25 @@
         parameter = (parameter as DefaultFormalParameter).parameter;
       }
       if (parameter is FieldFormalParameter) {
-        FieldElement fieldElement = (parameter.element as FieldFormalParameterElementImpl).field;
+        FieldElement fieldElement =
+            (parameter.element as FieldFormalParameterElementImpl).field;
         INIT_STATE state = fieldElementsMap[fieldElement];
         if (state == INIT_STATE.NOT_INIT) {
           fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_FIELD_FORMAL;
         } else if (state == INIT_STATE.INIT_IN_DECLARATION) {
           if (fieldElement.isFinal || fieldElement.isConst) {
-            _errorReporter.reportErrorForNode(StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, formalParameter.identifier, [fieldElement.displayName]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
+                formalParameter.identifier,
+                [fieldElement.displayName]);
             foundError = true;
           }
         } else if (state == INIT_STATE.INIT_IN_FIELD_FORMAL) {
           if (fieldElement.isFinal || fieldElement.isConst) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES, formalParameter.identifier, [fieldElement.displayName]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES,
+                formalParameter.identifier,
+                [fieldElement.displayName]);
             foundError = true;
           }
         }
@@ -1133,7 +1190,8 @@
         return false;
       }
       if (constructorInitializer is ConstructorFieldInitializer) {
-        ConstructorFieldInitializer constructorFieldInitializer = constructorInitializer;
+        ConstructorFieldInitializer constructorFieldInitializer =
+            constructorInitializer;
         SimpleIdentifier fieldName = constructorFieldInitializer.fieldName;
         Element element = fieldName.staticElement;
         if (element is FieldElement) {
@@ -1143,14 +1201,21 @@
             fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_INITIALIZERS;
           } else if (state == INIT_STATE.INIT_IN_DECLARATION) {
             if (fieldElement.isFinal || fieldElement.isConst) {
-              _errorReporter.reportErrorForNode(StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName);
+              _errorReporter.reportErrorForNode(
+                  StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION,
+                  fieldName);
               foundError = true;
             }
           } else if (state == INIT_STATE.INIT_IN_FIELD_FORMAL) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER,
+                fieldName);
             foundError = true;
           } else if (state == INIT_STATE.INIT_IN_INITIALIZERS) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, fieldName, [fieldElement.displayName]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+                fieldName,
+                [fieldElement.displayName]);
             foundError = true;
           }
         }
@@ -1163,14 +1228,14 @@
         if (fieldElement.isConst) {
           _errorReporter.reportErrorForNode(
               CompileTimeErrorCode.CONST_NOT_INITIALIZED,
-                  node.returnType,
-                  [fieldElement.name]);
+              node.returnType,
+              [fieldElement.name]);
           foundError = true;
         } else if (fieldElement.isFinal) {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.FINAL_NOT_INITIALIZED,
-                  node.returnType,
-                  [fieldElement.name]);
+              node.returnType,
+              [fieldElement.name]);
           foundError = true;
         }
       }
@@ -1198,7 +1263,10 @@
    * [StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE], and
    * [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES].
    */
-  bool _checkForAllInvalidOverrideErrorCodes(ExecutableElement executableElement, ExecutableElement overriddenExecutable, List<ParameterElement> parameters, List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
+  bool
+      _checkForAllInvalidOverrideErrorCodes(ExecutableElement executableElement,
+      ExecutableElement overriddenExecutable, List<ParameterElement> parameters,
+      List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
     bool isGetter = false;
     bool isSetter = false;
     if (executableElement is PropertyAccessorElement) {
@@ -1210,7 +1278,11 @@
     FunctionType overridingFT = executableElement.type;
     FunctionType overriddenFT = overriddenExecutable.type;
     InterfaceType enclosingType = _enclosingClass.type;
-    overriddenFT = _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(overriddenFT, executableElementName, enclosingType);
+    overriddenFT =
+        _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(
+            overriddenFT,
+            executableElementName,
+            enclosingType);
     if (overridingFT == null || overriddenFT == null) {
       return false;
     }
@@ -1222,17 +1294,23 @@
     List<DartType> overriddenPositionalPT = overriddenFT.optionalParameterTypes;
     Map<String, DartType> overridingNamedPT = overridingFT.namedParameterTypes;
     Map<String, DartType> overriddenNamedPT = overriddenFT.namedParameterTypes;
-    // CTEC.INVALID_OVERRIDE_REQUIRED, CTEC.INVALID_OVERRIDE_POSITIONAL and CTEC.INVALID_OVERRIDE_NAMED
+    // CTEC.INVALID_OVERRIDE_REQUIRED, CTEC.INVALID_OVERRIDE_POSITIONAL and
+    // CTEC.INVALID_OVERRIDE_NAMED
     if (overridingNormalPT.length > overriddenNormalPT.length) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.INVALID_OVERRIDE_REQUIRED, errorNameTarget, [
-          overriddenNormalPT.length,
-          overriddenExecutable.enclosingElement.displayName]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.INVALID_OVERRIDE_REQUIRED,
+          errorNameTarget,
+          [overriddenNormalPT.length, overriddenExecutable.enclosingElement.displayName]);
       return true;
     }
-    if (overridingNormalPT.length + overridingPositionalPT.length < overriddenPositionalPT.length + overriddenNormalPT.length) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.INVALID_OVERRIDE_POSITIONAL, errorNameTarget, [
-          overriddenPositionalPT.length + overriddenNormalPT.length,
-          overriddenExecutable.enclosingElement.displayName]);
+    if (overridingNormalPT.length + overridingPositionalPT.length <
+        overriddenPositionalPT.length + overriddenNormalPT.length) {
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.INVALID_OVERRIDE_POSITIONAL,
+          errorNameTarget,
+          [
+              overriddenPositionalPT.length + overriddenNormalPT.length,
+              overriddenExecutable.enclosingElement.displayName]);
       return true;
     }
     // For each named parameter in the overridden method, verify that there is
@@ -1244,17 +1322,22 @@
         _errorReporter.reportErrorForNode(
             StaticWarningCode.INVALID_OVERRIDE_NAMED,
             errorNameTarget,
-            [overriddenParamName,
-            overriddenExecutable.enclosingElement.displayName]);
+            [overriddenParamName, overriddenExecutable.enclosingElement.displayName]);
         return true;
       }
     }
     // SWC.INVALID_METHOD_OVERRIDE_RETURN_TYPE
-    if (overriddenFTReturnType != VoidTypeImpl.instance && !overridingFTReturnType.isAssignableTo(overriddenFTReturnType)) {
-      _errorReporter.reportTypeErrorForNode(!isGetter ? StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE : StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE, errorNameTarget, [
-          overridingFTReturnType,
-          overriddenFTReturnType,
-          overriddenExecutable.enclosingElement.displayName]);
+    if (overriddenFTReturnType != VoidTypeImpl.instance &&
+        !overridingFTReturnType.isAssignableTo(overriddenFTReturnType)) {
+      _errorReporter.reportTypeErrorForNode(
+          !isGetter ?
+              StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE :
+              StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
+          errorNameTarget,
+          [
+              overridingFTReturnType,
+              overriddenFTReturnType,
+              overriddenExecutable.enclosingElement.displayName]);
       return true;
     }
     // SWC.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
@@ -1264,26 +1347,36 @@
     int parameterIndex = 0;
     for (int i = 0; i < overridingNormalPT.length; i++) {
       if (!overridingNormalPT[i].isAssignableTo(overriddenNormalPT[i])) {
-        _errorReporter.reportTypeErrorForNode(!isSetter ? StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE : StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE, parameterLocations[parameterIndex], [
-            overridingNormalPT[i],
-            overriddenNormalPT[i],
-            overriddenExecutable.enclosingElement.displayName]);
+        _errorReporter.reportTypeErrorForNode(
+            !isSetter ?
+                StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE :
+                StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
+            parameterLocations[parameterIndex],
+            [
+                overridingNormalPT[i],
+                overriddenNormalPT[i],
+                overriddenExecutable.enclosingElement.displayName]);
         return true;
       }
       parameterIndex++;
     }
     // SWC.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE
     for (int i = 0; i < overriddenPositionalPT.length; i++) {
-      if (!overridingPositionalPT[i].isAssignableTo(overriddenPositionalPT[i])) {
-        _errorReporter.reportTypeErrorForNode(StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE, parameterLocations[parameterIndex], [
-            overridingPositionalPT[i],
-            overriddenPositionalPT[i],
-            overriddenExecutable.enclosingElement.displayName]);
+      if (!overridingPositionalPT[i].isAssignableTo(
+          overriddenPositionalPT[i])) {
+        _errorReporter.reportTypeErrorForNode(
+            StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
+            parameterLocations[parameterIndex],
+            [
+                overridingPositionalPT[i],
+                overriddenPositionalPT[i],
+                overriddenExecutable.enclosingElement.displayName]);
         return true;
       }
       parameterIndex++;
     }
-    // SWC.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE & SWC.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
+    // SWC.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE &
+    // SWC.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
     for (String overriddenName in overriddenNamedPT.keys) {
       DartType overridingType = overridingNamedPT[overriddenName];
       if (overridingType == null) {
@@ -1298,8 +1391,8 @@
         AstNode parameterLocationToSelect = null;
         for (int i = 0; i < parameters.length; i++) {
           ParameterElement parameter = parameters[i];
-          if (parameter.parameterKind == ParameterKind.NAMED
-              && overriddenName == parameter.name) {
+          if (parameter.parameterKind == ParameterKind.NAMED &&
+              overriddenName == parameter.name) {
             parameterToSelect = parameter;
             parameterLocationToSelect = parameterLocations[i];
             break;
@@ -1309,23 +1402,26 @@
           _errorReporter.reportTypeErrorForNode(
               StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE,
               parameterLocationToSelect,
-              [overridingType,
-              overriddenType,
-              overriddenExecutable.enclosingElement.displayName]);
+              [
+                  overridingType,
+                  overriddenType,
+                  overriddenExecutable.enclosingElement.displayName]);
           return true;
         }
       }
     }
     // SWC.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
     //
-    // Create three arrays: an array of the optional parameter ASTs (FormalParameters), an array of
-    // the optional parameters elements from our method, and finally an array of the optional
-    // parameter elements from the method we are overriding.
+    // Create three arrays: an array of the optional parameter ASTs
+    // (FormalParameters), an array of the optional parameters elements from our
+    // method, and finally an array of the optional parameter elements from the
+    // method we are overriding.
     //
     bool foundError = false;
     List<AstNode> formalParameters = new List<AstNode>();
     List<ParameterElementImpl> parameterElts = new List<ParameterElementImpl>();
-    List<ParameterElementImpl> overriddenParameterElts = new List<ParameterElementImpl>();
+    List<ParameterElementImpl> overriddenParameterElts =
+        new List<ParameterElementImpl>();
     List<ParameterElement> overriddenPEs = overriddenExecutable.parameters;
     for (int i = 0; i < parameters.length; i++) {
       ParameterElement parameter = parameters[i];
@@ -1342,12 +1438,13 @@
       }
     }
     //
-    // Next compare the list of optional parameter elements to the list of overridden optional
-    // parameter elements.
+    // Next compare the list of optional parameter elements to the list of
+    // overridden optional parameter elements.
     //
     if (parameterElts.length > 0) {
       if (parameterElts[0].parameterKind == ParameterKind.NAMED) {
-        // Named parameters, consider the names when matching the parameterElts to the overriddenParameterElts
+        // Named parameters, consider the names when matching the parameterElts
+        // to the overriddenParameterElts
         for (int i = 0; i < parameterElts.length; i++) {
           ParameterElementImpl parameterElt = parameterElts[i];
           EvaluationResultImpl result = parameterElt.evaluationResult;
@@ -1357,51 +1454,64 @@
           }
           String parameterName = parameterElt.name;
           for (int j = 0; j < overriddenParameterElts.length; j++) {
-            ParameterElementImpl overriddenParameterElt = overriddenParameterElts[j];
+            ParameterElementImpl overriddenParameterElt =
+                overriddenParameterElts[j];
             if (overriddenParameterElt.initializer == null) {
               // There is no warning if the overridden parameter has an
               // implicit default.
               continue;
             }
             String overriddenParameterName = overriddenParameterElt.name;
-            if (parameterName != null && parameterName == overriddenParameterName) {
-              EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
+            if (parameterName != null &&
+                parameterName == overriddenParameterName) {
+              EvaluationResultImpl overriddenResult =
+                  overriddenParameterElt.evaluationResult;
               if (_isUserDefinedObject(overriddenResult)) {
                 break;
               }
               if (!result.equalValues(_typeProvider, overriddenResult)) {
-                _errorReporter.reportErrorForNode(StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED, formalParameters[i], [
-                    overriddenExecutable.enclosingElement.displayName,
-                    overriddenExecutable.displayName,
-                    parameterName]);
+                _errorReporter.reportErrorForNode(
+                    StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
+                    formalParameters[i],
+                    [
+                        overriddenExecutable.enclosingElement.displayName,
+                        overriddenExecutable.displayName,
+                        parameterName]);
                 foundError = true;
               }
             }
           }
         }
       } else {
-        // Positional parameters, consider the positions when matching the parameterElts to the overriddenParameterElts
-        for (int i = 0; i < parameterElts.length && i < overriddenParameterElts.length; i++) {
+        // Positional parameters, consider the positions when matching the
+        // parameterElts to the overriddenParameterElts
+        for (int i =
+            0; i < parameterElts.length && i < overriddenParameterElts.length; i++) {
           ParameterElementImpl parameterElt = parameterElts[i];
           EvaluationResultImpl result = parameterElt.evaluationResult;
           // TODO (jwren) Ignore Object types, see Dart bug 11287
           if (_isUserDefinedObject(result)) {
             continue;
           }
-          ParameterElementImpl overriddenParameterElt = overriddenParameterElts[i];
+          ParameterElementImpl overriddenParameterElt =
+              overriddenParameterElts[i];
           if (overriddenParameterElt.initializer == null) {
             // There is no warning if the overridden parameter has an implicit
             // default.
             continue;
           }
-          EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
+          EvaluationResultImpl overriddenResult =
+              overriddenParameterElt.evaluationResult;
           if (_isUserDefinedObject(overriddenResult)) {
             continue;
           }
           if (!result.equalValues(_typeProvider, overriddenResult)) {
-            _errorReporter.reportErrorForNode(StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL, formalParameters[i], [
-                overriddenExecutable.enclosingElement.displayName,
-                overriddenExecutable.displayName]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL,
+                formalParameters[i],
+                [
+                    overriddenExecutable.enclosingElement.displayName,
+                    overriddenExecutable.displayName]);
             foundError = true;
           }
         }
@@ -1422,17 +1532,27 @@
    * @param errorNameTarget the node to report problems on
    * @return `true` if and only if an error code is generated on the passed node
    */
-  bool _checkForAllInvalidOverrideErrorCodesForExecutable(ExecutableElement executableElement, List<ParameterElement> parameters, List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
+  bool
+      _checkForAllInvalidOverrideErrorCodesForExecutable(ExecutableElement executableElement,
+      List<ParameterElement> parameters, List<AstNode> parameterLocations,
+      SimpleIdentifier errorNameTarget) {
     //
     // Compute the overridden executable from the InheritanceManager
     //
-    List<ExecutableElement> overriddenExecutables = _inheritanceManager.lookupOverrides(_enclosingClass, executableElement.name);
+    List<ExecutableElement> overriddenExecutables =
+        _inheritanceManager.lookupOverrides(_enclosingClass, executableElement.name);
     if (_checkForInstanceMethodNameCollidesWithSuperclassStatic(
-        executableElement, errorNameTarget)) {
+        executableElement,
+        errorNameTarget)) {
       return true;
     }
     for (ExecutableElement overriddenElement in overriddenExecutables) {
-      if (_checkForAllInvalidOverrideErrorCodes(executableElement, overriddenElement, parameters, parameterLocations, errorNameTarget)) {
+      if (_checkForAllInvalidOverrideErrorCodes(
+          executableElement,
+          overriddenElement,
+          parameters,
+          parameterLocations,
+          errorNameTarget)) {
         return true;
       }
     }
@@ -1473,7 +1593,7 @@
         if (_checkForAllInvalidOverrideErrorCodesForExecutable(
             setter,
             setter.parameters,
-            <AstNode> [fieldName],
+            <AstNode>[fieldName],
             fieldName)) {
           hasProblems = true;
         }
@@ -1490,7 +1610,9 @@
    * See [_checkForAllInvalidOverrideErrorCodes].
    */
   bool _checkForAllInvalidOverrideErrorCodesForMethod(MethodDeclaration node) {
-    if (_enclosingClass == null || node.isStatic || node.body is NativeFunctionBody) {
+    if (_enclosingClass == null ||
+        node.isStatic ||
+        node.body is NativeFunctionBody) {
       return false;
     }
     ExecutableElement executableElement = node.element;
@@ -1502,9 +1624,15 @@
       return false;
     }
     FormalParameterList formalParameterList = node.parameters;
-    NodeList<FormalParameter> parameterList = formalParameterList != null ? formalParameterList.parameters : null;
-    List<AstNode> parameters = parameterList != null ? new List.from(parameterList) : null;
-    return _checkForAllInvalidOverrideErrorCodesForExecutable(executableElement, executableElement.parameters, parameters, methodName);
+    NodeList<FormalParameter> parameterList =
+        formalParameterList != null ? formalParameterList.parameters : null;
+    List<AstNode> parameters =
+        parameterList != null ? new List.from(parameterList) : null;
+    return _checkForAllInvalidOverrideErrorCodesForExecutable(
+        executableElement,
+        executableElement.parameters,
+        parameters,
+        methodName);
   }
 
   /**
@@ -1574,11 +1702,14 @@
     ConstructorElement redirectedElement = redirectedConstructor.staticElement;
     if (redirectedElement == null) {
       //
-      // If the element is null, we check for the REDIRECT_TO_MISSING_CONSTRUCTOR case
+      // If the element is null, we check for the
+      // REDIRECT_TO_MISSING_CONSTRUCTOR case
       //
       TypeName constructorTypeName = redirectedConstructor.type;
       DartType redirectedType = constructorTypeName.type;
-      if (redirectedType != null && redirectedType.element != null && !redirectedType.isDynamic) {
+      if (redirectedType != null &&
+          redirectedType.element != null &&
+          !redirectedType.isDynamic) {
         //
         // Prepare the constructor name
         //
@@ -1586,8 +1717,13 @@
         if (redirectedConstructor.name != null) {
           constructorStrName += ".${redirectedConstructor.name.name}";
         }
-        ErrorCode errorCode = (node.constKeyword != null ? CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR : StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR);
-        _errorReporter.reportErrorForNode(errorCode, redirectedConstructor, [constructorStrName, redirectedType.displayName]);
+        ErrorCode errorCode = (node.constKeyword != null ?
+            CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR :
+            StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR);
+        _errorReporter.reportErrorForNode(
+            errorCode,
+            redirectedConstructor,
+            [constructorStrName, redirectedType.displayName]);
         return true;
       }
       return false;
@@ -1600,14 +1736,20 @@
     FunctionType constructorType = node.element.type;
     DartType constructorReturnType = constructorType.returnType;
     if (!redirectedReturnType.isAssignableTo(constructorReturnType)) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE, redirectedConstructor, [redirectedReturnType, constructorReturnType]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE,
+          redirectedConstructor,
+          [redirectedReturnType, constructorReturnType]);
       return true;
     }
     //
     // Check parameters
     //
     if (!redirectedType.isSubtypeOf(constructorType)) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE, redirectedConstructor, [redirectedType, constructorType]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE,
+          redirectedConstructor,
+          [redirectedType, constructorType]);
       return true;
     }
     return false;
@@ -1631,16 +1773,22 @@
    * [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE].
    */
   bool _checkForAllReturnStatementErrorCodes(ReturnStatement node) {
-    FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
-    DartType expectedReturnType = functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
+    FunctionType functionType =
+        _enclosingFunction == null ? null : _enclosingFunction.type;
+    DartType expectedReturnType =
+        functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
     Expression returnExpression = node.expression;
     // RETURN_IN_GENERATIVE_CONSTRUCTOR
-    bool isGenerativeConstructor = _enclosingFunction is ConstructorElement && !(_enclosingFunction as ConstructorElement).isFactory;
+    bool isGenerativeConstructor =
+        _enclosingFunction is ConstructorElement &&
+        !(_enclosingFunction as ConstructorElement).isFactory;
     if (isGenerativeConstructor) {
       if (returnExpression == null) {
         return false;
       }
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, returnExpression);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR,
+          returnExpression);
       return true;
     }
     // RETURN_WITHOUT_VALUE
@@ -1649,11 +1797,15 @@
         return false;
       }
       _hasReturnWithoutValue = true;
-      _errorReporter.reportErrorForNode(StaticWarningCode.RETURN_WITHOUT_VALUE, node);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.RETURN_WITHOUT_VALUE,
+          node);
       return true;
     } else if (_inGenerator) {
       // RETURN_IN_GENERATOR
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATOR, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.RETURN_IN_GENERATOR,
+          node);
     }
     // RETURN_OF_INVALID_TYPE
     return _checkForReturnOfInvalidType(returnExpression, expectedReturnType);
@@ -1670,21 +1822,26 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.AMBIGUOUS_EXPORT].
    */
-  bool _checkForAmbiguousExport(ExportDirective node, ExportElement exportElement, LibraryElement exportedLibrary) {
+  bool _checkForAmbiguousExport(ExportDirective node,
+      ExportElement exportElement, LibraryElement exportedLibrary) {
     if (exportedLibrary == null) {
       return false;
     }
     // check exported names
-    Namespace namespace = new NamespaceBuilder().createExportNamespaceForDirective(exportElement);
+    Namespace namespace =
+        new NamespaceBuilder().createExportNamespaceForDirective(exportElement);
     Map<String, Element> definedNames = namespace.definedNames;
     for (String name in definedNames.keys) {
       Element element = definedNames[name];
       Element prevElement = _exportedElements[name];
       if (element != null && prevElement != null && prevElement != element) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.AMBIGUOUS_EXPORT, node, [
-            name,
-            prevElement.library.definingCompilationUnit.displayName,
-            element.library.definingCompilationUnit.displayName]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.AMBIGUOUS_EXPORT,
+            node,
+            [
+                name,
+                prevElement.library.definingCompilationUnit.displayName,
+                element.library.definingCompilationUnit.displayName]);
         return true;
       } else {
         _exportedElements[name] = element;
@@ -1713,13 +1870,17 @@
    * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
    * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForArgumentTypeNotAssignable(Expression expression, DartType expectedStaticType, DartType actualStaticType, ErrorCode errorCode) {
+  bool _checkForArgumentTypeNotAssignable(Expression expression,
+      DartType expectedStaticType, DartType actualStaticType, ErrorCode errorCode) {
     //
     // Warning case: test static type information
     //
     if (actualStaticType != null && expectedStaticType != null) {
       if (!actualStaticType.isAssignableTo(expectedStaticType)) {
-        _errorReporter.reportTypeErrorForNode(errorCode, expression, [actualStaticType, expectedStaticType]);
+        _errorReporter.reportTypeErrorForNode(
+            errorCode,
+            expression,
+            [actualStaticType, expectedStaticType]);
         return true;
       }
     }
@@ -1740,8 +1901,12 @@
       return false;
     }
     ParameterElement staticParameterElement = argument.staticParameterElement;
-    DartType staticParameterType = staticParameterElement == null ? null : staticParameterElement.type;
-    return _checkForArgumentTypeNotAssignableWithExpectedTypes(argument, staticParameterType, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+    DartType staticParameterType =
+        staticParameterElement == null ? null : staticParameterElement.type;
+    return _checkForArgumentTypeNotAssignableWithExpectedTypes(
+        argument,
+        staticParameterType,
+        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
   }
 
   /**
@@ -1762,7 +1927,14 @@
    * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
    * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression, DartType expectedStaticType, ErrorCode errorCode) => _checkForArgumentTypeNotAssignable(expression, expectedStaticType, getStaticType(expression), errorCode);
+  bool
+      _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression,
+      DartType expectedStaticType, ErrorCode errorCode) =>
+      _checkForArgumentTypeNotAssignable(
+          expression,
+          expectedStaticType,
+          getStaticType(expression),
+          errorCode);
 
   /**
    * This verifies that the passed arguments can be assigned to their corresponding parameters.
@@ -1796,7 +1968,8 @@
    * @param arguments the arguments to pass in when creating the error
    * @return `true` if an error was reported
    */
-  bool _checkForAssignability(Expression expression, InterfaceType type, ErrorCode errorCode, List<Object> arguments) {
+  bool _checkForAssignability(Expression expression, InterfaceType type,
+      ErrorCode errorCode, List<Object> arguments) {
     if (expression == null) {
       return false;
     }
@@ -1842,25 +2015,39 @@
     if (element is VariableElement) {
       VariableElement variable = element as VariableElement;
       if (variable.isConst) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_CONST, expression);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.ASSIGNMENT_TO_CONST,
+            expression);
         return true;
       }
       if (variable.isFinal) {
-        if (variable is FieldElementImpl && variable.setter == null && variable.isSynthetic) {
-          _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, highlightedNode, [variable.name, variable.enclosingElement.displayName]);
+        if (variable is FieldElementImpl &&
+            variable.setter == null &&
+            variable.isSynthetic) {
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER,
+              highlightedNode,
+              [variable.name, variable.enclosingElement.displayName]);
           return true;
         }
-        _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FINAL, highlightedNode, [variable.name]);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.ASSIGNMENT_TO_FINAL,
+            highlightedNode,
+            [variable.name]);
         return true;
       }
       return false;
     }
     if (element is FunctionElement) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FUNCTION, expression);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.ASSIGNMENT_TO_FUNCTION,
+          expression);
       return true;
     }
     if (element is MethodElement) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_METHOD, expression);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.ASSIGNMENT_TO_METHOD,
+          expression);
       return true;
     }
     return false;
@@ -1881,10 +2068,14 @@
    * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME], and
    * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME].
    */
-  bool _checkForBuiltInIdentifierAsName(SimpleIdentifier identifier, ErrorCode errorCode) {
+  bool _checkForBuiltInIdentifierAsName(SimpleIdentifier identifier,
+      ErrorCode errorCode) {
     sc.Token token = identifier.token;
     if (token.type == sc.TokenType.KEYWORD) {
-      _errorReporter.reportErrorForNode(errorCode, identifier, [identifier.name]);
+      _errorReporter.reportErrorForNode(
+          errorCode,
+          identifier,
+          [identifier.name]);
       return true;
     }
     return false;
@@ -1915,7 +2106,9 @@
     } else {
       Statement statement = statements[statements.length - 1];
       // terminated with statement
-      if (statement is BreakStatement || statement is ContinueStatement || statement is ReturnStatement) {
+      if (statement is BreakStatement ||
+          statement is ContinueStatement ||
+          statement is ReturnStatement) {
         return false;
       }
       // terminated with 'throw' expression
@@ -1927,7 +2120,9 @@
       }
     }
     // report error
-    _errorReporter.reportErrorForToken(StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, node.keyword);
+    _errorReporter.reportErrorForToken(
+        StaticWarningCode.CASE_BLOCK_NOT_TERMINATED,
+        node.keyword);
     return true;
   }
 
@@ -1961,19 +2156,27 @@
    * See [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER].
    */
   bool _checkForConcreteClassWithAbstractMember(MethodDeclaration node) {
-    if (node.isAbstract && _enclosingClass != null && !_enclosingClass.isAbstract) {
+    if (node.isAbstract &&
+        _enclosingClass != null &&
+        !_enclosingClass.isAbstract) {
       SimpleIdentifier nameNode = node.name;
       String memberName = nameNode.name;
       ExecutableElement overriddenMember;
       if (node.isGetter) {
-        overriddenMember = _enclosingClass.lookUpInheritedConcreteGetter(memberName, _currentLibrary);
+        overriddenMember =
+            _enclosingClass.lookUpInheritedConcreteGetter(memberName, _currentLibrary);
       } else if (node.isSetter) {
-        overriddenMember = _enclosingClass.lookUpInheritedConcreteSetter(memberName, _currentLibrary);
+        overriddenMember =
+            _enclosingClass.lookUpInheritedConcreteSetter(memberName, _currentLibrary);
       } else {
-        overriddenMember = _enclosingClass.lookUpInheritedConcreteMethod(memberName, _currentLibrary);
+        overriddenMember =
+            _enclosingClass.lookUpInheritedConcreteMethod(memberName, _currentLibrary);
       }
       if (overriddenMember == null) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, nameNode, [memberName, _enclosingClass.displayName]);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
+            nameNode,
+            [memberName, _enclosingClass.displayName]);
         return true;
       }
     }
@@ -1992,7 +2195,8 @@
    * [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD], and
    * [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD].
    */
-  bool _checkForConflictingConstructorNameAndMember(ConstructorDeclaration node, ConstructorElement constructorElement) {
+  bool _checkForConflictingConstructorNameAndMember(ConstructorDeclaration node,
+      ConstructorElement constructorElement) {
     SimpleIdentifier constructorName = node.name;
     String name = constructorElement.name;
     ClassElement classElement = constructorElement.enclosingElement;
@@ -2004,25 +2208,38 @@
       }
       if (name == otherConstructor.name) {
         if (name == null || name.length == 0) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, node);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT,
+              node);
         } else {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, node, [name]);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
+              node,
+              [name]);
         }
         return true;
       }
     }
     // conflict with class member
-    if (constructorName != null && constructorElement != null && !constructorName.isSynthetic) {
+    if (constructorName != null &&
+        constructorElement != null &&
+        !constructorName.isSynthetic) {
       // fields
       FieldElement field = classElement.getField(name);
       if (field != null) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, node, [name]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
+            node,
+            [name]);
         return true;
       }
       // methods
       MethodElement method = classElement.getMethod(name);
       if (method != null) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, node, [name]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
+            node,
+            [name]);
         return true;
       }
     }
@@ -2046,16 +2263,18 @@
     for (MethodElement method in _enclosingClass.methods) {
       String name = method.name;
       // find inherited property accessor (and can be only getter)
-      ExecutableElement inherited = _inheritanceManager.lookupInheritance(_enclosingClass, name);
+      ExecutableElement inherited =
+          _inheritanceManager.lookupInheritance(_enclosingClass, name);
       if (inherited is! PropertyAccessorElement) {
         continue;
       }
       // report problem
       hasProblem = true;
-      _errorReporter.reportErrorForOffset(CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD, method.nameOffset, name.length, [
-          _enclosingClass.displayName,
-          inherited.enclosingElement.displayName,
-          name]);
+      _errorReporter.reportErrorForOffset(
+          CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD,
+          method.nameOffset,
+          name.length,
+          [_enclosingClass.displayName, inherited.enclosingElement.displayName, name]);
     }
     // getter declared in the enclosing class vs. inherited method
     for (PropertyAccessorElement accessor in _enclosingClass.accessors) {
@@ -2064,16 +2283,18 @@
       }
       String name = accessor.name;
       // find inherited method
-      ExecutableElement inherited = _inheritanceManager.lookupInheritance(_enclosingClass, name);
+      ExecutableElement inherited =
+          _inheritanceManager.lookupInheritance(_enclosingClass, name);
       if (inherited is! MethodElement) {
         continue;
       }
       // report problem
       hasProblem = true;
-      _errorReporter.reportErrorForOffset(CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER, accessor.nameOffset, name.length, [
-          _enclosingClass.displayName,
-          inherited.enclosingElement.displayName,
-          name]);
+      _errorReporter.reportErrorForOffset(
+          CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER,
+          accessor.nameOffset,
+          name.length,
+          [_enclosingClass.displayName, inherited.enclosingElement.displayName, name]);
     }
     // done
     return hasProblem;
@@ -2104,18 +2325,22 @@
       // prepare accessor properties
       String name = accessor.displayName;
       bool getter = accessor.isGetter;
-      // if non-final variable, ignore setter - we alreay reported problem for getter
+      // if non-final variable, ignore setter - we alreay reported problem for
+      // getter
       if (accessor.isSetter && accessor.isSynthetic) {
         continue;
       }
       // try to find super element
       ExecutableElement superElement;
-      superElement = enclosingType.lookUpGetterInSuperclass(name, _currentLibrary);
+      superElement =
+          enclosingType.lookUpGetterInSuperclass(name, _currentLibrary);
       if (superElement == null) {
-        superElement = enclosingType.lookUpSetterInSuperclass(name, _currentLibrary);
+        superElement =
+            enclosingType.lookUpSetterInSuperclass(name, _currentLibrary);
       }
       if (superElement == null) {
-        superElement = enclosingType.lookUpMethodInSuperclass(name, _currentLibrary);
+        superElement =
+            enclosingType.lookUpMethodInSuperclass(name, _currentLibrary);
       }
       if (superElement == null) {
         continue;
@@ -2125,14 +2350,21 @@
         continue;
       }
       // prepare "super" type to report its name
-      ClassElement superElementClass = superElement.enclosingElement as ClassElement;
+      ClassElement superElementClass =
+          superElement.enclosingElement as ClassElement;
       InterfaceType superElementType = superElementClass.type;
       // report problem
       hasProblem = true;
       if (getter) {
-        _errorReporter.reportErrorForElement(StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, accessor, [superElementType.displayName]);
+        _errorReporter.reportErrorForElement(
+            StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
+            accessor,
+            [superElementType.displayName]);
       } else {
-        _errorReporter.reportErrorForElement(StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, accessor, [superElementType.displayName]);
+        _errorReporter.reportErrorForElement(
+            StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
+            accessor,
+            [superElementType.displayName]);
       }
     }
     // done
@@ -2155,11 +2387,13 @@
     if (classMembers.isEmpty) {
       return false;
     }
-    // Create a HashMap to track conflicting members, and then loop through members in the class to
-    // construct the HashMap, at the same time, look for violations.  Don't add members if they are
-    // part of a conflict, this prevents multiple warnings for one issue.
+    // Create a HashMap to track conflicting members, and then loop through
+    // members in the class to construct the HashMap, at the same time,
+    // look for violations.  Don't add members if they are part of a conflict,
+    // this prevents multiple warnings for one issue.
     bool foundError = false;
-    HashMap<String, ClassMember> memberHashMap = new HashMap<String, ClassMember>();
+    HashMap<String, ClassMember> memberHashMap =
+        new HashMap<String, ClassMember>();
     for (ClassMember classMember in classMembers) {
       if (classMember is MethodDeclaration) {
         MethodDeclaration method = classMember;
@@ -2176,35 +2410,44 @@
         bool isSetter = method.isSetter;
         bool isOperator = method.isOperator;
         bool isMethod = !isGetter && !isSetter && !isOperator;
-        // Do lookups in the enclosing class (and the inherited member) if the member is a method or
-        // a setter for StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER warning.
+        // Do lookups in the enclosing class (and the inherited member) if the
+        // member is a method or a setter for
+        // StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER warning.
         if (isMethod) {
           String setterName = "${name.name}=";
           Element enclosingElementOfSetter = null;
           ClassMember conflictingSetter = memberHashMap[setterName];
           if (conflictingSetter != null) {
-            enclosingElementOfSetter = conflictingSetter.element.enclosingElement;
+            enclosingElementOfSetter =
+                conflictingSetter.element.enclosingElement;
           } else {
-            ExecutableElement elementFromInheritance = _inheritanceManager.lookupInheritance(_enclosingClass, setterName);
+            ExecutableElement elementFromInheritance =
+                _inheritanceManager.lookupInheritance(_enclosingClass, setterName);
             if (elementFromInheritance != null) {
-              enclosingElementOfSetter = elementFromInheritance.enclosingElement;
+              enclosingElementOfSetter =
+                  elementFromInheritance.enclosingElement;
             }
           }
           if (enclosingElementOfSetter != null) {
             // report problem
-            _errorReporter.reportErrorForNode(StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER, name, [
-                _enclosingClass.displayName,
-                name.name,
-                enclosingElementOfSetter.displayName]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER,
+                name,
+                [_enclosingClass.displayName, name.name, enclosingElementOfSetter.displayName]);
             foundError = true;
             addThisMemberToTheMap = false;
           }
         } else if (isSetter) {
           String methodName = name.name;
           ClassMember conflictingMethod = memberHashMap[methodName];
-          if (conflictingMethod != null && conflictingMethod is MethodDeclaration && !conflictingMethod.isGetter) {
+          if (conflictingMethod != null &&
+              conflictingMethod is MethodDeclaration &&
+              !conflictingMethod.isGetter) {
             // report problem
-            _errorReporter.reportErrorForNode(StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2, name, [_enclosingClass.displayName, name.name]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2,
+                name,
+                [_enclosingClass.displayName, name.name]);
             foundError = true;
             addThisMemberToTheMap = false;
           }
@@ -2230,7 +2473,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER].
    */
-  bool _checkForConflictingStaticGetterAndInstanceSetter(MethodDeclaration node) {
+  bool
+      _checkForConflictingStaticGetterAndInstanceSetter(MethodDeclaration node) {
     if (!node.isStatic) {
       return false;
     }
@@ -2246,7 +2490,8 @@
     }
     InterfaceType enclosingType = _enclosingClass.type;
     // try to find setter
-    ExecutableElement setter = enclosingType.lookUpSetter(name, _currentLibrary);
+    ExecutableElement setter =
+        enclosingType.lookUpSetter(name, _currentLibrary);
     if (setter == null) {
       return false;
     }
@@ -2258,7 +2503,10 @@
     ClassElement setterClass = setter.enclosingElement as ClassElement;
     InterfaceType setterType = setterClass.type;
     // report problem
-    _errorReporter.reportErrorForNode(StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, nameNode, [setterType.displayName]);
+    _errorReporter.reportErrorForNode(
+        StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
+        nameNode,
+        [setterType.displayName]);
     return true;
   }
 
@@ -2270,7 +2518,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER].
    */
-  bool _checkForConflictingStaticSetterAndInstanceMember(MethodDeclaration node) {
+  bool
+      _checkForConflictingStaticSetterAndInstanceMember(MethodDeclaration node) {
     if (!node.isStatic) {
       return false;
     }
@@ -2305,7 +2554,10 @@
     ClassElement memberClass = member.enclosingElement as ClassElement;
     InterfaceType memberType = memberClass.type;
     // report problem
-    _errorReporter.reportErrorForNode(StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER, nameNode, [memberType.displayName]);
+    _errorReporter.reportErrorForNode(
+        StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
+        nameNode,
+        [memberType.displayName]);
     return true;
   }
 
@@ -2323,12 +2575,22 @@
       String name = typeParameter.name;
       // name is same as the name of the enclosing class
       if (_enclosingClass.name == name) {
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS, typeParameter.nameOffset, name.length, [name]);
+        _errorReporter.reportErrorForOffset(
+            CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS,
+            typeParameter.nameOffset,
+            name.length,
+            [name]);
         problemReported = true;
       }
       // check members
-      if (_enclosingClass.getMethod(name) != null || _enclosingClass.getGetter(name) != null || _enclosingClass.getSetter(name) != null) {
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER, typeParameter.nameOffset, name.length, [name]);
+      if (_enclosingClass.getMethod(name) != null ||
+          _enclosingClass.getGetter(name) != null ||
+          _enclosingClass.getSetter(name) != null) {
+        _errorReporter.reportErrorForOffset(
+            CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
+            typeParameter.nameOffset,
+            name.length,
+            [name]);
         problemReported = true;
       }
     }
@@ -2353,7 +2615,9 @@
     }
     // check for mixins
     if (_enclosingClass.mixins.length != 0) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN, node.returnType);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN,
+          node.returnType);
       return true;
     }
     // try to find and check super constructor invocation
@@ -2364,7 +2628,10 @@
         if (element == null || element.isConst) {
           return false;
         }
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, superInvocation, [element.enclosingElement.displayName]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
+            superInvocation,
+            [element.enclosingElement.displayName]);
         return true;
       }
     }
@@ -2376,7 +2643,8 @@
     if (supertype.isObject) {
       return false;
     }
-    ConstructorElement unnamedConstructor = supertype.element.unnamedConstructor;
+    ConstructorElement unnamedConstructor =
+        supertype.element.unnamedConstructor;
     if (unnamedConstructor == null) {
       return false;
     }
@@ -2384,7 +2652,10 @@
       return false;
     }
     // default constructor is not 'const', report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, node.returnType, [supertype.displayName]);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
+        node.returnType,
+        [supertype.displayName]);
     return true;
   }
 
@@ -2397,7 +2668,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD].
    */
-  bool _checkForConstConstructorWithNonFinalField(ConstructorDeclaration node, ConstructorElement constructorElement) {
+  bool _checkForConstConstructorWithNonFinalField(ConstructorDeclaration node,
+      ConstructorElement constructorElement) {
     if (!_isEnclosingConstructorConst) {
       return false;
     }
@@ -2407,7 +2679,9 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, node);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
+        node);
     return true;
   }
 
@@ -2421,9 +2695,13 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.CONST_DEFERRED_CLASS].
    */
-  bool _checkForConstDeferredClass(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
+  bool _checkForConstDeferredClass(InstanceCreationExpression node,
+      ConstructorName constructorName, TypeName typeName) {
     if (typeName.isDeferred) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_DEFERRED_CLASS, constructorName, [typeName.name.name]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_DEFERRED_CLASS,
+          constructorName,
+          [typeName.name.name]);
       return true;
     }
     return false;
@@ -2439,7 +2717,9 @@
    */
   bool _checkForConstEvalThrowsException(ThrowExpression node) {
     if (_isEnclosingConstructorConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION,
+          node);
       return true;
     }
     return false;
@@ -2454,7 +2734,9 @@
    */
   bool _checkForConstFormalParameter(NormalFormalParameter node) {
     if (node.isConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_FORMAL_PARAMETER, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
+          node);
       return true;
     }
     return false;
@@ -2472,14 +2754,19 @@
    * See [StaticWarningCode.CONST_WITH_ABSTRACT_CLASS], and
    * [StaticWarningCode.NEW_WITH_ABSTRACT_CLASS].
    */
-  bool _checkForConstOrNewWithAbstractClass(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
+  bool _checkForConstOrNewWithAbstractClass(InstanceCreationExpression node,
+      TypeName typeName, InterfaceType type) {
     if (type.element.isAbstract) {
       ConstructorElement element = node.staticElement;
       if (element != null && !element.isFactory) {
         if ((node.keyword as sc.KeywordToken).keyword == sc.Keyword.CONST) {
-          _errorReporter.reportErrorForNode(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName);
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.CONST_WITH_ABSTRACT_CLASS,
+              typeName);
         } else {
-          _errorReporter.reportErrorForNode(StaticWarningCode.NEW_WITH_ABSTRACT_CLASS, typeName);
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.NEW_WITH_ABSTRACT_CLASS,
+              typeName);
         }
         return true;
       }
@@ -2497,9 +2784,12 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.INSTANTIATE_ENUM].
    */
-  bool _checkForConstOrNewWithEnum(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
+  bool _checkForConstOrNewWithEnum(InstanceCreationExpression node,
+      TypeName typeName, InterfaceType type) {
     if (type.element.isEnum) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANTIATE_ENUM, typeName);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.INSTANTIATE_ENUM,
+          typeName);
       return true;
     }
     return false;
@@ -2518,7 +2808,9 @@
   bool _checkForConstWithNonConst(InstanceCreationExpression node) {
     ConstructorElement constructorElement = node.staticElement;
     if (constructorElement != null && !constructorElement.isConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_NON_CONST, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_WITH_NON_CONST,
+          node);
       return true;
     }
     return false;
@@ -2542,7 +2834,9 @@
     }
     // should not be a type parameter
     if (name.staticElement is TypeParameterElement) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, name);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+          name);
     }
     // check type arguments
     TypeArgumentList typeArguments = typeName.typeArguments;
@@ -2572,7 +2866,8 @@
    * See [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR], and
    * [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT].
    */
-  bool _checkForConstWithUndefinedConstructor(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
+  bool _checkForConstWithUndefinedConstructor(InstanceCreationExpression node,
+      ConstructorName constructorName, TypeName typeName) {
     // OK if resolved
     if (node.staticElement != null) {
       return false;
@@ -2589,9 +2884,15 @@
     // report as named or default constructor absence
     SimpleIdentifier name = constructorName.name;
     if (name != null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, name, [className, name]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR,
+          name,
+          [className, name]);
     } else {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName, [className]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
+          constructorName,
+          [className]);
     }
     return true;
   }
@@ -2611,7 +2912,9 @@
       if (formalParameter is DefaultFormalParameter) {
         DefaultFormalParameter defaultFormalParameter = formalParameter;
         if (defaultFormalParameter.defaultValue != null) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, node);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
+              node);
           result = true;
         }
       }
@@ -2627,7 +2930,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER].
    */
-  bool _checkForDefaultValueInFunctionTypedParameter(DefaultFormalParameter node) {
+  bool
+      _checkForDefaultValueInFunctionTypedParameter(DefaultFormalParameter node) {
     // OK, not in a function typed parameter.
     if (!_isInFunctionTypedFormalParameter) {
       return false;
@@ -2637,7 +2941,9 @@
       return false;
     }
     // Report problem.
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER, node);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
+        node);
     return true;
   }
 
@@ -2653,7 +2959,8 @@
     NodeList<Directive> directives = node.directives;
     int count = directives.length;
     if (count > 0) {
-      HashMap<PrefixElement, List<ImportDirective>> prefixToDirectivesMap = new HashMap<PrefixElement, List<ImportDirective>>();
+      HashMap<PrefixElement, List<ImportDirective>> prefixToDirectivesMap =
+          new HashMap<PrefixElement, List<ImportDirective>>();
       for (int i = 0; i < count; i++) {
         Directive directive = directives[i];
         if (directive is ImportDirective) {
@@ -2663,7 +2970,8 @@
             Element element = prefix.staticElement;
             if (element is PrefixElement) {
               PrefixElement prefixElement = element;
-              List<ImportDirective> elements = prefixToDirectivesMap[prefixElement];
+              List<ImportDirective> elements =
+                  prefixToDirectivesMap[prefixElement];
               if (elements == null) {
                 elements = new List<ImportDirective>();
                 prefixToDirectivesMap[prefixElement] = elements;
@@ -2722,7 +3030,8 @@
       return false;
     }
     // try to find member
-    ExecutableElement inheritedMember = _inheritanceManager.lookupInheritance(_enclosingClass, name);
+    ExecutableElement inheritedMember =
+        _inheritanceManager.lookupInheritance(_enclosingClass, name);
     if (inheritedMember == null) {
       return false;
     }
@@ -2730,8 +3039,8 @@
     if (inheritedMember.isStatic) {
       return false;
     }
-    // determine the display name, use the extended display name if the enclosing class of the
-    // inherited member is in a different source
+    // determine the display name, use the extended display name if the
+    // enclosing class of the inherited member is in a different source
     String displayName;
     Element enclosingElement = inheritedMember.enclosingElement;
     if (enclosingElement.source == _enclosingClass.source) {
@@ -2740,7 +3049,11 @@
       displayName = enclosingElement.getExtendedDisplayName(null);
     }
     // report problem
-    _errorReporter.reportErrorForOffset(CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE, staticMember.nameOffset, name.length, [name, displayName]);
+    _errorReporter.reportErrorForOffset(
+        CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE,
+        staticMember.nameOffset,
+        name.length,
+        [name, displayName]);
     return true;
   }
 
@@ -2752,14 +3065,18 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS].
    */
-  bool _checkForExpectedOneListTypeArgument(ListLiteral node, TypeArgumentList typeArguments) {
+  bool _checkForExpectedOneListTypeArgument(ListLiteral node,
+      TypeArgumentList typeArguments) {
     // check number of type arguments
     int num = typeArguments.arguments.length;
     if (num == 1) {
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, typeArguments, [num]);
+    _errorReporter.reportErrorForNode(
+        StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
+        typeArguments,
+        [num]);
     return true;
   }
 
@@ -2773,7 +3090,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.EXPORT_DUPLICATED_LIBRARY_NAME].
    */
-  bool _checkForExportDuplicateLibraryName(ExportDirective node, ExportElement exportElement, LibraryElement exportedLibrary) {
+  bool _checkForExportDuplicateLibraryName(ExportDirective node,
+      ExportElement exportElement, LibraryElement exportedLibrary) {
     if (exportedLibrary == null) {
       return false;
     }
@@ -2786,13 +3104,15 @@
           _errorReporter.reportErrorForNode(
               StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED,
               node,
-              [prevLibrary.definingCompilationUnit.displayName,
+              [
+                  prevLibrary.definingCompilationUnit.displayName,
                   exportedLibrary.definingCompilationUnit.displayName]);
         } else {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED,
               node,
-              [prevLibrary.definingCompilationUnit.displayName,
+              [
+                  prevLibrary.definingCompilationUnit.displayName,
                   exportedLibrary.definingCompilationUnit.displayName,
                   name]);
         }
@@ -2815,7 +3135,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY].
    */
-  bool _checkForExportInternalLibrary(ExportDirective node, ExportElement exportElement) {
+  bool _checkForExportInternalLibrary(ExportDirective node,
+      ExportElement exportElement) {
     if (_isInSystemLibrary) {
       return false;
     }
@@ -2830,7 +3151,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, node, [node.uri]);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY,
+        node,
+        [node.uri]);
     return true;
   }
 
@@ -2845,7 +3169,9 @@
     if (node == null) {
       return false;
     }
-    return _checkForExtendsOrImplementsDeferredClass(node.superclass, CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS);
+    return _checkForExtendsOrImplementsDeferredClass(
+        node.superclass,
+        CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS);
   }
 
   /**
@@ -2859,7 +3185,9 @@
     if (node == null) {
       return false;
     }
-    return _checkForExtendsOrImplementsDeferredClass(node.superclass, CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS);
+    return _checkForExtendsOrImplementsDeferredClass(
+        node.superclass,
+        CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS);
   }
 
   /**
@@ -2873,7 +3201,9 @@
     if (node == null) {
       return false;
     }
-    return _checkForExtendsOrImplementsDisallowedClass(node.superclass, CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
+    return _checkForExtendsOrImplementsDisallowedClass(
+        node.superclass,
+        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
   }
 
   /**
@@ -2887,7 +3217,9 @@
     if (node == null) {
       return false;
     }
-    return _checkForExtendsOrImplementsDisallowedClass(node.superclass, CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
+    return _checkForExtendsOrImplementsDisallowedClass(
+        node.superclass,
+        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
   }
 
   /**
@@ -2904,12 +3236,16 @@
    * [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS], and
    * [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS].
    */
-  bool _checkForExtendsOrImplementsDeferredClass(TypeName typeName, ErrorCode errorCode) {
+  bool _checkForExtendsOrImplementsDeferredClass(TypeName typeName,
+      ErrorCode errorCode) {
     if (typeName.isSynthetic) {
       return false;
     }
     if (typeName.isDeferred) {
-      _errorReporter.reportErrorForNode(errorCode, typeName, [typeName.name.name]);
+      _errorReporter.reportErrorForNode(
+          errorCode,
+          typeName,
+          [typeName.name.name]);
       return true;
     }
     return false;
@@ -2929,31 +3265,38 @@
    * [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS], and
    * [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS].
    */
-  bool _checkForExtendsOrImplementsDisallowedClass(TypeName typeName, ErrorCode errorCode) {
+  bool _checkForExtendsOrImplementsDisallowedClass(TypeName typeName,
+      ErrorCode errorCode) {
     if (typeName.isSynthetic) {
       return false;
     }
     DartType superType = typeName.type;
-    for (InterfaceType disallowedType in _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT) {
+    for (InterfaceType disallowedType in
+        _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT) {
       if (superType != null && superType == disallowedType) {
-        // if the violating type happens to be 'num', we need to rule out the case where the
-        // enclosing class is 'int' or 'double'
+        // if the violating type happens to be 'num', we need to rule out the
+        // case where the enclosing class is 'int' or 'double'
         if (superType == _typeProvider.numType) {
           AstNode grandParent = typeName.parent.parent;
-          // Note: this is a corner case that won't happen often, so adding a field currentClass
-          // (see currentFunction) to ErrorVerifier isn't worth if for this case, but if the field
-          // currentClass is added, then this message should become a todo to not lookup the
-          // grandparent node
+          // Note: this is a corner case that won't happen often, so adding a
+          // field currentClass (see currentFunction) to ErrorVerifier isn't
+          // worth if for this case, but if the field currentClass is added,
+          // then this message should become a todo to not lookup the
+          // grandparent node.
           if (grandParent is ClassDeclaration) {
             ClassElement classElement = grandParent.element;
             DartType classType = classElement.type;
-            if (classType != null && (classType == _intType || classType == _typeProvider.doubleType)) {
+            if (classType != null &&
+                (classType == _intType || classType == _typeProvider.doubleType)) {
               return false;
             }
           }
         }
         // otherwise, report the error
-        _errorReporter.reportErrorForNode(errorCode, typeName, [disallowedType.displayName]);
+        _errorReporter.reportErrorForNode(
+            errorCode,
+            typeName,
+            [disallowedType.displayName]);
         return true;
       }
     }
@@ -2971,7 +3314,8 @@
    * See [CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE], and
    * [StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE].
    */
-  bool _checkForFieldInitializerNotAssignable(ConstructorFieldInitializer node, Element staticElement) {
+  bool _checkForFieldInitializerNotAssignable(ConstructorFieldInitializer node,
+      Element staticElement) {
     // prepare field element
     if (staticElement is! FieldElement) {
       return false;
@@ -2994,33 +3338,40 @@
     }
     // report problem
     if (_isEnclosingConstructorConst) {
-      // TODO(paulberry): this error should be based on the actual type of the constant, not the
-      // static type.  See dartbug.com/21119.
-      _errorReporter.reportTypeErrorForNode(CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [staticType, fieldType]);
+      // TODO(paulberry): this error should be based on the actual type of the
+      // constant, not the static type.  See dartbug.com/21119.
+      _errorReporter.reportTypeErrorForNode(
+          CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
+          expression,
+          [staticType, fieldType]);
     }
-    _errorReporter.reportTypeErrorForNode(StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [staticType, fieldType]);
+    _errorReporter.reportTypeErrorForNode(
+        StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
+        expression,
+        [staticType, fieldType]);
     return true;
-    // TODO(brianwilkerson) Define a hint corresponding to these errors and report it if appropriate.
-    //    // test the propagated type of the expression
-    //    Type propagatedType = expression.getPropagatedType();
-    //    if (propagatedType != null && propagatedType.isAssignableTo(fieldType)) {
-    //      return false;
-    //    }
-    //    // report problem
-    //    if (isEnclosingConstructorConst) {
-    //      errorReporter.reportTypeErrorForNode(
-    //          CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-    //          expression,
-    //          propagatedType == null ? staticType : propagatedType,
-    //          fieldType);
-    //    } else {
-    //      errorReporter.reportTypeErrorForNode(
-    //          StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
-    //          expression,
-    //          propagatedType == null ? staticType : propagatedType,
-    //          fieldType);
-    //    }
-    //    return true;
+    // TODO(brianwilkerson) Define a hint corresponding to these errors and
+    // report it if appropriate.
+//        // test the propagated type of the expression
+//        Type propagatedType = expression.getPropagatedType();
+//        if (propagatedType != null && propagatedType.isAssignableTo(fieldType)) {
+//          return false;
+//        }
+//        // report problem
+//        if (isEnclosingConstructorConst) {
+//          errorReporter.reportTypeErrorForNode(
+//              CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
+//              expression,
+//              propagatedType == null ? staticType : propagatedType,
+//              fieldType);
+//        } else {
+//          errorReporter.reportTypeErrorForNode(
+//              StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
+//              expression,
+//              propagatedType == null ? staticType : propagatedType,
+//              fieldType);
+//        }
+//        return true;
   }
 
   /**
@@ -3030,21 +3381,29 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR].
    */
-  bool _checkForFieldInitializingFormalRedirectingConstructor(FieldFormalParameter node) {
-    ConstructorDeclaration constructor = node.getAncestor((node) => node is ConstructorDeclaration);
+  bool
+      _checkForFieldInitializingFormalRedirectingConstructor(FieldFormalParameter node) {
+    ConstructorDeclaration constructor =
+        node.getAncestor((node) => node is ConstructorDeclaration);
     if (constructor == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+          node);
       return true;
     }
     // constructor cannot be a factory
     if (constructor.factoryKeyword != null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR,
+          node);
       return true;
     }
     // constructor cannot have a redirection
     for (ConstructorInitializer initializer in constructor.initializers) {
       if (initializer is RedirectingConstructorInvocation) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, node);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
+            node);
         return true;
       }
     }
@@ -3074,9 +3433,15 @@
       for (VariableDeclaration variable in variables) {
         if (variable.initializer == null) {
           if (node.isConst) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_NOT_INITIALIZED, variable.name, [variable.name.name]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.CONST_NOT_INITIALIZED,
+                variable.name,
+                [variable.name.name]);
           } else if (node.isFinal) {
-            _errorReporter.reportErrorForNode(StaticWarningCode.FINAL_NOT_INITIALIZED, variable.name, [variable.name.name]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.FINAL_NOT_INITIALIZED,
+                variable.name,
+                [variable.name.name]);
           }
           foundError = true;
         }
@@ -3104,8 +3469,8 @@
     }
     bool foundError = false;
     for (ClassMember classMember in classMembers) {
-      if (classMember is FieldDeclaration
-          && _checkForFinalNotInitialized(classMember.fields)) {
+      if (classMember is FieldDeclaration &&
+          _checkForFinalNotInitialized(classMember.fields)) {
         foundError = true;
       }
     }
@@ -3168,7 +3533,11 @@
    * TODO(scheglov) rename thid method
    */
   bool _checkForImplicitThisReferenceInInitializer(SimpleIdentifier node) {
-    if (!_isInConstructorInitializer && !_isInStaticMethod && !_isInFactory && !_isInInstanceVariableInitializer && !_isInStaticVariableDeclaration) {
+    if (!_isInConstructorInitializer &&
+        !_isInStaticMethod &&
+        !_isInFactory &&
+        !_isInInstanceVariableInitializer &&
+        !_isInStaticVariableDeclaration) {
       return false;
     }
     // prepare element
@@ -3194,7 +3563,8 @@
     // qualified method invocation
     if (parent is MethodInvocation) {
       MethodInvocation invocation = parent;
-      if (identical(invocation.methodName, node) && invocation.realTarget != null) {
+      if (identical(invocation.methodName, node) &&
+          invocation.realTarget != null) {
         return false;
       }
     }
@@ -3213,11 +3583,17 @@
     }
     // report problem
     if (_isInStaticMethod) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC,
+          node);
     } else if (_isInFactory) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
+          node);
     } else {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
+          node);
     }
     return true;
   }
@@ -3231,7 +3607,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.IMPORT_DUPLICATED_LIBRARY_NAME].
    */
-  bool _checkForImportDuplicateLibraryName(ImportDirective node, ImportElement importElement) {
+  bool _checkForImportDuplicateLibraryName(ImportDirective node,
+      ImportElement importElement) {
     // prepare imported library
     LibraryElement nodeLibrary = importElement.importedLibrary;
     if (nodeLibrary == null) {
@@ -3246,13 +3623,15 @@
           _errorReporter.reportErrorForNode(
               StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
               node,
-              [prevLibrary.definingCompilationUnit.displayName,
+              [
+                  prevLibrary.definingCompilationUnit.displayName,
                   nodeLibrary.definingCompilationUnit.displayName]);
         } else {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
               node,
-              [prevLibrary.definingCompilationUnit.displayName,
+              [
+                  prevLibrary.definingCompilationUnit.displayName,
                   nodeLibrary.definingCompilationUnit.displayName,
                   name]);
         }
@@ -3275,7 +3654,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY].
    */
-  bool _checkForImportInternalLibrary(ImportDirective node, ImportElement importElement) {
+  bool _checkForImportInternalLibrary(ImportDirective node,
+      ImportElement importElement) {
     if (_isInSystemLibrary) {
       return false;
     }
@@ -3290,7 +3670,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, node, [node.uri]);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
+        node,
+        [node.uri]);
     return true;
   }
 
@@ -3302,10 +3685,12 @@
    * See [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE].
    */
   bool _checkForInconsistentMethodInheritance() {
-    // Ensure that the inheritance manager has a chance to generate all errors we may care about,
-    // note that we ensure that the interfaces data since there are no errors.
+    // Ensure that the inheritance manager has a chance to generate all errors
+    // we may care about, note that we ensure that the interfaces data since
+    // there are no errors.
     _inheritanceManager.getMapOfMembersInheritedFromInterfaces(_enclosingClass);
-    HashSet<AnalysisError> errors = _inheritanceManager.getErrors(_enclosingClass);
+    HashSet<AnalysisError> errors =
+        _inheritanceManager.getErrors(_enclosingClass);
     if (errors == null || errors.isEmpty) {
       return false;
     }
@@ -3326,7 +3711,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER].
    */
-  bool _checkForInstanceAccessToStaticMember(ClassElement typeReference, SimpleIdentifier name) {
+  bool _checkForInstanceAccessToStaticMember(ClassElement typeReference,
+      SimpleIdentifier name) {
     // OK, in comment
     if (_isInComment) {
       return false;
@@ -3350,7 +3736,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, name, [name.name]);
+    _errorReporter.reportErrorForNode(
+        StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER,
+        name,
+        [name.name]);
     return true;
   }
 
@@ -3363,14 +3752,20 @@
    * @return `true` if and only if a warning was generated.
    * See [StaticTypeWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC].
    */
-  bool _checkForInstanceMethodNameCollidesWithSuperclassStatic(ExecutableElement executableElement, SimpleIdentifier errorNameTarget) {
+  bool
+      _checkForInstanceMethodNameCollidesWithSuperclassStatic(ExecutableElement executableElement,
+      SimpleIdentifier errorNameTarget) {
     String executableElementName = executableElement.name;
-    if (executableElement is! PropertyAccessorElement && !executableElement.isOperator) {
+    if (executableElement is! PropertyAccessorElement &&
+        !executableElement.isOperator) {
       HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
       InterfaceType superclassType = _enclosingClass.supertype;
-      ClassElement superclassElement = superclassType == null ? null : superclassType.element;
-      bool executableElementPrivate = Identifier.isPrivateName(executableElementName);
-      while (superclassElement != null && !visitedClasses.contains(superclassElement)) {
+      ClassElement superclassElement =
+          superclassType == null ? null : superclassType.element;
+      bool executableElementPrivate =
+          Identifier.isPrivateName(executableElementName);
+      while (superclassElement != null &&
+          !visitedClasses.contains(superclassElement)) {
         visitedClasses.add(superclassElement);
         LibraryElement superclassLibrary = superclassElement.library;
         // Check fields.
@@ -3381,14 +3776,16 @@
             continue;
           }
           // Ignore if private in a different library - cannot collide.
-          if (executableElementPrivate && _currentLibrary != superclassLibrary) {
+          if (executableElementPrivate &&
+              _currentLibrary != superclassLibrary) {
             continue;
           }
           // instance vs. static
           if (fieldElt.isStatic) {
-            _errorReporter.reportErrorForNode(StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, errorNameTarget, [
-                executableElementName,
-                fieldElt.enclosingElement.displayName]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
+                errorNameTarget,
+                [executableElementName, fieldElt.enclosingElement.displayName]);
             return true;
           }
         }
@@ -3400,19 +3797,22 @@
             continue;
           }
           // Ignore if private in a different library - cannot collide.
-          if (executableElementPrivate && _currentLibrary != superclassLibrary) {
+          if (executableElementPrivate &&
+              _currentLibrary != superclassLibrary) {
             continue;
           }
           // instance vs. static
           if (methodElement.isStatic) {
-            _errorReporter.reportErrorForNode(StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, errorNameTarget, [
-                executableElementName,
-                methodElement.enclosingElement.displayName]);
+            _errorReporter.reportErrorForNode(
+                StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
+                errorNameTarget,
+                [executableElementName, methodElement.enclosingElement.displayName]);
             return true;
           }
         }
         superclassType = superclassElement.supertype;
-        superclassElement = superclassType == null ? null : superclassType.element;
+        superclassElement =
+            superclassType == null ? null : superclassType.element;
       }
     }
     return false;
@@ -3432,8 +3832,13 @@
       return false;
     }
     ParameterElement staticParameterElement = argument.staticParameterElement;
-    DartType staticParameterType = staticParameterElement == null ? null : staticParameterElement.type;
-    return _checkForArgumentTypeNotAssignable(argument, staticParameterType, _intType, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+    DartType staticParameterType =
+        staticParameterElement == null ? null : staticParameterElement.type;
+    return _checkForArgumentTypeNotAssignable(
+        argument,
+        staticParameterType,
+        _intType,
+        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
   }
 
   /**
@@ -3447,7 +3852,9 @@
     Identifier nameIdentifier = node.name;
     if (nameIdentifier is PrefixedIdentifier) {
       if (nameIdentifier.isDeferred) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, node.name);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
+            node.name);
         return true;
       }
     }
@@ -3467,10 +3874,14 @@
       return false;
     }
     VariableElement leftVariableElement = getVariableElement(lhs);
-    DartType leftType = (leftVariableElement == null) ? getStaticType(lhs) : leftVariableElement.type;
+    DartType leftType =
+        (leftVariableElement == null) ? getStaticType(lhs) : leftVariableElement.type;
     DartType staticRightType = getStaticType(rhs);
     if (!staticRightType.isAssignableTo(leftType)) {
-      _errorReporter.reportTypeErrorForNode(StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [staticRightType, leftType]);
+      _errorReporter.reportTypeErrorForNode(
+          StaticTypeWarningCode.INVALID_ASSIGNMENT,
+          rhs,
+          [staticRightType, leftType]);
       return true;
     }
     return false;
@@ -3486,12 +3897,14 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticTypeWarningCode.INVALID_ASSIGNMENT].
    */
-  bool _checkForInvalidCompoundAssignment(AssignmentExpression node, Expression lhs, Expression rhs) {
+  bool _checkForInvalidCompoundAssignment(AssignmentExpression node,
+      Expression lhs, Expression rhs) {
     if (lhs == null) {
       return false;
     }
     VariableElement leftVariableElement = getVariableElement(lhs);
-    DartType leftType = (leftVariableElement == null) ? getStaticType(lhs) : leftVariableElement.type;
+    DartType leftType =
+        (leftVariableElement == null) ? getStaticType(lhs) : leftVariableElement.type;
     MethodElement invokedMethod = node.staticElement;
     if (invokedMethod == null) {
       return false;
@@ -3501,7 +3914,10 @@
       return false;
     }
     if (!rightType.isAssignableTo(leftType)) {
-      _errorReporter.reportTypeErrorForNode(StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [rightType, leftType]);
+      _errorReporter.reportTypeErrorForNode(
+          StaticTypeWarningCode.INVALID_ASSIGNMENT,
+          rhs,
+          [rightType, leftType]);
       return true;
     }
     return false;
@@ -3515,16 +3931,26 @@
    * @param staticElement the static element from the name in the
    *          [ConstructorFieldInitializer]
    */
-  void _checkForInvalidField(ConstructorFieldInitializer node, SimpleIdentifier fieldName, Element staticElement) {
+  void _checkForInvalidField(ConstructorFieldInitializer node,
+      SimpleIdentifier fieldName, Element staticElement) {
     if (staticElement is FieldElement) {
       FieldElement fieldElement = staticElement;
       if (fieldElement.isSynthetic) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, node, [fieldName]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
+            node,
+            [fieldName]);
       } else if (fieldElement.isStatic) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, node, [fieldName]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD,
+            node,
+            [fieldName]);
       }
     } else {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, node, [fieldName]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
+          node,
+          [fieldName]);
       return;
     }
   }
@@ -3537,7 +3963,8 @@
    * @param errorCode the error code to be reported if a modifier is found
    * @return `true` if an error was reported
    */
-  bool _checkForInvalidModifierOnBody(FunctionBody body, CompileTimeErrorCode errorCode) {
+  bool _checkForInvalidModifierOnBody(FunctionBody body,
+      CompileTimeErrorCode errorCode) {
     sc.Token keyword = body.keyword;
     if (keyword != null) {
       _errorReporter.reportErrorForToken(errorCode, keyword, [keyword.lexeme]);
@@ -3555,7 +3982,9 @@
    */
   bool _checkForInvalidReferenceToThis(ThisExpression node) {
     if (!_isThisInValidContext(node)) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS,
+          node);
       return true;
     }
     return false;
@@ -3571,7 +4000,9 @@
    *          [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]
    * @return `true` if and only if an error code is generated on the passed node
    */
-  bool _checkForInvalidTypeArgumentInConstTypedLiteral(NodeList<TypeName> arguments, ErrorCode errorCode) {
+  bool
+      _checkForInvalidTypeArgumentInConstTypedLiteral(NodeList<TypeName> arguments,
+      ErrorCode errorCode) {
     bool foundError = false;
     for (TypeName typeName in arguments) {
       if (typeName.type is TypeParameterType) {
@@ -3592,7 +4023,8 @@
    * See [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE], and
    * [StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForListElementTypeNotAssignable(ListLiteral node, TypeArgumentList typeArguments) {
+  bool _checkForListElementTypeNotAssignable(ListLiteral node,
+      TypeArgumentList typeArguments) {
     NodeList<TypeName> typeNames = typeArguments.arguments;
     if (typeNames.length < 1) {
       return false;
@@ -3633,7 +4065,8 @@
    * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
    * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForMapTypeNotAssignable(MapLiteral node, TypeArgumentList typeArguments) {
+  bool _checkForMapTypeNotAssignable(MapLiteral node,
+      TypeArgumentList typeArguments) {
     // Prepare maps key/value types.
     NodeList<TypeName> typeNames = typeArguments.arguments;
     if (typeNames.length < 2) {
@@ -3698,7 +4131,10 @@
     // check accessors
     for (PropertyAccessorElement accessor in _enclosingClass.accessors) {
       if (className == accessor.name) {
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME, accessor.nameOffset, className.length);
+        _errorReporter.reportErrorForOffset(
+            CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME,
+            accessor.nameOffset,
+            className.length);
         problemReported = true;
       }
     }
@@ -3716,40 +4152,50 @@
    * See [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES], and
    * [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE].
    */
-  bool _checkForMismatchedAccessorTypes(Declaration accessorDeclaration, String accessorTextName) {
-    ExecutableElement accessorElement = accessorDeclaration.element as ExecutableElement;
+  bool _checkForMismatchedAccessorTypes(Declaration accessorDeclaration,
+      String accessorTextName) {
+    ExecutableElement accessorElement =
+        accessorDeclaration.element as ExecutableElement;
     if (accessorElement is! PropertyAccessorElement) {
       return false;
     }
-    PropertyAccessorElement propertyAccessorElement = accessorElement as PropertyAccessorElement;
+    PropertyAccessorElement propertyAccessorElement =
+        accessorElement as PropertyAccessorElement;
     PropertyAccessorElement counterpartAccessor = null;
     ClassElement enclosingClassForCounterpart = null;
     if (propertyAccessorElement.isGetter) {
       counterpartAccessor = propertyAccessorElement.correspondingSetter;
     } else {
       counterpartAccessor = propertyAccessorElement.correspondingGetter;
-      // If the setter and getter are in the same enclosing element, return, this prevents having
-      // MISMATCHED_GETTER_AND_SETTER_TYPES reported twice.
-      if (counterpartAccessor != null && identical(counterpartAccessor.enclosingElement, propertyAccessorElement.enclosingElement)) {
+      // If the setter and getter are in the same enclosing element, return,
+      // this prevents having MISMATCHED_GETTER_AND_SETTER_TYPES reported twice.
+      if (counterpartAccessor != null &&
+          identical(
+              counterpartAccessor.enclosingElement,
+              propertyAccessorElement.enclosingElement)) {
         return false;
       }
     }
     if (counterpartAccessor == null) {
       // If the accessor is declared in a class, check the superclasses.
       if (_enclosingClass != null) {
-        // Figure out the correct identifier to lookup in the inheritance graph, if 'x', then 'x=',
-        // or if 'x=', then 'x'.
+        // Figure out the correct identifier to lookup in the inheritance graph,
+        // if 'x', then 'x=', or if 'x=', then 'x'.
         String lookupIdentifier = propertyAccessorElement.name;
         if (StringUtilities.endsWithChar(lookupIdentifier, 0x3D)) {
-          lookupIdentifier = lookupIdentifier.substring(0, lookupIdentifier.length - 1);
+          lookupIdentifier =
+              lookupIdentifier.substring(0, lookupIdentifier.length - 1);
         } else {
           lookupIdentifier += "=";
         }
         // lookup with the identifier.
-        ExecutableElement elementFromInheritance = _inheritanceManager.lookupInheritance(_enclosingClass, lookupIdentifier);
+        ExecutableElement elementFromInheritance =
+            _inheritanceManager.lookupInheritance(_enclosingClass, lookupIdentifier);
         // Verify that we found something, and that it is an accessor
-        if (elementFromInheritance != null && elementFromInheritance is PropertyAccessorElement) {
-          enclosingClassForCounterpart = elementFromInheritance.enclosingElement as ClassElement;
+        if (elementFromInheritance != null &&
+            elementFromInheritance is PropertyAccessorElement) {
+          enclosingClassForCounterpart =
+              elementFromInheritance.enclosingElement as ClassElement;
           counterpartAccessor = elementFromInheritance;
         }
       }
@@ -3768,18 +4214,26 @@
       setterType = _getSetterType(propertyAccessorElement);
       getterType = _getGetterType(counterpartAccessor);
     }
-    // If either types are not assignable to each other, report an error (if the getter is null,
-    // it is dynamic which is assignable to everything).
-    if (setterType != null && getterType != null && !getterType.isAssignableTo(setterType)) {
+    // If either types are not assignable to each other, report an error
+    // (if the getter is null, it is dynamic which is assignable to everything).
+    if (setterType != null &&
+        getterType != null &&
+        !getterType.isAssignableTo(setterType)) {
       if (enclosingClassForCounterpart == null) {
-        _errorReporter.reportTypeErrorForNode(StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES, accessorDeclaration, [accessorTextName, setterType, getterType]);
+        _errorReporter.reportTypeErrorForNode(
+            StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES,
+            accessorDeclaration,
+            [accessorTextName, setterType, getterType]);
         return true;
       } else {
-        _errorReporter.reportTypeErrorForNode(StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE, accessorDeclaration, [
-            accessorTextName,
-            setterType,
-            getterType,
-            enclosingClassForCounterpart.displayName]);
+        _errorReporter.reportTypeErrorForNode(
+            StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE,
+            accessorDeclaration,
+            [
+                accessorTextName,
+                setterType,
+                getterType,
+                enclosingClassForCounterpart.displayName]);
       }
     }
     return false;
@@ -3793,7 +4247,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    */
   bool _checkForMissingEnumConstantInSwitch(SwitchStatement statement) {
-    // TODO(brianwilkerson) This needs to be checked after constant values have been computed.
+    // TODO(brianwilkerson) This needs to be checked after constant values have
+    // been computed.
     Expression expression = statement.expression;
     DartType expressionType = getStaticType(expression);
     if (expressionType == null) {
@@ -3833,7 +4288,10 @@
       return false;
     }
     for (int i = 0; i < nameCount; i++) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH, statement, [constantNames[i]]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
+          statement,
+          [constantNames[i]]);
     }
     return true;
   }
@@ -3854,10 +4312,14 @@
     int withoutCount = _returnsWithout.length;
     if (withCount > 0 && withoutCount > 0) {
       for (int i = 0; i < withCount; i++) {
-        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWith[i].keyword);
+        _errorReporter.reportErrorForToken(
+            StaticWarningCode.MIXED_RETURN_TYPES,
+            _returnsWith[i].keyword);
       }
       for (int i = 0; i < withoutCount; i++) {
-        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWithout[i].keyword);
+        _errorReporter.reportErrorForToken(
+            StaticWarningCode.MIXED_RETURN_TYPES,
+            _returnsWithout[i].keyword);
       }
       return true;
     }
@@ -3872,10 +4334,14 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR].
    */
-  bool _checkForMixinDeclaresConstructor(TypeName mixinName, ClassElement mixinElement) {
+  bool _checkForMixinDeclaresConstructor(TypeName mixinName,
+      ClassElement mixinElement) {
     for (ConstructorElement constructor in mixinElement.constructors) {
       if (!constructor.isSynthetic && !constructor.isFactory) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR, mixinName, [mixinElement.name]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR,
+            mixinName,
+            [mixinElement.name]);
         return true;
       }
     }
@@ -3890,11 +4356,16 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT].
    */
-  bool _checkForMixinInheritsNotFromObject(TypeName mixinName, ClassElement mixinElement) {
+  bool _checkForMixinInheritsNotFromObject(TypeName mixinName,
+      ClassElement mixinElement) {
     InterfaceType mixinSupertype = mixinElement.supertype;
     if (mixinSupertype != null) {
-      if (!mixinSupertype.isObject || !mixinElement.isTypedef && mixinElement.mixins.length != 0) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, mixinName, [mixinElement.name]);
+      if (!mixinSupertype.isObject ||
+          !mixinElement.isTypedef && mixinElement.mixins.length != 0) {
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT,
+            mixinName,
+            [mixinElement.name]);
         return true;
       }
     }
@@ -3909,9 +4380,13 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER].
    */
-  bool _checkForMixinReferencesSuper(TypeName mixinName, ClassElement mixinElement) {
+  bool _checkForMixinReferencesSuper(TypeName mixinName,
+      ClassElement mixinElement) {
     if (mixinElement.hasReferenceToSuper) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MIXIN_REFERENCES_SUPER, mixinName, [mixinElement.name]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MIXIN_REFERENCES_SUPER,
+          mixinName,
+          [mixinElement.name]);
     }
     return false;
   }
@@ -3929,7 +4404,9 @@
       if (initializer is SuperConstructorInvocation) {
         numSuperInitializers++;
         if (numSuperInitializers > 1) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, initializer);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
+              initializer);
         }
       }
     }
@@ -3945,7 +4422,9 @@
    */
   bool _checkForNativeFunctionBodyInNonSDKCode(NativeFunctionBody node) {
     if (!_isInSystemLibrary && !_hasExtUri) {
-      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, node);
+      _errorReporter.reportErrorForNode(
+          ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
+          node);
       return true;
     }
     return false;
@@ -3962,7 +4441,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR].
    */
-  bool _checkForNewWithUndefinedConstructor(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
+  bool _checkForNewWithUndefinedConstructor(InstanceCreationExpression node,
+      ConstructorName constructorName, TypeName typeName) {
     // OK if resolved
     if (node.staticElement != null) {
       return false;
@@ -3980,9 +4460,15 @@
     // report as named or default constructor absence
     SimpleIdentifier name = constructorName.name;
     if (name != null) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, name, [className, name]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR,
+          name,
+          [className, name]);
     } else {
-      _errorReporter.reportErrorForNode(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, constructorName, [className]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
+          constructorName,
+          [className]);
     }
     return true;
   }
@@ -3996,6 +4482,11 @@
    * See [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT].
    */
   bool _checkForNoDefaultSuperConstructorImplicit(ClassDeclaration node) {
+    // do nothing if mixin errors have already been reported for this class.
+    ClassElementImpl enclosingClass = _enclosingClass;
+    if (enclosingClass.mixinErrorsReported) {
+      return false;
+    }
     // do nothing if there is explicit constructor
     List<ConstructorElement> constructors = _enclosingClass.constructors;
     if (!constructors[0].isSynthetic) {
@@ -4008,20 +4499,26 @@
     }
     ClassElement superElement = superType.element;
     // try to find default generative super constructor
-    ConstructorElement superUnnamedConstructor = superElement.unnamedConstructor;
+    ConstructorElement superUnnamedConstructor =
+        superElement.unnamedConstructor;
     if (superUnnamedConstructor != null) {
       if (superUnnamedConstructor.isFactory) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.name, [superUnnamedConstructor]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+            node.name,
+            [superUnnamedConstructor]);
         return true;
       }
       if (superUnnamedConstructor.isDefaultConstructor &&
-          _enclosingClass.isSuperConstructorAccessible(
-              superUnnamedConstructor)) {
+          _enclosingClass.isSuperConstructorAccessible(superUnnamedConstructor)) {
         return true;
       }
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, node.name, [superType.displayName]);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
+        node.name,
+        [superType.displayName]);
     return true;
   }
 
@@ -4038,7 +4535,8 @@
    * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR], and
    * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS].
    */
-  bool _checkForNonAbstractClassInheritsAbstractMember(SimpleIdentifier classNameNode) {
+  bool
+      _checkForNonAbstractClassInheritsAbstractMember(SimpleIdentifier classNameNode) {
     if (_enclosingClass.isAbstract) {
       return false;
     }
@@ -4049,80 +4547,105 @@
     for (MethodElement method in methods) {
       String methodName = method.name;
       // If the enclosing class declares the method noSuchMethod(), then return.
-      // From Spec:  It is a static warning if a concrete class does not have an implementation for
-      // a method in any of its superinterfaces unless it declares its own noSuchMethod
-      // method (7.10).
+      // From Spec:  It is a static warning if a concrete class does not have an
+      // implementation for a method in any of its superinterfaces unless it
+      // declares its own noSuchMethod method (7.10).
       if (methodName == FunctionElement.NO_SUCH_METHOD_METHOD_NAME) {
         return false;
       }
     }
-    HashSet<ExecutableElement> missingOverrides = new HashSet<ExecutableElement>();
+    HashSet<ExecutableElement> missingOverrides =
+        new HashSet<ExecutableElement>();
     //
-    // Loop through the set of all executable elements declared in the implicit interface.
+    // Loop through the set of all executable elements declared in the implicit
+    // interface.
     //
-    MemberMap membersInheritedFromInterfaces = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(_enclosingClass);
-    MemberMap membersInheritedFromSuperclasses = _inheritanceManager.getMapOfMembersInheritedFromClasses(_enclosingClass);
+    MemberMap membersInheritedFromInterfaces =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(_enclosingClass);
+    MemberMap membersInheritedFromSuperclasses =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(_enclosingClass);
     for (int i = 0; i < membersInheritedFromInterfaces.size; i++) {
       String memberName = membersInheritedFromInterfaces.getKey(i);
-      ExecutableElement executableElt = membersInheritedFromInterfaces.getValue(i);
+      ExecutableElement executableElt =
+          membersInheritedFromInterfaces.getValue(i);
       if (memberName == null) {
         break;
       }
-      // If the element is not synthetic and can be determined to be defined in Object, skip it.
-      if (executableElt.enclosingElement != null && (executableElt.enclosingElement as ClassElement).type.isObject) {
+      // If the element is not synthetic and can be determined to be defined in
+      // Object, skip it.
+      if (executableElt.enclosingElement != null &&
+          (executableElt.enclosingElement as ClassElement).type.isObject) {
         continue;
       }
-      // Check to see if some element is in local enclosing class that matches the name of the
-      // required member.
+      // Check to see if some element is in local enclosing class that matches
+      // the name of the required member.
       if (_isMemberInClassOrMixin(executableElt, _enclosingClass)) {
-        // We do not have to verify that this implementation of the found method matches the
-        // required function type: the set of StaticWarningCode.INVALID_METHOD_OVERRIDE_* warnings
-        // break out the different specific situations.
+        // We do not have to verify that this implementation of the found method
+        // matches the required function type: the set of
+        // StaticWarningCode.INVALID_METHOD_OVERRIDE_* warnings break out the
+        // different specific situations.
         continue;
       }
-      // First check to see if this element was declared in the superclass chain, in which case
-      // there is already a concrete implementation.
+      // First check to see if this element was declared in the superclass
+      // chain, in which case there is already a concrete implementation.
       ExecutableElement elt = membersInheritedFromSuperclasses.get(memberName);
-      // Check to see if an element was found in the superclass chain with the correct name.
+      // Check to see if an element was found in the superclass chain with the
+      // correct name.
       if (elt != null) {
         // Reference the types, if any are null then continue.
         InterfaceType enclosingType = _enclosingClass.type;
         FunctionType concreteType = elt.type;
         FunctionType requiredMemberType = executableElt.type;
-        if (enclosingType == null || concreteType == null || requiredMemberType == null) {
+        if (enclosingType == null ||
+            concreteType == null ||
+            requiredMemberType == null) {
           continue;
         }
-        // Some element was found in the superclass chain that matches the name of the required
-        // member.
-        // If it is not abstract and it is the correct one (types match- the version of this method
-        // that we have has the correct number of parameters, etc), then this class has a valid
-        // implementation of this method, so skip it.
-        if ((elt is MethodElement && !elt.isAbstract) || (elt is PropertyAccessorElement && !elt.isAbstract)) {
-          // Since we are comparing two function types, we need to do the appropriate type
-          // substitutions first ().
-          FunctionType foundConcreteFT = _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(concreteType, memberName, enclosingType);
-          FunctionType requiredMemberFT = _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(requiredMemberType, memberName, enclosingType);
+        // Some element was found in the superclass chain that matches the name
+        // of the required member.
+        // If it is not abstract and it is the correct one (types match- the
+        // version of this method that we have has the correct number of
+        // parameters, etc), then this class has a valid implementation of this
+        // method, so skip it.
+        if ((elt is MethodElement && !elt.isAbstract) ||
+            (elt is PropertyAccessorElement && !elt.isAbstract)) {
+          // Since we are comparing two function types, we need to do the
+          // appropriate type substitutions first ().
+          FunctionType foundConcreteFT =
+              _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(
+                  concreteType,
+                  memberName,
+                  enclosingType);
+          FunctionType requiredMemberFT =
+              _inheritanceManager.substituteTypeArgumentsInMemberFromInheritance(
+                  requiredMemberType,
+                  memberName,
+                  enclosingType);
           if (foundConcreteFT.isSubtypeOf(requiredMemberFT)) {
             continue;
           }
         }
       }
-      // The not qualifying concrete executable element was found, add it to the list.
+      // The not qualifying concrete executable element was found, add it to the
+      // list.
       missingOverrides.add(executableElt);
     }
-    // Now that we have the set of missing overrides, generate a warning on this class
+    // Now that we have the set of missing overrides, generate a warning on this
+    // class.
     int missingOverridesSize = missingOverrides.length;
     if (missingOverridesSize == 0) {
       return false;
     }
-    List<ExecutableElement> missingOverridesArray = new List.from(missingOverrides);
+    List<ExecutableElement> missingOverridesArray =
+        new List.from(missingOverrides);
     List<String> stringMembersArrayListSet = new List<String>();
     for (int i = 0; i < missingOverridesArray.length; i++) {
       String newStrMember;
       Element enclosingElement = missingOverridesArray[i].enclosingElement;
       String prefix = StringUtilities.EMPTY;
       if (missingOverridesArray[i] is PropertyAccessorElement) {
-        PropertyAccessorElement propertyAccessorElement = missingOverridesArray[i] as PropertyAccessorElement;
+        PropertyAccessorElement propertyAccessorElement =
+            missingOverridesArray[i] as PropertyAccessorElement;
         if (propertyAccessorElement.isGetter) {
           prefix = _GETTER_SPACE;
           // "getter "
@@ -4132,7 +4655,8 @@
         }
       }
       if (enclosingElement != null) {
-        newStrMember = "$prefix'${enclosingElement.displayName}.${missingOverridesArray[i].displayName}'";
+        newStrMember =
+            "$prefix'${enclosingElement.displayName}.${missingOverridesArray[i].displayName}'";
       } else {
         newStrMember = "$prefix'${missingOverridesArray[i].displayName}'";
       }
@@ -4141,29 +4665,43 @@
     List<String> stringMembersArray = new List.from(stringMembersArrayListSet);
     AnalysisErrorWithProperties analysisError;
     if (stringMembersArray.length == 1) {
-      analysisError = _errorReporter.newErrorWithProperties(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, classNameNode, [stringMembersArray[0]]);
+      analysisError = _errorReporter.newErrorWithProperties(
+          StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
+          classNameNode,
+          [stringMembersArray[0]]);
     } else if (stringMembersArray.length == 2) {
-      analysisError = _errorReporter.newErrorWithProperties(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, classNameNode, [stringMembersArray[0], stringMembersArray[1]]);
+      analysisError = _errorReporter.newErrorWithProperties(
+          StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
+          classNameNode,
+          [stringMembersArray[0], stringMembersArray[1]]);
     } else if (stringMembersArray.length == 3) {
-      analysisError = _errorReporter.newErrorWithProperties(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, classNameNode, [
-          stringMembersArray[0],
-          stringMembersArray[1],
-          stringMembersArray[2]]);
+      analysisError = _errorReporter.newErrorWithProperties(
+          StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
+          classNameNode,
+          [stringMembersArray[0], stringMembersArray[1], stringMembersArray[2]]);
     } else if (stringMembersArray.length == 4) {
-      analysisError = _errorReporter.newErrorWithProperties(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, classNameNode, [
-          stringMembersArray[0],
-          stringMembersArray[1],
-          stringMembersArray[2],
-          stringMembersArray[3]]);
+      analysisError = _errorReporter.newErrorWithProperties(
+          StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
+          classNameNode,
+          [
+              stringMembersArray[0],
+              stringMembersArray[1],
+              stringMembersArray[2],
+              stringMembersArray[3]]);
     } else {
-      analysisError = _errorReporter.newErrorWithProperties(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, classNameNode, [
-          stringMembersArray[0],
-          stringMembersArray[1],
-          stringMembersArray[2],
-          stringMembersArray[3],
-          stringMembersArray.length - 4]);
+      analysisError = _errorReporter.newErrorWithProperties(
+          StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS,
+          classNameNode,
+          [
+              stringMembersArray[0],
+              stringMembersArray[1],
+              stringMembersArray[2],
+              stringMembersArray[3],
+              stringMembersArray.length - 4]);
     }
-    analysisError.setProperty(ErrorProperty.UNIMPLEMENTED_METHODS, missingOverridesArray);
+    analysisError.setProperty(
+        ErrorProperty.UNIMPLEMENTED_METHODS,
+        missingOverridesArray);
     _errorReporter.reportError(analysisError);
     return true;
   }
@@ -4179,7 +4717,9 @@
   bool _checkForNonBoolCondition(Expression condition) {
     DartType conditionType = getStaticType(condition);
     if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_CONDITION, condition);
+      _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.NON_BOOL_CONDITION,
+          condition);
       return true;
     }
     return false;
@@ -4197,13 +4737,18 @@
     DartType type = getStaticType(expression);
     if (type is InterfaceType) {
       if (!type.isAssignableTo(_boolType)) {
-        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
+        _errorReporter.reportErrorForNode(
+            StaticTypeWarningCode.NON_BOOL_EXPRESSION,
+            expression);
         return true;
       }
     } else if (type is FunctionType) {
       FunctionType functionType = type;
-      if (functionType.typeArguments.length == 0 && !functionType.returnType.isAssignableTo(_boolType)) {
-        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
+      if (functionType.typeArguments.length == 0 &&
+          !functionType.returnType.isAssignableTo(_boolType)) {
+        _errorReporter.reportErrorForNode(
+            StaticTypeWarningCode.NON_BOOL_EXPRESSION,
+            expression);
         return true;
       }
     }
@@ -4220,7 +4765,9 @@
   bool _checkForNonBoolNegationExpression(Expression expression) {
     DartType conditionType = getStaticType(expression);
     if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, expression);
+      _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION,
+          expression);
       return true;
     }
     return false;
@@ -4246,7 +4793,8 @@
       return false;
     }
     // prepare statement
-    Statement statement = node.getAncestor((node) => node is ExpressionStatement);
+    Statement statement =
+        node.getAncestor((node) => node is ExpressionStatement);
     if (statement == null) {
       return false;
     }
@@ -4255,7 +4803,9 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, node);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
+        node);
     return true;
   }
 
@@ -4278,7 +4828,9 @@
     if (typeName != null) {
       DartType type = typeName.type;
       if (type != null && !type.isVoid) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR,
+            typeName);
       }
     }
     // no warning
@@ -4296,7 +4848,9 @@
     if (typeName != null) {
       DartType type = typeName.type;
       if (type != null && !type.isVoid) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
+            typeName);
       }
     }
     return false;
@@ -4321,7 +4875,9 @@
     NodeList<FormalParameter> formalParameters = parameterList.parameters;
     for (FormalParameter formalParameter in formalParameters) {
       if (formalParameter.kind.isOptional) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, formalParameter);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR,
+            formalParameter);
         foundError = true;
       }
     }
@@ -4346,7 +4902,9 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER,
+        node);
     return true;
   }
 
@@ -4359,12 +4917,14 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT].
    */
-  bool _checkForRecursiveConstructorRedirect(ConstructorDeclaration node, ConstructorElement constructorElement) {
+  bool _checkForRecursiveConstructorRedirect(ConstructorDeclaration node,
+      ConstructorElement constructorElement) {
     // we check generative constructor here
     if (node.factoryKeyword != null) {
       return false;
     }
-    // try to find redirecting constructor invocation and analyzer it for recursion
+    // try to find redirecting constructor invocation and analyzer it for
+    // recursion
     for (ConstructorInitializer initializer in node.initializers) {
       if (initializer is RedirectingConstructorInvocation) {
         // OK if no cycle
@@ -4372,7 +4932,9 @@
           return false;
         }
         // report error
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, initializer);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+            initializer);
         return true;
       }
     }
@@ -4389,7 +4951,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT].
    */
-  bool _checkForRecursiveFactoryRedirect(ConstructorDeclaration node, ConstructorElement constructorElement) {
+  bool _checkForRecursiveFactoryRedirect(ConstructorDeclaration node,
+      ConstructorElement constructorElement) {
     // prepare redirected constructor
     ConstructorName redirectedConstructorNode = node.redirectedConstructor;
     if (redirectedConstructorNode == null) {
@@ -4400,7 +4963,9 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, redirectedConstructorNode);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+        redirectedConstructorNode);
     return true;
   }
 
@@ -4417,7 +4982,9 @@
     if (classElt == null) {
       return false;
     }
-    return _safeCheckForRecursiveInterfaceInheritance(classElt, new List<ClassElement>());
+    return _safeCheckForRecursiveInterfaceInheritance(
+        classElt,
+        new List<ClassElement>());
   }
 
   /**
@@ -4440,8 +5007,11 @@
     ConstructorName redirectedConstructor = node.redirectedConstructor;
     if (redirectedConstructor != null) {
       for (FormalParameter parameter in node.parameters.parameters) {
-        if (parameter is DefaultFormalParameter && parameter.defaultValue != null) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, parameter.identifier);
+        if (parameter is DefaultFormalParameter &&
+            parameter.defaultValue != null) {
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR,
+              parameter.identifier);
           errorReported = true;
         }
       }
@@ -4451,7 +5021,9 @@
     for (ConstructorInitializer initializer in node.initializers) {
       if (initializer is RedirectingConstructorInvocation) {
         if (numRedirections > 0) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, initializer);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
+              initializer);
           errorReported = true;
         }
         if (node.factoryKeyword == null) {
@@ -4463,10 +5035,15 @@
             if (invocation.constructorName != null) {
               constructorStrName += ".${invocation.constructorName.name}";
             }
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, invocation, [constructorStrName, enclosingTypeName]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
+                invocation,
+                [constructorStrName, enclosingTypeName]);
           } else {
             if (redirectingElement.isFactory) {
-              _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, initializer);
+              _errorReporter.reportErrorForNode(
+                  CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR,
+                  initializer);
             }
           }
         }
@@ -4477,11 +5054,15 @@
     if (numRedirections > 0) {
       for (ConstructorInitializer initializer in node.initializers) {
         if (initializer is SuperConstructorInvocation) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, initializer);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
+              initializer);
           errorReported = true;
         }
         if (initializer is ConstructorFieldInitializer) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, initializer);
+          _errorReporter.reportErrorForNode(
+              CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
+              initializer);
           errorReported = true;
         }
       }
@@ -4499,7 +5080,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR].
    */
-  bool _checkForRedirectToNonConstConstructor(ConstructorDeclaration node, ConstructorElement constructorElement) {
+  bool _checkForRedirectToNonConstConstructor(ConstructorDeclaration node,
+      ConstructorElement constructorElement) {
     // prepare redirected constructor
     ConstructorName redirectedConstructorNode = node.redirectedConstructor;
     if (redirectedConstructorNode == null) {
@@ -4514,7 +5096,8 @@
       return false;
     }
     // prepare redirected constructor
-    ConstructorElement redirectedConstructor = constructorElement.redirectedConstructor;
+    ConstructorElement redirectedConstructor =
+        constructorElement.redirectedConstructor;
     if (redirectedConstructor == null) {
       return false;
     }
@@ -4523,7 +5106,9 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, redirectedConstructorNode);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR,
+        redirectedConstructorNode);
     return true;
   }
 
@@ -4536,7 +5121,9 @@
    */
   bool _checkForRethrowOutsideCatch(RethrowExpression node) {
     if (!_isInCatchClause) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, node);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH,
+          node);
       return true;
     }
     return false;
@@ -4561,7 +5148,9 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, body);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR,
+        body);
     return true;
   }
 
@@ -4577,58 +5166,62 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE].
    */
-  bool _checkForReturnOfInvalidType(Expression returnExpression, DartType expectedReturnType) {
+  bool _checkForReturnOfInvalidType(Expression returnExpression,
+      DartType expectedReturnType) {
     if (_enclosingFunction == null) {
       return false;
     }
     DartType staticReturnType = getStaticType(returnExpression);
     if (expectedReturnType.isVoid) {
-      if (staticReturnType.isVoid || staticReturnType.isDynamic || staticReturnType.isBottom) {
+      if (staticReturnType.isVoid ||
+          staticReturnType.isDynamic ||
+          staticReturnType.isBottom) {
         return false;
       }
-      _errorReporter.reportTypeErrorForNode(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [
-          staticReturnType,
-          expectedReturnType,
-          _enclosingFunction.displayName]);
+      _errorReporter.reportTypeErrorForNode(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+          returnExpression,
+          [staticReturnType, expectedReturnType, _enclosingFunction.displayName]);
       return true;
     }
     if (_enclosingFunction.isAsynchronous && !_enclosingFunction.isGenerator) {
-      // TODO(brianwilkerson) Figure out how to get the type "Future" so that we can build the type
-      // we need to test against.
-      //      InterfaceType impliedType = "Future<" + flatten(staticReturnType) + ">"
-      //      if (impliedType.isAssignableTo(expectedReturnType)) {
-      //        return false;
-      //      }
-      //      errorReporter.reportTypeErrorForNode(
-      //          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
-      //          returnExpression,
-      //          impliedType,
-      //          expectedReturnType.getDisplayName(),
-      //          enclosingFunction.getDisplayName());
-      //      return true;
+      // TODO(brianwilkerson) Figure out how to get the type "Future" so that we
+      // can build the type we need to test against.
+//            InterfaceType impliedType = "Future<" + flatten(staticReturnType) + ">"
+//            if (impliedType.isAssignableTo(expectedReturnType)) {
+//              return false;
+//            }
+//            errorReporter.reportTypeErrorForNode(
+//                StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+//                returnExpression,
+//                impliedType,
+//                expectedReturnType.getDisplayName(),
+//                enclosingFunction.getDisplayName());
+//            return true;
       return false;
     }
     if (staticReturnType.isAssignableTo(expectedReturnType)) {
       return false;
     }
-    _errorReporter.reportTypeErrorForNode(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [
-        staticReturnType,
-        expectedReturnType,
-        _enclosingFunction.displayName]);
+    _errorReporter.reportTypeErrorForNode(
+        StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+        returnExpression,
+        [staticReturnType, expectedReturnType, _enclosingFunction.displayName]);
     return true;
-    // TODO(brianwilkerson) Define a hint corresponding to the warning and report it if appropriate.
-    //    Type propagatedReturnType = returnExpression.getPropagatedType();
-    //    boolean isPropagatedAssignable = propagatedReturnType.isAssignableTo(expectedReturnType);
-    //    if (isStaticAssignable || isPropagatedAssignable) {
-    //      return false;
-    //    }
-    //    errorReporter.reportTypeErrorForNode(
-    //        StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
-    //        returnExpression,
-    //        staticReturnType,
-    //        expectedReturnType,
-    //        enclosingFunction.getDisplayName());
-    //    return true;
+    // TODO(brianwilkerson) Define a hint corresponding to the warning and
+    // report it if appropriate.
+//        Type propagatedReturnType = returnExpression.getPropagatedType();
+//        boolean isPropagatedAssignable = propagatedReturnType.isAssignableTo(expectedReturnType);
+//        if (isStaticAssignable || isPropagatedAssignable) {
+//          return false;
+//        }
+//        errorReporter.reportTypeErrorForNode(
+//            StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+//            returnExpression,
+//            staticReturnType,
+//            expectedReturnType,
+//            enclosingFunction.getDisplayName());
+//        return true;
   }
 
   /**
@@ -4642,7 +5235,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER].
    */
-  bool _checkForStaticAccessToInstanceMember(ClassElement typeReference, SimpleIdentifier name) {
+  bool _checkForStaticAccessToInstanceMember(ClassElement typeReference,
+      SimpleIdentifier name) {
     // OK, target is not a type
     if (typeReference == null) {
       return false;
@@ -4658,7 +5252,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, name, [name.name]);
+    _errorReporter.reportErrorForNode(
+        StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER,
+        name,
+        [name.name]);
     return true;
   }
 
@@ -4692,7 +5289,10 @@
         return false;
       }
       // report problem
-      _errorReporter.reportErrorForNode(StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE, expression, [expressionType, caseType]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE,
+          expression,
+          [expressionType, caseType]);
       return true;
     }
     return false;
@@ -4705,12 +5305,15 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF].
    */
-  bool _checkForTypeAliasCannotReferenceItself_function(FunctionTypeAlias node) {
+  bool
+      _checkForTypeAliasCannotReferenceItself_function(FunctionTypeAlias node) {
     FunctionTypeAliasElement element = node.element;
     if (!_hasTypedefSelfReference(element)) {
       return false;
     }
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, node);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+        node);
     return true;
   }
 
@@ -4723,7 +5326,10 @@
    */
   bool _checkForTypeAnnotationDeferredClass(TypeName node) {
     if (node != null && node.isDeferred) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS, node, [node.name]);
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
+          node,
+          [node.name]);
     }
     return false;
   }
@@ -4756,14 +5362,16 @@
     // iterate over each bounded type parameter and corresponding argument
     NodeList<TypeName> typeNameArgList = node.typeArguments.arguments;
     List<DartType> typeArguments = (type as InterfaceType).typeArguments;
-    int loopThroughIndex = math.min(typeNameArgList.length, boundingElts.length);
+    int loopThroughIndex =
+        math.min(typeNameArgList.length, boundingElts.length);
     bool foundError = false;
     for (int i = 0; i < loopThroughIndex; i++) {
       TypeName argTypeName = typeNameArgList[i];
       DartType argType = argTypeName.type;
       DartType boundType = boundingElts[i].bound;
       if (argType != null && boundType != null) {
-        if (typeArguments.length != 0 && typeArguments.length == typeParameters.length) {
+        if (typeArguments.length != 0 &&
+            typeArguments.length == typeParameters.length) {
           boundType = boundType.substitute2(typeArguments, typeParameters);
         }
         if (!argType.isSubtypeOf(boundType)) {
@@ -4773,7 +5381,10 @@
           } else {
             errorCode = StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS;
           }
-          _errorReporter.reportTypeErrorForNode(errorCode, argTypeName, [argType, boundType]);
+          _errorReporter.reportTypeErrorForNode(
+              errorCode,
+              argTypeName,
+              [argType, boundType]);
           foundError = true;
         }
       }
@@ -4793,7 +5404,9 @@
     if (_isInStaticMethod || _isInStaticVariableDeclaration) {
       DartType type = node.type;
       if (type is TypeParameterType) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, node);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC,
+            node);
         return true;
       }
     }
@@ -4819,7 +5432,10 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, node, [element.displayName]);
+    _errorReporter.reportErrorForNode(
+        StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
+        node,
+        [element.displayName]);
     return true;
   }
 
@@ -4834,7 +5450,16 @@
    * [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR], and
    * [StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT].
    */
-  bool _checkForUndefinedConstructorInInitializerImplicit(ConstructorDeclaration node) {
+  bool
+      _checkForUndefinedConstructorInInitializerImplicit(ConstructorDeclaration node) {
+    if (_enclosingClass == null) {
+      return false;
+    }
+    // do nothing if mixin errors have already been reported for this class.
+    ClassElementImpl enclosingClass = _enclosingClass;
+    if (enclosingClass.mixinErrorsReported) {
+      return false;
+    }
     //
     // Ignore if the constructor is not generative.
     //
@@ -4842,34 +5467,36 @@
       return false;
     }
     //
-    // Ignore if the constructor has either an implicit super constructor invocation or a
-    // redirecting constructor invocation.
+    // Ignore if the constructor has either an implicit super constructor
+    // invocation or a redirecting constructor invocation.
     //
     for (ConstructorInitializer constructorInitializer in node.initializers) {
-      if (constructorInitializer is SuperConstructorInvocation || constructorInitializer is RedirectingConstructorInvocation) {
+      if (constructorInitializer is SuperConstructorInvocation ||
+          constructorInitializer is RedirectingConstructorInvocation) {
         return false;
       }
     }
     //
-    // Check to see whether the superclass has a non-factory unnamed constructor.
+    // Check to see whether the superclass has a non-factory unnamed
+    // constructor.
     //
-    if (_enclosingClass == null) {
-      return false;
-    }
     InterfaceType superType = _enclosingClass.supertype;
     if (superType == null) {
       return false;
     }
     ClassElement superElement = superType.element;
-    ConstructorElement superUnnamedConstructor = superElement.unnamedConstructor;
+    ConstructorElement superUnnamedConstructor =
+        superElement.unnamedConstructor;
     if (superUnnamedConstructor != null) {
       if (superUnnamedConstructor.isFactory) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.returnType, [superUnnamedConstructor]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+            node.returnType,
+            [superUnnamedConstructor]);
         return true;
       }
       if (!superUnnamedConstructor.isDefaultConstructor ||
-          !_enclosingClass.isSuperConstructorAccessible(
-              superUnnamedConstructor)) {
+          !_enclosingClass.isSuperConstructorAccessible(superUnnamedConstructor)) {
         int offset;
         int length;
         {
@@ -4878,11 +5505,18 @@
           offset = returnType.offset;
           length = (name != null ? name.end : returnType.end) - offset;
         }
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, offset, length, [superType.displayName]);
+        _errorReporter.reportErrorForOffset(
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
+            offset,
+            length,
+            [superType.displayName]);
       }
       return false;
     }
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, node.returnType, [superElement.name]);
+    _errorReporter.reportErrorForNode(
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
+        node.returnType,
+        [superElement.name]);
     return true;
   }
 
@@ -4894,7 +5528,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
    */
-  bool _checkForUnqualifiedReferenceToNonLocalStaticMember(SimpleIdentifier name) {
+  bool
+      _checkForUnqualifiedReferenceToNonLocalStaticMember(SimpleIdentifier name) {
     Element element = name.staticElement;
     if (element == null || element is TypeParameterElement) {
       return false;
@@ -4903,13 +5538,17 @@
     if (enclosingElement is! ClassElement) {
       return false;
     }
-    if ((element is MethodElement && !element.isStatic) || (element is PropertyAccessorElement && !element.isStatic)) {
+    if ((element is MethodElement && !element.isStatic) ||
+        (element is PropertyAccessorElement && !element.isStatic)) {
       return false;
     }
     if (identical(enclosingElement, _enclosingClass)) {
       return false;
     }
-    _errorReporter.reportErrorForNode(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, name, [name.name]);
+    _errorReporter.reportErrorForNode(
+        StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
+        name,
+        [name.name]);
     return true;
   }
 
@@ -4918,7 +5557,10 @@
     if (element is FieldFormalParameterElement) {
       FieldElement fieldElement = element.field;
       if (fieldElement == null || fieldElement.isSynthetic) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, node, [node.identifier.name]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
+            node,
+            [node.identifier.name]);
       } else {
         ParameterElement parameterElement = node.element;
         if (parameterElement is FieldFormalParameterElementImpl) {
@@ -4926,25 +5568,42 @@
           DartType declaredType = fieldFormal.type;
           DartType fieldType = fieldElement.type;
           if (fieldElement.isSynthetic) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, node, [node.identifier.name]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
+                node,
+                [node.identifier.name]);
           } else if (fieldElement.isStatic) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [node.identifier.name]);
-          } else if (declaredType != null && fieldType != null && !declaredType.isAssignableTo(fieldType)) {
-            _errorReporter.reportTypeErrorForNode(StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, node, [declaredType, fieldType]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
+                node,
+                [node.identifier.name]);
+          } else if (declaredType != null &&
+              fieldType != null &&
+              !declaredType.isAssignableTo(fieldType)) {
+            _errorReporter.reportTypeErrorForNode(
+                StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
+                node,
+                [declaredType, fieldType]);
           }
         } else {
           if (fieldElement.isSynthetic) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, node, [node.identifier.name]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
+                node,
+                [node.identifier.name]);
           } else if (fieldElement.isStatic) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [node.identifier.name]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
+                node,
+                [node.identifier.name]);
           }
         }
       }
     }
-    //    else {
-    //    // TODO(jwren) Report error, constructor initializer variable is a top level element
-    //    // (Either here or in ErrorVerifier.checkForAllFinalInitializedErrorCodes)
-    //    }
+//        else {
+//        // TODO(jwren) Report error, constructor initializer variable is a top level element
+//        // (Either here or in ErrorVerifier.checkForAllFinalInitializedErrorCodes)
+//        }
   }
 
   /**
@@ -4959,7 +5618,9 @@
     if (returnType == null || returnType.name.name != "void") {
       return false;
     }
-    _errorReporter.reportErrorForNode(StaticWarningCode.VOID_RETURN_FOR_GETTER, returnType);
+    _errorReporter.reportErrorForNode(
+        StaticWarningCode.VOID_RETURN_FOR_GETTER,
+        returnType);
     return true;
   }
 
@@ -4990,18 +5651,39 @@
     int expected = -1;
     if ("[]=" == name) {
       expected = 2;
-    } else if ("<" == name || ">" == name || "<=" == name || ">=" == name || "==" == name || "+" == name || "/" == name || "~/" == name || "*" == name || "%" == name || "|" == name || "^" == name || "&" == name || "<<" == name || ">>" == name || "[]" == name) {
+    } else if ("<" == name ||
+        ">" == name ||
+        "<=" == name ||
+        ">=" == name ||
+        "==" == name ||
+        "+" == name ||
+        "/" == name ||
+        "~/" == name ||
+        "*" == name ||
+        "%" == name ||
+        "|" == name ||
+        "^" == name ||
+        "&" == name ||
+        "<<" == name ||
+        ">>" == name ||
+        "[]" == name) {
       expected = 1;
     } else if ("~" == name) {
       expected = 0;
     }
     if (expected != -1 && numParameters != expected) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, nameNode, [name, expected, numParameters]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
+          nameNode,
+          [name, expected, numParameters]);
       return true;
     }
     // check for operator "-"
     if ("-" == name && numParameters > 1) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, nameNode, [numParameters]);
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
+          nameNode,
+          [numParameters]);
       return true;
     }
     // OK
@@ -5018,7 +5700,8 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER].
    */
-  bool _checkForWrongNumberOfParametersForSetter(SimpleIdentifier setterName, FormalParameterList parameterList) {
+  bool _checkForWrongNumberOfParametersForSetter(SimpleIdentifier setterName,
+      FormalParameterList parameterList) {
     if (setterName == null) {
       return false;
     }
@@ -5026,8 +5709,11 @@
       return false;
     }
     NodeList<FormalParameter> parameters = parameterList.parameters;
-    if (parameters.length != 1 || parameters[0].kind != ParameterKind.REQUIRED) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, setterName);
+    if (parameters.length != 1 ||
+        parameters[0].kind != ParameterKind.REQUIRED) {
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER,
+          setterName);
       return true;
     }
     return false;
@@ -5051,13 +5737,20 @@
     if (!classElement.type.isSubtypeOf(_typeProvider.functionType)) {
       return false;
     }
-    // If there is a noSuchMethod method, then don't report the warning, see dartbug.com/16078
-    if (classElement.getMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME) != null) {
+    // If there is a noSuchMethod method, then don't report the warning,
+    // see dartbug.com/16078
+    if (classElement.getMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME) !=
+        null) {
       return false;
     }
-    ExecutableElement callMethod = _inheritanceManager.lookupMember(classElement, "call");
-    if (callMethod == null || callMethod is! MethodElement || (callMethod as MethodElement).isAbstract) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.FUNCTION_WITHOUT_CALL, node.name);
+    ExecutableElement callMethod =
+        _inheritanceManager.lookupMember(classElement, "call");
+    if (callMethod == null ||
+        callMethod is! MethodElement ||
+        (callMethod as MethodElement).isAbstract) {
+      _errorReporter.reportErrorForNode(
+          StaticWarningCode.FUNCTION_WITHOUT_CALL,
+          node.name);
       return true;
     }
     return false;
@@ -5086,7 +5779,10 @@
     for (TypeName interfaceNode in implementsClause.interfaces) {
       if (interfaceNode.type == superType) {
         hasProblem = true;
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, interfaceNode, [superType.displayName]);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
+            interfaceNode,
+            [superType.displayName]);
       }
     }
     // done
@@ -5102,15 +5798,18 @@
   ErrorCode _getBaseCaseErrorCode(ClassElement classElt) {
     InterfaceType supertype = classElt.supertype;
     if (supertype != null && _enclosingClass == supertype.element) {
-      return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS;
+      return
+          CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS;
     }
     List<InterfaceType> mixins = classElt.mixins;
     for (int i = 0; i < mixins.length; i++) {
       if (_enclosingClass == mixins[i].element) {
-        return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH;
+        return
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH;
       }
     }
-    return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS;
+    return
+        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS;
   }
 
   /**
@@ -5121,7 +5820,8 @@
    * @return the name of the constant referenced by the expression
    */
   String _getConstantName(Expression expression) {
-    // TODO(brianwilkerson) Convert this to return the element representing the constant.
+    // TODO(brianwilkerson) Convert this to return the element representing the
+    // constant.
     if (expression is SimpleIdentifier) {
       return expression.name;
     } else if (expression is PrefixedIdentifier) {
@@ -5155,7 +5855,8 @@
    */
   DartType _getSetterType(PropertyAccessorElement propertyAccessorElement) {
     // Get the parameters for MethodDeclaration or FunctionDeclaration
-    List<ParameterElement> setterParameters = propertyAccessorElement.parameters;
+    List<ParameterElement> setterParameters =
+        propertyAccessorElement.parameters;
     // If there are no setter parameters, return no type.
     if (setterParameters.length == 0) {
       return null;
@@ -5178,7 +5879,9 @@
       for (int i = 0; i < count; i++) {
         sc.Token deferredToken = directives[i].deferredToken;
         if (deferredToken != null) {
-          _errorReporter.reportErrorForToken(CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, deferredToken);
+          _errorReporter.reportErrorForToken(
+              CompileTimeErrorCode.SHARED_DEFERRED_PREFIX,
+              deferredToken);
           foundError = true;
         }
       }
@@ -5250,37 +5953,14 @@
     } else if (type is FunctionType || type.isDartCoreFunction) {
       return true;
     } else if (type is InterfaceType) {
-      MethodElement callMethod = type.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _currentLibrary);
+      MethodElement callMethod =
+          type.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _currentLibrary);
       return callMethod != null;
     }
     return false;
   }
 
   /**
-   * Return `true` if the given type represents the class `Future` from the
-   * `dart:async` library.
-   *
-   * @param type the type to be tested
-   * @return `true` if the given type represents the class `Future` from the
-   *         `dart:async` library
-   */
-  bool _isFuture(DartType type) {
-    if (type is InterfaceType) {
-      InterfaceType interfaceType = type;
-      if (interfaceType.name == "Future") {
-        ClassElement element = interfaceType.element;
-        if (element != null) {
-          LibraryElement library = element.library;
-          if (library.name == "dart.async") {
-            return true;
-          }
-        }
-      }
-    }
-    return false;
-  }
-
-  /**
    * Return `true` iff the passed [ClassElement] has a method, getter or setter that
    * matches the name of the passed [ExecutableElement] in either the class itself, or one of
    * its' mixins that is concrete.
@@ -5293,7 +5973,8 @@
    * @param classElt the class method to search through the members of
    * @return `true` iff the passed member is found in the passed class element
    */
-  bool _isMemberInClassOrMixin(ExecutableElement executableElt, ClassElement classElt) {
+  bool _isMemberInClassOrMixin(ExecutableElement executableElt,
+      ClassElement classElt) {
     ExecutableElement foundElt = null;
     String executableName = executableElt.name;
     if (executableElt is MethodElement) {
@@ -5316,7 +5997,8 @@
       if (foundElt == null && propertyAccessorElement.isSetter) {
         foundElt = classElt.getSetter(executableName);
       }
-      if (foundElt != null && !(foundElt as PropertyAccessorElement).isAbstract) {
+      if (foundElt != null &&
+          !(foundElt as PropertyAccessorElement).isAbstract) {
         return true;
       }
       List<InterfaceType> mixins = classElt.mixins;
@@ -5326,7 +6008,8 @@
           foundElt = mixins[i].getSetter(executableName);
         }
       }
-      if (foundElt != null && !(foundElt as PropertyAccessorElement).isAbstract) {
+      if (foundElt != null &&
+          !(foundElt as PropertyAccessorElement).isAbstract) {
         return true;
       }
     }
@@ -5365,12 +6048,16 @@
    * @return `true` if the given identifier is in a location where it is allowed to resolve to
    *         a static member of a supertype
    */
-  bool _isUnqualifiedReferenceToNonLocalStaticMemberAllowed(SimpleIdentifier node) {
+  bool
+      _isUnqualifiedReferenceToNonLocalStaticMemberAllowed(SimpleIdentifier node) {
     if (node.inDeclarationContext()) {
       return true;
     }
     AstNode parent = node.parent;
-    if (parent is ConstructorName || parent is MethodInvocation || parent is PropertyAccess || parent is SuperConstructorInvocation) {
+    if (parent is ConstructorName ||
+        parent is MethodInvocation ||
+        parent is PropertyAccess ||
+        parent is SuperConstructorInvocation) {
       return true;
     }
     if (parent is PrefixedIdentifier && identical(parent.identifier, node)) {
@@ -5388,7 +6075,8 @@
     return false;
   }
 
-  bool _isUserDefinedObject(EvaluationResultImpl result) => result == null || (result.value != null && result.value.isUserDefinedObject);
+  bool _isUserDefinedObject(EvaluationResultImpl result) =>
+      result == null || (result.value != null && result.value.isUserDefinedObject);
 
   /**
    * This checks the class declaration is not a superinterface to itself.
@@ -5401,15 +6089,17 @@
    * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS], and
    * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH].
    */
-  bool _safeCheckForRecursiveInterfaceInheritance(ClassElement classElt, List<ClassElement> path) {
+  bool _safeCheckForRecursiveInterfaceInheritance(ClassElement classElt,
+      List<ClassElement> path) {
     // Detect error condition.
     int size = path.length;
-    // If this is not the base case (size > 0), and the enclosing class is the passed class
-    // element then an error an error.
+    // If this is not the base case (size > 0), and the enclosing class is the
+    // passed class element then an error an error.
     if (size > 0 && _enclosingClass == classElt) {
       String enclosingClassName = _enclosingClass.displayName;
       if (size > 1) {
-        // Construct a string showing the cyclic implements path: "A, B, C, D, A"
+        // Construct a string showing the cyclic implements path:
+        // "A, B, C, D, A"
         String separator = ", ";
         StringBuffer buffer = new StringBuffer();
         for (int i = 0; i < size; i++) {
@@ -5417,13 +6107,21 @@
           buffer.write(separator);
         }
         buffer.write(classElt.displayName);
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, _enclosingClass.nameOffset, enclosingClassName.length, [enclosingClassName, buffer.toString()]);
+        _errorReporter.reportErrorForOffset(
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            _enclosingClass.nameOffset,
+            enclosingClassName.length,
+            [enclosingClassName, buffer.toString()]);
         return true;
       } else {
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS or
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS or
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH
-        _errorReporter.reportErrorForOffset(_getBaseCaseErrorCode(classElt), _enclosingClass.nameOffset, enclosingClassName.length, [enclosingClassName]);
+        _errorReporter.reportErrorForOffset(
+            _getBaseCaseErrorCode(classElt),
+            _enclosingClass.nameOffset,
+            enclosingClassName.length,
+            [enclosingClassName]);
         return true;
       }
     }
@@ -5433,12 +6131,15 @@
     path.add(classElt);
     // n-case
     InterfaceType supertype = classElt.supertype;
-    if (supertype != null && _safeCheckForRecursiveInterfaceInheritance(supertype.element, path)) {
+    if (supertype != null &&
+        _safeCheckForRecursiveInterfaceInheritance(supertype.element, path)) {
       return true;
     }
     List<InterfaceType> interfaceTypes = classElt.interfaces;
     for (InterfaceType interfaceType in interfaceTypes) {
-      if (_safeCheckForRecursiveInterfaceInheritance(interfaceType.element, path)) {
+      if (_safeCheckForRecursiveInterfaceInheritance(
+          interfaceType.element,
+          path)) {
         return true;
       }
     }
@@ -5451,13 +6152,46 @@
     path.removeAt(path.length - 1);
     return false;
   }
+
+  /**
+   * Return the static type of the given expression that is to be used for type analysis.
+   *
+   * @param expression the expression whose type is to be returned
+   * @return the static type of the given expression
+   */
+  static DartType getStaticType(Expression expression) {
+    DartType type = expression.staticType;
+    if (type == null) {
+      // TODO(brianwilkerson) This should never happen.
+      return DynamicTypeImpl.instance;
+    }
+    return type;
+  }
+
+  /**
+   * Return the variable element represented by the given expression, or `null` if there is no
+   * such element.
+   *
+   * @param expression the expression whose element is to be returned
+   * @return the variable element represented by the expression
+   */
+  static VariableElement getVariableElement(Expression expression) {
+    if (expression is Identifier) {
+      Element element = expression.staticElement;
+      if (element is VariableElement) {
+        return element;
+      }
+    }
+    return null;
+  }
 }
 
-class GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference extends GeneralizingElementVisitor<Object> {
+class GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference extends
+    GeneralizingElementVisitor<Object> {
   List<Element> toCheck;
 
-  GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(
-      this.toCheck) : super();
+  GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(this.toCheck)
+      : super();
 
   @override
   Object visitClassElement(ClassElement element) {
diff --git a/pkg/analyzer/lib/src/generated/html.dart b/pkg/analyzer/lib/src/generated/html.dart
index 956a2da..1e1b7b3 100644
--- a/pkg/analyzer/lib/src/generated/html.dart
+++ b/pkg/analyzer/lib/src/generated/html.dart
@@ -8,15 +8,17 @@
 library engine.html;
 
 import 'dart:collection';
-import 'java_core.dart';
-import 'java_engine.dart';
-import 'source.dart';
-import 'error.dart' show AnalysisErrorListener;
-import 'scanner.dart' as sc show Scanner, SubSequenceReader, Token;
-import 'parser.dart' show Parser;
+
 import 'ast.dart';
 import 'element.dart';
-import 'engine.dart' show AnalysisEngine, AngularHtmlUnitResolver, ExpressionVisitor;
+import 'engine.dart' show AnalysisEngine, AngularHtmlUnitResolver,
+    ExpressionVisitor;
+import 'error.dart' show AnalysisErrorListener;
+import 'java_core.dart';
+import 'java_engine.dart';
+import 'parser.dart' show Parser;
+import 'scanner.dart' as sc show Scanner, SubSequenceReader, Token;
+import 'source.dart';
 
 /**
  * The abstract class `AbstractScanner` implements a scanner for HTML code. Subclasses are
@@ -82,18 +84,8 @@
    * Set array of element tags for which the content between tags should be consider a single token.
    */
   void set passThroughElements(List<String> passThroughElements) {
-    this._passThroughElements = passThroughElements != null ? passThroughElements : _NO_PASS_THROUGH_ELEMENTS;
-  }
-
-  /**
-   * Scan the source code to produce a list of tokens representing the source.
-   *
-   * @return the first token in the list of tokens that were produced
-   */
-  Token tokenize() {
-    _scan();
-    _appendEofToken();
-    return _firstToken();
+    this._passThroughElements =
+        passThroughElements != null ? passThroughElements : _NO_PASS_THROUGH_ELEMENTS;
   }
 
   /**
@@ -129,9 +121,21 @@
     _lineStarts.add(offset);
   }
 
+  /**
+   * Scan the source code to produce a list of tokens representing the source.
+   *
+   * @return the first token in the list of tokens that were produced
+   */
+  Token tokenize() {
+    _scan();
+    _appendEofToken();
+    return _firstToken();
+  }
+
   void _appendEofToken() {
     Token eofToken = new Token.con1(TokenType.EOF, offset);
-    // The EOF token points to itself so that there is always infinite look-ahead.
+    // The EOF token points to itself so that there is always infinite
+    // look-ahead.
     eofToken.setNext(eofToken);
     _tail = _tail.setNext(eofToken);
   }
@@ -142,9 +146,11 @@
     return token;
   }
 
-  Token _emitWithOffset(TokenType type, int start) => _emit(new Token.con1(type, start));
+  Token _emitWithOffset(TokenType type, int start) =>
+      _emit(new Token.con1(type, start));
 
-  Token _emitWithOffsetAndLength(TokenType type, int start, int count) => _emit(new Token.con2(type, start, getString(start, count)));
+  Token _emitWithOffsetAndLength(TokenType type, int start, int count) =>
+      _emit(new Token.con2(type, start, getString(start, count)));
 
   Token _firstToken() => _tokens.next;
 
@@ -362,16 +368,6 @@
  * of [XmlNode]s.
  */
 class HtmlParser extends XmlParser {
-  /**
-   * The line information associated with the source being parsed.
-   */
-  LineInfo _lineInfo;
-
-  /**
-   * The error listener to which errors will be reported.
-   */
-  final AnalysisErrorListener _errorListener;
-
   static String _APPLICATION_DART_IN_DOUBLE_QUOTES = "\"application/dart\"";
 
   static String _APPLICATION_DART_IN_SINGLE_QUOTES = "'application/dart'";
@@ -383,49 +379,31 @@
   /**
    * A set containing the names of tags that do not have a closing tag.
    */
-  static Set<String> SELF_CLOSING = new HashSet<String>.from(<String>[
-      "area",
-      "base",
-      "basefont",
-      "br",
-      "col",
-      "frame",
-      "hr",
-      "img",
-      "input",
-      "link",
-      "meta",
-      "param",
-      "!"]);
+  static Set<String> SELF_CLOSING = new HashSet<String>.from(
+      <String>[
+          "area",
+          "base",
+          "basefont",
+          "br",
+          "col",
+          "frame",
+          "hr",
+          "img",
+          "input",
+          "link",
+          "meta",
+          "param",
+          "!"]);
 
   /**
-   * Given the contents of an embedded expression that occurs at the given offset, parse it as a
-   * Dart expression. The contents should not include the expression's delimiters.
-   *
-   * @param source the source that contains that given token
-   * @param token the token to start parsing from
-   * @return the Dart expression that was parsed
+   * The line information associated with the source being parsed.
    */
-  static Expression parseEmbeddedExpression(Source source, sc.Token token, AnalysisErrorListener errorListener) {
-    Parser parser = new Parser(source, errorListener);
-    return parser.parseExpression(token);
-  }
+  LineInfo _lineInfo;
 
   /**
-   * Given the contents of an embedded expression that occurs at the given offset, scans it as a
-   * Dart code.
-   *
-   * @param source the source of that contains the given contents
-   * @param contents the contents to scan
-   * @param contentOffset the offset of the contents in the larger file
-   * @return the first Dart token
+   * The error listener to which errors will be reported.
    */
-  static sc.Token scanDartSource(Source source, LineInfo lineInfo, String contents, int contentOffset, AnalysisErrorListener errorListener) {
-    LineInfo_Location location = lineInfo.getLocation(contentOffset);
-    sc.Scanner scanner = new sc.Scanner(source, new sc.SubSequenceReader(contents, contentOffset), errorListener);
-    scanner.setSourceStart(location.lineNumber, location.columnNumber);
-    return scanner.tokenize();
-  }
+  final AnalysisErrorListener _errorListener;
 
   /**
    * Construct a parser for the specified source.
@@ -435,6 +413,53 @@
    */
   HtmlParser(Source source, this._errorListener) : super(source);
 
+  @override
+  XmlAttributeNode createAttributeNode(Token name, Token equals, Token value) =>
+      new XmlAttributeNode(name, equals, value);
+
+  @override
+  XmlTagNode createTagNode(Token nodeStart, Token tag,
+      List<XmlAttributeNode> attributes, Token attributeEnd,
+      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) {
+    if (_isScriptNode(tag, attributes, tagNodes)) {
+      HtmlScriptTagNode tagNode = new HtmlScriptTagNode(
+          nodeStart,
+          tag,
+          attributes,
+          attributeEnd,
+          tagNodes,
+          contentEnd,
+          closingTag,
+          nodeEnd);
+      String contents = tagNode.content;
+      int contentOffset = attributeEnd.end;
+      LineInfo_Location location = _lineInfo.getLocation(contentOffset);
+      sc.Scanner scanner = new sc.Scanner(
+          source,
+          new sc.SubSequenceReader(contents, contentOffset),
+          _errorListener);
+      scanner.setSourceStart(location.lineNumber, location.columnNumber);
+      sc.Token firstToken = scanner.tokenize();
+      Parser parser = new Parser(source, _errorListener);
+      CompilationUnit unit = parser.parseCompilationUnit(firstToken);
+      unit.lineInfo = _lineInfo;
+      tagNode.script = unit;
+      return tagNode;
+    }
+    return new XmlTagNode(
+        nodeStart,
+        tag,
+        attributes,
+        attributeEnd,
+        tagNodes,
+        contentEnd,
+        closingTag,
+        nodeEnd);
+  }
+
+  @override
+  bool isSelfClosing(Token tag) => SELF_CLOSING.contains(tag.lexeme);
+
   /**
    * Parse the given tokens.
    *
@@ -448,38 +473,14 @@
     return new HtmlUnit(token, tagNodes, currentToken);
   }
 
-  @override
-  XmlAttributeNode createAttributeNode(Token name, Token equals, Token value) => new XmlAttributeNode(name, equals, value);
-
-  @override
-  XmlTagNode createTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) {
-    if (_isScriptNode(tag, attributes, tagNodes)) {
-      HtmlScriptTagNode tagNode = new HtmlScriptTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
-      String contents = tagNode.content;
-      int contentOffset = attributeEnd.end;
-      LineInfo_Location location = _lineInfo.getLocation(contentOffset);
-      sc.Scanner scanner = new sc.Scanner(source, new sc.SubSequenceReader(contents, contentOffset), _errorListener);
-      scanner.setSourceStart(location.lineNumber, location.columnNumber);
-      sc.Token firstToken = scanner.tokenize();
-      Parser parser = new Parser(source, _errorListener);
-      CompilationUnit unit = parser.parseCompilationUnit(firstToken);
-      unit.lineInfo = _lineInfo;
-      tagNode.script = unit;
-      return tagNode;
-    }
-    return new XmlTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
-  }
-
-  @override
-  bool isSelfClosing(Token tag) => SELF_CLOSING.contains(tag.lexeme);
-
   /**
    * Determine if the specified node is a Dart script.
    *
    * @param node the node to be tested (not `null`)
    * @return `true` if the node is a Dart script
    */
-  bool _isScriptNode(Token tag, List<XmlAttributeNode> attributes, List<XmlTagNode> tagNodes) {
+  bool _isScriptNode(Token tag, List<XmlAttributeNode> attributes,
+      List<XmlTagNode> tagNodes) {
     if (tagNodes.length != 0 || tag.lexeme != _SCRIPT) {
       return false;
     }
@@ -488,7 +489,8 @@
         Token valueToken = attribute.valueToken;
         if (valueToken != null) {
           String value = valueToken.lexeme;
-          if (value == _APPLICATION_DART_IN_DOUBLE_QUOTES || value == _APPLICATION_DART_IN_SINGLE_QUOTES) {
+          if (value == _APPLICATION_DART_IN_DOUBLE_QUOTES ||
+              value == _APPLICATION_DART_IN_SINGLE_QUOTES) {
             return true;
           }
         }
@@ -496,6 +498,40 @@
     }
     return false;
   }
+
+  /**
+   * Given the contents of an embedded expression that occurs at the given offset, parse it as a
+   * Dart expression. The contents should not include the expression's delimiters.
+   *
+   * @param source the source that contains that given token
+   * @param token the token to start parsing from
+   * @return the Dart expression that was parsed
+   */
+  static Expression parseEmbeddedExpression(Source source, sc.Token token,
+      AnalysisErrorListener errorListener) {
+    Parser parser = new Parser(source, errorListener);
+    return parser.parseExpression(token);
+  }
+
+  /**
+   * Given the contents of an embedded expression that occurs at the given offset, scans it as a
+   * Dart code.
+   *
+   * @param source the source of that contains the given contents
+   * @param contents the contents to scan
+   * @param contentOffset the offset of the contents in the larger file
+   * @return the first Dart token
+   */
+  static sc.Token scanDartSource(Source source, LineInfo lineInfo,
+      String contents, int contentOffset, AnalysisErrorListener errorListener) {
+    LineInfo_Location location = lineInfo.getLocation(contentOffset);
+    sc.Scanner scanner = new sc.Scanner(
+        source,
+        new sc.SubSequenceReader(contents, contentOffset),
+        errorListener);
+    scanner.setSourceStart(location.lineNumber, location.columnNumber);
+    return scanner.tokenize();
+  }
 }
 
 /**
@@ -526,10 +562,18 @@
    * @param closingTag the name of the tag that occurs in the closing tag
    * @param nodeEnd the last token in the tag
    */
-  HtmlScriptTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) : super(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
-
-  @override
-  accept(XmlVisitor visitor) => visitor.visitHtmlScriptTagNode(this);
+  HtmlScriptTagNode(Token nodeStart, Token tag,
+      List<XmlAttributeNode> attributes, Token attributeEnd,
+      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd)
+      : super(
+          nodeStart,
+          tag,
+          attributes,
+          attributeEnd,
+          tagNodes,
+          contentEnd,
+          closingTag,
+          nodeEnd);
 
   /**
    * Return the AST structure representing the Dart code within this tag, or `null` if this
@@ -547,6 +591,9 @@
   void set script(CompilationUnit unit) {
     _script = unit;
   }
+
+  @override
+  accept(XmlVisitor visitor) => visitor.visitHtmlScriptTagNode(this);
 }
 
 /**
@@ -581,9 +628,6 @@
     this._tagNodes = becomeParentOfAll(tagNodes);
   }
 
-  @override
-  accept(XmlVisitor visitor) => visitor.visitHtmlUnit(this);
-
   /**
    * Return the element associated with this HTML unit.
    *
@@ -592,6 +636,15 @@
   @override
   HtmlElement get element => super.element as HtmlElement;
 
+  @override
+  void set element(Element element) {
+    if (element != null && element is! HtmlElement) {
+      throw new IllegalArgumentException(
+          "HtmlElement expected, but ${element.runtimeType} given");
+    }
+    super.element = element;
+  }
+
   /**
    * Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list
    * to edit the AST structure.
@@ -601,12 +654,7 @@
   List<XmlTagNode> get tagNodes => _tagNodes;
 
   @override
-  void set element(Element element) {
-    if (element != null && element is! HtmlElement) {
-      throw new IllegalArgumentException("HtmlElement expected, but ${element.runtimeType} given");
-    }
-    super.element = element;
-  }
+  accept(XmlVisitor visitor) => visitor.visitHtmlUnit(this);
 
   @override
   void visitChildren(XmlVisitor visitor) {
@@ -628,8 +676,8 @@
     if (htmlUnit == null) {
       return null;
     }
-    RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode visitor
-        = new RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode(offset);
+    RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode visitor =
+        new RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode(offset);
     try {
       htmlUnit.accept(visitor);
     } on HtmlUnitUtils_FoundAttributeNodeError catch (e) {
@@ -663,7 +711,8 @@
   static Element getElementToOpen(HtmlUnit htmlUnit, Expression expression) {
     Element element = getElement(expression);
     {
-      AngularElement angularElement = AngularHtmlUnitResolver.getAngularElement(element);
+      AngularElement angularElement =
+          AngularHtmlUnitResolver.getAngularElement(element);
       if (angularElement != null) {
         return angularElement;
       }
@@ -679,8 +728,8 @@
     if (htmlUnit == null) {
       return null;
     }
-    RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode visitor
-        = new RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode(offset);
+    RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode visitor =
+        new RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode(offset);
     try {
       htmlUnit.accept(visitor);
     } on HtmlUnitUtils_FoundTagNodeError catch (e) {
@@ -697,8 +746,8 @@
     if (htmlUnit == null) {
       return null;
     }
-    ExpressionVisitor_HtmlUnitUtils_getExpression visitor
-        = new ExpressionVisitor_HtmlUnitUtils_getExpression(offset);
+    ExpressionVisitor_HtmlUnitUtils_getExpression visitor =
+        new ExpressionVisitor_HtmlUnitUtils_getExpression(offset);
     try {
       // TODO(scheglov) this code is very Angular specific
       htmlUnit.accept(visitor);
@@ -725,7 +774,9 @@
     }
     // is "offset" in the open tag?
     Token closeTag = node.closingTag;
-    if (closeTag != null && closeTag.offset <= offset && offset <= closeTag.end) {
+    if (closeTag != null &&
+        closeTag.offset <= offset &&
+        offset <= closeTag.end) {
       return node;
     }
     // not on a tag name
@@ -821,7 +872,8 @@
   }
 }
 
-class RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode extends RecursiveXmlVisitor<Object> {
+class RecursiveXmlVisitor_HtmlUnitUtils_getAttributeNode extends
+    RecursiveXmlVisitor<Object> {
   final int offset;
 
   XmlAttributeNode result;
@@ -839,7 +891,8 @@
   }
 }
 
-class RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode extends RecursiveXmlVisitor<Object> {
+class RecursiveXmlVisitor_HtmlUnitUtils_getEnclosingTagNode extends
+    RecursiveXmlVisitor<Object> {
   final int offset;
 
   XmlTagNode result;
@@ -925,7 +978,8 @@
   }
 
   @override
-  String getString(int start, int endDelta) => _string.substring(start, _charOffset + 1 + endDelta).toString();
+  String getString(int start, int endDelta) =>
+      _string.substring(start, _charOffset + 1 + endDelta).toString();
 
   @override
   int peek() {
@@ -937,86 +991,6 @@
 }
 
 /**
- * Instances of the class `ToSourceVisitor` write a source representation of a visited XML
- * node (and all of it's children) to a writer.
- */
-class ToSourceVisitor implements XmlVisitor<Object> {
-  /**
-   * The writer to which the source is to be written.
-   */
-  final PrintWriter _writer;
-
-  /**
-   * Initialize a newly created visitor to write source code representing the visited nodes to the
-   * given writer.
-   *
-   * @param writer the writer to which the source is to be written
-   */
-  ToSourceVisitor(this._writer);
-
-  @override
-  Object visitHtmlScriptTagNode(HtmlScriptTagNode node) => visitXmlTagNode(node);
-
-  @override
-  Object visitHtmlUnit(HtmlUnit node) {
-    for (XmlTagNode child in node.tagNodes) {
-      _visit(child);
-    }
-    return null;
-  }
-
-  @override
-  Object visitXmlAttributeNode(XmlAttributeNode node) {
-    String name = node.name;
-    Token value = node.valueToken;
-    if (name.length == 0) {
-      _writer.print("__");
-    } else {
-      _writer.print(name);
-    }
-    _writer.print("=");
-    if (value == null) {
-      _writer.print("__");
-    } else {
-      _writer.print(value.lexeme);
-    }
-    return null;
-  }
-
-  @override
-  Object visitXmlTagNode(XmlTagNode node) {
-    _writer.print("<");
-    String tagName = node.tag;
-    _writer.print(tagName);
-    for (XmlAttributeNode attribute in node.attributes) {
-      _writer.print(" ");
-      _visit(attribute);
-    }
-    _writer.print(node.attributeEnd.lexeme);
-    if (node.closingTag != null) {
-      for (XmlTagNode child in node.tagNodes) {
-        _visit(child);
-      }
-      _writer.print("</");
-      _writer.print(tagName);
-      _writer.print(">");
-    }
-    return null;
-  }
-
-  /**
-   * Safely visit the given node.
-   *
-   * @param node the node to be visited
-   */
-  void _visit(XmlNode node) {
-    if (node != null) {
-      node.accept(this);
-    }
-  }
-}
-
-/**
  * Instances of the class `Token` represent a token that was scanned from the input. Each
  * token knows which token follows it, acting as the head of a linked list of tokens.
  */
@@ -1075,6 +1049,15 @@
   int get end => offset + length;
 
   /**
+   * Return `true` if this token is a synthetic token. A synthetic token is a token that was
+   * introduced by the parser in order to recover from an error in the code. Synthetic tokens always
+   * have a length of zero (`0`).
+   *
+   * @return `true` if this token is a synthetic token
+   */
+  bool get isSynthetic => length == 0;
+
+  /**
    * Return the number of characters in the node's source range.
    *
    * @return the number of characters in the node's source range
@@ -1096,15 +1079,6 @@
   Token get next => _next;
 
   /**
-   * Return `true` if this token is a synthetic token. A synthetic token is a token that was
-   * introduced by the parser in order to recover from an error in the code. Synthetic tokens always
-   * have a length of zero (`0`).
-   *
-   * @return `true` if this token is a synthetic token
-   */
-  bool get isSynthetic => length == 0;
-
-  /**
    * Set the next token in the token stream to the given token. This has the side-effect of setting
    * this token to be the previous token for the given token.
    *
@@ -1177,16 +1151,103 @@
 }
 
 class TokenType_EOF extends TokenType {
-  const TokenType_EOF(String name, int ordinal, String arg0) : super(name, ordinal, arg0);
+  const TokenType_EOF(String name, int ordinal, String arg0)
+      : super(name, ordinal, arg0);
 
   @override
   String toString() => "-eof-";
 }
 
 /**
+ * Instances of the class `ToSourceVisitor` write a source representation of a visited XML
+ * node (and all of it's children) to a writer.
+ */
+class ToSourceVisitor implements XmlVisitor<Object> {
+  /**
+   * The writer to which the source is to be written.
+   */
+  final PrintWriter _writer;
+
+  /**
+   * Initialize a newly created visitor to write source code representing the visited nodes to the
+   * given writer.
+   *
+   * @param writer the writer to which the source is to be written
+   */
+  ToSourceVisitor(this._writer);
+
+  @override
+  Object visitHtmlScriptTagNode(HtmlScriptTagNode node) =>
+      visitXmlTagNode(node);
+
+  @override
+  Object visitHtmlUnit(HtmlUnit node) {
+    for (XmlTagNode child in node.tagNodes) {
+      _visit(child);
+    }
+    return null;
+  }
+
+  @override
+  Object visitXmlAttributeNode(XmlAttributeNode node) {
+    String name = node.name;
+    Token value = node.valueToken;
+    if (name.length == 0) {
+      _writer.print("__");
+    } else {
+      _writer.print(name);
+    }
+    _writer.print("=");
+    if (value == null) {
+      _writer.print("__");
+    } else {
+      _writer.print(value.lexeme);
+    }
+    return null;
+  }
+
+  @override
+  Object visitXmlTagNode(XmlTagNode node) {
+    _writer.print("<");
+    String tagName = node.tag;
+    _writer.print(tagName);
+    for (XmlAttributeNode attribute in node.attributes) {
+      _writer.print(" ");
+      _visit(attribute);
+    }
+    _writer.print(node.attributeEnd.lexeme);
+    if (node.closingTag != null) {
+      for (XmlTagNode child in node.tagNodes) {
+        _visit(child);
+      }
+      _writer.print("</");
+      _writer.print(tagName);
+      _writer.print(">");
+    }
+    return null;
+  }
+
+  /**
+   * Safely visit the given node.
+   *
+   * @param node the node to be visited
+   */
+  void _visit(XmlNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+}
+
+/**
  * Instances of `XmlAttributeNode` represent name/value pairs owned by an [XmlTagNode].
  */
 class XmlAttributeNode extends XmlNode {
+  /**
+   * An empty list of XML attribute nodes.
+   */
+  static const List<XmlAttributeNode> EMPTY_LIST = const <XmlAttributeNode>[];
+
   final Token _name;
 
   final Token equals;
@@ -1196,11 +1257,6 @@
   List<XmlExpression> expressions = XmlExpression.EMPTY_ARRAY;
 
   /**
-   * An empty list of XML attribute nodes.
-   */
-  static const List<XmlAttributeNode> EMPTY_LIST = const <XmlAttributeNode>[];
-
-  /**
    * Construct a new instance representing an XML attribute.
    *
    * @param name the name token (not `null`). This may be a zero length token if the attribute
@@ -1211,9 +1267,6 @@
   XmlAttributeNode(this._name, this.equals, this._value);
 
   @override
-  accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this);
-
-  @override
   Token get beginToken => _name;
 
   @override
@@ -1243,7 +1296,8 @@
     if (_value == null) {
       return null;
     }
-    //TODO (danrubel): replace HTML character encodings with the actual characters
+    //TODO (danrubel): replace HTML character encodings with the actual
+    // characters
     String text = _value.lexeme;
     int len = text.length;
     if (len > 0) {
@@ -1274,7 +1328,8 @@
       return -1;
     }
     String text = _value.lexeme;
-    if (StringUtilities.startsWithChar(text, 0x22) || StringUtilities.startsWithChar(text, 0x27)) {
+    if (StringUtilities.startsWithChar(text, 0x22) ||
+        StringUtilities.startsWithChar(text, 0x27)) {
       return _value.offset + 1;
     }
     return _value.offset;
@@ -1289,6 +1344,9 @@
   Token get valueToken => _value;
 
   @override
+  accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this);
+
+  @override
   void visitChildren(XmlVisitor visitor) {
     // no children to visit
   }
@@ -1300,14 +1358,9 @@
  */
 abstract class XmlExpression {
   /**
-   * An empty array of expressions.
+   * An empty list of expressions.
    */
-  static List<XmlExpression> EMPTY_ARRAY = new List<XmlExpression>(0);
-
-  /**
-   * Check if the given offset belongs to the expression's source range.
-   */
-  bool contains(int offset) => this.offset <= offset && offset < end;
+  static const List<XmlExpression> EMPTY_ARRAY = const <XmlExpression>[];
 
   /**
    * Return the offset of the character immediately following the last character of this
@@ -1328,6 +1381,11 @@
   int get offset;
 
   /**
+   * Check if the given offset belongs to the expression's source range.
+   */
+  bool contains(int offset) => this.offset <= offset && offset < end;
+
+  /**
    * Return the [Reference] at the given offset.
    *
    * @param offset the offset from the beginning of the file
@@ -1368,14 +1426,6 @@
   Element _element;
 
   /**
-   * Use the given visitor to visit this node.
-   *
-   * @param visitor the visitor that will visit this node
-   * @return the value returned by the visitor as a result of visiting this node
-   */
-  accept(XmlVisitor visitor);
-
-  /**
    * Return the first token included in this node's source range.
    *
    * @return the first token or `null` if none
@@ -1390,6 +1440,15 @@
   Element get element => _element;
 
   /**
+   * Set the element associated with this node.
+   *
+   * @param element the element
+   */
+  void set element(Element element) {
+    this._element = element;
+  }
+
+  /**
    * Return the offset of the character immediately following the last character of this node's
    * source range. This is equivalent to `node.getOffset() + node.getLength()`. For an html
    * unit this will be equal to the length of the unit's source.
@@ -1445,28 +1504,33 @@
   XmlNode get parent => _parent;
 
   /**
-   * Set the element associated with this node.
+   * Set the parent of this node to the given node.
    *
-   * @param element the element
+   * @param newParent the node that is to be made the parent of this node
    */
-  void set element(Element element) {
-    this._element = element;
-  }
-
-  @override
-  String toString() {
-    PrintStringWriter writer = new PrintStringWriter();
-    accept(new ToSourceVisitor(writer));
-    return writer.toString();
+  void set parent(XmlNode newParent) {
+    XmlNode current = newParent;
+    while (current != null) {
+      if (identical(current, this)) {
+        AnalysisEngine.instance.logger.logError(
+            "Circular structure while setting an XML node's parent",
+            new CaughtException(
+                new ArgumentError(_buildRecursiveStructureMessage(newParent)),
+                null));
+        return;
+      }
+      current = current.parent;
+    }
+    _parent = newParent;
   }
 
   /**
-   * Use the given visitor to visit all of the children of this node. The children will be visited
-   * in source order.
+   * Use the given visitor to visit this node.
    *
-   * @param visitor the visitor that will be used to visit the children of this node
+   * @param visitor the visitor that will visit this node
+   * @return the value returned by the visitor as a result of visiting this node
    */
-  void visitChildren(XmlVisitor visitor);
+  accept(XmlVisitor visitor);
 
   /**
    * Make this node the parent of the given child node.
@@ -1503,6 +1567,21 @@
     return children;
   }
 
+  @override
+  String toString() {
+    PrintStringWriter writer = new PrintStringWriter();
+    accept(new ToSourceVisitor(writer));
+    return writer.toString();
+  }
+
+  /**
+   * Use the given visitor to visit all of the children of this node. The children will be visited
+   * in source order.
+   *
+   * @param visitor the visitor that will be used to visit the children of this node
+   */
+  void visitChildren(XmlVisitor visitor);
+
   /**
    * This method exists for debugging purposes only.
    */
@@ -1538,27 +1617,6 @@
     }
     return buffer.toString();
   }
-
-  /**
-   * Set the parent of this node to the given node.
-   *
-   * @param newParent the node that is to be made the parent of this node
-   */
-  void set parent(XmlNode newParent) {
-    XmlNode current = newParent;
-    while (current != null) {
-      if (identical(current, this)) {
-        AnalysisEngine.instance.logger.logError(
-            "Circular structure while setting an XML node's parent",
-            new CaughtException(
-                new ArgumentError(_buildRecursiveStructureMessage(newParent)),
-                null));
-        return;
-      }
-      current = current.parent;
-    }
-    _parent = newParent;
-  }
 }
 
 /**
@@ -1584,6 +1642,13 @@
   XmlParser(this.source);
 
   /**
+   * Answer the current token.
+   *
+   * @return the current token
+   */
+  Token get currentToken => _currentToken;
+
+  /**
    * Create a node representing an attribute.
    *
    * @param name the name of the attribute
@@ -1591,7 +1656,8 @@
    * @param value the value of the attribute
    * @return the node that was created
    */
-  XmlAttributeNode createAttributeNode(Token name, Token equals, Token value) => new XmlAttributeNode(name, equals, value);
+  XmlAttributeNode createAttributeNode(Token name, Token equals, Token value) =>
+      new XmlAttributeNode(name, equals, value);
 
   /**
    * Create a node representing a tag.
@@ -1606,7 +1672,18 @@
    * @param nodeEnd the last token in the tag
    * @return the node that was created
    */
-  XmlTagNode createTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) => new XmlTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
+  XmlTagNode createTagNode(Token nodeStart, Token tag,
+      List<XmlAttributeNode> attributes, Token attributeEnd,
+      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) =>
+      new XmlTagNode(
+          nodeStart,
+          tag,
+          attributes,
+          attributeEnd,
+          tagNodes,
+          contentEnd,
+          closingTag,
+          nodeEnd);
 
   /**
    * Answer `true` if the specified tag is self closing and thus should never have content or
@@ -1630,7 +1707,9 @@
     while (type != TokenType.EOF) {
       if (type == TokenType.LT) {
         tagNodes.add(_parseTagNode());
-      } else if (type == TokenType.DECLARATION || type == TokenType.DIRECTIVE || type == TokenType.COMMENT) {
+      } else if (type == TokenType.DECLARATION ||
+          type == TokenType.DIRECTIVE ||
+          type == TokenType.COMMENT) {
         // ignored tokens
         _currentToken = _currentToken.next;
       } else {
@@ -1643,13 +1722,6 @@
   }
 
   /**
-   * Answer the current token.
-   *
-   * @return the current token
-   */
-  Token get currentToken => _currentToken;
-
-  /**
    * Insert a synthetic token of the specified type before the current token
    *
    * @param type the type of token to be inserted (not `null`)
@@ -1701,11 +1773,15 @@
    */
   List<XmlAttributeNode> _parseAttributes() {
     TokenType type = _currentToken.type;
-    if (type == TokenType.GT || type == TokenType.SLASH_GT || type == TokenType.EOF) {
+    if (type == TokenType.GT ||
+        type == TokenType.SLASH_GT ||
+        type == TokenType.EOF) {
       return XmlTagNode.NO_ATTRIBUTES;
     }
     List<XmlAttributeNode> attributes = new List<XmlAttributeNode>();
-    while (type != TokenType.GT && type != TokenType.SLASH_GT && type != TokenType.EOF) {
+    while (type != TokenType.GT &&
+        type != TokenType.SLASH_GT &&
+        type != TokenType.EOF) {
       if (type == TokenType.TAG) {
         attributes.add(_parseAttribute());
       } else {
@@ -1767,7 +1843,8 @@
     List<XmlAttributeNode> attributes = _parseAttributes();
     // Token ending attribute list
     Token attributeEnd;
-    if (_currentToken.type == TokenType.GT || _currentToken.type == TokenType.SLASH_GT) {
+    if (_currentToken.type == TokenType.GT ||
+        _currentToken.type == TokenType.SLASH_GT) {
       attributeEnd = _currentToken;
       _currentToken = _currentToken.next;
     } else {
@@ -1776,7 +1853,15 @@
     }
     // If the node has no children, then return the node
     if (attributeEnd.type == TokenType.SLASH_GT || isSelfClosing(tag)) {
-      return createTagNode(nodeStart, tag, attributes, attributeEnd, XmlTagNode.NO_TAG_NODES, _currentToken, null, attributeEnd);
+      return createTagNode(
+          nodeStart,
+          tag,
+          attributes,
+          attributeEnd,
+          XmlTagNode.NO_TAG_NODES,
+          _currentToken,
+          null,
+          attributeEnd);
     }
     // Parse the child tag nodes
     List<XmlTagNode> tagNodes = _parseChildTagNodes();
@@ -1786,8 +1871,8 @@
       contentEnd = _currentToken;
       _currentToken = _currentToken.next;
     } else {
-      // TODO (danrubel): handle self closing HTML elements by inserting synthetic tokens
-      // but not reporting an error
+      // TODO (danrubel): handle self closing HTML elements by inserting
+      // synthetic tokens but not reporting an error
       _reportUnexpectedToken();
       contentEnd = _insertSyntheticToken(TokenType.LT_SLASH);
     }
@@ -1809,7 +1894,15 @@
       _reportUnexpectedToken();
       nodeEnd = _insertSyntheticToken(TokenType.GT);
     }
-    return createTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
+    return createTagNode(
+        nodeStart,
+        tag,
+        attributes,
+        attributeEnd,
+        tagNodes,
+        contentEnd,
+        closingTag,
+        nodeEnd);
   }
 
   /**
@@ -1828,12 +1921,14 @@
   /**
    * Constant representing empty list of attributes.
    */
-  static List<XmlAttributeNode> NO_ATTRIBUTES = new UnmodifiableListView(new List<XmlAttributeNode>());
+  static List<XmlAttributeNode> NO_ATTRIBUTES =
+      new UnmodifiableListView(new List<XmlAttributeNode>());
 
   /**
    * Constant representing empty list of tag nodes.
    */
-  static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTagNode>());
+  static List<XmlTagNode> NO_TAG_NODES =
+      new UnmodifiableListView(new List<XmlTagNode>());
 
   /**
    * The starting [TokenType.LT] token (not `null`).
@@ -1913,29 +2008,13 @@
    * @param nodeEnd the ending [TokenType.GT] or [TokenType.SLASH_GT] token (not
    *          `null`)
    */
-  XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes, this.attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this.nodeEnd) {
+  XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes,
+      this.attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag,
+      this.nodeEnd) {
     this._attributes = becomeParentOfAll(attributes, ifEmpty: NO_ATTRIBUTES);
     this._tagNodes = becomeParentOfAll(tagNodes, ifEmpty: NO_TAG_NODES);
   }
 
-  @override
-  accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
-
-  /**
-   * Answer the attribute with the specified name.
-   *
-   * @param name the attribute name
-   * @return the attribute or `null` if no matching attribute is found
-   */
-  XmlAttributeNode getAttribute(String name) {
-    for (XmlAttributeNode attribute in _attributes) {
-      if (attribute.name == name) {
-        return attribute;
-      }
-    }
-    return null;
-  }
-
   /**
    * Answer the receiver's attributes. Callers should not manipulate the returned list to edit the
    * AST structure.
@@ -1944,19 +2023,6 @@
    */
   List<XmlAttributeNode> get attributes => _attributes;
 
-  /**
-   * Find the attribute with the given name (see [getAttribute] and answer the lexeme
-   * for the attribute's value token without the leading and trailing quotes (see
-   * [XmlAttributeNode.getText]).
-   *
-   * @param name the attribute name
-   * @return the attribute text or `null` if no matching attribute is found
-   */
-  String getAttributeText(String name) {
-    XmlAttributeNode attribute = getAttribute(name);
-    return attribute != null ? attribute.text : null;
-  }
-
   @override
   Token get beginToken => nodeStart;
 
@@ -2033,6 +2099,37 @@
   Token get tagToken => _tag;
 
   @override
+  accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
+
+  /**
+   * Answer the attribute with the specified name.
+   *
+   * @param name the attribute name
+   * @return the attribute or `null` if no matching attribute is found
+   */
+  XmlAttributeNode getAttribute(String name) {
+    for (XmlAttributeNode attribute in _attributes) {
+      if (attribute.name == name) {
+        return attribute;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Find the attribute with the given name (see [getAttribute] and answer the lexeme
+   * for the attribute's value token without the leading and trailing quotes (see
+   * [XmlAttributeNode.getText]).
+   *
+   * @param name the attribute name
+   * @return the attribute text or `null` if no matching attribute is found
+   */
+  String getAttributeText(String name) {
+    XmlAttributeNode attribute = getAttribute(name);
+    return attribute != null ? attribute.text : null;
+  }
+
+  @override
   void visitChildren(XmlVisitor visitor) {
     for (XmlAttributeNode node in _attributes) {
       node.accept(visitor);
@@ -2055,4 +2152,4 @@
   R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode);
 
   R visitXmlTagNode(XmlTagNode xmlTagNode);
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
new file mode 100644
index 0000000..2bb8647
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -0,0 +1,1464 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library engine.incremental_resolver;
+
+import 'dart:collection';
+import 'dart:math' as math;
+
+import 'package:analyzer/src/generated/error_verifier.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+import 'ast.dart';
+import 'element.dart';
+import 'engine.dart';
+import 'error.dart';
+import 'java_engine.dart';
+import 'parser.dart';
+import 'resolver.dart';
+import 'scanner.dart';
+import 'source.dart';
+
+
+/**
+ * Instances of the class [DeclarationMatcher] determine whether the element
+ * model defined by a given AST structure matches an existing element model.
+ */
+class DeclarationMatcher extends RecursiveAstVisitor {
+  /**
+   * The libary containing the AST nodes being visited.
+   */
+  LibraryElement _enclosingLibrary;
+
+  /**
+   * The compilation unit containing the AST nodes being visited.
+   */
+  CompilationUnitElement _enclosingUnit;
+
+  /**
+   * The function type alias containing the AST nodes being visited, or `null` if we are not
+   * in the scope of a function type alias.
+   */
+  FunctionTypeAliasElement _enclosingAlias;
+
+  /**
+   * The class containing the AST nodes being visited, or `null` if we are not
+   * in the scope of a class.
+   */
+  ClassElement _enclosingClass;
+
+  /**
+   * The parameter containing the AST nodes being visited, or `null` if we are not in the
+   * scope of a parameter.
+   */
+  ParameterElement _enclosingParameter;
+
+  FieldDeclaration _enclosingFieldNode = null;
+  bool _inTopLevelVariableDeclaration = false;
+
+  /**
+   * Is `true` if the current class declaration has a constructor.
+   */
+  bool _hasConstructor = false;
+
+  /**
+   * A set containing all of the elements in the element model that were defined by the old AST node
+   * corresponding to the AST node being visited.
+   */
+  HashSet<Element> _allElements = new HashSet<Element>();
+
+  /**
+   * A set containing all of the elements in the element model that were defined by the old AST node
+   * corresponding to the AST node being visited that have not already been matched to nodes in the
+   * AST structure being visited.
+   */
+  HashSet<Element> _unmatchedElements = new HashSet<Element>();
+
+  /**
+   * Return `true` if the declarations within the given AST structure define an element model
+   * that is equivalent to the corresponding elements rooted at the given element.
+   *
+   * @param node the AST structure being compared to the element model
+   * @param element the root of the element model being compared to the AST structure
+   * @return `true` if the AST structure defines the same elements as those in the given
+   *         element model
+   */
+  bool matches(AstNode node, Element element) {
+    _captureEnclosingElements(element);
+    _gatherElements(element);
+    try {
+      node.accept(this);
+    } on _DeclarationMismatchException catch (exception) {
+      return false;
+    }
+    return _unmatchedElements.isEmpty;
+  }
+
+  @override
+  visitBlockFunctionBody(BlockFunctionBody node) {
+    // ignore bodies
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    String name = node.name.name;
+    ClassElement element = _findElement(_enclosingUnit.types, name);
+    _enclosingClass = element;
+    _processElement(element);
+    _assertSameTypeParameters(node.typeParameters, element.typeParameters);
+    // check for missing clauses
+    if (node.extendsClause == null) {
+      _assertTrue(element.supertype.name == 'Object');
+    }
+    if (node.implementsClause == null) {
+      _assertTrue(element.interfaces.isEmpty);
+    }
+    if (node.withClause == null) {
+      _assertTrue(element.mixins.isEmpty);
+    }
+    // process clauses and members
+    _hasConstructor = false;
+    super.visitClassDeclaration(node);
+    // process default constructor
+    if (!_hasConstructor) {
+      ConstructorElement constructor = element.unnamedConstructor;
+      _processElement(constructor);
+      if (!constructor.isSynthetic) {
+        _assertEquals(constructor.parameters.length, 0);
+      }
+    }
+  }
+
+  @override
+  visitClassTypeAlias(ClassTypeAlias node) {
+    String name = node.name.name;
+    ClassElement element = _findElement(_enclosingUnit.types, name);
+    _enclosingClass = element;
+    _processElement(element);
+    _assertSameTypeParameters(node.typeParameters, element.typeParameters);
+    _processElement(element.unnamedConstructor);
+    super.visitClassTypeAlias(node);
+  }
+
+  @override
+  visitCompilationUnit(CompilationUnit node) {
+    _processElement(_enclosingUnit);
+    super.visitCompilationUnit(node);
+  }
+
+  @override
+  visitConstructorDeclaration(ConstructorDeclaration node) {
+    _hasConstructor = true;
+    SimpleIdentifier constructorName = node.name;
+    ConstructorElement element = constructorName == null ?
+        _enclosingClass.unnamedConstructor :
+        _enclosingClass.getNamedConstructor(constructorName.name);
+    _processElement(element);
+    node.element = element;
+    _assertCompatibleParameters(node.parameters, element.parameters);
+  }
+
+  @override
+  visitEnumConstantDeclaration(EnumConstantDeclaration node) {
+    String name = node.name.name;
+    FieldElement element = _findElement(_enclosingClass.fields, name);
+    _processElement(element);
+  }
+
+  @override
+  visitEnumDeclaration(EnumDeclaration node) {
+    String name = node.name.name;
+    ClassElement element = _findElement(_enclosingUnit.enums, name);
+    _enclosingClass = element;
+    _processElement(element);
+    _assertTrue(element.isEnum);
+    super.visitEnumDeclaration(node);
+  }
+
+  @override
+  visitExportDirective(ExportDirective node) {
+    String uri = _getStringValue(node.uri);
+    if (uri != null) {
+      ExportElement element =
+          _findUriReferencedElement(_enclosingLibrary.exports, uri);
+      _processElement(element);
+      _assertCombinators(node.combinators, element.combinators);
+    }
+  }
+
+  @override
+  visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    // ignore bodies
+  }
+
+  @override
+  visitExtendsClause(ExtendsClause node) {
+    _assertSameType(node.superclass, _enclosingClass.supertype);
+  }
+
+  @override
+  visitFieldDeclaration(FieldDeclaration node) {
+    _enclosingFieldNode = node;
+    try {
+      super.visitFieldDeclaration(node);
+    } finally {
+      _enclosingFieldNode = null;
+    }
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    // prepare element name
+    String name = node.name.name;
+    if (node.isSetter) {
+      name += '=';
+    }
+    // prepare element
+    Token property = node.propertyKeyword;
+    ExecutableElement element;
+    if (property == null) {
+      element = _findElement(_enclosingUnit.functions, name);
+    } else {
+      element = _findElement(_enclosingUnit.accessors, name);
+    }
+    // process element
+    _processElement(element);
+    node.name.staticElement = element;
+    node.functionExpression.element = element;
+    _assertFalse(element.isSynthetic);
+    _assertSameType(node.returnType, element.returnType);
+    _assertCompatibleParameters(
+        node.functionExpression.parameters,
+        element.parameters);
+  }
+
+  @override
+  visitFunctionTypeAlias(FunctionTypeAlias node) {
+    String name = node.name.name;
+    FunctionTypeAliasElement element =
+        _findElement(_enclosingUnit.functionTypeAliases, name);
+    _processElement(element);
+    _assertSameTypeParameters(node.typeParameters, element.typeParameters);
+    _assertSameType(node.returnType, element.returnType);
+    _assertCompatibleParameters(node.parameters, element.parameters);
+  }
+
+  @override
+  visitImplementsClause(ImplementsClause node) {
+    List<TypeName> nodes = node.interfaces;
+    List<InterfaceType> types = _enclosingClass.interfaces;
+    _assertSameTypes(nodes, types);
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    String uri = _getStringValue(node.uri);
+    if (uri != null) {
+      ImportElement element =
+          _findUriReferencedElement(_enclosingLibrary.imports, uri);
+      _processElement(element);
+      // match the prefix
+      SimpleIdentifier prefixNode = node.prefix;
+      PrefixElement prefixElement = element.prefix;
+      if (prefixNode == null) {
+        _assertNull(prefixElement);
+      } else {
+        _assertNotNull(prefixElement);
+        _assertEquals(prefixNode.name, prefixElement.name);
+      }
+      // match combinators
+      _assertCombinators(node.combinators, element.combinators);
+    }
+  }
+
+  @override
+  visitMethodDeclaration(MethodDeclaration node) {
+    // prepare element name
+    String name = node.name.name;
+    if (name == TokenType.MINUS.lexeme &&
+        node.parameters.parameters.length == 0) {
+      name = "unary-";
+    }
+    if (node.isSetter) {
+      name += '=';
+    }
+    // prepare element
+    Token property = node.propertyKeyword;
+    ExecutableElement element;
+    if (property == null) {
+      element = _findElement(_enclosingClass.methods, name);
+    } else {
+      element = _findElement(_enclosingClass.accessors, name);
+    }
+    // process element
+    _processElement(element);
+    _assertEquals(node.isStatic, element.isStatic);
+    node.name.staticElement = element;
+    _assertSameType(node.returnType, element.returnType);
+    _assertCompatibleParameters(node.parameters, element.parameters);
+  }
+
+  @override
+  visitPartDirective(PartDirective node) {
+    String uri = _getStringValue(node.uri);
+    if (uri != null) {
+      CompilationUnitElement element =
+          _findUriReferencedElement(_enclosingLibrary.parts, uri);
+      _processElement(element);
+    }
+    super.visitPartDirective(node);
+  }
+
+  @override
+  visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    _inTopLevelVariableDeclaration = true;
+    try {
+      super.visitTopLevelVariableDeclaration(node);
+    } finally {
+      _inTopLevelVariableDeclaration = false;
+    }
+  }
+
+  @override
+  visitVariableDeclaration(VariableDeclaration node) {
+    // prepare variable
+    String name = node.name.name;
+    PropertyInducingElement element;
+    if (_inTopLevelVariableDeclaration) {
+      element = _findElement(_enclosingUnit.topLevelVariables, name);
+    } else {
+      element = _findElement(_enclosingClass.fields, name);
+    }
+    // verify
+    _assertNotNull(element);
+    _processElement(element);
+    _assertEquals(node.isConst, element.isConst);
+    _assertEquals(node.isFinal, element.isFinal);
+    if (_enclosingFieldNode != null) {
+      _assertEquals(_enclosingFieldNode.isStatic, element.isStatic);
+    }
+    _assertSameType(
+        (node.parent as VariableDeclarationList).type,
+        element.type);
+  }
+
+  @override
+  visitWithClause(WithClause node) {
+    List<TypeName> nodes = node.mixinTypes;
+    List<InterfaceType> types = _enclosingClass.mixins;
+    _assertSameTypes(nodes, types);
+  }
+
+  void _assertCombinators(List<Combinator> nodeCombinators,
+      List<NamespaceCombinator> elementCombinators) {
+    // prepare shown/hidden names in the element
+    Set<String> showNames = new Set<String>();
+    Set<String> hideNames = new Set<String>();
+    for (NamespaceCombinator combinator in elementCombinators) {
+      if (combinator is ShowElementCombinator) {
+        showNames.addAll(combinator.shownNames);
+      } else if (combinator is HideElementCombinator) {
+        hideNames.addAll(combinator.hiddenNames);
+      }
+    }
+    // match combinators with the node
+    for (Combinator combinator in nodeCombinators) {
+      if (combinator is ShowCombinator) {
+        for (SimpleIdentifier nameNode in combinator.shownNames) {
+          String name = nameNode.name;
+          _assertTrue(showNames.remove(name));
+        }
+      } else if (combinator is HideCombinator) {
+        for (SimpleIdentifier nameNode in combinator.hiddenNames) {
+          String name = nameNode.name;
+          _assertTrue(hideNames.remove(name));
+        }
+      }
+    }
+    _assertTrue(showNames.isEmpty);
+    _assertTrue(hideNames.isEmpty);
+  }
+
+  void _assertCompatibleParameter(FormalParameter node,
+      ParameterElement element) {
+    _assertEquals(node.kind, element.parameterKind);
+    if (node.kind == ParameterKind.NAMED) {
+      _assertEquals(node.identifier.name, element.name);
+    }
+    // check parameter type specific properties
+    if (node is DefaultFormalParameter) {
+      Expression nodeDefault = node.defaultValue;
+      if (nodeDefault == null) {
+        _assertNull(element.defaultValueCode);
+      } else {
+        _assertEquals(nodeDefault.toSource(), element.defaultValueCode);
+      }
+    } else if (node is FieldFormalParameter) {
+      _assertTrue(element.isInitializingFormal);
+    } else if (node is FunctionTypedFormalParameter) {
+      _assertTrue(element.type is FunctionType);
+      FunctionType elementType = element.type;
+      _assertCompatibleParameters(node.parameters, element.parameters);
+      _assertSameType(node.returnType, elementType.returnType);
+    } else if (node is SimpleFormalParameter) {
+      _assertSameType(node.type, element.type);
+      node.identifier.staticElement = element;
+      (element as ElementImpl).nameOffset = node.identifier.offset;
+      (element as ElementImpl).name = node.identifier.name;
+    }
+  }
+
+  void _assertCompatibleParameters(FormalParameterList nodes,
+      List<ParameterElement> elements) {
+    if (nodes == null) {
+      return _assertEquals(elements.length, 0);
+    }
+    List<FormalParameter> parameters = nodes.parameters;
+    int length = parameters.length;
+    _assertEquals(length, elements.length);
+    for (int i = 0; i < length; i++) {
+      _assertCompatibleParameter(parameters[i], elements[i]);
+    }
+  }
+
+  void _assertEquals(Object a, Object b) {
+    if (a != b) {
+      throw new _DeclarationMismatchException();
+    }
+  }
+
+  void _assertFalse(bool condition) {
+    if (condition) {
+      throw new _DeclarationMismatchException();
+    }
+  }
+
+  void _assertNotNull(Object object) {
+    if (object == null) {
+      throw new _DeclarationMismatchException();
+    }
+  }
+
+  void _assertNull(Object object) {
+    if (object != null) {
+      throw new _DeclarationMismatchException();
+    }
+  }
+
+  void _assertSameType(TypeName node, DartType type) {
+    // no return type == dynamic
+    if (node == null) {
+      return _assertTrue(type == null || type.isDynamic);
+    }
+    if (type == null) {
+      return _assertTrue(false);
+    }
+    // prepare name
+    Identifier nameIdentifier = node.name;
+    if (nameIdentifier is PrefixedIdentifier) {
+      nameIdentifier = (nameIdentifier as PrefixedIdentifier).identifier;
+    }
+    String nodeName = nameIdentifier.name;
+    // check specific type kinds
+    if (type is InterfaceType) {
+      _assertEquals(nodeName, type.name);
+      // check arguments
+      TypeArgumentList nodeArgumentList = node.typeArguments;
+      List<DartType> typeArguments = type.typeArguments;
+      if (nodeArgumentList == null) {
+        // Node doesn't have type arguments, so all type arguments of the
+        // element must be "dynamic".
+        for (DartType typeArgument in typeArguments) {
+          _assertTrue(typeArgument.isDynamic);
+        }
+      } else {
+        List<TypeName> nodeArguments = nodeArgumentList.arguments;
+        _assertSameTypes(nodeArguments, typeArguments);
+      }
+    } else if (type is TypeParameterType) {
+      _assertEquals(nodeName, type.name);
+      // TODO(scheglov) it should be possible to rename type parameters
+    } else if (type.isVoid) {
+      _assertEquals(nodeName, 'void');
+    } else if (type.isDynamic) {
+      _assertEquals(nodeName, 'dynamic');
+    } else {
+      // TODO(scheglov) support other types
+//      print('node: $node type: $type  type.type: ${type.runtimeType}');
+      _assertTrue(false);
+    }
+  }
+
+  void _assertSameTypeParameter(TypeParameter node,
+      TypeParameterElement element) {
+    _assertSameType(node.bound, element.bound);
+  }
+
+  void _assertSameTypeParameters(TypeParameterList nodesList,
+      List<TypeParameterElement> elements) {
+    if (nodesList == null) {
+      return _assertEquals(elements.length, 0);
+    }
+    List<TypeParameter> nodes = nodesList.typeParameters;
+    int length = nodes.length;
+    _assertEquals(length, elements.length);
+    for (int i = 0; i < length; i++) {
+      _assertSameTypeParameter(nodes[i], elements[i]);
+    }
+  }
+
+  void _assertSameTypes(List<TypeName> nodes, List<DartType> types) {
+    int length = nodes.length;
+    _assertEquals(length, types.length);
+    for (int i = 0; i < length; i++) {
+      _assertSameType(nodes[i], types[i]);
+    }
+  }
+
+  void _assertTrue(bool condition) {
+    if (!condition) {
+      throw new _DeclarationMismatchException();
+    }
+  }
+
+  /**
+   * Given that the comparison is to begin with the given [element], capture
+   * the enclosing elements that might be used while performing the comparison.
+   */
+  void _captureEnclosingElements(Element element) {
+    Element parent =
+        element is CompilationUnitElement ? element : element.enclosingElement;
+    while (parent != null) {
+      if (parent is CompilationUnitElement) {
+        _enclosingUnit = parent as CompilationUnitElement;
+        _enclosingLibrary = element.library;
+      } else if (parent is ClassElement) {
+        if (_enclosingClass == null) {
+          _enclosingClass = parent as ClassElement;
+        }
+      } else if (parent is FunctionTypeAliasElement) {
+        if (_enclosingAlias == null) {
+          _enclosingAlias = parent as FunctionTypeAliasElement;
+        }
+      } else if (parent is ParameterElement) {
+        if (_enclosingParameter == null) {
+          _enclosingParameter = parent as ParameterElement;
+        }
+      }
+      parent = parent.enclosingElement;
+    }
+  }
+
+  void _gatherElements(Element element) {
+    _ElementsGatherer gatherer = new _ElementsGatherer(this);
+    element.accept(gatherer);
+    // TODO(scheglov) what if a change in a directive?
+    if (identical(element, _enclosingLibrary.definingCompilationUnit)) {
+      gatherer.addElements(_enclosingLibrary.imports);
+      gatherer.addElements(_enclosingLibrary.exports);
+      gatherer.addElements(_enclosingLibrary.parts);
+    }
+  }
+
+  void _processElement(Element element) {
+    _assertNotNull(element);
+    if (!_allElements.contains(element)) {
+      throw new _DeclarationMismatchException();
+    }
+    _unmatchedElements.remove(element);
+  }
+
+  /**
+   * Return the [Element] in [elements] with the given [name].
+   */
+  static Element _findElement(List<Element> elements, String name) {
+    for (Element element in elements) {
+      if (element.name == name) {
+        return element;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Return the [UriReferencedElement] from [elements] with the given [uri], or
+   * `null` if there is no such element.
+   */
+  static UriReferencedElement
+      _findUriReferencedElement(List<UriReferencedElement> elements, String uri) {
+    for (UriReferencedElement element in elements) {
+      if (element.uri == uri) {
+        return element;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Return the value of [literal], or `null` if the string is not a constant
+   * string without any string interpolation.
+   */
+  static String _getStringValue(StringLiteral literal) {
+    if (literal is StringInterpolation) {
+      return null;
+    }
+    return literal.stringValue;
+  }
+}
+
+
+/**
+ * Instances of the class [IncrementalResolver] resolve the smallest portion of
+ * an AST structure that we currently know how to resolve.
+ */
+class IncrementalResolver {
+  /**
+   * The object used to access the types from the core library.
+   */
+  final TypeProvider _typeProvider;
+
+  /**
+   * The element for the library containing the compilation unit being resolved.
+   */
+  final LibraryElement _definingLibrary;
+
+  /**
+   * The element of the compilation unit being resolved.
+   */
+  final CompilationUnitElement _definingUnit;
+
+  /**
+   * The source representing the compilation unit being visited.
+   */
+  final Source _source;
+
+  /**
+   * The offset of the changed contents.
+   */
+  final int _updateOffset;
+
+  /**
+   * The number of characters in the original contents that were replaced.
+   */
+  final int _updateOldLength;
+
+  /**
+   * The number of characters in the replacement text.
+   */
+  final int _updateNewLength;
+
+  ResolutionContext _resolutionContext;
+
+  List<AnalysisError> _resolveErrors = AnalysisError.NO_ERRORS;
+  List<AnalysisError> _verifyErrors = AnalysisError.NO_ERRORS;
+  List<AnalysisError> _hints = AnalysisError.NO_ERRORS;
+
+  /**
+   * Initialize a newly created incremental resolver to resolve a node in the
+   * given source in the given library.
+   */
+  IncrementalResolver(this._typeProvider, this._definingLibrary,
+      this._definingUnit, this._source, this._updateOffset, this._updateOldLength,
+      this._updateNewLength);
+
+  /**
+   * Resolve [node], reporting any errors or warnings to the given listener.
+   *
+   * [node] - the root of the AST structure to be resolved.
+   */
+  void resolve(AstNode node) {
+    AstNode rootNode = _findResolutionRoot(node);
+    // update elements
+    _updateElementNameOffsets(
+        _definingUnit,
+        _updateOffset,
+        _updateNewLength - _updateOldLength);
+    if (_elementModelChanged(rootNode)) {
+      throw new AnalysisException("Cannot resolve node: element model changed");
+    }
+    _updateElements(rootNode);
+    // resolve
+    _resolveReferences(rootNode);
+    // verify
+    _verify(rootNode);
+    _generateHints(rootNode);
+  }
+
+  /**
+   * Return `true` if the given node can be resolved independently of any other
+   * nodes.
+   *
+   * *Note*: This method needs to be kept in sync with
+   * [ScopeBuilder.ContextBuilder].
+   *
+   * [node] - the node being tested.
+   */
+  bool _canBeResolved(AstNode node) =>
+      node is ClassDeclaration ||
+          node is ClassTypeAlias ||
+          node is CompilationUnit ||
+          node is ConstructorDeclaration ||
+          node is FunctionDeclaration ||
+          node is FunctionTypeAlias ||
+          node is MethodDeclaration;
+
+  /**
+   * Return `true` if the portion of the element model defined by the given node
+   * has changed.
+   *
+   * [node] - the node defining the portion of the element model being tested.
+   *
+   * Throws [AnalysisException] if the correctness of the element model cannot
+   * be determined.
+   */
+  bool _elementModelChanged(AstNode node) {
+    // If we are replacing the whole declaration (e.g. rename a parameter), we
+    // can try to find the corresponding Element in the enclosing one, see if it
+    // is compatible, and if 'yes', then restore and update it.
+    // TODO(scheglov) This should be rewritten. It causes validating the whole
+    // class, when just one method is changed.
+    if (node is Declaration) {
+      node = node.parent;
+    }
+    Element element = _getElement(node);
+    if (element == null) {
+      throw new AnalysisException(
+          "Cannot resolve node: a ${node.runtimeType} does not define an element");
+    }
+    DeclarationMatcher matcher = new DeclarationMatcher();
+    return !matcher.matches(node, element);
+  }
+
+  /**
+   * Starting at [node], find the smallest AST node that can be resolved
+   * independently of any other nodes. Return the node that was found.
+   *
+   * [node] - the node at which the search is to begin
+   *
+   * Throws [AnalysisException] if there is no such node.
+   */
+  AstNode _findResolutionRoot(AstNode node) {
+    while (node != null) {
+      if (_canBeResolved(node)) {
+        return node;
+      }
+      node = node.parent;
+    }
+    throw new AnalysisException("Cannot resolve node: no resolvable node");
+  }
+
+  void _generateHints(AstNode node) {
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
+    AnalysisContext analysisContext = _definingLibrary.context;
+    HintGenerator hintGenerator =
+        new HintGenerator(<CompilationUnit>[unit], analysisContext, errorListener);
+    hintGenerator.generateForLibrary();
+    _hints = errorListener.getErrorsForSource(_source);
+  }
+
+  /**
+   * Return the element defined by [node], or `null` if the node does not
+   * define an element.
+   */
+  Element _getElement(AstNode node) {
+    if (node is Declaration) {
+      return node.element;
+    } else if (node is CompilationUnit) {
+      return node.element;
+    }
+    return null;
+  }
+
+  _resolveReferences(AstNode node) {
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    // prepare context
+    _resolutionContext =
+        ResolutionContextBuilder.contextFor(node, errorListener);
+    Scope scope = _resolutionContext.scope;
+    // resolve types
+    {
+      TypeResolverVisitor visitor = new TypeResolverVisitor.con3(
+          _definingLibrary,
+          _source,
+          _typeProvider,
+          scope,
+          errorListener);
+      node.accept(visitor);
+    }
+    // resolve variables
+    {
+      VariableResolverVisitor visitor = new VariableResolverVisitor.con2(
+          _definingLibrary,
+          _source,
+          _typeProvider,
+          scope,
+          errorListener);
+      node.accept(visitor);
+    }
+    // resolve references
+    {
+      ResolverVisitor visitor = new ResolverVisitor.con3(
+          _definingLibrary,
+          _source,
+          _typeProvider,
+          _resolutionContext.scope,
+          errorListener);
+      if (_resolutionContext.enclosingClassDeclaration != null) {
+        visitor.visitClassDeclarationIncrementally(
+            _resolutionContext.enclosingClassDeclaration);
+      }
+      node.accept(visitor);
+    }
+    // remember errors
+    _resolveErrors = errorListener.getErrorsForSource(_source);
+  }
+
+  void _updateElements(AstNode node) {
+    // build elements in node
+    ElementHolder holder;
+    _ElementsRestorer elementsRestorer = new _ElementsRestorer(node);
+    try {
+      holder = new ElementHolder();
+      ElementBuilder builder = new ElementBuilder(holder);
+      node.accept(builder);
+    } finally {
+      elementsRestorer.restore();
+    }
+    // apply compatible changes to elements
+    if (node is FunctionDeclaration) {
+      ExecutableElementImpl oldElement = node.element;
+      // prepare the new element
+      ExecutableElement newElement;
+      {
+        List<FunctionElement> holderFunctions = holder.functions;
+        List<PropertyAccessorElement> holderAccessors = holder.accessors;
+        if (holderFunctions.isNotEmpty) {
+          newElement = holderFunctions[0];
+        } else if (holderAccessors.isNotEmpty) {
+          newElement = holderAccessors[0];
+        }
+      }
+      // update the old Element
+      oldElement.labels = newElement.labels;
+      oldElement.localVariables = newElement.localVariables;
+    }
+    if (node is MethodDeclaration) {
+      ExecutableElementImpl oldElement = node.element;
+      // prepare the new element
+      ExecutableElement newElement;
+      {
+        List<MethodElement> holderMethods = holder.methods;
+        List<PropertyAccessorElement> holderAccessors = holder.accessors;
+        if (holderMethods.isNotEmpty) {
+          newElement = holderMethods[0];
+        } else if (holderAccessors.isNotEmpty) {
+          newElement = holderAccessors[0];
+        }
+      }
+      // update the old Element
+      oldElement.labels = newElement.labels;
+      oldElement.localVariables = newElement.localVariables;
+    }
+  }
+
+  void _verify(AstNode node) {
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
+    ErrorVerifier errorVerifier = new ErrorVerifier(
+        errorReporter,
+        _definingLibrary,
+        _typeProvider,
+        new InheritanceManager(_definingLibrary));
+    if (_resolutionContext.enclosingClassDeclaration != null) {
+      errorVerifier.visitClassDeclarationIncrementally(
+          _resolutionContext.enclosingClassDeclaration);
+    }
+    node.accept(errorVerifier);
+    _verifyErrors = errorListener.getErrorsForSource(_source);
+  }
+
+  static void _updateElementNameOffsets(Element root, int offset, int delta) {
+    root.accept(new _ElementNameOffsetUpdater(offset, delta));
+  }
+}
+
+
+class PoorMansIncrementalResolver {
+  final TypeProvider _typeProvider;
+  final Source _unitSource;
+  final Source _librarySource;
+  final DartEntry _entry;
+
+  int _updateOffset;
+  int _updateDelta;
+  int _updateEndOld;
+  int _updateEndNew;
+
+  List<AnalysisError> _newScanErrors = <AnalysisError>[];
+  List<AnalysisError> _newParseErrors = <AnalysisError>[];
+  List<AnalysisError> _newResolveErrors = <AnalysisError>[];
+  List<AnalysisError> _newVerifyErrors = <AnalysisError>[];
+  List<AnalysisError> _newHints = <AnalysisError>[];
+
+  PoorMansIncrementalResolver(this._typeProvider, this._unitSource,
+      this._librarySource, this._entry);
+
+  /**
+   * Attempts to update [oldUnit] to the state corresponding to [newCode].
+   * Returns `true` if success, or `false` otherwise.
+   * The [oldUnit] might be damaged.
+   */
+  bool resolve(CompilationUnit oldUnit, String newCode) {
+    try {
+      CompilationUnit newUnit = _parseUnit(newCode);
+      _TokenPair firstPair =
+          _findFirstDifferentToken(oldUnit.beginToken, newUnit.beginToken);
+      _TokenPair lastPair =
+          _findLastDifferentToken(oldUnit.endToken, newUnit.endToken);
+      if (firstPair != null && lastPair != null) {
+        int firstOffsetOld = firstPair.oldToken.offset;
+        int firstOffsetNew = firstPair.newToken.offset;
+        int lastOffsetOld = lastPair.oldToken.end;
+        int lastOffsetNew = lastPair.newToken.end;
+        int beginOffsetOld = math.min(firstOffsetOld, lastOffsetOld);
+        int endOffsetOld = math.max(firstOffsetOld, lastOffsetOld);
+        int beginOffsetNew = math.min(firstOffsetNew, lastOffsetNew);
+        int endOffsetNew = math.max(firstOffsetNew, lastOffsetNew);
+        // check for a whitespace only change
+        if (identical(lastPair.oldToken, firstPair.oldToken) &&
+            identical(lastPair.newToken, firstPair.newToken)) {
+          _updateOffset = beginOffsetOld - 1;
+          _updateEndOld = endOffsetOld;
+          _updateDelta = newUnit.length - oldUnit.length;
+          _shiftTokens(firstPair.oldToken, _updateDelta);
+          IncrementalResolver._updateElementNameOffsets(
+              oldUnit.element,
+              _updateOffset,
+              _updateDelta);
+          _updateEntry();
+          return true;
+        }
+//        print('beginOffsetOld: $beginOffsetOld endOffsetOld: $endOffsetOld');
+//        print('beginOffsetNew: $beginOffsetNew endOffsetNew: $endOffsetNew');
+        // Find nodes covering the "old" and "new" token ranges.
+        AstNode oldNode =
+            _findNodeCovering(oldUnit, beginOffsetOld, endOffsetOld);
+        AstNode newNode =
+            _findNodeCovering(newUnit, beginOffsetNew, endOffsetNew);
+//        print('oldNode: $oldNode');
+//        print('newNode: $newNode');
+        // Try to find the smallest common node, a FunctionBody currently.
+        {
+          List<AstNode> oldParents = _getParents(oldNode);
+          List<AstNode> newParents = _getParents(newNode);
+          int length = math.min(oldParents.length, newParents.length);
+          bool found = false;
+          for (int i = 0; i < length; i++) {
+            AstNode oldParent = oldParents[i];
+            AstNode newParent = newParents[i];
+            if (oldParent is FunctionDeclaration &&
+                newParent is FunctionDeclaration ||
+                oldParent is MethodDeclaration && newParent is MethodDeclaration ||
+                oldParent is ConstructorDeclaration && newParent is ConstructorDeclaration) {
+              oldNode = oldParent;
+              newNode = newParent;
+              found = true;
+            }
+            if (oldParent is FunctionBody && newParent is FunctionBody) {
+              oldNode = oldParent;
+              newNode = newParent;
+              found = true;
+              break;
+            }
+          }
+          if (!found) {
+            return false;
+          }
+        }
+//        print('oldNode: $oldNode');
+//        print('newNode: $newNode');
+        // prepare update range
+        _updateOffset = oldNode.offset;
+        _updateEndOld = oldNode.end;
+        _updateEndNew = newNode.end;
+        _updateDelta = _updateEndNew - _updateEndOld;
+        // replace node
+        NodeReplacer.replace(oldNode, newNode);
+        // update token references
+        {
+          Token oldBeginToken = oldNode.beginToken;
+          if (oldBeginToken.previous.type == TokenType.EOF) {
+            oldUnit.beginToken = newNode.beginToken;
+          } else {
+            oldBeginToken.previous.setNext(newNode.beginToken);
+          }
+          newNode.endToken.setNext(oldNode.endToken.next);
+          _shiftTokens(oldNode.endToken.next, _updateDelta);
+        }
+        // perform incremental resolution
+        CompilationUnitElement oldUnitElement = oldUnit.element;
+        IncrementalResolver incrementalResolver = new IncrementalResolver(
+            _typeProvider,
+            oldUnitElement.library,
+            oldUnitElement,
+            oldUnitElement.source,
+            _updateOffset,
+            oldNode.length,
+            newNode.length);
+        incrementalResolver.resolve(newNode);
+        _newResolveErrors = incrementalResolver._resolveErrors;
+        _newVerifyErrors = incrementalResolver._verifyErrors;
+        _newHints = incrementalResolver._hints;
+        _updateEntry();
+//        print('Successfully incrementally resolved.');
+        return true;
+      }
+    } catch (e) {
+      // TODO(scheglov) find a way to log these exceptions
+//      print(e);
+//      print(st);
+    }
+    return false;
+  }
+
+  CompilationUnit _parseUnit(String code) {
+    Token token = _scan(code);
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    Parser parser = new Parser(_unitSource, errorListener);
+    CompilationUnit unit = parser.parseCompilationUnit(token);
+    _newParseErrors = errorListener.errors;
+    return unit;
+  }
+
+  Token _scan(String code) {
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    CharSequenceReader reader = new CharSequenceReader(code);
+    Scanner scanner = new Scanner(_unitSource, reader, errorListener);
+    Token token = scanner.tokenize();
+    _newScanErrors = errorListener.errors;
+    return token;
+  }
+
+  void _updateEntry() {
+    _entry.setValue(DartEntry.SCAN_ERRORS, _newScanErrors);
+    _entry.setValue(DartEntry.PARSE_ERRORS, _newParseErrors);
+    {
+      List<AnalysisError> oldErrors =
+          _entry.getValueInLibrary(DartEntry.RESOLUTION_ERRORS, _librarySource);
+      List<AnalysisError> errors = _updateErrors(oldErrors, _newResolveErrors);
+      _entry.setValueInLibrary(
+          DartEntry.RESOLUTION_ERRORS,
+          _librarySource,
+          errors);
+    }
+    {
+      List<AnalysisError> oldErrors =
+          _entry.getValueInLibrary(DartEntry.VERIFICATION_ERRORS, _librarySource);
+      List<AnalysisError> errors = _updateErrors(oldErrors, _newVerifyErrors);
+      _entry.setValueInLibrary(
+          DartEntry.VERIFICATION_ERRORS,
+          _librarySource,
+          errors);
+    }
+    {
+      List<AnalysisError> oldErrors =
+          _entry.getValueInLibrary(DartEntry.HINTS, _librarySource);
+      List<AnalysisError> errors = _updateErrors(oldErrors, _newHints);
+      _entry.setValueInLibrary(DartEntry.HINTS, _librarySource, errors);
+    }
+  }
+
+  List<AnalysisError> _updateErrors(List<AnalysisError> oldErrors,
+      List<AnalysisError> newErrors) {
+    List<AnalysisError> errors = new List<AnalysisError>();
+    // add updated old errors
+    for (AnalysisError error in oldErrors) {
+      int errorOffset = error.offset;
+      if (errorOffset < _updateOffset) {
+        errors.add(error);
+      } else if (errorOffset > _updateEndOld) {
+        error.offset += _updateDelta;
+        errors.add(error);
+      }
+    }
+    // add new errors
+    for (AnalysisError error in newErrors) {
+      int errorOffset = error.offset;
+      if (errorOffset > _updateOffset && errorOffset < _updateEndNew) {
+        errors.add(error);
+      }
+    }
+    // done
+    return errors;
+  }
+
+  static bool _equalToken(Token oldToken, Token newToken, int delta) {
+    if (oldToken.type != newToken.type) {
+      return false;
+    }
+    if (newToken.offset - oldToken.offset != delta) {
+      return false;
+    }
+    return oldToken.lexeme == newToken.lexeme;
+  }
+
+  static _TokenPair _findFirstDifferentToken(Token oldToken, Token newToken) {
+//    print('first ------------');
+    while (oldToken.type != TokenType.EOF && newToken.type != TokenType.EOF) {
+//      print('old: $oldToken @ ${oldToken.offset}');
+//      print('new: $newToken @ ${newToken.offset}');
+      if (!_equalToken(oldToken, newToken, 0)) {
+        return new _TokenPair(oldToken, newToken);
+      }
+      oldToken = oldToken.next;
+      newToken = newToken.next;
+    }
+    return null;
+  }
+
+  static _TokenPair _findLastDifferentToken(Token oldToken, Token newToken) {
+//    print('last ------------');
+    int delta = newToken.offset - oldToken.offset;
+    while (oldToken.previous != oldToken && newToken.previous != newToken) {
+//      print('old: $oldToken @ ${oldToken.offset}');
+//      print('new: $newToken @ ${newToken.offset}');
+      if (!_equalToken(oldToken, newToken, delta)) {
+        return new _TokenPair(oldToken.next, newToken.next);
+      }
+      oldToken = oldToken.previous;
+      newToken = newToken.previous;
+    }
+    return null;
+  }
+
+  static AstNode _findNodeCovering(AstNode root, int offset, int end) {
+    NodeLocator nodeLocator = new NodeLocator.con2(offset, end);
+    return nodeLocator.searchWithin(root);
+  }
+
+  static List<AstNode> _getParents(AstNode node) {
+    List<AstNode> parents = <AstNode>[];
+    while (node != null) {
+      parents.insert(0, node);
+      node = node.parent;
+    }
+    return parents;
+  }
+
+  static void _shiftTokens(Token token, int delta) {
+    while (true) {
+      token.offset += delta;
+      if (token.type == TokenType.EOF) {
+        break;
+      }
+      token = token.next;
+    }
+  }
+}
+
+
+/**
+ * The context to resolve an [AstNode] in.
+ */
+class ResolutionContext {
+  ClassDeclaration enclosingClassDeclaration;
+  ClassElement enclosingClass;
+  Scope scope;
+}
+
+
+/**
+ * Instances of the class [ResolutionContextBuilder] build the context for a
+ * given node in an AST structure. At the moment, this class only handles
+ * top-level and class-level declarations.
+ */
+class ResolutionContextBuilder {
+  /**
+   * The listener to which analysis errors will be reported.
+   */
+  final AnalysisErrorListener _errorListener;
+
+  /**
+   * The class containing the enclosing [ClassDeclaration], or `null` if we are
+   * not in the scope of a class.
+   */
+  ClassDeclaration _enclosingClassDeclaration;
+
+  /**
+   * The class containing the enclosing [ClassElement], or `null` if we are not
+   * in the scope of a class.
+   */
+  ClassElement _enclosingClass;
+
+  /**
+   * Initialize a newly created scope builder to generate a scope that will
+   * report errors to the given listener.
+   */
+  ResolutionContextBuilder(this._errorListener);
+
+  Scope _scopeFor(AstNode node) {
+    if (node is CompilationUnit) {
+      return _scopeForAstNode(node);
+    }
+    AstNode parent = node.parent;
+    if (parent == null) {
+      throw new AnalysisException(
+          "Cannot create scope: node is not part of a CompilationUnit");
+    }
+    return _scopeForAstNode(parent);
+  }
+
+  /**
+   * Return the scope in which the given AST structure should be resolved.
+   *
+   * *Note:* This method needs to be kept in sync with
+   * [IncrementalResolver.canBeResolved].
+   *
+   * [node] - the root of the AST structure to be resolved.
+   *
+   * Throws [AnalysisException] if the AST structure has not been resolved or
+   * is not part of a [CompilationUnit]
+   */
+  Scope _scopeForAstNode(AstNode node) {
+    if (node is CompilationUnit) {
+      return _scopeForCompilationUnit(node);
+    }
+    AstNode parent = node.parent;
+    if (parent == null) {
+      throw new AnalysisException(
+          "Cannot create scope: node is not part of a CompilationUnit");
+    }
+    Scope scope = _scopeForAstNode(parent);
+    if (node is ClassDeclaration) {
+      _enclosingClassDeclaration = node;
+      _enclosingClass = node.element;
+      if (_enclosingClass == null) {
+        throw new AnalysisException(
+            "Cannot build a scope for an unresolved class");
+      }
+      scope = new ClassScope(
+          new TypeParameterScope(scope, _enclosingClass),
+          _enclosingClass);
+    } else if (node is ClassTypeAlias) {
+      ClassElement element = node.element;
+      if (element == null) {
+        throw new AnalysisException(
+            "Cannot build a scope for an unresolved class type alias");
+      }
+      scope = new ClassScope(new TypeParameterScope(scope, element), element);
+    } else if (node is ConstructorDeclaration) {
+      ConstructorElement element = node.element;
+      if (element == null) {
+        throw new AnalysisException(
+            "Cannot build a scope for an unresolved constructor");
+      }
+      FunctionScope functionScope = new FunctionScope(scope, element);
+      functionScope.defineParameters();
+      scope = functionScope;
+    } else if (node is FunctionDeclaration) {
+      ExecutableElement element = node.element;
+      if (element == null) {
+        throw new AnalysisException(
+            "Cannot build a scope for an unresolved function");
+      }
+      FunctionScope functionScope = new FunctionScope(scope, element);
+      functionScope.defineParameters();
+      scope = functionScope;
+    } else if (node is FunctionTypeAlias) {
+      scope = new FunctionTypeScope(scope, node.element);
+    } else if (node is MethodDeclaration) {
+      ExecutableElement element = node.element;
+      if (element == null) {
+        throw new AnalysisException(
+            "Cannot build a scope for an unresolved method");
+      }
+      FunctionScope functionScope = new FunctionScope(scope, element);
+      functionScope.defineParameters();
+      scope = functionScope;
+    }
+    return scope;
+  }
+
+  Scope _scopeForCompilationUnit(CompilationUnit node) {
+    CompilationUnitElement unitElement = node.element;
+    if (unitElement == null) {
+      throw new AnalysisException(
+          "Cannot create scope: compilation unit is not resolved");
+    }
+    LibraryElement libraryElement = unitElement.library;
+    if (libraryElement == null) {
+      throw new AnalysisException(
+          "Cannot create scope: compilation unit is not part of a library");
+    }
+    return new LibraryScope(libraryElement, _errorListener);
+  }
+
+  /**
+   * Return the context in which the given AST structure should be resolved.
+   *
+   * [node] - the root of the AST structure to be resolved.
+   * [errorListener] - the listener to which analysis errors will be reported.
+   *
+   * Throws [AnalysisException] if the AST structure has not been resolved or
+   * is not part of a [CompilationUnit]
+   */
+  static ResolutionContext contextFor(AstNode node,
+      AnalysisErrorListener errorListener) {
+    if (node == null) {
+      throw new AnalysisException("Cannot create context: node is null");
+    }
+    // build scope
+    ResolutionContextBuilder builder =
+        new ResolutionContextBuilder(errorListener);
+    Scope scope = builder._scopeFor(node);
+    // prepare context
+    ResolutionContext context = new ResolutionContext();
+    context.scope = scope;
+    context.enclosingClassDeclaration = builder._enclosingClassDeclaration;
+    context.enclosingClass = builder._enclosingClass;
+    return context;
+  }
+}
+
+
+/**
+ * Instances of the class [_DeclarationMismatchException] represent an exception
+ * that is thrown when the element model defined by a given AST structure does
+ * not match an existing element model.
+ */
+class _DeclarationMismatchException {
+}
+
+
+class _ElementNameOffsetUpdater extends GeneralizingElementVisitor {
+  final int updateOffset;
+  final int updateDelta;
+
+  _ElementNameOffsetUpdater(this.updateOffset, this.updateDelta);
+
+  @override
+  visitElement(Element element) {
+    int nameOffset = element.nameOffset;
+    if (nameOffset > updateOffset) {
+      (element as ElementImpl).nameOffset = nameOffset + updateDelta;
+    }
+    super.visitElement(element);
+  }
+}
+
+
+class _ElementsGatherer extends GeneralizingElementVisitor {
+  final DeclarationMatcher matcher;
+
+  _ElementsGatherer(this.matcher);
+
+  void addElements(List<Element> elements) {
+    for (Element element in elements) {
+      if (!element.isSynthetic) {
+        _addElement(element);
+      }
+    }
+  }
+
+  @override
+  visitElement(Element element) {
+    _addElement(element);
+    super.visitElement(element);
+  }
+
+  @override
+  visitExecutableElement(ExecutableElement element) {
+    _addElement(element);
+  }
+
+  @override
+  visitParameterElement(ParameterElement element) {
+  }
+
+  @override
+  visitPropertyAccessorElement(PropertyAccessorElement element) {
+    if (!element.isSynthetic) {
+      _addElement(element);
+    }
+    // Don't visit children (such as synthetic setter parameters).
+  }
+
+  @override
+  visitPropertyInducingElement(PropertyInducingElement element) {
+    if (!element.isSynthetic) {
+      _addElement(element);
+    }
+    // Don't visit children (such as property accessors).
+  }
+
+  @override
+  visitTypeParameterElement(TypeParameterElement element) {
+  }
+
+  void _addElement(Element element) {
+    if (element != null) {
+      matcher._allElements.add(element);
+      matcher._unmatchedElements.add(element);
+    }
+  }
+}
+
+
+/**
+ * [ElementBuilder] not just builds elements, it also applies them to nodes.
+ * But we want to keep externally visible (and referenced) elements instances.
+ * So, we need to remember them and restore.
+ */
+class _ElementsRestorer extends RecursiveAstVisitor {
+  final Map<AstNode, Element> _elements = <AstNode, Element>{};
+
+  _ElementsRestorer(AstNode root) {
+    root.accept(this);
+  }
+
+  void restore() {
+    _elements.forEach((AstNode node, Element element) {
+      if (node is ConstructorDeclaration) {
+        node.element = element;
+      } else if (node is FunctionExpression) {
+        node.element = element;
+      } else if (node is SimpleIdentifier) {
+        node.staticElement = element;
+      }
+    });
+  }
+
+  @override
+  visitBlockFunctionBody(BlockFunctionBody node) {
+  }
+
+  @override
+  visitConstructorDeclaration(ConstructorDeclaration node) {
+    _elements[node] = node.element;
+    super.visitConstructorDeclaration(node);
+  }
+
+  @override
+  visitExpressionFunctionBody(ExpressionFunctionBody node) {
+  }
+
+  @override
+  visitFunctionExpression(FunctionExpression node) {
+    _elements[node] = node.element;
+    super.visitFunctionExpression(node);
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    _elements[node] = node.staticElement;
+  }
+}
+
+
+class _TokenPair {
+  final Token oldToken;
+  final Token newToken;
+  _TokenPair(this.oldToken, this.newToken);
+}
diff --git a/pkg/analyzer/lib/src/generated/incremental_scanner.dart b/pkg/analyzer/lib/src/generated/incremental_scanner.dart
new file mode 100644
index 0000000..ac91b96
--- /dev/null
+++ b/pkg/analyzer/lib/src/generated/incremental_scanner.dart
@@ -0,0 +1,244 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library engine.incremental_scanner;
+
+import "dart:math" as math;
+
+import 'error.dart';
+import 'scanner.dart';
+import 'source.dart';
+import 'utilities_collection.dart' show TokenMap;
+
+/**
+ * An `IncrementalScanner` is a scanner that scans a subset of a string and
+ * inserts the resulting tokens into the middle of an existing token stream.
+ */
+class IncrementalScanner {
+  /**
+   * The source being scanned.
+   */
+  final Source source;
+
+  /**
+   * The reader used to access the characters in the source.
+   */
+  final CharacterReader reader;
+
+  /**
+   * The error listener that will be informed of any errors that are found
+   * during the scan.
+   *
+   * TODO(brianwilkerson) Replace this with a list of errors so that we can
+   * update the errors.
+   */
+  final AnalysisErrorListener errorListener;
+
+  /**
+   * A map from tokens that were copied to the copies of the tokens.
+   */
+  TokenMap _tokenMap = new TokenMap();
+
+  /**
+   * The token immediately to the left of the range of tokens that were
+   * modified.
+   */
+  Token leftToken;
+
+  /**
+   * The token immediately to the right of the range of tokens that were
+   * modified.
+   */
+  Token rightToken;
+
+  /**
+   * A flag indicating whether there were any non-comment tokens changed (other
+   * than having their position updated) as a result of the modification.
+   */
+  bool hasNonWhitespaceChange = false;
+
+  /**
+   * Initialize a newly created scanner to scan characters within the given
+   * [source]. The content of the source can be read using the given [reader].
+   * Any errors that are found will be reported to the given [errorListener].
+   */
+  IncrementalScanner(this.source, this.reader, this.errorListener);
+
+  /**
+   * Return a map from tokens that were copied to the copies of the tokens.
+   *
+   * @return a map from tokens that were copied to the copies of the tokens
+   */
+  TokenMap get tokenMap => _tokenMap;
+
+  /**
+   * Given the [stream] of tokens scanned from the original source, the modified
+   * source (the result of replacing one contiguous range of characters with
+   * another string of characters), and a specification of the modification that
+   * was made, update the token stream to reflect the modified source. Return
+   * the first token in the updated token stream.
+   *
+   * The [stream] is expected to be the first non-EOF token in the token stream.
+   *
+   * The modification is specified by the [index] of the first character in both
+   * the original and modified source that was affected by the modification, the
+   * number of characters removed from the original source (the [removedLength])
+   * and the number of characters added to the modified source (the
+   * [insertedLength]).
+   */
+  Token rescan(Token stream, int index, int removedLength, int insertedLength) {
+    Token leftEof = stream.previous;
+    //
+    // Compute the delta between the character index of characters after the
+    // modified region in the original source and the index of the corresponding
+    // character in the modified source.
+    //
+    int delta = insertedLength - removedLength;
+    //
+    // Skip past the tokens whose end is less than the replacement start. (If
+    // the replacement start is equal to the end of an existing token, then it
+    // means that the existing token might have been modified, so we need to
+    // rescan it.)
+    //
+    while (stream.type != TokenType.EOF && stream.end < index) {
+      _tokenMap.put(stream, stream);
+      stream = stream.next;
+    }
+    Token oldFirst = stream;
+    Token oldLeftToken = stream.previous;
+    leftToken = oldLeftToken;
+    //
+    // Skip past tokens until we find a token whose offset is greater than the
+    // end of the removed region. (If the end of the removed region is equal to
+    // the beginning of an existing token, then it means that the existing token
+    // might have been modified, so we need to rescan it.)
+    //
+    int removedEnd = index + (removedLength == 0 ? 0 : removedLength - 1);
+    while (stream.type != TokenType.EOF && stream.offset <= removedEnd) {
+      stream = stream.next;
+    }
+    //
+    // Figure out which region of characters actually needs to be re-scanned.
+    //
+    Token oldLast;
+    Token oldRightToken;
+    if (stream.type != TokenType.EOF && removedEnd + 1 == stream.offset) {
+      oldLast = stream;
+      stream = stream.next;
+      oldRightToken = stream;
+    } else {
+      oldLast = stream.previous;
+      oldRightToken = stream;
+    }
+    //
+    // Compute the range of characters that are known to need to be rescanned.
+    // If the index is within an existing token, then we need to start at the
+    // beginning of the token.
+    //
+    int scanStart = math.max(oldLeftToken.end, 0);
+    int scanEnd = oldRightToken.offset + delta;
+    //
+    // Rescan the characters that need to be rescanned.
+    //
+    Token replacementStart = _scanRange(scanStart, scanEnd);
+    oldLeftToken.setNext(replacementStart);
+    Token replacementEnd = _findEof(replacementStart).previous;
+    replacementEnd.setNext(stream);
+    //
+    // Apply the delta to the tokens after the last new token.
+    //
+    _updateOffsets(stream, delta);
+    rightToken = stream;
+    //
+    // If the index is immediately after an existing token and the inserted
+    // characters did not change that original token, then adjust the leftToken
+    // to be the next token. For example, in "a; c;" --> "a;b c;", the leftToken
+    // was ";", but this code advances it to "b" since "b" is the first new
+    // token.
+    //
+    Token newFirst = leftToken.next;
+    while (!identical(newFirst, rightToken) &&
+        !identical(oldFirst, oldRightToken) &&
+        newFirst.type != TokenType.EOF &&
+        _equalTokens(oldFirst, newFirst)) {
+      _tokenMap.put(oldFirst, newFirst);
+      oldLeftToken = oldFirst;
+      oldFirst = oldFirst.next;
+      leftToken = newFirst;
+      newFirst = newFirst.next;
+    }
+    Token newLast = rightToken.previous;
+    while (!identical(newLast, leftToken) &&
+        !identical(oldLast, oldLeftToken) &&
+        newLast.type != TokenType.EOF &&
+        _equalTokens(oldLast, newLast)) {
+      _tokenMap.put(oldLast, newLast);
+      oldRightToken = oldLast;
+      oldLast = oldLast.previous;
+      rightToken = newLast;
+      newLast = newLast.previous;
+    }
+    hasNonWhitespaceChange = !identical(leftToken.next, rightToken) ||
+        !identical(oldLeftToken.next, oldRightToken);
+    //
+    // TODO(brianwilkerson) Begin tokens are not getting associated with the
+    // corresponding end tokens (because the end tokens have not been copied
+    // when we're copying the begin tokens). This could have implications for
+    // parsing.
+    // TODO(brianwilkerson) Update the lineInfo.
+    //
+    return leftEof.next;
+  }
+
+  /**
+   * Return `true` if the [oldToken] and the [newToken] are equal to each other.
+   * For the purposes of the incremental scanner, two tokens are equal if they
+   * have the same type and lexeme.
+   */
+  bool _equalTokens(Token oldToken, Token newToken) =>
+      oldToken.type == newToken.type &&
+          oldToken.length == newToken.length &&
+          oldToken.lexeme == newToken.lexeme;
+
+  /**
+   * Given a [token], return the EOF token that follows the token.
+   */
+  Token _findEof(Token token) {
+    while (token.type != TokenType.EOF) {
+      token = token.next;
+    }
+    return token;
+  }
+
+  /**
+   * Scan the token between the [start] (inclusive) and [end] (exclusive)
+   * offsets.
+   */
+  Token _scanRange(int start, int end) {
+    Scanner scanner = new Scanner(
+        source,
+        new CharacterRangeReader(reader, start, end),
+        errorListener);
+    return scanner.tokenize();
+  }
+
+  /**
+   * Update the offsets of every token from the given [token] to the end of the
+   * stream by adding the given [delta].
+   */
+  void _updateOffsets(Token token, int delta) {
+    while (token.type != TokenType.EOF) {
+      _tokenMap.put(token, token);
+      token.offset += delta;
+      Token comment = token.precedingComments;
+      while (comment != null) {
+        comment.offset += delta;
+        comment = comment.next;
+      }
+      token = token.next;
+    }
+    _tokenMap.put(token, token);
+    token.offset += delta;
+  }
+}
diff --git a/pkg/analyzer/lib/src/generated/instrumentation.dart b/pkg/analyzer/lib/src/generated/instrumentation.dart
index 918c0ff..54e4789 100644
--- a/pkg/analyzer/lib/src/generated/instrumentation.dart
+++ b/pkg/analyzer/lib/src/generated/instrumentation.dart
@@ -42,13 +42,15 @@
   /**
    * A builder that will silently ignore all data and logging requests.
    */
-  static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new InstrumentationBuilder_Instrumentation_NULL_INSTRUMENTATION_BUILDER();
+  static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER =
+      new InstrumentationBuilder_Instrumentation_NULL_INSTRUMENTATION_BUILDER();
 
   /**
    * An instrumentation logger that can be used when no other instrumentation logger has been
    * configured. This logger will silently ignore all data and logging requests.
    */
-  static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_Instrumentation_NULL_LOGGER();
+  static InstrumentationLogger _NULL_LOGGER =
+      new InstrumentationLogger_Instrumentation_NULL_LOGGER();
 
   /**
    * The current instrumentation logger.
@@ -56,34 +58,6 @@
   static InstrumentationLogger _CURRENT_LOGGER = _NULL_LOGGER;
 
   /**
-   * Create a builder that can collect the data associated with an operation.
-   *
-   * @param clazz the class performing the operation (not `null`)
-   * @return the builder that was created (not `null`)
-   */
-  static InstrumentationBuilder builder(Type clazz) => _CURRENT_LOGGER.createBuilder(clazz.toString());
-
-  /**
-   * Create a builder that can collect the data associated with an operation.
-   *
-   * @param name the name used to uniquely identify the operation (not `null`)
-   * @return the builder that was created (not `null`)
-   */
-  static InstrumentationBuilder builder2(String name) => _CURRENT_LOGGER.createBuilder(name);
-
-  /**
-   * Get the currently active instrumentation logger
-   */
-  static InstrumentationLogger get logger => _CURRENT_LOGGER;
-
-  /**
-   * Return a builder that will silently ignore all data and logging requests.
-   *
-   * @return the builder (not `null`)
-   */
-  static InstrumentationBuilder get nullBuilder => _NULL_INSTRUMENTATION_BUILDER;
-
-  /**
    * Is this instrumentation system currently configured to drop instrumentation data provided to
    * it?
    *
@@ -92,6 +66,11 @@
   static bool get isNullLogger => identical(_CURRENT_LOGGER, _NULL_LOGGER);
 
   /**
+   * Get the currently active instrumentation logger
+   */
+  static InstrumentationLogger get logger => _CURRENT_LOGGER;
+
+  /**
    * Set the logger that should receive instrumentation information to the given logger.
    *
    * @param logger the logger that should receive instrumentation information
@@ -99,6 +78,32 @@
   static void set logger(InstrumentationLogger logger) {
     _CURRENT_LOGGER = logger == null ? _NULL_LOGGER : logger;
   }
+
+  /**
+   * Return a builder that will silently ignore all data and logging requests.
+   *
+   * @return the builder (not `null`)
+   */
+  static InstrumentationBuilder get nullBuilder =>
+      _NULL_INSTRUMENTATION_BUILDER;
+
+  /**
+   * Create a builder that can collect the data associated with an operation.
+   *
+   * @param clazz the class performing the operation (not `null`)
+   * @return the builder that was created (not `null`)
+   */
+  static InstrumentationBuilder builder(Type clazz) =>
+      _CURRENT_LOGGER.createBuilder(clazz.toString());
+
+  /**
+   * Create a builder that can collect the data associated with an operation.
+   *
+   * @param name the name used to uniquely identify the operation (not `null`)
+   * @return the builder that was created (not `null`)
+   */
+  static InstrumentationBuilder builder2(String name) =>
+      _CURRENT_LOGGER.createBuilder(name);
 }
 
 /**
@@ -109,6 +114,14 @@
  */
 abstract class InstrumentationBuilder {
   /**
+   * Answer the [InstrumentationLevel] of this `InstrumentationBuilder`.
+   *
+   * @return one of [InstrumentationLevel.EVERYTHING], [InstrumentationLevel.METRICS],
+   *         [InstrumentationLevel.OFF]
+   */
+  InstrumentationLevel get instrumentationLevel;
+
+  /**
    * Append the given data to the data being collected by this builder. The information is declared
    * to potentially contain data that is either user identifiable or contains user intellectual
    * property (but is not guaranteed to contain either).
@@ -153,14 +166,6 @@
   InstrumentationBuilder data4(String name, List<String> value);
 
   /**
-   * Answer the [InstrumentationLevel] of this `InstrumentationBuilder`.
-   *
-   * @return one of [InstrumentationLevel.EVERYTHING], [InstrumentationLevel.METRICS],
-   *         [InstrumentationLevel.OFF]
-   */
-  InstrumentationLevel get instrumentationLevel;
-
-  /**
    * Log the data that has been collected. The instrumentation builder should not be used after this
    * method is invoked. The behavior of any method defined on this interface that is used after this
    * method is invoked is undefined.
@@ -232,7 +237,11 @@
   InstrumentationBuilder record(Exception exception);
 }
 
-class InstrumentationBuilder_Instrumentation_NULL_INSTRUMENTATION_BUILDER implements InstrumentationBuilder {
+class InstrumentationBuilder_Instrumentation_NULL_INSTRUMENTATION_BUILDER
+    implements InstrumentationBuilder {
+  @override
+  InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF;
+
   @override
   InstrumentationBuilder data(String name, bool value) => this;
 
@@ -246,9 +255,6 @@
   InstrumentationBuilder data4(String name, List<String> value) => this;
 
   @override
-  InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF;
-
-  @override
   void log() {
   }
 
@@ -279,15 +285,22 @@
  */
 class InstrumentationLevel extends Enum<InstrumentationLevel> {
   /** Recording all instrumented information */
-  static const InstrumentationLevel EVERYTHING = const InstrumentationLevel('EVERYTHING', 0);
+  static const InstrumentationLevel EVERYTHING =
+      const InstrumentationLevel('EVERYTHING', 0);
 
   /** Recording only metrics */
-  static const InstrumentationLevel METRICS = const InstrumentationLevel('METRICS', 1);
+  static const InstrumentationLevel METRICS =
+      const InstrumentationLevel('METRICS', 1);
 
   /** Nothing recorded */
   static const InstrumentationLevel OFF = const InstrumentationLevel('OFF', 2);
 
-  static const List<InstrumentationLevel> values = const [EVERYTHING, METRICS, OFF];
+  static const List<InstrumentationLevel> values = const [
+      EVERYTHING,
+      METRICS,
+      OFF];
+
+  const InstrumentationLevel(String name, int ordinal) : super(name, ordinal);
 
   static InstrumentationLevel fromString(String str) {
     if (str == "EVERYTHING") {
@@ -301,8 +314,6 @@
     }
     throw new IllegalArgumentException("Unrecognised InstrumentationLevel");
   }
-
-  const InstrumentationLevel(String name, int ordinal) : super(name, ordinal);
 }
 
 /**
@@ -322,7 +333,9 @@
   InstrumentationBuilder createBuilder(String name);
 }
 
-class InstrumentationLogger_Instrumentation_NULL_LOGGER implements InstrumentationLogger {
+class InstrumentationLogger_Instrumentation_NULL_LOGGER implements
+    InstrumentationLogger {
   @override
-  InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INSTRUMENTATION_BUILDER;
-}
\ No newline at end of file
+  InstrumentationBuilder createBuilder(String name) =>
+      Instrumentation._NULL_INSTRUMENTATION_BUILDER;
+}
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index 9c86f23..a06e984 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -1,135 +1,81 @@
 library java.core;
 
-final Stopwatch nanoTimeStopwatch = new Stopwatch();
-
 const int LONG_MAX_VALUE = 0x7fffffffffffffff;
 
-class JavaSystem {
-  static int currentTimeMillis() {
-    return (new DateTime.now()).millisecondsSinceEpoch;
-  }
+final Stopwatch nanoTimeStopwatch = new Stopwatch();
 
-  static int nanoTime() {
-    if (!nanoTimeStopwatch.isRunning) {
-      nanoTimeStopwatch.start();
-    }
-    return nanoTimeStopwatch.elapsedMicroseconds * 1000;
-  }
-
-  static void arraycopy(List src, int srcPos, List dest, int destPos, int length) {
-    for (int i = 0; i < length; i++) {
-      dest[destPos + i] = src[srcPos + i];
-    }
-  }
+/**
+ * Inserts the given arguments into [pattern].
+ *
+ *     format('Hello, {0}!', 'John') = 'Hello, John!'
+ *     format('{0} are you {1}ing?', 'How', 'do') = 'How are you doing?'
+ *     format('{0} are you {1}ing?', 'What', 'read') = 'What are you reading?'
+ */
+String format(String pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7])
+    {
+  return formatList(pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]);
 }
 
-class JavaArrays {
-  static bool equals(List a, List b) {
-    if (identical(a, b)) {
-      return true;
-    }
-    if (a.length != b.length) {
-      return false;
-    }
-    var len = a.length;
-    for (int i = 0; i < len; i++) {
-      if (a[i] != b[i]) {
-        return false;
-      }
-    }
-    return true;
+/**
+ * Inserts the given [args] into [pattern].
+ *
+ *     format('Hello, {0}!', ['John']) = 'Hello, John!'
+ *     format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?'
+ *     format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?'
+ */
+String formatList(String pattern, List<Object> arguments) {
+  if (arguments == null || arguments.isEmpty) {
+    return pattern;
   }
-  static int makeHashCode(List a) {
-    if (a == null) {
-      return 0;
-    }
-    int result = 1;
-    for (var element in a) {
-      result = 31 * result + (element == null ? 0 : element.hashCode);
-    }
-    return result;
-  }
+  return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
+    String indexStr = match.group(1);
+    int index = int.parse(indexStr);
+    Object arg = arguments[index];
+    return arg != null ? arg.toString() : null;
+  });
 }
 
-class Character {
-  static const int MAX_VALUE = 0xffff;
-  static const int MAX_CODE_POINT = 0x10ffff;
-  static const int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
-  static const int MIN_LOW_SURROGATE  = 0xDC00;
-  static const int MIN_HIGH_SURROGATE = 0xD800;
-  static bool isDigit(int c) {
-    return c >= 0x30 && c <= 0x39;
-  }
-  static bool isLetter(int c) {
-    return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A;
-  }
-  static bool isLetterOrDigit(int c) {
-    return isLetter(c) || isDigit(c);
-  }
-  static bool isLowerCase(int c) {
-    return c >= 0x61 && c <= 0x7A;
-  }
-  static bool isUpperCase(int c) {
-    return c >= 0x41 && c <= 0x5A;
-  }
-  static int toLowerCase(int c) {
-    if (c >= 0x41 && c <= 0x5A) {
-      return 0x61 + (c - 0x41);
-    }
-    return c;
-  }
-  static int toUpperCase(int c) {
-    if (c >= 0x61 && c <= 0x7A) {
-      return 0x41 + (c - 0x61);
-    }
-    return c;
-  }
-  static bool isWhitespace(int c) {
-    return c == 0x09 || c == 0x20 || c == 0x0A || c == 0x0D;
-  }
-  static int digit(int codePoint, int radix) {
-    if (radix != 16) {
-      throw new ArgumentError("only radix == 16 is supported");
-    }
-    if (0x30 <= codePoint && codePoint <= 0x39) {
-      return codePoint - 0x30;
-    }
-    if (0x41 <= codePoint && codePoint <= 0x46) {
-      return 0xA + (codePoint - 0x41);
-    }
-    if (0x61 <= codePoint && codePoint <= 0x66) {
-      return 0xA + (codePoint - 0x61);
-    }
-    return -1;
-  }
-  static String toChars(int codePoint) {
-    if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
-      throw new IllegalArgumentException();
-    }
-    if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
-      return new String.fromCharCode(codePoint);
-    }
-    int offset = codePoint - MIN_SUPPLEMENTARY_CODE_POINT;
-    int c0 = ((offset & 0x7FFFFFFF) >> 10) + MIN_HIGH_SURROGATE;
-    int c1 = (offset & 0x3ff) + MIN_LOW_SURROGATE;
-    return new String.fromCharCodes([c0, c1]);
-  }
+bool javaCollectionContainsAll(Iterable list, Iterable c) {
+  return c.fold(true, (bool prev, e) => prev && list.contains(e));
 }
 
-class JavaString {
-  static int indexOf(String target, String str, int fromIndex) {
-    if (fromIndex > target.length) return -1;
-    if (fromIndex < 0) fromIndex = 0;
-    return target.indexOf(str, fromIndex);
+javaListSet(List list, int index, newValue) {
+  var oldValue = list[index];
+  list[index] = newValue;
+  return oldValue;
+}
+
+bool javaSetEquals(Set a, Set b) {
+  return a.containsAll(b) && b.containsAll(a);
+}
+
+bool javaStringEqualsIgnoreCase(String a, String b) {
+  return a.toLowerCase() == b.toLowerCase();
+}
+
+bool javaStringRegionMatches(String t, int toffset, String o, int ooffset,
+    int len) {
+  if (toffset < 0) return false;
+  if (ooffset < 0) return false;
+  var tend = toffset + len;
+  var oend = ooffset + len;
+  if (tend > t.length) return false;
+  if (oend > o.length) return false;
+  return t.substring(toffset, tend) == o.substring(ooffset, oend);
+}
+
+/// Parses given string to [Uri], throws [URISyntaxException] if invalid.
+Uri parseUriWithException(String str) {
+  Uri uri;
+  try {
+    uri = Uri.parse(str);
+  } on FormatException catch (e) {
+    throw new URISyntaxException(e.toString());
   }
-  static int lastIndexOf(String target, String str, int fromIndex) {
-    if (fromIndex > target.length) return -1;
-    if (fromIndex < 0) fromIndex = 0;
-    return target.lastIndexOf(str, fromIndex);
+  if (uri.path.isEmpty) {
+    throw new URISyntaxException('empty path');
   }
-  static bool startsWithBefore(String s, String other, int start) {
-    return s.indexOf(other, start) != -1;
-  }
+  return uri;
 }
 
 /**
@@ -163,7 +109,8 @@
         continue;
       }
       // unknown
-      throw new IllegalArgumentException('[$fmt][$i] = 0x${c.toRadixString(16)}');
+      throw new IllegalArgumentException(
+          '[$fmt][$i] = 0x${c.toRadixString(16)}');
     } else {
       sb.writeCharCode(c);
     }
@@ -171,23 +118,206 @@
   return sb.toString();
 }
 
-abstract class PrintWriter {
-  void print(x);
+class Character {
+  static const int MAX_VALUE = 0xffff;
+  static const int MAX_CODE_POINT = 0x10ffff;
+  static const int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000;
+  static const int MIN_LOW_SURROGATE = 0xDC00;
+  static const int MIN_HIGH_SURROGATE = 0xD800;
+  static int digit(int codePoint, int radix) {
+    if (radix != 16) {
+      throw new ArgumentError("only radix == 16 is supported");
+    }
+    if (0x30 <= codePoint && codePoint <= 0x39) {
+      return codePoint - 0x30;
+    }
+    if (0x41 <= codePoint && codePoint <= 0x46) {
+      return 0xA + (codePoint - 0x41);
+    }
+    if (0x61 <= codePoint && codePoint <= 0x66) {
+      return 0xA + (codePoint - 0x61);
+    }
+    return -1;
+  }
+  static bool isDigit(int c) {
+    return c >= 0x30 && c <= 0x39;
+  }
+  static bool isLetter(int c) {
+    return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A;
+  }
+  static bool isLetterOrDigit(int c) {
+    return isLetter(c) || isDigit(c);
+  }
+  static bool isLowerCase(int c) {
+    return c >= 0x61 && c <= 0x7A;
+  }
+  static bool isUpperCase(int c) {
+    return c >= 0x41 && c <= 0x5A;
+  }
+  static bool isWhitespace(int c) {
+    return c == 0x09 || c == 0x20 || c == 0x0A || c == 0x0D;
+  }
+  static String toChars(int codePoint) {
+    if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
+      throw new IllegalArgumentException();
+    }
+    if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
+      return new String.fromCharCode(codePoint);
+    }
+    int offset = codePoint - MIN_SUPPLEMENTARY_CODE_POINT;
+    int c0 = ((offset & 0x7FFFFFFF) >> 10) + MIN_HIGH_SURROGATE;
+    int c1 = (offset & 0x3ff) + MIN_LOW_SURROGATE;
+    return new String.fromCharCodes([c0, c1]);
+  }
+  static int toLowerCase(int c) {
+    if (c >= 0x41 && c <= 0x5A) {
+      return 0x61 + (c - 0x41);
+    }
+    return c;
+  }
+  static int toUpperCase(int c) {
+    if (c >= 0x61 && c <= 0x7A) {
+      return 0x41 + (c - 0x61);
+    }
+    return c;
+  }
+}
 
-  void newLine() {
-    this.print('\n');
+abstract class Enum<E extends Enum> implements Comparable<E> {
+  /// The name of this enum constant, as declared in the enum declaration.
+  final String name;
+  /// The position in the enum declaration.
+  final int ordinal;
+  const Enum(this.name, this.ordinal);
+  int get hashCode => ordinal;
+  int compareTo(E other) => ordinal - other.ordinal;
+  String toString() => name;
+}
+
+class IllegalArgumentException extends JavaException {
+  IllegalArgumentException([message = "", cause = null])
+      : super(message, cause);
+}
+
+class IllegalStateException extends JavaException {
+  IllegalStateException([message = ""]) : super(message);
+}
+
+class JavaArrays {
+  static bool equals(List a, List b) {
+    if (identical(a, b)) {
+      return true;
+    }
+    if (a.length != b.length) {
+      return false;
+    }
+    var len = a.length;
+    for (int i = 0; i < len; i++) {
+      if (a[i] != b[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+  static int makeHashCode(List a) {
+    if (a == null) {
+      return 0;
+    }
+    int result = 1;
+    for (var element in a) {
+      result = 31 * result + (element == null ? 0 : element.hashCode);
+    }
+    return result;
+  }
+}
+
+class JavaException implements Exception {
+  final String message;
+  final Exception cause;
+  JavaException([this.message = "", this.cause = null]);
+  JavaException.withCause(this.cause) : message = null;
+  String toString() => "$runtimeType: $message $cause";
+}
+
+class JavaIOException extends JavaException {
+  JavaIOException([message = "", cause = null]) : super(message, cause);
+}
+
+class JavaPatternMatcher {
+  Iterator<Match> _matches;
+  Match _match;
+  JavaPatternMatcher(RegExp re, String input) {
+    _matches = re.allMatches(input).iterator;
+  }
+  int end() => _match.end;
+  bool find() {
+    if (!_matches.moveNext()) {
+      return false;
+    }
+    _match = _matches.current;
+    return true;
+  }
+  String group(int i) => _match[i];
+  bool matches() => find();
+  int start() => _match.start;
+}
+
+class JavaString {
+  static int indexOf(String target, String str, int fromIndex) {
+    if (fromIndex > target.length) return -1;
+    if (fromIndex < 0) fromIndex = 0;
+    return target.indexOf(str, fromIndex);
+  }
+  static int lastIndexOf(String target, String str, int fromIndex) {
+    if (fromIndex > target.length) return -1;
+    if (fromIndex < 0) fromIndex = 0;
+    return target.lastIndexOf(str, fromIndex);
+  }
+  static bool startsWithBefore(String s, String other, int start) {
+    return s.indexOf(other, start) != -1;
+  }
+}
+
+class JavaSystem {
+  static void arraycopy(List src, int srcPos, List dest, int destPos,
+      int length) {
+    for (int i = 0; i < length; i++) {
+      dest[destPos + i] = src[srcPos + i];
+    }
   }
 
-  void println(String s) {
-    this.print(s);
-    this.newLine();
+  static int currentTimeMillis() {
+    return (new DateTime.now()).millisecondsSinceEpoch;
   }
 
-  void printf(String fmt, List args) {
-    this.print(_printf(fmt, args));
+  static int nanoTime() {
+    if (!nanoTimeStopwatch.isRunning) {
+      nanoTimeStopwatch.start();
+    }
+    return nanoTimeStopwatch.elapsedMicroseconds * 1000;
   }
 }
 
+class MissingFormatArgumentException implements Exception {
+  final String s;
+
+  MissingFormatArgumentException(this.s);
+
+  String toString() => "MissingFormatArgumentException: $s";
+}
+
+class NoSuchElementException extends JavaException {
+  String toString() => "NoSuchElementException";
+}
+
+class NotImplementedException extends JavaException {
+  NotImplementedException(message) : super(message);
+}
+
+class NumberFormatException extends JavaException {
+  String toString() => "NumberFormatException";
+}
+
 class PrintStringWriter extends PrintWriter {
   final StringBuffer _sb = new StringBuffer();
 
@@ -198,6 +328,32 @@
   String toString() => _sb.toString();
 }
 
+abstract class PrintWriter {
+  void newLine() {
+    this.print('\n');
+  }
+
+  void print(x);
+
+  void printf(String fmt, List args) {
+    this.print(_printf(fmt, args));
+  }
+
+  void println(String s) {
+    this.print(s);
+    this.newLine();
+  }
+}
+
+class RuntimeException extends JavaException {
+  RuntimeException({String message: "", Exception cause: null})
+      : super(message, cause);
+}
+
+class StringIndexOutOfBoundsException extends JavaException {
+  StringIndexOutOfBoundsException(int index) : super('$index');
+}
+
 class StringUtils {
   static String capitalize(String str) {
     if (isEmpty(str)) {
@@ -220,8 +376,8 @@
     return str == null || str.isEmpty;
   }
 
-  static String join(Iterable iter, [String separator = ' ', int start = 0, int
-      end = -1]) {
+  static String join(Iterable iter, [String separator = ' ', int start = 0,
+      int end = -1]) {
     if (start != 0) {
       iter = iter.skip(start);
     }
@@ -264,170 +420,18 @@
     return s.split(pattern);
   }
 
-  static List<String> splitByWholeSeparatorPreserveAllTokens(String s, String
-      pattern) {
+  static List<String> splitByWholeSeparatorPreserveAllTokens(String s,
+      String pattern) {
     return s.split(pattern);
   }
 }
 
-class RuntimeException extends JavaException {
-  RuntimeException({String message: "", Exception cause: null}) :
-    super(message, cause);
-}
-
-class JavaException implements Exception {
-  final String message;
-  final Exception cause;
-  JavaException([this.message = "", this.cause = null]);
-  JavaException.withCause(this.cause) : message = null;
-  String toString() => "$runtimeType: $message $cause";
-}
-
-class JavaIOException extends JavaException {
-  JavaIOException([message = "", cause = null]) : super(message, cause);
-}
-
-class IllegalArgumentException extends JavaException {
-  IllegalArgumentException([message = "", cause = null]) : super(message, cause);
-}
-
-class StringIndexOutOfBoundsException extends JavaException {
-  StringIndexOutOfBoundsException(int index) : super('$index');
-}
-
-class IllegalStateException extends JavaException {
-  IllegalStateException([message = ""]) : super(message);
-}
-
-class NotImplementedException extends JavaException {
-  NotImplementedException(message) : super(message);
-}
-
 class UnsupportedOperationException extends JavaException {
   UnsupportedOperationException([message = ""]) : super(message);
 }
 
-class NoSuchElementException extends JavaException {
-  String toString() => "NoSuchElementException";
-}
-
-class NumberFormatException extends JavaException {
-  String toString() => "NumberFormatException";
-}
-
-/// Parses given string to [Uri], throws [URISyntaxException] if invalid.
-Uri parseUriWithException(String str) {
-  Uri uri;
-  try {
-    uri = Uri.parse(str);
-  } on FormatException catch (e) {
-    throw new URISyntaxException(e.toString());
-  }
-  if (uri.path.isEmpty) {
-    throw new URISyntaxException('empty path');
-  }
-  return uri;
-}
-
 class URISyntaxException implements Exception {
   final String message;
   URISyntaxException(this.message);
   String toString() => "URISyntaxException: $message";
 }
-
-class MissingFormatArgumentException implements Exception {
-  final String s;
-
-  String toString() => "MissingFormatArgumentException: $s";
-
-  MissingFormatArgumentException(this.s);
-}
-
-javaListSet(List list, int index, newValue) {
-  var oldValue = list[index];
-  list[index] = newValue;
-  return oldValue;
-}
-
-bool javaCollectionContainsAll(Iterable list, Iterable c) {
-  return c.fold(true, (bool prev, e) => prev && list.contains(e));
-}
-
-bool javaSetEquals(Set a, Set b) {
-  return a.containsAll(b) && b.containsAll(a);
-}
-
-bool javaStringEqualsIgnoreCase(String a, String b) {
-  return a.toLowerCase() == b.toLowerCase();
-}
-
-bool javaStringRegionMatches(String t, int toffset, String o, int ooffset, int len) {
-  if (toffset < 0) return false;
-  if (ooffset < 0) return false;
-  var tend = toffset + len;
-  var oend = ooffset + len;
-  if (tend > t.length) return false;
-  if (oend > o.length) return false;
-  return t.substring(toffset, tend) == o.substring(ooffset, oend);
-}
-
-abstract class Enum<E extends Enum> implements Comparable<E> {
-  /// The name of this enum constant, as declared in the enum declaration.
-  final String name;
-  /// The position in the enum declaration.
-  final int ordinal;
-  const Enum(this.name, this.ordinal);
-  int get hashCode => ordinal;
-  String toString() => name;
-  int compareTo(E other) => ordinal - other.ordinal;
-}
-
-class JavaPatternMatcher {
-  Iterator<Match> _matches;
-  Match _match;
-  JavaPatternMatcher(RegExp re, String input) {
-    _matches = re.allMatches(input).iterator;
-  }
-  bool matches() => find();
-  bool find() {
-    if (!_matches.moveNext()) {
-      return false;
-    }
-    _match = _matches.current;
-    return true;
-  }
-  String group(int i) => _match[i];
-  int start() => _match.start;
-  int end() => _match.end;
-}
-
-/**
- * Inserts the given arguments into [pattern].
- *
- *     format('Hello, {0}!', 'John') = 'Hello, John!'
- *     format('{0} are you {1}ing?', 'How', 'do') = 'How are you doing?'
- *     format('{0} are you {1}ing?', 'What', 'read') = 'What are you reading?'
- */
-String format(String pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7])
-    {
-  return formatList(pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]);
-}
-
-/**
- * Inserts the given [args] into [pattern].
- *
- *     format('Hello, {0}!', ['John']) = 'Hello, John!'
- *     format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?'
- *     format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?'
- */
-String formatList(String pattern, List<Object> arguments) {
-  if (arguments == null || arguments.isEmpty) {
-    return pattern;
-  }
-  return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
-    String indexStr = match.group(1);
-    int index = int.parse(indexStr);
-    Object arg = arguments[index];
-    return arg != null ? arg.toString() : null;
-  });
-}
diff --git a/pkg/analyzer/lib/src/generated/java_engine.dart b/pkg/analyzer/lib/src/generated/java_engine.dart
index 0f787cb..cd3f6bf 100644
--- a/pkg/analyzer/lib/src/generated/java_engine.dart
+++ b/pkg/analyzer/lib/src/generated/java_engine.dart
@@ -8,221 +8,6 @@
  */
 typedef bool Predicate<E>(E argument);
 
-class StringUtilities {
-  static const String EMPTY = '';
-  static const List<String> EMPTY_ARRAY = const <String>[];
-
-  static Interner INTERNER = new NullInterner();
-
-  static String intern(String string) => INTERNER.intern(string);
-  static bool isTagName(String s) {
-    if (s == null || s.length == 0) {
-      return false;
-    }
-    int sz = s.length;
-    for (int i = 0; i < sz; i++) {
-      int c = s.codeUnitAt(i);
-      if (!Character.isLetter(c)) {
-        if (i == 0) {
-          return false;
-        }
-        if (!Character.isDigit(c) && c != 0x2D) {
-          return false;
-        }
-      }
-    }
-    return true;
-  }
-  static bool isEmpty(String s) {
-    return s == null || s.isEmpty;
-  }
-  static String substringBefore(String str, String separator) {
-    if (str == null || str.isEmpty) {
-      return str;
-    }
-    if (separator == null) {
-      return str;
-    }
-    int pos = str.indexOf(separator);
-    if (pos < 0) {
-      return str;
-    }
-    return str.substring(0, pos);
-  }
-  static endsWithChar(String str, int c) {
-    int length = str.length;
-    return length > 0 && str.codeUnitAt(length - 1) == c;
-  }
-  static endsWith3(String str, int c1, int c2, int c3) {
-    var length = str.length;
-    return length >= 3 && str.codeUnitAt(length - 3) == c1 && str.codeUnitAt(
-        length - 2) == c2 && str.codeUnitAt(length - 1) == c3;
-  }
-
-  static startsWithChar(String str, int c) {
-    return str.length != 0 && str.codeUnitAt(0) == c;
-  }
-  static startsWith2(String str, int start, int c1, int c2) {
-    return str.length - start >= 2 && str.codeUnitAt(start) == c1 &&
-        str.codeUnitAt(start + 1) == c2;
-  }
-  static startsWith3(String str, int start, int c1, int c2, int c3) {
-    return str.length - start >= 3 && str.codeUnitAt(start) == c1 &&
-        str.codeUnitAt(start + 1) == c2 && str.codeUnitAt(start + 2) == c3;
-  }
-  static startsWith4(String str, int start, int c1, int c2, int c3, int c4) {
-    return str.length - start >= 4 && str.codeUnitAt(start) == c1 &&
-        str.codeUnitAt(start + 1) == c2 && str.codeUnitAt(start + 2) == c3 &&
-        str.codeUnitAt(start + 3) == c4;
-  }
-  static startsWith5(String str, int start, int c1, int c2, int c3, int c4, int
-      c5) {
-    return str.length - start >= 5 && str.codeUnitAt(start) == c1 &&
-        str.codeUnitAt(start + 1) == c2 && str.codeUnitAt(start + 2) == c3 &&
-        str.codeUnitAt(start + 3) == c4 && str.codeUnitAt(start + 4) == c5;
-  }
-  static startsWith6(String str, int start, int c1, int c2, int c3, int c4, int
-      c5, int c6) {
-    return str.length - start >= 6 && str.codeUnitAt(start) == c1 &&
-        str.codeUnitAt(start + 1) == c2 && str.codeUnitAt(start + 2) == c3 &&
-        str.codeUnitAt(start + 3) == c4 && str.codeUnitAt(start + 4) == c5 &&
-        str.codeUnitAt(start + 5) == c6;
-  }
-  static int indexOf1(String str, int start, int c) {
-    int index = start;
-    int last = str.length;
-    while (index < last) {
-      if (str.codeUnitAt(index) == c) {
-        return index;
-      }
-      index++;
-    }
-    return -1;
-  }
-  static int indexOf2(String str, int start, int c1, int c2) {
-    int index = start;
-    int last = str.length - 1;
-    while (index < last) {
-      if (str.codeUnitAt(index) == c1 && str.codeUnitAt(index + 1) == c2) {
-        return index;
-      }
-      index++;
-    }
-    return -1;
-  }
-  static int indexOf4(String string, int start, int c1, int c2, int c3, int c4)
-      {
-    int index = start;
-    int last = string.length - 3;
-    while (index < last) {
-      if (string.codeUnitAt(index) == c1 && string.codeUnitAt(index + 1) == c2
-          && string.codeUnitAt(index + 2) == c3 && string.codeUnitAt(index + 3) == c4) {
-        return index;
-      }
-      index++;
-    }
-    return -1;
-  }
-  static int indexOf5(String str, int start, int c1, int c2, int c3, int c4, int
-      c5) {
-    int index = start;
-    int last = str.length - 4;
-    while (index < last) {
-      if (str.codeUnitAt(index) == c1 && str.codeUnitAt(index + 1) == c2 &&
-          str.codeUnitAt(index + 2) == c3 && str.codeUnitAt(index + 3) == c4 &&
-          str.codeUnitAt(index + 4) == c5) {
-        return index;
-      }
-      index++;
-    }
-    return -1;
-  }
-  static String substringBeforeChar(String str, int c) {
-    if (isEmpty(str)) {
-      return str;
-    }
-    int pos = indexOf1(str, 0, c);
-    if (pos < 0) {
-      return str;
-    }
-    return str.substring(0, pos);
-  }
-
-  /**
-   * Return the index of the first not letter/digit character in the [string]
-   * that is at or after the [startIndex]. Return the length of the [string] if
-   * all characters to the end are letters/digits.
-   */
-  static int indexOfFirstNotLetterDigit(String string, int startIndex) {
-    int index = startIndex;
-    int last = string.length;
-    while (index < last) {
-      int c = string.codeUnitAt(index);
-      if (!Character.isLetterOrDigit(c)) {
-        return index;
-      }
-      index++;
-    }
-    return last;
-  }
-
-  /**
-   * Produce a string containing all of the names in the given array, surrounded by single quotes,
-   * and separated by commas. The list must contain at least two elements.
-   *
-   * @param names the names to be printed
-   * @return the result of printing the names
-   */
-  static String printListOfQuotedNames(List<String> names) {
-    if (names == null) {
-      throw new IllegalArgumentException("The list must not be null");
-    }
-    int count = names.length;
-    if (count < 2) {
-      throw new IllegalArgumentException("The list must contain at least two names");
-    }
-    StringBuffer buffer = new StringBuffer();
-    buffer.write("'");
-    buffer.write(names[0]);
-    buffer.write("'");
-    for (int i = 1; i < count - 1; i++) {
-      buffer.write(", '");
-      buffer.write(names[i]);
-      buffer.write("'");
-    }
-    buffer.write(" and '");
-    buffer.write(names[count - 1]);
-    buffer.write("'");
-    return buffer.toString();
-  }
-}
-
-class FileNameUtilities {
-  static String getExtension(String fileName) {
-    if (fileName == null) {
-      return "";
-    }
-    int index = fileName.lastIndexOf('.');
-    if (index >= 0) {
-      return fileName.substring(index + 1);
-    }
-    return "";
-  }
-}
-
-class ObjectUtilities {
-  static int combineHashCodes(int first, int second) => first * 31 + second;
-}
-
-class UUID {
-  static int __nextId = 0;
-  final String id;
-  UUID(this.id);
-  String toString() => id;
-  static UUID randomUUID() => new UUID((__nextId).toString());
-}
-
-
 /**
  * Instances of the class `AnalysisException` represent an exception that
  * occurred during the analysis of one or more sources.
@@ -257,7 +42,6 @@
   }
 }
 
-
 /**
  * Instances of the class `CaughtException` represent an exception that was
  * caught and has an associated stack trace.
@@ -317,3 +101,237 @@
     }
   }
 }
+
+class FileNameUtilities {
+  static String getExtension(String fileName) {
+    if (fileName == null) {
+      return "";
+    }
+    int index = fileName.lastIndexOf('.');
+    if (index >= 0) {
+      return fileName.substring(index + 1);
+    }
+    return "";
+  }
+}
+
+class ObjectUtilities {
+  static int combineHashCodes(int first, int second) => first * 31 + second;
+}
+
+
+class StringUtilities {
+  static const String EMPTY = '';
+  static const List<String> EMPTY_ARRAY = const <String>[];
+
+  static Interner INTERNER = new NullInterner();
+
+  static endsWith3(String str, int c1, int c2, int c3) {
+    var length = str.length;
+    return length >= 3 &&
+        str.codeUnitAt(length - 3) == c1 &&
+        str.codeUnitAt(length - 2) == c2 &&
+        str.codeUnitAt(length - 1) == c3;
+  }
+  static endsWithChar(String str, int c) {
+    int length = str.length;
+    return length > 0 && str.codeUnitAt(length - 1) == c;
+  }
+  static int indexOf1(String str, int start, int c) {
+    int index = start;
+    int last = str.length;
+    while (index < last) {
+      if (str.codeUnitAt(index) == c) {
+        return index;
+      }
+      index++;
+    }
+    return -1;
+  }
+  static int indexOf2(String str, int start, int c1, int c2) {
+    int index = start;
+    int last = str.length - 1;
+    while (index < last) {
+      if (str.codeUnitAt(index) == c1 && str.codeUnitAt(index + 1) == c2) {
+        return index;
+      }
+      index++;
+    }
+    return -1;
+  }
+  static int indexOf4(String string, int start, int c1, int c2, int c3,
+      int c4) {
+    int index = start;
+    int last = string.length - 3;
+    while (index < last) {
+      if (string.codeUnitAt(index) == c1 &&
+          string.codeUnitAt(index + 1) == c2 &&
+          string.codeUnitAt(index + 2) == c3 &&
+          string.codeUnitAt(index + 3) == c4) {
+        return index;
+      }
+      index++;
+    }
+    return -1;
+  }
+  static int indexOf5(String str, int start, int c1, int c2, int c3, int c4,
+      int c5) {
+    int index = start;
+    int last = str.length - 4;
+    while (index < last) {
+      if (str.codeUnitAt(index) == c1 &&
+          str.codeUnitAt(index + 1) == c2 &&
+          str.codeUnitAt(index + 2) == c3 &&
+          str.codeUnitAt(index + 3) == c4 &&
+          str.codeUnitAt(index + 4) == c5) {
+        return index;
+      }
+      index++;
+    }
+    return -1;
+  }
+
+  /**
+   * Return the index of the first not letter/digit character in the [string]
+   * that is at or after the [startIndex]. Return the length of the [string] if
+   * all characters to the end are letters/digits.
+   */
+  static int indexOfFirstNotLetterDigit(String string, int startIndex) {
+    int index = startIndex;
+    int last = string.length;
+    while (index < last) {
+      int c = string.codeUnitAt(index);
+      if (!Character.isLetterOrDigit(c)) {
+        return index;
+      }
+      index++;
+    }
+    return last;
+  }
+  static String intern(String string) => INTERNER.intern(string);
+  static bool isEmpty(String s) {
+    return s == null || s.isEmpty;
+  }
+  static bool isTagName(String s) {
+    if (s == null || s.length == 0) {
+      return false;
+    }
+    int sz = s.length;
+    for (int i = 0; i < sz; i++) {
+      int c = s.codeUnitAt(i);
+      if (!Character.isLetter(c)) {
+        if (i == 0) {
+          return false;
+        }
+        if (!Character.isDigit(c) && c != 0x2D) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+  /**
+   * Produce a string containing all of the names in the given array, surrounded by single quotes,
+   * and separated by commas. The list must contain at least two elements.
+   *
+   * @param names the names to be printed
+   * @return the result of printing the names
+   */
+  static String printListOfQuotedNames(List<String> names) {
+    if (names == null) {
+      throw new IllegalArgumentException("The list must not be null");
+    }
+    int count = names.length;
+    if (count < 2) {
+      throw new IllegalArgumentException(
+          "The list must contain at least two names");
+    }
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("'");
+    buffer.write(names[0]);
+    buffer.write("'");
+    for (int i = 1; i < count - 1; i++) {
+      buffer.write(", '");
+      buffer.write(names[i]);
+      buffer.write("'");
+    }
+    buffer.write(" and '");
+    buffer.write(names[count - 1]);
+    buffer.write("'");
+    return buffer.toString();
+  }
+  static startsWith2(String str, int start, int c1, int c2) {
+    return str.length - start >= 2 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2;
+  }
+  static startsWith3(String str, int start, int c1, int c2, int c3) {
+    return str.length - start >= 3 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2 &&
+        str.codeUnitAt(start + 2) == c3;
+  }
+  static startsWith4(String str, int start, int c1, int c2, int c3, int c4) {
+    return str.length - start >= 4 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2 &&
+        str.codeUnitAt(start + 2) == c3 &&
+        str.codeUnitAt(start + 3) == c4;
+  }
+  static startsWith5(String str, int start, int c1, int c2, int c3, int c4,
+      int c5) {
+    return str.length - start >= 5 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2 &&
+        str.codeUnitAt(start + 2) == c3 &&
+        str.codeUnitAt(start + 3) == c4 &&
+        str.codeUnitAt(start + 4) == c5;
+  }
+  static startsWith6(String str, int start, int c1, int c2, int c3, int c4,
+      int c5, int c6) {
+    return str.length - start >= 6 &&
+        str.codeUnitAt(start) == c1 &&
+        str.codeUnitAt(start + 1) == c2 &&
+        str.codeUnitAt(start + 2) == c3 &&
+        str.codeUnitAt(start + 3) == c4 &&
+        str.codeUnitAt(start + 4) == c5 &&
+        str.codeUnitAt(start + 5) == c6;
+  }
+  static startsWithChar(String str, int c) {
+    return str.length != 0 && str.codeUnitAt(0) == c;
+  }
+
+  static String substringBefore(String str, String separator) {
+    if (str == null || str.isEmpty) {
+      return str;
+    }
+    if (separator == null) {
+      return str;
+    }
+    int pos = str.indexOf(separator);
+    if (pos < 0) {
+      return str;
+    }
+    return str.substring(0, pos);
+  }
+
+  static String substringBeforeChar(String str, int c) {
+    if (isEmpty(str)) {
+      return str;
+    }
+    int pos = indexOf1(str, 0, c);
+    if (pos < 0) {
+      return str;
+    }
+    return str.substring(0, pos);
+  }
+}
+
+
+class UUID {
+  static int __nextId = 0;
+  final String id;
+  UUID(this.id);
+  String toString() => id;
+  static UUID randomUUID() => new UUID((__nextId).toString());
+}
diff --git a/pkg/analyzer/lib/src/generated/java_io.dart b/pkg/analyzer/lib/src/generated/java_io.dart
index 66e38d7..5e900d1 100644
--- a/pkg/analyzer/lib/src/generated/java_io.dart
+++ b/pkg/analyzer/lib/src/generated/java_io.dart
@@ -1,11 +1,101 @@
 library java.io;
 
 import "dart:io";
-import 'java_core.dart' show JavaIOException;
+
 import 'package:path/path.dart' as pathos;
 
+import 'java_core.dart' show JavaIOException;
+
+class JavaFile {
+  static final String separator = Platform.pathSeparator;
+  static final int separatorChar = Platform.pathSeparator.codeUnitAt(0);
+  String _path;
+  JavaFile(String path) {
+    _path = path;
+  }
+  JavaFile.fromUri(Uri uri) : this(pathos.fromUri(uri));
+  JavaFile.relative(JavaFile base, String child) {
+    if (child.isEmpty) {
+      this._path = base._path;
+    } else {
+      this._path = pathos.join(base._path, child);
+    }
+  }
+  int get hashCode => _path.hashCode;
+  bool operator ==(other) {
+    return other is JavaFile && other._path == _path;
+  }
+  bool exists() {
+    if (_newFile().existsSync()) {
+      return true;
+    }
+    if (_newDirectory().existsSync()) {
+      return true;
+    }
+    return false;
+  }
+  JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
+  String getAbsolutePath() {
+    String path = pathos.absolute(_path);
+    path = pathos.normalize(path);
+    return path;
+  }
+  JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
+  String getCanonicalPath() {
+    try {
+      return _newFile().resolveSymbolicLinksSync();
+    } catch (e) {
+      throw new JavaIOException('IOException', e);
+    }
+  }
+  String getName() => pathos.basename(_path);
+  String getParent() {
+    var result = pathos.dirname(_path);
+    // "." or  "/" or  "C:\"
+    if (result.length < 4) return null;
+    return result;
+  }
+  JavaFile getParentFile() {
+    var parent = getParent();
+    if (parent == null) return null;
+    return new JavaFile(parent);
+  }
+  String getPath() => _path;
+  bool isDirectory() {
+    return _newDirectory().existsSync();
+  }
+  bool isExecutable() {
+    return _newFile().statSync().mode & 0x111 != 0;
+  }
+  bool isFile() {
+    return _newFile().existsSync();
+  }
+  int lastModified() {
+    if (!_newFile().existsSync()) return 0;
+    return _newFile().lastModifiedSync().millisecondsSinceEpoch;
+
+  }
+  List<JavaFile> listFiles() {
+    var files = <JavaFile>[];
+    var entities = _newDirectory().listSync();
+    for (FileSystemEntity entity in entities) {
+      files.add(new JavaFile(entity.path));
+    }
+    return files;
+  }
+  String readAsStringSync() => _newFile().readAsStringSync();
+  String toString() => _path.toString();
+  Uri toURI() {
+    String path = getAbsolutePath();
+    return pathos.toUri(path);
+  }
+  Directory _newDirectory() => new Directory(_path);
+  File _newFile() => new File(_path);
+}
+
 class JavaSystemIO {
   static Map<String, String> _properties = new Map();
+  static String getenv(String name) => Platform.environment[name];
   static String getProperty(String name) {
     {
       String value = _properties[name];
@@ -48,92 +138,4 @@
     _properties[name] = value;
     return oldValue;
   }
-  static String getenv(String name) => Platform.environment[name];
-}
-
-class JavaFile {
-  static final String separator = Platform.pathSeparator;
-  static final int separatorChar = Platform.pathSeparator.codeUnitAt(0);
-  String _path;
-  JavaFile(String path) {
-    _path = path;
-  }
-  JavaFile.relative(JavaFile base, String child) {
-    if (child.isEmpty) {
-      this._path = base._path;
-    } else {
-      this._path = pathos.join(base._path, child);
-    }
-  }
-  JavaFile.fromUri(Uri uri) : this(pathos.fromUri(uri));
-  String toString() => _path.toString();
-  int get hashCode => _path.hashCode;
-  bool operator ==(other) {
-    return other is JavaFile && other._path == _path;
-  }
-  String getPath() => _path;
-  String getName() => pathos.basename(_path);
-  String getParent() {
-    var result = pathos.dirname(_path);
-    // "." or  "/" or  "C:\"
-    if (result.length < 4) return null;
-    return result;
-  }
-  JavaFile getParentFile() {
-    var parent = getParent();
-    if (parent == null) return null;
-    return new JavaFile(parent);
-  }
-  String getAbsolutePath() {
-    String path = pathos.absolute(_path);
-    path = pathos.normalize(path);
-    return path;
-  }
-  String getCanonicalPath() {
-    try {
-      return _newFile().resolveSymbolicLinksSync();
-    } catch (e) {
-      throw new JavaIOException('IOException', e);
-    }
-  }
-  JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
-  JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
-  bool exists() {
-    if (_newFile().existsSync()) {
-      return true;
-    }
-    if (_newDirectory().existsSync()) {
-      return true;
-    }
-    return false;
-  }
-  bool isExecutable() {
-    return _newFile().statSync().mode & 0x111 != 0;
-  }
-  bool isFile() {
-    return _newFile().existsSync();
-  }
-  bool isDirectory() {
-    return _newDirectory().existsSync();
-  }
-  Uri toURI() {
-    String path = getAbsolutePath();
-    return pathos.toUri(path);
-  }
-  String readAsStringSync() => _newFile().readAsStringSync();
-  int lastModified() {
-    if (!_newFile().existsSync()) return 0;
-    return _newFile().lastModifiedSync().millisecondsSinceEpoch;
-
-  }
-  List<JavaFile> listFiles() {
-    var files = <JavaFile>[];
-    var entities = _newDirectory().listSync();
-    for (FileSystemEntity entity in entities) {
-      files.add(new JavaFile(entity.path));
-    }
-    return files;
-  }
-  File _newFile() => new File(_path);
-  Directory _newDirectory() => new Directory(_path);
 }
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 7f95463..9bd6454e 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -7,19 +7,624 @@
 
 library engine.parser;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:collection';
 
+import 'ast.dart';
+import 'engine.dart' show AnalysisEngine, AnalysisOptionsImpl;
+import 'error.dart';
+import 'instrumentation.dart';
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'instrumentation.dart';
-import 'error.dart';
-import 'source.dart';
 import 'scanner.dart';
-import 'ast.dart';
-import 'utilities_dart.dart';
-import 'engine.dart' show AnalysisEngine, AnalysisOptionsImpl;
+import 'source.dart';
 import 'utilities_collection.dart' show TokenMap;
+import 'utilities_dart.dart';
+
+Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
+  'parseCompilationUnit_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseCompilationUnit(arg0)),
+  'parseDirectives_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseDirectives(arg0)),
+  'parseExpression_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseExpression(arg0)),
+  'parseStatement_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseStatement(arg0)),
+  'parseStatements_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseStatements(arg0)),
+  'parseAnnotation_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseAnnotation()),
+  'parseArgument_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseArgument()),
+  'parseArgumentList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseArgumentList()),
+  'parseBitwiseOrExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseBitwiseOrExpression()),
+  'parseBlock_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseBlock()),
+  'parseClassMember_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target.parseClassMember(arg0)),
+  'parseCompilationUnit_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseCompilationUnit2()),
+  'parseConditionalExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseConditionalExpression()),
+  'parseConstructorName_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseConstructorName()),
+  'parseExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseExpression2()),
+  'parseExpressionWithoutCascade_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseExpressionWithoutCascade()),
+  'parseExtendsClause_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseExtendsClause()),
+  'parseFormalParameterList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseFormalParameterList()),
+  'parseFunctionExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseFunctionExpression()),
+  'parseImplementsClause_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseImplementsClause()),
+  'parseLabel_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseLabel()),
+  'parseLibraryIdentifier_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseLibraryIdentifier()),
+  'parseLogicalOrExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseLogicalOrExpression()),
+  'parseMapLiteralEntry_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseMapLiteralEntry()),
+  'parseNormalFormalParameter_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseNormalFormalParameter()),
+  'parsePrefixedIdentifier_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parsePrefixedIdentifier()),
+  'parseReturnType_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseReturnType()),
+  'parseSimpleIdentifier_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseSimpleIdentifier()),
+  'parseStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseStatement2()),
+  'parseStringLiteral_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseStringLiteral()),
+  'parseTypeArgumentList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseTypeArgumentList()),
+  'parseTypeName_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseTypeName()),
+  'parseTypeParameter_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseTypeParameter()),
+  'parseTypeParameterList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseTypeParameterList()),
+  'parseWithClause_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseWithClause()),
+  'advance_0': new MethodTrampoline(0, (Parser target) => target._advance()),
+  'appendScalarValue_5': new MethodTrampoline(
+      5,
+      (Parser target, arg0, arg1, arg2, arg3, arg4) =>
+          target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
+  'computeStringValue_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._computeStringValue(arg0, arg1, arg2)),
+  'convertToFunctionDeclaration_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._convertToFunctionDeclaration(arg0)),
+  'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._couldBeStartOfCompilationUnitMember()),
+  'createSyntheticIdentifier_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._createSyntheticIdentifier()),
+  'createSyntheticKeyword_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._createSyntheticKeyword(arg0)),
+  'createSyntheticStringLiteral_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._createSyntheticStringLiteral()),
+  'createSyntheticToken_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._createSyntheticToken(arg0)),
+  'ensureAssignable_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._ensureAssignable(arg0)),
+  'expect_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._expect(arg0)),
+  'expectGt_0': new MethodTrampoline(0, (Parser target) => target._expectGt()),
+  'expectKeyword_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._expectKeyword(arg0)),
+  'expectSemicolon_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._expectSemicolon()),
+  'findRange_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._findRange(arg0, arg1)),
+  'getCodeBlockRanges_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._getCodeBlockRanges(arg0)),
+  'getEndToken_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._getEndToken(arg0)),
+  'injectToken_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._injectToken(arg0)),
+  'isFunctionDeclaration_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._isFunctionDeclaration()),
+  'isFunctionExpression_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._isFunctionExpression(arg0)),
+  'isHexDigit_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._isHexDigit(arg0)),
+  'isInitializedVariableDeclaration_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._isInitializedVariableDeclaration()),
+  'isLinkText_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._isLinkText(arg0, arg1)),
+  'isOperator_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._isOperator(arg0)),
+  'isSwitchMember_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._isSwitchMember()),
+  'isTypedIdentifier_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._isTypedIdentifier(arg0)),
+  'lockErrorListener_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._lockErrorListener()),
+  'matches_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._matches(arg0)),
+  'matchesGt_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._matchesGt()),
+  'matchesIdentifier_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._matchesIdentifier()),
+  'matchesKeyword_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._matchesKeyword(arg0)),
+  'matchesString_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._matchesString(arg0)),
+  'optional_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._optional(arg0)),
+  'parseAdditiveExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseAdditiveExpression()),
+  'parseAssertStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseAssertStatement()),
+  'parseAssignableExpression_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseAssignableExpression(arg0)),
+  'parseAssignableSelector_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseAssignableSelector(arg0, arg1)),
+  'parseAwaitExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseAwaitExpression()),
+  'parseBitwiseAndExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseBitwiseAndExpression()),
+  'parseBitwiseXorExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseBitwiseXorExpression()),
+  'parseBreakStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseBreakStatement()),
+  'parseCascadeSection_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseCascadeSection()),
+  'parseClassDeclaration_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseClassDeclaration(arg0, arg1)),
+  'parseClassMembers_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseClassMembers(arg0, arg1)),
+  'parseClassTypeAlias_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseClassTypeAlias(arg0, arg1, arg2)),
+  'parseCombinator_0': new MethodTrampoline(
+      0,
+      (Parser target) => target.parseCombinator()),
+  'parseCombinators_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseCombinators()),
+  'parseCommentAndMetadata_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseCommentAndMetadata()),
+  'parseCommentReference_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseCommentReference(arg0, arg1)),
+  'parseCommentReferences_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseCommentReferences(arg0)),
+  'parseCompilationUnitMember_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseCompilationUnitMember(arg0)),
+  'parseConstExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseConstExpression()),
+  'parseConstructor_8': new MethodTrampoline(
+      8,
+      (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) =>
+          target._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
+  'parseConstructorFieldInitializer_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseConstructorFieldInitializer()),
+  'parseContinueStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseContinueStatement()),
+  'parseDirective_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseDirective(arg0)),
+  'parseDirectives_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseDirectives()),
+  'parseDocumentationComment_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseDocumentationComment()),
+  'parseDoStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseDoStatement()),
+  'parseEmptyStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseEmptyStatement()),
+  'parseEnumConstantDeclaration_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseEnumConstantDeclaration()),
+  'parseEnumDeclaration_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseEnumDeclaration(arg0)),
+  'parseEqualityExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseEqualityExpression()),
+  'parseExportDirective_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseExportDirective(arg0)),
+  'parseExpressionList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseExpressionList()),
+  'parseFinalConstVarOrType_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)),
+  'parseFormalParameter_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseFormalParameter(arg0)),
+  'parseForStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseForStatement()),
+  'parseFunctionBody_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseFunctionBody(arg0, arg1, arg2)),
+  'parseFunctionDeclaration_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseFunctionDeclaration(arg0, arg1, arg2)),
+  'parseFunctionDeclarationStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseFunctionDeclarationStatement()),
+  'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) =>
+          target._parseFunctionDeclarationStatementAfterReturnType(arg0, arg1)),
+  'parseFunctionTypeAlias_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseFunctionTypeAlias(arg0, arg1)),
+  'parseGetter_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseGetter(arg0, arg1, arg2, arg3)),
+  'parseIdentifierList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseIdentifierList()),
+  'parseIfStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseIfStatement()),
+  'parseImportDirective_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseImportDirective(arg0)),
+  'parseInitializedIdentifierList_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
+  'parseInstanceCreationExpression_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseInstanceCreationExpression(arg0)),
+  'parseLibraryDirective_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseLibraryDirective(arg0)),
+  'parseLibraryName_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseLibraryName(arg0, arg1)),
+  'parseListLiteral_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseListLiteral(arg0, arg1)),
+  'parseListOrMapLiteral_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseListOrMapLiteral(arg0)),
+  'parseLogicalAndExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseLogicalAndExpression()),
+  'parseMapLiteral_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)),
+  'parseMethodDeclarationAfterParameters_6': new MethodTrampoline(
+      6,
+      (Parser target, arg0, arg1, arg2, arg3, arg4, arg5) =>
+          target._parseMethodDeclarationAfterParameters(
+              arg0,
+              arg1,
+              arg2,
+              arg3,
+              arg4,
+              arg5)),
+  'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)),
+  'parseModifiers_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseModifiers()),
+  'parseMultiplicativeExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseMultiplicativeExpression()),
+  'parseNativeClause_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseNativeClause()),
+  'parseNewExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseNewExpression()),
+  'parseNonLabeledStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseNonLabeledStatement()),
+  'parseOperator_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) => target._parseOperator(arg0, arg1, arg2)),
+  'parseOptionalReturnType_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseOptionalReturnType()),
+  'parsePartDirective_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parsePartDirective(arg0)),
+  'parsePostfixExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parsePostfixExpression()),
+  'parsePrimaryExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parsePrimaryExpression()),
+  'parseRedirectingConstructorInvocation_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseRedirectingConstructorInvocation()),
+  'parseRelationalExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseRelationalExpression()),
+  'parseRethrowExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseRethrowExpression()),
+  'parseReturnStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseReturnStatement()),
+  'parseSetter_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseSetter(arg0, arg1, arg2, arg3)),
+  'parseShiftExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseShiftExpression()),
+  'parseStatementList_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseStatementList()),
+  'parseStringInterpolation_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseStringInterpolation(arg0)),
+  'parseSuperConstructorInvocation_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseSuperConstructorInvocation()),
+  'parseSwitchStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseSwitchStatement()),
+  'parseSymbolLiteral_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseSymbolLiteral()),
+  'parseThrowExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseThrowExpression()),
+  'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseThrowExpressionWithoutCascade()),
+  'parseTryStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseTryStatement()),
+  'parseTypeAlias_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._parseTypeAlias(arg0)),
+  'parseUnaryExpression_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseUnaryExpression()),
+  'parseVariableDeclaration_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseVariableDeclaration()),
+  'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) =>
+          target._parseVariableDeclarationListAfterMetadata(arg0)),
+  'parseVariableDeclarationListAfterType_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseVariableDeclarationListAfterType(arg0, arg1, arg2)),
+  'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) =>
+          target._parseVariableDeclarationStatementAfterMetadata(arg0)),
+  'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseVariableDeclarationStatementAfterType(arg0, arg1, arg2)),
+  'parseWhileStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseWhileStatement()),
+  'parseYieldStatement_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._parseYieldStatement()),
+  'peek_0': new MethodTrampoline(0, (Parser target) => target._peek()),
+  'peekAt_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._peekAt(arg0)),
+  'reportError_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._reportError(arg0)),
+  'reportErrorForCurrentToken_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._reportErrorForCurrentToken(arg0, arg1)),
+  'reportErrorForNode_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._reportErrorForNode(arg0, arg1, arg2)),
+  'reportErrorForToken_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._reportErrorForToken(arg0, arg1, arg2)),
+  'skipBlock_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._skipBlock()),
+  'skipFinalConstVarOrType_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipFinalConstVarOrType(arg0)),
+  'skipFormalParameterList_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipFormalParameterList(arg0)),
+  'skipPastMatchingToken_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipPastMatchingToken(arg0)),
+  'skipPrefixedIdentifier_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipPrefixedIdentifier(arg0)),
+  'skipReturnType_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipReturnType(arg0)),
+  'skipSimpleIdentifier_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipSimpleIdentifier(arg0)),
+  'skipStringInterpolation_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipStringInterpolation(arg0)),
+  'skipStringLiteral_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipStringLiteral(arg0)),
+  'skipTypeArgumentList_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipTypeArgumentList(arg0)),
+  'skipTypeName_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipTypeName(arg0)),
+  'skipTypeParameterList_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._skipTypeParameterList(arg0)),
+  'tokenMatches_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._tokenMatches(arg0, arg1)),
+  'tokenMatchesIdentifier_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._tokenMatchesIdentifier(arg0)),
+  'tokenMatchesKeyword_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._tokenMatchesKeyword(arg0, arg1)),
+  'tokenMatchesString_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) => target._tokenMatchesString(arg0, arg1)),
+  'translateCharacter_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._translateCharacter(arg0, arg1, arg2)),
+  'unlockErrorListener_0': new MethodTrampoline(
+      0,
+      (Parser target) => target._unlockErrorListener()),
+  'validateFormalParameterList_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateFormalParameterList(arg0)),
+  'validateModifiersForClass_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForClass(arg0)),
+  'validateModifiersForConstructor_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForConstructor(arg0)),
+  'validateModifiersForEnum_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForEnum(arg0)),
+  'validateModifiersForField_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForField(arg0)),
+  'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) =>
+          target._validateModifiersForFunctionDeclarationStatement(arg0)),
+  'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) =>
+          target._validateModifiersForGetterOrSetterOrMethod(arg0)),
+  'validateModifiersForOperator_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForOperator(arg0)),
+  'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForTopLevelDeclaration(arg0)),
+  'validateModifiersForTopLevelFunction_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForTopLevelFunction(arg0)),
+  'validateModifiersForTopLevelVariable_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForTopLevelVariable(arg0)),
+  'validateModifiersForTypedef_1': new MethodTrampoline(
+      1,
+      (Parser target, arg0) => target._validateModifiersForTypedef(arg0)),
+};
+
+Object invokeParserMethodImpl(Parser parser, String methodName,
+    List<Object> objects, Token tokenStream) {
+  parser.currentToken = tokenStream;
+  MethodTrampoline method =
+      methodTable_Parser['${methodName}_${objects.length}'];
+  return method.invoke(parser, objects);
+}
 
 /**
  * Instances of the class `CommentAndMetadata` implement a simple data-holder for a method
@@ -144,10 +749,11 @@
   @override
   AstNode visitAssignmentExpression(AssignmentExpression node) {
     if (identical(_oldNode, node.leftHandSide)) {
-      // TODO(brianwilkerson) If the assignment is part of a cascade section, then we don't have a
-      // single parse method that will work. Otherwise, we can parse a conditional expression, but
-      // need to ensure that the resulting expression is assignable.
-      // return parser.parseConditionalExpression();
+      // TODO(brianwilkerson) If the assignment is part of a cascade section,
+      // then we don't have a single parse method that will work.
+      // Otherwise, we can parse a conditional expression, but need to ensure
+      // that the resulting expression is assignable.
+//      return parser.parseConditionalExpression();
       throw new InsufficientContextException();
     } else if (identical(_oldNode, node.rightHandSide)) {
       if (_isCascadeAllowedInAssignment(node)) {
@@ -161,7 +767,8 @@
   @override
   AstNode visitAwaitExpression(AwaitExpression node) {
     if (identical(_oldNode, node.expression)) {
-      // TODO(brianwilkerson) Depending on precedence, this might not be sufficient.
+      // TODO(brianwilkerson) Depending on precedence,
+      // this might not be sufficient.
       return _parser.parseExpression2();
     }
     return _notAChild(node);
@@ -235,7 +842,9 @@
     } else if (node.metadata.contains(_oldNode)) {
       return _parser.parseAnnotation();
     } else if (identical(_oldNode, node.name)) {
-      return _parser.parseSimpleIdentifier();
+      // Changing the class name changes whether a member is interpreted as a
+      // constructor or not, so we'll just have to re-parse the entire class.
+      throw new InsufficientContextException();
     } else if (identical(_oldNode, node.typeParameters)) {
       return _parser.parseTypeParameterList();
     } else if (identical(_oldNode, node.extendsClause)) {
@@ -642,8 +1251,7 @@
     } else if (identical(_oldNode, node.prefix)) {
       return _parser.parseSimpleIdentifier();
     } else if (node.combinators.contains(_oldNode)) {
-      throw new IncrementalParseException();
-      //return parser.parseCombinator();
+      return _parser.parseCombinator();
     }
     return _notAChild(node);
   }
@@ -784,6 +1392,11 @@
     } else if (identical(_oldNode, node.body)) {
       //return parser.parseFunctionBody();
       throw new InsufficientContextException();
+    } else if (identical(_oldNode, node.parameters)) {
+      // TODO(paulberry): if we want errors to be correct, we'll need to also
+      // call _validateFormalParameterList, and sometimes
+      // _validateModifiersForGetterOrSetterOrMethod.
+      return _parser.parseFormalParameterList();
     }
     return _notAChild(node);
   }
@@ -898,7 +1511,8 @@
   }
 
   @override
-  AstNode visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  AstNode
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     if (identical(_oldNode, node.constructorName)) {
       return _parser.parseSimpleIdentifier();
     } else if (identical(_oldNode, node.argumentList)) {
@@ -947,7 +1561,8 @@
   AstNode visitSimpleIdentifier(SimpleIdentifier node) => _notAChild(node);
 
   @override
-  AstNode visitSimpleStringLiteral(SimpleStringLiteral node) => _notAChild(node);
+  AstNode visitSimpleStringLiteral(SimpleStringLiteral node) =>
+      _notAChild(node);
 
   @override
   AstNode visitStringInterpolation(StringInterpolation node) {
@@ -1103,6 +1718,13 @@
       throw new InsufficientContextException();
     } else if (node.metadata.contains(_oldNode)) {
       return _parser.parseAnnotation();
+    } else if (identical(_oldNode, node.type)) {
+      // There is not enough context to know whether we should reparse the type
+      // using parseReturnType() (which allows 'void') or parseTypeName()
+      // (which doesn't).  Note that even though the language disallows
+      // variables of type 'void', the parser sometimes accepts them in the
+      // course of error recovery (e.g. "class C { void v; }"
+      throw new InsufficientContextException();
     } else if (node.variables.contains(_oldNode)) {
       throw new InsufficientContextException();
     }
@@ -1173,7 +1795,8 @@
    * @param visitedNode the visited node that should have been the parent of the node to be replaced
    */
   AstNode _notAChild(AstNode visitedNode) {
-    throw new IncrementalParseException.con1("Internal error: the visited node (a ${visitedNode.runtimeType}) was not the parent of the node to be replaced (a ${_oldNode.runtimeType})");
+    throw new IncrementalParseException.con1(
+        "Internal error: the visited node (a ${visitedNode.runtimeType}) was not the parent of the node to be replaced (a ${_oldNode.runtimeType})");
   }
 }
 
@@ -1257,7 +1880,8 @@
    * @param originalStart the offset in the original source of the first character that was modified
    * @param originalEnd the offset in the original source of the last character that was modified
    */
-  AstNode reparse(AstNode originalStructure, Token leftToken, Token rightToken, int originalStart, int originalEnd) {
+  AstNode reparse(AstNode originalStructure, Token leftToken, Token rightToken,
+      int originalStart, int originalEnd) {
     AstNode oldNode = null;
     AstNode newNode = null;
     //
@@ -1265,16 +1889,21 @@
     //
     Token firstToken = leftToken.next;
     if (identical(firstToken, rightToken)) {
-      // If there are no new tokens, then we need to include at least one copied node in the range.
+      // If there are no new tokens, then we need to include at least one copied
+      // node in the range.
       firstToken = leftToken;
     }
     //
-    // Find the smallest AST node that encompasses the range of re-scanned tokens.
+    // Find the smallest AST node that encompasses the range of re-scanned
+    // tokens.
     //
     if (originalEnd < originalStart) {
-      oldNode = new NodeLocator.con1(originalStart).searchWithin(originalStructure);
+      oldNode =
+          new NodeLocator.con1(originalStart).searchWithin(originalStructure);
     } else {
-      oldNode = new NodeLocator.con2(originalStart, originalEnd).searchWithin(originalStructure);
+      oldNode = new NodeLocator.con2(
+          originalStart,
+          originalEnd).searchWithin(originalStructure);
     }
     //
     // Find the token at which parsing is to begin.
@@ -1298,13 +1927,20 @@
       }
       bool advanceToParent = false;
       try {
-        IncrementalParseDispatcher dispatcher = new IncrementalParseDispatcher(parser, oldNode);
+        IncrementalParseDispatcher dispatcher =
+            new IncrementalParseDispatcher(parser, oldNode);
+        IncrementalParseStateBuilder contextBuilder =
+            new IncrementalParseStateBuilder(parser);
+        contextBuilder.buildState(oldNode);
         newNode = parent.accept(dispatcher);
         //
         // Validate that the new node can replace the old node.
         //
         Token mappedToken = _tokenMap.get(oldNode.endToken.next);
-        if (mappedToken == null || mappedToken.offset != newNode.endToken.next.offset || newNode.offset != oldNode.offset) {
+        if (mappedToken == null ||
+            newNode == null ||
+            mappedToken.offset != newNode.endToken.next.offset ||
+            newNode.offset != oldNode.offset) {
           advanceToParent = true;
         }
       } on InsufficientContextException catch (exception) {
@@ -1322,15 +1958,18 @@
     }
     _updatedNode = newNode;
     //
-    // Replace the old node with the new node in a copy of the original AST structure.
+    // Replace the old node with the new node in a copy of the original AST
+    // structure.
     //
     if (identical(oldNode, originalStructure)) {
-      // We ended up re-parsing the whole structure, so there's no need for a copy.
+      // We ended up re-parsing the whole structure, so there's no need for a
+      // copy.
       ResolutionCopier.copyResolutionData(oldNode, newNode);
       return newNode;
     }
     ResolutionCopier.copyResolutionData(oldNode, newNode);
-    IncrementalAstCloner cloner = new IncrementalAstCloner(oldNode, newNode, _tokenMap);
+    IncrementalAstCloner cloner =
+        new IncrementalAstCloner(oldNode, newNode, _tokenMap);
     return originalStructure.accept(cloner) as AstNode;
   }
 
@@ -1364,6 +2003,100 @@
 }
 
 /**
+ * Visitor capable of inferring the correct parser state for incremental
+ * parsing.  This visitor visits each parent/child relationship in the chain of
+ * ancestors of the node to be replaced (starting with the root of the parse
+ * tree), updating the parser to the correct state for parsing the child of the
+ * given parent.  Once it has visited all of these relationships, the parser
+ * will be in the correct state for reparsing the node to be replaced.
+ *
+ * TODO(paulberry): add support for other pieces of parser state (_inAsync,
+ * _inGenerator, _inLoop, and _inSwitch).  Note that _inLoop and _inSwitch only
+ * affect error message generation.
+ */
+class IncrementalParseStateBuilder extends SimpleAstVisitor {
+  /**
+   * The parser whose state should be built.
+   */
+  final Parser _parser;
+
+  /**
+   * The child node in the parent/child relationship currently being visited.
+   * (The corresponding parent is the node passed to the visit...() function.)
+   */
+  AstNode _childNode;
+
+  /**
+   * Create an IncrementalParseStateBuilder which will build the correct state
+   * for [_parser].
+   */
+  IncrementalParseStateBuilder(this._parser);
+
+  /**
+   * Build the correct parser state for parsing a replacement for [node].
+   */
+  void buildState(AstNode node) {
+    List<AstNode> ancestors = <AstNode>[];
+    while (node != null) {
+      ancestors.add(node);
+      node = node.parent;
+    }
+    _parser._inInitializer = false;
+    for (int i = ancestors.length - 2; i >= 0; i--) {
+      _childNode = ancestors[i];
+      ancestors[i + 1].accept(this);
+    }
+  }
+
+  @override
+  void visitArgumentList(ArgumentList node) {
+    _parser._inInitializer = false;
+  }
+
+  @override
+  void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    if (identical(_childNode, node.expression)) {
+      _parser._inInitializer = true;
+    }
+  }
+
+  @override
+  void visitIndexExpression(IndexExpression node) {
+    if (identical(_childNode, node.index)) {
+      _parser._inInitializer = false;
+    }
+  }
+
+  @override
+  void visitInterpolationExpression(InterpolationExpression node) {
+    if (identical(_childNode, node.expression)) {
+      _parser._inInitializer = false;
+    }
+  }
+
+  @override
+  void visitListLiteral(ListLiteral node) {
+    if (node.elements.contains(_childNode)) {
+      _parser._inInitializer = false;
+    }
+  }
+
+  @override
+  void visitMapLiteral(MapLiteral node) {
+    if (node.entries.contains(_childNode)) {
+      _parser._inInitializer = false;
+    }
+  }
+
+  @override
+  void visitParenthesizedExpression(ParenthesizedExpression node) {
+    if (identical(_childNode, node.expression)) {
+      _parser._inInitializer = false;
+    }
+  }
+}
+
+/**
  * Instances of the class `InsufficientContextException` represent a situation in which an AST
  * node cannot be re-parsed because there is not enough context to know how to re-parse the node.
  * Clients can attempt to re-parse the parent of the node.
@@ -1390,6 +2123,40 @@
 }
 
 /**
+ * Wrapper around [Function] which should be called with "target" and "arguments".
+ */
+class MethodTrampoline {
+  int parameterCount;
+  Function trampoline;
+  MethodTrampoline(this.parameterCount, this.trampoline);
+  Object invoke(target, List arguments) {
+    if (arguments.length != parameterCount) {
+      throw new IllegalArgumentException(
+          "${arguments.length} != $parameterCount");
+    }
+    switch (parameterCount) {
+      case 0:
+        return trampoline(target);
+      case 1:
+        return trampoline(target, arguments[0]);
+      case 2:
+        return trampoline(target, arguments[0], arguments[1]);
+      case 3:
+        return trampoline(target, arguments[0], arguments[1], arguments[2]);
+      case 4:
+        return trampoline(
+            target,
+            arguments[0],
+            arguments[1],
+            arguments[2],
+            arguments[3]);
+      default:
+        throw new IllegalArgumentException("Not implemented for > 4 arguments");
+    }
+  }
+}
+
+/**
  * Instances of the class `Modifiers` implement a simple data-holder for a method that needs
  * to return multiple values.
  */
@@ -1467,6 +2234,24 @@
  * Instances of the class `Parser` are used to parse tokens into an AST structure.
  */
 class Parser {
+  static String ASYNC = "async";
+
+  static String _AWAIT = "await";
+
+  static String _HIDE = "hide";
+
+  static String _OF = "of";
+
+  static String _ON = "on";
+
+  static String _NATIVE = "native";
+
+  static String _SHOW = "show";
+
+  static String SYNC = "sync";
+
+  static String _YIELD = "yield";
+
   /**
    * The source being parsed.
    */
@@ -1495,7 +2280,8 @@
   /**
    * A flag indicating whether the parser is to parse deferred libraries.
    */
-  bool _parseDeferredLibraries = AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING;
+  bool _parseDeferredLibraries =
+      AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING;
 
   /**
    * A flag indicating whether the parser is to parse enum declarations.
@@ -1533,24 +2319,6 @@
    */
   bool _inInitializer = false;
 
-  static String ASYNC = "async";
-
-  static String _AWAIT = "await";
-
-  static String _HIDE = "hide";
-
-  static String _OF = "of";
-
-  static String _ON = "on";
-
-  static String _NATIVE = "native";
-
-  static String _SHOW = "show";
-
-  static String SYNC = "sync";
-
-  static String _YIELD = "yield";
-
   /**
    * Initialize a newly created parser.
    *
@@ -1561,93 +2329,35 @@
   Parser(this._source, this._errorListener);
 
   /**
-   * Parse a compilation unit, starting with the given token.
+   * Advance to the next token in the token stream, making it the new current token.
    *
-   * @param token the first token of the compilation unit
-   * @return the compilation unit that was parsed
+   * @return the token that was current before this method was invoked
    */
-  CompilationUnit parseCompilationUnit(Token token) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseCompilationUnit");
-    try {
-      _currentToken = token;
-      return parseCompilationUnit2();
-    } finally {
-      instrumentation.log2(2);
-      //Record if >= 2ms
-    }
+  Token get andAdvance {
+    Token token = _currentToken;
+    _advance();
+    return token;
+  }
+
+  void set currentToken(Token currentToken) {
+    this._currentToken = currentToken;
   }
 
   /**
-   * Parse the script tag and directives in a compilation unit, starting with the given token, until
-   * the first non-directive is encountered. The remainder of the compilation unit will not be
-   * parsed. Specifically, if there are directives later in the file, they will not be parsed.
+   * Return `true` if the current token is the first token of a return type that is followed
+   * by an identifier, possibly followed by a list of type parameters, followed by a
+   * left-parenthesis. This is used by parseTypeAlias to determine whether or not to parse a return
+   * type.
    *
-   * @param token the first token of the compilation unit
-   * @return the compilation unit that was parsed
+   * @return `true` if we can successfully parse the rest of a type alias if we first parse a
+   *         return type.
    */
-  CompilationUnit parseDirectives(Token token) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseDirectives");
-    try {
-      _currentToken = token;
-      return _parseDirectives();
-    } finally {
-      instrumentation.log2(2);
-      //Record if >= 2ms
+  bool get hasReturnTypeInTypeAlias {
+    Token next = _skipReturnType(_currentToken);
+    if (next == null) {
+      return false;
     }
-  }
-
-  /**
-   * Parse an expression, starting with the given token.
-   *
-   * @param token the first token of the expression
-   * @return the expression that was parsed, or `null` if the tokens do not represent a
-   *         recognizable expression
-   */
-  Expression parseExpression(Token token) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseExpression");
-    try {
-      _currentToken = token;
-      return parseExpression2();
-    } finally {
-      instrumentation.log2(2);
-      //Record if >= 2ms
-    }
-  }
-
-  /**
-   * Parse a statement, starting with the given token.
-   *
-   * @param token the first token of the statement
-   * @return the statement that was parsed, or `null` if the tokens do not represent a
-   *         recognizable statement
-   */
-  Statement parseStatement(Token token) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseStatement");
-    try {
-      _currentToken = token;
-      return parseStatement2();
-    } finally {
-      instrumentation.log2(2);
-      //Record if >= 2ms
-    }
-  }
-
-  /**
-   * Parse a sequence of statements, starting with the given token.
-   *
-   * @param token the first token of the sequence of statement
-   * @return the statements that were parsed, or `null` if the tokens do not represent a
-   *         recognizable sequence of statements
-   */
-  List<Statement> parseStatements(Token token) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.Parser.parseStatements");
-    try {
-      _currentToken = token;
-      return _parseStatementList();
-    } finally {
-      instrumentation.log2(2);
-      //Record if >= 2ms
-    }
+    return _tokenMatchesIdentifier(next);
   }
 
   /**
@@ -1728,8 +2438,8 @@
    */
   Expression parseArgument() {
     //
-    // Both namedArgument and expression can start with an identifier, but only namedArgument can
-    // have an identifier followed by a colon.
+    // Both namedArgument and expression can start with an identifier, but only
+    // namedArgument can have an identifier followed by a colon.
     //
     if (_matchesIdentifier() && _tokenMatches(_peek(), TokenType.COLON)) {
       return new NamedExpression(parseLabel(), parseExpression2());
@@ -1759,8 +2469,8 @@
       return new ArgumentList(leftParenthesis, arguments, andAdvance);
     }
     //
-    // Even though unnamed arguments must all appear before any named arguments, we allow them to
-    // appear in any order so that we can recover faster.
+    // Even though unnamed arguments must all appear before any named arguments,
+    // we allow them to appear in any order so that we can recover faster.
     //
     bool wasInInitializer = _inInitializer;
     _inInitializer = false;
@@ -1773,19 +2483,24 @@
         argument = parseArgument();
         arguments.add(argument);
         if (foundNamedArgument) {
-          bool blankArgument = argument is SimpleIdentifier && (argument as SimpleIdentifier).name.isEmpty;
-          if (!generatedError && !(argument is NamedExpression && !blankArgument)) {
-            // Report the error, once, but allow the arguments to be in any order in the AST.
-            _reportErrorForCurrentToken(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT);
+          bool blankArgument =
+              argument is SimpleIdentifier &&
+              (argument as SimpleIdentifier).name.isEmpty;
+          if (!generatedError &&
+              !(argument is NamedExpression && !blankArgument)) {
+            // Report the error, once, but allow the arguments to be in any
+            // order in the AST.
+            _reportErrorForCurrentToken(
+                ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT);
             generatedError = true;
           }
         } else if (argument is NamedExpression) {
           foundNamedArgument = true;
         }
       }
-      // TODO(brianwilkerson) Recovery: Look at the left parenthesis to see whether there is a
-      // matching right parenthesis. If there is, then we're more likely missing a comma and should
-      // go back to parsing arguments.
+      // TODO(brianwilkerson) Recovery: Look at the left parenthesis to see
+      // whether there is a matching right parenthesis. If there is, then we're
+      // more likely missing a comma and should go back to parsing arguments.
       Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       return new ArgumentList(leftParenthesis, arguments, rightParenthesis);
     } finally {
@@ -1806,14 +2521,16 @@
    */
   Expression parseBitwiseOrExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _tokenMatches(_peek(), TokenType.BAR)) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _tokenMatches(_peek(), TokenType.BAR)) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseBitwiseXorExpression();
     }
     while (_matches(TokenType.BAR)) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseBitwiseXorExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseBitwiseXorExpression());
     }
     return expression;
   }
@@ -1832,14 +2549,18 @@
     Token leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET);
     List<Statement> statements = new List<Statement>();
     Token statementStart = _currentToken;
-    while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET)) {
+    while (!_matches(TokenType.EOF) &&
+        !_matches(TokenType.CLOSE_CURLY_BRACKET)) {
       Statement statement = parseStatement2();
       if (statement != null) {
         statements.add(statement);
       }
       if (identical(_currentToken, statementStart)) {
         // Ensure that we are making progress and report an error if we're not.
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
       }
       statementStart = _currentToken;
@@ -1868,58 +2589,101 @@
       TypeName returnType = parseReturnType();
       if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) {
         _validateModifiersForGetterOrSetterOrMethod(modifiers);
-        return _parseGetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, returnType);
-      } else if (_matchesKeyword(Keyword.SET) && _tokenMatchesIdentifier(_peek())) {
+        return _parseGetter(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            modifiers.staticKeyword,
+            returnType);
+      } else if (_matchesKeyword(Keyword.SET) &&
+          _tokenMatchesIdentifier(_peek())) {
         _validateModifiersForGetterOrSetterOrMethod(modifiers);
-        return _parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, returnType);
+        return _parseSetter(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            modifiers.staticKeyword,
+            returnType);
       } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
         _validateModifiersForOperator(modifiers);
-        return _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType);
-      } else if (_matchesIdentifier() && _peek().matchesAny([
-          TokenType.OPEN_PAREN,
-          TokenType.OPEN_CURLY_BRACKET,
-          TokenType.FUNCTION])) {
+        return _parseOperator(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            returnType);
+      } else if (_matchesIdentifier() &&
+          _peek().matchesAny(
+              [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
         _validateModifiersForGetterOrSetterOrMethod(modifiers);
-        return _parseMethodDeclarationAfterReturnType(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, returnType);
+        return _parseMethodDeclarationAfterReturnType(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            modifiers.staticKeyword,
+            returnType);
       } else {
         //
         // We have found an error of some kind. Try to recover.
         //
         if (_matchesIdentifier()) {
-          if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
+          if (_peek().matchesAny(
+              [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
             //
             // We appear to have a variable declaration with a type of "void".
             //
             _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
-            return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), returnType);
+            return _parseInitializedIdentifierList(
+                commentAndMetadata,
+                modifiers.staticKeyword,
+                _validateModifiersForField(modifiers),
+                returnType);
           }
         }
         if (_isOperator(_currentToken)) {
           //
-          // We appear to have found an operator declaration without the 'operator' keyword.
+          // We appear to have found an operator declaration without the
+          // 'operator' keyword.
           //
           _validateModifiersForOperator(modifiers);
-          return _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType);
+          return _parseOperator(
+              commentAndMetadata,
+              modifiers.externalKeyword,
+              returnType);
         }
-        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
+        _reportErrorForToken(
+            ParserErrorCode.EXPECTED_EXECUTABLE,
+            _currentToken);
         return null;
       }
-    } else if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) {
+    } else if (_matchesKeyword(Keyword.GET) &&
+        _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
-      return _parseGetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, null);
-    } else if (_matchesKeyword(Keyword.SET) && _tokenMatchesIdentifier(_peek())) {
+      return _parseGetter(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          null);
+    } else if (_matchesKeyword(Keyword.SET) &&
+        _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
-      return _parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, null);
+      return _parseSetter(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          null);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
       _validateModifiersForOperator(modifiers);
-      return _parseOperator(commentAndMetadata, modifiers.externalKeyword, null);
+      return _parseOperator(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          null);
     } else if (!_matchesIdentifier()) {
       if (_isOperator(_currentToken)) {
         //
-        // We appear to have found an operator declaration without the 'operator' keyword.
+        // We appear to have found an operator declaration without the
+        // 'operator' keyword.
         //
         _validateModifiersForOperator(modifiers);
-        return _parseOperator(commentAndMetadata, modifiers.externalKeyword, null);
+        return _parseOperator(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            null);
       }
       Token keyword = modifiers.varKeyword;
       if (keyword == null) {
@@ -1934,71 +2698,151 @@
         //
         _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
-        variables.add(new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
-        return new FieldDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, null, new VariableDeclarationList(null, null, keyword, null, variables), _expectSemicolon());
+        variables.add(
+            new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
+        return new FieldDeclaration(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            null,
+            new VariableDeclarationList(null, null, keyword, null, variables),
+            _expectSemicolon());
       }
-      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
-      if (commentAndMetadata.comment != null || !commentAndMetadata.metadata.isEmpty) {
+      _reportErrorForToken(
+          ParserErrorCode.EXPECTED_CLASS_MEMBER,
+          _currentToken);
+      if (commentAndMetadata.comment != null ||
+          !commentAndMetadata.metadata.isEmpty) {
         //
-        // We appear to have found an incomplete declaration at the end of the class. At this point
-        // it consists of a metadata, which we don't want to loose, so we'll treat it as a method
-        // declaration with a missing name, parameters and empty body.
+        // We appear to have found an incomplete declaration at the end of the
+        // class. At this point it consists of a metadata, which we don't want
+        // to loose, so we'll treat it as a method declaration with a missing
+        // name, parameters and empty body.
         //
-        return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, null, null, null, null, null, _createSyntheticIdentifier(), new FormalParameterList(null, new List<FormalParameter>(), null, null, null), new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON)));
+        return new MethodDeclaration(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            null,
+            null,
+            null,
+            null,
+            null,
+            _createSyntheticIdentifier(),
+            new FormalParameterList(null, new List<FormalParameter>(), null, null, null),
+            new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON)));
       }
       return null;
-    } else if (_tokenMatches(_peek(), TokenType.PERIOD) && _tokenMatchesIdentifier(_peekAt(2)) && _tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
-      return _parseConstructor(commentAndMetadata, modifiers.externalKeyword, _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleIdentifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList());
+    } else if (_tokenMatches(_peek(), TokenType.PERIOD) &&
+        _tokenMatchesIdentifier(_peekAt(2)) &&
+        _tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
+      return _parseConstructor(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          _validateModifiersForConstructor(modifiers),
+          modifiers.factoryKeyword,
+          parseSimpleIdentifier(),
+          andAdvance,
+          parseSimpleIdentifier(),
+          parseFormalParameterList());
     } else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       SimpleIdentifier methodName = parseSimpleIdentifier();
       FormalParameterList parameters = parseFormalParameterList();
-      if (_matches(TokenType.COLON) || modifiers.factoryKeyword != null || methodName.name == className) {
-        return _parseConstructor(commentAndMetadata, modifiers.externalKeyword, _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName, null, null, parameters);
+      if (_matches(TokenType.COLON) ||
+          modifiers.factoryKeyword != null ||
+          methodName.name == className) {
+        return _parseConstructor(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            _validateModifiersForConstructor(modifiers),
+            modifiers.factoryKeyword,
+            methodName,
+            null,
+            null,
+            parameters);
       }
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
       _validateFormalParameterList(parameters);
-      return _parseMethodDeclarationAfterParameters(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, null, methodName, parameters);
-    } else if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
-      if (modifiers.constKeyword == null && modifiers.finalKeyword == null && modifiers.varKeyword == null) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
+      return _parseMethodDeclarationAfterParameters(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          null,
+          methodName,
+          parameters);
+    } else if (_peek().matchesAny(
+        [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
+      if (modifiers.constKeyword == null &&
+          modifiers.finalKeyword == null &&
+          modifiers.varKeyword == null) {
+        _reportErrorForCurrentToken(
+            ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
-      return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), null);
+      return _parseInitializedIdentifierList(
+          commentAndMetadata,
+          modifiers.staticKeyword,
+          _validateModifiersForField(modifiers),
+          null);
     }
     TypeName type = parseTypeName();
     if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
-      return _parseGetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
-    } else if (_matchesKeyword(Keyword.SET) && _tokenMatchesIdentifier(_peek())) {
+      return _parseGetter(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          type);
+    } else if (_matchesKeyword(Keyword.SET) &&
+        _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
-      return _parseSetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
+      return _parseSetter(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          type);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
       _validateModifiersForOperator(modifiers);
-      return _parseOperator(commentAndMetadata, modifiers.externalKeyword, type);
+      return _parseOperator(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          type);
     } else if (!_matchesIdentifier()) {
       if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
         //
-        // We appear to have found an incomplete declaration at the end of the class. At this point
-        // it consists of a type name, so we'll treat it as a field declaration with a missing
-        // field name and semicolon.
+        // We appear to have found an incomplete declaration at the end of the
+        // class. At this point it consists of a type name, so we'll treat it as
+        // a field declaration with a missing field name and semicolon.
         //
-        return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), type);
+        return _parseInitializedIdentifierList(
+            commentAndMetadata,
+            modifiers.staticKeyword,
+            _validateModifiersForField(modifiers),
+            type);
       }
       if (_isOperator(_currentToken)) {
         //
-        // We appear to have found an operator declaration without the 'operator' keyword.
+        // We appear to have found an operator declaration without the
+        // 'operator' keyword.
         //
         _validateModifiersForOperator(modifiers);
-        return _parseOperator(commentAndMetadata, modifiers.externalKeyword, type);
+        return _parseOperator(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            type);
       }
       //
-      // We appear to have found an incomplete declaration before another declaration.
-      // At this point it consists of a type name, so we'll treat it as a field declaration
-      // with a missing field name and semicolon.
+      // We appear to have found an incomplete declaration before another
+      // declaration. At this point it consists of a type name, so we'll treat
+      // it as a field declaration with a missing field name and semicolon.
       //
-      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
+      _reportErrorForToken(
+          ParserErrorCode.EXPECTED_CLASS_MEMBER,
+          _currentToken);
       try {
         _lockErrorListener();
-        return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), type);
+        return _parseInitializedIdentifierList(
+            commentAndMetadata,
+            modifiers.staticKeyword,
+            _validateModifiersForField(modifiers),
+            type);
       } finally {
         _unlockErrorListener();
       }
@@ -2007,20 +2851,84 @@
       FormalParameterList parameters = parseFormalParameterList();
       if (methodName.name == className) {
         _reportErrorForNode(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type);
-        return _parseConstructor(commentAndMetadata, modifiers.externalKeyword, _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName, null, null, parameters);
+        return _parseConstructor(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            _validateModifiersForConstructor(modifiers),
+            modifiers.factoryKeyword,
+            methodName,
+            null,
+            null,
+            parameters);
       }
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
       _validateFormalParameterList(parameters);
-      return _parseMethodDeclarationAfterParameters(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type, methodName, parameters);
+      return _parseMethodDeclarationAfterParameters(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          type,
+          methodName,
+          parameters);
     } else if (_tokenMatches(_peek(), TokenType.OPEN_CURLY_BRACKET)) {
-      // We have found "TypeName identifier {", and are guessing that this is a getter without the
-      // keyword 'get'.
+      // We have found "TypeName identifier {", and are guessing that this is a
+      // getter without the keyword 'get'.
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_GET);
-      _currentToken = _injectToken(new Parser_SyntheticKeywordToken(Keyword.GET, _currentToken.offset));
-      return _parseGetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
+      _currentToken = _injectToken(
+          new Parser_SyntheticKeywordToken(Keyword.GET, _currentToken.offset));
+      return _parseGetter(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          type);
     }
-    return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), type);
+    return _parseInitializedIdentifierList(
+        commentAndMetadata,
+        modifiers.staticKeyword,
+        _validateModifiersForField(modifiers),
+        type);
+  }
+
+  /**
+   * Parse a single import combinator.  If no combinator is found, return
+   * `null`.
+   *
+   * <pre>
+   * combinator ::=
+   *     'show' identifier (',' identifier)*
+   *   | 'hide' identifier (',' identifier)*
+   * </pre>
+   */
+  Combinator parseCombinator() {
+    if (_matchesString(_SHOW) || _matchesString(_HIDE)) {
+      Token keyword = andAdvance;
+      List<SimpleIdentifier> names = _parseIdentifierList();
+      if (keyword.lexeme == _SHOW) {
+        return new ShowCombinator(keyword, names);
+      } else {
+        return new HideCombinator(keyword, names);
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Parse a compilation unit, starting with the given token.
+   *
+   * @param token the first token of the compilation unit
+   * @return the compilation unit that was parsed
+   */
+  CompilationUnit parseCompilationUnit(Token token) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.Parser.parseCompilationUnit");
+    try {
+      _currentToken = token;
+      return parseCompilationUnit2();
+    } finally {
+      instrumentation.log2(2);
+      //Record if >= 2ms
+    }
   }
 
   /**
@@ -2052,30 +2960,42 @@
       scriptTag = new ScriptTag(andAdvance);
     }
     //
-    // Even though all directives must appear before declarations and must occur in a given order,
-    // we allow directives and declarations to occur in any order so that we can recover better.
+    // Even though all directives must appear before declarations and must occur
+    // in a given order, we allow directives and declarations to occur in any
+    // order so that we can recover better.
     //
     bool libraryDirectiveFound = false;
     bool partOfDirectiveFound = false;
     bool partDirectiveFound = false;
     bool directiveFoundAfterDeclaration = false;
     List<Directive> directives = new List<Directive>();
-    List<CompilationUnitMember> declarations = new List<CompilationUnitMember>();
+    List<CompilationUnitMember> declarations =
+        new List<CompilationUnitMember>();
     Token memberStart = _currentToken;
     while (!_matches(TokenType.EOF)) {
       CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata();
-      if ((_matchesKeyword(Keyword.IMPORT) || _matchesKeyword(Keyword.EXPORT) || _matchesKeyword(Keyword.LIBRARY) || _matchesKeyword(Keyword.PART)) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+      if ((_matchesKeyword(Keyword.IMPORT) ||
+          _matchesKeyword(Keyword.EXPORT) ||
+          _matchesKeyword(Keyword.LIBRARY) ||
+          _matchesKeyword(Keyword.PART)) &&
+          !_tokenMatches(_peek(), TokenType.PERIOD) &&
+          !_tokenMatches(_peek(), TokenType.LT) &&
+          !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
         Directive directive = _parseDirective(commentAndMetadata);
         if (declarations.length > 0 && !directiveFoundAfterDeclaration) {
-          _reportErrorForCurrentToken(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DIRECTIVE_AFTER_DECLARATION);
           directiveFoundAfterDeclaration = true;
         }
         if (directive is LibraryDirective) {
           if (libraryDirectiveFound) {
-            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES);
           } else {
             if (directives.length > 0) {
-              _reportErrorForToken(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, directive.libraryToken);
+              _reportErrorForToken(
+                  ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST,
+                  directive.libraryToken);
             }
             libraryDirectiveFound = true;
           }
@@ -2083,46 +3003,68 @@
           partDirectiveFound = true;
         } else if (partDirectiveFound) {
           if (directive is ExportDirective) {
-            _reportErrorForToken(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword);
+            _reportErrorForToken(
+                ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+                directive.keyword);
           } else if (directive is ImportDirective) {
-            _reportErrorForToken(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword);
+            _reportErrorForToken(
+                ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+                directive.keyword);
           }
         }
         if (directive is PartOfDirective) {
           if (partOfDirectiveFound) {
-            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES);
           } else {
             int directiveCount = directives.length;
             for (int i = 0; i < directiveCount; i++) {
-              _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directives[i].keyword);
+              _reportErrorForToken(
+                  ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART,
+                  directives[i].keyword);
             }
             partOfDirectiveFound = true;
           }
         } else {
           if (partOfDirectiveFound) {
-            _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directive.keyword);
+            _reportErrorForToken(
+                ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART,
+                directive.keyword);
           }
         }
         directives.add(directive);
       } else if (_matches(TokenType.SEMICOLON)) {
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
       } else {
-        CompilationUnitMember member = _parseCompilationUnitMember(commentAndMetadata);
+        CompilationUnitMember member =
+            _parseCompilationUnitMember(commentAndMetadata);
         if (member != null) {
           declarations.add(member);
         }
       }
       if (identical(_currentToken, memberStart)) {
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
-        while (!_matches(TokenType.EOF) && !_couldBeStartOfCompilationUnitMember()) {
+        while (!_matches(TokenType.EOF) &&
+            !_couldBeStartOfCompilationUnitMember()) {
           _advance();
         }
       }
       memberStart = _currentToken;
     }
-    return new CompilationUnit(firstToken, scriptTag, directives, declarations, _currentToken);
+    return new CompilationUnit(
+        firstToken,
+        scriptTag,
+        directives,
+        declarations,
+        _currentToken);
   }
 
   /**
@@ -2144,7 +3086,12 @@
     Expression thenExpression = parseExpressionWithoutCascade();
     Token colon = _expect(TokenType.COLON);
     Expression elseExpression = parseExpressionWithoutCascade();
-    return new ConditionalExpression(condition, question, thenExpression, colon, elseExpression);
+    return new ConditionalExpression(
+        condition,
+        question,
+        thenExpression,
+        colon,
+        elseExpression);
   }
 
   /**
@@ -2169,6 +3116,45 @@
   }
 
   /**
+   * Parse the script tag and directives in a compilation unit, starting with the given token, until
+   * the first non-directive is encountered. The remainder of the compilation unit will not be
+   * parsed. Specifically, if there are directives later in the file, they will not be parsed.
+   *
+   * @param token the first token of the compilation unit
+   * @return the compilation unit that was parsed
+   */
+  CompilationUnit parseDirectives(Token token) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.Parser.parseDirectives");
+    try {
+      _currentToken = token;
+      return _parseDirectives();
+    } finally {
+      instrumentation.log2(2);
+      //Record if >= 2ms
+    }
+  }
+
+  /**
+   * Parse an expression, starting with the given token.
+   *
+   * @param token the first token of the expression
+   * @return the expression that was parsed, or `null` if the tokens do not represent a
+   *         recognizable expression
+   */
+  Expression parseExpression(Token token) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.Parser.parseExpression");
+    try {
+      _currentToken = token;
+      return parseExpression2();
+    } finally {
+      instrumentation.log2(2);
+      //Record if >= 2ms
+    }
+  }
+
+  /**
    * Parse an expression that might contain a cascade.
    *
    * <pre>
@@ -2188,9 +3174,10 @@
       return _parseRethrowExpression();
     }
     //
-    // assignableExpression is a subset of conditionalExpression, so we can parse a conditional
-    // expression and then determine whether it is followed by an assignmentOperator, checking for
-    // conformance to the restricted grammar after making that determination.
+    // assignableExpression is a subset of conditionalExpression, so we can
+    // parse a conditional expression and then determine whether it is followed
+    // by an assignmentOperator, checking for conformance to the restricted
+    // grammar after making that determination.
     //
     Expression expression = parseConditionalExpression();
     TokenType tokenType = _currentToken.type;
@@ -2231,15 +3218,19 @@
       return _parseRethrowExpression();
     }
     //
-    // assignableExpression is a subset of conditionalExpression, so we can parse a conditional
-    // expression and then determine whether it is followed by an assignmentOperator, checking for
-    // conformance to the restricted grammar after making that determination.
+    // assignableExpression is a subset of conditionalExpression, so we can
+    // parse a conditional expression and then determine whether it is followed
+    // by an assignmentOperator, checking for conformance to the restricted
+    // grammar after making that determination.
     //
     Expression expression = parseConditionalExpression();
     if (_currentToken.type.isAssignmentOperator) {
       Token operator = andAdvance;
       _ensureAssignable(expression);
-      expression = new AssignmentExpression(expression, operator, parseExpressionWithoutCascade());
+      expression = new AssignmentExpression(
+          expression,
+          operator,
+          parseExpressionWithoutCascade());
     }
     return expression;
   }
@@ -2288,7 +3279,12 @@
   FormalParameterList parseFormalParameterList() {
     Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
     if (_matches(TokenType.CLOSE_PAREN)) {
-      return new FormalParameterList(leftParenthesis, null, null, null, andAdvance);
+      return new FormalParameterList(
+          leftParenthesis,
+          null,
+          null,
+          null,
+          andAdvance);
     }
     //
     // Even though it is invalid to have default parameters outside of brackets,
@@ -2316,11 +3312,16 @@
       if (firstParameter) {
         firstParameter = false;
       } else if (!_optional(TokenType.COMMA)) {
-        // TODO(brianwilkerson) The token is wrong, we need to recover from this case.
+        // TODO(brianwilkerson) The token is wrong, we need to recover from this
+        // case.
         if (_getEndToken(leftParenthesis) != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.EXPECTED_TOKEN,
+              [TokenType.COMMA.lexeme]);
         } else {
-          _reportErrorForToken(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToken.previous);
+          _reportErrorForToken(
+              ParserErrorCode.MISSING_CLOSING_PARENTHESIS,
+              _currentToken.previous);
           break;
         }
       }
@@ -2331,7 +3332,8 @@
       if (_matches(TokenType.OPEN_SQUARE_BRACKET)) {
         wasOptionalParameter = true;
         if (leftSquareBracket != null && !reportedMuliplePositionalGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS);
           reportedMuliplePositionalGroups = true;
         }
         if (leftCurlyBracket != null && !reportedMixedGroups) {
@@ -2344,7 +3346,8 @@
       } else if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
         wasOptionalParameter = true;
         if (leftCurlyBracket != null && !reportedMulipleNamedGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS);
           reportedMulipleNamedGroups = true;
         }
         if (leftSquareBracket != null && !reportedMixedGroups) {
@@ -2362,22 +3365,29 @@
       parameters.add(parameter);
       currentParameters.add(parameter);
       if (kind == ParameterKind.REQUIRED && wasOptionalParameter) {
-        _reportErrorForNode(ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter);
+        _reportErrorForNode(
+            ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS,
+            parameter);
       }
       //
       // Handle the end of parameter groups.
       //
-      // TODO(brianwilkerson) Improve the detection and reporting of missing and mismatched delimiters.
+      // TODO(brianwilkerson) Improve the detection and reporting of missing and
+      // mismatched delimiters.
       if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) {
         rightSquareBracket = andAdvance;
         currentParameters = normalParameters;
         if (leftSquareBracket == null) {
           if (leftCurlyBracket != null) {
-            _reportErrorForCurrentToken(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
+                ["}"]);
             rightCurlyBracket = rightSquareBracket;
             rightSquareBracket = null;
           } else {
-            _reportErrorForCurrentToken(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, ["["]);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
+                ["["]);
           }
         }
         kind = ParameterKind.REQUIRED;
@@ -2386,25 +3396,34 @@
         currentParameters = normalParameters;
         if (leftCurlyBracket == null) {
           if (leftSquareBracket != null) {
-            _reportErrorForCurrentToken(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
+                ["]"]);
             rightSquareBracket = rightCurlyBracket;
             rightCurlyBracket = null;
           } else {
-            _reportErrorForCurrentToken(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, ["{"]);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
+                ["{"]);
           }
         }
         kind = ParameterKind.REQUIRED;
       }
-    } while (!_matches(TokenType.CLOSE_PAREN) && !identical(initialToken, _currentToken));
+    } while (!_matches(TokenType.CLOSE_PAREN) &&
+        !identical(initialToken, _currentToken));
     Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
     //
     // Check that the groups were closed correctly.
     //
     if (leftSquareBracket != null && rightSquareBracket == null) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
+          ["]"]);
     }
     if (leftCurlyBracket != null && rightCurlyBracket == null) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
+          ["}"]);
     }
     //
     // Build the parameter list.
@@ -2415,7 +3434,12 @@
     if (rightSquareBracket == null) {
       rightSquareBracket = rightCurlyBracket;
     }
-    return new FormalParameterList(leftParenthesis, parameters, leftSquareBracket, rightSquareBracket, rightParenthesis);
+    return new FormalParameterList(
+        leftParenthesis,
+        parameters,
+        leftSquareBracket,
+        rightSquareBracket,
+        rightParenthesis);
   }
 
   /**
@@ -2431,7 +3455,8 @@
   FunctionExpression parseFunctionExpression() {
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
-    FunctionBody body = _parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, true);
+    FunctionBody body =
+        _parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, true);
     return new FunctionExpression(parameters, body);
   }
 
@@ -2505,7 +3530,8 @@
     Expression expression = _parseLogicalAndExpression();
     while (_matches(TokenType.BAR_BAR)) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseLogicalAndExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseLogicalAndExpression());
     }
     return expression;
   }
@@ -2562,25 +3588,56 @@
       FormalParameterList parameters = parseFormalParameterList();
       if (thisKeyword == null) {
         if (holder.keyword != null) {
-          _reportErrorForToken(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword);
+          _reportErrorForToken(
+              ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR,
+              holder.keyword);
         }
-        return new FunctionTypedFormalParameter(commentAndMetadata.comment, commentAndMetadata.metadata, holder.type, identifier, parameters);
+        return new FunctionTypedFormalParameter(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            holder.type,
+            identifier,
+            parameters);
       } else {
-        return new FieldFormalParameter(commentAndMetadata.comment, commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier, parameters);
+        return new FieldFormalParameter(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            holder.keyword,
+            holder.type,
+            thisKeyword,
+            period,
+            identifier,
+            parameters);
       }
     }
     TypeName type = holder.type;
     if (type != null) {
       if (_tokenMatchesKeyword(type.name.beginToken, Keyword.VOID)) {
-        _reportErrorForToken(ParserErrorCode.VOID_PARAMETER, type.name.beginToken);
-      } else if (holder.keyword != null && _tokenMatchesKeyword(holder.keyword, Keyword.VAR)) {
+        _reportErrorForToken(
+            ParserErrorCode.VOID_PARAMETER,
+            type.name.beginToken);
+      } else if (holder.keyword != null &&
+          _tokenMatchesKeyword(holder.keyword, Keyword.VAR)) {
         _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, holder.keyword);
       }
     }
     if (thisKeyword != null) {
-      return new FieldFormalParameter(commentAndMetadata.comment, commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier, null);
+      return new FieldFormalParameter(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          holder.keyword,
+          holder.type,
+          thisKeyword,
+          period,
+          identifier,
+          null);
     }
-    return new SimpleFormalParameter(commentAndMetadata.comment, commentAndMetadata.metadata, holder.keyword, holder.type, identifier);
+    return new SimpleFormalParameter(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        holder.keyword,
+        holder.type,
+        identifier);
   }
 
   /**
@@ -2641,6 +3698,25 @@
   }
 
   /**
+   * Parse a statement, starting with the given token.
+   *
+   * @param token the first token of the statement
+   * @return the statement that was parsed, or `null` if the tokens do not represent a
+   *         recognizable statement
+   */
+  Statement parseStatement(Token token) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.Parser.parseStatement");
+    try {
+      _currentToken = token;
+      return parseStatement2();
+    } finally {
+      instrumentation.log2(2);
+      //Record if >= 2ms
+    }
+  }
+
+  /**
    * Parse a statement.
    *
    * <pre>
@@ -2663,6 +3739,25 @@
   }
 
   /**
+   * Parse a sequence of statements, starting with the given token.
+   *
+   * @param token the first token of the sequence of statement
+   * @return the statements that were parsed, or `null` if the tokens do not represent a
+   *         recognizable sequence of statements
+   */
+  List<Statement> parseStatements(Token token) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.Parser.parseStatements");
+    try {
+      _currentToken = token;
+      return _parseStatementList();
+    } finally {
+      instrumentation.log2(2);
+      //Record if >= 2ms
+    }
+  }
+
+  /**
    * Parse a string literal.
    *
    * <pre>
@@ -2677,10 +3772,14 @@
     List<StringLiteral> strings = new List<StringLiteral>();
     while (_matches(TokenType.STRING)) {
       Token string = andAdvance;
-      if (_matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
+      if (_matches(TokenType.STRING_INTERPOLATION_EXPRESSION) ||
+          _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
         strings.add(_parseStringInterpolation(string));
       } else {
-        strings.add(new SimpleStringLiteral(string, _computeStringValue(string.lexeme, true, true)));
+        strings.add(
+            new SimpleStringLiteral(
+                string,
+                _computeStringValue(string.lexeme, true, true)));
       }
     }
     if (strings.length < 1) {
@@ -2761,9 +3860,19 @@
     if (_matchesKeyword(Keyword.EXTENDS)) {
       Token keyword = andAdvance;
       TypeName bound = parseTypeName();
-      return new TypeParameter(commentAndMetadata.comment, commentAndMetadata.metadata, name, keyword, bound);
+      return new TypeParameter(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          name,
+          keyword,
+          bound);
     }
-    return new TypeParameter(commentAndMetadata.comment, commentAndMetadata.metadata, name, null, null);
+    return new TypeParameter(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        name,
+        null,
+        null);
   }
 
   /**
@@ -2807,10 +3916,6 @@
     return new WithClause(with2, types);
   }
 
-  void set currentToken(Token currentToken) {
-    this._currentToken = currentToken;
-  }
-
   /**
    * Advance to the next token in the token stream.
    */
@@ -2829,9 +3934,14 @@
    * @param startIndex the index of the first character representing the scalar value
    * @param endIndex the index of the last character representing the scalar value
    */
-  void _appendScalarValue(StringBuffer buffer, String escapeSequence, int scalarValue, int startIndex, int endIndex) {
-    if (scalarValue < 0 || scalarValue > Character.MAX_CODE_POINT || (scalarValue >= 0xD800 && scalarValue <= 0xDFFF)) {
-      _reportErrorForCurrentToken(ParserErrorCode.INVALID_CODE_POINT, [escapeSequence]);
+  void _appendScalarValue(StringBuffer buffer, String escapeSequence,
+      int scalarValue, int startIndex, int endIndex) {
+    if (scalarValue < 0 ||
+        scalarValue > Character.MAX_CODE_POINT ||
+        (scalarValue >= 0xD800 && scalarValue <= 0xDFFF)) {
+      _reportErrorForCurrentToken(
+          ParserErrorCode.INVALID_CODE_POINT,
+          [escapeSequence]);
       return;
     }
     if (scalarValue < Character.MAX_VALUE) {
@@ -2853,28 +3963,35 @@
     bool isRaw = false;
     int start = 0;
     if (first) {
-      if (StringUtilities.startsWith4(lexeme, 0, 0x72, 0x22, 0x22, 0x22) || StringUtilities.startsWith4(lexeme, 0, 0x72, 0x27, 0x27, 0x27)) {
+      if (StringUtilities.startsWith4(lexeme, 0, 0x72, 0x22, 0x22, 0x22) ||
+          StringUtilities.startsWith4(lexeme, 0, 0x72, 0x27, 0x27, 0x27)) {
         isRaw = true;
         start += 4;
-      } else if (StringUtilities.startsWith2(lexeme, 0, 0x72, 0x22) || StringUtilities.startsWith2(lexeme, 0, 0x72, 0x27)) {
+      } else if (StringUtilities.startsWith2(lexeme, 0, 0x72, 0x22) ||
+          StringUtilities.startsWith2(lexeme, 0, 0x72, 0x27)) {
         isRaw = true;
         start += 2;
-      } else if (StringUtilities.startsWith3(lexeme, 0, 0x22, 0x22, 0x22) || StringUtilities.startsWith3(lexeme, 0, 0x27, 0x27, 0x27)) {
+      } else if (StringUtilities.startsWith3(lexeme, 0, 0x22, 0x22, 0x22) ||
+          StringUtilities.startsWith3(lexeme, 0, 0x27, 0x27, 0x27)) {
         start += 3;
-      } else if (StringUtilities.startsWithChar(lexeme, 0x22) || StringUtilities.startsWithChar(lexeme, 0x27)) {
+      } else if (StringUtilities.startsWithChar(lexeme, 0x22) ||
+          StringUtilities.startsWithChar(lexeme, 0x27)) {
         start += 1;
       }
     }
     int end = lexeme.length;
     if (last) {
-      if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) || StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) {
+      if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) ||
+          StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) {
         end -= 3;
-      } else if (StringUtilities.endsWithChar(lexeme, 0x22) || StringUtilities.endsWithChar(lexeme, 0x27)) {
+      } else if (StringUtilities.endsWithChar(lexeme, 0x22) ||
+          StringUtilities.endsWithChar(lexeme, 0x27)) {
         end -= 1;
       }
     }
     if (end - start + 1 < 0) {
-      AnalysisEngine.instance.logger.logError("Internal error: computeStringValue($lexeme, $first, $last)");
+      AnalysisEngine.instance.logger.logError(
+          "Internal error: computeStringValue($lexeme, $first, $last)");
       return "";
     }
     if (isRaw) {
@@ -2895,7 +4012,15 @@
    * @return the function declaration that most closely captures the components of the given method
    *         declaration
    */
-  FunctionDeclaration _convertToFunctionDeclaration(MethodDeclaration method) => new FunctionDeclaration(method.documentationComment, method.metadata, method.externalKeyword, method.returnType, method.propertyKeyword, method.name, new FunctionExpression(method.parameters, method.body));
+  FunctionDeclaration _convertToFunctionDeclaration(MethodDeclaration method) =>
+      new FunctionDeclaration(
+          method.documentationComment,
+          method.metadata,
+          method.externalKeyword,
+          method.returnType,
+          method.propertyKeyword,
+          method.name,
+          new FunctionExpression(method.parameters, method.body));
 
   /**
    * Return `true` if the current token could be the start of a compilation unit member. This
@@ -2905,16 +4030,26 @@
    * @return `true` if the current token could be the start of a compilation unit member
    */
   bool _couldBeStartOfCompilationUnitMember() {
-    if ((_matchesKeyword(Keyword.IMPORT) || _matchesKeyword(Keyword.EXPORT) || _matchesKeyword(Keyword.LIBRARY) || _matchesKeyword(Keyword.PART)) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT)) {
+    if ((_matchesKeyword(Keyword.IMPORT) ||
+        _matchesKeyword(Keyword.EXPORT) ||
+        _matchesKeyword(Keyword.LIBRARY) ||
+        _matchesKeyword(Keyword.PART)) &&
+        !_tokenMatches(_peek(), TokenType.PERIOD) &&
+        !_tokenMatches(_peek(), TokenType.LT)) {
       // This looks like the start of a directive
       return true;
     } else if (_matchesKeyword(Keyword.CLASS)) {
       // This looks like the start of a class definition
       return true;
-    } else if (_matchesKeyword(Keyword.TYPEDEF) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT)) {
+    } else if (_matchesKeyword(Keyword.TYPEDEF) &&
+        !_tokenMatches(_peek(), TokenType.PERIOD) &&
+        !_tokenMatches(_peek(), TokenType.LT)) {
       // This looks like the start of a typedef
       return true;
-    } else if (_matchesKeyword(Keyword.VOID) || ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && _tokenMatchesIdentifier(_peek())) || (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek()))) {
+    } else if (_matchesKeyword(Keyword.VOID) ||
+        ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) &&
+            _tokenMatchesIdentifier(_peek())) ||
+        (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek()))) {
       // This looks like the start of a function
       return true;
     } else if (_matchesIdentifier()) {
@@ -2926,7 +4061,10 @@
       if (token == null) {
         return false;
       }
-      if (_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET) || (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) || _matchesIdentifier()) {
+      if (_matchesKeyword(Keyword.GET) ||
+          _matchesKeyword(Keyword.SET) ||
+          (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) ||
+          _matchesIdentifier()) {
         return true;
       }
     }
@@ -2942,10 +4080,15 @@
     Token syntheticToken;
     if (_currentToken.type == TokenType.KEYWORD) {
       // Consider current keyword token as an identifier.
-      // It is not always true, e.g. "^is T" where "^" is place the place for synthetic identifier.
-      // By creating SyntheticStringToken we can distinguish a real identifier from synthetic.
-      // In the code completion behavior will depend on a cursor position - before or on "is".
-      syntheticToken = _injectToken(new SyntheticStringToken(TokenType.IDENTIFIER, _currentToken.lexeme, _currentToken.offset));
+      // It is not always true, e.g. "^is T" where "^" is place the place for
+      // synthetic identifier. By creating SyntheticStringToken we can
+      // distinguish a real identifier from synthetic. In the code completion
+      // behavior will depend on a cursor position - before or on "is".
+      syntheticToken = _injectToken(
+          new SyntheticStringToken(
+              TokenType.IDENTIFIER,
+              _currentToken.lexeme,
+              _currentToken.offset));
     } else {
       syntheticToken = _createSyntheticToken(TokenType.IDENTIFIER);
     }
@@ -2957,21 +4100,24 @@
    *
    * @return the synthetic token that was created
    */
-  Token _createSyntheticKeyword(Keyword keyword) => _injectToken(new Parser_SyntheticKeywordToken(keyword, _currentToken.offset));
+  Token _createSyntheticKeyword(Keyword keyword) =>
+      _injectToken(new Parser_SyntheticKeywordToken(keyword, _currentToken.offset));
 
   /**
    * Create a synthetic string literal.
    *
    * @return the synthetic string literal that was created
    */
-  SimpleStringLiteral _createSyntheticStringLiteral() => new SimpleStringLiteral(_createSyntheticToken(TokenType.STRING), "");
+  SimpleStringLiteral _createSyntheticStringLiteral() =>
+      new SimpleStringLiteral(_createSyntheticToken(TokenType.STRING), "");
 
   /**
    * Create a synthetic token with the given type.
    *
    * @return the synthetic token that was created
    */
-  Token _createSyntheticToken(TokenType type) => _injectToken(new StringToken(type, "", _currentToken.offset));
+  Token _createSyntheticToken(TokenType type) =>
+      _injectToken(new StringToken(type, "", _currentToken.offset));
 
   /**
    * Check that the given expression is assignable and report an error if it isn't.
@@ -2991,7 +4137,8 @@
    */
   void _ensureAssignable(Expression expression) {
     if (expression != null && !expression.isAssignable) {
-      _reportErrorForCurrentToken(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE);
     }
   }
 
@@ -3010,9 +4157,14 @@
     // Remove uses of this method in favor of matches?
     // Pass in the error code to use to report the error?
     if (type == TokenType.SEMICOLON) {
-      _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [type.lexeme]);
+      _reportErrorForToken(
+          ParserErrorCode.EXPECTED_TOKEN,
+          _currentToken.previous,
+          [type.lexeme]);
     } else {
-      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [type.lexeme]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.EXPECTED_TOKEN,
+          [type.lexeme]);
     }
     return _currentToken;
   }
@@ -3027,7 +4179,9 @@
     if (_matchesGt()) {
       return andAdvance;
     }
-    _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [TokenType.GT.lexeme]);
+    _reportErrorForCurrentToken(
+        ParserErrorCode.EXPECTED_TOKEN,
+        [TokenType.GT.lexeme]);
     return _currentToken;
   }
 
@@ -3044,7 +4198,9 @@
     }
     // Remove uses of this method in favor of matches?
     // Pass in the error code to use to report the error?
-    _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [keyword.syntax]);
+    _reportErrorForCurrentToken(
+        ParserErrorCode.EXPECTED_TOKEN,
+        [keyword.syntax]);
     return _currentToken;
   }
 
@@ -3058,7 +4214,10 @@
     if (_matches(TokenType.SEMICOLON)) {
       return andAdvance;
     } else {
-      _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [";"]);
+      _reportErrorForToken(
+          ParserErrorCode.EXPECTED_TOKEN,
+          _currentToken.previous,
+          [";"]);
       return _createSyntheticToken(TokenType.SEMICOLON);
     }
   }
@@ -3085,17 +4244,6 @@
   }
 
   /**
-   * Advance to the next token in the token stream, making it the new current token.
-   *
-   * @return the token that was current before this method was invoked
-   */
-  Token get andAdvance {
-    Token token = _currentToken;
-    _advance();
-    return token;
-  }
-
-  /**
    * Return a list of the ranges of characters in the given comment string that should be treated as
    * code blocks.
    *
@@ -3113,7 +4261,8 @@
     if (firstChar == 0x2F) {
       int secondChar = comment.codeUnitAt(1);
       int thirdChar = comment.codeUnitAt(2);
-      if ((secondChar == 0x2A && thirdChar == 0x2A) || (secondChar == 0x2F && thirdChar == 0x2F)) {
+      if ((secondChar == 0x2A && thirdChar == 0x2A) ||
+          (secondChar == 0x2F && thirdChar == 0x2F)) {
         index = 3;
       }
     }
@@ -3121,23 +4270,36 @@
       int currentChar = comment.codeUnitAt(index);
       if (currentChar == 0xD || currentChar == 0xA) {
         index = index + 1;
-        while (index < length && Character.isWhitespace(comment.codeUnitAt(index))) {
+        while (index < length &&
+            Character.isWhitespace(comment.codeUnitAt(index))) {
           index = index + 1;
         }
-        if (StringUtilities.startsWith6(comment, index, 0x2A, 0x20, 0x20, 0x20, 0x20, 0x20)) {
+        if (StringUtilities.startsWith6(
+            comment,
+            index,
+            0x2A,
+            0x20,
+            0x20,
+            0x20,
+            0x20,
+            0x20)) {
           int end = index + 6;
-          while (end < length && comment.codeUnitAt(end) != 0xD && comment.codeUnitAt(end) != 0xA) {
+          while (end < length &&
+              comment.codeUnitAt(end) != 0xD &&
+              comment.codeUnitAt(end) != 0xA) {
             end = end + 1;
           }
-          ranges.add(<int> [index, end]);
+          ranges.add(<int>[index, end]);
           index = end;
         }
-      } else if (index + 1 < length && currentChar == 0x5B && comment.codeUnitAt(index + 1) == 0x3A) {
+      } else if (index + 1 < length &&
+          currentChar == 0x5B &&
+          comment.codeUnitAt(index + 1) == 0x3A) {
         int end = StringUtilities.indexOf2(comment, index + 2, 0x3A, 0x5D);
         if (end < 0) {
           end = length;
         }
-        ranges.add(<int> [index, end]);
+        ranges.add(<int>[index, end]);
         index = end + 1;
       } else {
         index = index + 1;
@@ -3161,23 +4323,6 @@
   }
 
   /**
-   * Return `true` if the current token is the first token of a return type that is followed
-   * by an identifier, possibly followed by a list of type parameters, followed by a
-   * left-parenthesis. This is used by parseTypeAlias to determine whether or not to parse a return
-   * type.
-   *
-   * @return `true` if we can successfully parse the rest of a type alias if we first parse a
-   *         return type.
-   */
-  bool get hasReturnTypeInTypeAlias {
-    Token next = _skipReturnType(_currentToken);
-    if (next == null) {
-      return false;
-    }
-    return _tokenMatchesIdentifier(next);
-  }
-
-  /**
    * Inject the given token into the token stream immediately before the current token.
    *
    * @param token the token to be added to the token stream
@@ -3223,15 +4368,15 @@
       if (afterName == null) {
         return false;
       }
-      return _tokenMatches(afterName, TokenType.FUNCTION)
-          || _tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
+      return _tokenMatches(afterName, TokenType.FUNCTION) ||
+          _tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
     } else if (_tokenMatchesKeyword(afterReturnType, Keyword.GET)) {
       Token afterName = _skipSimpleIdentifier(afterReturnType.next);
       if (afterName == null) {
         return false;
       }
-      return _tokenMatches(afterName, TokenType.FUNCTION)
-          || _tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
+      return _tokenMatches(afterName, TokenType.FUNCTION) ||
+          _tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
     }
     return false;
   }
@@ -3251,7 +4396,8 @@
     if (afterParameters == null) {
       return false;
     }
-    if (afterParameters.matchesAny([TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
+    if (afterParameters.matchesAny(
+        [TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
       return true;
     }
     if (_parseAsync) {
@@ -3267,7 +4413,10 @@
    * @param character the character being tested
    * @return `true` if the character is a valid hexadecimal digit
    */
-  bool _isHexDigit(int character) => (0x30 <= character && character <= 0x39) || (0x41 <= character && character <= 0x46) || (0x61 <= character && character <= 0x66);
+  bool _isHexDigit(int character) =>
+      (0x30 <= character && character <= 0x39) ||
+          (0x41 <= character && character <= 0x46) ||
+          (0x61 <= character && character <= 0x66);
 
   /**
    * Return `true` if the current token is the first token in an initialized variable
@@ -3299,19 +4448,22 @@
    */
   bool _isInitializedVariableDeclaration() {
     if (_matchesKeyword(Keyword.FINAL) || _matchesKeyword(Keyword.VAR)) {
-      // An expression cannot start with a keyword other than 'const', 'rethrow', or 'throw'.
+      // An expression cannot start with a keyword other than 'const',
+      // 'rethrow', or 'throw'.
       return true;
     }
     if (_matchesKeyword(Keyword.CONST)) {
-      // Look to see whether we might be at the start of a list or map literal, otherwise this
-      // should be the start of a variable declaration.
-      return !_peek().matchesAny([
-          TokenType.LT,
-          TokenType.OPEN_CURLY_BRACKET,
-          TokenType.OPEN_SQUARE_BRACKET,
-          TokenType.INDEX]);
+      // Look to see whether we might be at the start of a list or map literal,
+      // otherwise this should be the start of a variable declaration.
+      return !_peek().matchesAny(
+          [
+              TokenType.LT,
+              TokenType.OPEN_CURLY_BRACKET,
+              TokenType.OPEN_SQUARE_BRACKET,
+              TokenType.INDEX]);
     }
-    // We know that we have an identifier, and need to see whether it might be a type name.
+    // We know that we have an identifier, and need to see whether it might be
+    // a type name.
     Token token = _skipTypeName(_currentToken);
     if (token == null) {
       // There was no type name, so this can't be a declaration.
@@ -3322,7 +4474,10 @@
       return false;
     }
     TokenType type = token.type;
-    return type == TokenType.EQ || type == TokenType.COMMA || type == TokenType.SEMICOLON || _tokenMatchesKeyword(token, Keyword.IN);
+    return type == TokenType.EQ ||
+        type == TokenType.COMMA ||
+        type == TokenType.SEMICOLON ||
+        _tokenMatchesKeyword(token, Keyword.IN);
   }
 
   /**
@@ -3388,7 +4543,8 @@
    */
   bool _isSwitchMember() {
     Token token = _currentToken;
-    while (_tokenMatches(token, TokenType.IDENTIFIER) && _tokenMatches(token.next, TokenType.COLON)) {
+    while (_tokenMatches(token, TokenType.IDENTIFIER) &&
+        _tokenMatches(token.next, TokenType.COLON)) {
       token = token.next.next;
     }
     if (token.type == TokenType.KEYWORD) {
@@ -3408,9 +4564,9 @@
       return false;
     } else if (_tokenMatchesIdentifier(token)) {
       return true;
-    } else if (_tokenMatchesKeyword(token, Keyword.THIS)
-        && _tokenMatches(token.next, TokenType.PERIOD)
-        && _tokenMatchesIdentifier(token.next.next)) {
+    } else if (_tokenMatchesKeyword(token, Keyword.THIS) &&
+        _tokenMatches(token.next, TokenType.PERIOD) &&
+        _tokenMatchesIdentifier(token.next.next)) {
       return true;
     } else if (_tokenMatchesKeyword(startToken, Keyword.VOID)) {
       // The keyword 'void' isn't a valid identifier, so it should be assumed to
@@ -3425,30 +4581,6 @@
   }
 
   /**
-   * Compare the given tokens to find the token that appears first in the source being parsed. That
-   * is, return the left-most of all of the tokens. The arguments are allowed to be `null`.
-   * Return the token with the smallest offset, or `null` if there are no arguments or if all
-   * of the arguments are `null`.
-   *
-   * @param tokens the tokens being compared
-   * @return the token with the smallest offset
-   */
-  Token _lexicallyFirst(List<Token> tokens) {
-    Token first = null;
-    int firstOffset = 2147483647;
-    for (Token token in tokens) {
-      if (token != null) {
-        int offset = token.offset;
-        if (offset < firstOffset) {
-          first = token;
-          firstOffset = offset;
-        }
-      }
-    }
-    return first;
-  }
-
-  /**
    * Increments the error reporting lock level. If level is more than `0`, then
    * [reportError] wont report any error.
    */
@@ -3525,7 +4657,8 @@
    * @param keyword the keyword that can optionally appear in the current location
    * @return `true` if the current token matches the given keyword
    */
-  bool _matchesKeyword(Keyword keyword) => _tokenMatchesKeyword(_currentToken, keyword);
+  bool _matchesKeyword(Keyword keyword) =>
+      _tokenMatchesKeyword(_currentToken, keyword);
 
   /**
    * Return `true` if the current token matches the given identifier.
@@ -3533,7 +4666,9 @@
    * @param identifier the identifier that can optionally appear in the current location
    * @return `true` if the current token matches the given identifier
    */
-  bool _matchesString(String identifier) => _currentToken.type == TokenType.IDENTIFIER && _currentToken.lexeme == identifier;
+  bool _matchesString(String identifier) =>
+      _currentToken.type == TokenType.IDENTIFIER &&
+          _currentToken.lexeme == identifier;
 
   /**
    * If the current token has the given type, then advance to the next token and return `true`
@@ -3564,14 +4699,16 @@
    */
   Expression _parseAdditiveExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _currentToken.next.type.isAdditiveOperator) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _currentToken.next.type.isAdditiveOperator) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseMultiplicativeExpression();
     }
     while (_currentToken.type.isAdditiveOperator) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseMultiplicativeExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseMultiplicativeExpression());
     }
     return expression;
   }
@@ -3591,17 +4728,30 @@
     Token leftParen = _expect(TokenType.OPEN_PAREN);
     Expression expression = parseExpression2();
     if (expression is AssignmentExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, expression);
+      _reportErrorForNode(
+          ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT,
+          expression);
     } else if (expression is CascadeExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, expression);
+      _reportErrorForNode(
+          ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE,
+          expression);
     } else if (expression is ThrowExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, expression);
+      _reportErrorForNode(
+          ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW,
+          expression);
     } else if (expression is RethrowExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, expression);
+      _reportErrorForNode(
+          ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW,
+          expression);
     }
     Token rightParen = _expect(TokenType.CLOSE_PAREN);
     Token semicolon = _expect(TokenType.SEMICOLON);
-    return new AssertStatement(keyword, leftParen, expression, rightParen, semicolon);
+    return new AssertStatement(
+        keyword,
+        leftParen,
+        expression,
+        rightParen,
+        semicolon);
   }
 
   /**
@@ -3623,9 +4773,9 @@
       return _parseAssignableSelector(new SuperExpression(andAdvance), false);
     }
     //
-    // A primary expression can start with an identifier. We resolve the ambiguity by determining
-    // whether the primary consists of anything other than an identifier and/or is followed by an
-    // assignableSelector.
+    // A primary expression can start with an identifier. We resolve the
+    // ambiguity by determining whether the primary consists of anything other
+    // than an identifier and/or is followed by an assignableSelector.
     //
     Expression expression = _parsePrimaryExpression();
     bool isOptional = primaryAllowed || expression is SimpleIdentifier;
@@ -3633,25 +4783,40 @@
       while (_matches(TokenType.OPEN_PAREN)) {
         ArgumentList argumentList = parseArgumentList();
         if (expression is SimpleIdentifier) {
-          expression = new MethodInvocation(null, null, expression as SimpleIdentifier, argumentList);
+          expression =
+              new MethodInvocation(null, null, expression as SimpleIdentifier, argumentList);
         } else if (expression is PrefixedIdentifier) {
           PrefixedIdentifier identifier = expression as PrefixedIdentifier;
-          expression = new MethodInvocation(identifier.prefix, identifier.period, identifier.identifier, argumentList);
+          expression = new MethodInvocation(
+              identifier.prefix,
+              identifier.period,
+              identifier.identifier,
+              argumentList);
         } else if (expression is PropertyAccess) {
           PropertyAccess access = expression as PropertyAccess;
-          expression = new MethodInvocation(access.target, access.operator, access.propertyName, argumentList);
+          expression = new MethodInvocation(
+              access.target,
+              access.operator,
+              access.propertyName,
+              argumentList);
         } else {
-          expression = new FunctionExpressionInvocation(expression, argumentList);
+          expression =
+              new FunctionExpressionInvocation(expression, argumentList);
         }
         if (!primaryAllowed) {
           isOptional = false;
         }
       }
-      Expression selectorExpression = _parseAssignableSelector(expression, isOptional || (expression is PrefixedIdentifier));
+      Expression selectorExpression = _parseAssignableSelector(
+          expression,
+          isOptional || (expression is PrefixedIdentifier));
       if (identical(selectorExpression, expression)) {
         if (!isOptional && (expression is PrefixedIdentifier)) {
           PrefixedIdentifier identifier = expression as PrefixedIdentifier;
-          expression = new PropertyAccess(identifier.prefix, identifier.period, identifier.identifier);
+          expression = new PropertyAccess(
+              identifier.prefix,
+              identifier.period,
+              identifier.identifier);
         }
         return expression;
       }
@@ -3682,7 +4847,11 @@
       try {
         Expression index = parseExpression2();
         Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET);
-        return new IndexExpression.forTarget(prefix, leftBracket, index, rightBracket);
+        return new IndexExpression.forTarget(
+            prefix,
+            leftBracket,
+            index,
+            rightBracket);
       } finally {
         _inInitializer = wasInInitializer;
       }
@@ -3692,7 +4861,8 @@
     } else {
       if (!optional) {
         // Report the missing selector.
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR);
+        _reportErrorForCurrentToken(
+            ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR);
       }
       return prefix;
     }
@@ -3727,14 +4897,16 @@
    */
   Expression _parseBitwiseAndExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _tokenMatches(_peek(), TokenType.AMPERSAND)) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _tokenMatches(_peek(), TokenType.AMPERSAND)) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseShiftExpression();
     }
     while (_matches(TokenType.AMPERSAND)) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseShiftExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseShiftExpression());
     }
     return expression;
   }
@@ -3752,14 +4924,16 @@
    */
   Expression _parseBitwiseXorExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _tokenMatches(_peek(), TokenType.CARET)) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _tokenMatches(_peek(), TokenType.CARET)) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseBitwiseAndExpression();
     }
     while (_matches(TokenType.CARET)) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseBitwiseAndExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseBitwiseAndExpression());
     }
     return expression;
   }
@@ -3817,27 +4991,38 @@
       try {
         Expression index = parseExpression2();
         Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET);
-        expression = new IndexExpression.forCascade(period, leftBracket, index, rightBracket);
+        expression =
+            new IndexExpression.forCascade(period, leftBracket, index, rightBracket);
         period = null;
       } finally {
         _inInitializer = wasInInitializer;
       }
     } else {
-      _reportErrorForToken(ParserErrorCode.MISSING_IDENTIFIER, _currentToken, [_currentToken.lexeme]);
+      _reportErrorForToken(
+          ParserErrorCode.MISSING_IDENTIFIER,
+          _currentToken,
+          [_currentToken.lexeme]);
       functionName = _createSyntheticIdentifier();
     }
-    assert((expression == null && functionName != null) || (expression != null && functionName == null));
+    assert((expression == null && functionName != null) ||
+        (expression != null && functionName == null));
     if (_currentToken.type == TokenType.OPEN_PAREN) {
       while (_currentToken.type == TokenType.OPEN_PAREN) {
         if (functionName != null) {
-          expression = new MethodInvocation(expression, period, functionName, parseArgumentList());
+          expression =
+              new MethodInvocation(expression, period, functionName, parseArgumentList());
           period = null;
           functionName = null;
         } else if (expression == null) {
           // It should not be possible to get here.
-          expression = new MethodInvocation(expression, period, _createSyntheticIdentifier(), parseArgumentList());
+          expression = new MethodInvocation(
+              expression,
+              period,
+              _createSyntheticIdentifier(),
+              parseArgumentList());
         } else {
-          expression = new FunctionExpressionInvocation(expression, parseArgumentList());
+          expression =
+              new FunctionExpressionInvocation(expression, parseArgumentList());
         }
       }
     } else if (functionName != null) {
@@ -3855,9 +5040,14 @@
         while (_currentToken.type == TokenType.OPEN_PAREN) {
           if (expression is PropertyAccess) {
             PropertyAccess propertyAccess = expression as PropertyAccess;
-            expression = new MethodInvocation(propertyAccess.target, propertyAccess.operator, propertyAccess.propertyName, parseArgumentList());
+            expression = new MethodInvocation(
+                propertyAccess.target,
+                propertyAccess.operator,
+                propertyAccess.propertyName,
+                parseArgumentList());
           } else {
-            expression = new FunctionExpressionInvocation(expression, parseArgumentList());
+            expression =
+                new FunctionExpressionInvocation(expression, parseArgumentList());
           }
         }
       }
@@ -3865,7 +5055,10 @@
     if (_currentToken.type.isAssignmentOperator) {
       Token operator = andAdvance;
       _ensureAssignable(expression);
-      expression = new AssignmentExpression(expression, operator, parseExpressionWithoutCascade());
+      expression = new AssignmentExpression(
+          expression,
+          operator,
+          parseExpressionWithoutCascade());
     }
     return expression;
   }
@@ -3884,17 +5077,25 @@
    *          not given
    * @return the class declaration that was parsed
    */
-  CompilationUnitMember _parseClassDeclaration(CommentAndMetadata commentAndMetadata, Token abstractKeyword) {
+  CompilationUnitMember
+      _parseClassDeclaration(CommentAndMetadata commentAndMetadata,
+      Token abstractKeyword) {
     Token keyword = _expectKeyword(Keyword.CLASS);
     if (_matchesIdentifier()) {
       Token next = _peek();
       if (_tokenMatches(next, TokenType.LT)) {
         next = _skipTypeParameterList(next);
         if (next != null && _tokenMatches(next, TokenType.EQ)) {
-          return _parseClassTypeAlias(commentAndMetadata, abstractKeyword, keyword);
+          return _parseClassTypeAlias(
+              commentAndMetadata,
+              abstractKeyword,
+              keyword);
         }
       } else if (_tokenMatches(next, TokenType.EQ)) {
-        return _parseClassTypeAlias(commentAndMetadata, abstractKeyword, keyword);
+        return _parseClassTypeAlias(
+            commentAndMetadata,
+            abstractKeyword,
+            keyword);
       }
     }
     SimpleIdentifier name = parseSimpleIdentifier();
@@ -3904,8 +5105,9 @@
       typeParameters = parseTypeParameterList();
     }
     //
-    // Parse the clauses. The parser accepts clauses in any order, but will generate errors if they
-    // are not in the order required by the specification.
+    // Parse the clauses. The parser accepts clauses in any order, but will
+    // generate errors if they are not in the order required by the
+    // specification.
     //
     ExtendsClause extendsClause = null;
     WithClause withClause = null;
@@ -3916,39 +5118,55 @@
         if (extendsClause == null) {
           extendsClause = parseExtendsClause();
           if (withClause != null) {
-            _reportErrorForToken(ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKeyword);
+            _reportErrorForToken(
+                ParserErrorCode.WITH_BEFORE_EXTENDS,
+                withClause.withKeyword);
           } else if (implementsClause != null) {
-            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, implementsClause.keyword);
+            _reportErrorForToken(
+                ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS,
+                implementsClause.keyword);
           }
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, extendsClause.keyword);
+          _reportErrorForToken(
+              ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES,
+              extendsClause.keyword);
           parseExtendsClause();
         }
       } else if (_matchesKeyword(Keyword.WITH)) {
         if (withClause == null) {
           withClause = parseWithClause();
           if (implementsClause != null) {
-            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, implementsClause.keyword);
+            _reportErrorForToken(
+                ParserErrorCode.IMPLEMENTS_BEFORE_WITH,
+                implementsClause.keyword);
           }
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKeyword);
+          _reportErrorForToken(
+              ParserErrorCode.MULTIPLE_WITH_CLAUSES,
+              withClause.withKeyword);
           parseWithClause();
-          // TODO(brianwilkerson) Should we merge the list of applied mixins into a single list?
+          // TODO(brianwilkerson) Should we merge the list of applied mixins
+          // into a single list?
         }
       } else if (_matchesKeyword(Keyword.IMPLEMENTS)) {
         if (implementsClause == null) {
           implementsClause = parseImplementsClause();
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsClause.keyword);
+          _reportErrorForToken(
+              ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES,
+              implementsClause.keyword);
           parseImplementsClause();
-          // TODO(brianwilkerson) Should we merge the list of implemented classes into a single list?
+          // TODO(brianwilkerson) Should we merge the list of implemented
+          // classes into a single list?
         }
       } else {
         foundClause = false;
       }
     }
     if (withClause != null && extendsClause == null) {
-      _reportErrorForToken(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.WITH_WITHOUT_EXTENDS,
+          withClause.withKeyword);
     }
     //
     // Look for and skip over the extra-lingual 'native' specification.
@@ -3972,7 +5190,19 @@
       rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_CLASS_BODY);
     }
-    ClassDeclaration classDeclaration = new ClassDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, withClause, implementsClause, leftBracket, members, rightBracket);
+    ClassDeclaration classDeclaration = new ClassDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        abstractKeyword,
+        keyword,
+        name,
+        typeParameters,
+        extendsClause,
+        withClause,
+        implementsClause,
+        leftBracket,
+        members,
+        rightBracket);
     classDeclaration.nativeClause = nativeClause;
     return classDeclaration;
   }
@@ -3993,9 +5223,15 @@
   List<ClassMember> _parseClassMembers(String className, Token closingBracket) {
     List<ClassMember> members = new List<ClassMember>();
     Token memberStart = _currentToken;
-    while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET) && (closingBracket != null || (!_matchesKeyword(Keyword.CLASS) && !_matchesKeyword(Keyword.TYPEDEF)))) {
+    while (!_matches(TokenType.EOF) &&
+        !_matches(TokenType.CLOSE_CURLY_BRACKET) &&
+        (closingBracket != null ||
+            (!_matchesKeyword(Keyword.CLASS) && !_matchesKeyword(Keyword.TYPEDEF)))) {
       if (_matches(TokenType.SEMICOLON)) {
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
       } else {
         ClassMember member = parseClassMember(className);
@@ -4004,7 +5240,10 @@
         }
       }
       if (identical(_currentToken, memberStart)) {
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
       }
       memberStart = _currentToken;
@@ -4028,7 +5267,8 @@
    * @param classKeyword the token representing the 'class' keyword
    * @return the class type alias that was parsed
    */
-  ClassTypeAlias _parseClassTypeAlias(CommentAndMetadata commentAndMetadata, Token abstractKeyword, Token classKeyword) {
+  ClassTypeAlias _parseClassTypeAlias(CommentAndMetadata commentAndMetadata,
+      Token abstractKeyword, Token classKeyword) {
     SimpleIdentifier className = parseSimpleIdentifier();
     TypeParameterList typeParameters = null;
     if (_matches(TokenType.LT)) {
@@ -4040,7 +5280,9 @@
     if (_matchesKeyword(Keyword.WITH)) {
       withClause = parseWithClause();
     } else {
-      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [Keyword.WITH.syntax]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.EXPECTED_TOKEN,
+          [Keyword.WITH.syntax]);
     }
     ImplementsClause implementsClause = null;
     if (_matchesKeyword(Keyword.IMPLEMENTS)) {
@@ -4051,16 +5293,32 @@
       semicolon = andAdvance;
     } else {
       if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
-        _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [TokenType.SEMICOLON.lexeme]);
+        _reportErrorForCurrentToken(
+            ParserErrorCode.EXPECTED_TOKEN,
+            [TokenType.SEMICOLON.lexeme]);
         Token leftBracket = andAdvance;
         _parseClassMembers(className.name, _getEndToken(leftBracket));
         _expect(TokenType.CLOSE_CURLY_BRACKET);
       } else {
-        _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [TokenType.SEMICOLON.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.EXPECTED_TOKEN,
+            _currentToken.previous,
+            [TokenType.SEMICOLON.lexeme]);
       }
       semicolon = _createSyntheticToken(TokenType.SEMICOLON);
     }
-    return new ClassTypeAlias(commentAndMetadata.comment, commentAndMetadata.metadata, classKeyword, className, typeParameters, equals, abstractKeyword, superclass, withClause, implementsClause, semicolon);
+    return new ClassTypeAlias(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        classKeyword,
+        className,
+        typeParameters,
+        equals,
+        abstractKeyword,
+        superclass,
+        withClause,
+        implementsClause,
+        semicolon);
   }
 
   /**
@@ -4076,15 +5334,12 @@
    */
   List<Combinator> _parseCombinators() {
     List<Combinator> combinators = new List<Combinator>();
-    while (_matchesString(_SHOW) || _matchesString(_HIDE)) {
-      Token keyword = _expect(TokenType.IDENTIFIER);
-      if (keyword.lexeme == _SHOW) {
-        List<SimpleIdentifier> shownNames = _parseIdentifierList();
-        combinators.add(new ShowCombinator(keyword, shownNames));
-      } else {
-        List<SimpleIdentifier> hiddenNames = _parseIdentifierList();
-        combinators.add(new HideCombinator(keyword, hiddenNames));
+    while (true) {
+      Combinator combinator = parseCombinator();
+      if (combinator == null) {
+        break;
       }
+      combinators.add(combinator);
     }
     return combinators;
   }
@@ -4127,15 +5382,21 @@
    * @param sourceOffset the offset of the first character of the reference source
    * @return the comment reference that was parsed, or `null` if no reference could be found
    */
-  CommentReference _parseCommentReference(String referenceSource, int sourceOffset) {
-    // TODO(brianwilkerson) The errors are not getting the right offset/length and are being duplicated.
+  CommentReference _parseCommentReference(String referenceSource,
+      int sourceOffset) {
+    // TODO(brianwilkerson) The errors are not getting the right offset/length
+    // and are being duplicated.
     if (referenceSource.length == 0) {
-      Token syntheticToken = new SyntheticStringToken(TokenType.IDENTIFIER, "", sourceOffset);
+      Token syntheticToken =
+          new SyntheticStringToken(TokenType.IDENTIFIER, "", sourceOffset);
       return new CommentReference(null, new SimpleIdentifier(syntheticToken));
     }
     try {
       BooleanErrorListener listener = new BooleanErrorListener();
-      Scanner scanner = new Scanner(null, new SubSequenceReader(referenceSource, sourceOffset), listener);
+      Scanner scanner = new Scanner(
+          null,
+          new SubSequenceReader(referenceSource, sourceOffset),
+          listener);
       scanner.setSourceStart(1, 1);
       Token firstToken = scanner.tokenize();
       if (listener.errorReported) {
@@ -4151,8 +5412,12 @@
         Token thirdToken = secondToken.next;
         Token nextToken;
         Identifier identifier;
-        if (_tokenMatches(secondToken, TokenType.PERIOD) && _tokenMatchesIdentifier(thirdToken)) {
-          identifier = new PrefixedIdentifier(new SimpleIdentifier(firstToken), secondToken, new SimpleIdentifier(thirdToken));
+        if (_tokenMatches(secondToken, TokenType.PERIOD) &&
+            _tokenMatchesIdentifier(thirdToken)) {
+          identifier = new PrefixedIdentifier(
+              new SimpleIdentifier(firstToken),
+              secondToken,
+              new SimpleIdentifier(thirdToken));
           nextToken = thirdToken.next;
         } else {
           identifier = new SimpleIdentifier(firstToken);
@@ -4162,11 +5427,15 @@
           return null;
         }
         return new CommentReference(newKeyword, identifier);
-      } else if (_tokenMatchesKeyword(firstToken, Keyword.THIS) || _tokenMatchesKeyword(firstToken, Keyword.NULL) || _tokenMatchesKeyword(firstToken, Keyword.TRUE) || _tokenMatchesKeyword(firstToken, Keyword.FALSE)) {
-        // TODO(brianwilkerson) If we want to support this we will need to extend the definition
-        // of CommentReference to take an expression rather than an identifier. For now we just
-        // ignore it to reduce the number of errors produced, but that's probably not a valid
-        // long term approach.
+      } else if (_tokenMatchesKeyword(firstToken, Keyword.THIS) ||
+          _tokenMatchesKeyword(firstToken, Keyword.NULL) ||
+          _tokenMatchesKeyword(firstToken, Keyword.TRUE) ||
+          _tokenMatchesKeyword(firstToken, Keyword.FALSE)) {
+        // TODO(brianwilkerson) If we want to support this we will need to
+        // extend the definition of CommentReference to take an expression
+        // rather than an identifier. For now we just ignore it to reduce the
+        // number of errors produced, but that's probably not a valid long term
+        // approach.
         return null;
       }
     } catch (exception) {
@@ -4205,9 +5474,12 @@
             int firstChar = comment.codeUnitAt(leftIndex + 1);
             if (firstChar != 0x27 && firstChar != 0x22) {
               if (_isLinkText(comment, rightIndex)) {
-                // TODO(brianwilkerson) Handle the case where there's a library URI in the link text.
+                // TODO(brianwilkerson) Handle the case where there's a library
+                // URI in the link text.
               } else {
-                CommentReference reference = _parseCommentReference(comment.substring(leftIndex + 1, rightIndex), nameOffset);
+                CommentReference reference = _parseCommentReference(
+                    comment.substring(leftIndex + 1, rightIndex),
+                    nameOffset);
                 if (reference != null) {
                   references.add(reference);
                 }
@@ -4217,13 +5489,18 @@
             // terminating ']' is not typed yet
             int charAfterLeft = comment.codeUnitAt(leftIndex + 1);
             if (Character.isLetterOrDigit(charAfterLeft)) {
-              int nameEnd = StringUtilities.indexOfFirstNotLetterDigit(comment, leftIndex + 1);
+              int nameEnd =
+                  StringUtilities.indexOfFirstNotLetterDigit(comment, leftIndex + 1);
               String name = comment.substring(leftIndex + 1, nameEnd);
-              Token nameToken = new StringToken(TokenType.IDENTIFIER, name, nameOffset);
-              references.add(new CommentReference(null, new SimpleIdentifier(nameToken)));
+              Token nameToken =
+                  new StringToken(TokenType.IDENTIFIER, name, nameOffset);
+              references.add(
+                  new CommentReference(null, new SimpleIdentifier(nameToken)));
             } else {
-              Token nameToken = new SyntheticStringToken(TokenType.IDENTIFIER, "", nameOffset);
-              references.add(new CommentReference(null, new SimpleIdentifier(nameToken)));
+              Token nameToken =
+                  new SyntheticStringToken(TokenType.IDENTIFIER, "", nameOffset);
+              references.add(
+                  new CommentReference(null, new SimpleIdentifier(nameToken)));
             }
             // next character
             rightIndex = leftIndex + 1;
@@ -4257,11 +5534,17 @@
    * @return the compilation unit member that was parsed, or `null` if what was parsed could
    *         not be represented as a compilation unit member
    */
-  CompilationUnitMember _parseCompilationUnitMember(CommentAndMetadata commentAndMetadata) {
+  CompilationUnitMember
+      _parseCompilationUnitMember(CommentAndMetadata commentAndMetadata) {
     Modifiers modifiers = _parseModifiers();
     if (_matchesKeyword(Keyword.CLASS)) {
-      return _parseClassDeclaration(commentAndMetadata, _validateModifiersForClass(modifiers));
-    } else if (_matchesKeyword(Keyword.TYPEDEF) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+      return _parseClassDeclaration(
+          commentAndMetadata,
+          _validateModifiersForClass(modifiers));
+    } else if (_matchesKeyword(Keyword.TYPEDEF) &&
+        !_tokenMatches(_peek(), TokenType.PERIOD) &&
+        !_tokenMatches(_peek(), TokenType.LT) &&
+        !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       _validateModifiersForTypedef(modifiers);
       return _parseTypeAlias(commentAndMetadata);
     } else if (_parseEnum && _matchesKeyword(Keyword.ENUM)) {
@@ -4270,40 +5553,62 @@
     }
     if (_matchesKeyword(Keyword.VOID)) {
       TypeName returnType = parseReturnType();
-      if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && _tokenMatchesIdentifier(_peek())) {
+      if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) &&
+          _tokenMatchesIdentifier(_peek())) {
         _validateModifiersForTopLevelFunction(modifiers);
-        return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
+        return _parseFunctionDeclaration(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            returnType);
       } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
         _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
-        return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
-      } else if (_matchesIdentifier() && _peek().matchesAny([
-          TokenType.OPEN_PAREN,
-          TokenType.OPEN_CURLY_BRACKET,
-          TokenType.FUNCTION])) {
+        return _convertToFunctionDeclaration(
+            _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
+      } else if (_matchesIdentifier() &&
+          _peek().matchesAny(
+              [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
         _validateModifiersForTopLevelFunction(modifiers);
-        return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
+        return _parseFunctionDeclaration(
+            commentAndMetadata,
+            modifiers.externalKeyword,
+            returnType);
       } else {
         //
         // We have found an error of some kind. Try to recover.
         //
         if (_matchesIdentifier()) {
-          if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
+          if (_peek().matchesAny(
+              [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
             //
             // We appear to have a variable declaration with a type of "void".
             //
             _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
-            return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), null), _expect(TokenType.SEMICOLON));
+            return new TopLevelVariableDeclaration(
+                commentAndMetadata.comment,
+                commentAndMetadata.metadata,
+                _parseVariableDeclarationListAfterType(
+                    null,
+                    _validateModifiersForTopLevelVariable(modifiers),
+                    null),
+                _expect(TokenType.SEMICOLON));
           }
         }
-        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
+        _reportErrorForToken(
+            ParserErrorCode.EXPECTED_EXECUTABLE,
+            _currentToken);
         return null;
       }
-    } else if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && _tokenMatchesIdentifier(_peek())) {
+    } else if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) &&
+        _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForTopLevelFunction(modifiers);
-      return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
+      return _parseFunctionDeclaration(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          null);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
       _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
-      return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, null));
+      return _convertToFunctionDeclaration(
+          _parseOperator(commentAndMetadata, modifiers.externalKeyword, null));
     } else if (!_matchesIdentifier()) {
       Token keyword = modifiers.varKeyword;
       if (keyword == null) {
@@ -4318,31 +5623,63 @@
         //
         _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
-        variables.add(new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
-        return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, new VariableDeclarationList(null, null, keyword, null, variables), _expectSemicolon());
+        variables.add(
+            new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
+        return new TopLevelVariableDeclaration(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            new VariableDeclarationList(null, null, keyword, null, variables),
+            _expectSemicolon());
       }
       _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
       return null;
     } else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       _validateModifiersForTopLevelFunction(modifiers);
-      return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
-    } else if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
-      if (modifiers.constKeyword == null && modifiers.finalKeyword == null && modifiers.varKeyword == null) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
+      return _parseFunctionDeclaration(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          null);
+    } else if (_peek().matchesAny(
+        [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
+      if (modifiers.constKeyword == null &&
+          modifiers.finalKeyword == null &&
+          modifiers.varKeyword == null) {
+        _reportErrorForCurrentToken(
+            ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), null), _expect(TokenType.SEMICOLON));
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          _parseVariableDeclarationListAfterType(
+              null,
+              _validateModifiersForTopLevelVariable(modifiers),
+              null),
+          _expect(TokenType.SEMICOLON));
     }
     TypeName returnType = parseReturnType();
-    if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && _tokenMatchesIdentifier(_peek())) {
+    if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) &&
+        _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForTopLevelFunction(modifiers);
-      return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
+      return _parseFunctionDeclaration(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          returnType);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
       _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
-      return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
+      return _convertToFunctionDeclaration(
+          _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
     } else if (_matches(TokenType.AT)) {
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), returnType), _expect(TokenType.SEMICOLON));
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          _parseVariableDeclarationListAfterType(
+              null,
+              _validateModifiersForTopLevelVariable(modifiers),
+              returnType),
+          _expect(TokenType.SEMICOLON));
     } else if (!_matchesIdentifier()) {
-      // TODO(brianwilkerson) Generalize this error. We could also be parsing a top-level variable at this point.
+      // TODO(brianwilkerson) Generalize this error. We could also be parsing a
+      // top-level variable at this point.
       _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
       Token semicolon;
       if (_matches(TokenType.SEMICOLON)) {
@@ -4351,17 +5688,30 @@
         semicolon = _createSyntheticToken(TokenType.SEMICOLON);
       }
       List<VariableDeclaration> variables = new List<VariableDeclaration>();
-      variables.add(new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, new VariableDeclarationList(null, null, null, returnType, variables), semicolon);
+      variables.add(
+          new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          new VariableDeclarationList(null, null, null, returnType, variables),
+          semicolon);
     }
-    if (_peek().matchesAny([
-        TokenType.OPEN_PAREN,
-        TokenType.FUNCTION,
-        TokenType.OPEN_CURLY_BRACKET])) {
+    if (_peek().matchesAny(
+        [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType.OPEN_CURLY_BRACKET])) {
       _validateModifiersForTopLevelFunction(modifiers);
-      return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
+      return _parseFunctionDeclaration(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          returnType);
     }
-    return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), returnType), _expect(TokenType.SEMICOLON));
+    return new TopLevelVariableDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        _parseVariableDeclarationListAfterType(
+            null,
+            _validateModifiersForTopLevelVariable(modifiers),
+            returnType),
+        _expect(TokenType.SEMICOLON));
   }
 
   /**
@@ -4388,7 +5738,10 @@
     return _parseInstanceCreationExpression(keyword);
   }
 
-  ConstructorDeclaration _parseConstructor(CommentAndMetadata commentAndMetadata, Token externalKeyword, Token constKeyword, Token factoryKeyword, SimpleIdentifier returnType, Token period, SimpleIdentifier name, FormalParameterList parameters) {
+  ConstructorDeclaration
+      _parseConstructor(CommentAndMetadata commentAndMetadata, Token externalKeyword,
+      Token constKeyword, Token factoryKeyword, SimpleIdentifier returnType,
+      Token period, SimpleIdentifier name, FormalParameterList parameters) {
     bool bodyAllowed = externalKeyword == null;
     Token separator = null;
     List<ConstructorInitializer> initializers = null;
@@ -4400,7 +5753,8 @@
           if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
             bodyAllowed = false;
             initializers.add(_parseRedirectingConstructorInvocation());
-          } else if (_tokenMatches(_peek(), TokenType.PERIOD) && _tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
+          } else if (_tokenMatches(_peek(), TokenType.PERIOD) &&
+              _tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
             bodyAllowed = false;
             initializers.add(_parseRedirectingConstructorInvocation());
           } else {
@@ -4408,15 +5762,17 @@
           }
         } else if (_matchesKeyword(Keyword.SUPER)) {
           initializers.add(_parseSuperConstructorInvocation());
-        } else if (_matches(TokenType.OPEN_CURLY_BRACKET)
-            || _matches(TokenType.FUNCTION)) {
+        } else if (_matches(TokenType.OPEN_CURLY_BRACKET) ||
+            _matches(TokenType.FUNCTION)) {
           _reportErrorForCurrentToken(ParserErrorCode.MISSING_INITIALIZER);
         } else {
           initializers.add(_parseConstructorFieldInitializer());
         }
       } while (_optional(TokenType.COMMA));
       if (factoryKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.FACTORY_WITH_INITIALIZERS, factoryKeyword);
+        _reportErrorForToken(
+            ParserErrorCode.FACTORY_WITH_INITIALIZERS,
+            factoryKeyword);
       }
     }
     ConstructorName redirectedConstructor = null;
@@ -4426,25 +5782,49 @@
       redirectedConstructor = parseConstructorName();
       body = new EmptyFunctionBody(_expect(TokenType.SEMICOLON));
       if (factoryKeyword == null) {
-        _reportErrorForNode(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redirectedConstructor);
+        _reportErrorForNode(
+            ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
+            redirectedConstructor);
       }
     } else {
-      body = _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
-      if (constKeyword != null && factoryKeyword != null && externalKeyword == null) {
+      body =
+          _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
+      if (constKeyword != null &&
+          factoryKeyword != null &&
+          externalKeyword == null) {
         _reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword);
       } else if (body is EmptyFunctionBody) {
         if (factoryKeyword != null && externalKeyword == null) {
-          _reportErrorForToken(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword);
+          _reportErrorForToken(
+              ParserErrorCode.FACTORY_WITHOUT_BODY,
+              factoryKeyword);
         }
       } else {
         if (constKeyword != null) {
-          _reportErrorForNode(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body);
+          _reportErrorForNode(
+              ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY,
+              body);
         } else if (!bodyAllowed) {
-          _reportErrorForNode(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body);
+          _reportErrorForNode(
+              ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY,
+              body);
         }
       }
     }
-    return new ConstructorDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, constKeyword, factoryKeyword, returnType, period, name, parameters, separator, initializers, redirectedConstructor, body);
+    return new ConstructorDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        constKeyword,
+        factoryKeyword,
+        returnType,
+        period,
+        name,
+        parameters,
+        separator,
+        initializers,
+        redirectedConstructor,
+        body);
   }
 
   /**
@@ -4468,14 +5848,16 @@
     Token equals = null;
     if (_matches(TokenType.EQ)) {
       equals = andAdvance;
-    } else if (!_matchesKeyword(Keyword.THIS)
-        && !_matchesKeyword(Keyword.SUPER)
-        && !_matches(TokenType.OPEN_CURLY_BRACKET)
-        && !_matches(TokenType.FUNCTION)) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
+    } else if (!_matchesKeyword(Keyword.THIS) &&
+        !_matchesKeyword(Keyword.SUPER) &&
+        !_matches(TokenType.OPEN_CURLY_BRACKET) &&
+        !_matches(TokenType.FUNCTION)) {
+      _reportErrorForCurrentToken(
+          ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
       equals = _createSyntheticToken(TokenType.EQ);
     } else {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
       return new ConstructorFieldInitializer(
           keyword,
           period,
@@ -4499,7 +5881,12 @@
         }
         expression = new CascadeExpression(expression, cascadeSections);
       }
-      return new ConstructorFieldInitializer(keyword, period, fieldName, equals, expression);
+      return new ConstructorFieldInitializer(
+          keyword,
+          period,
+          fieldName,
+          equals,
+          expression);
     } finally {
       _inInitializer = wasInInitializer;
     }
@@ -4518,14 +5905,18 @@
   Statement _parseContinueStatement() {
     Token continueKeyword = _expectKeyword(Keyword.CONTINUE);
     if (!_inLoop && !_inSwitch) {
-      _reportErrorForToken(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP,
+          continueKeyword);
     }
     SimpleIdentifier label = null;
     if (_matchesIdentifier()) {
       label = parseSimpleIdentifier();
     }
     if (_inSwitch && !_inLoop && label == null) {
-      _reportErrorForToken(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE,
+          continueKeyword);
     }
     Token semicolon = _expect(TokenType.SEMICOLON);
     return new ContinueStatement(continueKeyword, label, semicolon);
@@ -4555,9 +5946,10 @@
     } else if (_matchesKeyword(Keyword.PART)) {
       return _parsePartDirective(commentAndMetadata);
     } else {
-      // Internal error: this method should not have been invoked if the current token was something
-      // other than one of the above.
-      throw new IllegalStateException("parseDirective invoked in an invalid state; currentToken = $_currentToken");
+      // Internal error: this method should not have been invoked if the current
+      // token was something other than one of the above.
+      throw new IllegalStateException(
+          "parseDirective invoked in an invalid state; currentToken = $_currentToken");
     }
   }
 
@@ -4582,7 +5974,13 @@
     List<Directive> directives = new List<Directive>();
     while (!_matches(TokenType.EOF)) {
       CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata();
-      if ((_matchesKeyword(Keyword.IMPORT) || _matchesKeyword(Keyword.EXPORT) || _matchesKeyword(Keyword.LIBRARY) || _matchesKeyword(Keyword.PART)) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+      if ((_matchesKeyword(Keyword.IMPORT) ||
+          _matchesKeyword(Keyword.EXPORT) ||
+          _matchesKeyword(Keyword.LIBRARY) ||
+          _matchesKeyword(Keyword.PART)) &&
+          !_tokenMatches(_peek(), TokenType.PERIOD) &&
+          !_tokenMatches(_peek(), TokenType.LT) &&
+          !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
         directives.add(_parseDirective(commentAndMetadata));
       } else if (_matches(TokenType.SEMICOLON)) {
         _advance();
@@ -4590,10 +5988,20 @@
         while (!_matches(TokenType.EOF)) {
           _advance();
         }
-        return new CompilationUnit(firstToken, scriptTag, directives, new List<CompilationUnitMember>(), _currentToken);
+        return new CompilationUnit(
+            firstToken,
+            scriptTag,
+            directives,
+            new List<CompilationUnitMember>(),
+            _currentToken);
       }
     }
-    return new CompilationUnit(firstToken, scriptTag, directives, new List<CompilationUnitMember>(), _currentToken);
+    return new CompilationUnit(
+        firstToken,
+        scriptTag,
+        directives,
+        new List<CompilationUnitMember>(),
+        _currentToken);
   }
 
   /**
@@ -4612,14 +6020,25 @@
     Token commentToken = _currentToken.precedingComments;
     while (commentToken != null) {
       if (commentToken.type == TokenType.SINGLE_LINE_COMMENT) {
-        if (StringUtilities.startsWith3(commentToken.lexeme, 0, 0x2F, 0x2F, 0x2F)) {
-          if (commentTokens.length == 1 && StringUtilities.startsWith3(commentTokens[0].lexeme, 0, 0x2F, 0x2A, 0x2A)) {
+        if (StringUtilities.startsWith3(
+            commentToken.lexeme,
+            0,
+            0x2F,
+            0x2F,
+            0x2F)) {
+          if (commentTokens.length == 1 &&
+              StringUtilities.startsWith3(commentTokens[0].lexeme, 0, 0x2F, 0x2A, 0x2A)) {
             commentTokens.clear();
           }
           commentTokens.add(commentToken);
         }
       } else {
-        if (StringUtilities.startsWith3(commentToken.lexeme, 0, 0x2F, 0x2A, 0x2A)) {
+        if (StringUtilities.startsWith3(
+            commentToken.lexeme,
+            0,
+            0x2F,
+            0x2A,
+            0x2A)) {
           commentTokens.clear();
           commentTokens.add(commentToken);
         }
@@ -4630,7 +6049,9 @@
       return null;
     }
     List<CommentReference> references = _parseCommentReferences(commentTokens);
-    return Comment.createDocumentationCommentWithReferences(commentTokens, references);
+    return Comment.createDocumentationCommentWithReferences(
+        commentTokens,
+        references);
   }
 
   /**
@@ -4654,7 +6075,14 @@
       Expression condition = parseExpression2();
       Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       Token semicolon = _expect(TokenType.SEMICOLON);
-      return new DoStatement(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthesis, semicolon);
+      return new DoStatement(
+          doKeyword,
+          body,
+          whileKeyword,
+          leftParenthesis,
+          condition,
+          rightParenthesis,
+          semicolon);
     } finally {
       _inLoop = wasInLoop;
     }
@@ -4680,7 +6108,10 @@
     } else {
       name = _createSyntheticIdentifier();
     }
-    return new EnumConstantDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, name);
+    return new EnumConstantDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        name);
   }
 
   /**
@@ -4698,13 +6129,15 @@
     Token keyword = _expectKeyword(Keyword.ENUM);
     SimpleIdentifier name = parseSimpleIdentifier();
     Token leftBracket = null;
-    List<EnumConstantDeclaration> constants = new List<EnumConstantDeclaration>();
+    List<EnumConstantDeclaration> constants =
+        new List<EnumConstantDeclaration>();
     Token rightBracket = null;
     if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
       leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET);
       if (_matchesIdentifier()) {
         constants.add(_parseEnumConstantDeclaration());
-      } else if (_matches(TokenType.COMMA) && _tokenMatchesIdentifier(_peek())) {
+      } else if (_matches(TokenType.COMMA) &&
+          _tokenMatchesIdentifier(_peek())) {
         constants.add(_parseEnumConstantDeclaration());
         _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
       } else {
@@ -4723,7 +6156,14 @@
       rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_ENUM_BODY);
     }
-    return new EnumDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, name, leftBracket, constants, rightBracket);
+    return new EnumDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        keyword,
+        name,
+        leftBracket,
+        constants,
+        rightBracket);
   }
 
   /**
@@ -4739,7 +6179,8 @@
    */
   Expression _parseEqualityExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _currentToken.next.type.isEqualityOperator) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _currentToken.next.type.isEqualityOperator) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseRelationalExpression();
@@ -4748,9 +6189,12 @@
     while (_currentToken.type.isEqualityOperator) {
       Token operator = andAdvance;
       if (leftEqualityExpression) {
-        _reportErrorForNode(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, expression);
+        _reportErrorForNode(
+            ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
+            expression);
       }
-      expression = new BinaryExpression(expression, operator, _parseRelationalExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseRelationalExpression());
       leftEqualityExpression = true;
     }
     return expression;
@@ -4772,7 +6216,13 @@
     StringLiteral libraryUri = parseStringLiteral();
     List<Combinator> combinators = _parseCombinators();
     Token semicolon = _expectSemicolon();
-    return new ExportDirective(commentAndMetadata.comment, commentAndMetadata.metadata, exportKeyword, libraryUri, combinators, semicolon);
+    return new ExportDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        exportKeyword,
+        libraryUri,
+        combinators,
+        semicolon);
   }
 
   /**
@@ -4822,7 +6272,8 @@
       if (_isTypedIdentifier(_currentToken)) {
         type = parseReturnType();
       } else if (!optional) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
+        _reportErrorForCurrentToken(
+            ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
     }
     return new FinalConstVarOrType(keyword, type);
@@ -4850,20 +6301,36 @@
       Token seperator = andAdvance;
       Expression defaultValue = parseExpression2();
       if (kind == ParameterKind.NAMED) {
-        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, seperator);
+        _reportErrorForToken(
+            ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
+            seperator);
       } else if (kind == ParameterKind.REQUIRED) {
-        _reportErrorForNode(ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, parameter);
+        _reportErrorForNode(
+            ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
+            parameter);
       }
-      return new DefaultFormalParameter(parameter, kind, seperator, defaultValue);
+      return new DefaultFormalParameter(
+          parameter,
+          kind,
+          seperator,
+          defaultValue);
     } else if (_matches(TokenType.COLON)) {
       Token seperator = andAdvance;
       Expression defaultValue = parseExpression2();
       if (kind == ParameterKind.POSITIONAL) {
-        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, seperator);
+        _reportErrorForToken(
+            ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
+            seperator);
       } else if (kind == ParameterKind.REQUIRED) {
-        _reportErrorForNode(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter);
+        _reportErrorForNode(
+            ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
+            parameter);
       }
-      return new DefaultFormalParameter(parameter, kind, seperator, defaultValue);
+      return new DefaultFormalParameter(
+          parameter,
+          kind,
+          seperator,
+          defaultValue);
     } else if (kind != ParameterKind.REQUIRED) {
       return new DefaultFormalParameter(parameter, kind, null, null);
     }
@@ -4906,10 +6373,17 @@
         if (_matchesIdentifier() && _tokenMatchesKeyword(_peek(), Keyword.IN)) {
           List<VariableDeclaration> variables = new List<VariableDeclaration>();
           SimpleIdentifier variableName = parseSimpleIdentifier();
-          variables.add(new VariableDeclaration(null, null, variableName, null, null));
-          variableList = new VariableDeclarationList(commentAndMetadata.comment, commentAndMetadata.metadata, null, null, variables);
+          variables.add(
+              new VariableDeclaration(null, null, variableName, null, null));
+          variableList = new VariableDeclarationList(
+              commentAndMetadata.comment,
+              commentAndMetadata.metadata,
+              null,
+              null,
+              variables);
         } else if (_isInitializedVariableDeclaration()) {
-          variableList = _parseVariableDeclarationListAfterMetadata(commentAndMetadata);
+          variableList =
+              _parseVariableDeclarationListAfterMetadata(commentAndMetadata);
         } else {
           initialization = parseExpression2();
         }
@@ -4918,24 +6392,34 @@
           SimpleIdentifier identifier = null;
           if (variableList == null) {
             // We found: <expression> 'in'
-            _reportErrorForCurrentToken(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH);
+            _reportErrorForCurrentToken(
+                ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH);
           } else {
             NodeList<VariableDeclaration> variables = variableList.variables;
             if (variables.length > 1) {
-              _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [variables.length.toString()]);
+              _reportErrorForCurrentToken(
+                  ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH,
+                  [variables.length.toString()]);
             }
             VariableDeclaration variable = variables[0];
             if (variable.initializer != null) {
-              _reportErrorForCurrentToken(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH);
+              _reportErrorForCurrentToken(
+                  ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH);
             }
             Token keyword = variableList.keyword;
             TypeName type = variableList.type;
             if (keyword != null || type != null) {
-              loopVariable = new DeclaredIdentifier(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, type, variable.name);
+              loopVariable = new DeclaredIdentifier(
+                  commentAndMetadata.comment,
+                  commentAndMetadata.metadata,
+                  keyword,
+                  type,
+                  variable.name);
             } else {
               if (!commentAndMetadata.metadata.isEmpty) {
-                // TODO(jwren) metadata isn't allowed before the identifier in "identifier in expression",
-                // add warning if commentAndMetadata has content
+                // TODO(jwren) metadata isn't allowed before the identifier in
+                // "identifier in expression", add warning if commentAndMetadata
+                // has content
               }
               identifier = variable.name;
             }
@@ -4945,13 +6429,31 @@
           Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
           Statement body = parseStatement2();
           if (loopVariable == null) {
-            return new ForEachStatement.con2(awaitKeyword, forKeyword, leftParenthesis, identifier, inKeyword, iterator, rightParenthesis, body);
+            return new ForEachStatement.con2(
+                awaitKeyword,
+                forKeyword,
+                leftParenthesis,
+                identifier,
+                inKeyword,
+                iterator,
+                rightParenthesis,
+                body);
           }
-          return new ForEachStatement.con1(awaitKeyword, forKeyword, leftParenthesis, loopVariable, inKeyword, iterator, rightParenthesis, body);
+          return new ForEachStatement.con1(
+              awaitKeyword,
+              forKeyword,
+              leftParenthesis,
+              loopVariable,
+              inKeyword,
+              iterator,
+              rightParenthesis,
+              body);
         }
       }
       if (awaitKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.INVALID_AWAIT_IN_FOR, awaitKeyword);
+        _reportErrorForToken(
+            ParserErrorCode.INVALID_AWAIT_IN_FOR,
+            awaitKeyword);
       }
       Token leftSeparator = _expect(TokenType.SEMICOLON);
       Expression condition = null;
@@ -4965,7 +6467,17 @@
       }
       Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       Statement body = parseStatement2();
-      return new ForStatement(forKeyword, leftParenthesis, variableList, initialization, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body);
+      return new ForStatement(
+          forKeyword,
+          leftParenthesis,
+          variableList,
+          initialization,
+          leftSeparator,
+          condition,
+          rightSeparator,
+          updaters,
+          rightParenthesis,
+          body);
     } finally {
       _inLoop = wasInLoop;
     }
@@ -4990,7 +6502,8 @@
    *          and therefore does not have a terminating semicolon
    * @return the function body that was parsed
    */
-  FunctionBody _parseFunctionBody(bool mayBeEmpty, ParserErrorCode emptyErrorCode, bool inExpression) {
+  FunctionBody _parseFunctionBody(bool mayBeEmpty,
+      ParserErrorCode emptyErrorCode, bool inExpression) {
     bool wasInAsync = _inAsync;
     bool wasInGenerator = _inGenerator;
     bool wasInLoop = _inLoop;
@@ -5011,7 +6524,10 @@
         if (_matches(TokenType.STRING)) {
           stringLiteral = parseStringLiteral();
         }
-        return new NativeFunctionBody(nativeToken, stringLiteral, _expect(TokenType.SEMICOLON));
+        return new NativeFunctionBody(
+            nativeToken,
+            stringLiteral,
+            _expect(TokenType.SEMICOLON));
       }
       Token keyword = null;
       Token star = null;
@@ -5037,7 +6553,9 @@
             _reportErrorForToken(ParserErrorCode.INVALID_SYNC, keyword);
             keyword = null;
           } else if (star != null) {
-            _reportErrorForToken(ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star);
+            _reportErrorForToken(
+                ParserErrorCode.INVALID_STAR_AFTER_ASYNC,
+                star);
           }
         }
         Token functionDefinition = andAdvance;
@@ -5047,24 +6565,33 @@
           semicolon = _expect(TokenType.SEMICOLON);
         }
         if (!_parseFunctionBodies) {
-          return new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON));
+          return new EmptyFunctionBody(
+              _createSyntheticToken(TokenType.SEMICOLON));
         }
-        return new ExpressionFunctionBody(keyword, functionDefinition, expression, semicolon);
+        return new ExpressionFunctionBody(
+            keyword,
+            functionDefinition,
+            expression,
+            semicolon);
       } else if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
         if (keyword != null) {
           if (_tokenMatchesString(keyword, SYNC) && star == null) {
-            _reportErrorForToken(ParserErrorCode.MISSING_STAR_AFTER_SYNC, keyword);
+            _reportErrorForToken(
+                ParserErrorCode.MISSING_STAR_AFTER_SYNC,
+                keyword);
           }
         }
         if (!_parseFunctionBodies) {
           _skipBlock();
-          return new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON));
+          return new EmptyFunctionBody(
+              _createSyntheticToken(TokenType.SEMICOLON));
         }
         return new BlockFunctionBody(keyword, star, parseBlock());
       } else {
         // Invalid function body
         _reportErrorForCurrentToken(emptyErrorCode);
-        return new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON));
+        return new EmptyFunctionBody(
+            _createSyntheticToken(TokenType.SEMICOLON));
       }
     } finally {
       _inAsync = wasInAsync;
@@ -5090,13 +6617,17 @@
    * @param isStatement `true` if the function declaration is being parsed as a statement
    * @return the function declaration that was parsed
    */
-  FunctionDeclaration _parseFunctionDeclaration(CommentAndMetadata commentAndMetadata, Token externalKeyword, TypeName returnType) {
+  FunctionDeclaration
+      _parseFunctionDeclaration(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, TypeName returnType) {
     Token keyword = null;
     bool isGetter = false;
-    if (_matchesKeyword(Keyword.GET) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+    if (_matchesKeyword(Keyword.GET) &&
+        !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       keyword = andAdvance;
       isGetter = true;
-    } else if (_matchesKeyword(Keyword.SET) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+    } else if (_matchesKeyword(Keyword.SET) &&
+        !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       keyword = andAdvance;
     }
     SimpleIdentifier name = parseSimpleIdentifier();
@@ -5106,7 +6637,8 @@
         parameters = parseFormalParameterList();
         _validateFormalParameterList(parameters);
       } else {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
+        _reportErrorForCurrentToken(
+            ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
       }
     } else if (_matches(TokenType.OPEN_PAREN)) {
       _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
@@ -5114,16 +6646,24 @@
     }
     FunctionBody body;
     if (externalKeyword == null) {
-      body = _parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, false);
+      body =
+          _parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, false);
     } else {
       body = new EmptyFunctionBody(_expect(TokenType.SEMICOLON));
     }
-    //    if (!isStatement && matches(TokenType.SEMICOLON)) {
-    //      // TODO(brianwilkerson) Improve this error message.
-    //      reportError(ParserErrorCode.UNEXPECTED_TOKEN, currentToken.getLexeme());
-    //      advance();
-    //    }
-    return new FunctionDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, returnType, keyword, name, new FunctionExpression(parameters, body));
+//        if (!isStatement && matches(TokenType.SEMICOLON)) {
+//          // TODO(brianwilkerson) Improve this error message.
+//          reportError(ParserErrorCode.UNEXPECTED_TOKEN, currentToken.getLexeme());
+//          advance();
+//        }
+    return new FunctionDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        returnType,
+        keyword,
+        name,
+        new FunctionExpression(parameters, body));
   }
 
   /**
@@ -5139,7 +6679,9 @@
   Statement _parseFunctionDeclarationStatement() {
     Modifiers modifiers = _parseModifiers();
     _validateModifiersForFunctionDeclarationStatement(modifiers);
-    return _parseFunctionDeclarationStatementAfterReturnType(_parseCommentAndMetadata(), _parseOptionalReturnType());
+    return _parseFunctionDeclarationStatementAfterReturnType(
+        _parseCommentAndMetadata(),
+        _parseOptionalReturnType());
   }
 
   /**
@@ -5155,14 +6697,21 @@
    * @param returnType the return type, or `null` if there is no return type
    * @return the function declaration statement that was parsed
    */
-  Statement _parseFunctionDeclarationStatementAfterReturnType(CommentAndMetadata commentAndMetadata, TypeName returnType) {
-    FunctionDeclaration declaration = _parseFunctionDeclaration(commentAndMetadata, null, returnType);
+  Statement
+      _parseFunctionDeclarationStatementAfterReturnType(CommentAndMetadata commentAndMetadata,
+      TypeName returnType) {
+    FunctionDeclaration declaration =
+        _parseFunctionDeclaration(commentAndMetadata, null, returnType);
     Token propertyKeyword = declaration.propertyKeyword;
     if (propertyKeyword != null) {
       if ((propertyKeyword as KeywordToken).keyword == Keyword.GET) {
-        _reportErrorForToken(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword);
+        _reportErrorForToken(
+            ParserErrorCode.GETTER_IN_FUNCTION,
+            propertyKeyword);
       } else {
-        _reportErrorForToken(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword);
+        _reportErrorForToken(
+            ParserErrorCode.SETTER_IN_FUNCTION,
+            propertyKeyword);
       }
     }
     return new FunctionDeclarationStatement(declaration);
@@ -5183,7 +6732,8 @@
    * @param keyword the token representing the 'typedef' keyword
    * @return the function type alias that was parsed
    */
-  FunctionTypeAlias _parseFunctionTypeAlias(CommentAndMetadata commentAndMetadata, Token keyword) {
+  FunctionTypeAlias
+      _parseFunctionTypeAlias(CommentAndMetadata commentAndMetadata, Token keyword) {
     TypeName returnType = null;
     if (hasReturnTypeInTypeAlias) {
       returnType = parseReturnType();
@@ -5195,20 +6745,55 @@
     }
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.EOF)) {
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
-      FormalParameterList parameters = new FormalParameterList(_createSyntheticToken(TokenType.OPEN_PAREN), null, null, null, _createSyntheticToken(TokenType.CLOSE_PAREN));
+      FormalParameterList parameters = new FormalParameterList(
+          _createSyntheticToken(TokenType.OPEN_PAREN),
+          null,
+          null,
+          null,
+          _createSyntheticToken(TokenType.CLOSE_PAREN));
       Token semicolon = _expect(TokenType.SEMICOLON);
-      return new FunctionTypeAlias(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolon);
+      return new FunctionTypeAlias(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          keyword,
+          returnType,
+          name,
+          typeParameters,
+          parameters,
+          semicolon);
     } else if (!_matches(TokenType.OPEN_PAREN)) {
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
-      // TODO(brianwilkerson) Recover from this error. At the very least we should skip to the start
-      // of the next valid compilation unit member, allowing for the possibility of finding the
-      // typedef parameters before that point.
-      return new FunctionTypeAlias(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, returnType, name, typeParameters, new FormalParameterList(_createSyntheticToken(TokenType.OPEN_PAREN), null, null, null, _createSyntheticToken(TokenType.CLOSE_PAREN)), _createSyntheticToken(TokenType.SEMICOLON));
+      // TODO(brianwilkerson) Recover from this error. At the very least we
+      // should skip to the start of the next valid compilation unit member,
+      // allowing for the possibility of finding the typedef parameters before
+      // that point.
+      return new FunctionTypeAlias(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          keyword,
+          returnType,
+          name,
+          typeParameters,
+          new FormalParameterList(
+              _createSyntheticToken(TokenType.OPEN_PAREN),
+              null,
+              null,
+              null,
+              _createSyntheticToken(TokenType.CLOSE_PAREN)),
+          _createSyntheticToken(TokenType.SEMICOLON));
     }
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
     Token semicolon = _expect(TokenType.SEMICOLON);
-    return new FunctionTypeAlias(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolon);
+    return new FunctionTypeAlias(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        keyword,
+        returnType,
+        name,
+        typeParameters,
+        parameters,
+        semicolon);
   }
 
   /**
@@ -5230,19 +6815,34 @@
    *          type
    * @return the getter that was parsed
    */
-  MethodDeclaration _parseGetter(CommentAndMetadata commentAndMetadata, Token externalKeyword, Token staticKeyword, TypeName returnType) {
+  MethodDeclaration _parseGetter(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, Token staticKeyword, TypeName returnType) {
     Token propertyKeyword = _expectKeyword(Keyword.GET);
     SimpleIdentifier name = parseSimpleIdentifier();
-    if (_matches(TokenType.OPEN_PAREN) && _tokenMatches(_peek(), TokenType.CLOSE_PAREN)) {
+    if (_matches(TokenType.OPEN_PAREN) &&
+        _tokenMatches(_peek(), TokenType.CLOSE_PAREN)) {
       _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
       _advance();
       _advance();
     }
-    FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false);
+    FunctionBody body = _parseFunctionBody(
+        externalKeyword != null || staticKeyword == null,
+        ParserErrorCode.STATIC_GETTER_WITHOUT_BODY,
+        false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null, name, null, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        propertyKeyword,
+        null,
+        name,
+        null,
+        body);
   }
 
   /**
@@ -5287,7 +6887,14 @@
       elseKeyword = andAdvance;
       elseStatement = parseStatement2();
     }
-    return new IfStatement(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement);
+    return new IfStatement(
+        ifKeyword,
+        leftParenthesis,
+        condition,
+        rightParenthesis,
+        thenStatement,
+        elseKeyword,
+        elseStatement);
   }
 
   /**
@@ -5311,7 +6918,8 @@
       if (_parseDeferredLibraries) {
         deferredToken = andAdvance;
       } else {
-        _reportErrorForCurrentToken(ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED);
+        _reportErrorForCurrentToken(
+            ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED);
         _advance();
       }
     }
@@ -5319,11 +6927,21 @@
       asToken = andAdvance;
       prefix = parseSimpleIdentifier();
     } else if (deferredToken != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT);
     }
     List<Combinator> combinators = _parseCombinators();
     Token semicolon = _expectSemicolon();
-    return new ImportDirective(commentAndMetadata.comment, commentAndMetadata.metadata, importKeyword, libraryUri, deferredToken, asToken, prefix, combinators, semicolon);
+    return new ImportDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        importKeyword,
+        libraryUri,
+        deferredToken,
+        asToken,
+        prefix,
+        combinators,
+        semicolon);
   }
 
   /**
@@ -5349,9 +6967,17 @@
    * @param type the type that has already been parsed, or `null` if 'var' was provided
    * @return the getter that was parsed
    */
-  FieldDeclaration _parseInitializedIdentifierList(CommentAndMetadata commentAndMetadata, Token staticKeyword, Token keyword, TypeName type) {
-    VariableDeclarationList fieldList = _parseVariableDeclarationListAfterType(null, keyword, type);
-    return new FieldDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, staticKeyword, fieldList, _expect(TokenType.SEMICOLON));
+  FieldDeclaration
+      _parseInitializedIdentifierList(CommentAndMetadata commentAndMetadata,
+      Token staticKeyword, Token keyword, TypeName type) {
+    VariableDeclarationList fieldList =
+        _parseVariableDeclarationListAfterType(null, keyword, type);
+    return new FieldDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        staticKeyword,
+        fieldList,
+        _expect(TokenType.SEMICOLON));
   }
 
   /**
@@ -5368,7 +6994,10 @@
   InstanceCreationExpression _parseInstanceCreationExpression(Token keyword) {
     ConstructorName constructorName = parseConstructorName();
     ArgumentList argumentList = parseArgumentList();
-    return new InstanceCreationExpression(keyword, constructorName, argumentList);
+    return new InstanceCreationExpression(
+        keyword,
+        constructorName,
+        argumentList);
   }
 
   /**
@@ -5382,11 +7011,18 @@
    * @param commentAndMetadata the metadata to be associated with the directive
    * @return the library directive that was parsed
    */
-  LibraryDirective _parseLibraryDirective(CommentAndMetadata commentAndMetadata) {
+  LibraryDirective
+      _parseLibraryDirective(CommentAndMetadata commentAndMetadata) {
     Token keyword = _expectKeyword(Keyword.LIBRARY);
-    LibraryIdentifier libraryName = _parseLibraryName(ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE, keyword);
+    LibraryIdentifier libraryName =
+        _parseLibraryName(ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE, keyword);
     Token semicolon = _expect(TokenType.SEMICOLON);
-    return new LibraryDirective(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, libraryName, semicolon);
+    return new LibraryDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        keyword,
+        libraryName,
+        semicolon);
   }
 
   /**
@@ -5402,12 +7038,14 @@
    *          missing
    * @return the library name that was parsed
    */
-  LibraryIdentifier _parseLibraryName(ParserErrorCode missingNameError, Token missingNameToken) {
+  LibraryIdentifier _parseLibraryName(ParserErrorCode missingNameError,
+      Token missingNameToken) {
     if (_matchesIdentifier()) {
       return parseLibraryIdentifier();
     } else if (_matches(TokenType.STRING)) {
-      // TODO(brianwilkerson) Recovery: This should be extended to handle arbitrary tokens until we
-      // can find a token that can start a compilation unit member.
+      // TODO(brianwilkerson) Recovery: This should be extended to handle
+      // arbitrary tokens until we can find a token that can start a compilation
+      // unit member.
       StringLiteral string = parseStringLiteral();
       _reportErrorForNode(ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, string);
     } else {
@@ -5432,22 +7070,35 @@
    *          are no type arguments
    * @return the list literal that was parsed
    */
-  ListLiteral _parseListLiteral(Token modifier, TypeArgumentList typeArguments) {
+  ListLiteral _parseListLiteral(Token modifier,
+      TypeArgumentList typeArguments) {
     // may be empty list literal
     if (_matches(TokenType.INDEX)) {
-      BeginToken leftBracket = new BeginToken(TokenType.OPEN_SQUARE_BRACKET, _currentToken.offset);
-      Token rightBracket = new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
+      BeginToken leftBracket =
+          new BeginToken(TokenType.OPEN_SQUARE_BRACKET, _currentToken.offset);
+      Token rightBracket =
+          new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
       leftBracket.endToken = rightBracket;
       rightBracket.setNext(_currentToken.next);
       leftBracket.setNext(rightBracket);
       _currentToken.previous.setNext(leftBracket);
       _currentToken = _currentToken.next;
-      return new ListLiteral(modifier, typeArguments, leftBracket, null, rightBracket);
+      return new ListLiteral(
+          modifier,
+          typeArguments,
+          leftBracket,
+          null,
+          rightBracket);
     }
     // open
     Token leftBracket = _expect(TokenType.OPEN_SQUARE_BRACKET);
     if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) {
-      return new ListLiteral(modifier, typeArguments, leftBracket, null, andAdvance);
+      return new ListLiteral(
+          modifier,
+          typeArguments,
+          leftBracket,
+          null,
+          andAdvance);
     }
     bool wasInInitializer = _inInitializer;
     _inInitializer = false;
@@ -5456,12 +7107,22 @@
       elements.add(parseExpression2());
       while (_optional(TokenType.COMMA)) {
         if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) {
-          return new ListLiteral(modifier, typeArguments, leftBracket, elements, andAdvance);
+          return new ListLiteral(
+              modifier,
+              typeArguments,
+              leftBracket,
+              elements,
+              andAdvance);
         }
         elements.add(parseExpression2());
       }
       Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET);
-      return new ListLiteral(modifier, typeArguments, leftBracket, elements, rightBracket);
+      return new ListLiteral(
+          modifier,
+          typeArguments,
+          leftBracket,
+          elements,
+          rightBracket);
     } finally {
       _inInitializer = wasInInitializer;
     }
@@ -5487,11 +7148,17 @@
     }
     if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
       return _parseMapLiteral(modifier, typeArguments);
-    } else if (_matches(TokenType.OPEN_SQUARE_BRACKET) || _matches(TokenType.INDEX)) {
+    } else if (_matches(TokenType.OPEN_SQUARE_BRACKET) ||
+        _matches(TokenType.INDEX)) {
       return _parseListLiteral(modifier, typeArguments);
     }
     _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL);
-    return new ListLiteral(modifier, typeArguments, _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET), null, _createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
+    return new ListLiteral(
+        modifier,
+        typeArguments,
+        _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET),
+        null,
+        _createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
   }
 
   /**
@@ -5508,7 +7175,8 @@
     Expression expression = _parseEqualityExpression();
     while (_matches(TokenType.AMPERSAND_AMPERSAND)) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseEqualityExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseEqualityExpression());
     }
     return expression;
   }
@@ -5531,7 +7199,12 @@
     Token leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET);
     List<MapLiteralEntry> entries = new List<MapLiteralEntry>();
     if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
-      return new MapLiteral(modifier, typeArguments, leftBracket, entries, andAdvance);
+      return new MapLiteral(
+          modifier,
+          typeArguments,
+          leftBracket,
+          entries,
+          andAdvance);
     }
     bool wasInInitializer = _inInitializer;
     _inInitializer = false;
@@ -5539,12 +7212,22 @@
       entries.add(parseMapLiteralEntry());
       while (_optional(TokenType.COMMA)) {
         if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
-          return new MapLiteral(modifier, typeArguments, leftBracket, entries, andAdvance);
+          return new MapLiteral(
+              modifier,
+              typeArguments,
+              leftBracket,
+              entries,
+              andAdvance);
         }
         entries.add(parseMapLiteralEntry());
       }
       Token rightBracket = _expect(TokenType.CLOSE_CURLY_BRACKET);
-      return new MapLiteral(modifier, typeArguments, leftBracket, entries, rightBracket);
+      return new MapLiteral(
+          modifier,
+          typeArguments,
+          leftBracket,
+          entries,
+          rightBracket);
     } finally {
       _inInitializer = wasInInitializer;
     }
@@ -5568,8 +7251,14 @@
    * @param parameters the parameters to the method
    * @return the method declaration that was parsed
    */
-  MethodDeclaration _parseMethodDeclarationAfterParameters(CommentAndMetadata commentAndMetadata, Token externalKeyword, Token staticKeyword, TypeName returnType, SimpleIdentifier name, FormalParameterList parameters) {
-    FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.MISSING_FUNCTION_BODY, false);
+  MethodDeclaration
+      _parseMethodDeclarationAfterParameters(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, Token staticKeyword, TypeName returnType,
+      SimpleIdentifier name, FormalParameterList parameters) {
+    FunctionBody body = _parseFunctionBody(
+        externalKeyword != null || staticKeyword == null,
+        ParserErrorCode.MISSING_FUNCTION_BODY,
+        false);
     if (externalKeyword != null) {
       if (body is! EmptyFunctionBody) {
         _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body);
@@ -5579,7 +7268,17 @@
         _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body);
       }
     }
-    return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, null, null, name, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        null,
+        null,
+        name,
+        parameters,
+        body);
   }
 
   /**
@@ -5598,11 +7297,19 @@
    * @param returnType the return type of the method
    * @return the method declaration that was parsed
    */
-  MethodDeclaration _parseMethodDeclarationAfterReturnType(CommentAndMetadata commentAndMetadata, Token externalKeyword, Token staticKeyword, TypeName returnType) {
+  MethodDeclaration
+      _parseMethodDeclarationAfterReturnType(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, Token staticKeyword, TypeName returnType) {
     SimpleIdentifier methodName = parseSimpleIdentifier();
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
-    return _parseMethodDeclarationAfterParameters(commentAndMetadata, externalKeyword, staticKeyword, returnType, methodName, parameters);
+    return _parseMethodDeclarationAfterParameters(
+        commentAndMetadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        methodName,
+        parameters);
   }
 
   /**
@@ -5622,54 +7329,76 @@
     Modifiers modifiers = new Modifiers();
     bool progress = true;
     while (progress) {
-      if (_tokenMatches(_peek(), TokenType.PERIOD) || _tokenMatches(_peek(), TokenType.LT) || _tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
+      if (_tokenMatches(_peek(), TokenType.PERIOD) ||
+          _tokenMatches(_peek(), TokenType.LT) ||
+          _tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
         return modifiers;
       }
       if (_matchesKeyword(Keyword.ABSTRACT)) {
         if (modifiers.abstractKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.abstractKeyword = andAdvance;
         }
       } else if (_matchesKeyword(Keyword.CONST)) {
         if (modifiers.constKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.constKeyword = andAdvance;
         }
-      } else if (_matchesKeyword(Keyword.EXTERNAL) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT)) {
+      } else if (_matchesKeyword(Keyword.EXTERNAL) &&
+          !_tokenMatches(_peek(), TokenType.PERIOD) &&
+          !_tokenMatches(_peek(), TokenType.LT)) {
         if (modifiers.externalKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.externalKeyword = andAdvance;
         }
-      } else if (_matchesKeyword(Keyword.FACTORY) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT)) {
+      } else if (_matchesKeyword(Keyword.FACTORY) &&
+          !_tokenMatches(_peek(), TokenType.PERIOD) &&
+          !_tokenMatches(_peek(), TokenType.LT)) {
         if (modifiers.factoryKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.factoryKeyword = andAdvance;
         }
       } else if (_matchesKeyword(Keyword.FINAL)) {
         if (modifiers.finalKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.finalKeyword = andAdvance;
         }
-      } else if (_matchesKeyword(Keyword.STATIC) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT)) {
+      } else if (_matchesKeyword(Keyword.STATIC) &&
+          !_tokenMatches(_peek(), TokenType.PERIOD) &&
+          !_tokenMatches(_peek(), TokenType.LT)) {
         if (modifiers.staticKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.staticKeyword = andAdvance;
         }
       } else if (_matchesKeyword(Keyword.VAR)) {
         if (modifiers.varKeyword != null) {
-          _reportErrorForCurrentToken(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]);
+          _reportErrorForCurrentToken(
+              ParserErrorCode.DUPLICATED_MODIFIER,
+              [_currentToken.lexeme]);
           _advance();
         } else {
           modifiers.varKeyword = andAdvance;
@@ -5694,14 +7423,16 @@
    */
   Expression _parseMultiplicativeExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _currentToken.next.type.isMultiplicativeOperator) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _currentToken.next.type.isMultiplicativeOperator) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseUnaryExpression();
     }
     while (_currentToken.type.isMultiplicativeOperator) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseUnaryExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseUnaryExpression());
     }
     return expression;
   }
@@ -5732,7 +7463,8 @@
    *
    * @return the new expression that was parsed
    */
-  InstanceCreationExpression _parseNewExpression() => _parseInstanceCreationExpression(_expectKeyword(Keyword.NEW));
+  InstanceCreationExpression _parseNewExpression() =>
+      _parseInstanceCreationExpression(_expectKeyword(Keyword.NEW));
 
   /**
    * Parse a non-labeled statement.
@@ -5764,13 +7496,17 @@
       if (_tokenMatches(_peek(), TokenType.STRING)) {
         Token afterString = _skipStringLiteral(_currentToken.next);
         if (afterString != null && afterString.type == TokenType.COLON) {
-          return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
+          return new ExpressionStatement(
+              parseExpression2(),
+              _expect(TokenType.SEMICOLON));
         }
       }
       return parseBlock();
-    } else if (_matches(TokenType.KEYWORD) && !(_currentToken as KeywordToken).keyword.isPseudoKeyword) {
+    } else if (_matches(TokenType.KEYWORD) &&
+        !(_currentToken as KeywordToken).keyword.isPseudoKeyword) {
       Keyword keyword = (_currentToken as KeywordToken).keyword;
-      // TODO(jwren) compute some metrics to figure out a better order for this if-then sequence to optimize performance
+      // TODO(jwren) compute some metrics to figure out a better order for this
+      // if-then sequence to optimize performance
       if (keyword == Keyword.ASSERT) {
         return _parseAssertStatement();
       } else if (keyword == Keyword.BREAK) {
@@ -5784,67 +7520,94 @@
       } else if (keyword == Keyword.IF) {
         return _parseIfStatement();
       } else if (keyword == Keyword.RETHROW) {
-        return new ExpressionStatement(_parseRethrowExpression(), _expect(TokenType.SEMICOLON));
+        return new ExpressionStatement(
+            _parseRethrowExpression(),
+            _expect(TokenType.SEMICOLON));
       } else if (keyword == Keyword.RETURN) {
         return _parseReturnStatement();
       } else if (keyword == Keyword.SWITCH) {
         return _parseSwitchStatement();
       } else if (keyword == Keyword.THROW) {
-        return new ExpressionStatement(_parseThrowExpression(), _expect(TokenType.SEMICOLON));
+        return new ExpressionStatement(
+            _parseThrowExpression(),
+            _expect(TokenType.SEMICOLON));
       } else if (keyword == Keyword.TRY) {
         return _parseTryStatement();
       } else if (keyword == Keyword.WHILE) {
         return _parseWhileStatement();
       } else if (keyword == Keyword.VAR || keyword == Keyword.FINAL) {
-        return _parseVariableDeclarationStatementAfterMetadata(commentAndMetadata);
+        return _parseVariableDeclarationStatementAfterMetadata(
+            commentAndMetadata);
       } else if (keyword == Keyword.VOID) {
         TypeName returnType = parseReturnType();
-        if (_matchesIdentifier() && _peek().matchesAny([
-            TokenType.OPEN_PAREN,
-            TokenType.OPEN_CURLY_BRACKET,
-            TokenType.FUNCTION])) {
-          return _parseFunctionDeclarationStatementAfterReturnType(commentAndMetadata, returnType);
+        if (_matchesIdentifier() &&
+            _peek().matchesAny(
+                [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
+          return _parseFunctionDeclarationStatementAfterReturnType(
+              commentAndMetadata,
+              returnType);
         } else {
           //
           // We have found an error of some kind. Try to recover.
           //
           if (_matchesIdentifier()) {
-            if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
+            if (_peek().matchesAny(
+                [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
               //
               // We appear to have a variable declaration with a type of "void".
               //
               _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
-              return _parseVariableDeclarationStatementAfterMetadata(commentAndMetadata);
+              return _parseVariableDeclarationStatementAfterMetadata(
+                  commentAndMetadata);
             }
           } else if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
             //
-            // We appear to have found an incomplete statement at the end of a block. Parse it as a
-            // variable declaration.
+            // We appear to have found an incomplete statement at the end of a
+            // block. Parse it as a variable declaration.
             //
-            return _parseVariableDeclarationStatementAfterType(commentAndMetadata, null, returnType);
+            return _parseVariableDeclarationStatementAfterType(
+                commentAndMetadata,
+                null,
+                returnType);
           }
           _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
           // TODO(brianwilkerson) Recover from this error.
           return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
         }
       } else if (keyword == Keyword.CONST) {
-        if (_peek().matchesAny([
-            TokenType.LT,
-            TokenType.OPEN_CURLY_BRACKET,
-            TokenType.OPEN_SQUARE_BRACKET,
-            TokenType.INDEX])) {
-          return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
+        if (_peek().matchesAny(
+            [
+                TokenType.LT,
+                TokenType.OPEN_CURLY_BRACKET,
+                TokenType.OPEN_SQUARE_BRACKET,
+                TokenType.INDEX])) {
+          return new ExpressionStatement(
+              parseExpression2(),
+              _expect(TokenType.SEMICOLON));
         } else if (_tokenMatches(_peek(), TokenType.IDENTIFIER)) {
           Token afterType = _skipTypeName(_peek());
           if (afterType != null) {
-            if (_tokenMatches(afterType, TokenType.OPEN_PAREN) || (_tokenMatches(afterType, TokenType.PERIOD) && _tokenMatches(afterType.next, TokenType.IDENTIFIER) && _tokenMatches(afterType.next.next, TokenType.OPEN_PAREN))) {
-              return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
+            if (_tokenMatches(afterType, TokenType.OPEN_PAREN) ||
+                (_tokenMatches(afterType, TokenType.PERIOD) &&
+                    _tokenMatches(afterType.next, TokenType.IDENTIFIER) &&
+                    _tokenMatches(afterType.next.next, TokenType.OPEN_PAREN))) {
+              return new ExpressionStatement(
+                  parseExpression2(),
+                  _expect(TokenType.SEMICOLON));
             }
           }
         }
-        return _parseVariableDeclarationStatementAfterMetadata(commentAndMetadata);
-      } else if (keyword == Keyword.NEW || keyword == Keyword.TRUE || keyword == Keyword.FALSE || keyword == Keyword.NULL || keyword == Keyword.SUPER || keyword == Keyword.THIS) {
-        return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
+        return _parseVariableDeclarationStatementAfterMetadata(
+            commentAndMetadata);
+      } else if (keyword == Keyword.NEW ||
+          keyword == Keyword.TRUE ||
+          keyword == Keyword.FALSE ||
+          keyword == Keyword.NULL ||
+          keyword == Keyword.SUPER ||
+          keyword == Keyword.THIS) {
+        return new ExpressionStatement(
+            parseExpression2(),
+            _expect(TokenType.SEMICOLON));
       } else {
         //
         // We have found an error of some kind. Try to recover.
@@ -5858,25 +7621,33 @@
       if (_tokenMatchesKeyword(_peek(), Keyword.FOR)) {
         return _parseForStatement();
       }
-      return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
-    } else if (_matchesString(_AWAIT) && _tokenMatchesKeyword(_peek(), Keyword.FOR)) {
+      return new ExpressionStatement(
+          parseExpression2(),
+          _expect(TokenType.SEMICOLON));
+    } else if (_matchesString(_AWAIT) &&
+        _tokenMatchesKeyword(_peek(), Keyword.FOR)) {
       Token awaitToken = _currentToken;
       Statement statement = _parseForStatement();
       if (statement is! ForStatement) {
-        _reportErrorForToken(CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, awaitToken);
+        _reportErrorForToken(
+            CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT,
+            awaitToken);
       }
       return statement;
     } else if (_matches(TokenType.SEMICOLON)) {
       return _parseEmptyStatement();
     } else if (_isInitializedVariableDeclaration()) {
-      return _parseVariableDeclarationStatementAfterMetadata(commentAndMetadata);
+      return _parseVariableDeclarationStatementAfterMetadata(
+          commentAndMetadata);
     } else if (_isFunctionDeclaration()) {
       return _parseFunctionDeclarationStatement();
     } else if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
       return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
     } else {
-      return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
+      return new ExpressionStatement(
+          parseExpression2(),
+          _expect(TokenType.SEMICOLON));
     }
   }
 
@@ -5898,32 +7669,52 @@
    *          type
    * @return the operator declaration that was parsed
    */
-  MethodDeclaration _parseOperator(CommentAndMetadata commentAndMetadata, Token externalKeyword, TypeName returnType) {
+  MethodDeclaration _parseOperator(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, TypeName returnType) {
     Token operatorKeyword;
     if (_matchesKeyword(Keyword.OPERATOR)) {
       operatorKeyword = andAdvance;
     } else {
-      _reportErrorForToken(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken);
+      _reportErrorForToken(
+          ParserErrorCode.MISSING_KEYWORD_OPERATOR,
+          _currentToken);
       operatorKeyword = _createSyntheticKeyword(Keyword.OPERATOR);
     }
     if (!_currentToken.isUserDefinableOperator) {
-      _reportErrorForCurrentToken(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.lexeme]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.NON_USER_DEFINABLE_OPERATOR,
+          [_currentToken.lexeme]);
     }
     SimpleIdentifier name = new SimpleIdentifier(andAdvance);
     if (_matches(TokenType.EQ)) {
       Token previous = _currentToken.previous;
-      if ((_tokenMatches(previous, TokenType.EQ_EQ) || _tokenMatches(previous, TokenType.BANG_EQ)) && _currentToken.offset == previous.offset + 2) {
-        _reportErrorForCurrentToken(ParserErrorCode.INVALID_OPERATOR, ["${previous.lexeme}${_currentToken.lexeme}"]);
+      if ((_tokenMatches(previous, TokenType.EQ_EQ) ||
+          _tokenMatches(previous, TokenType.BANG_EQ)) &&
+          _currentToken.offset == previous.offset + 2) {
+        _reportErrorForCurrentToken(
+            ParserErrorCode.INVALID_OPERATOR,
+            ["${previous.lexeme}${_currentToken.lexeme}"]);
         _advance();
       }
     }
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
-    FunctionBody body = _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
+    FunctionBody body =
+        _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        null,
+        returnType,
+        null,
+        operatorKeyword,
+        name,
+        parameters,
+        body);
   }
 
   /**
@@ -5934,9 +7725,17 @@
   TypeName _parseOptionalReturnType() {
     if (_matchesKeyword(Keyword.VOID)) {
       return parseReturnType();
-    } else if (_matchesIdentifier() && !_matchesKeyword(Keyword.GET) && !_matchesKeyword(Keyword.SET) && !_matchesKeyword(Keyword.OPERATOR) && (_tokenMatchesIdentifier(_peek()) || _tokenMatches(_peek(), TokenType.LT))) {
+    } else if (_matchesIdentifier() &&
+        !_matchesKeyword(Keyword.GET) &&
+        !_matchesKeyword(Keyword.SET) &&
+        !_matchesKeyword(Keyword.OPERATOR) &&
+        (_tokenMatchesIdentifier(_peek()) || _tokenMatches(_peek(), TokenType.LT))) {
       return parseReturnType();
-    } else if (_matchesIdentifier() && _tokenMatches(_peek(), TokenType.PERIOD) && _tokenMatchesIdentifier(_peekAt(2)) && (_tokenMatchesIdentifier(_peekAt(3)) || _tokenMatches(_peekAt(3), TokenType.LT))) {
+    } else if (_matchesIdentifier() &&
+        _tokenMatches(_peek(), TokenType.PERIOD) &&
+        _tokenMatchesIdentifier(_peekAt(2)) &&
+        (_tokenMatchesIdentifier(_peekAt(3)) ||
+            _tokenMatches(_peekAt(3), TokenType.LT))) {
       return parseReturnType();
     }
     return null;
@@ -5960,13 +7759,26 @@
     Token partKeyword = _expectKeyword(Keyword.PART);
     if (_matchesString(_OF)) {
       Token ofKeyword = andAdvance;
-      LibraryIdentifier libraryName = _parseLibraryName(ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, ofKeyword);
+      LibraryIdentifier libraryName = _parseLibraryName(
+          ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE,
+          ofKeyword);
       Token semicolon = _expect(TokenType.SEMICOLON);
-      return new PartOfDirective(commentAndMetadata.comment, commentAndMetadata.metadata, partKeyword, ofKeyword, libraryName, semicolon);
+      return new PartOfDirective(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          partKeyword,
+          ofKeyword,
+          libraryName,
+          semicolon);
     }
     StringLiteral partUri = parseStringLiteral();
     Token semicolon = _expect(TokenType.SEMICOLON);
-    return new PartDirective(commentAndMetadata.comment, commentAndMetadata.metadata, partKeyword, partUri, semicolon);
+    return new PartDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        partKeyword,
+        partUri,
+        semicolon);
   }
 
   /**
@@ -5986,20 +7798,28 @@
    */
   Expression _parsePostfixExpression() {
     Expression operand = _parseAssignableExpression(true);
-    if (_matches(TokenType.OPEN_SQUARE_BRACKET) || _matches(TokenType.PERIOD) || _matches(TokenType.OPEN_PAREN)) {
+    if (_matches(TokenType.OPEN_SQUARE_BRACKET) ||
+        _matches(TokenType.PERIOD) ||
+        _matches(TokenType.OPEN_PAREN)) {
       do {
         if (_matches(TokenType.OPEN_PAREN)) {
           ArgumentList argumentList = parseArgumentList();
           if (operand is PropertyAccess) {
             PropertyAccess access = operand as PropertyAccess;
-            operand = new MethodInvocation(access.target, access.operator, access.propertyName, argumentList);
+            operand = new MethodInvocation(
+                access.target,
+                access.operator,
+                access.propertyName,
+                argumentList);
           } else {
             operand = new FunctionExpressionInvocation(operand, argumentList);
           }
         } else {
           operand = _parseAssignableSelector(operand, true);
         }
-      } while (_matches(TokenType.OPEN_SQUARE_BRACKET) || _matches(TokenType.PERIOD) || _matches(TokenType.OPEN_PAREN));
+      } while (_matches(TokenType.OPEN_SQUARE_BRACKET) ||
+          _matches(TokenType.PERIOD) ||
+          _matches(TokenType.OPEN_PAREN));
       return operand;
     }
     if (!_currentToken.type.isIncrementOperator) {
@@ -6079,19 +7899,21 @@
       return parseStringLiteral();
     } else if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
       return _parseMapLiteral(null, null);
-    } else if (_matches(TokenType.OPEN_SQUARE_BRACKET) || _matches(TokenType.INDEX)) {
+    } else if (_matches(TokenType.OPEN_SQUARE_BRACKET) ||
+        _matches(TokenType.INDEX)) {
       return _parseListLiteral(null, null);
     } else if (_matchesIdentifier()) {
-      // TODO(brianwilkerson) The code below was an attempt to recover from an error case, but it
-      // needs to be applied as a recovery only after we know that parsing it as an identifier
-      // doesn't work. Leaving the code as a reminder of how to recover.
-      //      if (isFunctionExpression(peek())) {
-      //        //
-      //        // Function expressions were allowed to have names at one point, but this is now illegal.
-      //        //
-      //        reportError(ParserErrorCode.NAMED_FUNCTION_EXPRESSION, getAndAdvance());
-      //        return parseFunctionExpression();
-      //      }
+      // TODO(brianwilkerson) The code below was an attempt to recover from an
+      // error case, but it needs to be applied as a recovery only after we
+      // know that parsing it as an identifier doesn't work. Leaving the code as
+      // a reminder of how to recover.
+//            if (isFunctionExpression(peek())) {
+//              //
+//              // Function expressions were allowed to have names at one point, but this is now illegal.
+//              //
+//              reportError(ParserErrorCode.NAMED_FUNCTION_EXPRESSION, getAndAdvance());
+//              return parseFunctionExpression();
+//            }
       return parsePrefixedIdentifier();
     } else if (_matchesKeyword(Keyword.NEW)) {
       return _parseNewExpression();
@@ -6107,22 +7929,31 @@
       try {
         Expression expression = parseExpression2();
         Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
-        return new ParenthesizedExpression(leftParenthesis, expression, rightParenthesis);
+        return new ParenthesizedExpression(
+            leftParenthesis,
+            expression,
+            rightParenthesis);
       } finally {
         _inInitializer = wasInInitializer;
       }
     } else if (_matches(TokenType.LT)) {
       return _parseListOrMapLiteral(null);
-    } else if (_matches(TokenType.QUESTION) && _tokenMatches(_peek(), TokenType.IDENTIFIER)) {
-      _reportErrorForCurrentToken(ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]);
+    } else if (_matches(TokenType.QUESTION) &&
+        _tokenMatches(_peek(), TokenType.IDENTIFIER)) {
+      _reportErrorForCurrentToken(
+          ParserErrorCode.UNEXPECTED_TOKEN,
+          [_currentToken.lexeme]);
       _advance();
       return _parsePrimaryExpression();
     } else if (_matchesKeyword(Keyword.VOID)) {
       //
-      // Recover from having a return type of "void" where a return type is not expected.
+      // Recover from having a return type of "void" where a return type is not
+      // expected.
       //
       // TODO(brianwilkerson) Improve this error message.
-      _reportErrorForCurrentToken(ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]);
+      _reportErrorForCurrentToken(
+          ParserErrorCode.UNEXPECTED_TOKEN,
+          [_currentToken.lexeme]);
       _advance();
       return _parsePrimaryExpression();
     } else if (_matches(TokenType.HASH)) {
@@ -6152,7 +7983,11 @@
       constructorName = parseSimpleIdentifier();
     }
     ArgumentList argumentList = parseArgumentList();
-    return new RedirectingConstructorInvocation(keyword, period, constructorName, argumentList);
+    return new RedirectingConstructorInvocation(
+        keyword,
+        period,
+        constructorName,
+        argumentList);
   }
 
   /**
@@ -6167,10 +8002,12 @@
    * @return the relational expression that was parsed
    */
   Expression _parseRelationalExpression() {
-    if (_matchesKeyword(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _currentToken.next.type.isRelationalOperator) {
       Expression expression = new SuperExpression(andAdvance);
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, parseBitwiseOrExpression());
+      expression =
+          new BinaryExpression(expression, operator, parseBitwiseOrExpression());
       return expression;
     }
     Expression expression = parseBitwiseOrExpression();
@@ -6183,10 +8020,12 @@
       if (_matches(TokenType.BANG)) {
         notOperator = andAdvance;
       }
-      expression = new IsExpression(expression, isOperator, notOperator, parseTypeName());
+      expression =
+          new IsExpression(expression, isOperator, notOperator, parseTypeName());
     } else if (_currentToken.type.isRelationalOperator) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, parseBitwiseOrExpression());
+      expression =
+          new BinaryExpression(expression, operator, parseBitwiseOrExpression());
     }
     return expression;
   }
@@ -6201,7 +8040,8 @@
    *
    * @return the rethrow expression that was parsed
    */
-  Expression _parseRethrowExpression() => new RethrowExpression(_expectKeyword(Keyword.RETHROW));
+  Expression _parseRethrowExpression() =>
+      new RethrowExpression(_expectKeyword(Keyword.RETHROW));
 
   /**
    * Parse a return statement.
@@ -6242,16 +8082,30 @@
    *          type
    * @return the setter that was parsed
    */
-  MethodDeclaration _parseSetter(CommentAndMetadata commentAndMetadata, Token externalKeyword, Token staticKeyword, TypeName returnType) {
+  MethodDeclaration _parseSetter(CommentAndMetadata commentAndMetadata,
+      Token externalKeyword, Token staticKeyword, TypeName returnType) {
     Token propertyKeyword = _expectKeyword(Keyword.SET);
     SimpleIdentifier name = parseSimpleIdentifier();
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
-    FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false);
+    FunctionBody body = _parseFunctionBody(
+        externalKeyword != null || staticKeyword == null,
+        ParserErrorCode.STATIC_SETTER_WITHOUT_BODY,
+        false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null, name, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        propertyKeyword,
+        null,
+        name,
+        parameters,
+        body);
   }
 
   /**
@@ -6267,14 +8121,16 @@
    */
   Expression _parseShiftExpression() {
     Expression expression;
-    if (_matchesKeyword(Keyword.SUPER) && _currentToken.next.type.isShiftOperator) {
+    if (_matchesKeyword(Keyword.SUPER) &&
+        _currentToken.next.type.isShiftOperator) {
       expression = new SuperExpression(andAdvance);
     } else {
       expression = _parseAdditiveExpression();
     }
     while (_currentToken.type.isShiftOperator) {
       Token operator = andAdvance;
-      expression = new BinaryExpression(expression, operator, _parseAdditiveExpression());
+      expression =
+          new BinaryExpression(expression, operator, _parseAdditiveExpression());
     }
     return expression;
   }
@@ -6292,10 +8148,15 @@
   List<Statement> _parseStatementList() {
     List<Statement> statements = new List<Statement>();
     Token statementStart = _currentToken;
-    while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET) && !_isSwitchMember()) {
+    while (!_matches(TokenType.EOF) &&
+        !_matches(TokenType.CLOSE_CURLY_BRACKET) &&
+        !_isSwitchMember()) {
       statements.add(parseStatement2());
       if (identical(_currentToken, statementStart)) {
-        _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentToken.lexeme]);
+        _reportErrorForToken(
+            ParserErrorCode.UNEXPECTED_TOKEN,
+            _currentToken,
+            [_currentToken.lexeme]);
         _advance();
       }
       statementStart = _currentToken;
@@ -6310,8 +8171,13 @@
    */
   StringInterpolation _parseStringInterpolation(Token string) {
     List<InterpolationElement> elements = new List<InterpolationElement>();
-    bool hasMore = _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER);
-    elements.add(new InterpolationString(string, _computeStringValue(string.lexeme, true, !hasMore)));
+    bool hasMore =
+        _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) ||
+        _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER);
+    elements.add(
+        new InterpolationString(
+            string,
+            _computeStringValue(string.lexeme, true, !hasMore)));
     while (hasMore) {
       if (_matches(TokenType.STRING_INTERPOLATION_EXPRESSION)) {
         Token openToken = andAdvance;
@@ -6320,7 +8186,8 @@
         try {
           Expression expression = parseExpression2();
           Token rightBracket = _expect(TokenType.CLOSE_CURLY_BRACKET);
-          elements.add(new InterpolationExpression(openToken, expression, rightBracket));
+          elements.add(
+              new InterpolationExpression(openToken, expression, rightBracket));
         } finally {
           _inInitializer = wasInInitializer;
         }
@@ -6336,8 +8203,12 @@
       }
       if (_matches(TokenType.STRING)) {
         string = andAdvance;
-        hasMore = _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER);
-        elements.add(new InterpolationString(string, _computeStringValue(string.lexeme, false, !hasMore)));
+        hasMore = _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) ||
+            _matches(TokenType.STRING_INTERPOLATION_IDENTIFIER);
+        elements.add(
+            new InterpolationString(
+                string,
+                _computeStringValue(string.lexeme, false, !hasMore)));
       } else {
         hasMore = false;
       }
@@ -6364,7 +8235,11 @@
       constructorName = parseSimpleIdentifier();
     }
     ArgumentList argumentList = parseArgumentList();
-    return new SuperConstructorInvocation(keyword, period, constructorName, argumentList);
+    return new SuperConstructorInvocation(
+        keyword,
+        period,
+        constructorName,
+        argumentList);
   }
 
   /**
@@ -6395,13 +8270,18 @@
       Token leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET);
       Token defaultKeyword = null;
       List<SwitchMember> members = new List<SwitchMember>();
-      while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET)) {
+      while (!_matches(TokenType.EOF) &&
+          !_matches(TokenType.CLOSE_CURLY_BRACKET)) {
         List<Label> labels = new List<Label>();
-        while (_matchesIdentifier() && _tokenMatches(_peek(), TokenType.COLON)) {
+        while (_matchesIdentifier() &&
+            _tokenMatches(_peek(), TokenType.COLON)) {
           SimpleIdentifier identifier = parseSimpleIdentifier();
           String label = identifier.token.lexeme;
           if (definedLabels.contains(label)) {
-            _reportErrorForToken(ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, identifier.token, [label]);
+            _reportErrorForToken(
+                ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
+                identifier.token,
+                [label]);
           } else {
             definedLabels.add(label);
           }
@@ -6412,28 +8292,49 @@
           Token caseKeyword = andAdvance;
           Expression caseExpression = parseExpression2();
           Token colon = _expect(TokenType.COLON);
-          members.add(new SwitchCase(labels, caseKeyword, caseExpression, colon, _parseStatementList()));
+          members.add(
+              new SwitchCase(
+                  labels,
+                  caseKeyword,
+                  caseExpression,
+                  colon,
+                  _parseStatementList()));
           if (defaultKeyword != null) {
-            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, caseKeyword);
+            _reportErrorForToken(
+                ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
+                caseKeyword);
           }
         } else if (_matchesKeyword(Keyword.DEFAULT)) {
           if (defaultKeyword != null) {
-            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, _peek());
+            _reportErrorForToken(
+                ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
+                _peek());
           }
           defaultKeyword = andAdvance;
           Token colon = _expect(TokenType.COLON);
-          members.add(new SwitchDefault(labels, defaultKeyword, colon, _parseStatementList()));
+          members.add(
+              new SwitchDefault(labels, defaultKeyword, colon, _parseStatementList()));
         } else {
-          // We need to advance, otherwise we could end up in an infinite loop, but this could be a
-          // lot smarter about recovering from the error.
+          // We need to advance, otherwise we could end up in an infinite loop,
+          // but this could be a lot smarter about recovering from the error.
           _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_CASE_OR_DEFAULT);
-          while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET) && !_matchesKeyword(Keyword.CASE) && !_matchesKeyword(Keyword.DEFAULT)) {
+          while (!_matches(TokenType.EOF) &&
+              !_matches(TokenType.CLOSE_CURLY_BRACKET) &&
+              !_matchesKeyword(Keyword.CASE) &&
+              !_matchesKeyword(Keyword.DEFAULT)) {
             _advance();
           }
         }
       }
       Token rightBracket = _expect(TokenType.CLOSE_CURLY_BRACKET);
-      return new SwitchStatement(keyword, leftParenthesis, expression, rightParenthesis, leftBracket, members, rightBracket);
+      return new SwitchStatement(
+          keyword,
+          leftParenthesis,
+          expression,
+          rightParenthesis,
+          leftBracket,
+          members,
+          rightBracket);
     } finally {
       _inSwitch = wasInSwitch;
     }
@@ -6488,7 +8389,9 @@
   Expression _parseThrowExpression() {
     Token keyword = _expectKeyword(Keyword.THROW);
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) {
-      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken);
+      _reportErrorForToken(
+          ParserErrorCode.MISSING_EXPRESSION_IN_THROW,
+          _currentToken);
       return new ThrowExpression(keyword, _createSyntheticIdentifier());
     }
     Expression expression = parseExpression2();
@@ -6508,7 +8411,9 @@
   Expression _parseThrowExpressionWithoutCascade() {
     Token keyword = _expectKeyword(Keyword.THROW);
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) {
-      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken);
+      _reportErrorForToken(
+          ParserErrorCode.MISSING_EXPRESSION_IN_THROW,
+          _currentToken);
       return new ThrowExpression(keyword, _createSyntheticIdentifier());
     }
     Expression expression = parseExpressionWithoutCascade();
@@ -6564,7 +8469,17 @@
         rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       }
       Block catchBody = parseBlock();
-      catchClauses.add(new CatchClause(onKeyword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParenthesis, catchBody));
+      catchClauses.add(
+          new CatchClause(
+              onKeyword,
+              exceptionType,
+              catchKeyword,
+              leftParenthesis,
+              exceptionParameter,
+              comma,
+              stackTraceParameter,
+              rightParenthesis,
+              catchBody));
     }
     Token finallyKeyword = null;
     if (_matchesKeyword(Keyword.FINALLY)) {
@@ -6575,7 +8490,12 @@
         _reportErrorForCurrentToken(ParserErrorCode.MISSING_CATCH_OR_FINALLY);
       }
     }
-    return new TryStatement(tryKeyword, body, catchClauses, finallyKeyword, finallyClause);
+    return new TryStatement(
+        tryKeyword,
+        body,
+        catchClauses,
+        finallyKeyword,
+        finallyClause);
   }
 
   /**
@@ -6612,13 +8532,19 @@
       if (_tokenMatches(next, TokenType.LT)) {
         next = _skipTypeParameterList(next);
         if (next != null && _tokenMatches(next, TokenType.EQ)) {
-          TypeAlias typeAlias = _parseClassTypeAlias(commentAndMetadata, null, keyword);
-          _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword);
+          TypeAlias typeAlias =
+              _parseClassTypeAlias(commentAndMetadata, null, keyword);
+          _reportErrorForToken(
+              ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS,
+              keyword);
           return typeAlias;
         }
       } else if (_tokenMatches(next, TokenType.EQ)) {
-        TypeAlias typeAlias = _parseClassTypeAlias(commentAndMetadata, null, keyword);
-        _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword);
+        TypeAlias typeAlias =
+            _parseClassTypeAlias(commentAndMetadata, null, keyword);
+        _reportErrorForToken(
+            ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS,
+            keyword);
         return typeAlias;
       }
     }
@@ -6641,10 +8567,13 @@
    * @return the unary expression that was parsed
    */
   Expression _parseUnaryExpression() {
-    if (_matches(TokenType.MINUS) || _matches(TokenType.BANG) || _matches(TokenType.TILDE)) {
+    if (_matches(TokenType.MINUS) ||
+        _matches(TokenType.BANG) ||
+        _matches(TokenType.TILDE)) {
       Token operator = andAdvance;
       if (_matchesKeyword(Keyword.SUPER)) {
-        if (_tokenMatches(_peek(), TokenType.OPEN_SQUARE_BRACKET) || _tokenMatches(_peek(), TokenType.PERIOD)) {
+        if (_tokenMatches(_peek(), TokenType.OPEN_SQUARE_BRACKET) ||
+            _tokenMatches(_peek(), TokenType.PERIOD)) {
           //     "prefixOperator unaryExpression"
           // --> "prefixOperator postfixExpression"
           // --> "prefixOperator primary                    selector*"
@@ -6657,14 +8586,17 @@
     } else if (_currentToken.type.isIncrementOperator) {
       Token operator = andAdvance;
       if (_matchesKeyword(Keyword.SUPER)) {
-        if (_tokenMatches(_peek(), TokenType.OPEN_SQUARE_BRACKET) || _tokenMatches(_peek(), TokenType.PERIOD)) {
+        if (_tokenMatches(_peek(), TokenType.OPEN_SQUARE_BRACKET) ||
+            _tokenMatches(_peek(), TokenType.PERIOD)) {
           // --> "prefixOperator 'super' assignableSelector selector*"
           return new PrefixExpression(operator, _parseUnaryExpression());
         }
         //
-        // Even though it is not valid to use an incrementing operator ('++' or '--') before 'super',
-        // we can (and therefore must) interpret "--super" as semantically equivalent to "-(-super)".
-        // Unfortunately, we cannot do the same for "++super" because "+super" is also not valid.
+        // Even though it is not valid to use an incrementing operator
+        // ('++' or '--') before 'super', we can (and therefore must) interpret
+        // "--super" as semantically equivalent to "-(-super)". Unfortunately,
+        // we cannot do the same for "++super" because "+super" is also not
+        // valid.
         //
         if (operator.type == TokenType.MINUS_MINUS) {
           int offset = operator.offset;
@@ -6673,11 +8605,17 @@
           secondOperator.setNext(_currentToken);
           firstOperator.setNext(secondOperator);
           operator.previous.setNext(firstOperator);
-          return new PrefixExpression(firstOperator, new PrefixExpression(secondOperator, new SuperExpression(andAdvance)));
+          return new PrefixExpression(
+              firstOperator,
+              new PrefixExpression(secondOperator, new SuperExpression(andAdvance)));
         } else {
           // Invalid operator before 'super'
-          _reportErrorForCurrentToken(ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, [operator.lexeme]);
-          return new PrefixExpression(operator, new SuperExpression(andAdvance));
+          _reportErrorForCurrentToken(
+              ParserErrorCode.INVALID_OPERATOR_FOR_SUPER,
+              [operator.lexeme]);
+          return new PrefixExpression(
+              operator,
+              new SuperExpression(andAdvance));
         }
       }
       return new PrefixExpression(operator, _parseAssignableExpression(false));
@@ -6709,7 +8647,12 @@
       equals = andAdvance;
       initializer = parseExpression2();
     }
-    return new VariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, name, equals, initializer);
+    return new VariableDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        name,
+        equals,
+        initializer);
   }
 
   /**
@@ -6723,9 +8666,13 @@
    * @param commentAndMetadata the metadata to be associated with the variable declaration list
    * @return the variable declaration list that was parsed
    */
-  VariableDeclarationList _parseVariableDeclarationListAfterMetadata(CommentAndMetadata commentAndMetadata) {
+  VariableDeclarationList
+      _parseVariableDeclarationListAfterMetadata(CommentAndMetadata commentAndMetadata) {
     FinalConstVarOrType holder = _parseFinalConstVarOrType(false);
-    return _parseVariableDeclarationListAfterType(commentAndMetadata, holder.keyword, holder.type);
+    return _parseVariableDeclarationListAfterType(
+        commentAndMetadata,
+        holder.keyword,
+        holder.type);
   }
 
   /**
@@ -6743,8 +8690,12 @@
    * @param type the type of the variables in the list
    * @return the variable declaration list that was parsed
    */
-  VariableDeclarationList _parseVariableDeclarationListAfterType(CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) {
-    if (type != null && keyword != null && _tokenMatchesKeyword(keyword, Keyword.VAR)) {
+  VariableDeclarationList
+      _parseVariableDeclarationListAfterType(CommentAndMetadata commentAndMetadata,
+      Token keyword, TypeName type) {
+    if (type != null &&
+        keyword != null &&
+        _tokenMatchesKeyword(keyword, Keyword.VAR)) {
       _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, keyword);
     }
     List<VariableDeclaration> variables = new List<VariableDeclaration>();
@@ -6753,7 +8704,12 @@
       _advance();
       variables.add(_parseVariableDeclaration());
     }
-    return new VariableDeclarationList(commentAndMetadata != null ? commentAndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.metadata : null, keyword, type, variables);
+    return new VariableDeclarationList(
+        commentAndMetadata != null ? commentAndMetadata.comment : null,
+        commentAndMetadata != null ? commentAndMetadata.metadata : null,
+        keyword,
+        type,
+        variables);
   }
 
   /**
@@ -6768,15 +8724,17 @@
    *          statement, or `null` if there is no attempt at parsing the comment and metadata
    * @return the variable declaration statement that was parsed
    */
-  VariableDeclarationStatement _parseVariableDeclarationStatementAfterMetadata(CommentAndMetadata commentAndMetadata) {
+  VariableDeclarationStatement
+      _parseVariableDeclarationStatementAfterMetadata(CommentAndMetadata commentAndMetadata) {
     //    Token startToken = currentToken;
-    VariableDeclarationList variableList = _parseVariableDeclarationListAfterMetadata(commentAndMetadata);
-    //    if (!matches(TokenType.SEMICOLON)) {
-    //      if (matches(startToken, Keyword.VAR) && isTypedIdentifier(startToken.getNext())) {
-    //        // TODO(brianwilkerson) This appears to be of the form "var type variable". We should do
-    //        // a better job of recovering in this case.
-    //      }
-    //    }
+    VariableDeclarationList variableList =
+        _parseVariableDeclarationListAfterMetadata(commentAndMetadata);
+//        if (!matches(TokenType.SEMICOLON)) {
+//          if (matches(startToken, Keyword.VAR) && isTypedIdentifier(startToken.getNext())) {
+//            // TODO(brianwilkerson) This appears to be of the form "var type variable". We should do
+//            // a better job of recovering in this case.
+//          }
+//        }
     Token semicolon = _expect(TokenType.SEMICOLON);
     return new VariableDeclarationStatement(variableList, semicolon);
   }
@@ -6796,8 +8754,11 @@
    * @param type the type of the variables in the list
    * @return the variable declaration statement that was parsed
    */
-  VariableDeclarationStatement _parseVariableDeclarationStatementAfterType(CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) {
-    VariableDeclarationList variableList = _parseVariableDeclarationListAfterType(commentAndMetadata, keyword, type);
+  VariableDeclarationStatement
+      _parseVariableDeclarationStatementAfterType(CommentAndMetadata commentAndMetadata,
+      Token keyword, TypeName type) {
+    VariableDeclarationList variableList =
+        _parseVariableDeclarationListAfterType(commentAndMetadata, keyword, type);
     Token semicolon = _expect(TokenType.SEMICOLON);
     return new VariableDeclarationStatement(variableList, semicolon);
   }
@@ -6821,7 +8782,12 @@
       Expression condition = parseExpression2();
       Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       Statement body = parseStatement2();
-      return new WhileStatement(keyword, leftParenthesis, condition, rightParenthesis, body);
+      return new WhileStatement(
+          keyword,
+          leftParenthesis,
+          condition,
+          rightParenthesis,
+          body);
     } finally {
       _inLoop = wasInLoop;
     }
@@ -6889,7 +8855,8 @@
    * @param errorCode the error code of the error to be reported
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForCurrentToken(ParserErrorCode errorCode, [List<Object> arguments]) {
+  void _reportErrorForCurrentToken(ParserErrorCode errorCode,
+      [List<Object> arguments]) {
     _reportErrorForToken(errorCode, _currentToken, arguments);
   }
 
@@ -6900,8 +8867,15 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForNode(ParserErrorCode errorCode, AstNode node, [List<Object> arguments]) {
-    _reportError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, arguments));
+  void _reportErrorForNode(ParserErrorCode errorCode, AstNode node,
+      [List<Object> arguments]) {
+    _reportError(
+        new AnalysisError.con2(
+            _source,
+            node.offset,
+            node.length,
+            errorCode,
+            arguments));
   }
 
   /**
@@ -6911,11 +8885,18 @@
    * @param token the token specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
+  void _reportErrorForToken(ErrorCode errorCode, Token token,
+      [List<Object> arguments]) {
     if (token.type == TokenType.EOF) {
       token = token.previous;
     }
-    _reportError(new AnalysisError.con2(_source, token.offset, math.max(token.length, 1), errorCode, arguments));
+    _reportError(
+        new AnalysisError.con2(
+            _source,
+            token.offset,
+            math.max(token.length, 1),
+            errorCode,
+            arguments));
   }
 
   /**
@@ -6929,7 +8910,10 @@
         _currentToken = endToken;
         endToken = _currentToken.next;
       }
-      _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, ["}"]);
+      _reportErrorForToken(
+          ParserErrorCode.EXPECTED_TOKEN,
+          _currentToken.previous,
+          ["}"]);
     } else {
       _currentToken = endToken.next;
     }
@@ -6953,12 +8937,15 @@
    * @return the token following the type that was parsed
    */
   Token _skipFinalConstVarOrType(Token startToken) {
-    if (_tokenMatchesKeyword(startToken, Keyword.FINAL) || _tokenMatchesKeyword(startToken, Keyword.CONST)) {
+    if (_tokenMatchesKeyword(startToken, Keyword.FINAL) ||
+        _tokenMatchesKeyword(startToken, Keyword.CONST)) {
       Token next = startToken.next;
       if (_tokenMatchesIdentifier(next)) {
         Token next2 = next.next;
         // "Type parameter" or "Type<" or "prefix.Type"
-        if (_tokenMatchesIdentifier(next2) || _tokenMatches(next2, TokenType.LT) || _tokenMatches(next2, TokenType.PERIOD)) {
+        if (_tokenMatchesIdentifier(next2) ||
+            _tokenMatches(next2, TokenType.LT) ||
+            _tokenMatches(next2, TokenType.PERIOD)) {
           return _skipTypeName(next);
         }
         // "parameter"
@@ -6968,7 +8955,14 @@
       return startToken.next;
     } else if (_tokenMatchesIdentifier(startToken)) {
       Token next = startToken.next;
-      if (_tokenMatchesIdentifier(next) || _tokenMatches(next, TokenType.LT) || _tokenMatchesKeyword(next, Keyword.THIS) || (_tokenMatches(next, TokenType.PERIOD) && _tokenMatchesIdentifier(next.next) && (_tokenMatchesIdentifier(next.next.next) || _tokenMatches(next.next.next, TokenType.LT) || _tokenMatchesKeyword(next.next.next, Keyword.THIS)))) {
+      if (_tokenMatchesIdentifier(next) ||
+          _tokenMatches(next, TokenType.LT) ||
+          _tokenMatchesKeyword(next, Keyword.THIS) ||
+          (_tokenMatches(next, TokenType.PERIOD) &&
+              _tokenMatchesIdentifier(next.next) &&
+              (_tokenMatchesIdentifier(next.next.next) ||
+                  _tokenMatches(next.next.next, TokenType.LT) ||
+                  _tokenMatchesKeyword(next.next.next, Keyword.THIS)))) {
         return _skipReturnType(startToken);
       }
     }
@@ -7021,27 +9015,31 @@
       return next.next;
     }
     //
-    // Look to see whether the token after the open parenthesis is something that should only occur
-    // at the beginning of a parameter list.
+    // Look to see whether the token after the open parenthesis is something
+    // that should only occur at the beginning of a parameter list.
     //
-    if (next.matchesAny([
-        TokenType.AT,
-        TokenType.OPEN_SQUARE_BRACKET,
-        TokenType.OPEN_CURLY_BRACKET]) || _tokenMatchesKeyword(next, Keyword.VOID) || (_tokenMatchesIdentifier(next) && (next.next.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
+    if (next.matchesAny(
+        [TokenType.AT, TokenType.OPEN_SQUARE_BRACKET, TokenType.OPEN_CURLY_BRACKET]) ||
+        _tokenMatchesKeyword(next, Keyword.VOID) ||
+        (_tokenMatchesIdentifier(next) &&
+            (next.next.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
       return _skipPastMatchingToken(startToken);
     }
     //
-    // Look to see whether the first parameter is a function typed parameter without a return type.
+    // Look to see whether the first parameter is a function typed parameter
+    // without a return type.
     //
-    if (_tokenMatchesIdentifier(next) && _tokenMatches(next.next, TokenType.OPEN_PAREN)) {
+    if (_tokenMatchesIdentifier(next) &&
+        _tokenMatches(next.next, TokenType.OPEN_PAREN)) {
       Token afterParameters = _skipFormalParameterList(next.next);
-      if (afterParameters != null && (afterParameters.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN]))) {
+      if (afterParameters != null &&
+          (afterParameters.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN]))) {
         return _skipPastMatchingToken(startToken);
       }
     }
     //
-    // Look to see whether the first parameter has a type or is a function typed parameter with a
-    // return type.
+    // Look to see whether the first parameter has a type or is a function typed
+    // parameter with a return type.
     //
     Token afterType = _skipFinalConstVarOrType(next);
     if (afterType == null) {
@@ -7138,7 +9136,9 @@
    * @return the token following the simple identifier that was parsed
    */
   Token _skipSimpleIdentifier(Token startToken) {
-    if (_tokenMatches(startToken, TokenType.IDENTIFIER) || (_tokenMatches(startToken, TokenType.KEYWORD) && (startToken as KeywordToken).keyword.isPseudoKeyword)) {
+    if (_tokenMatches(startToken, TokenType.IDENTIFIER) ||
+        (_tokenMatches(startToken, TokenType.KEYWORD) &&
+            (startToken as KeywordToken).keyword.isPseudoKeyword)) {
       return startToken.next;
     }
     return null;
@@ -7158,14 +9158,15 @@
   Token _skipStringInterpolation(Token startToken) {
     Token token = startToken;
     TokenType type = token.type;
-    while (type == TokenType.STRING_INTERPOLATION_EXPRESSION || type == TokenType.STRING_INTERPOLATION_IDENTIFIER) {
+    while (type == TokenType.STRING_INTERPOLATION_EXPRESSION ||
+        type == TokenType.STRING_INTERPOLATION_IDENTIFIER) {
       if (type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
         token = token.next;
         type = token.type;
         //
-        // Rather than verify that the following tokens represent a valid expression, we simply skip
-        // tokens until we reach the end of the interpolation, being careful to handle nested string
-        // literals.
+        // Rather than verify that the following tokens represent a valid
+        // expression, we simply skip tokens until we reach the end of the
+        // interpolation, being careful to handle nested string literals.
         //
         int bracketNestingLevel = 1;
         while (bracketNestingLevel > 0) {
@@ -7224,7 +9225,8 @@
     while (token != null && _tokenMatches(token, TokenType.STRING)) {
       token = token.next;
       TokenType type = token.type;
-      if (type == TokenType.STRING_INTERPOLATION_EXPRESSION || type == TokenType.STRING_INTERPOLATION_IDENTIFIER) {
+      if (type == TokenType.STRING_INTERPOLATION_EXPRESSION ||
+          type == TokenType.STRING_INTERPOLATION_IDENTIFIER) {
         token = _skipStringInterpolation(token);
       }
     }
@@ -7324,8 +9326,8 @@
       return null;
     }
     //
-    // We can't skip a type parameter because it can be preceeded by metadata, so we just assume
-    // that everything before the matching end token is valid.
+    // We can't skip a type parameter because it can be preceeded by metadata,
+    // so we just assume that everything before the matching end token is valid.
     //
     int depth = 1;
     Token next = startToken.next;
@@ -7375,7 +9377,10 @@
    *
    * @return `true` if the given token is a valid identifier
    */
-  bool _tokenMatchesIdentifier(Token token) => _tokenMatches(token, TokenType.IDENTIFIER) || (_tokenMatches(token, TokenType.KEYWORD) && (token as KeywordToken).keyword.isPseudoKeyword);
+  bool _tokenMatchesIdentifier(Token token) =>
+      _tokenMatches(token, TokenType.IDENTIFIER) ||
+          (_tokenMatches(token, TokenType.KEYWORD) &&
+              (token as KeywordToken).keyword.isPseudoKeyword);
 
   /**
    * Return `true` if the given token matches the given keyword.
@@ -7384,7 +9389,8 @@
    * @param keyword the keyword that is being tested for
    * @return `true` if the given token matches the given keyword
    */
-  bool _tokenMatchesKeyword(Token token, Keyword keyword) => token.type == TokenType.KEYWORD && (token as KeywordToken).keyword == keyword;
+  bool _tokenMatchesKeyword(Token token, Keyword keyword) =>
+      token.type == TokenType.KEYWORD && (token as KeywordToken).keyword == keyword;
 
   /**
    * Return `true` if the given token matches the given identifier.
@@ -7393,7 +9399,8 @@
    * @param identifier the identifier that can optionally appear in the current location
    * @return `true` if the current token matches the given identifier
    */
-  bool _tokenMatchesString(Token token, String identifier) => token.type == TokenType.IDENTIFIER && token.lexeme == identifier;
+  bool _tokenMatchesString(Token token, String identifier) =>
+      token.type == TokenType.IDENTIFIER && token.lexeme == identifier;
 
   /**
    * Translate the characters at the given [index] in the given [lexeme],
@@ -7451,8 +9458,9 @@
         // Illegal escape sequence: invalid hex digit
         _reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE);
       } else {
-        int charCode = (Character.digit(firstDigit, 16) << 4)
-            + Character.digit(secondDigit, 16);
+        int charCode =
+            (Character.digit(firstDigit, 16) << 4) +
+            Character.digit(secondDigit, 16);
         buffer.writeCharCode(charCode);
       }
       return currentIndex + 3;
@@ -7479,8 +9487,8 @@
             // Illegal escape sequence: invalid hex digit
             _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
             currentIndex++;
-            while (currentIndex < length
-                && lexeme.codeUnitAt(currentIndex) != 0x7D) {
+            while (currentIndex < length &&
+                lexeme.codeUnitAt(currentIndex) != 0x7D) {
               currentIndex++;
             }
             return currentIndex + 1;
@@ -7516,20 +9524,22 @@
         int secondDigit = lexeme.codeUnitAt(currentIndex + 1);
         int thirdDigit = lexeme.codeUnitAt(currentIndex + 2);
         int fourthDigit = lexeme.codeUnitAt(currentIndex + 3);
-        if (!_isHexDigit(firstDigit)
-            || !_isHexDigit(secondDigit)
-            || !_isHexDigit(thirdDigit)
-            || !_isHexDigit(fourthDigit)) {
+        if (!_isHexDigit(firstDigit) ||
+            !_isHexDigit(secondDigit) ||
+            !_isHexDigit(thirdDigit) ||
+            !_isHexDigit(fourthDigit)) {
           // Illegal escape sequence: invalid hex digits
           _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
         } else {
           _appendScalarValue(
               buffer,
               lexeme.substring(index, currentIndex + 1),
-              (((((Character.digit(firstDigit, 16) << 4)
-                  + Character.digit(secondDigit, 16)) << 4)
-                  + Character.digit(thirdDigit, 16)) << 4)
-                  + Character.digit(fourthDigit, 16),
+              (((((Character.digit(firstDigit, 16) << 4) +
+                  Character.digit(secondDigit, 16)) <<
+                  4) +
+                  Character.digit(thirdDigit, 16)) <<
+                  4) +
+                  Character.digit(fourthDigit, 16),
               index,
               currentIndex + 3);
         }
@@ -7547,7 +9557,8 @@
    */
   void _unlockErrorListener() {
     if (_errorListenerLock == 0) {
-      throw new IllegalStateException("Attempt to unlock not locked error listener.");
+      throw new IllegalStateException(
+          "Attempt to unlock not locked error listener.");
     }
     _errorListenerLock--;
   }
@@ -7560,7 +9571,9 @@
   void _validateFormalParameterList(FormalParameterList parameterList) {
     for (FormalParameter parameter in parameterList.parameters) {
       if (parameter is FieldFormalParameter) {
-        _reportErrorForNode(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, parameter.identifier);
+        _reportErrorForNode(
+            ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+            parameter.identifier);
       }
     }
   }
@@ -7577,7 +9590,9 @@
       _reportErrorForToken(ParserErrorCode.CONST_CLASS, modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_CLASS,
+          modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
       _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword);
@@ -7597,25 +9612,41 @@
    */
   Token _validateModifiersForConstructor(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, modifiers.abstractKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.ABSTRACT_CLASS_MEMBER,
+          modifiers.abstractKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.FINAL_CONSTRUCTOR,
+          modifiers.finalKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.STATIC_CONSTRUCTOR,
+          modifiers.staticKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE,
+          modifiers.varKeyword);
     }
     Token externalKeyword = modifiers.externalKeyword;
     Token constKeyword = modifiers.constKeyword;
     Token factoryKeyword = modifiers.factoryKeyword;
-    if (externalKeyword != null && constKeyword != null && constKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword);
+    if (externalKeyword != null &&
+        constKeyword != null &&
+        constKeyword.offset < externalKeyword.offset) {
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_AFTER_CONST,
+          externalKeyword);
     }
-    if (externalKeyword != null && factoryKeyword != null && factoryKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword);
+    if (externalKeyword != null &&
+        factoryKeyword != null &&
+        factoryKeyword.offset < externalKeyword.offset) {
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_AFTER_FACTORY,
+          externalKeyword);
     }
     return constKeyword;
   }
@@ -7629,13 +9660,17 @@
   void _validateModifiersForEnum(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_ENUM, modifiers.abstractKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.ABSTRACT_ENUM,
+          modifiers.abstractKeyword);
     }
     if (modifiers.constKeyword != null) {
       _reportErrorForToken(ParserErrorCode.CONST_ENUM, modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_ENUM, modifiers.externalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_ENUM,
+          modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
       _reportErrorForToken(ParserErrorCode.FINAL_ENUM, modifiers.finalKeyword);
@@ -7657,10 +9692,14 @@
       _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_FIELD,
+          modifiers.externalKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.NON_CONSTRUCTOR_FACTORY,
+          modifiers.factoryKeyword);
     }
     Token staticKeyword = modifiers.staticKeyword;
     Token constKeyword = modifiers.constKeyword;
@@ -7683,10 +9722,12 @@
       if (staticKeyword != null && finalKeyword.offset < staticKeyword.offset) {
         _reportErrorForToken(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword);
       }
-    } else if (varKeyword != null && staticKeyword != null && varKeyword.offset < staticKeyword.offset) {
+    } else if (varKeyword != null &&
+        staticKeyword != null &&
+        varKeyword.offset < staticKeyword.offset) {
       _reportErrorForToken(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword);
     }
-    return _lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
+    return Token.lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
   }
 
   /**
@@ -7695,8 +9736,15 @@
    * @param modifiers the modifiers being validated
    */
   void _validateModifiersForFunctionDeclarationStatement(Modifiers modifiers) {
-    if (modifiers.abstractKeyword != null || modifiers.constKeyword != null || modifiers.externalKeyword != null || modifiers.factoryKeyword != null || modifiers.finalKeyword != null || modifiers.staticKeyword != null || modifiers.varKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER);
+    if (modifiers.abstractKeyword != null ||
+        modifiers.constKeyword != null ||
+        modifiers.externalKeyword != null ||
+        modifiers.factoryKeyword != null ||
+        modifiers.finalKeyword != null ||
+        modifiers.staticKeyword != null ||
+        modifiers.varKeyword != null) {
+      _reportErrorForCurrentToken(
+          ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER);
     }
   }
 
@@ -7710,21 +9758,33 @@
       _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONST_METHOD,
+          modifiers.constKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.NON_CONSTRUCTOR_FACTORY,
+          modifiers.factoryKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.FINAL_METHOD,
+          modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.VAR_RETURN_TYPE,
+          modifiers.varKeyword);
     }
     Token externalKeyword = modifiers.externalKeyword;
     Token staticKeyword = modifiers.staticKeyword;
-    if (externalKeyword != null && staticKeyword != null && staticKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword);
+    if (externalKeyword != null &&
+        staticKeyword != null &&
+        staticKeyword.offset < externalKeyword.offset) {
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_AFTER_STATIC,
+          externalKeyword);
     }
   }
 
@@ -7738,19 +9798,29 @@
       _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONST_METHOD,
+          modifiers.constKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.NON_CONSTRUCTOR_FACTORY,
+          modifiers.factoryKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.FINAL_METHOD,
+          modifiers.finalKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.STATIC_OPERATOR,
+          modifiers.staticKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.VAR_RETURN_TYPE,
+          modifiers.varKeyword);
     }
   }
 
@@ -7761,10 +9831,14 @@
    */
   void _validateModifiersForTopLevelDeclaration(Modifiers modifiers) {
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, modifiers.factoryKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION,
+          modifiers.factoryKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, modifiers.staticKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION,
+          modifiers.staticKeyword);
     }
   }
 
@@ -7785,7 +9859,9 @@
       _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.VAR_RETURN_TYPE,
+          modifiers.varKeyword);
     }
   }
 
@@ -7802,7 +9878,9 @@
       _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_FIELD,
+          modifiers.externalKeyword);
     }
     Token constKeyword = modifiers.constKeyword;
     Token finalKeyword = modifiers.finalKeyword;
@@ -7819,7 +9897,7 @@
         _reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword);
       }
     }
-    return _lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
+    return Token.lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
   }
 
   /**
@@ -7831,22 +9909,50 @@
   void _validateModifiersForTypedef(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.ABSTRACT_TYPEDEF,
+          modifiers.abstractKeyword);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.CONST_TYPEDEF,
+          modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.EXTERNAL_TYPEDEF,
+          modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword);
+      _reportErrorForToken(
+          ParserErrorCode.FINAL_TYPEDEF,
+          modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
       _reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword);
     }
   }
 }
+/**
+ * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
+ */
+class Parser_SyntheticKeywordToken extends KeywordToken {
+  /**
+   * Initialize a newly created token to represent the given keyword.
+   *
+   * @param keyword the keyword being represented by this token
+   * @param offset the offset from the beginning of the file to the first character in the token
+   */
+  Parser_SyntheticKeywordToken(Keyword keyword, int offset)
+      : super(keyword, offset);
+
+  @override
+  int get length => 0;
+
+  @override
+  Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
+}
+
 
 /**
  * The enumeration `ParserErrorCode` defines the error codes used for errors
@@ -7856,315 +9962,664 @@
  * problem can be corrected.
  */
 class ParserErrorCode extends ErrorCode {
-  static const ParserErrorCode ABSTRACT_CLASS_MEMBER= const ParserErrorCode('ABSTRACT_CLASS_MEMBER', "Members of classes cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_CLASS_MEMBER = const ParserErrorCode(
+      'ABSTRACT_CLASS_MEMBER',
+      "Members of classes cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode('ABSTRACT_ENUM', "Enums cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode(
+      'ABSTRACT_ENUM',
+      "Enums cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode('ABSTRACT_STATIC_METHOD', "Static methods cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode(
+      'ABSTRACT_STATIC_METHOD',
+      "Static methods cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = const ParserErrorCode('ABSTRACT_TOP_LEVEL_FUNCTION', "Top-level functions cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION =
+      const ParserErrorCode(
+          'ABSTRACT_TOP_LEVEL_FUNCTION',
+          "Top-level functions cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = const ParserErrorCode('ABSTRACT_TOP_LEVEL_VARIABLE', "Top-level variables cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE =
+      const ParserErrorCode(
+          'ABSTRACT_TOP_LEVEL_VARIABLE',
+          "Top-level variables cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode('ABSTRACT_TYPEDEF', "Type aliases cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode(
+      'ABSTRACT_TYPEDEF',
+      "Type aliases cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', "Assert cannot be called on an assignment");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT =
+      const ParserErrorCode(
+          'ASSERT_DOES_NOT_TAKE_ASSIGNMENT',
+          "Assert cannot be called on an assignment");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_CASCADE', "Assert cannot be called on cascade");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE =
+      const ParserErrorCode(
+          'ASSERT_DOES_NOT_TAKE_CASCADE',
+          "Assert cannot be called on cascade");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_THROW', "Assert cannot be called on throws");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW =
+      const ParserErrorCode(
+          'ASSERT_DOES_NOT_TAKE_THROW',
+          "Assert cannot be called on throws");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_RETHROW', "Assert cannot be called on rethrows");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW =
+      const ParserErrorCode(
+          'ASSERT_DOES_NOT_TAKE_RETHROW',
+          "Assert cannot be called on rethrows");
 
-  static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode('BREAK_OUTSIDE_OF_LOOP', "A break statement cannot be used outside of a loop or switch statement");
+  static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode(
+      'BREAK_OUTSIDE_OF_LOOP',
+      "A break statement cannot be used outside of a loop or switch statement");
 
-  static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode('CONST_AND_FINAL', "Members cannot be declared to be both 'const' and 'final'");
+  static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode(
+      'CONST_AND_FINAL',
+      "Members cannot be declared to be both 'const' and 'final'");
 
-  static const ParserErrorCode CONST_AND_VAR = const ParserErrorCode('CONST_AND_VAR', "Members cannot be declared to be both 'const' and 'var'");
+  static const ParserErrorCode CONST_AND_VAR = const ParserErrorCode(
+      'CONST_AND_VAR',
+      "Members cannot be declared to be both 'const' and 'var'");
 
-  static const ParserErrorCode CONST_CLASS = const ParserErrorCode('CONST_CLASS', "Classes cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_CLASS = const ParserErrorCode(
+      'CONST_CLASS',
+      "Classes cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = const ParserErrorCode('CONST_CONSTRUCTOR_WITH_BODY', "'const' constructors cannot have a body");
+  static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY =
+      const ParserErrorCode(
+          'CONST_CONSTRUCTOR_WITH_BODY',
+          "'const' constructors cannot have a body");
 
-  static const ParserErrorCode CONST_ENUM = const ParserErrorCode('CONST_ENUM', "Enums cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_ENUM =
+      const ParserErrorCode('CONST_ENUM', "Enums cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_FACTORY = const ParserErrorCode('CONST_FACTORY', "Only redirecting factory constructors can be declared to be 'const'");
+  static const ParserErrorCode CONST_FACTORY = const ParserErrorCode(
+      'CONST_FACTORY',
+      "Only redirecting factory constructors can be declared to be 'const'");
 
-  static const ParserErrorCode CONST_METHOD = const ParserErrorCode('CONST_METHOD', "Getters, setters and methods cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_METHOD = const ParserErrorCode(
+      'CONST_METHOD',
+      "Getters, setters and methods cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode('CONST_TYPEDEF', "Type aliases cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode(
+      'CONST_TYPEDEF',
+      "Type aliases cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = const ParserErrorCode('CONSTRUCTOR_WITH_RETURN_TYPE', "Constructors cannot have a return type");
+  static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE =
+      const ParserErrorCode(
+          'CONSTRUCTOR_WITH_RETURN_TYPE',
+          "Constructors cannot have a return type");
 
-  static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode('CONTINUE_OUTSIDE_OF_LOOP', "A continue statement cannot be used outside of a loop or switch statement");
+  static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode(
+      'CONTINUE_OUTSIDE_OF_LOOP',
+      "A continue statement cannot be used outside of a loop or switch statement");
 
-  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE', "A continue statement in a switch statement must have a label as a target");
+  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE =
+      const ParserErrorCode(
+          'CONTINUE_WITHOUT_LABEL_IN_CASE',
+          "A continue statement in a switch statement must have a label as a target");
 
-  static const ParserErrorCode DEFERRED_IMPORTS_NOT_SUPPORTED = const ParserErrorCode('DEFERRED_IMPORTS_NOT_SUPPORTED', "Deferred imports are not supported by default");
+  static const ParserErrorCode DEFERRED_IMPORTS_NOT_SUPPORTED =
+      const ParserErrorCode(
+          'DEFERRED_IMPORTS_NOT_SUPPORTED',
+          "Deferred imports are not supported by default");
 
-  static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = const ParserErrorCode('DEPRECATED_CLASS_TYPE_ALIAS', "The 'typedef' mixin application was replaced with 'class'");
+  static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS =
+      const ParserErrorCode(
+          'DEPRECATED_CLASS_TYPE_ALIAS',
+          "The 'typedef' mixin application was replaced with 'class'");
 
-  static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION = const ParserErrorCode('DIRECTIVE_AFTER_DECLARATION', "Directives must appear before any declarations");
+  static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION =
+      const ParserErrorCode(
+          'DIRECTIVE_AFTER_DECLARATION',
+          "Directives must appear before any declarations");
 
-  static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', "The label {0} was already used in this switch statement");
+  static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT =
+      const ParserErrorCode(
+          'DUPLICATE_LABEL_IN_SWITCH_STATEMENT',
+          "The label {0} was already used in this switch statement");
 
-  static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode('DUPLICATED_MODIFIER', "The modifier '{0}' was already specified.");
+  static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode(
+      'DUPLICATED_MODIFIER',
+      "The modifier '{0}' was already specified.");
 
-  static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode('EMPTY_ENUM_BODY', "An enum must declare at least one constant name");
+  static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode(
+      'EMPTY_ENUM_BODY',
+      "An enum must declare at least one constant name");
 
-  static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', "Equality expression cannot be operand of another equality expression.");
+  static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND =
+      const ParserErrorCode(
+          'EQUALITY_CANNOT_BE_EQUALITY_OPERAND',
+          "Equality expression cannot be operand of another equality expression.");
 
-  static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode('EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'");
+  static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode(
+      'EXPECTED_CASE_OR_DEFAULT',
+      "Expected 'case' or 'default'");
 
-  static const ParserErrorCode EXPECTED_CLASS_MEMBER = const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member");
+  static const ParserErrorCode EXPECTED_CLASS_MEMBER =
+      const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member");
 
-  static const ParserErrorCode EXPECTED_EXECUTABLE = const ParserErrorCode('EXPECTED_EXECUTABLE', "Expected a method, getter, setter or operator declaration");
+  static const ParserErrorCode EXPECTED_EXECUTABLE = const ParserErrorCode(
+      'EXPECTED_EXECUTABLE',
+      "Expected a method, getter, setter or operator declaration");
 
-  static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = const ParserErrorCode('EXPECTED_LIST_OR_MAP_LITERAL', "Expected a list or map literal");
+  static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL =
+      const ParserErrorCode(
+          'EXPECTED_LIST_OR_MAP_LITERAL',
+          "Expected a list or map literal");
 
-  static const ParserErrorCode EXPECTED_STRING_LITERAL = const ParserErrorCode('EXPECTED_STRING_LITERAL', "Expected a string literal");
+  static const ParserErrorCode EXPECTED_STRING_LITERAL =
+      const ParserErrorCode('EXPECTED_STRING_LITERAL', "Expected a string literal");
 
-  static const ParserErrorCode EXPECTED_TOKEN = const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'");
+  static const ParserErrorCode EXPECTED_TOKEN =
+      const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'");
 
-  static const ParserErrorCode EXPECTED_TYPE_NAME = const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name");
+  static const ParserErrorCode EXPECTED_TYPE_NAME =
+      const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name");
 
-  static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Export directives must preceed part directives");
+  static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE =
+      const ParserErrorCode(
+          'EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
+          "Export directives must preceed part directives");
 
-  static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode('EXTERNAL_AFTER_CONST', "The modifier 'external' should be before the modifier 'const'");
+  static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode(
+      'EXTERNAL_AFTER_CONST',
+      "The modifier 'external' should be before the modifier 'const'");
 
-  static const ParserErrorCode EXTERNAL_AFTER_FACTORY = const ParserErrorCode('EXTERNAL_AFTER_FACTORY', "The modifier 'external' should be before the modifier 'factory'");
+  static const ParserErrorCode EXTERNAL_AFTER_FACTORY = const ParserErrorCode(
+      'EXTERNAL_AFTER_FACTORY',
+      "The modifier 'external' should be before the modifier 'factory'");
 
-  static const ParserErrorCode EXTERNAL_AFTER_STATIC = const ParserErrorCode('EXTERNAL_AFTER_STATIC', "The modifier 'external' should be before the modifier 'static'");
+  static const ParserErrorCode EXTERNAL_AFTER_STATIC = const ParserErrorCode(
+      'EXTERNAL_AFTER_STATIC',
+      "The modifier 'external' should be before the modifier 'static'");
 
-  static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode('EXTERNAL_CLASS', "Classes cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode(
+      'EXTERNAL_CLASS',
+      "Classes cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = const ParserErrorCode('EXTERNAL_CONSTRUCTOR_WITH_BODY', "External constructors cannot have a body");
+  static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY =
+      const ParserErrorCode(
+          'EXTERNAL_CONSTRUCTOR_WITH_BODY',
+          "External constructors cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode('EXTERNAL_ENUM', "Enums cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode(
+      'EXTERNAL_ENUM',
+      "Enums cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode('EXTERNAL_FIELD', "Fields cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode(
+      'EXTERNAL_FIELD',
+      "Fields cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = const ParserErrorCode('EXTERNAL_GETTER_WITH_BODY', "External getters cannot have a body");
+  static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY =
+      const ParserErrorCode(
+          'EXTERNAL_GETTER_WITH_BODY',
+          "External getters cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY = const ParserErrorCode('EXTERNAL_METHOD_WITH_BODY', "External methods cannot have a body");
+  static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY =
+      const ParserErrorCode(
+          'EXTERNAL_METHOD_WITH_BODY',
+          "External methods cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = const ParserErrorCode('EXTERNAL_OPERATOR_WITH_BODY', "External operators cannot have a body");
+  static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY =
+      const ParserErrorCode(
+          'EXTERNAL_OPERATOR_WITH_BODY',
+          "External operators cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = const ParserErrorCode('EXTERNAL_SETTER_WITH_BODY', "External setters cannot have a body");
+  static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY =
+      const ParserErrorCode(
+          'EXTERNAL_SETTER_WITH_BODY',
+          "External setters cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode('EXTERNAL_TYPEDEF', "Type aliases cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode(
+      'EXTERNAL_TYPEDEF',
+      "Type aliases cannot be declared to be 'external'");
 
-  static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = const ParserErrorCode('FACTORY_TOP_LEVEL_DECLARATION', "Top-level declarations cannot be declared to be 'factory'");
+  static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION =
+      const ParserErrorCode(
+          'FACTORY_TOP_LEVEL_DECLARATION',
+          "Top-level declarations cannot be declared to be 'factory'");
 
-  static const ParserErrorCode FACTORY_WITH_INITIALIZERS
-      = const ParserErrorCode(
+  static const ParserErrorCode FACTORY_WITH_INITIALIZERS =
+      const ParserErrorCode(
           'FACTORY_WITH_INITIALIZERS',
           "A 'factory' constructor cannot have initializers",
           "Either remove the 'factory' keyword to make this a generative "
-          "constructor or remove the initializers.");
+              "constructor or remove the initializers.");
 
-  static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode('FACTORY_WITHOUT_BODY', "A non-redirecting 'factory' constructor must have a body");
+  static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode(
+      'FACTORY_WITHOUT_BODY',
+      "A non-redirecting 'factory' constructor must have a body");
 
-  static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const ParserErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Field initializers can only be used in a constructor");
+  static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR =
+      const ParserErrorCode(
+          'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR',
+          "Field initializers can only be used in a constructor");
 
-  static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode('FINAL_AND_VAR', "Members cannot be declared to be both 'final' and 'var'");
+  static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode(
+      'FINAL_AND_VAR',
+      "Members cannot be declared to be both 'final' and 'var'");
 
-  static const ParserErrorCode FINAL_CLASS = const ParserErrorCode('FINAL_CLASS', "Classes cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_CLASS = const ParserErrorCode(
+      'FINAL_CLASS',
+      "Classes cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode('FINAL_CONSTRUCTOR', "A constructor cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode(
+      'FINAL_CONSTRUCTOR',
+      "A constructor cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_ENUM = const ParserErrorCode('FINAL_ENUM', "Enums cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_ENUM =
+      const ParserErrorCode('FINAL_ENUM', "Enums cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_METHOD = const ParserErrorCode('FINAL_METHOD', "Getters, setters and methods cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_METHOD = const ParserErrorCode(
+      'FINAL_METHOD',
+      "Getters, setters and methods cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode('FINAL_TYPEDEF', "Type aliases cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode(
+      'FINAL_TYPEDEF',
+      "Type aliases cannot be declared to be 'final'");
 
-  static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = const ParserErrorCode('FUNCTION_TYPED_PARAMETER_VAR', "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type");
+  static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR =
+      const ParserErrorCode(
+          'FUNCTION_TYPED_PARAMETER_VAR',
+          "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type");
 
-  static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode('GETTER_IN_FUNCTION', "Getters cannot be defined within methods or functions");
+  static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode(
+      'GETTER_IN_FUNCTION',
+      "Getters cannot be defined within methods or functions");
 
-  static const ParserErrorCode GETTER_WITH_PARAMETERS = const ParserErrorCode('GETTER_WITH_PARAMETERS', "Getter should be declared without a parameter list");
+  static const ParserErrorCode GETTER_WITH_PARAMETERS = const ParserErrorCode(
+      'GETTER_WITH_PARAMETERS',
+      "Getter should be declared without a parameter list");
 
-  static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = const ParserErrorCode('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', "Illegal assignment to non-assignable expression");
+  static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE =
+      const ParserErrorCode(
+          'ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE',
+          "Illegal assignment to non-assignable expression");
 
-  static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = const ParserErrorCode('IMPLEMENTS_BEFORE_EXTENDS', "The extends clause must be before the implements clause");
+  static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS =
+      const ParserErrorCode(
+          'IMPLEMENTS_BEFORE_EXTENDS',
+          "The extends clause must be before the implements clause");
 
-  static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode('IMPLEMENTS_BEFORE_WITH', "The with clause must be before the implements clause");
+  static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode(
+      'IMPLEMENTS_BEFORE_WITH',
+      "The with clause must be before the implements clause");
 
-  static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Import directives must preceed part directives");
+  static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE =
+      const ParserErrorCode(
+          'IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE',
+          "Import directives must preceed part directives");
 
-  static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = const ParserErrorCode('INITIALIZED_VARIABLE_IN_FOR_EACH', "The loop variable in a for-each loop cannot be initialized");
+  static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH =
+      const ParserErrorCode(
+          'INITIALIZED_VARIABLE_IN_FOR_EACH',
+          "The loop variable in a for-each loop cannot be initialized");
 
-  static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode('INVALID_AWAIT_IN_FOR', "The modifier 'await' is not allowed for a normal 'for' statement", "Remove the keyword or use a for-each statement.");
+  static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode(
+      'INVALID_AWAIT_IN_FOR',
+      "The modifier 'await' is not allowed for a normal 'for' statement",
+      "Remove the keyword or use a for-each statement.");
 
-  static const ParserErrorCode INVALID_CODE_POINT = const ParserErrorCode('INVALID_CODE_POINT', "The escape sequence '{0}' is not a valid code point");
+  static const ParserErrorCode INVALID_CODE_POINT = const ParserErrorCode(
+      'INVALID_CODE_POINT',
+      "The escape sequence '{0}' is not a valid code point");
 
-  static const ParserErrorCode INVALID_COMMENT_REFERENCE = const ParserErrorCode('INVALID_COMMENT_REFERENCE', "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
+  static const ParserErrorCode INVALID_COMMENT_REFERENCE =
+      const ParserErrorCode(
+          'INVALID_COMMENT_REFERENCE',
+          "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
 
-  static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode('INVALID_HEX_ESCAPE', "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
+  static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode(
+      'INVALID_HEX_ESCAPE',
+      "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
 
-  static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode('INVALID_OPERATOR', "The string '{0}' is not a valid operator");
+  static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode(
+      'INVALID_OPERATOR',
+      "The string '{0}' is not a valid operator");
 
-  static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = const ParserErrorCode('INVALID_OPERATOR_FOR_SUPER', "The operator '{0}' cannot be used with 'super'");
+  static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER =
+      const ParserErrorCode(
+          'INVALID_OPERATOR_FOR_SUPER',
+          "The operator '{0}' cannot be used with 'super'");
 
-  static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode('INVALID_STAR_AFTER_ASYNC', "The modifier 'async*' is not allowed for an expression function body", "Convert the body to a block.");
+  static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode(
+      'INVALID_STAR_AFTER_ASYNC',
+      "The modifier 'async*' is not allowed for an expression function body",
+      "Convert the body to a block.");
 
-  static const ParserErrorCode INVALID_SYNC = const ParserErrorCode('INVALID_SYNC', "The modifier 'sync' is not allowed for an exrpression function body", "Convert the body to a block.");
+  static const ParserErrorCode INVALID_SYNC = const ParserErrorCode(
+      'INVALID_SYNC',
+      "The modifier 'sync' is not allowed for an exrpression function body",
+      "Convert the body to a block.");
 
-  static const ParserErrorCode INVALID_UNICODE_ESCAPE = const ParserErrorCode('INVALID_UNICODE_ESCAPE', "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
+  static const ParserErrorCode INVALID_UNICODE_ESCAPE = const ParserErrorCode(
+      'INVALID_UNICODE_ESCAPE',
+      "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
 
-  static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = const ParserErrorCode('LIBRARY_DIRECTIVE_NOT_FIRST', "The library directive must appear before all other directives");
+  static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST =
+      const ParserErrorCode(
+          'LIBRARY_DIRECTIVE_NOT_FIRST',
+          "The library directive must appear before all other directives");
 
-  static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = const ParserErrorCode('LOCAL_FUNCTION_DECLARATION_MODIFIER', "Local function declarations cannot specify any modifier");
+  static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER =
+      const ParserErrorCode(
+          'LOCAL_FUNCTION_DECLARATION_MODIFIER',
+          "Local function declarations cannot specify any modifier");
 
-  static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = const ParserErrorCode('MISSING_ASSIGNABLE_SELECTOR', "Missing selector such as \".<identifier>\" or \"[0]\"");
+  static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR =
+      const ParserErrorCode(
+          'MISSING_ASSIGNABLE_SELECTOR',
+          "Missing selector such as \".<identifier>\" or \"[0]\"");
 
-  static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER
-      = const ParserErrorCode(
+  static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER =
+      const ParserErrorCode(
           'MISSING_ASSIGNMENT_IN_INITIALIZER',
           "Expected an assignment after the field name");
 
-  static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode('MISSING_CATCH_OR_FINALLY', "A try statement must have either a catch or finally clause");
+  static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode(
+      'MISSING_CATCH_OR_FINALLY',
+      "A try statement must have either a catch or finally clause");
 
-  static const ParserErrorCode MISSING_CLASS_BODY = const ParserErrorCode('MISSING_CLASS_BODY', "A class definition must have a body, even if it is empty");
+  static const ParserErrorCode MISSING_CLASS_BODY = const ParserErrorCode(
+      'MISSING_CLASS_BODY',
+      "A class definition must have a body, even if it is empty");
 
-  static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = const ParserErrorCode('MISSING_CLOSING_PARENTHESIS', "The closing parenthesis is missing");
+  static const ParserErrorCode MISSING_CLOSING_PARENTHESIS =
+      const ParserErrorCode(
+          'MISSING_CLOSING_PARENTHESIS',
+          "The closing parenthesis is missing");
 
-  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = const ParserErrorCode('MISSING_CONST_FINAL_VAR_OR_TYPE', "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
+  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE =
+      const ParserErrorCode(
+          'MISSING_CONST_FINAL_VAR_OR_TYPE',
+          "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
 
-  static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode('MISSING_ENUM_BODY', "An enum definition must have a body with at least one constant name");
+  static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode(
+      'MISSING_ENUM_BODY',
+      "An enum definition must have a body with at least one constant name");
 
-  static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER
-      = const ParserErrorCode(
+  static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER =
+      const ParserErrorCode(
           'MISSING_EXPRESSION_IN_INITIALIZER',
           "Expected an expression after the assignment operator");
 
-  static const ParserErrorCode MISSING_EXPRESSION_IN_THROW = const ParserErrorCode('MISSING_EXPRESSION_IN_THROW', "Throw expressions must compute the object to be thrown");
+  static const ParserErrorCode MISSING_EXPRESSION_IN_THROW =
+      const ParserErrorCode(
+          'MISSING_EXPRESSION_IN_THROW',
+          "Throw expressions must compute the object to be thrown");
 
-  static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode('MISSING_FUNCTION_BODY', "A function body must be provided");
+  static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode(
+      'MISSING_FUNCTION_BODY',
+      "A function body must be provided");
 
-  static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = const ParserErrorCode('MISSING_FUNCTION_PARAMETERS', "Functions must have an explicit list of parameters");
+  static const ParserErrorCode MISSING_FUNCTION_PARAMETERS =
+      const ParserErrorCode(
+          'MISSING_FUNCTION_PARAMETERS',
+          "Functions must have an explicit list of parameters");
 
-  static const ParserErrorCode MISSING_GET = const ParserErrorCode('MISSING_GET', "Getters must have the keyword 'get' before the getter name");
+  static const ParserErrorCode MISSING_GET = const ParserErrorCode(
+      'MISSING_GET',
+      "Getters must have the keyword 'get' before the getter name");
 
-  static const ParserErrorCode MISSING_IDENTIFIER = const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier");
+  static const ParserErrorCode MISSING_IDENTIFIER =
+      const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier");
 
-  static const ParserErrorCode MISSING_INITIALIZER
-      = const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer");
+  static const ParserErrorCode MISSING_INITIALIZER =
+      const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer");
 
-  static const ParserErrorCode MISSING_KEYWORD_OPERATOR = const ParserErrorCode('MISSING_KEYWORD_OPERATOR', "Operator declarations must be preceeded by the keyword 'operator'");
+  static const ParserErrorCode MISSING_KEYWORD_OPERATOR = const ParserErrorCode(
+      'MISSING_KEYWORD_OPERATOR',
+      "Operator declarations must be preceeded by the keyword 'operator'");
 
-  static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = const ParserErrorCode('MISSING_NAME_IN_LIBRARY_DIRECTIVE', "Library directives must include a library name");
+  static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE =
+      const ParserErrorCode(
+          'MISSING_NAME_IN_LIBRARY_DIRECTIVE',
+          "Library directives must include a library name");
 
-  static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = const ParserErrorCode('MISSING_NAME_IN_PART_OF_DIRECTIVE', "Library directives must include a library name");
+  static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE =
+      const ParserErrorCode(
+          'MISSING_NAME_IN_PART_OF_DIRECTIVE',
+          "Library directives must include a library name");
 
-  static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT = const ParserErrorCode('MISSING_PREFIX_IN_DEFERRED_IMPORT', "Deferred imports must have a prefix");
+  static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT =
+      const ParserErrorCode(
+          'MISSING_PREFIX_IN_DEFERRED_IMPORT',
+          "Deferred imports must have a prefix");
 
-  static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode('MISSING_STAR_AFTER_SYNC', "The modifier 'sync' must be followed by a star ('*')", "Remove the modifier or add a star.");
+  static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode(
+      'MISSING_STAR_AFTER_SYNC',
+      "The modifier 'sync' must be followed by a star ('*')",
+      "Remove the modifier or add a star.");
 
-  static const ParserErrorCode MISSING_STATEMENT = const ParserErrorCode('MISSING_STATEMENT', "Expected a statement");
+  static const ParserErrorCode MISSING_STATEMENT =
+      const ParserErrorCode('MISSING_STATEMENT', "Expected a statement");
 
-  static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to close the parameter group");
+  static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP =
+      const ParserErrorCode(
+          'MISSING_TERMINATOR_FOR_PARAMETER_GROUP',
+          "There is no '{0}' to close the parameter group");
 
-  static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = const ParserErrorCode('MISSING_TYPEDEF_PARAMETERS', "Type aliases for functions must have an explicit list of parameters");
+  static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS =
+      const ParserErrorCode(
+          'MISSING_TYPEDEF_PARAMETERS',
+          "Type aliases for functions must have an explicit list of parameters");
 
-  static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = const ParserErrorCode('MISSING_VARIABLE_IN_FOR_EACH', "A loop variable must be declared in a for-each loop before the 'in', but none were found");
+  static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH =
+      const ParserErrorCode(
+          'MISSING_VARIABLE_IN_FOR_EACH',
+          "A loop variable must be declared in a for-each loop before the 'in', but none were found");
 
-  static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode('MIXED_PARAMETER_GROUPS', "Cannot have both positional and named parameters in a single parameter list");
+  static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode(
+      'MIXED_PARAMETER_GROUPS',
+      "Cannot have both positional and named parameters in a single parameter list");
 
-  static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = const ParserErrorCode('MULTIPLE_EXTENDS_CLAUSES', "Each class definition can have at most one extends clause");
+  static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = const ParserErrorCode(
+      'MULTIPLE_EXTENDS_CLAUSES',
+      "Each class definition can have at most one extends clause");
 
-  static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = const ParserErrorCode('MULTIPLE_IMPLEMENTS_CLAUSES', "Each class definition can have at most one implements clause");
+  static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES =
+      const ParserErrorCode(
+          'MULTIPLE_IMPLEMENTS_CLAUSES',
+          "Each class definition can have at most one implements clause");
 
-  static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = const ParserErrorCode('MULTIPLE_LIBRARY_DIRECTIVES', "Only one library directive may be declared in a file");
+  static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES =
+      const ParserErrorCode(
+          'MULTIPLE_LIBRARY_DIRECTIVES',
+          "Only one library directive may be declared in a file");
 
-  static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = const ParserErrorCode('MULTIPLE_NAMED_PARAMETER_GROUPS', "Cannot have multiple groups of named parameters in a single parameter list");
+  static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS =
+      const ParserErrorCode(
+          'MULTIPLE_NAMED_PARAMETER_GROUPS',
+          "Cannot have multiple groups of named parameters in a single parameter list");
 
-  static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = const ParserErrorCode('MULTIPLE_PART_OF_DIRECTIVES', "Only one part-of directive may be declared in a file");
+  static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES =
+      const ParserErrorCode(
+          'MULTIPLE_PART_OF_DIRECTIVES',
+          "Only one part-of directive may be declared in a file");
 
-  static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = const ParserErrorCode('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', "Cannot have multiple groups of positional parameters in a single parameter list");
+  static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS =
+      const ParserErrorCode(
+          'MULTIPLE_POSITIONAL_PARAMETER_GROUPS',
+          "Cannot have multiple groups of positional parameters in a single parameter list");
 
-  static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = const ParserErrorCode('MULTIPLE_VARIABLES_IN_FOR_EACH', "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found");
+  static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH =
+      const ParserErrorCode(
+          'MULTIPLE_VARIABLES_IN_FOR_EACH',
+          "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found");
 
-  static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode('MULTIPLE_WITH_CLAUSES', "Each class definition can have at most one with clause");
+  static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode(
+      'MULTIPLE_WITH_CLAUSES',
+      "Each class definition can have at most one with clause");
 
-  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = const ParserErrorCode('NAMED_FUNCTION_EXPRESSION', "Function expressions cannot be named");
+  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION =
+      const ParserErrorCode(
+          'NAMED_FUNCTION_EXPRESSION',
+          "Function expressions cannot be named");
 
-  static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode('NAMED_PARAMETER_OUTSIDE_GROUP', "Named parameters must be enclosed in curly braces ('{' and '}')");
+  static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP =
+      const ParserErrorCode(
+          'NAMED_PARAMETER_OUTSIDE_GROUP',
+          "Named parameters must be enclosed in curly braces ('{' and '}')");
 
-  static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = const ParserErrorCode('NATIVE_CLAUSE_IN_NON_SDK_CODE', "Native clause can only be used in the SDK and code that is loaded through native extensions");
+  static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE =
+      const ParserErrorCode(
+          'NATIVE_CLAUSE_IN_NON_SDK_CODE',
+          "Native clause can only be used in the SDK and code that is loaded through native extensions");
 
-  static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = const ParserErrorCode('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', "Native functions can only be declared in the SDK and code that is loaded through native extensions");
+  static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE =
+      const ParserErrorCode(
+          'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE',
+          "Native functions can only be declared in the SDK and code that is loaded through native extensions");
 
-  static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode('NON_CONSTRUCTOR_FACTORY', "Only constructors can be declared to be a 'factory'");
+  static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode(
+      'NON_CONSTRUCTOR_FACTORY',
+      "Only constructors can be declared to be a 'factory'");
 
-  static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = const ParserErrorCode('NON_IDENTIFIER_LIBRARY_NAME', "The name of a library must be an identifier");
+  static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME =
+      const ParserErrorCode(
+          'NON_IDENTIFIER_LIBRARY_NAME',
+          "The name of a library must be an identifier");
 
-  static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = const ParserErrorCode('NON_PART_OF_DIRECTIVE_IN_PART', "The part-of directive must be the only directive in a part");
+  static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART =
+      const ParserErrorCode(
+          'NON_PART_OF_DIRECTIVE_IN_PART',
+          "The part-of directive must be the only directive in a part");
 
-  static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR = const ParserErrorCode('NON_USER_DEFINABLE_OPERATOR', "The operator '{0}' is not user definable");
+  static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR =
+      const ParserErrorCode(
+          'NON_USER_DEFINABLE_OPERATOR',
+          "The operator '{0}' is not user definable");
 
-  static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = const ParserErrorCode('NORMAL_BEFORE_OPTIONAL_PARAMETERS', "Normal parameters must occur before optional parameters");
+  static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS =
+      const ParserErrorCode(
+          'NORMAL_BEFORE_OPTIONAL_PARAMETERS',
+          "Normal parameters must occur before optional parameters");
 
-  static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = const ParserErrorCode('POSITIONAL_AFTER_NAMED_ARGUMENT', "Positional arguments must occur before named arguments");
+  static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT =
+      const ParserErrorCode(
+          'POSITIONAL_AFTER_NAMED_ARGUMENT',
+          "Positional arguments must occur before named arguments");
 
-  static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode('POSITIONAL_PARAMETER_OUTSIDE_GROUP', "Positional parameters must be enclosed in square brackets ('[' and ']')");
+  static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP =
+      const ParserErrorCode(
+          'POSITIONAL_PARAMETER_OUTSIDE_GROUP',
+          "Positional parameters must be enclosed in square brackets ('[' and ']')");
 
-  static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = const ParserErrorCode('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', "Only factory constructor can specify '=' redirection.");
+  static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR =
+      const ParserErrorCode(
+          'REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR',
+          "Only factory constructor can specify '=' redirection.");
 
-  static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode('SETTER_IN_FUNCTION', "Setters cannot be defined within methods or functions");
+  static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode(
+      'SETTER_IN_FUNCTION',
+      "Setters cannot be defined within methods or functions");
 
-  static const ParserErrorCode STATIC_AFTER_CONST = const ParserErrorCode('STATIC_AFTER_CONST', "The modifier 'static' should be before the modifier 'const'");
+  static const ParserErrorCode STATIC_AFTER_CONST = const ParserErrorCode(
+      'STATIC_AFTER_CONST',
+      "The modifier 'static' should be before the modifier 'const'");
 
-  static const ParserErrorCode STATIC_AFTER_FINAL = const ParserErrorCode('STATIC_AFTER_FINAL', "The modifier 'static' should be before the modifier 'final'");
+  static const ParserErrorCode STATIC_AFTER_FINAL = const ParserErrorCode(
+      'STATIC_AFTER_FINAL',
+      "The modifier 'static' should be before the modifier 'final'");
 
-  static const ParserErrorCode STATIC_AFTER_VAR = const ParserErrorCode('STATIC_AFTER_VAR', "The modifier 'static' should be before the modifier 'var'");
+  static const ParserErrorCode STATIC_AFTER_VAR = const ParserErrorCode(
+      'STATIC_AFTER_VAR',
+      "The modifier 'static' should be before the modifier 'var'");
 
-  static const ParserErrorCode STATIC_CONSTRUCTOR = const ParserErrorCode('STATIC_CONSTRUCTOR', "Constructors cannot be static");
+  static const ParserErrorCode STATIC_CONSTRUCTOR =
+      const ParserErrorCode('STATIC_CONSTRUCTOR', "Constructors cannot be static");
 
-  static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = const ParserErrorCode('STATIC_GETTER_WITHOUT_BODY', "A 'static' getter must have a body");
+  static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY =
+      const ParserErrorCode(
+          'STATIC_GETTER_WITHOUT_BODY',
+          "A 'static' getter must have a body");
 
-  static const ParserErrorCode STATIC_OPERATOR = const ParserErrorCode('STATIC_OPERATOR', "Operators cannot be static");
+  static const ParserErrorCode STATIC_OPERATOR =
+      const ParserErrorCode('STATIC_OPERATOR', "Operators cannot be static");
 
-  static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = const ParserErrorCode('STATIC_SETTER_WITHOUT_BODY', "A 'static' setter must have a body");
+  static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY =
+      const ParserErrorCode(
+          'STATIC_SETTER_WITHOUT_BODY',
+          "A 'static' setter must have a body");
 
-  static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = const ParserErrorCode('STATIC_TOP_LEVEL_DECLARATION', "Top-level declarations cannot be declared to be 'static'");
+  static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION =
+      const ParserErrorCode(
+          'STATIC_TOP_LEVEL_DECLARATION',
+          "Top-level declarations cannot be declared to be 'static'");
 
-  static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = const ParserErrorCode('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', "The 'default' case should be the last case in a switch statement");
+  static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE =
+      const ParserErrorCode(
+          'SWITCH_HAS_CASE_AFTER_DEFAULT_CASE',
+          "The 'default' case should be the last case in a switch statement");
 
-  static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = const ParserErrorCode('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', "The 'default' case can only be declared once");
+  static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES =
+      const ParserErrorCode(
+          'SWITCH_HAS_MULTIPLE_DEFAULT_CASES',
+          "The 'default' case can only be declared once");
 
-  static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode('TOP_LEVEL_OPERATOR', "Operators must be declared within a class");
+  static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode(
+      'TOP_LEVEL_OPERATOR',
+      "Operators must be declared within a class");
 
-  static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to open a parameter group");
+  static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP =
+      const ParserErrorCode(
+          'UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP',
+          "There is no '{0}' to open a parameter group");
 
-  static const ParserErrorCode UNEXPECTED_TOKEN = const ParserErrorCode('UNEXPECTED_TOKEN', "Unexpected token '{0}'");
+  static const ParserErrorCode UNEXPECTED_TOKEN =
+      const ParserErrorCode('UNEXPECTED_TOKEN', "Unexpected token '{0}'");
 
-  static const ParserErrorCode WITH_BEFORE_EXTENDS = const ParserErrorCode('WITH_BEFORE_EXTENDS', "The extends clause must be before the with clause");
+  static const ParserErrorCode WITH_BEFORE_EXTENDS = const ParserErrorCode(
+      'WITH_BEFORE_EXTENDS',
+      "The extends clause must be before the with clause");
 
-  static const ParserErrorCode WITH_WITHOUT_EXTENDS = const ParserErrorCode('WITH_WITHOUT_EXTENDS', "The with clause cannot be used without an extends clause");
+  static const ParserErrorCode WITH_WITHOUT_EXTENDS = const ParserErrorCode(
+      'WITH_WITHOUT_EXTENDS',
+      "The with clause cannot be used without an extends clause");
 
-  static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = const ParserErrorCode('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', "The default value of a named parameter should be preceeded by ':'");
+  static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER =
+      const ParserErrorCode(
+          'WRONG_SEPARATOR_FOR_NAMED_PARAMETER',
+          "The default value of a named parameter should be preceeded by ':'");
 
-  static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = const ParserErrorCode('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', "The default value of a positional parameter should be preceeded by '='");
+  static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER =
+      const ParserErrorCode(
+          'WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER',
+          "The default value of a positional parameter should be preceeded by '='");
 
-  static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', "Expected '{0}' to close parameter group");
+  static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP =
+      const ParserErrorCode(
+          'WRONG_TERMINATOR_FOR_PARAMETER_GROUP',
+          "Expected '{0}' to close parameter group");
 
-  static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode('VAR_AND_TYPE', "Variables cannot be declared using both 'var' and a type name; remove the 'var'");
+  static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode(
+      'VAR_AND_TYPE',
+      "Variables cannot be declared using both 'var' and a type name; remove the 'var'");
 
-  static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode('VAR_AS_TYPE_NAME', "The keyword 'var' cannot be used as a type name");
+  static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode(
+      'VAR_AS_TYPE_NAME',
+      "The keyword 'var' cannot be used as a type name");
 
-  static const ParserErrorCode VAR_CLASS = const ParserErrorCode('VAR_CLASS', "Classes cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_CLASS =
+      const ParserErrorCode('VAR_CLASS', "Classes cannot be declared to be 'var'");
 
-  static const ParserErrorCode VAR_ENUM = const ParserErrorCode('VAR_ENUM', "Enums cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_ENUM =
+      const ParserErrorCode('VAR_ENUM', "Enums cannot be declared to be 'var'");
 
-  static const ParserErrorCode VAR_RETURN_TYPE = const ParserErrorCode('VAR_RETURN_TYPE', "The return type cannot be 'var'");
+  static const ParserErrorCode VAR_RETURN_TYPE =
+      const ParserErrorCode('VAR_RETURN_TYPE', "The return type cannot be 'var'");
 
-  static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode('VAR_TYPEDEF', "Type aliases cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode(
+      'VAR_TYPEDEF',
+      "Type aliases cannot be declared to be 'var'");
 
-  static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode('VOID_PARAMETER', "Parameters cannot have a type of 'void'");
+  static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode(
+      'VOID_PARAMETER',
+      "Parameters cannot have a type of 'void'");
 
-  static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode('VOID_VARIABLE', "Variables cannot have a type of 'void'");
+  static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode(
+      'VOID_VARIABLE',
+      "Variables cannot have a type of 'void'");
 
   /**
    * Initialize a newly created error code to have the given [name]. The message
@@ -8182,24 +10637,6 @@
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
 }
 
-/**
- * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
- */
-class Parser_SyntheticKeywordToken extends KeywordToken {
-  /**
-   * Initialize a newly created token to represent the given keyword.
-   *
-   * @param keyword the keyword being represented by this token
-   * @param offset the offset from the beginning of the file to the first character in the token
-   */
-  Parser_SyntheticKeywordToken(Keyword keyword, int offset) : super(keyword, offset);
-
-  @override
-  Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
-
-  @override
-  int get length => 0;
-}
 
 /**
  * Instances of the class `ResolutionCopier` copies resolution information from one AST
@@ -8208,17 +10645,6 @@
  */
 class ResolutionCopier implements AstVisitor<bool> {
   /**
-   * Copy resolution data from one node to another.
-   *
-   * @param fromNode the node from which resolution information will be copied
-   * @param toNode the node to which resolution information will be copied
-   */
-  static void copyResolutionData(AstNode fromNode, AstNode toNode) {
-    ResolutionCopier copier = new ResolutionCopier();
-    copier._isEqualNodes(fromNode, toNode);
-  }
-
-  /**
    * The AST node with which the node being visited is to be compared. This is only valid at the
    * beginning of each visit method (until [isEqualNodes] is invoked).
    */
@@ -8350,10 +10776,14 @@
   @override
   bool visitBreakStatement(BreakStatement node) {
     BreakStatement toNode = this._toNode as BreakStatement;
-    return _and(
+    if (_and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualNodes(node.label, toNode.label),
-        _isEqualTokens(node.semicolon, toNode.semicolon));
+        _isEqualTokens(node.semicolon, toNode.semicolon))) {
+      // TODO(paulberry): map node.target to toNode.target.
+      return true;
+    }
+    return false;
   }
 
   @override
@@ -8489,7 +10919,8 @@
 
   @override
   bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    ConstructorFieldInitializer toNode = this._toNode as ConstructorFieldInitializer;
+    ConstructorFieldInitializer toNode =
+        this._toNode as ConstructorFieldInitializer;
     return _and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualTokens(node.period, toNode.period),
@@ -8514,10 +10945,14 @@
   @override
   bool visitContinueStatement(ContinueStatement node) {
     ContinueStatement toNode = this._toNode as ContinueStatement;
-    return _and(
+    if (_and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualNodes(node.label, toNode.label),
-        _isEqualTokens(node.semicolon, toNode.semicolon));
+        _isEqualTokens(node.semicolon, toNode.semicolon))) {
+      // TODO(paulberry): map node.target to toNode.target.
+      return true;
+    }
+    return false;
   }
 
   @override
@@ -8559,7 +10994,7 @@
     DoubleLiteral toNode = this._toNode as DoubleLiteral;
     if (_and(
         _isEqualTokens(node.literal, toNode.literal),
-            node.value == toNode.value)) {
+        node.value == toNode.value)) {
       toNode.propagatedType = node.propagatedType;
       toNode.staticType = node.staticType;
       return true;
@@ -8693,7 +11128,8 @@
   @override
   bool visitForStatement(ForStatement node) {
     ForStatement toNode = this._toNode as ForStatement;
-    return _and(_isEqualTokens(node.forKeyword, toNode.forKeyword),
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.variables, toNode.variables),
         _isEqualNodes(node.initialization, toNode.initialization),
@@ -8720,7 +11156,8 @@
 
   @override
   bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
-    FunctionDeclarationStatement toNode = this._toNode as FunctionDeclarationStatement;
+    FunctionDeclarationStatement toNode =
+        this._toNode as FunctionDeclarationStatement;
     return _isEqualNodes(node.functionDeclaration, toNode.functionDeclaration);
   }
 
@@ -8740,7 +11177,8 @@
 
   @override
   bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
-    FunctionExpressionInvocation toNode = this._toNode as FunctionExpressionInvocation;
+    FunctionExpressionInvocation toNode =
+        this._toNode as FunctionExpressionInvocation;
     if (_and(
         _isEqualNodes(node.function, toNode.function),
         _isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -8769,7 +11207,8 @@
 
   @override
   bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
-    FunctionTypedFormalParameter toNode = this._toNode as FunctionTypedFormalParameter;
+    FunctionTypedFormalParameter toNode =
+        this._toNode as FunctionTypedFormalParameter;
     return _and(
         _isEqualNodes(node.documentationComment, toNode.documentationComment),
         _isEqualNodeLists(node.metadata, toNode.metadata),
@@ -8845,7 +11284,8 @@
 
   @override
   bool visitInstanceCreationExpression(InstanceCreationExpression node) {
-    InstanceCreationExpression toNode = this._toNode as InstanceCreationExpression;
+    InstanceCreationExpression toNode =
+        this._toNode as InstanceCreationExpression;
     if (_and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualNodes(node.constructorName, toNode.constructorName),
@@ -8885,7 +11325,7 @@
     InterpolationString toNode = this._toNode as InterpolationString;
     return _and(
         _isEqualTokens(node.contents, toNode.contents),
-            node.value == toNode.value);
+        node.value == toNode.value);
   }
 
   @override
@@ -9158,8 +11598,10 @@
   }
 
   @override
-  bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    RedirectingConstructorInvocation toNode = this._toNode as RedirectingConstructorInvocation;
+  bool
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    RedirectingConstructorInvocation toNode =
+        this._toNode as RedirectingConstructorInvocation;
     if (_and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualTokens(node.period, toNode.period),
@@ -9256,7 +11698,8 @@
 
   @override
   bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    SuperConstructorInvocation toNode = this._toNode as SuperConstructorInvocation;
+    SuperConstructorInvocation toNode =
+        this._toNode as SuperConstructorInvocation;
     if (_and(
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualTokens(node.period, toNode.period),
@@ -9352,7 +11795,8 @@
 
   @override
   bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
-    TopLevelVariableDeclaration toNode = this._toNode as TopLevelVariableDeclaration;
+    TopLevelVariableDeclaration toNode =
+        this._toNode as TopLevelVariableDeclaration;
     return _and(
         _isEqualNodes(node.documentationComment, toNode.documentationComment),
         _isEqualNodeLists(node.metadata, toNode.metadata),
@@ -9436,7 +11880,8 @@
 
   @override
   bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
-    VariableDeclarationStatement toNode = this._toNode as VariableDeclarationStatement;
+    VariableDeclarationStatement toNode =
+        this._toNode as VariableDeclarationStatement;
     return _and(
         _isEqualNodes(node.variables, toNode.variables),
         _isEqualTokens(node.semicolon, toNode.semicolon));
@@ -9474,10 +11919,21 @@
    * Return `true` if all of the parameters are `true`.
    */
   bool _and(bool b1, bool b2, [bool b3 = true, bool b4 = true, bool b5 = true,
-      bool b6 = true, bool b7 = true, bool b8 = true, bool b9 = true,
-      bool b10 = true, bool b11 = true, bool b12 = true, bool b13 = true]) {
-    return b1 && b2 && b3 && b4 && b5 && b6 && b7 && b8 && b9 && b10 && b11
-        && b12 && b13;
+      bool b6 = true, bool b7 = true, bool b8 = true, bool b9 = true, bool b10 = true,
+      bool b11 = true, bool b12 = true, bool b13 = true]) {
+    return b1 &&
+        b2 &&
+        b3 &&
+        b4 &&
+        b5 &&
+        b6 &&
+        b7 &&
+        b8 &&
+        b9 &&
+        b10 &&
+        b11 &&
+        b12 &&
+        b13;
   }
 
   /**
@@ -9582,232 +12038,15 @@
     }
     return first.lexeme == second.lexeme;
   }
-}
-Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline> {
-  'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseCompilationUnit(arg0)),
-  'parseDirectives_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseDirectives(arg0)),
-  'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseExpression(arg0)),
-  'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStatement(arg0)),
-  'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStatements(arg0)),
-  'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAnnotation()),
-  'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgument()),
-  'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parseArgumentList()),
-  'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => target.parseBitwiseOrExpression()),
-  'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock()),
-  'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseClassMember(arg0)),
-  'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.parseCompilationUnit2()),
-  'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => target.parseConditionalExpression()),
-  'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.parseConstructorName()),
-  'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseExpression2()),
-  'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target.parseExpressionWithoutCascade()),
-  'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.parseExtendsClause()),
-  'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => target.parseFormalParameterList()),
-  'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target.parseFunctionExpression()),
-  'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.parseImplementsClause()),
-  'parseLabel_0': new MethodTrampoline(0, (Parser target) => target.parseLabel()),
-  'parseLibraryIdentifier_0': new MethodTrampoline(0, (Parser target) => target.parseLibraryIdentifier()),
-  'parseLogicalOrExpression_0': new MethodTrampoline(0, (Parser target) => target.parseLogicalOrExpression()),
-  'parseMapLiteralEntry_0': new MethodTrampoline(0, (Parser target) => target.parseMapLiteralEntry()),
-  'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => target.parseNormalFormalParameter()),
-  'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target.parsePrefixedIdentifier()),
-  'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseReturnType()),
-  'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.parseSimpleIdentifier()),
-  'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseStatement2()),
-  'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.parseStringLiteral()),
-  'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parseTypeArgumentList()),
-  'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseTypeName()),
-  'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.parseTypeParameter()),
-  'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target.parseTypeParameterList()),
-  'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWithClause()),
-  'advance_0': new MethodTrampoline(0, (Parser target) => target._advance()),
-  'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg2, arg3, arg4) => target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
-  'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._computeStringValue(arg0, arg1, arg2)),
-  'convertToFunctionDeclaration_1': new MethodTrampoline(1, (Parser target, arg0) => target._convertToFunctionDeclaration(arg0)),
-  'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser target) => target._couldBeStartOfCompilationUnitMember()),
-  'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => target._createSyntheticIdentifier()),
-  'createSyntheticKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => target._createSyntheticKeyword(arg0)),
-  'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => target._createSyntheticStringLiteral()),
-  'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => target._createSyntheticToken(arg0)),
-  'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target._ensureAssignable(arg0)),
-  'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target._expect(arg0)),
-  'expectGt_0': new MethodTrampoline(0, (Parser target) => target._expectGt()),
-  'expectKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => target._expectKeyword(arg0)),
-  'expectSemicolon_0': new MethodTrampoline(0, (Parser target) => target._expectSemicolon()),
-  'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._findRange(arg0, arg1)),
-  'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => target._getCodeBlockRanges(arg0)),
-  'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target._getEndToken(arg0)),
-  'injectToken_1': new MethodTrampoline(1, (Parser target, arg0) => target._injectToken(arg0)),
-  'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target._isFunctionDeclaration()),
-  'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target._isFunctionExpression(arg0)),
-  'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target._isHexDigit(arg0)),
-  'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target._isInitializedVariableDeclaration()),
-  'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._isLinkText(arg0, arg1)),
-  'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target._isOperator(arg0)),
-  'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target._isSwitchMember()),
-  'isTypedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target._isTypedIdentifier(arg0)),
-  'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target._lexicallyFirst(arg0)),
-  'lockErrorListener_0': new MethodTrampoline(0, (Parser target) => target._lockErrorListener()),
-  'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target._matches(arg0)),
-  'matchesGt_0': new MethodTrampoline(0, (Parser target) => target._matchesGt()),
-  'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target._matchesIdentifier()),
-  'matchesKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => target._matchesKeyword(arg0)),
-  'matchesString_1': new MethodTrampoline(1, (Parser target, arg0) => target._matchesString(arg0)),
-  'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target._optional(arg0)),
-  'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target._parseAdditiveExpression()),
-  'parseAssertStatement_0': new MethodTrampoline(0, (Parser target) => target._parseAssertStatement()),
-  'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseAssignableExpression(arg0)),
-  'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseAssignableSelector(arg0, arg1)),
-  'parseAwaitExpression_0': new MethodTrampoline(0, (Parser target) => target._parseAwaitExpression()),
-  'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => target._parseBitwiseAndExpression()),
-  'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => target._parseBitwiseXorExpression()),
-  'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target._parseBreakStatement()),
-  'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target._parseCascadeSection()),
-  'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseClassDeclaration(arg0, arg1)),
-  'parseClassMembers_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseClassMembers(arg0, arg1)),
-  'parseClassTypeAlias_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseClassTypeAlias(arg0, arg1, arg2)),
-  'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target._parseCombinators()),
-  'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target._parseCommentAndMetadata()),
-  'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseCommentReference(arg0, arg1)),
-  'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseCommentReferences(arg0)),
-  'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseCompilationUnitMember(arg0)),
-  'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target._parseConstExpression()),
-  'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) => target._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
-  'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target._parseConstructorFieldInitializer()),
-  'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target._parseContinueStatement()),
-  'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseDirective(arg0)),
-  'parseDirectives_0': new MethodTrampoline(0, (Parser target) => target._parseDirectives()),
-  'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => target._parseDocumentationComment()),
-  'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target._parseDoStatement()),
-  'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target._parseEmptyStatement()),
-  'parseEnumConstantDeclaration_0': new MethodTrampoline(0, (Parser target) => target._parseEnumConstantDeclaration()),
-  'parseEnumDeclaration_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseEnumDeclaration(arg0)),
-  'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target._parseEqualityExpression()),
-  'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseExportDirective(arg0)),
-  'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target._parseExpressionList()),
-  'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)),
-  'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseFormalParameter(arg0)),
-  'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target._parseForStatement()),
-  'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseFunctionBody(arg0, arg1, arg2)),
-  'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseFunctionDeclaration(arg0, arg1, arg2)),
-  'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target) => target._parseFunctionDeclarationStatement()),
-  'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseFunctionDeclarationStatementAfterReturnType(arg0, arg1)),
-  'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseFunctionTypeAlias(arg0, arg1)),
-  'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg3) => target._parseGetter(arg0, arg1, arg2, arg3)),
-  'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target._parseIdentifierList()),
-  'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target._parseIfStatement()),
-  'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseImportDirective(arg0)),
-  'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg3) => target._parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
-  'parseInstanceCreationExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseInstanceCreationExpression(arg0)),
-  'parseLibraryDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseLibraryDirective(arg0)),
-  'parseLibraryName_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseLibraryName(arg0, arg1)),
-  'parseListLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseListLiteral(arg0, arg1)),
-  'parseListOrMapLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseListOrMapLiteral(arg0)),
-  'parseLogicalAndExpression_0': new MethodTrampoline(0, (Parser target) => target._parseLogicalAndExpression()),
-  'parseMapLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)),
-  'parseMethodDeclarationAfterParameters_6': new MethodTrampoline(6, (Parser target, arg0, arg1, arg2, arg3, arg4, arg5) => target._parseMethodDeclarationAfterParameters(arg0, arg1, arg2, arg3, arg4, arg5)),
-  'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg3) => target._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)),
-  'parseModifiers_0': new MethodTrampoline(0, (Parser target) => target._parseModifiers()),
-  'parseMultiplicativeExpression_0': new MethodTrampoline(0, (Parser target) => target._parseMultiplicativeExpression()),
-  'parseNativeClause_0': new MethodTrampoline(0, (Parser target) => target._parseNativeClause()),
-  'parseNewExpression_0': new MethodTrampoline(0, (Parser target) => target._parseNewExpression()),
-  'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => target._parseNonLabeledStatement()),
-  'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseOperator(arg0, arg1, arg2)),
-  'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target._parseOptionalReturnType()),
-  'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._parsePartDirective(arg0)),
-  'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target._parsePostfixExpression()),
-  'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target._parsePrimaryExpression()),
-  'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser target) => target._parseRedirectingConstructorInvocation()),
-  'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => target._parseRelationalExpression()),
-  'parseRethrowExpression_0': new MethodTrampoline(0, (Parser target) => target._parseRethrowExpression()),
-  'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target._parseReturnStatement()),
-  'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg3) => target._parseSetter(arg0, arg1, arg2, arg3)),
-  'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target._parseShiftExpression()),
-  'parseStatementList_0': new MethodTrampoline(0, (Parser target) => target._parseStatementList()),
-  'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseStringInterpolation(arg0)),
-  'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) => target._parseSuperConstructorInvocation()),
-  'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target._parseSwitchStatement()),
-  'parseSymbolLiteral_0': new MethodTrampoline(0, (Parser target) => target._parseSymbolLiteral()),
-  'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target._parseThrowExpression()),
-  'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target._parseThrowExpressionWithoutCascade()),
-  'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target._parseTryStatement()),
-  'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseTypeAlias(arg0)),
-  'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target._parseUnaryExpression()),
-  'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target._parseVariableDeclaration()),
-  'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseVariableDeclarationListAfterMetadata(arg0)),
-  'parseVariableDeclarationListAfterType_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseVariableDeclarationListAfterType(arg0, arg1, arg2)),
-  'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseVariableDeclarationStatementAfterMetadata(arg0)),
-  'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._parseVariableDeclarationStatementAfterType(arg0, arg1, arg2)),
-  'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target._parseWhileStatement()),
-  'parseYieldStatement_0': new MethodTrampoline(0, (Parser target) => target._parseYieldStatement()),
-  'peek_0': new MethodTrampoline(0, (Parser target) => target._peek()),
-  'peekAt_1': new MethodTrampoline(1, (Parser target, arg0) => target._peekAt(arg0)),
-  'reportError_1': new MethodTrampoline(1, (Parser target, arg0) => target._reportError(arg0)),
-  'reportErrorForCurrentToken_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._reportErrorForCurrentToken(arg0, arg1)),
-  'reportErrorForNode_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._reportErrorForNode(arg0, arg1, arg2)),
-  'reportErrorForToken_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._reportErrorForToken(arg0, arg1, arg2)),
-  'skipBlock_0': new MethodTrampoline(0, (Parser target) => target._skipBlock()),
-  'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipFinalConstVarOrType(arg0)),
-  'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipFormalParameterList(arg0)),
-  'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipPastMatchingToken(arg0)),
-  'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipPrefixedIdentifier(arg0)),
-  'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipReturnType(arg0)),
-  'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipSimpleIdentifier(arg0)),
-  'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipStringInterpolation(arg0)),
-  'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipStringLiteral(arg0)),
-  'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipTypeArgumentList(arg0)),
-  'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipTypeName(arg0)),
-  'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target._skipTypeParameterList(arg0)),
-  'tokenMatches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._tokenMatches(arg0, arg1)),
-  'tokenMatchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target._tokenMatchesIdentifier(arg0)),
-  'tokenMatchesKeyword_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._tokenMatchesKeyword(arg0, arg1)),
-  'tokenMatchesString_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._tokenMatchesString(arg0, arg1)),
-  'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target._translateCharacter(arg0, arg1, arg2)),
-  'unlockErrorListener_0': new MethodTrampoline(0, (Parser target) => target._unlockErrorListener()),
-  'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateFormalParameterList(arg0)),
-  'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForClass(arg0)),
-  'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForConstructor(arg0)),
-  'validateModifiersForEnum_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForEnum(arg0)),
-  'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForField(arg0)),
-  'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForFunctionDeclarationStatement(arg0)),
-  'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForGetterOrSetterOrMethod(arg0)),
-  'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForOperator(arg0)),
-  'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForTopLevelDeclaration(arg0)),
-  'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForTopLevelFunction(arg0)),
-  'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForTopLevelVariable(arg0)),
-  'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target._validateModifiersForTypedef(arg0)),};
 
-
-Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> objects, Token tokenStream) {
-  parser.currentToken = tokenStream;
-  MethodTrampoline method = methodTable_Parser['${methodName}_${objects.length}'];
-  return method.invoke(parser, objects);
-}
-
-
-/**
- * Wrapper around [Function] which should be called with "target" and "arguments".
- */
-class MethodTrampoline {
-  int parameterCount;
-  Function trampoline;
-  MethodTrampoline(this.parameterCount, this.trampoline);
-  Object invoke(target, List arguments) {
-    if (arguments.length != parameterCount) {
-      throw new IllegalArgumentException("${arguments.length} != $parameterCount");
-    }
-    switch (parameterCount) {
-      case 0:
-        return trampoline(target);
-      case 1:
-        return trampoline(target, arguments[0]);
-      case 2:
-        return trampoline(target, arguments[0], arguments[1]);
-      case 3:
-        return trampoline(target, arguments[0], arguments[1], arguments[2]);
-      case 4:
-        return trampoline(target, arguments[0], arguments[1], arguments[2], arguments[3]);
-      default:
-        throw new IllegalArgumentException("Not implemented for > 4 arguments");
-    }
+  /**
+   * Copy resolution data from one node to another.
+   *
+   * @param fromNode the node from which resolution information will be copied
+   * @param toNode the node to which resolution information will be copied
+   */
+  static void copyResolutionData(AstNode fromNode, AstNode toNode) {
+    ResolutionCopier copier = new ResolutionCopier();
+    copier._isEqualNodes(fromNode, toNode);
   }
 }
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index cc92baf..bc8654a 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4,26 +4,26 @@
 
 library engine.resolver;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:collection';
 
+import 'ast.dart';
+import 'constant.dart';
+import 'element.dart';
+import 'element_resolver.dart';
+import 'engine.dart';
+import 'error.dart';
+import 'error_verifier.dart';
+import 'html.dart' as ht;
+import 'instrumentation.dart';
 import 'java_core.dart';
 import 'java_engine.dart';
-import 'instrumentation.dart';
-import 'source.dart';
-import 'error.dart';
 import 'scanner.dart' as sc;
+import 'sdk.dart' show DartSdk, SdkLibrary;
+import 'source.dart';
+import 'static_type_analyzer.dart';
 import 'utilities_dart.dart';
 import 'utilities_general.dart';
-import 'ast.dart';
-import 'sdk.dart' show DartSdk, SdkLibrary;
-import 'element.dart';
-import 'html.dart' as ht;
-import 'engine.dart';
-import 'constant.dart';
-import 'error_verifier.dart';
-import 'element_resolver.dart';
-import 'static_type_analyzer.dart';
 
 /**
  * Instances of the class `AngularCompilationUnitBuilder` build an Angular specific element
@@ -58,165 +58,6 @@
 
   static String _NG_TWO_WAY = "NgTwoWay";
 
-  static Element getElement(AstNode node, int offset) {
-    // maybe node is not SimpleStringLiteral
-    if (node is! SimpleStringLiteral) {
-      return null;
-    }
-    SimpleStringLiteral literal = node as SimpleStringLiteral;
-    // maybe has AngularElement
-    {
-      Element element = literal.toolkitElement;
-      if (element is AngularElement) {
-        return element;
-      }
-    }
-    // prepare enclosing ClassDeclaration
-    ClassDeclaration classDeclaration = node.getAncestor((node) => node is ClassDeclaration);
-    if (classDeclaration == null) {
-      return null;
-    }
-    // prepare ClassElement
-    ClassElement classElement = classDeclaration.element;
-    if (classElement == null) {
-      return null;
-    }
-    // check toolkit objects
-    for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
-      List<AngularPropertyElement> properties = AngularPropertyElement.EMPTY_ARRAY;
-      // maybe name
-      if (toolkitObject is AngularElement) {
-        if (_isNameCoveredByLiteral(toolkitObject, node)) {
-          return toolkitObject;
-        }
-      }
-      // try selector
-      if (toolkitObject is AngularHasSelectorElement) {
-        AngularHasSelectorElement hasSelector = toolkitObject;
-        AngularSelectorElement selector = hasSelector.selector;
-        if (_isNameCoveredByLiteral(selector, node)) {
-          return selector;
-        }
-      }
-      // try properties of AngularComponentElement
-      if (toolkitObject is AngularComponentElement) {
-        AngularComponentElement component = toolkitObject;
-        properties = component.properties;
-      }
-      // try properties of AngularDirectiveElement
-      if (toolkitObject is AngularDecoratorElement) {
-        AngularDecoratorElement directive = toolkitObject;
-        properties = directive.properties;
-      }
-      // check properties
-      for (AngularPropertyElement property in properties) {
-        // property name (use complete node range)
-        if (_isNameCoveredByLiteral(property, node)) {
-          return property;
-        }
-        // field name (use complete node range, including @, => and <=>)
-        FieldElement field = property.field;
-        if (field != null) {
-          int fieldOffset = property.fieldNameOffset;
-          int fieldEnd = fieldOffset + field.name.length;
-          if (node.offset <= fieldOffset && fieldEnd < node.end) {
-            return field;
-          }
-        }
-      }
-    }
-    // no Element
-    return null;
-  }
-
-  /**
-   * Parses given selector text and returns [AngularSelectorElement]. May be `null` if
-   * cannot parse.
-   */
-  static AngularSelectorElement parseSelector(int offset, String text) {
-    // [attribute]
-    if (StringUtilities.startsWithChar(text, 0x5B) && StringUtilities.endsWithChar(text, 0x5D)) {
-      int nameOffset = offset + 1;
-      String attributeName = text.substring(1, text.length - 1);
-      // TODO(scheglov) report warning if there are spaces between [ and identifier
-      return new HasAttributeSelectorElementImpl(attributeName, nameOffset);
-    }
-    // .class
-    if (StringUtilities.startsWithChar(text, 0x2E)) {
-      int nameOffset = offset + 1;
-      String className = text.substring(1, text.length);
-      return new AngularHasClassSelectorElementImpl(className, nameOffset);
-    }
-    // tag[attribute]
-    if (StringUtilities.endsWithChar(text, 0x5D)) {
-      int index = StringUtilities.indexOf1(text, 0, 0x5B);
-      if (index != -1) {
-        String tagName = text.substring(0, index);
-        String attributeName = text.substring(index + 1, text.length - 1);
-        if (StringUtilities.isTagName(tagName)) {
-          return new IsTagHasAttributeSelectorElementImpl(tagName, attributeName);
-        }
-      }
-    }
-    // tag
-    if (StringUtilities.isTagName(text)) {
-      return new AngularTagSelectorElementImpl(text, offset);
-    }
-    return null;
-  }
-
-  /**
-   * Returns the [FieldElement] of the first field in the given [FieldDeclaration].
-   */
-  static FieldElement _getOnlyFieldElement(FieldDeclaration fieldDeclaration) {
-    NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables;
-    return fields[0].element as FieldElement;
-  }
-
-  /**
-   * If given [Annotation] has one argument and it is [SimpleStringLiteral], returns it,
-   * otherwise returns `null`.
-   */
-  static SimpleStringLiteral _getOnlySimpleStringLiteralArgument(Annotation annotation) {
-    SimpleStringLiteral nameLiteral = null;
-    ArgumentList argsNode = annotation.arguments;
-    if (argsNode != null) {
-      NodeList<Expression> args = argsNode.arguments;
-      if (args.length == 1) {
-        Expression arg = args[0];
-        if (arg is SimpleStringLiteral) {
-          nameLiteral = arg;
-        }
-      }
-    }
-    return nameLiteral;
-  }
-
-  /**
-   * Checks if the name range of the given [Element] is completely covered by the given
-   * [SimpleStringLiteral].
-   */
-  static bool _isNameCoveredByLiteral(Element element, AstNode node) {
-    if (element != null) {
-      String name = element.name;
-      if (name != null) {
-        int nameOffset = element.nameOffset;
-        int nameEnd = nameOffset + name.length;
-        return node.offset <= nameOffset && nameEnd < node.end;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Parses given [SimpleStringLiteral] using [parseSelector].
-   */
-  static AngularSelectorElement _parseSelectorFromString(SimpleStringLiteral literal) {
-    int offset = literal.contentsOffset;
-    String text = literal.stringValue;
-    return parseSelector(offset, text);
-  }
-
   /**
    * The listener to which errors will be reported.
    */
@@ -366,7 +207,9 @@
    */
   bool _isAngularLibraryElement(Element element) {
     LibraryElement library = element.library;
-    return library != null && library.name != null && library.name.startsWith("angular");
+    return library != null &&
+        library.name != null &&
+        library.name.startsWith("angular");
   }
 
   void _parseComponent() {
@@ -387,7 +230,10 @@
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
       selector = _parseSelectorFromString(selectorLiteral);
       if (selector == null) {
-        _reportErrorForArgument(_SELECTOR, AngularCode.CANNOT_PARSE_SELECTOR, [selectorLiteral]);
+        _reportErrorForArgument(
+            _SELECTOR,
+            AngularCode.CANNOT_PARSE_SELECTOR,
+            [selectorLiteral]);
         isValid = false;
       }
     }
@@ -407,7 +253,8 @@
     }
     // create
     if (isValid) {
-      AngularComponentElementImpl element = new AngularComponentElementImpl(name, nameOffset, _annotation.offset);
+      AngularComponentElementImpl element =
+          new AngularComponentElementImpl(name, nameOffset, _annotation.offset);
       element.selector = selector;
       element.templateUri = templateUri;
       element.templateUriOffset = templateUriOffset;
@@ -432,7 +279,8 @@
   /**
    * Parses [AngularPropertyElement]s from [annotation].
    */
-  void _parseComponentProperties_fromFields(List<AngularPropertyElement> properties) {
+  void
+      _parseComponentProperties_fromFields(List<AngularPropertyElement> properties) {
     NodeList<ClassMember> members = _classDeclaration.members;
     for (ClassMember member in members) {
       if (member is FieldDeclaration) {
@@ -453,10 +301,12 @@
           }
           // add property
           if (kind != null) {
-            SimpleStringLiteral nameLiteral = _getOnlySimpleStringLiteralArgument(annotation);
+            SimpleStringLiteral nameLiteral =
+                _getOnlySimpleStringLiteralArgument(annotation);
             FieldElement field = _getOnlyFieldElement(fieldDeclaration);
             if (nameLiteral != null && field != null) {
-              AngularPropertyElementImpl property = new AngularPropertyElementImpl(nameLiteral.value, nameLiteral.contentsOffset);
+              AngularPropertyElementImpl property =
+                  new AngularPropertyElementImpl(nameLiteral.value, nameLiteral.contentsOffset);
               property.field = field;
               property.propertyKind = kind;
               properties.add(property);
@@ -470,7 +320,8 @@
   /**
    * Parses [AngularPropertyElement]s from [annotation].
    */
-  void _parseComponentProperties_fromMap(List<AngularPropertyElement> properties) {
+  void
+      _parseComponentProperties_fromMap(List<AngularPropertyElement> properties) {
     Expression mapExpression = _getArgument("map");
     // may be not properties
     if (mapExpression == null) {
@@ -520,20 +371,29 @@
         kind = AngularPropertyKind.TWO_WAY;
         fieldNameOffset = 3;
       } else {
-        _reportErrorForNode(AngularCode.INVALID_PROPERTY_KIND, specLiteral, [spec]);
+        _reportErrorForNode(
+            AngularCode.INVALID_PROPERTY_KIND,
+            specLiteral,
+            [spec]);
         continue;
       }
       String fieldName = spec.substring(fieldNameOffset);
       fieldNameOffset += specLiteral.contentsOffset;
       // prepare field
-      PropertyAccessorElement setter = _classElement.type.lookUpSetter(fieldName, _classElement.library);
+      PropertyAccessorElement setter =
+          _classElement.type.lookUpSetter(fieldName, _classElement.library);
       if (setter == null) {
-        _reportErrorForOffset(AngularCode.INVALID_PROPERTY_FIELD, fieldNameOffset, fieldName.length, [fieldName]);
+        _reportErrorForOffset(
+            AngularCode.INVALID_PROPERTY_FIELD,
+            fieldNameOffset,
+            fieldName.length,
+            [fieldName]);
         continue;
       }
       FieldElement field = setter.variable as FieldElement;
       // add property
-      AngularPropertyElementImpl property = new AngularPropertyElementImpl(name, nameOffset);
+      AngularPropertyElementImpl property =
+          new AngularPropertyElementImpl(name, nameOffset);
       property.field = field;
       property.propertyKind = kind;
       property.fieldNameOffset = fieldNameOffset;
@@ -557,7 +417,10 @@
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
       selector = _parseSelectorFromString(selectorLiteral);
       if (selector == null) {
-        _reportErrorForArgument(_SELECTOR, AngularCode.CANNOT_PARSE_SELECTOR, [selectorLiteral]);
+        _reportErrorForArgument(
+            _SELECTOR,
+            AngularCode.CANNOT_PARSE_SELECTOR,
+            [selectorLiteral]);
         isValid = false;
       }
     }
@@ -565,7 +428,8 @@
     if (isValid) {
       String name = _getStringArgument(_PUBLISH_AS);
       int nameOffset = _getStringArgumentOffset(_PUBLISH_AS);
-      AngularControllerElementImpl element = new AngularControllerElementImpl(name, nameOffset);
+      AngularControllerElementImpl element =
+          new AngularControllerElementImpl(name, nameOffset);
       element.selector = selector;
       _classElement.addToolkitObjects(element);
     }
@@ -582,14 +446,18 @@
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
       selector = _parseSelectorFromString(selectorLiteral);
       if (selector == null) {
-        _reportErrorForArgument(_SELECTOR, AngularCode.CANNOT_PARSE_SELECTOR, [selectorLiteral]);
+        _reportErrorForArgument(
+            _SELECTOR,
+            AngularCode.CANNOT_PARSE_SELECTOR,
+            [selectorLiteral]);
         isValid = false;
       }
     }
     // create
     if (isValid) {
       int offset = _annotation.offset;
-      AngularDecoratorElementImpl element = new AngularDecoratorElementImpl(offset);
+      AngularDecoratorElementImpl element =
+          new AngularDecoratorElementImpl(offset);
       element.selector = selector;
       element.properties = _parseComponentProperties();
       _classElement.addToolkitObjects(element);
@@ -607,13 +475,17 @@
     if (isValid) {
       String name = _getStringArgument(_NAME);
       int nameOffset = _getStringArgumentOffset(_NAME);
-      _classElement.addToolkitObjects(new AngularFormatterElementImpl(name, nameOffset));
+      _classElement.addToolkitObjects(
+          new AngularFormatterElementImpl(name, nameOffset));
     }
   }
 
   List<AngularScopePropertyElement> _parseScopeProperties() {
-    List<AngularScopePropertyElement> properties = <AngularScopePropertyElement>[];
-    _classDeclaration.accept(new RecursiveAstVisitor_AngularCompilationUnitBuilder_parseScopeProperties(properties));
+    List<AngularScopePropertyElement> properties =
+        <AngularScopePropertyElement>[
+        ];
+    _classDeclaration.accept(
+        new _AngularCompilationUnitBuilder_parseScopeProperties(properties));
     return properties;
   }
 
@@ -623,30 +495,203 @@
    */
   void _parseViews() {
     List<AngularViewElement> views = <AngularViewElement>[];
-    _unit.accept(new RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(views));
+    _unit.accept(
+        new RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(views));
     if (!views.isEmpty) {
       List<AngularViewElement> viewArray = views;
       (_unit.element as CompilationUnitElementImpl).angularViews = viewArray;
     }
   }
 
-  void _reportErrorForAnnotation(ErrorCode errorCode, [List<Object> arguments]) {
+  void _reportErrorForAnnotation(ErrorCode errorCode,
+      [List<Object> arguments]) {
     _reportErrorForNode(errorCode, _annotation, arguments);
   }
 
-  void _reportErrorForArgument(String argumentName, ErrorCode errorCode, [List<Object> arguments]) {
+  void _reportErrorForArgument(String argumentName, ErrorCode errorCode,
+      [List<Object> arguments]) {
     Expression argument = _getArgument(argumentName);
     _reportErrorForNode(errorCode, argument, arguments);
   }
 
-  void _reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
+  void _reportErrorForNode(ErrorCode errorCode, AstNode node,
+      [List<Object> arguments]) {
     int offset = node.offset;
     int length = node.length;
     _reportErrorForOffset(errorCode, offset, length, arguments);
   }
 
-  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+  }
+
+  static Element getElement(AstNode node, int offset) {
+    // maybe node is not SimpleStringLiteral
+    if (node is! SimpleStringLiteral) {
+      return null;
+    }
+    SimpleStringLiteral literal = node as SimpleStringLiteral;
+    // maybe has AngularElement
+    {
+      Element element = literal.toolkitElement;
+      if (element is AngularElement) {
+        return element;
+      }
+    }
+    // prepare enclosing ClassDeclaration
+    ClassDeclaration classDeclaration =
+        node.getAncestor((node) => node is ClassDeclaration);
+    if (classDeclaration == null) {
+      return null;
+    }
+    // prepare ClassElement
+    ClassElement classElement = classDeclaration.element;
+    if (classElement == null) {
+      return null;
+    }
+    // check toolkit objects
+    for (ToolkitObjectElement toolkitObject in classElement.toolkitObjects) {
+      List<AngularPropertyElement> properties =
+          AngularPropertyElement.EMPTY_ARRAY;
+      // maybe name
+      if (toolkitObject is AngularElement) {
+        if (_isNameCoveredByLiteral(toolkitObject, node)) {
+          return toolkitObject;
+        }
+      }
+      // try selector
+      if (toolkitObject is AngularHasSelectorElement) {
+        AngularHasSelectorElement hasSelector = toolkitObject;
+        AngularSelectorElement selector = hasSelector.selector;
+        if (_isNameCoveredByLiteral(selector, node)) {
+          return selector;
+        }
+      }
+      // try properties of AngularComponentElement
+      if (toolkitObject is AngularComponentElement) {
+        AngularComponentElement component = toolkitObject;
+        properties = component.properties;
+      }
+      // try properties of AngularDirectiveElement
+      if (toolkitObject is AngularDecoratorElement) {
+        AngularDecoratorElement directive = toolkitObject;
+        properties = directive.properties;
+      }
+      // check properties
+      for (AngularPropertyElement property in properties) {
+        // property name (use complete node range)
+        if (_isNameCoveredByLiteral(property, node)) {
+          return property;
+        }
+        // field name (use complete node range, including @, => and <=>)
+        FieldElement field = property.field;
+        if (field != null) {
+          int fieldOffset = property.fieldNameOffset;
+          int fieldEnd = fieldOffset + field.name.length;
+          if (node.offset <= fieldOffset && fieldEnd < node.end) {
+            return field;
+          }
+        }
+      }
+    }
+    // no Element
+    return null;
+  }
+
+  /**
+   * Parses given selector text and returns [AngularSelectorElement]. May be `null` if
+   * cannot parse.
+   */
+  static AngularSelectorElement parseSelector(int offset, String text) {
+    // [attribute]
+    if (StringUtilities.startsWithChar(text, 0x5B) &&
+        StringUtilities.endsWithChar(text, 0x5D)) {
+      int nameOffset = offset + 1;
+      String attributeName = text.substring(1, text.length - 1);
+      // TODO(scheglov) report warning if there are spaces between
+      // [ and identifier
+      return new HasAttributeSelectorElementImpl(attributeName, nameOffset);
+    }
+    // .class
+    if (StringUtilities.startsWithChar(text, 0x2E)) {
+      int nameOffset = offset + 1;
+      String className = text.substring(1, text.length);
+      return new AngularHasClassSelectorElementImpl(className, nameOffset);
+    }
+    // tag[attribute]
+    if (StringUtilities.endsWithChar(text, 0x5D)) {
+      int index = StringUtilities.indexOf1(text, 0, 0x5B);
+      if (index != -1) {
+        String tagName = text.substring(0, index);
+        String attributeName = text.substring(index + 1, text.length - 1);
+        if (StringUtilities.isTagName(tagName)) {
+          return new IsTagHasAttributeSelectorElementImpl(
+              tagName,
+              attributeName);
+        }
+      }
+    }
+    // tag
+    if (StringUtilities.isTagName(text)) {
+      return new AngularTagSelectorElementImpl(text, offset);
+    }
+    return null;
+  }
+
+  /**
+   * Returns the [FieldElement] of the first field in the given [FieldDeclaration].
+   */
+  static FieldElement _getOnlyFieldElement(FieldDeclaration fieldDeclaration) {
+    NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables;
+    return fields[0].element as FieldElement;
+  }
+
+  /**
+   * If given [Annotation] has one argument and it is [SimpleStringLiteral], returns it,
+   * otherwise returns `null`.
+   */
+  static SimpleStringLiteral
+      _getOnlySimpleStringLiteralArgument(Annotation annotation) {
+    SimpleStringLiteral nameLiteral = null;
+    ArgumentList argsNode = annotation.arguments;
+    if (argsNode != null) {
+      NodeList<Expression> args = argsNode.arguments;
+      if (args.length == 1) {
+        Expression arg = args[0];
+        if (arg is SimpleStringLiteral) {
+          nameLiteral = arg;
+        }
+      }
+    }
+    return nameLiteral;
+  }
+
+  /**
+   * Checks if the name range of the given [Element] is completely covered by the given
+   * [SimpleStringLiteral].
+   */
+  static bool _isNameCoveredByLiteral(Element element, AstNode node) {
+    if (element != null) {
+      String name = element.name;
+      if (name != null) {
+        int nameOffset = element.nameOffset;
+        int nameEnd = nameOffset + name.length;
+        return node.offset <= nameOffset && nameEnd < node.end;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Parses given [SimpleStringLiteral] using [parseSelector].
+   */
+  static AngularSelectorElement
+      _parseSelectorFromString(SimpleStringLiteral literal) {
+    int offset = literal.contentsOffset;
+    String text = literal.stringValue;
+    return parseSelector(offset, text);
   }
 }
 
@@ -655,31 +700,13 @@
  * violations of Dart best practices.
  */
 class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
-  static String _HASHCODE_GETTER_NAME = "hashCode";
+//  static String _HASHCODE_GETTER_NAME = "hashCode";
 
   static String _NULL_TYPE_NAME = "Null";
 
   static String _TO_INT_METHOD_NAME = "toInt";
 
   /**
-   * Given a parenthesized expression, this returns the parent (or recursively grand-parent) of the
-   * expression that is a parenthesized expression, but whose parent is not a parenthesized
-   * expression.
-   *
-   * For example given the code `(((e)))`: `(e) -> (((e)))`.
-   *
-   * @param parenthesizedExpression some expression whose parent is a parenthesized expression
-   * @return the first parent or grand-parent that is a parenthesized expression, that does not have
-   *         a parenthesized expression parent
-   */
-  static ParenthesizedExpression _wrapParenthesizedExpression(ParenthesizedExpression parenthesizedExpression) {
-    if (parenthesizedExpression.parent is ParenthesizedExpression) {
-      return _wrapParenthesizedExpression(parenthesizedExpression.parent as ParenthesizedExpression);
-    }
-    return parenthesizedExpression;
-  }
-
-  /**
    * The class containing the AST nodes being visited, or `null` if we are not in the scope of
    * a class.
    */
@@ -804,7 +831,8 @@
   }
 
   @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
     _checkForDeprecatedMemberUse(node.staticElement, node);
     return super.visitRedirectingConstructorInvocation(node);
   }
@@ -851,24 +879,34 @@
     if (rhsType.isDynamic && rhsNameStr == sc.Keyword.DYNAMIC.syntax) {
       if (node.notOperator == null) {
         // the is case
-        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node);
+        _errorReporter.reportErrorForNode(
+            HintCode.UNNECESSARY_TYPE_CHECK_TRUE,
+            node);
       } else {
         // the is not case
-        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node);
+        _errorReporter.reportErrorForNode(
+            HintCode.UNNECESSARY_TYPE_CHECK_FALSE,
+            node);
       }
       return true;
     }
     Element rhsElement = rhsType.element;
-    LibraryElement libraryElement = rhsElement != null ? rhsElement.library : null;
+    LibraryElement libraryElement =
+        rhsElement != null ? rhsElement.library : null;
     if (libraryElement != null && libraryElement.isDartCore) {
       // if x is Object or null is Null
-      if (rhsType.isObject || (expression is NullLiteral && rhsNameStr == _NULL_TYPE_NAME)) {
+      if (rhsType.isObject ||
+          (expression is NullLiteral && rhsNameStr == _NULL_TYPE_NAME)) {
         if (node.notOperator == null) {
           // the is case
-          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node);
+          _errorReporter.reportErrorForNode(
+              HintCode.UNNECESSARY_TYPE_CHECK_TRUE,
+              node);
         } else {
           // the is not case
-          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node);
+          _errorReporter.reportErrorForNode(
+              HintCode.UNNECESSARY_TYPE_CHECK_FALSE,
+              node);
         }
         return true;
       } else if (rhsNameStr == _NULL_TYPE_NAME) {
@@ -877,7 +915,9 @@
           _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NULL, node);
         } else {
           // the is not case
-          _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NOT_NULL, node);
+          _errorReporter.reportErrorForNode(
+              HintCode.TYPE_CHECK_IS_NOT_NULL,
+              node);
         }
         return true;
       }
@@ -902,14 +942,17 @@
    * @return `true` if and only if an hint code is generated on the passed node
    * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForArgumentTypeNotAssignable(Expression expression, DartType expectedStaticType, DartType actualStaticType, DartType expectedPropagatedType, DartType actualPropagatedType, ErrorCode hintCode) {
+  bool _checkForArgumentTypeNotAssignable(Expression expression,
+      DartType expectedStaticType, DartType actualStaticType,
+      DartType expectedPropagatedType, DartType actualPropagatedType,
+      ErrorCode hintCode) {
     //
     // Warning case: test static type information
     //
     if (actualStaticType != null && expectedStaticType != null) {
       if (!actualStaticType.isAssignableTo(expectedStaticType)) {
-        // A warning was created in the ErrorVerifier, return false, don't create a hint when a
-        // warning has already been created.
+        // A warning was created in the ErrorVerifier, return false, don't
+        // create a hint when a warning has already been created.
         return false;
       }
     }
@@ -917,11 +960,16 @@
     // Hint case: test propagated type information
     //
     // Compute the best types to use.
-    DartType expectedBestType = expectedPropagatedType != null ? expectedPropagatedType : expectedStaticType;
-    DartType actualBestType = actualPropagatedType != null ? actualPropagatedType : actualStaticType;
+    DartType expectedBestType =
+        expectedPropagatedType != null ? expectedPropagatedType : expectedStaticType;
+    DartType actualBestType =
+        actualPropagatedType != null ? actualPropagatedType : actualStaticType;
     if (actualBestType != null && expectedBestType != null) {
       if (!actualBestType.isAssignableTo(expectedBestType)) {
-        _errorReporter.reportTypeErrorForNode(hintCode, expression, [actualBestType, expectedBestType]);
+        _errorReporter.reportTypeErrorForNode(
+            hintCode,
+            expression,
+            [actualBestType, expectedBestType]);
         return true;
       }
     }
@@ -942,10 +990,17 @@
       return false;
     }
     ParameterElement staticParameterElement = argument.staticParameterElement;
-    DartType staticParameterType = staticParameterElement == null ? null : staticParameterElement.type;
-    ParameterElement propagatedParameterElement = argument.propagatedParameterElement;
-    DartType propagatedParameterType = propagatedParameterElement == null ? null : propagatedParameterElement.type;
-    return _checkForArgumentTypeNotAssignableWithExpectedTypes(argument, staticParameterType, propagatedParameterType, HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+    DartType staticParameterType =
+        staticParameterElement == null ? null : staticParameterElement.type;
+    ParameterElement propagatedParameterElement =
+        argument.propagatedParameterElement;
+    DartType propagatedParameterType =
+        propagatedParameterElement == null ? null : propagatedParameterElement.type;
+    return _checkForArgumentTypeNotAssignableWithExpectedTypes(
+        argument,
+        staticParameterType,
+        propagatedParameterType,
+        HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
   }
 
   /**
@@ -959,7 +1014,17 @@
    * @return `true` if and only if an hint code is generated on the passed node
    * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression, DartType expectedStaticType, DartType expectedPropagatedType, ErrorCode errorCode) => _checkForArgumentTypeNotAssignable(expression, expectedStaticType, expression.staticType, expectedPropagatedType, expression.propagatedType, errorCode);
+  bool
+      _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression,
+      DartType expectedStaticType, DartType expectedPropagatedType,
+      ErrorCode errorCode) =>
+      _checkForArgumentTypeNotAssignable(
+          expression,
+          expectedStaticType,
+          expression.staticType,
+          expectedPropagatedType,
+          expression.propagatedType,
+          errorCode);
 
   /**
    * This verifies that the passed arguments can be assigned to their corresponding parameters.
@@ -996,15 +1061,19 @@
     if (element != null && element.isDeprecated) {
       String displayName = element.displayName;
       if (element is ConstructorElement) {
-        // TODO(jwren) We should modify ConstructorElement.getDisplayName(), or have the logic
-        // centralized elsewhere, instead of doing this logic here.
+        // TODO(jwren) We should modify ConstructorElement.getDisplayName(),
+        // or have the logic centralized elsewhere, instead of doing this logic
+        // here.
         ConstructorElement constructorElement = element;
         displayName = constructorElement.enclosingElement.displayName;
         if (!constructorElement.displayName.isEmpty) {
           displayName = "$displayName.${constructorElement.displayName}";
         }
       }
-      _errorReporter.reportErrorForNode(HintCode.DEPRECATED_MEMBER_USE, node, [displayName]);
+      _errorReporter.reportErrorForNode(
+          HintCode.DEPRECATED_MEMBER_USE,
+          node,
+          [displayName]);
       return true;
     }
     return false;
@@ -1029,7 +1098,10 @@
       return false;
     }
     AstNode parent = identifier.parent;
-    if ((parent is ConstructorName && identical(identifier, parent.name)) || (parent is SuperConstructorInvocation && identical(identifier, parent.constructorName)) || parent is HideCombinator) {
+    if ((parent is ConstructorName && identical(identifier, parent.name)) ||
+        (parent is SuperConstructorInvocation &&
+            identical(identifier, parent.constructorName)) ||
+        parent is HideCombinator) {
       return false;
     }
     return _checkForDeprecatedMemberUse(identifier.bestElement, identifier);
@@ -1047,7 +1119,8 @@
     if (node.operator.type != sc.TokenType.SLASH) {
       return false;
     }
-    // Return if the '/' operator is not defined in core, or if we don't know its static or propagated type
+    // Return if the '/' operator is not defined in core, or if we don't know
+    // its static or propagated type
     MethodElement methodElement = node.bestElement;
     if (methodElement == null) {
       return false;
@@ -1058,11 +1131,16 @@
     }
     // Report error if the (x/y) has toInt() invoked on it
     if (node.parent is ParenthesizedExpression) {
-      ParenthesizedExpression parenthesizedExpression = _wrapParenthesizedExpression(node.parent as ParenthesizedExpression);
+      ParenthesizedExpression parenthesizedExpression =
+          _wrapParenthesizedExpression(node.parent as ParenthesizedExpression);
       if (parenthesizedExpression.parent is MethodInvocation) {
-        MethodInvocation methodInvocation = parenthesizedExpression.parent as MethodInvocation;
-        if (_TO_INT_METHOD_NAME == methodInvocation.methodName.name && methodInvocation.argumentList.arguments.isEmpty) {
-          _errorReporter.reportErrorForNode(HintCode.DIVISION_OPTIMIZATION, methodInvocation);
+        MethodInvocation methodInvocation =
+            parenthesizedExpression.parent as MethodInvocation;
+        if (_TO_INT_METHOD_NAME == methodInvocation.methodName.name &&
+            methodInvocation.argumentList.arguments.isEmpty) {
+          _errorReporter.reportErrorForNode(
+              HintCode.DIVISION_OPTIMIZATION,
+              methodInvocation);
           return true;
         }
       }
@@ -1085,7 +1163,9 @@
       return false;
     }
     VariableElement leftVariableElement = ErrorVerifier.getVariableElement(lhs);
-    DartType leftType = (leftVariableElement == null) ? ErrorVerifier.getStaticType(lhs) : leftVariableElement.type;
+    DartType leftType = (leftVariableElement == null) ?
+        ErrorVerifier.getStaticType(lhs) :
+        leftVariableElement.type;
     DartType staticRightType = ErrorVerifier.getStaticType(rhs);
     if (!staticRightType.isAssignableTo(leftType)) {
       // The warning was generated on this rhs
@@ -1095,7 +1175,10 @@
     DartType bestRightType = rhs.bestType;
     if (leftType != null && bestRightType != null) {
       if (!bestRightType.isAssignableTo(leftType)) {
-        _errorReporter.reportTypeErrorForNode(HintCode.INVALID_ASSIGNMENT, rhs, [bestRightType, leftType]);
+        _errorReporter.reportTypeErrorForNode(
+            HintCode.INVALID_ASSIGNMENT,
+            rhs,
+            [bestRightType, leftType]);
         return true;
       }
     }
@@ -1111,13 +1194,17 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION].
    */
-  bool _checkForLoadLibraryFunction(ImportDirective node, ImportElement importElement) {
+  bool _checkForLoadLibraryFunction(ImportDirective node,
+      ImportElement importElement) {
     LibraryElement importedLibrary = importElement.importedLibrary;
     if (importedLibrary == null) {
       return false;
     }
     if (importedLibrary.hasLoadLibraryFunction) {
-      _errorReporter.reportErrorForNode(HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, node, [importedLibrary.name]);
+      _errorReporter.reportErrorForNode(
+          HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
+          node,
+          [importedLibrary.name]);
       return true;
     }
     return false;
@@ -1150,7 +1237,10 @@
     // Check the block for a return statement, if not, create the hint
     BlockFunctionBody blockFunctionBody = body as BlockFunctionBody;
     if (!blockFunctionBody.accept(new ExitDetector())) {
-      _errorReporter.reportErrorForNode(HintCode.MISSING_RETURN, returnType, [returnTypeType.displayName]);
+      _errorReporter.reportErrorForNode(
+          HintCode.MISSING_RETURN,
+          returnType,
+          [returnTypeType.displayName]);
       return true;
     }
     return false;
@@ -1164,21 +1254,26 @@
    * @return `true` if and only if a hint code is generated on the passed node
    * See [HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE].
    */
-  bool _checkForOverrideEqualsButNotHashCode(ClassDeclaration node) {
-    ClassElement classElement = node.element;
-    if (classElement == null) {
-      return false;
-    }
-    MethodElement equalsOperatorMethodElement = classElement.getMethod(sc.TokenType.EQ_EQ.lexeme);
-    if (equalsOperatorMethodElement != null) {
-      PropertyAccessorElement hashCodeElement = classElement.getGetter(_HASHCODE_GETTER_NAME);
-      if (hashCodeElement == null) {
-        _errorReporter.reportErrorForNode(HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, node.name, [classElement.displayName]);
-        return true;
-      }
-    }
-    return false;
-  }
+//  bool _checkForOverrideEqualsButNotHashCode(ClassDeclaration node) {
+//    ClassElement classElement = node.element;
+//    if (classElement == null) {
+//      return false;
+//    }
+//    MethodElement equalsOperatorMethodElement =
+//        classElement.getMethod(sc.TokenType.EQ_EQ.lexeme);
+//    if (equalsOperatorMethodElement != null) {
+//      PropertyAccessorElement hashCodeElement =
+//          classElement.getGetter(_HASHCODE_GETTER_NAME);
+//      if (hashCodeElement == null) {
+//        _errorReporter.reportErrorForNode(
+//            HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
+//            node.name,
+//            [classElement.displayName]);
+//        return true;
+//      }
+//    }
+//    return false;
+//  }
 
   /**
    * Check for the passed as expression for the [HintCode.UNNECESSARY_CAST] hint code.
@@ -1192,9 +1287,15 @@
     TypeName typeName = node.type;
     DartType lhsType = expression.staticType;
     DartType rhsType = typeName.type;
-    // TODO(jwren) After dartbug.com/13732, revisit this, we should be able to remove the
-    // !(x instanceof TypeParameterType) checks.
-    if (lhsType != null && rhsType != null && !lhsType.isDynamic && !rhsType.isDynamic && lhsType is! TypeParameterType && rhsType is! TypeParameterType && lhsType.isMoreSpecificThan(rhsType)) {
+    // TODO(jwren) After dartbug.com/13732, revisit this, we should be able to
+    // remove the !(x instanceof TypeParameterType) checks.
+    if (lhsType != null &&
+        rhsType != null &&
+        !lhsType.isDynamic &&
+        !rhsType.isDynamic &&
+        lhsType is! TypeParameterType &&
+        rhsType is! TypeParameterType &&
+        lhsType.isMoreSpecificThan(rhsType)) {
       _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_CAST, node);
       return true;
     }
@@ -1219,11 +1320,34 @@
     MethodInvocation methodInvocation = expression as MethodInvocation;
     if (identical(methodInvocation.staticType, VoidTypeImpl.instance)) {
       SimpleIdentifier methodName = methodInvocation.methodName;
-      _errorReporter.reportErrorForNode(HintCode.USE_OF_VOID_RESULT, methodName, [methodName.name]);
+      _errorReporter.reportErrorForNode(
+          HintCode.USE_OF_VOID_RESULT,
+          methodName,
+          [methodName.name]);
       return true;
     }
     return false;
   }
+
+  /**
+   * Given a parenthesized expression, this returns the parent (or recursively grand-parent) of the
+   * expression that is a parenthesized expression, but whose parent is not a parenthesized
+   * expression.
+   *
+   * For example given the code `(((e)))`: `(e) -> (((e)))`.
+   *
+   * @param parenthesizedExpression some expression whose parent is a parenthesized expression
+   * @return the first parent or grand-parent that is a parenthesized expression, that does not have
+   *         a parenthesized expression parent
+   */
+  static ParenthesizedExpression
+      _wrapParenthesizedExpression(ParenthesizedExpression parenthesizedExpression) {
+    if (parenthesizedExpression.parent is ParenthesizedExpression) {
+      return _wrapParenthesizedExpression(
+          parenthesizedExpression.parent as ParenthesizedExpression);
+    }
+    return parenthesizedExpression;
+  }
 }
 
 /**
@@ -1236,7 +1360,8 @@
    * @param enclosingScope the scope in which this scope is lexically enclosed
    * @param typeElement the element representing the type represented by this scope
    */
-  ClassScope(Scope enclosingScope, ClassElement typeElement) : super(enclosingScope) {
+  ClassScope(Scope enclosingScope, ClassElement typeElement)
+      : super(enclosingScope) {
     if (typeElement == null) {
       throw new IllegalArgumentException("class element cannot be null");
     }
@@ -1247,9 +1372,19 @@
   AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
     if (existing is PropertyAccessorElement && duplicate is MethodElement) {
       if (existing.nameOffset < duplicate.nameOffset) {
-        return new AnalysisError.con2(duplicate.source, duplicate.nameOffset, duplicate.displayName.length, CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME, [existing.displayName]);
+        return new AnalysisError.con2(
+            duplicate.source,
+            duplicate.nameOffset,
+            duplicate.displayName.length,
+            CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME,
+            [existing.displayName]);
       } else {
-        return new AnalysisError.con2(existing.source, existing.nameOffset, existing.displayName.length, CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME, [existing.displayName]);
+        return new AnalysisError.con2(
+            existing.source,
+            existing.nameOffset,
+            existing.displayName.length,
+            CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME,
+            [existing.displayName]);
       }
     }
     return super.getErrorForDuplicate(existing, duplicate);
@@ -1280,8 +1415,10 @@
    * compilation [unit] associated with the source. Throw an AnalysisException
    * if the element could not be built.
    */
-  CompilationUnitElementImpl buildCompilationUnit(Source source, CompilationUnit unit) {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+  CompilationUnitElementImpl buildCompilationUnit(Source source,
+      CompilationUnit unit) {
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       if (unit == null) {
         return null;
@@ -1289,7 +1426,8 @@
       ElementHolder holder = new ElementHolder();
       ElementBuilder builder = new ElementBuilder(holder);
       unit.accept(builder);
-      CompilationUnitElementImpl element = new CompilationUnitElementImpl(source.shortName);
+      CompilationUnitElementImpl element =
+          new CompilationUnitElementImpl(source.shortName);
       element.accessors = holder.accessors;
       element.enums = holder.enums;
       element.functions = holder.functions;
@@ -1352,7 +1490,8 @@
    *
    * @param errorReporter the error reporter by which errors will be reported
    */
-  ConstantVerifier(this._errorReporter, this._currentLibrary, this._typeProvider) {
+  ConstantVerifier(this._errorReporter, this._currentLibrary,
+      this._typeProvider) {
     this._boolType = _typeProvider.boolType;
     this._intType = _typeProvider.intType;
     this._numType = _typeProvider.numType;
@@ -1368,13 +1507,17 @@
       ConstructorElement constructorElement = element;
       // should 'const' constructor
       if (!constructorElement.isConst) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, node);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
+            node);
         return null;
       }
       // should have arguments
       ArgumentList argumentList = node.arguments;
       if (argumentList == null) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, node);
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
+            node);
         return null;
       }
       // arguments should be constants
@@ -1404,7 +1547,8 @@
   Object visitInstanceCreationExpression(InstanceCreationExpression node) {
     if (node.isConst) {
       EvaluationResultImpl evaluationResult = node.evaluationResult;
-      // Note: evaluationResult might be null if there are circular references among constants.
+      // Note: evaluationResult might be null if there are circular references
+      // among constants.
       if (evaluationResult != null) {
         _reportErrors(evaluationResult.errors, null);
       }
@@ -1419,9 +1563,12 @@
     if (node.constKeyword != null) {
       DartObjectImpl result;
       for (Expression element in node.elements) {
-        result = _validate(element, CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT);
+        result =
+            _validate(element, CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT);
         if (result != null) {
-          _reportErrorIfFromDeferredLibrary(element, CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY);
+          _reportErrorIfFromDeferredLibrary(
+              element,
+              CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY);
         }
       }
     }
@@ -1438,14 +1585,20 @@
     for (MapLiteralEntry entry in node.entries) {
       Expression key = entry.key;
       if (isConst) {
-        DartObjectImpl keyResult = _validate(key, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
+        DartObjectImpl keyResult =
+            _validate(key, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY);
         Expression valueExpression = entry.value;
-        DartObjectImpl valueResult = _validate(valueExpression, CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE);
+        DartObjectImpl valueResult =
+            _validate(valueExpression, CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE);
         if (valueResult != null) {
-          _reportErrorIfFromDeferredLibrary(valueExpression, CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY);
+          _reportErrorIfFromDeferredLibrary(
+              valueExpression,
+              CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY);
         }
         if (keyResult != null) {
-          _reportErrorIfFromDeferredLibrary(key, CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY);
+          _reportErrorIfFromDeferredLibrary(
+              key,
+              CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY);
           if (keys.contains(keyResult)) {
             invalidKeys.add(key);
           } else {
@@ -1453,14 +1606,20 @@
           }
           DartType type = keyResult.type;
           if (_implementsEqualsWhenNotAllowed(type)) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, key, [type.displayName]);
+            _errorReporter.reportErrorForNode(
+                CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
+                key,
+                [type.displayName]);
           }
         }
       } else {
         // Note: we throw the errors away because this isn't actually a const.
-        AnalysisErrorListener errorListener = AnalysisErrorListener.NULL_LISTENER;
-        ErrorReporter subErrorReporter = new ErrorReporter(errorListener, _errorReporter.source);
-        DartObjectImpl result = key.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
+        AnalysisErrorListener errorListener =
+            AnalysisErrorListener.NULL_LISTENER;
+        ErrorReporter subErrorReporter =
+            new ErrorReporter(errorListener, _errorReporter.source);
+        DartObjectImpl result =
+            key.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
         if (result != null) {
           if (keys.contains(result)) {
             invalidKeys.add(key);
@@ -1474,7 +1633,9 @@
     }
     if (reportEqualKeys) {
       for (Expression key in invalidKeys) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.EQUAL_KEYS_IN_MAP, key);
+        _errorReporter.reportErrorForNode(
+            StaticWarningCode.EQUAL_KEYS_IN_MAP,
+            key);
       }
     }
     return null;
@@ -1499,16 +1660,22 @@
       if (switchMember is SwitchCase) {
         SwitchCase switchCase = switchMember;
         Expression expression = switchCase.expression;
-        DartObjectImpl caseResult = _validate(expression, CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION);
+        DartObjectImpl caseResult =
+            _validate(expression, CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION);
         if (caseResult != null) {
-          _reportErrorIfFromDeferredLibrary(expression, CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY);
+          _reportErrorIfFromDeferredLibrary(
+              expression,
+              CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY);
           DartObject value = caseResult;
           if (firstType == null) {
             firstType = value.type;
           } else {
             DartType nType = value.type;
             if (firstType != nType) {
-              _errorReporter.reportErrorForNode(CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, expression, [expression.toSource(), firstType.displayName]);
+              _errorReporter.reportErrorForNode(
+                  CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+                  expression,
+                  [expression.toSource(), firstType.displayName]);
               foundError = true;
             }
           }
@@ -1530,16 +1697,23 @@
       EvaluationResultImpl result = element.evaluationResult;
       if (result == null) {
         //
-        // Normally we don't need to visit const variable declarations because we have already
-        // computed their values. But if we missed it for some reason, this gives us a second
-        // chance.
+        // Normally we don't need to visit const variable declarations because
+        // we have already computed their values. But if we missed it for some
+        // reason, this gives us a second chance.
         //
-        result = new EvaluationResultImpl.con1(_validate(initializer, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE));
+        result = new EvaluationResultImpl.con1(
+            _validate(
+                initializer,
+                CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE));
         element.evaluationResult = result;
         return null;
       }
-      _reportErrors(result.errors, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
-      _reportErrorIfFromDeferredLibrary(initializer, CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY);
+      _reportErrors(
+          result.errors,
+          CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+      _reportErrorIfFromDeferredLibrary(
+          initializer,
+          CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY);
     }
     return null;
   }
@@ -1553,12 +1727,16 @@
    * @return `true` if and only if an error code is generated on the passed node
    * See [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS].
    */
-  bool _checkForCaseExpressionTypeImplementsEquals(SwitchStatement node, DartType type) {
+  bool _checkForCaseExpressionTypeImplementsEquals(SwitchStatement node,
+      DartType type) {
     if (!_implementsEqualsWhenNotAllowed(type)) {
       return false;
     }
     // report error
-    _errorReporter.reportErrorForToken(CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, node.keyword, [type.displayName]);
+    _errorReporter.reportErrorForToken(
+        CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
+        node.keyword,
+        [type.displayName]);
     return true;
   }
 
@@ -1580,7 +1758,8 @@
     }
     ClassElement classElement = element as ClassElement;
     // lookup for ==
-    MethodElement method = classElement.lookUpConcreteMethod("==", _currentLibrary);
+    MethodElement method =
+        classElement.lookUpConcreteMethod("==", _currentLibrary);
     if (method == null || method.enclosingElement.type.isObject) {
       return false;
     }
@@ -1596,8 +1775,10 @@
    * @param errorCode the error code to be used if the expression is or consists of a reference to a
    *          deferred library
    */
-  void _reportErrorIfFromDeferredLibrary(Expression expression, ErrorCode errorCode) {
-    DeferredLibraryReferenceDetector referenceDetector = new DeferredLibraryReferenceDetector();
+  void _reportErrorIfFromDeferredLibrary(Expression expression,
+      ErrorCode errorCode) {
+    DeferredLibraryReferenceDetector referenceDetector =
+        new DeferredLibraryReferenceDetector();
     expression.accept(referenceDetector);
     if (referenceDetector.result) {
       _errorReporter.reportErrorForNode(errorCode, expression);
@@ -1614,18 +1795,29 @@
   void _reportErrors(List<AnalysisError> errors, ErrorCode errorCode) {
     for (AnalysisError data in errors) {
       ErrorCode dataErrorCode = data.errorCode;
-      if (identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION) ||
+      if (identical(
+          dataErrorCode,
+          CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION) ||
           identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE) ||
-          identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING) ||
+          identical(
+              dataErrorCode,
+              CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING) ||
           identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL) ||
           identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_INT) ||
           identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM) ||
-          identical(dataErrorCode, CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH) ||
-          identical(dataErrorCode, CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH) ||
-          identical(dataErrorCode, CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH)) {
+          identical(
+              dataErrorCode,
+              CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH) ||
+          identical(
+              dataErrorCode,
+              CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH) ||
+          identical(
+              dataErrorCode,
+              CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH)) {
         _errorReporter.reportError(data);
       } else if (errorCode != null) {
-        _errorReporter.reportError(new AnalysisError.con2(data.source, data.offset, data.length, errorCode));
+        _errorReporter.reportError(
+            new AnalysisError.con2(data.source, data.offset, data.length, errorCode));
       }
     }
   }
@@ -1640,8 +1832,10 @@
    */
   DartObjectImpl _validate(Expression expression, ErrorCode errorCode) {
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    ErrorReporter subErrorReporter = new ErrorReporter(errorListener, _errorReporter.source);
-    DartObjectImpl result = expression.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
+    ErrorReporter subErrorReporter =
+        new ErrorReporter(errorListener, _errorReporter.source);
+    DartObjectImpl result =
+        expression.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
     _reportErrors(errorListener.errors, errorCode);
     return result;
   }
@@ -1656,7 +1850,9 @@
       if (argument is NamedExpression) {
         argument = (argument as NamedExpression).expression;
       }
-      _validate(argument, CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT);
+      _validate(
+          argument,
+          CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT);
     }
   }
 
@@ -1667,20 +1863,27 @@
    * @param constructor the constant constructor declaration to validate
    */
   void _validateConstructorInitializers(ConstructorDeclaration constructor) {
-    List<ParameterElement> parameterElements = constructor.parameters.parameterElements;
+    List<ParameterElement> parameterElements =
+        constructor.parameters.parameterElements;
     NodeList<ConstructorInitializer> initializers = constructor.initializers;
     for (ConstructorInitializer initializer in initializers) {
       if (initializer is ConstructorFieldInitializer) {
         ConstructorFieldInitializer fieldInitializer = initializer;
-        _validateInitializerExpression(parameterElements, fieldInitializer.expression);
+        _validateInitializerExpression(
+            parameterElements,
+            fieldInitializer.expression);
       }
       if (initializer is RedirectingConstructorInvocation) {
         RedirectingConstructorInvocation invocation = initializer;
-        _validateInitializerInvocationArguments(parameterElements, invocation.argumentList);
+        _validateInitializerInvocationArguments(
+            parameterElements,
+            invocation.argumentList);
       }
       if (initializer is SuperConstructorInvocation) {
         SuperConstructorInvocation invocation = initializer;
-        _validateInitializerInvocationArguments(parameterElements, invocation.argumentList);
+        _validateInitializerInvocationArguments(
+            parameterElements,
+            invocation.argumentList);
       }
     }
   }
@@ -1701,13 +1904,15 @@
         Expression defaultValue = defaultParameter.defaultValue;
         DartObjectImpl result;
         if (defaultValue == null) {
-          result = new DartObjectImpl(_typeProvider.nullType,
-              NullState.NULL_STATE);
+          result =
+              new DartObjectImpl(_typeProvider.nullType, NullState.NULL_STATE);
         } else {
-          result = _validate(defaultValue,
-              CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
+          result =
+              _validate(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
           if (result != null) {
-            _reportErrorIfFromDeferredLibrary(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY);
+            _reportErrorIfFromDeferredLibrary(
+                defaultValue,
+                CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY);
           }
         }
         VariableElementImpl element = parameter.element as VariableElementImpl;
@@ -1724,22 +1929,30 @@
    * @param classDeclaration the class which should be validated
    * @param errorSite the site at which errors should be reported.
    */
-  void _validateFieldInitializers(ClassDeclaration classDeclaration, ConstructorDeclaration errorSite) {
+  void _validateFieldInitializers(ClassDeclaration classDeclaration,
+      ConstructorDeclaration errorSite) {
     NodeList<ClassMember> members = classDeclaration.members;
     for (ClassMember member in members) {
       if (member is FieldDeclaration) {
         FieldDeclaration fieldDeclaration = member;
         if (!fieldDeclaration.isStatic) {
-          for (VariableDeclaration variableDeclaration in fieldDeclaration.fields.variables) {
+          for (VariableDeclaration variableDeclaration in
+              fieldDeclaration.fields.variables) {
             Expression initializer = variableDeclaration.initializer;
             if (initializer != null) {
-              // Ignore any errors produced during validation--if the constant can't be eavluated
-              // we'll just report a single error.
-              AnalysisErrorListener errorListener = AnalysisErrorListener.NULL_LISTENER;
-              ErrorReporter subErrorReporter = new ErrorReporter(errorListener, _errorReporter.source);
-              DartObjectImpl result = initializer.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
+              // Ignore any errors produced during validation--if the constant
+              // can't be eavluated we'll just report a single error.
+              AnalysisErrorListener errorListener =
+                  AnalysisErrorListener.NULL_LISTENER;
+              ErrorReporter subErrorReporter =
+                  new ErrorReporter(errorListener, _errorReporter.source);
+              DartObjectImpl result =
+                  initializer.accept(new ConstantVisitor.con1(_typeProvider, subErrorReporter));
               if (result == null) {
-                _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, errorSite, [variableDeclaration.name.name]);
+                _errorReporter.reportErrorForNode(
+                    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
+                    errorSite,
+                    [variableDeclaration.name.name]);
               }
             }
           }
@@ -1755,13 +1968,24 @@
    *          considered as a valid potentially constant expressions
    * @param expression the expression to validate
    */
-  void _validateInitializerExpression(List<ParameterElement> parameterElements, Expression expression) {
+  void _validateInitializerExpression(List<ParameterElement> parameterElements,
+      Expression expression) {
     RecordingErrorListener errorListener = new RecordingErrorListener();
-    ErrorReporter subErrorReporter = new ErrorReporter(errorListener, _errorReporter.source);
-    DartObjectImpl result = expression.accept(new ConstantVisitor_ConstantVerifier_validateInitializerExpression(_typeProvider, subErrorReporter, this, parameterElements));
-    _reportErrors(errorListener.errors, CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER);
+    ErrorReporter subErrorReporter =
+        new ErrorReporter(errorListener, _errorReporter.source);
+    DartObjectImpl result = expression.accept(
+        new _ConstantVerifier_validateInitializerExpression(
+            _typeProvider,
+            subErrorReporter,
+            this,
+            parameterElements));
+    _reportErrors(
+        errorListener.errors,
+        CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER);
     if (result != null) {
-      _reportErrorIfFromDeferredLibrary(expression, CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY);
+      _reportErrorIfFromDeferredLibrary(
+          expression,
+          CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY);
     }
   }
 
@@ -1772,7 +1996,9 @@
    *          considered as a valid potentially constant expressions
    * @param argumentList the argument list to validate
    */
-  void _validateInitializerInvocationArguments(List<ParameterElement> parameterElements, ArgumentList argumentList) {
+  void
+      _validateInitializerInvocationArguments(List<ParameterElement> parameterElements,
+      ArgumentList argumentList) {
     if (argumentList == null) {
       return;
     }
@@ -1799,63 +2025,22 @@
   }
 }
 
-class ConstantVisitor_ConstantVerifier_validateInitializerExpression extends ConstantVisitor {
-  final ConstantVerifier ConstantVerifier_this;
-
-  List<ParameterElement> parameterElements;
-
-  ConstantVisitor_ConstantVerifier_validateInitializerExpression(TypeProvider arg0, ErrorReporter arg1, this.ConstantVerifier_this, this.parameterElements) : super.con1(arg0, arg1);
-
-  @override
-  DartObjectImpl visitSimpleIdentifier(SimpleIdentifier node) {
-    Element element = node.staticElement;
-    for (ParameterElement parameterElement in parameterElements) {
-      if (identical(parameterElement, element) && parameterElement != null) {
-        DartType type = parameterElement.type;
-        if (type != null) {
-          if (type.isDynamic) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.objectType, DynamicState.DYNAMIC_STATE);
-          } else if (type.isSubtypeOf(ConstantVerifier_this._boolType)) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.boolType, BoolState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(ConstantVerifier_this._typeProvider.doubleType)) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.doubleType, DoubleState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(ConstantVerifier_this._intType)) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.intType, IntState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(ConstantVerifier_this._numType)) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.numType, NumState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(ConstantVerifier_this._stringType)) {
-            return new DartObjectImpl(ConstantVerifier_this._typeProvider.stringType, StringState.UNKNOWN_VALUE);
-          }
-          //
-          // We don't test for other types of objects (such as List, Map, Function or Type)
-          // because there are no operations allowed on such types other than '==' and '!=',
-          // which means that we don't need to know the type when there is no specific data
-          // about the state of such objects.
-          //
-        }
-        return new DartObjectImpl(type is InterfaceType ? type : ConstantVerifier_this._typeProvider.objectType, GenericState.UNKNOWN_VALUE);
-      }
-    }
-    return super.visitSimpleIdentifier(node);
-  }
-}
-
 /**
  * Instances of the class `Dart2JSVerifier` traverse an AST structure looking for hints for
  * code that will be compiled to JS, such as [HintCode.IS_DOUBLE].
  */
 class Dart2JSVerifier extends RecursiveAstVisitor<Object> {
   /**
-   * The error reporter by which errors will be reported.
-   */
-  final ErrorReporter _errorReporter;
-
-  /**
    * The name of the `double` type.
    */
   static String _DOUBLE_TYPE_NAME = "double";
 
   /**
+   * The error reporter by which errors will be reported.
+   */
+  final ErrorReporter _errorReporter;
+
+  /**
    * Create a new instance of the [Dart2JSVerifier].
    *
    * @param errorReporter the error reporter
@@ -1895,7 +2080,9 @@
       //        }
       //        return true;
       //      } else
-      if (typeNameStr == _DOUBLE_TYPE_NAME && libraryElement != null && libraryElement.isDartCore) {
+      if (typeNameStr == _DOUBLE_TYPE_NAME &&
+          libraryElement != null &&
+          libraryElement.isDartCore) {
         if (node.notOperator == null) {
           _errorReporter.reportErrorForNode(HintCode.IS_DOUBLE, node);
         } else {
@@ -1909,44 +2096,6 @@
 }
 
 /**
- * Instances of the class [UnusedElementVerifier] traverse an element
- * structure looking for cases of [HintCode.UNUSED_ELEMENT] and
- * [HintCode.UNUSED_LOCAL_VARIABLE].
- */
-class UnusedElementVerifier extends RecursiveElementVisitor {
-  /**
-   * The error reporter by which errors will be reported.
-   */
-  final ErrorReporter _errorReporter;
-
-  /**
-   * Create a new instance of the [UnusedElementVerifier].
-   */
-  UnusedElementVerifier(this._errorReporter);
-
-  @override
-  visitClassElement(ClassElement element) {
-    if (element is ClassElementImpl && !element.isUsed) {
-      _errorReporter.reportErrorForElement(
-          HintCode.UNUSED_ELEMENT,
-          element,
-          [element.kind.displayName, element.displayName]);
-    }
-    element.visitChildren(this);
-  }
-
-  @override
-  visitLocalVariableElement(LocalVariableElement element) {
-    if (element is LocalVariableElementImpl && !element.isUsed) {
-      _errorReporter.reportErrorForElement(
-          HintCode.UNUSED_LOCAL_VARIABLE,
-          element,
-          [element.displayName]);
-    }
-  }
-}
-
-/**
  * Instances of the class `DeadCodeVerifier` traverse an AST structure looking for cases of
  * [HintCode.DEAD_CODE].
  */
@@ -1975,37 +2124,42 @@
         if (lhsResult != null) {
           if (lhsResult.value.isTrue && isBarBar) {
             // report error on else block: true || !e!
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand);
+            _errorReporter.reportErrorForNode(
+                HintCode.DEAD_CODE,
+                node.rightOperand);
             // only visit the LHS:
             _safelyVisit(lhsCondition);
             return null;
           } else if (lhsResult.value.isFalse && isAmpAmp) {
             // report error on if block: false && !e!
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand);
+            _errorReporter.reportErrorForNode(
+                HintCode.DEAD_CODE,
+                node.rightOperand);
             // only visit the LHS:
             _safelyVisit(lhsCondition);
             return null;
           }
         }
       }
-      // How do we want to handle the RHS? It isn't dead code, but "pointless" or "obscure"...
-      //      Expression rhsCondition = node.getRightOperand();
-      //      ValidResult rhsResult = getConstantBooleanValue(rhsCondition);
-      //      if (rhsResult != null) {
-      //        if (rhsResult == ValidResult.RESULT_TRUE && isBarBar) {
-      //          // report error on else block: !e! || true
-      //          errorReporter.reportError(HintCode.DEAD_CODE, node.getRightOperand());
-      //          // only visit the RHS:
-      //          safelyVisit(rhsCondition);
-      //          return null;
-      //        } else if (rhsResult == ValidResult.RESULT_FALSE && isAmpAmp) {
-      //          // report error on if block: !e! && false
-      //          errorReporter.reportError(HintCode.DEAD_CODE, node.getRightOperand());
-      //          // only visit the RHS:
-      //          safelyVisit(rhsCondition);
-      //          return null;
-      //        }
-      //      }
+      // How do we want to handle the RHS? It isn't dead code, but "pointless"
+      // or "obscure"...
+//            Expression rhsCondition = node.getRightOperand();
+//            ValidResult rhsResult = getConstantBooleanValue(rhsCondition);
+//            if (rhsResult != null) {
+//              if (rhsResult == ValidResult.RESULT_TRUE && isBarBar) {
+//                // report error on else block: !e! || true
+//                errorReporter.reportError(HintCode.DEAD_CODE, node.getRightOperand());
+//                // only visit the RHS:
+//                safelyVisit(rhsCondition);
+//                return null;
+//              } else if (rhsResult == ValidResult.RESULT_FALSE && isAmpAmp) {
+//                // report error on if block: !e! && false
+//                errorReporter.reportError(HintCode.DEAD_CODE, node.getRightOperand());
+//                // only visit the RHS:
+//                safelyVisit(rhsCondition);
+//                return null;
+//              }
+//            }
     }
     return super.visitBinaryExpression(node);
   }
@@ -2028,16 +2182,21 @@
     Expression conditionExpression = node.condition;
     _safelyVisit(conditionExpression);
     if (!_isDebugConstant(conditionExpression)) {
-      EvaluationResultImpl result = _getConstantBooleanValue(conditionExpression);
+      EvaluationResultImpl result =
+          _getConstantBooleanValue(conditionExpression);
       if (result != null) {
         if (result.value.isTrue) {
           // report error on else block: true ? 1 : !2!
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.elseExpression);
+          _errorReporter.reportErrorForNode(
+              HintCode.DEAD_CODE,
+              node.elseExpression);
           _safelyVisit(node.thenExpression);
           return null;
         } else {
           // report error on if block: false ? !1! : 2
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenExpression);
+          _errorReporter.reportErrorForNode(
+              HintCode.DEAD_CODE,
+              node.thenExpression);
           _safelyVisit(node.elseExpression);
           return null;
         }
@@ -2051,19 +2210,24 @@
     Expression conditionExpression = node.condition;
     _safelyVisit(conditionExpression);
     if (!_isDebugConstant(conditionExpression)) {
-      EvaluationResultImpl result = _getConstantBooleanValue(conditionExpression);
+      EvaluationResultImpl result =
+          _getConstantBooleanValue(conditionExpression);
       if (result != null) {
         if (result.value.isTrue) {
           // report error on else block: if(true) {} else {!}
           Statement elseStatement = node.elseStatement;
           if (elseStatement != null) {
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, elseStatement);
+            _errorReporter.reportErrorForNode(
+                HintCode.DEAD_CODE,
+                elseStatement);
             _safelyVisit(node.thenStatement);
             return null;
           }
         } else {
           // report error on if block: if (false) {!} else {}
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenStatement);
+          _errorReporter.reportErrorForNode(
+              HintCode.DEAD_CODE,
+              node.thenStatement);
           _safelyVisit(node.elseStatement);
           return null;
         }
@@ -2094,23 +2258,27 @@
     for (int i = 0; i < numOfCatchClauses; i++) {
       CatchClause catchClause = catchClauses[i];
       if (catchClause.onKeyword != null) {
-        // on-catch clause found, verify that the exception type is not a subtype of a previous
-        // on-catch exception type
+        // on-catch clause found, verify that the exception type is not a
+        // subtype of a previous on-catch exception type
         TypeName typeName = catchClause.exceptionType;
         if (typeName != null && typeName.type != null) {
           DartType currentType = typeName.type;
           if (currentType.isObject) {
-            // Found catch clause clause that has Object as an exception type, this is equivalent to
-            // having a catch clause that doesn't have an exception type, visit the block, but
-             // generate an error on any following catch clauses (and don't visit them).
+            // Found catch clause clause that has Object as an exception type,
+            // this is equivalent to having a catch clause that doesn't have an
+            // exception type, visit the block, but generate an error on any
+            // following catch clauses (and don't visit them).
             _safelyVisit(catchClause);
             if (i + 1 != numOfCatchClauses) {
-               // this catch clause is not the last in the try statement
+              // this catch clause is not the last in the try statement
               CatchClause nextCatchClause = catchClauses[i + 1];
               CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
               int offset = nextCatchClause.offset;
               int length = lastCatchClause.end - offset;
-              _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length);
+              _errorReporter.reportErrorForOffset(
+                  HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH,
+                  offset,
+                  length);
               return null;
             }
           }
@@ -2119,7 +2287,11 @@
               CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
               int offset = catchClause.offset;
               int length = lastCatchClause.end - offset;
-              _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_ON_CATCH_SUBTYPE, offset, length, [currentType.displayName, type.displayName]);
+              _errorReporter.reportErrorForOffset(
+                  HintCode.DEAD_CODE_ON_CATCH_SUBTYPE,
+                  offset,
+                  length,
+                  [currentType.displayName, type.displayName]);
               return null;
             }
           }
@@ -2127,8 +2299,9 @@
         }
         _safelyVisit(catchClause);
       } else {
-         // Found catch clause clause that doesn't have an exception type, visit the block, but
-        // generate an error on any following catch clauses (and don't visit them).
+        // Found catch clause clause that doesn't have an exception type,
+        // visit the block, but generate an error on any following catch clauses
+        // (and don't visit them).
         _safelyVisit(catchClause);
         if (i + 1 != numOfCatchClauses) {
           // this catch clause is not the last in the try statement
@@ -2136,7 +2309,10 @@
           CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
           int offset = nextCatchClause.offset;
           int length = lastCatchClause.end - offset;
-          _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length);
+          _errorReporter.reportErrorForOffset(
+              HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH,
+              offset,
+              length);
           return null;
         }
       }
@@ -2149,7 +2325,8 @@
     Expression conditionExpression = node.condition;
     _safelyVisit(conditionExpression);
     if (!_isDebugConstant(conditionExpression)) {
-      EvaluationResultImpl result = _getConstantBooleanValue(conditionExpression);
+      EvaluationResultImpl result =
+          _getConstantBooleanValue(conditionExpression);
       if (result != null) {
         if (result.value.isFalse) {
           // report error on if block: while (false) {!}
@@ -2174,7 +2351,10 @@
     for (int i = 0; i < size; i++) {
       Statement currentStatement = statements[i];
       _safelyVisit(currentStatement);
-      bool returnOrBreakingStatement = currentStatement is ReturnStatement || (currentStatement is BreakStatement && currentStatement.label == null) || (currentStatement is ContinueStatement && currentStatement.label == null);
+      bool returnOrBreakingStatement =
+          currentStatement is ReturnStatement ||
+          (currentStatement is BreakStatement && currentStatement.label == null) ||
+          (currentStatement is ContinueStatement && currentStatement.label == null);
       if (returnOrBreakingStatement && i != size - 1) {
         Statement nextStatement = statements[i + 1];
         Statement lastStatement = statements[size - 1];
@@ -2199,22 +2379,24 @@
   EvaluationResultImpl _getConstantBooleanValue(Expression expression) {
     if (expression is BooleanLiteral) {
       if (expression.value) {
-        return new EvaluationResultImpl.con1(new DartObjectImpl(null, BoolState.from(true)));
+        return new EvaluationResultImpl.con1(
+            new DartObjectImpl(null, BoolState.from(true)));
       } else {
-        return new EvaluationResultImpl.con1(new DartObjectImpl(null, BoolState.from(false)));
+        return new EvaluationResultImpl.con1(
+            new DartObjectImpl(null, BoolState.from(false)));
       }
     }
     // Don't consider situations where we could evaluate to a constant boolean
     // expression with the ConstantVisitor
-       // else {
-         // EvaluationResultImpl result = expression.accept(new ConstantVisitor());
-         // if (result == ValidResult.RESULT_TRUE) {
-           // return ValidResult.RESULT_TRUE;
-         // } else if (result == ValidResult.RESULT_FALSE) {
-           // return ValidResult.RESULT_FALSE;
-         // }
-         // return null;
-       // }
+    // else {
+    // EvaluationResultImpl result = expression.accept(new ConstantVisitor());
+    // if (result == ValidResult.RESULT_TRUE) {
+    // return ValidResult.RESULT_TRUE;
+    // } else if (result == ValidResult.RESULT_FALSE) {
+    // return ValidResult.RESULT_FALSE;
+    // }
+    // return null;
+    // }
     return null;
   }
 
@@ -2254,644 +2436,6 @@
 }
 
 /**
- * Instances of the class `DeclarationMatcher` determine whether the element model defined by
- * a given AST structure matches an existing element model.
- */
-class DeclarationMatcher extends RecursiveAstVisitor<Object> {
-  /**
-   * The compilation unit containing the AST nodes being visited.
-   */
-  CompilationUnitElement _enclosingUnit;
-
-  /**
-   * The function type alias containing the AST nodes being visited, or `null` if we are not
-   * in the scope of a function type alias.
-   */
-  FunctionTypeAliasElement _enclosingAlias;
-
-  /**
-   * The class containing the AST nodes being visited, or `null` if we are not in the scope of
-   * a class.
-   */
-  ClassElement _enclosingClass;
-
-  /**
-   * The method or function containing the AST nodes being visited, or `null` if we are not in
-   * the scope of a method or function.
-   */
-  ExecutableElement _enclosingExecutable;
-
-  /**
-   * The parameter containing the AST nodes being visited, or `null` if we are not in the
-   * scope of a parameter.
-   */
-  ParameterElement _enclosingParameter;
-
-  /**
-   * A set containing all of the elements in the element model that were defined by the old AST node
-   * corresponding to the AST node being visited.
-   */
-  HashSet<Element> _allElements = new HashSet<Element>();
-
-  /**
-   * A set containing all of the elements in the element model that were defined by the old AST node
-   * corresponding to the AST node being visited that have not already been matched to nodes in the
-   * AST structure being visited.
-   */
-  HashSet<Element> _unmatchedElements = new HashSet<Element>();
-
-  /**
-   * Return `true` if the declarations within the given AST structure define an element model
-   * that is equivalent to the corresponding elements rooted at the given element.
-   *
-   * @param node the AST structure being compared to the element model
-   * @param element the root of the element model being compared to the AST structure
-   * @return `true` if the AST structure defines the same elements as those in the given
-   *         element model
-   */
-  bool matches(AstNode node, Element element) {
-    _captureEnclosingElements(element);
-    _gatherElements(element);
-    try {
-      node.accept(this);
-    } on DeclarationMatcher_DeclarationMismatchException catch (exception) {
-      return false;
-    }
-    return _unmatchedElements.isEmpty;
-  }
-
-  @override
-  Object visitCatchClause(CatchClause node) {
-    SimpleIdentifier exceptionParameter = node.exceptionParameter;
-    if (exceptionParameter != null) {
-      List<LocalVariableElement> localVariables = _enclosingExecutable.localVariables;
-      LocalVariableElement exceptionElement = _findIdentifier(localVariables, exceptionParameter);
-      processElement(exceptionElement);
-      SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
-      if (stackTraceParameter != null) {
-        LocalVariableElement stackTraceElement = _findIdentifier(localVariables, stackTraceParameter);
-        processElement(stackTraceElement);
-      }
-    }
-    return super.visitCatchClause(node);
-  }
-
-  @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    ClassElement outerClass = _enclosingClass;
-    try {
-      SimpleIdentifier className = node.name;
-      _enclosingClass = _findIdentifier(_enclosingUnit.types, className);
-      processElement(_enclosingClass);
-      if (!_hasConstructor(node)) {
-        ConstructorElement constructor = _enclosingClass.unnamedConstructor;
-        if (constructor.isSynthetic) {
-          processElement(constructor);
-        }
-      }
-      return super.visitClassDeclaration(node);
-    } finally {
-      _enclosingClass = outerClass;
-    }
-  }
-
-  @override
-  Object visitClassTypeAlias(ClassTypeAlias node) {
-    ClassElement outerClass = _enclosingClass;
-    try {
-      SimpleIdentifier className = node.name;
-      _enclosingClass = _findIdentifier(_enclosingUnit.types, className);
-      processElement(_enclosingClass);
-      return super.visitClassTypeAlias(node);
-    } finally {
-      _enclosingClass = outerClass;
-    }
-  }
-
-  @override
-  Object visitCompilationUnit(CompilationUnit node) {
-    processElement(_enclosingUnit);
-    return super.visitCompilationUnit(node);
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      SimpleIdentifier constructorName = node.name;
-      if (constructorName == null) {
-        _enclosingExecutable = _enclosingClass.unnamedConstructor;
-      } else {
-        _enclosingExecutable = _enclosingClass.getNamedConstructor(constructorName.name);
-      }
-      processElement(_enclosingExecutable);
-      return super.visitConstructorDeclaration(node);
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
-    SimpleIdentifier variableName = node.identifier;
-    LocalVariableElement element = _findIdentifier(_enclosingExecutable.localVariables, variableName);
-    processElement(element);
-    return super.visitDeclaredIdentifier(node);
-  }
-
-  @override
-  Object visitDefaultFormalParameter(DefaultFormalParameter node) {
-    SimpleIdentifier parameterName = node.parameter.identifier;
-    ParameterElement element = _getElementForParameter(node, parameterName);
-    Expression defaultValue = node.defaultValue;
-    if (defaultValue != null) {
-      ExecutableElement outerExecutable = _enclosingExecutable;
-      try {
-        if (element == null) {
-          // TODO(brianwilkerson) Report this internal error.
-        } else {
-          _enclosingExecutable = element.initializer;
-        }
-        defaultValue.accept(this);
-      } finally {
-        _enclosingExecutable = outerExecutable;
-      }
-      processElement(_enclosingExecutable);
-    }
-    ParameterElement outerParameter = _enclosingParameter;
-    try {
-      _enclosingParameter = element;
-      processElement(_enclosingParameter);
-      return super.visitDefaultFormalParameter(node);
-    } finally {
-      _enclosingParameter = outerParameter;
-    }
-  }
-
-  @override
-  Object visitEnumDeclaration(EnumDeclaration node) {
-    ClassElement enclosingEnum = _findIdentifier(_enclosingUnit.enums, node.name);
-    processElement(enclosingEnum);
-    List<FieldElement> constants = enclosingEnum.fields;
-    for (EnumConstantDeclaration constant in node.constants) {
-      FieldElement constantElement = _findIdentifier(constants, constant.name);
-      processElement(constantElement);
-    }
-    return super.visitEnumDeclaration(node);
-  }
-
-  @override
-  Object visitExportDirective(ExportDirective node) {
-    String uri = _getStringValue(node.uri);
-    if (uri != null) {
-      LibraryElement library = _enclosingUnit.library;
-      ExportElement exportElement = _findExport(library.exports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri));
-      processElement(exportElement);
-    }
-    return super.visitExportDirective(node);
-  }
-
-  @override
-  Object visitFieldFormalParameter(FieldFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        processElement(_enclosingParameter);
-        return super.visitFieldFormalParameter(node);
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {
-      return super.visitFieldFormalParameter(node);
-    }
-  }
-
-  @override
-  Object visitFunctionDeclaration(FunctionDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      SimpleIdentifier functionName = node.name;
-      sc.Token property = node.propertyKeyword;
-      if (property == null) {
-        if (_enclosingExecutable != null) {
-          _enclosingExecutable = _findIdentifier(_enclosingExecutable.functions, functionName);
-        } else {
-          _enclosingExecutable = _findIdentifier(_enclosingUnit.functions, functionName);
-        }
-      } else {
-        PropertyAccessorElement accessor = _findIdentifier(_enclosingUnit.accessors, functionName);
-        if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
-          accessor = accessor.variable.setter;
-        }
-        _enclosingExecutable = accessor;
-      }
-      processElement(_enclosingExecutable);
-      return super.visitFunctionDeclaration(node);
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitFunctionExpression(FunctionExpression node) {
-    if (node.parent is! FunctionDeclaration) {
-      FunctionElement element = _findAtOffset(_enclosingExecutable.functions, node.beginToken.offset);
-      processElement(element);
-    }
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      _enclosingExecutable = node.element;
-      processElement(_enclosingExecutable);
-      return super.visitFunctionExpression(node);
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    FunctionTypeAliasElement outerAlias = _enclosingAlias;
-    try {
-      SimpleIdentifier aliasName = node.name;
-      _enclosingAlias = _findIdentifier(_enclosingUnit.functionTypeAliases, aliasName);
-      processElement(_enclosingAlias);
-      return super.visitFunctionTypeAlias(node);
-    } finally {
-      _enclosingAlias = outerAlias;
-    }
-  }
-
-  @override
-  Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        processElement(_enclosingParameter);
-        return super.visitFunctionTypedFormalParameter(node);
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {
-      return super.visitFunctionTypedFormalParameter(node);
-    }
-  }
-
-  @override
-  Object visitImportDirective(ImportDirective node) {
-    String uri = _getStringValue(node.uri);
-    if (uri != null) {
-      LibraryElement library = _enclosingUnit.library;
-      ImportElement importElement = _findImport(library.imports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri), node.prefix);
-      processElement(importElement);
-    }
-    return super.visitImportDirective(node);
-  }
-
-  @override
-  Object visitLabeledStatement(LabeledStatement node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElement element = _findIdentifier(_enclosingExecutable.labels, labelName);
-      processElement(element);
-    }
-    return super.visitLabeledStatement(node);
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    ExecutableElement outerExecutable = _enclosingExecutable;
-    try {
-      sc.Token property = node.propertyKeyword;
-      SimpleIdentifier methodName = node.name;
-      String nameOfMethod = methodName.name;
-      if (nameOfMethod == sc.TokenType.MINUS.lexeme && node.parameters.parameters.length == 0) {
-        nameOfMethod = "unary-";
-      }
-      if (property == null) {
-        _enclosingExecutable = _findWithNameAndOffset(_enclosingClass.methods, nameOfMethod, methodName.offset);
-        methodName.staticElement = _enclosingExecutable;
-      } else {
-        PropertyAccessorElement accessor = _findIdentifier(_enclosingClass.accessors, methodName);
-        if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
-          accessor = accessor.variable.setter;
-          methodName.staticElement = accessor;
-        }
-        _enclosingExecutable = accessor;
-      }
-      processElement(_enclosingExecutable);
-      return super.visitMethodDeclaration(node);
-    } finally {
-      _enclosingExecutable = outerExecutable;
-    }
-  }
-
-  @override
-  Object visitPartDirective(PartDirective node) {
-    String uri = _getStringValue(node.uri);
-    if (uri != null) {
-      Source partSource = _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri);
-      CompilationUnitElement element = _findPart(_enclosingUnit.library.parts, partSource);
-      processElement(element);
-    }
-    return super.visitPartDirective(node);
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    if (node.parent is! DefaultFormalParameter) {
-      SimpleIdentifier parameterName = node.identifier;
-      ParameterElement element = _getElementForParameter(node, parameterName);
-      ParameterElement outerParameter = _enclosingParameter;
-      try {
-        _enclosingParameter = element;
-        processElement(_enclosingParameter);
-        return super.visitSimpleFormalParameter(node);
-      } finally {
-        _enclosingParameter = outerParameter;
-      }
-    } else {
-    }
-    return super.visitSimpleFormalParameter(node);
-  }
-
-  @override
-  Object visitSwitchCase(SwitchCase node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElement element = _findIdentifier(_enclosingExecutable.labels, labelName);
-      processElement(element);
-    }
-    return super.visitSwitchCase(node);
-  }
-
-  @override
-  Object visitSwitchDefault(SwitchDefault node) {
-    for (Label label in node.labels) {
-      SimpleIdentifier labelName = label.label;
-      LabelElement element = _findIdentifier(_enclosingExecutable.labels, labelName);
-      processElement(element);
-    }
-    return super.visitSwitchDefault(node);
-  }
-
-  @override
-  Object visitTypeParameter(TypeParameter node) {
-    SimpleIdentifier parameterName = node.name;
-    TypeParameterElement element = null;
-    if (_enclosingClass != null) {
-      element = _findIdentifier(_enclosingClass.typeParameters, parameterName);
-    } else if (_enclosingAlias != null) {
-      element = _findIdentifier(_enclosingAlias.typeParameters, parameterName);
-    }
-    processElement(element);
-    return super.visitTypeParameter(node);
-  }
-
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    VariableElement element = null;
-    SimpleIdentifier variableName = node.name;
-    if (_enclosingExecutable != null) {
-      element = _findIdentifier(_enclosingExecutable.localVariables, variableName);
-    }
-    if (element == null && _enclosingClass != null) {
-      element = _findIdentifier(_enclosingClass.fields, variableName);
-    }
-    if (element == null && _enclosingUnit != null) {
-      element = _findIdentifier(_enclosingUnit.topLevelVariables, variableName);
-    }
-    Expression initializer = node.initializer;
-    if (initializer != null) {
-      ExecutableElement outerExecutable = _enclosingExecutable;
-      try {
-        if (element == null) {
-          // TODO(brianwilkerson) Report this internal error.
-        } else {
-          _enclosingExecutable = element.initializer;
-        }
-        processElement(element);
-        processElement(_enclosingExecutable);
-        return super.visitVariableDeclaration(node);
-      } finally {
-        _enclosingExecutable = outerExecutable;
-      }
-    }
-    return super.visitVariableDeclaration(node);
-  }
-
-  void processElement(Element element) {
-    if (element == null) {
-      throw new DeclarationMatcher_DeclarationMismatchException();
-    }
-    if (!_allElements.contains(element)) {
-      throw new DeclarationMatcher_DeclarationMismatchException();
-    }
-    _unmatchedElements.remove(element);
-  }
-
-  /**
-   * Given that the comparison is to begin with the given element, capture the enclosing elements
-   * that might be used while performing the comparison.
-   *
-   * @param element the element corresponding to the AST structure to be compared
-   */
-  void _captureEnclosingElements(Element element) {
-    Element parent = element is CompilationUnitElement ? element : element.enclosingElement;
-    while (parent != null) {
-      if (parent is CompilationUnitElement) {
-        _enclosingUnit = parent as CompilationUnitElement;
-      } else if (parent is ClassElement) {
-        if (_enclosingClass == null) {
-          _enclosingClass = parent as ClassElement;
-        }
-      } else if (parent is FunctionTypeAliasElement) {
-        if (_enclosingAlias == null) {
-          _enclosingAlias = parent as FunctionTypeAliasElement;
-        }
-      } else if (parent is ExecutableElement) {
-        if (_enclosingExecutable == null) {
-          _enclosingExecutable = parent as ExecutableElement;
-        }
-      } else if (parent is ParameterElement) {
-        if (_enclosingParameter == null) {
-          _enclosingParameter = parent as ParameterElement;
-        }
-      }
-      parent = parent.enclosingElement;
-    }
-  }
-
-  /**
-   * Return the element in the given array of elements that was created for the declaration at the
-   * given offset. This method should only be used when there is no name
-   *
-   * @param elements the elements of the appropriate kind that exist in the current context
-   * @param offset the offset of the name of the element to be returned
-   * @return the element at the given offset
-   */
-  Element _findAtOffset(List<Element> elements, int offset) => _findWithNameAndOffset(elements, "", offset);
-
-  /**
-   * Return the export element from the given array whose library has the given source, or
-   * `null` if there is no such export.
-   *
-   * @param exports the export elements being searched
-   * @param source the source of the library associated with the export element to being searched
-   *          for
-   * @return the export element whose library has the given source
-   */
-  ExportElement _findExport(List<ExportElement> exports, Source source) {
-    for (ExportElement export in exports) {
-      if (export.exportedLibrary.source == source) {
-        return export;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Return the element in the given array of elements that was created for the declaration with the
-   * given name.
-   *
-   * @param elements the elements of the appropriate kind that exist in the current context
-   * @param identifier the name node in the declaration of the element to be returned
-   * @return the element created for the declaration with the given name
-   */
-  Element _findIdentifier(List<Element> elements, SimpleIdentifier identifier) => _findWithNameAndOffset(elements, identifier.name, identifier.offset);
-
-  /**
-   * Return the import element from the given array whose library has the given source and that has
-   * the given prefix, or `null` if there is no such import.
-   *
-   * @param imports the import elements being searched
-   * @param source the source of the library associated with the import element to being searched
-   *          for
-   * @param prefix the prefix with which the library was imported
-   * @return the import element whose library has the given source and prefix
-   */
-  ImportElement _findImport(List<ImportElement> imports, Source source, SimpleIdentifier prefix) {
-    for (ImportElement element in imports) {
-      if (element.importedLibrary.source == source) {
-        PrefixElement prefixElement = element.prefix;
-        if (prefix == null) {
-          if (prefixElement == null) {
-            return element;
-          }
-        } else {
-          if (prefixElement != null && prefix.name == prefixElement.displayName) {
-            return element;
-          }
-        }
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Return the element for the part with the given source, or `null` if there is no element
-   * for the given source.
-   *
-   * @param parts the elements for the parts
-   * @param partSource the source for the part whose element is to be returned
-   * @return the element for the part with the given source
-   */
-  CompilationUnitElement _findPart(List<CompilationUnitElement> parts, Source partSource) {
-    for (CompilationUnitElement part in parts) {
-      if (part.source == partSource) {
-        return part;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Return the element in the given array of elements that was created for the declaration with the
-   * given name at the given offset.
-   *
-   * @param elements the elements of the appropriate kind that exist in the current context
-   * @param name the name of the element to be returned
-   * @param offset the offset of the name of the element to be returned
-   * @return the element with the given name and offset
-   */
-  Element _findWithNameAndOffset(List<Element> elements, String name, int offset) {
-    for (Element element in elements) {
-      if (element.displayName == name && element.nameOffset == offset) {
-        return element;
-      }
-    }
-    return null;
-  }
-
-  void _gatherElements(Element element) {
-    element.accept(new GeneralizingElementVisitor_DeclarationMatcher_gatherElements(this));
-  }
-
-  /**
-   * Search the most closely enclosing list of parameters for a parameter with the given name.
-   *
-   * @param node the node defining the parameter with the given name
-   * @param parameterName the name of the parameter being searched for
-   * @return the element representing the parameter with that name
-   */
-  ParameterElement _getElementForParameter(FormalParameter node, SimpleIdentifier parameterName) {
-    List<ParameterElement> parameters = null;
-    if (_enclosingParameter != null) {
-      parameters = _enclosingParameter.parameters;
-    }
-    if (parameters == null && _enclosingExecutable != null) {
-      parameters = _enclosingExecutable.parameters;
-    }
-    if (parameters == null && _enclosingAlias != null) {
-      parameters = _enclosingAlias.parameters;
-    }
-    return parameters == null ? null : _findIdentifier(parameters, parameterName);
-  }
-
-  /**
-   * Return the value of the given string literal, or `null` if the string is not a constant
-   * string without any string interpolation.
-   *
-   * @param literal the string literal whose value is to be returned
-   * @return the value of the given string literal
-   */
-  String _getStringValue(StringLiteral literal) {
-    if (literal is StringInterpolation) {
-      return null;
-    }
-    return literal.stringValue;
-  }
-
-  /**
-   * Return `true` if the given class defines at least one constructor.
-   *
-   * @param node the class being tested
-   * @return `true` if the class defines at least one constructor
-   */
-  bool _hasConstructor(ClassDeclaration node) {
-    for (ClassMember member in node.members) {
-      if (member is ConstructorDeclaration) {
-        return true;
-      }
-    }
-    return false;
-  }
-}
-
-/**
- * Instances of the class `DeclarationMismatchException` represent an exception that is
- * thrown when the element model defined by a given AST structure does not match an existing
- * element model.
- */
-class DeclarationMatcher_DeclarationMismatchException extends RuntimeException {
-}
-
-/**
  * Instances of the class `DeclarationResolver` are used to resolve declarations in an AST
  * structure to already built elements.
  */
@@ -2942,7 +2486,8 @@
   Object visitCatchClause(CatchClause node) {
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
-      List<LocalVariableElement> localVariables = _enclosingExecutable.localVariables;
+      List<LocalVariableElement> localVariables =
+          _enclosingExecutable.localVariables;
       _findIdentifier(localVariables, exceptionParameter);
       SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
       if (stackTraceParameter != null) {
@@ -2984,7 +2529,8 @@
       if (constructorName == null) {
         _enclosingExecutable = _enclosingClass.unnamedConstructor;
       } else {
-        _enclosingExecutable = _enclosingClass.getNamedConstructor(constructorName.name);
+        _enclosingExecutable =
+            _enclosingClass.getNamedConstructor(constructorName.name);
         constructorName.staticElement = _enclosingExecutable;
       }
       node.element = _enclosingExecutable as ConstructorElement;
@@ -3030,7 +2576,8 @@
 
   @override
   Object visitEnumDeclaration(EnumDeclaration node) {
-    ClassElement enclosingEnum = _findIdentifier(_enclosingUnit.enums, node.name);
+    ClassElement enclosingEnum =
+        _findIdentifier(_enclosingUnit.enums, node.name);
     List<FieldElement> constants = enclosingEnum.fields;
     for (EnumConstantDeclaration constant in node.constants) {
       _findIdentifier(constants, constant.name);
@@ -3043,7 +2590,9 @@
     String uri = _getStringValue(node.uri);
     if (uri != null) {
       LibraryElement library = _enclosingUnit.library;
-      ExportElement exportElement = _findExport(library.exports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri));
+      ExportElement exportElement = _findExport(
+          library.exports,
+          _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri));
       node.element = exportElement;
     }
     return super.visitExportDirective(node);
@@ -3074,12 +2623,15 @@
       sc.Token property = node.propertyKeyword;
       if (property == null) {
         if (_enclosingExecutable != null) {
-          _enclosingExecutable = _findIdentifier(_enclosingExecutable.functions, functionName);
+          _enclosingExecutable =
+              _findIdentifier(_enclosingExecutable.functions, functionName);
         } else {
-          _enclosingExecutable = _findIdentifier(_enclosingUnit.functions, functionName);
+          _enclosingExecutable =
+              _findIdentifier(_enclosingUnit.functions, functionName);
         }
       } else {
-        PropertyAccessorElement accessor = _findIdentifier(_enclosingUnit.accessors, functionName);
+        PropertyAccessorElement accessor =
+            _findIdentifier(_enclosingUnit.accessors, functionName);
         if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
           accessor = accessor.variable.setter;
           functionName.staticElement = accessor;
@@ -3096,7 +2648,8 @@
   @override
   Object visitFunctionExpression(FunctionExpression node) {
     if (node.parent is! FunctionDeclaration) {
-      FunctionElement element = _findAtOffset(_enclosingExecutable.functions, node.beginToken.offset);
+      FunctionElement element =
+          _findAtOffset(_enclosingExecutable.functions, node.beginToken.offset);
       node.element = element;
     }
     ExecutableElement outerExecutable = _enclosingExecutable;
@@ -3113,7 +2666,8 @@
     FunctionTypeAliasElement outerAlias = _enclosingAlias;
     try {
       SimpleIdentifier aliasName = node.name;
-      _enclosingAlias = _findIdentifier(_enclosingUnit.functionTypeAliases, aliasName);
+      _enclosingAlias =
+          _findIdentifier(_enclosingUnit.functionTypeAliases, aliasName);
       return super.visitFunctionTypeAlias(node);
     } finally {
       _enclosingAlias = outerAlias;
@@ -3142,7 +2696,10 @@
     String uri = _getStringValue(node.uri);
     if (uri != null) {
       LibraryElement library = _enclosingUnit.library;
-      ImportElement importElement = _findImport(library.imports, _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri), node.prefix);
+      ImportElement importElement = _findImport(
+          library.imports,
+          _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri),
+          node.prefix);
       node.element = importElement;
     }
     return super.visitImportDirective(node);
@@ -3170,14 +2727,19 @@
       sc.Token property = node.propertyKeyword;
       SimpleIdentifier methodName = node.name;
       String nameOfMethod = methodName.name;
-      if (nameOfMethod == sc.TokenType.MINUS.lexeme && node.parameters.parameters.length == 0) {
+      if (nameOfMethod == sc.TokenType.MINUS.lexeme &&
+          node.parameters.parameters.length == 0) {
         nameOfMethod = "unary-";
       }
       if (property == null) {
-        _enclosingExecutable = _findWithNameAndOffset(_enclosingClass.methods, nameOfMethod, methodName.offset);
+        _enclosingExecutable = _findWithNameAndOffset(
+            _enclosingClass.methods,
+            nameOfMethod,
+            methodName.offset);
         methodName.staticElement = _enclosingExecutable;
       } else {
-        PropertyAccessorElement accessor = _findIdentifier(_enclosingClass.accessors, methodName);
+        PropertyAccessorElement accessor =
+            _findIdentifier(_enclosingClass.accessors, methodName);
         if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
           accessor = accessor.variable.setter;
           methodName.staticElement = accessor;
@@ -3194,7 +2756,8 @@
   Object visitPartDirective(PartDirective node) {
     String uri = _getStringValue(node.uri);
     if (uri != null) {
-      Source partSource = _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri);
+      Source partSource =
+          _enclosingUnit.context.sourceFactory.resolveUri(_enclosingUnit.source, uri);
       node.element = _findPart(_enclosingUnit.library.parts, partSource);
     }
     return super.visitPartDirective(node);
@@ -3257,7 +2820,8 @@
     VariableElement element = null;
     SimpleIdentifier variableName = node.name;
     if (_enclosingExecutable != null) {
-      element = _findIdentifier(_enclosingExecutable.localVariables, variableName);
+      element =
+          _findIdentifier(_enclosingExecutable.localVariables, variableName);
     }
     if (element == null && _enclosingClass != null) {
       element = _findIdentifier(_enclosingClass.fields, variableName);
@@ -3290,7 +2854,8 @@
    * @param offset the offset of the name of the element to be returned
    * @return the element at the given offset
    */
-  Element _findAtOffset(List<Element> elements, int offset) => _findWithNameAndOffset(elements, "", offset);
+  Element _findAtOffset(List<Element> elements, int offset) =>
+      _findWithNameAndOffset(elements, "", offset);
 
   /**
    * Return the export element from the given array whose library has the given source, or
@@ -3319,7 +2884,8 @@
    * @return the element created for the declaration with the given name
    */
   Element _findIdentifier(List<Element> elements, SimpleIdentifier identifier) {
-    Element element = _findWithNameAndOffset(elements, identifier.name, identifier.offset);
+    Element element =
+        _findWithNameAndOffset(elements, identifier.name, identifier.offset);
     identifier.staticElement = element;
     return element;
   }
@@ -3334,7 +2900,8 @@
    * @param prefix the prefix with which the library was imported
    * @return the import element whose library has the given source and prefix
    */
-  ImportElement _findImport(List<ImportElement> imports, Source source, SimpleIdentifier prefix) {
+  ImportElement _findImport(List<ImportElement> imports, Source source,
+      SimpleIdentifier prefix) {
     for (ImportElement element in imports) {
       if (element.importedLibrary.source == source) {
         PrefixElement prefixElement = element.prefix;
@@ -3343,7 +2910,8 @@
             return element;
           }
         } else {
-          if (prefixElement != null && prefix.name == prefixElement.displayName) {
+          if (prefixElement != null &&
+              prefix.name == prefixElement.displayName) {
             return element;
           }
         }
@@ -3360,7 +2928,8 @@
    * @param partSource the source for the part whose element is to be returned
    * @return the element for the part with the given source
    */
-  CompilationUnitElement _findPart(List<CompilationUnitElement> parts, Source partSource) {
+  CompilationUnitElement _findPart(List<CompilationUnitElement> parts,
+      Source partSource) {
     for (CompilationUnitElement part in parts) {
       if (part.source == partSource) {
         return part;
@@ -3378,7 +2947,8 @@
    * @param offset the offset of the name of the element to be returned
    * @return the element with the given name and offset
    */
-  Element _findWithNameAndOffset(List<Element> elements, String name, int offset) {
+  Element _findWithNameAndOffset(List<Element> elements, String name,
+      int offset) {
     for (Element element in elements) {
       if (element.displayName == name && element.nameOffset == offset) {
         return element;
@@ -3394,7 +2964,8 @@
    * @param parameterName the name of the parameter being searched for
    * @return the element representing the parameter with that name
    */
-  ParameterElement _getElementForParameter(FormalParameter node, SimpleIdentifier parameterName) {
+  ParameterElement _getElementForParameter(FormalParameter node,
+      SimpleIdentifier parameterName) {
     List<ParameterElement> parameters = null;
     if (_enclosingParameter != null) {
       parameters = _enclosingParameter.parameters;
@@ -3405,11 +2976,13 @@
     if (parameters == null && _enclosingAlias != null) {
       parameters = _enclosingAlias.parameters;
     }
-    ParameterElement element = parameters == null ? null : _findIdentifier(parameters, parameterName);
+    ParameterElement element =
+        parameters == null ? null : _findIdentifier(parameters, parameterName);
     if (element == null) {
       StringBuffer buffer = new StringBuffer();
       buffer.writeln("Invalid state found in the Analysis Engine:");
-      buffer.writeln("DeclarationResolver.getElementForParameter() is visiting a parameter that does not appear to be in a method or function.");
+      buffer.writeln(
+          "DeclarationResolver.getElementForParameter() is visiting a parameter that does not appear to be in a method or function.");
       buffer.writeln("Ancestors:");
       AstNode parent = node.parent;
       while (parent != null) {
@@ -3503,16 +3076,15 @@
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
       // exception
-      LocalVariableElementImpl exception = new LocalVariableElementImpl.forNode(exceptionParameter);
+      LocalVariableElementImpl exception =
+          new LocalVariableElementImpl.forNode(exceptionParameter);
       _currentHolder.addLocalVariable(exception);
       exceptionParameter.staticElement = exception;
-      // we cannot catch an exception without declaring a variable,
-      // so the exception variable is always used
-      exception.markUsed();
       // stack trace
       SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
       if (stackTraceParameter != null) {
-        LocalVariableElementImpl stackTrace = new LocalVariableElementImpl.forNode(stackTraceParameter);
+        LocalVariableElementImpl stackTrace =
+            new LocalVariableElementImpl.forNode(stackTraceParameter);
         _currentHolder.addLocalVariable(stackTrace);
         stackTraceParameter.staticElement = stackTrace;
       }
@@ -3526,14 +3098,15 @@
     _isValidMixin = true;
     _functionTypesToFix = new List<FunctionTypeImpl>();
     //
-    // Process field declarations before constructors and methods so that field formal parameters
-    // can be correctly resolved to their fields.
+    // Process field declarations before constructors and methods so that field
+    // formal parameters can be correctly resolved to their fields.
     //
     ElementHolder previousHolder = _currentHolder;
     _currentHolder = holder;
     try {
       List<ClassMember> nonFields = new List<ClassMember>();
-      node.visitChildren(new UnifyingAstVisitor_ElementBuilder_visitClassDeclaration(this, nonFields));
+      node.visitChildren(
+          new _ElementBuilder_visitClassDeclaration(this, nonFields));
       _buildFieldMap(holder.fieldsWithoutFlushing);
       int count = nonFields.length;
       for (int i = 0; i < count; i++) {
@@ -3615,7 +3188,8 @@
     }
     FunctionBody body = node.body;
     SimpleIdentifier constructorName = node.name;
-    ConstructorElementImpl element = new ConstructorElementImpl.forNode(constructorName);
+    ConstructorElementImpl element =
+        new ConstructorElementImpl.forNode(constructorName);
     if (node.factoryKeyword != null) {
       element.factory = true;
     }
@@ -3648,7 +3222,8 @@
   Object visitDeclaredIdentifier(DeclaredIdentifier node) {
     SimpleIdentifier variableName = node.identifier;
     sc.Token keyword = node.keyword;
-    LocalVariableElementImpl element = new LocalVariableElementImpl.forNode(variableName);
+    LocalVariableElementImpl element =
+        new LocalVariableElementImpl.forNode(variableName);
     ForEachStatement statement = node.parent as ForEachStatement;
     int declarationEnd = node.offset + node.length;
     int statementEnd = statement.offset + statement.length;
@@ -3668,7 +3243,8 @@
     ParameterElementImpl parameter;
     if (normalParameter is FieldFormalParameter) {
       parameter = new DefaultFieldFormalParameterElementImpl(parameterName);
-      FieldElement field = _fieldMap == null ? null : _fieldMap[parameterName.name];
+      FieldElement field =
+          _fieldMap == null ? null : _fieldMap[parameterName.name];
       if (field != null) {
         (parameter as DefaultFieldFormalParameterElementImpl).field = field;
       }
@@ -3682,7 +3258,8 @@
     Expression defaultValue = node.defaultValue;
     if (defaultValue != null) {
       _visit(holder, defaultValue);
-      FunctionElementImpl initializer = new FunctionElementImpl.forOffset(defaultValue.beginToken.offset);
+      FunctionElementImpl initializer =
+          new FunctionElementImpl.forOffset(defaultValue.beginToken.offset);
       initializer.functions = holder.functions;
       initializer.labels = holder.labels;
       initializer.localVariables = holder.localVariables;
@@ -3728,8 +3305,10 @@
   Object visitFieldFormalParameter(FieldFormalParameter node) {
     if (node.parent is! DefaultFormalParameter) {
       SimpleIdentifier parameterName = node.identifier;
-      FieldElement field = _fieldMap == null ? null : _fieldMap[parameterName.name];
-      FieldFormalParameterElementImpl parameter = new FieldFormalParameterElementImpl(parameterName);
+      FieldElement field =
+          _fieldMap == null ? null : _fieldMap[parameterName.name];
+      FieldFormalParameterElementImpl parameter =
+          new FieldFormalParameterElementImpl(parameterName);
       parameter.const3 = node.isConst;
       parameter.final2 = node.isFinal;
       parameter.parameterKind = node.kind;
@@ -3740,7 +3319,8 @@
       parameterName.staticElement = parameter;
     }
     //
-    // The children of this parameter include any parameters defined on the type of this parameter.
+    // The children of this parameter include any parameters defined on the type
+    // of this parameter.
     //
     ElementHolder holder = new ElementHolder();
     _visitChildren(holder, node);
@@ -3765,7 +3345,8 @@
       sc.Token property = node.propertyKeyword;
       if (property == null || _inFunction) {
         SimpleIdentifier functionName = node.name;
-        FunctionElementImpl element = new FunctionElementImpl.forNode(functionName);
+        FunctionElementImpl element =
+            new FunctionElementImpl.forNode(functionName);
         element.functions = holder.functions;
         element.labels = holder.labels;
         element.localVariables = holder.localVariables;
@@ -3794,7 +3375,8 @@
           return null;
         }
         String propertyName = propertyNameNode.name;
-        TopLevelVariableElementImpl variable = _currentHolder.getTopLevelVariable(propertyName) as TopLevelVariableElementImpl;
+        TopLevelVariableElementImpl variable =
+            _currentHolder.getTopLevelVariable(propertyName) as TopLevelVariableElementImpl;
         if (variable == null) {
           variable = new TopLevelVariableElementImpl(node.name.name, -1);
           variable.final2 = true;
@@ -3802,7 +3384,8 @@
           _currentHolder.addTopLevelVariable(variable);
         }
         if (_matches(property, sc.Keyword.GET)) {
-          PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          PropertyAccessorElementImpl getter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
           getter.functions = holder.functions;
           getter.labels = holder.labels;
           getter.localVariables = holder.localVariables;
@@ -3820,7 +3403,8 @@
           expression.element = getter;
           propertyNameNode.staticElement = getter;
         } else {
-          PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          PropertyAccessorElementImpl setter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
           setter.functions = holder.functions;
           setter.labels = holder.labels;
           setter.localVariables = holder.localVariables;
@@ -3857,7 +3441,8 @@
       _inFunction = wasInFunction;
     }
     FunctionBody body = node.body;
-    FunctionElementImpl element = new FunctionElementImpl.forOffset(node.beginToken.offset);
+    FunctionElementImpl element =
+        new FunctionElementImpl.forOffset(node.beginToken.offset);
     element.functions = holder.functions;
     element.labels = holder.labels;
     element.localVariables = holder.localVariables;
@@ -3894,7 +3479,8 @@
     SimpleIdentifier aliasName = node.name;
     List<ParameterElement> parameters = holder.parameters;
     List<TypeParameterElement> typeParameters = holder.typeParameters;
-    FunctionTypeAliasElementImpl element = new FunctionTypeAliasElementImpl.forNode(aliasName);
+    FunctionTypeAliasElementImpl element =
+        new FunctionTypeAliasElementImpl.forNode(aliasName);
     element.parameters = parameters;
     element.typeParameters = typeParameters;
     FunctionTypeImpl type = new FunctionTypeImpl.con2(element);
@@ -3910,14 +3496,16 @@
   Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
     if (node.parent is! DefaultFormalParameter) {
       SimpleIdentifier parameterName = node.identifier;
-      ParameterElementImpl parameter = new ParameterElementImpl.forNode(parameterName);
+      ParameterElementImpl parameter =
+          new ParameterElementImpl.forNode(parameterName);
       parameter.parameterKind = node.kind;
       _setParameterVisibleRange(node, parameter);
       _currentHolder.addParameter(parameter);
       parameterName.staticElement = parameter;
     }
     //
-    // The children of this parameter include any parameters defined on the type of this parameter.
+    // The children of this parameter include any parameters defined on the type
+    //of this parameter.
     //
     ElementHolder holder = new ElementHolder();
     _visitChildren(holder, node);
@@ -3931,7 +3519,8 @@
     bool onSwitchStatement = node.statement is SwitchStatement;
     for (Label label in node.labels) {
       SimpleIdentifier labelName = label.label;
-      LabelElementImpl element = new LabelElementImpl(labelName, onSwitchStatement, false);
+      LabelElementImpl element =
+          new LabelElementImpl(labelName, onSwitchStatement, false);
       _currentHolder.addLabel(element);
       labelName.staticElement = element;
     }
@@ -3955,10 +3544,12 @@
       if (property == null) {
         SimpleIdentifier methodName = node.name;
         String nameOfMethod = methodName.name;
-        if (nameOfMethod == sc.TokenType.MINUS.lexeme && node.parameters.parameters.length == 0) {
+        if (nameOfMethod == sc.TokenType.MINUS.lexeme &&
+            node.parameters.parameters.length == 0) {
           nameOfMethod = "unary-";
         }
-        MethodElementImpl element = new MethodElementImpl(nameOfMethod, methodName.offset);
+        MethodElementImpl element =
+            new MethodElementImpl(nameOfMethod, methodName.offset);
         element.abstract = node.isAbstract;
         element.functions = holder.functions;
         element.labels = holder.labels;
@@ -3976,7 +3567,8 @@
       } else {
         SimpleIdentifier propertyNameNode = node.name;
         String propertyName = propertyNameNode.name;
-        FieldElementImpl field = _currentHolder.getField(propertyName) as FieldElementImpl;
+        FieldElementImpl field =
+            _currentHolder.getField(propertyName) as FieldElementImpl;
         if (field == null) {
           field = new FieldElementImpl(node.name.name, -1);
           field.final2 = true;
@@ -3985,7 +3577,8 @@
           _currentHolder.addField(field);
         }
         if (_matches(property, sc.Keyword.GET)) {
-          PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          PropertyAccessorElementImpl getter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
           getter.functions = holder.functions;
           getter.labels = holder.labels;
           getter.localVariables = holder.localVariables;
@@ -3996,14 +3589,16 @@
             getter.generator = true;
           }
           getter.variable = field;
-          getter.abstract = body is EmptyFunctionBody && node.externalKeyword == null;
+          getter.abstract =
+              body is EmptyFunctionBody && node.externalKeyword == null;
           getter.getter = true;
           getter.static = isStatic;
           field.getter = getter;
           _currentHolder.addAccessor(getter);
           propertyNameNode.staticElement = getter;
         } else {
-          PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          PropertyAccessorElementImpl setter =
+              new PropertyAccessorElementImpl.forNode(propertyNameNode);
           setter.functions = holder.functions;
           setter.labels = holder.labels;
           setter.localVariables = holder.localVariables;
@@ -4015,7 +3610,8 @@
             setter.generator = true;
           }
           setter.variable = field;
-          setter.abstract = body is EmptyFunctionBody && !_matches(node.externalKeyword, sc.Keyword.EXTERNAL);
+          setter.abstract = body is EmptyFunctionBody &&
+              !_matches(node.externalKeyword, sc.Keyword.EXTERNAL);
           setter.setter = true;
           setter.static = isStatic;
           field.setter = setter;
@@ -4027,7 +3623,8 @@
       holder.validate();
     } catch (exception, stackTrace) {
       if (node.name.staticElement == null) {
-        ClassDeclaration classNode = node.getAncestor((node) => node is ClassDeclaration);
+        ClassDeclaration classNode =
+            node.getAncestor((node) => node is ClassDeclaration);
         StringBuffer buffer = new StringBuffer();
         buffer.write("The element for the method ");
         buffer.write(node.name);
@@ -4038,14 +3635,16 @@
             buffer.toString(),
             new CaughtException(exception, stackTrace));
       } else {
-        String message = "Exception caught in ElementBuilder.visitMethodDeclaration()";
+        String message =
+            "Exception caught in ElementBuilder.visitMethodDeclaration()";
         AnalysisEngine.instance.logger.logError(
             message,
             new CaughtException(exception, stackTrace));
       }
     } finally {
       if (node.name.staticElement == null) {
-        ClassDeclaration classNode = node.getAncestor((node) => node is ClassDeclaration);
+        ClassDeclaration classNode =
+            node.getAncestor((node) => node is ClassDeclaration);
         StringBuffer buffer = new StringBuffer();
         buffer.write("The element for the method ");
         buffer.write(node.name);
@@ -4064,7 +3663,8 @@
   Object visitSimpleFormalParameter(SimpleFormalParameter node) {
     if (node.parent is! DefaultFormalParameter) {
       SimpleIdentifier parameterName = node.identifier;
-      ParameterElementImpl parameter = new ParameterElementImpl.forNode(parameterName);
+      ParameterElementImpl parameter =
+          new ParameterElementImpl.forNode(parameterName);
       parameter.const3 = node.isConst;
       parameter.final2 = node.isFinal;
       parameter.parameterKind = node.kind;
@@ -4106,8 +3706,10 @@
   @override
   Object visitTypeParameter(TypeParameter node) {
     SimpleIdentifier parameterName = node.name;
-    TypeParameterElementImpl typeParameter = new TypeParameterElementImpl.forNode(parameterName);
-    TypeParameterTypeImpl typeParameterType = new TypeParameterTypeImpl(typeParameter);
+    TypeParameterElementImpl typeParameter =
+        new TypeParameterElementImpl.forNode(parameterName);
+    TypeParameterTypeImpl typeParameterType =
+        new TypeParameterTypeImpl(typeParameter);
     typeParameter.type = typeParameterType;
     _currentHolder.addTypeParameter(typeParameter);
     parameterName.staticElement = typeParameter;
@@ -4144,7 +3746,8 @@
       Block enclosingBlock = node.getAncestor((node) => node is Block);
       int functionEnd = node.offset + node.length;
       int blockEnd = enclosingBlock.offset + enclosingBlock.length;
-      // TODO(brianwilkerson) This isn't right for variables declared in a for loop.
+      // TODO(brianwilkerson) This isn't right for variables declared in a for
+      // loop.
       variable.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
       _currentHolder.addLocalVariable(variable);
       variableName.staticElement = element;
@@ -4171,7 +3774,8 @@
       } finally {
         _inFieldContext = wasInFieldContext;
       }
-      FunctionElementImpl initializer = new FunctionElementImpl.forOffset(node.initializer.beginToken.offset);
+      FunctionElementImpl initializer =
+          new FunctionElementImpl.forOffset(node.initializer.beginToken.offset);
       initializer.functions = holder.functions;
       initializer.labels = holder.labels;
       initializer.localVariables = holder.localVariables;
@@ -4180,21 +3784,27 @@
       holder.validate();
     }
     if (element is PropertyInducingElementImpl) {
-      PropertyInducingElementImpl variable = element as PropertyInducingElementImpl;
+      PropertyInducingElementImpl variable =
+          element as PropertyInducingElementImpl;
       if (_inFieldContext) {
-        (variable as FieldElementImpl).static = _matches((node.parent.parent as FieldDeclaration).staticKeyword, sc.Keyword.STATIC);
+        (variable as FieldElementImpl).static = _matches(
+            (node.parent.parent as FieldDeclaration).staticKeyword,
+            sc.Keyword.STATIC);
       }
-      PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(variable);
+      PropertyAccessorElementImpl getter =
+          new PropertyAccessorElementImpl.forVariable(variable);
       getter.getter = true;
       _currentHolder.addAccessor(getter);
       variable.getter = getter;
       if (!isFinal) {
-        PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forVariable(variable);
+        PropertyAccessorElementImpl setter =
+            new PropertyAccessorElementImpl.forVariable(variable);
         setter.setter = true;
-        ParameterElementImpl parameter = new ParameterElementImpl("_${variable.name}", variable.nameOffset);
+        ParameterElementImpl parameter =
+            new ParameterElementImpl("_${variable.name}", variable.nameOffset);
         parameter.synthetic = true;
         parameter.parameterKind = ParameterKind.REQUIRED;
-        setter.parameters = <ParameterElement> [parameter];
+        setter.parameters = <ParameterElement>[parameter];
         _currentHolder.addAccessor(setter);
         variable.setter = setter;
       }
@@ -4223,14 +3833,16 @@
    * @param interfaceType the interface type for which to create a default constructor
    * @return the [ConstructorElement]s array with the single default constructor element
    */
-  List<ConstructorElement> _createDefaultConstructors(InterfaceTypeImpl interfaceType) {
-    ConstructorElementImpl constructor = new ConstructorElementImpl.forNode(null);
+  List<ConstructorElement>
+      _createDefaultConstructors(InterfaceTypeImpl interfaceType) {
+    ConstructorElementImpl constructor =
+        new ConstructorElementImpl.forNode(null);
     constructor.synthetic = true;
     constructor.returnType = interfaceType;
     FunctionTypeImpl type = new FunctionTypeImpl.con1(constructor);
     _functionTypesToFix.add(type);
     constructor.type = type;
-    return <ConstructorElement> [constructor];
+    return <ConstructorElement>[constructor];
   }
 
   /**
@@ -4240,12 +3852,15 @@
    * @param typeParameters the type parameters for which types are to be created
    * @return an array of types corresponding to the given parameters
    */
-  List<DartType> _createTypeParameterTypes(List<TypeParameterElement> typeParameters) {
+  List<DartType>
+      _createTypeParameterTypes(List<TypeParameterElement> typeParameters) {
     int typeParameterCount = typeParameters.length;
     List<DartType> typeArguments = new List<DartType>(typeParameterCount);
     for (int i = 0; i < typeParameterCount; i++) {
-      TypeParameterElementImpl typeParameter = typeParameters[i] as TypeParameterElementImpl;
-      TypeParameterTypeImpl typeParameterType = new TypeParameterTypeImpl(typeParameter);
+      TypeParameterElementImpl typeParameter =
+          typeParameters[i] as TypeParameterElementImpl;
+      TypeParameterTypeImpl typeParameterType =
+          new TypeParameterTypeImpl(typeParameter);
       typeParameter.type = typeParameterType;
       typeArguments[i] = typeParameterType;
     }
@@ -4281,12 +3896,16 @@
    * @param keyword the keyword being tested for
    * @return `true` if the given token is a token for the given keyword
    */
-  bool _matches(sc.Token token, sc.Keyword keyword) => token != null && token.type == sc.TokenType.KEYWORD && (token as sc.KeywordToken).keyword == keyword;
+  bool _matches(sc.Token token, sc.Keyword keyword) =>
+      token != null &&
+          token.type == sc.TokenType.KEYWORD &&
+          (token as sc.KeywordToken).keyword == keyword;
 
   /**
    * Sets the visible source range for formal parameter.
    */
-  void _setParameterVisibleRange(FormalParameter node, ParameterElementImpl element) {
+  void _setParameterVisibleRange(FormalParameter node,
+      ParameterElementImpl element) {
     FunctionBody body = _getFunctionBody(node);
     if (body != null) {
       element.setVisibleRange(body.offset, body.length);
@@ -4361,6 +3980,131 @@
 
   List<TypeParameterElement> _typeParameters;
 
+  List<PropertyAccessorElement> get accessors {
+    if (_accessors == null) {
+      return PropertyAccessorElementImpl.EMPTY_ARRAY;
+    }
+    List<PropertyAccessorElement> result = _accessors;
+    _accessors = null;
+    return result;
+  }
+
+  List<ConstructorElement> get constructors {
+    if (_constructors == null) {
+      return ConstructorElementImpl.EMPTY_ARRAY;
+    }
+    List<ConstructorElement> result = _constructors;
+    _constructors = null;
+    return result;
+  }
+
+  List<ClassElement> get enums {
+    if (_enums == null) {
+      return ClassElementImpl.EMPTY_ARRAY;
+    }
+    List<ClassElement> result = _enums;
+    _enums = null;
+    return result;
+  }
+
+  List<FieldElement> get fields {
+    if (_fields == null) {
+      return FieldElementImpl.EMPTY_ARRAY;
+    }
+    List<FieldElement> result = _fields;
+    _fields = null;
+    return result;
+  }
+
+  List<FieldElement> get fieldsWithoutFlushing {
+    if (_fields == null) {
+      return FieldElementImpl.EMPTY_ARRAY;
+    }
+    List<FieldElement> result = _fields;
+    return result;
+  }
+
+  List<FunctionElement> get functions {
+    if (_functions == null) {
+      return FunctionElementImpl.EMPTY_ARRAY;
+    }
+    List<FunctionElement> result = _functions;
+    _functions = null;
+    return result;
+  }
+
+  List<LabelElement> get labels {
+    if (_labels == null) {
+      return LabelElementImpl.EMPTY_ARRAY;
+    }
+    List<LabelElement> result = _labels;
+    _labels = null;
+    return result;
+  }
+
+  List<LocalVariableElement> get localVariables {
+    if (_localVariables == null) {
+      return LocalVariableElementImpl.EMPTY_ARRAY;
+    }
+    List<LocalVariableElement> result = _localVariables;
+    _localVariables = null;
+    return result;
+  }
+
+  List<MethodElement> get methods {
+    if (_methods == null) {
+      return MethodElementImpl.EMPTY_ARRAY;
+    }
+    List<MethodElement> result = _methods;
+    _methods = null;
+    return result;
+  }
+
+  List<ParameterElement> get parameters {
+    if (_parameters == null) {
+      return ParameterElementImpl.EMPTY_ARRAY;
+    }
+    List<ParameterElement> result = _parameters;
+    _parameters = null;
+    return result;
+  }
+
+  List<TopLevelVariableElement> get topLevelVariables {
+    if (_topLevelVariables == null) {
+      return TopLevelVariableElementImpl.EMPTY_ARRAY;
+    }
+    List<TopLevelVariableElement> result = _topLevelVariables;
+    _topLevelVariables = null;
+    return result;
+  }
+
+  List<FunctionTypeAliasElement> get typeAliases {
+    if (_typeAliases == null) {
+      return FunctionTypeAliasElementImpl.EMPTY_ARRAY;
+    }
+    List<FunctionTypeAliasElement> result = _typeAliases;
+    _typeAliases = null;
+    return result;
+  }
+
+  List<TypeParameterElement> get typeParameters {
+    if (_typeParameters == null) {
+      return TypeParameterElementImpl.EMPTY_ARRAY;
+    }
+    List<TypeParameterElement> result = _typeParameters;
+    _typeParameters = null;
+    return result;
+  }
+
+  List<ClassElement> get types {
+    if (_types == null) {
+      return ClassElementImpl.EMPTY_ARRAY;
+    }
+    List<ClassElement> result = _types;
+    _types = null;
+    return result;
+  }
+
   void addAccessor(PropertyAccessorElement element) {
     if (_accessors == null) {
       _accessors = new List<PropertyAccessorElement>();
@@ -4452,33 +4196,6 @@
     _typeParameters.add(element);
   }
 
-  List<PropertyAccessorElement> get accessors {
-    if (_accessors == null) {
-      return PropertyAccessorElementImpl.EMPTY_ARRAY;
-    }
-    List<PropertyAccessorElement> result = _accessors;
-    _accessors = null;
-    return result;
-  }
-
-  List<ConstructorElement> get constructors {
-    if (_constructors == null) {
-      return ConstructorElementImpl.EMPTY_ARRAY;
-    }
-    List<ConstructorElement> result = _constructors;
-    _constructors = null;
-    return result;
-  }
-
-  List<ClassElement> get enums {
-    if (_enums == null) {
-      return ClassElementImpl.EMPTY_ARRAY;
-    }
-    List<ClassElement> result = _enums;
-    _enums = null;
-    return result;
-  }
-
   FieldElement getField(String fieldName) {
     if (_fields == null) {
       return null;
@@ -4491,68 +4208,6 @@
     return null;
   }
 
-  List<FieldElement> get fields {
-    if (_fields == null) {
-      return FieldElementImpl.EMPTY_ARRAY;
-    }
-    List<FieldElement> result = _fields;
-    _fields = null;
-    return result;
-  }
-
-  List<FieldElement> get fieldsWithoutFlushing {
-    if (_fields == null) {
-      return FieldElementImpl.EMPTY_ARRAY;
-    }
-    List<FieldElement> result = _fields;
-    return result;
-  }
-
-  List<FunctionElement> get functions {
-    if (_functions == null) {
-      return FunctionElementImpl.EMPTY_ARRAY;
-    }
-    List<FunctionElement> result = _functions;
-    _functions = null;
-    return result;
-  }
-
-  List<LabelElement> get labels {
-    if (_labels == null) {
-      return LabelElementImpl.EMPTY_ARRAY;
-    }
-    List<LabelElement> result = _labels;
-    _labels = null;
-    return result;
-  }
-
-  List<LocalVariableElement> get localVariables {
-    if (_localVariables == null) {
-      return LocalVariableElementImpl.EMPTY_ARRAY;
-    }
-    List<LocalVariableElement> result = _localVariables;
-    _localVariables = null;
-    return result;
-  }
-
-  List<MethodElement> get methods {
-    if (_methods == null) {
-      return MethodElementImpl.EMPTY_ARRAY;
-    }
-    List<MethodElement> result = _methods;
-    _methods = null;
-    return result;
-  }
-
-  List<ParameterElement> get parameters {
-    if (_parameters == null) {
-      return ParameterElementImpl.EMPTY_ARRAY;
-    }
-    List<ParameterElement> result = _parameters;
-    _parameters = null;
-    return result;
-  }
-
   TopLevelVariableElement getTopLevelVariable(String variableName) {
     if (_topLevelVariables == null) {
       return null;
@@ -4565,42 +4220,6 @@
     return null;
   }
 
-  List<TopLevelVariableElement> get topLevelVariables {
-    if (_topLevelVariables == null) {
-      return TopLevelVariableElementImpl.EMPTY_ARRAY;
-    }
-    List<TopLevelVariableElement> result = _topLevelVariables;
-    _topLevelVariables = null;
-    return result;
-  }
-
-  List<FunctionTypeAliasElement> get typeAliases {
-    if (_typeAliases == null) {
-      return FunctionTypeAliasElementImpl.EMPTY_ARRAY;
-    }
-    List<FunctionTypeAliasElement> result = _typeAliases;
-    _typeAliases = null;
-    return result;
-  }
-
-  List<TypeParameterElement> get typeParameters {
-    if (_typeParameters == null) {
-      return TypeParameterElementImpl.EMPTY_ARRAY;
-    }
-    List<TypeParameterElement> result = _typeParameters;
-    _typeParameters = null;
-    return result;
-  }
-
-  List<ClassElement> get types {
-    if (_types == null) {
-      return ClassElementImpl.EMPTY_ARRAY;
-    }
-    List<ClassElement> result = _types;
-    _types = null;
-    return result;
-  }
-
   void validate() {
     StringBuffer buffer = new StringBuffer();
     if (_accessors != null) {
@@ -4685,7 +4304,8 @@
       buffer.write(" type parameters");
     }
     if (buffer.length > 0) {
-      AnalysisEngine.instance.logger.logError("Failed to capture elements: $buffer");
+      AnalysisEngine.instance.logger.logError(
+          "Failed to capture elements: $buffer");
     }
   }
 }
@@ -4740,7 +4360,8 @@
   }
 
   @override
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) {
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary) {
     Element element = localLookup(name, referencingLibrary);
     if (element != null) {
       return element;
@@ -4749,7 +4370,13 @@
     if (_hasHiddenName) {
       Element hiddenElement = _hiddenElements[name];
       if (hiddenElement != null) {
-        errorListener.onError(new AnalysisError.con2(getSource(identifier), identifier.offset, identifier.length, CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, []));
+        errorListener.onError(
+            new AnalysisError.con2(
+                getSource(identifier),
+                identifier.offset,
+                identifier.length,
+                CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION,
+                []));
         return hiddenElement;
       }
     }
@@ -4801,7 +4428,7 @@
     valuesField.static = true;
     valuesField.const3 = true;
     valuesField.synthetic = true;
-    valuesField.type = _typeProvider.listType.substitute4(<DartType> [enumType]);
+    valuesField.type = _typeProvider.listType.substitute4(<DartType>[enumType]);
     fields.add(valuesField);
     getters.add(_createGetter(valuesField));
     //
@@ -4811,16 +4438,19 @@
     int constantCount = constants.length;
     for (int i = 0; i < constantCount; i++) {
       SimpleIdentifier constantName = constants[i].name;
-      FieldElementImpl constantField = new ConstFieldElementImpl.con1(constantName);
+      FieldElementImpl constantField =
+          new ConstFieldElementImpl.con1(constantName);
       constantField.static = true;
       constantField.const3 = true;
       constantField.type = enumType;
       //
       // Create a value for the constant.
       //
-      HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
+      HashMap<String, DartObjectImpl> fieldMap =
+          new HashMap<String, DartObjectImpl>();
       fieldMap[indexFieldName] = new DartObjectImpl(intType, new IntState(i));
-      DartObjectImpl value = new DartObjectImpl(enumType, new GenericState(fieldMap));
+      DartObjectImpl value =
+          new DartObjectImpl(enumType, new GenericState(fieldMap));
       constantField.evaluationResult = new EvaluationResultImpl.con1(value);
       fields.add(constantField);
       getters.add(_createGetter(constantField));
@@ -4831,7 +4461,8 @@
     //
     enumElement.fields = fields;
     enumElement.accessors = getters;
-    // Client code isn't allowed to invoke the constructor, so we do not model it.
+    // Client code isn't allowed to invoke the constructor, so we do not model
+    // it.
     return super.visitEnumDeclaration(node);
   }
 
@@ -4842,7 +4473,8 @@
    * @return the getter that was created
    */
   PropertyAccessorElement _createGetter(FieldElementImpl field) {
-    PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(field);
+    PropertyAccessorElementImpl getter =
+        new PropertyAccessorElementImpl.forVariable(field);
     getter.getter = true;
     getter.returnType = field.type;
     getter.type = new FunctionTypeImpl.con1(getter);
@@ -4864,7 +4496,8 @@
   bool _enclosingBlockContainsBreak = false;
 
   @override
-  bool visitArgumentList(ArgumentList node) => _visitExpressions(node.arguments);
+  bool visitArgumentList(ArgumentList node) =>
+      _visitExpressions(node.arguments);
 
   @override
   bool visitAsExpression(AsExpression node) => _nodeExits(node.expression);
@@ -4873,16 +4506,18 @@
   bool visitAssertStatement(AssertStatement node) => _nodeExits(node.condition);
 
   @override
-  bool visitAssignmentExpression(AssignmentExpression node) => _nodeExits(node.leftHandSide) || _nodeExits(node.rightHandSide);
+  bool visitAssignmentExpression(AssignmentExpression node) =>
+      _nodeExits(node.leftHandSide) || _nodeExits(node.rightHandSide);
 
   @override
   bool visitBinaryExpression(BinaryExpression node) {
     Expression lhsExpression = node.leftOperand;
     sc.TokenType operatorType = node.operator.type;
-    // If the operator is || and the left hand side is false literal, don't consider the RHS of the
-    // binary expression.
-    // TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
-    // differently than if(<condition>), when <condition> evaluates to a constant false value?
+    // If the operator is || and the left hand side is false literal, don't
+    // consider the RHS of the binary expression.
+    // TODO(jwren) Do we want to take constant expressions into account,
+    // evaluate if(false) {} differently than if(<condition>), when <condition>
+    // evaluates to a constant false value?
     if (operatorType == sc.TokenType.BAR_BAR) {
       if (lhsExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = lhsExpression;
@@ -4891,8 +4526,8 @@
         }
       }
     }
-    // If the operator is && and the left hand side is true literal, don't consider the RHS of the
-    // binary expression.
+    // If the operator is && and the left hand side is true literal, don't
+    // consider the RHS of the binary expression.
     if (operatorType == sc.TokenType.AMPERSAND_AMPERSAND) {
       if (lhsExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = lhsExpression;
@@ -4918,15 +4553,17 @@
   }
 
   @override
-  bool visitCascadeExpression(CascadeExpression node) => _nodeExits(node.target) || _visitExpressions(node.cascadeSections);
+  bool visitCascadeExpression(CascadeExpression node) =>
+      _nodeExits(node.target) || _visitExpressions(node.cascadeSections);
 
   @override
   bool visitConditionalExpression(ConditionalExpression node) {
     Expression conditionExpression = node.condition;
     Expression thenStatement = node.thenExpression;
     Expression elseStatement = node.elseExpression;
-    // TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
-    // differently than if(<condition>), when <condition> evaluates to a constant false value?
+    // TODO(jwren) Do we want to take constant expressions into account,
+    // evaluate if(false) {} differently than if(<condition>), when <condition>
+    // evaluates to a constant false value?
     if (_nodeExits(conditionExpression)) {
       return true;
     }
@@ -4951,10 +4588,11 @@
       // TODO(jwren) Do we want to take all constant expressions into account?
       if (conditionExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = conditionExpression;
-        // If do {} while (true), and the body doesn't return or the body doesn't have a break, then
-        // return true.
+        // If do {} while (true), and the body doesn't return or the body
+        // doesn't have a break, then return true.
         bool blockReturns = _nodeExits(node.body);
-        if (booleanLiteral.value && (blockReturns || !_enclosingBlockContainsBreak)) {
+        if (booleanLiteral.value &&
+            (blockReturns || !_enclosingBlockContainsBreak)) {
           return true;
         }
       }
@@ -4968,7 +4606,8 @@
   bool visitEmptyStatement(EmptyStatement node) => false;
 
   @override
-  bool visitExpressionStatement(ExpressionStatement node) => _nodeExits(node.expression);
+  bool visitExpressionStatement(ExpressionStatement node) =>
+      _nodeExits(node.expression);
 
   @override
   bool visitForEachStatement(ForEachStatement node) {
@@ -4986,7 +4625,8 @@
     bool outerBreakValue = _enclosingBlockContainsBreak;
     _enclosingBlockContainsBreak = false;
     try {
-      if (node.variables != null && _visitVariableDeclarations(node.variables.variables)) {
+      if (node.variables != null &&
+          _visitVariableDeclarations(node.variables.variables)) {
         return true;
       }
       if (node.initialization != null && _nodeExits(node.initialization)) {
@@ -5000,9 +4640,11 @@
         return true;
       }
       // TODO(jwren) Do we want to take all constant expressions into account?
-      // If for(; true; ) (or for(;;)), and the body doesn't return or the body doesn't have a
-      // break, then return true.
-      bool implicitOrExplictTrue = conditionExpression == null || (conditionExpression is BooleanLiteral && conditionExpression.value);
+      // If for(; true; ) (or for(;;)), and the body doesn't return or the body
+      // doesn't have a break, then return true.
+      bool implicitOrExplictTrue =
+          conditionExpression == null ||
+          (conditionExpression is BooleanLiteral && conditionExpression.value);
       if (implicitOrExplictTrue) {
         bool blockReturns = _nodeExits(node.body);
         if (blockReturns || !_enclosingBlockContainsBreak) {
@@ -5016,7 +4658,8 @@
   }
 
   @override
-  bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => false;
+  bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
+      false;
 
   @override
   bool visitFunctionExpression(FunctionExpression node) => false;
@@ -5070,7 +4713,8 @@
   }
 
   @override
-  bool visitInstanceCreationExpression(InstanceCreationExpression node) => _nodeExits(node.argumentList);
+  bool visitInstanceCreationExpression(InstanceCreationExpression node) =>
+      _nodeExits(node.argumentList);
 
   @override
   bool visitIsExpression(IsExpression node) => node.expression.accept(this);
@@ -5079,7 +4723,8 @@
   bool visitLabel(Label node) => false;
 
   @override
-  bool visitLabeledStatement(LabeledStatement node) => node.statement.accept(this);
+  bool visitLabeledStatement(LabeledStatement node) =>
+      node.statement.accept(this);
 
   @override
   bool visitLiteral(Literal node) => false;
@@ -5094,10 +4739,12 @@
   }
 
   @override
-  bool visitNamedExpression(NamedExpression node) => node.expression.accept(this);
+  bool visitNamedExpression(NamedExpression node) =>
+      node.expression.accept(this);
 
   @override
-  bool visitParenthesizedExpression(ParenthesizedExpression node) => node.expression.accept(this);
+  bool visitParenthesizedExpression(ParenthesizedExpression node) =>
+      node.expression.accept(this);
 
   @override
   bool visitPostfixExpression(PostfixExpression node) => false;
@@ -5127,7 +4774,8 @@
   bool visitSwitchCase(SwitchCase node) => _visitStatements(node.statements);
 
   @override
-  bool visitSwitchDefault(SwitchDefault node) => _visitStatements(node.statements);
+  bool visitSwitchDefault(SwitchDefault node) =>
+      _visitStatements(node.statements);
 
   @override
   bool visitSwitchStatement(SwitchStatement node) {
@@ -5140,13 +4788,15 @@
         SwitchMember switchMember = members[i];
         if (switchMember is SwitchDefault) {
           hasDefault = true;
-          // If this is the last member and there are no statements, return false
+          // If this is the last member and there are no statements, return
+          // false
           if (switchMember.statements.isEmpty && i + 1 == members.length) {
             return false;
           }
         }
-        // For switch members with no statements, don't visit the children, otherwise, return false if
-        // no return is found in the children statements
+        // For switch members with no statements, don't visit the children,
+        // otherwise, return false if no return is found in the children
+        // statements.
         if (!switchMember.statements.isEmpty && !switchMember.accept(this)) {
           return false;
         }
@@ -5188,7 +4838,8 @@
   }
 
   @override
-  bool visitVariableDeclarationList(VariableDeclarationList node) => _visitVariableDeclarations(node.variables);
+  bool visitVariableDeclarationList(VariableDeclarationList node) =>
+      _visitVariableDeclarations(node.variables);
 
   @override
   bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
@@ -5213,10 +4864,11 @@
       // TODO(jwren) Do we want to take all constant expressions into account?
       if (conditionExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = conditionExpression;
-        // If while(true), and the body doesn't return or the body doesn't have a break, then return
-        // true.
+        // If while(true), and the body doesn't return or the body doesn't have
+        // a break, then return true.
         bool blockReturns = node.body.accept(this);
-        if (booleanLiteral.value && (blockReturns || !_enclosingBlockContainsBreak)) {
+        if (booleanLiteral.value &&
+            (blockReturns || !_enclosingBlockContainsBreak)) {
           return true;
         }
       }
@@ -5257,7 +4909,8 @@
     return false;
   }
 
-  bool _visitVariableDeclarations(NodeList<VariableDeclaration> variableDeclarations) {
+  bool
+      _visitVariableDeclarations(NodeList<VariableDeclaration> variableDeclarations) {
     for (int i = variableDeclarations.length - 1; i >= 0; i--) {
       if (variableDeclarations[i].accept(this)) {
         return true;
@@ -5281,7 +4934,8 @@
    * @param enclosingScope the scope in which this scope is lexically enclosed
    * @param functionElement the element representing the type represented by this scope
    */
-  FunctionScope(Scope enclosingScope, this._functionElement) : super(new EnclosedScope(enclosingScope)) {
+  FunctionScope(Scope enclosingScope, this._functionElement)
+      : super(new EnclosedScope(enclosingScope)) {
     if (_functionElement == null) {
       throw new IllegalArgumentException("function element cannot be null");
     }
@@ -5319,7 +4973,8 @@
    * @param enclosingScope the scope in which this scope is lexically enclosed
    * @param typeElement the element representing the type alias represented by this scope
    */
-  FunctionTypeScope(Scope enclosingScope, this._typeElement) : super(new EnclosedScope(enclosingScope)) {
+  FunctionTypeScope(Scope enclosingScope, this._typeElement)
+      : super(new EnclosedScope(enclosingScope)) {
     _defineTypeParameters();
   }
 
@@ -5351,19 +5006,6 @@
   }
 }
 
-class GeneralizingElementVisitor_DeclarationMatcher_gatherElements extends GeneralizingElementVisitor<Object> {
-  final DeclarationMatcher DeclarationMatcher_this;
-
-  GeneralizingElementVisitor_DeclarationMatcher_gatherElements(this.DeclarationMatcher_this) : super();
-
-  @override
-  Object visitElement(Element element) {
-    DeclarationMatcher_this._allElements.add(element);
-    DeclarationMatcher_this._unmatchedElements.add(element);
-    return super.visitElement(element);
-  }
-}
-
 /**
  * Instances of the class `HintGenerator` traverse a library's worth of dart code at a time to
  * generate hints over the set of sources.
@@ -5377,6 +5019,8 @@
 
   final AnalysisErrorListener _errorListener;
 
+  LibraryElement _library;
+
   ImportsVerifier _importsVerifier;
 
   bool _enableDart2JSHints = false;
@@ -5386,15 +5030,19 @@
    */
   InheritanceManager _manager;
 
+  _GatherUsedElementsVisitor _usedElementsVisitor;
+
   HintGenerator(this._compilationUnits, this._context, this._errorListener) {
-    LibraryElement library = _compilationUnits[0].element.library;
-    _importsVerifier = new ImportsVerifier(library);
+    _library = _compilationUnits[0].element.library;
+    _importsVerifier = new ImportsVerifier(_library);
     _enableDart2JSHints = _context.analysisOptions.dart2jsHint;
     _manager = new InheritanceManager(_compilationUnits[0].element.library);
+    _usedElementsVisitor = new _GatherUsedElementsVisitor(_library);
   }
 
   void generateForLibrary() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.hints.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.hints.start();
     try {
       for (int i = 0; i < _compilationUnits.length; i++) {
         CompilationUnitElement element = _compilationUnits[i].element;
@@ -5408,9 +5056,14 @@
           }
         }
       }
-      ErrorReporter definingCompilationUnitErrorReporter = new ErrorReporter(_errorListener, _compilationUnits[0].element.source);
-      _importsVerifier.generateDuplicateImportHints(definingCompilationUnitErrorReporter);
-      _importsVerifier.generateUnusedImportHints(definingCompilationUnitErrorReporter);
+      ErrorReporter definingCompilationUnitErrorReporter =
+          new ErrorReporter(_errorListener, _compilationUnits[0].element.source);
+      _importsVerifier.generateDuplicateImportHints(
+          definingCompilationUnitErrorReporter);
+      _importsVerifier.generateUnusedImportHints(
+          definingCompilationUnitErrorReporter);
+      _library.accept(
+          new _UnusedElementsVerifier(_errorListener, _usedElementsVisitor.usedElements));
     } finally {
       timeCounter.stop();
     }
@@ -5421,7 +5074,7 @@
     unit.accept(_importsVerifier);
     // dead code analysis
     unit.accept(new DeadCodeVerifier(errorReporter));
-    unit.element.accept(new UnusedElementVerifier(errorReporter));
+    unit.accept(_usedElementsVisitor);
     // dart2js analysis
     if (_enableDart2JSHints) {
       unit.accept(new Dart2JSVerifier(errorReporter));
@@ -5432,12 +5085,209 @@
     // Find to-do comments
     new ToDoFinder(errorReporter).findIn(unit);
     // pub analysis
-    // TODO(danrubel/jwren) Commented out until bugs in the pub verifier are fixed
+    // TODO(danrubel/jwren) Commented out until bugs in the pub verifier are
+    // fixed
     //    unit.accept(new PubVerifier(context, errorReporter));
   }
 }
 
 /**
+ * Instances of the class {@code HtmlTagInfo} record information about the tags used in an HTML
+ * file.
+ */
+class HtmlTagInfo {
+  /**
+   * An array containing all of the tags used in the HTML file.
+   */
+  List<String> allTags;
+
+  /**
+   * A table mapping the id's defined in the HTML file to an array containing the names of tags with
+   * that identifier.
+   */
+  HashMap<String, String> idToTagMap;
+
+  /**
+   * A table mapping the classes defined in the HTML file to an array containing the names of tags
+   * with that class.
+   */
+  HashMap<String, List<String>> classToTagsMap;
+
+  /**
+   * Initialize a newly created information holder to hold the given information about the tags in
+   * an HTML file.
+   *
+   * @param allTags an array containing all of the tags used in the HTML file
+   * @param idToTagMap a table mapping the id's defined in the HTML file to an array containing the
+   *          names of tags with that identifier
+   * @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;
+  }
+
+  /**
+   * Return an array containing the tags that have the given class, or {@code null} if there are no
+   * such tags.
+   *
+   * @return an array containing the tags that have the given class
+   */
+  List<String> getTagsWithClass(String identifier) {
+    return classToTagsMap[identifier];
+  }
+
+  /**
+   * Return the tag that has the given identifier, or {@code null} if there is no such tag (the
+   * identifier is not defined).
+   *
+   * @return the tag that has the given identifier
+   */
+  String getTagWithId(String identifier) {
+    return idToTagMap[identifier];
+  }
+}
+
+/**
+ * Instances of the class {@code HtmlTagInfoBuilder} gather information about the tags used in one
+ * or more HTML structures.
+ */
+class HtmlTagInfoBuilder implements ht.XmlVisitor {
+  /**
+   * The name of the 'id' attribute.
+   */
+  static final String ID_ATTRIBUTE = "id";
+
+  /**
+   * The name of the 'class' attribute.
+   */
+  static final String ID_CLASS = "class";
+
+  /**
+   * A set containing all of the tag names used in the HTML.
+   */
+  HashSet<String> tagSet = new HashSet<String>();
+
+  /**
+   * A table mapping the id's that are defined to the tag name with that id.
+   */
+  HashMap<String, String> idMap = new HashMap<String, String>();
+
+  /**
+   * A table mapping the classes that are defined to a set of the tag names with that class.
+   */
+  HashMap<String, HashSet<String>> classMap =
+      new HashMap<String, HashSet<String>>();
+
+  /**
+   * Initialize a newly created HTML tag info builder.
+   */
+  HtmlTagInfoBuilder();
+
+  /**
+   * Create a tag information holder holding all of the information gathered about the tags in the
+   * HTML structures that were visited.
+   *
+   * @return the information gathered about the tags in the visited HTML structures
+   */
+  HtmlTagInfo getTagInfo() {
+    List<String> allTags = tagSet.toList();
+    HashMap<String, List<String>> classToTagsMap =
+        new HashMap<String, List<String>>();
+    classMap.forEach((String key, Set<String> tags) {
+      classToTagsMap[key] = tags.toList();
+    });
+    return new HtmlTagInfo(allTags, idMap, classToTagsMap);
+  }
+
+  @override
+  visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
+    visitXmlTagNode(node);
+  }
+
+  @override
+  visitHtmlUnit(ht.HtmlUnit node) {
+    node.visitChildren(this);
+  }
+
+  @override
+  visitXmlAttributeNode(ht.XmlAttributeNode node) {
+  }
+
+  @override
+  visitXmlTagNode(ht.XmlTagNode node) {
+    node.visitChildren(this);
+    String tagName = node.tag;
+    tagSet.add(tagName);
+    for (ht.XmlAttributeNode attribute in node.attributes) {
+      String attributeName = attribute.name;
+      if (attributeName == ID_ATTRIBUTE) {
+        String attributeValue = attribute.text;
+        if (attributeValue != null) {
+          String tag = idMap[attributeValue];
+          if (tag == null) {
+            idMap[attributeValue] = tagName;
+          } else {
+//            reportError(HtmlWarningCode.MULTIPLY_DEFINED_ID, valueToken);
+          }
+        }
+      } else if (attributeName == ID_CLASS) {
+        String attributeValue = attribute.text;
+        if (attributeValue != null) {
+          HashSet<String> tagList = classMap[attributeValue];
+          if (tagList == null) {
+            tagList = new HashSet<String>();
+            classMap[attributeValue] = tagList;
+          } else {
+//            reportError(HtmlWarningCode.MULTIPLY_DEFINED_ID, valueToken);
+          }
+          tagList.add(tagName);
+        }
+      }
+    }
+  }
+
+//  /**
+//   * Report an error with the given error code at the given location. Use the given arguments to
+//   * compose the error message.
+//   *
+//   * @param errorCode the error code of the error to be reported
+//   * @param offset the offset of the first character to be highlighted
+//   * @param length the number of characters to be highlighted
+//   * @param arguments the arguments used to compose the error message
+//   */
+//  private void reportError(ErrorCode errorCode, Token token, Object... arguments) {
+//    errorListener.onError(new AnalysisError(
+//        htmlElement.getSource(),
+//        token.getOffset(),
+//        token.getLength(),
+//        errorCode,
+//        arguments));
+//  }
+//
+//  /**
+//   * Report an error with the given error code at the given location. Use the given arguments to
+//   * compose the error message.
+//   *
+//   * @param errorCode the error code of the error to be reported
+//   * @param offset the offset of the first character to be highlighted
+//   * @param length the number of characters to be highlighted
+//   * @param arguments the arguments used to compose the error message
+//   */
+//  private void reportError(ErrorCode errorCode, int offset, int length, Object... arguments) {
+//    errorListener.onError(new AnalysisError(
+//        htmlElement.getSource(),
+//        offset,
+//        length,
+//        errorCode,
+//        arguments));
+//  }
+}
+
+/**
  * Instances of the class `HtmlUnitBuilder` build an element model for a single HTML unit.
  */
 class HtmlUnitBuilder implements ht.XmlVisitor<Object> {
@@ -5454,11 +5304,6 @@
   RecordingErrorListener _errorListener;
 
   /**
-   * The modification time of the source for which an element is being built.
-   */
-  int _modificationStamp = 0;
-
-  /**
    * The HTML element being built.
    */
   HtmlElementImpl _htmlElement;
@@ -5488,26 +5333,6 @@
   }
 
   /**
-   * Build the HTML element for the given source.
-   *
-   * @param source the source describing the compilation unit
-   * @param modificationStamp the modification time of the source for which an element is being
-   *          built
-   * @param unit the AST structure representing the HTML
-   * @throws AnalysisException if the analysis could not be performed
-   */
-  HtmlElementImpl buildHtmlElement(Source source, int modificationStamp, ht.HtmlUnit unit) {
-    this._modificationStamp = modificationStamp;
-    HtmlElementImpl result = new HtmlElementImpl(_context, source.shortName);
-    result.source = source;
-    _htmlElement = result;
-    unit.accept(this);
-    _htmlElement = null;
-    unit.element = result;
-    return result;
-  }
-
-  /**
    * Return the listener to which analysis errors will be reported.
    *
    * @return the listener to which analysis errors will be reported
@@ -5521,6 +5346,23 @@
    */
   Set<Library> get resolvedLibraries => _resolvedLibraries;
 
+  /**
+   * Build the HTML element for the given source.
+   *
+   * @param source the source describing the compilation unit
+   * @param unit the AST structure representing the HTML
+   * @throws AnalysisException if the analysis could not be performed
+   */
+  HtmlElementImpl buildHtmlElement(Source source, ht.HtmlUnit unit) {
+    HtmlElementImpl result = new HtmlElementImpl(_context, source.shortName);
+    result.source = source;
+    _htmlElement = result;
+    unit.accept(this);
+    _htmlElement = null;
+    unit.element = result;
+    return result;
+  }
+
   @override
   Object visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
     if (_parentNodes.contains(node)) {
@@ -5530,12 +5372,16 @@
     try {
       Source htmlSource = _htmlElement.source;
       ht.XmlAttributeNode scriptAttribute = _getScriptSourcePath(node);
-      String scriptSourcePath = scriptAttribute == null ? null : scriptAttribute.text;
-      if (node.attributeEnd.type == ht.TokenType.GT && scriptSourcePath == null) {
-        EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
+      String scriptSourcePath =
+          scriptAttribute == null ? null : scriptAttribute.text;
+      if (node.attributeEnd.type == ht.TokenType.GT &&
+          scriptSourcePath == null) {
+        EmbeddedHtmlScriptElementImpl script =
+            new EmbeddedHtmlScriptElementImpl(node);
         try {
           LibraryResolver resolver = new LibraryResolver(_context);
-          LibraryElementImpl library = resolver.resolveEmbeddedLibrary(htmlSource, node.script, true);
+          LibraryElementImpl library =
+              resolver.resolveEmbeddedLibrary(htmlSource, node.script, true);
           script.scriptLibrary = library;
           _resolvedLibraries.addAll(resolver.resolvedLibraries);
           _errorListener.addAll(resolver.errorListener);
@@ -5548,20 +5394,28 @@
         node.scriptElement = script;
         _scripts.add(script);
       } else {
-        ExternalHtmlScriptElementImpl script = new ExternalHtmlScriptElementImpl(node);
+        ExternalHtmlScriptElementImpl script =
+            new ExternalHtmlScriptElementImpl(node);
         if (scriptSourcePath != null) {
           try {
             scriptSourcePath = Uri.encodeFull(scriptSourcePath);
-            // Force an exception to be thrown if the URI is invalid so that we can report the
-            // problem.
+            // Force an exception to be thrown if the URI is invalid so that we
+            // can report the problem.
             parseUriWithException(scriptSourcePath);
-            Source scriptSource = _context.sourceFactory.resolveUri(htmlSource, scriptSourcePath);
+            Source scriptSource =
+                _context.sourceFactory.resolveUri(htmlSource, scriptSourcePath);
             script.scriptSource = scriptSource;
             if (!_context.exists(scriptSource)) {
-              _reportValueError(HtmlWarningCode.URI_DOES_NOT_EXIST, scriptAttribute, [scriptSourcePath]);
+              _reportValueError(
+                  HtmlWarningCode.URI_DOES_NOT_EXIST,
+                  scriptAttribute,
+                  [scriptSourcePath]);
             }
           } on URISyntaxException catch (exception) {
-            _reportValueError(HtmlWarningCode.INVALID_URI, scriptAttribute, [scriptSourcePath]);
+            _reportValueError(
+                HtmlWarningCode.INVALID_URI,
+                scriptAttribute,
+                [scriptSourcePath]);
           }
         }
         node.scriptElement = script;
@@ -5621,9 +5475,9 @@
 
   Object _reportCircularity(ht.XmlTagNode node) {
     //
-    // This should not be possible, but we have an error report that suggests that it happened at
-    // least once. This code will guard against infinite recursion and might help us identify the
-    // cause of the issue.
+    // This should not be possible, but we have an error report that suggests
+    // that it happened at least once. This code will guard against infinite
+    // recursion and might help us identify the cause of the issue.
     //
     StringBuffer buffer = new StringBuffer();
     buffer.write("Found circularity in XML nodes: ");
@@ -5656,8 +5510,15 @@
    * @param length the number of characters to be highlighted
    * @param arguments the arguments used to compose the error message
    */
-  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
-    _errorListener.onError(new AnalysisError.con2(_htmlElement.source, offset, length, errorCode, arguments));
+  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length,
+      List<Object> arguments) {
+    _errorListener.onError(
+        new AnalysisError.con2(
+            _htmlElement.source,
+            offset,
+            length,
+            errorCode,
+            arguments));
   }
 
   /**
@@ -5669,7 +5530,8 @@
    * @param length the number of characters to be highlighted
    * @param arguments the arguments used to compose the error message
    */
-  void _reportValueError(ErrorCode errorCode, ht.XmlAttributeNode attribute, List<Object> arguments) {
+  void _reportValueError(ErrorCode errorCode, ht.XmlAttributeNode attribute,
+      List<Object> arguments) {
     int offset = attribute.valueToken.offset + 1;
     int length = attribute.valueToken.length - 2;
     _reportErrorForOffset(errorCode, offset, length, arguments);
@@ -5677,29 +5539,6 @@
 }
 
 /**
- * This enum holds one of four states of a field initialization state through a constructor
- * signature, not initialized, initialized in the field declaration, initialized in the field
- * formal, and finally, initialized in the initializers list.
- */
-class INIT_STATE extends Enum<INIT_STATE> {
-  static const INIT_STATE NOT_INIT = const INIT_STATE('NOT_INIT', 0);
-
-  static const INIT_STATE INIT_IN_DECLARATION = const INIT_STATE('INIT_IN_DECLARATION', 1);
-
-  static const INIT_STATE INIT_IN_FIELD_FORMAL = const INIT_STATE('INIT_IN_FIELD_FORMAL', 2);
-
-  static const INIT_STATE INIT_IN_INITIALIZERS = const INIT_STATE('INIT_IN_INITIALIZERS', 3);
-
-  static const List<INIT_STATE> values = const [
-      NOT_INIT,
-      INIT_IN_DECLARATION,
-      INIT_IN_FIELD_FORMAL,
-      INIT_IN_INITIALIZERS];
-
-  const INIT_STATE(String name, int ordinal) : super(name, ordinal);
-}
-
-/**
  * Instances of the class `SecondTypeResolverVisitor` are used to finish any resolve steps
  * after the [TypeResolverVisitor] that cannot happen in the [TypeResolverVisitor], but
  * should happen before the next tasks.
@@ -5715,7 +5554,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ImplicitConstructorBuilder.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider);
+  ImplicitConstructorBuilder.con1(Library library, Source source,
+      TypeProvider typeProvider)
+      : super.con1(library, source, typeProvider);
 
   /**
    * Initialize a newly created visitor to finish resolution in the nodes in a compilation unit.
@@ -5724,16 +5565,56 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ImplicitConstructorBuilder.con2(ResolvableLibrary library, Source source, TypeProvider typeProvider) : super.con4(library, source, typeProvider);
+  ImplicitConstructorBuilder.con2(ResolvableLibrary library, Source source,
+      TypeProvider typeProvider)
+      : super.con4(library, source, typeProvider);
 
   @override
-  Object visitClassDeclaration(ClassDeclaration node) => null;
+  Object visitClassDeclaration(ClassDeclaration node) {
+    ClassElementImpl classElement = node.element;
+    classElement.mixinErrorsReported = false;
+    if (node.extendsClause != null && node.withClause != null) {
+      // We don't need to build any implicitly constructors for the mixin
+      // application (since there isn't an explicit element for it), but we
+      // need to verify that they _could_ be built.
+      InterfaceType superclassType = null;
+      TypeName superclassName = node.extendsClause.superclass;
+      DartType type = superclassName.type;
+      if (type is InterfaceType) {
+        superclassType = type;
+      } else {
+        superclassType = typeProvider.objectType;
+      }
+      ClassElement superclassElement = classElement.supertype.element;
+      if (superclassElement != null) {
+        bool constructorFound = false;
+        void callback(ConstructorElement explicitConstructor,
+            List<DartType> parameterTypes, List<DartType> argumentTypes) {
+          constructorFound = true;
+        }
+        if (_findForwardedConstructors(
+            classElement,
+            superclassName,
+            superclassType,
+            callback) &&
+            !constructorFound) {
+          reportErrorForNode(
+              CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
+              node.withClause,
+              [superclassType.element.name]);
+          classElement.mixinErrorsReported = true;
+        }
+      }
+    }
+    return null;
+  }
 
   @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
     super.visitClassTypeAlias(node);
     InterfaceType superclassType = null;
-    DartType type = node.superclass.type;
+    TypeName superclassName = node.superclass;
+    DartType type = superclassName.type;
     if (type is InterfaceType) {
       superclassType = type;
     } else {
@@ -5741,27 +5622,31 @@
     }
     ClassElementImpl classElement = node.element as ClassElementImpl;
     if (classElement != null) {
-      ClassElement superclassElement = superclassType.element;
-      if (superclassElement != null) {
-        List<ConstructorElement> constructors = superclassElement.constructors;
-        int count = constructors.length;
-        if (count > 0) {
-          List<DartType> parameterTypes = TypeParameterTypeImpl.getTypes(superclassType.typeParameters);
-          List<DartType> argumentTypes = _getArgumentTypes(node.superclass.typeArguments, parameterTypes);
-          InterfaceType classType = classElement.type;
-          List<ConstructorElement> implicitConstructors = new List<ConstructorElement>();
-          for (int i = 0; i < count; i++) {
-            ConstructorElement explicitConstructor = constructors[i];
-            if (!explicitConstructor.isFactory &&
-                classElement.isSuperConstructorAccessible(explicitConstructor)) {
-              implicitConstructors.add(_createImplicitContructor(classType, explicitConstructor, parameterTypes, argumentTypes));
-            }
-          }
+      if (superclassType.element != null) {
+        List<ConstructorElement> implicitConstructors =
+            new List<ConstructorElement>();
+        void callback(ConstructorElement explicitConstructor,
+            List<DartType> parameterTypes, List<DartType> argumentTypes) {
+          implicitConstructors.add(
+              _createImplicitContructor(
+                  classElement.type,
+                  explicitConstructor,
+                  parameterTypes,
+                  argumentTypes));
+        }
+        if (_findForwardedConstructors(
+            classElement,
+            superclassName,
+            superclassType,
+            callback)) {
           if (implicitConstructors.isEmpty) {
-            reportErrorForNode(CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
-                node, [superclassElement.name]);
+            reportErrorForNode(
+                CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
+                node,
+                [superclassType.element.name]);
+          } else {
+            classElement.constructors = implicitConstructors;
           }
-          classElement.constructors = implicitConstructors;
         }
       }
     }
@@ -5775,7 +5660,8 @@
   Object visitFunctionDeclaration(FunctionDeclaration node) => null;
 
   @override
-  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => null;
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
+      null;
 
   /**
    * Create an implicit constructor that is copied from the given constructor, but that is in the
@@ -5787,8 +5673,11 @@
    * @param argumentTypes the types with which the parameters are to be replaced
    * @return the implicit constructor that was created
    */
-  ConstructorElement _createImplicitContructor(InterfaceType classType, ConstructorElement explicitConstructor, List<DartType> parameterTypes, List<DartType> argumentTypes) {
-    ConstructorElementImpl implicitConstructor = new ConstructorElementImpl(explicitConstructor.name, -1);
+  ConstructorElement _createImplicitContructor(InterfaceType classType,
+      ConstructorElement explicitConstructor, List<DartType> parameterTypes,
+      List<DartType> argumentTypes) {
+    ConstructorElementImpl implicitConstructor =
+        new ConstructorElementImpl(explicitConstructor.name, -1);
     implicitConstructor.synthetic = true;
     implicitConstructor.redirectedConstructor = explicitConstructor;
     implicitConstructor.const2 = explicitConstructor.isConst;
@@ -5796,15 +5685,18 @@
     List<ParameterElement> explicitParameters = explicitConstructor.parameters;
     int count = explicitParameters.length;
     if (count > 0) {
-      List<ParameterElement> implicitParameters = new List<ParameterElement>(count);
+      List<ParameterElement> implicitParameters =
+          new List<ParameterElement>(count);
       for (int i = 0; i < count; i++) {
         ParameterElement explicitParameter = explicitParameters[i];
-        ParameterElementImpl implicitParameter = new ParameterElementImpl(explicitParameter.name, -1);
+        ParameterElementImpl implicitParameter =
+            new ParameterElementImpl(explicitParameter.name, -1);
         implicitParameter.const3 = explicitParameter.isConst;
         implicitParameter.final2 = explicitParameter.isFinal;
         implicitParameter.parameterKind = explicitParameter.parameterKind;
         implicitParameter.synthetic = true;
-        implicitParameter.type = explicitParameter.type.substitute2(argumentTypes, parameterTypes);
+        implicitParameter.type =
+            explicitParameter.type.substitute2(argumentTypes, parameterTypes);
         implicitParameters[i] = implicitParameter;
       }
       implicitConstructor.parameters = implicitParameters;
@@ -5816,6 +5708,40 @@
   }
 
   /**
+   * Find all the constructors that should be forwarded from the superclass
+   * named [superclassName], having type [superclassType], to the class or
+   * mixin application [classElement], and pass information about them to
+   * [callback].
+   *
+   * Return true if some constructors were considered.  (A false return value
+   * can only happen if the supeclass is a built-in type, in which case it
+   * can't be used as a mixin anyway).
+   */
+  bool _findForwardedConstructors(ClassElementImpl classElement,
+      TypeName superclassName, InterfaceType superclassType, void
+      callback(ConstructorElement explicitConstructor, List<DartType> parameterTypes,
+      List<DartType> argumentTypes)) {
+    ClassElement superclassElement = superclassType.element;
+    List<ConstructorElement> constructors = superclassElement.constructors;
+    int count = constructors.length;
+    if (count == 0) {
+      return false;
+    }
+    List<DartType> parameterTypes =
+        TypeParameterTypeImpl.getTypes(superclassType.typeParameters);
+    List<DartType> argumentTypes =
+        _getArgumentTypes(superclassName.typeArguments, parameterTypes);
+    for (int i = 0; i < count; i++) {
+      ConstructorElement explicitConstructor = constructors[i];
+      if (!explicitConstructor.isFactory &&
+          classElement.isSuperConstructorAccessible(explicitConstructor)) {
+        callback(explicitConstructor, parameterTypes, argumentTypes);
+      }
+    }
+    return true;
+  }
+
+  /**
    * Return an array of argument types that corresponds to the array of parameter types and that are
    * derived from the given list of type arguments.
    *
@@ -5823,7 +5749,8 @@
    * @param parameterTypes the parameter types that must be matched by the type arguments
    * @return the argument types that correspond to the parameter types
    */
-  List<DartType> _getArgumentTypes(TypeArgumentList typeArguments, List<DartType> parameterTypes) {
+  List<DartType> _getArgumentTypes(TypeArgumentList typeArguments,
+      List<DartType> parameterTypes) {
     DynamicTypeImpl dynamic = DynamicTypeImpl.instance;
     int parameterCount = parameterTypes.length;
     List<DartType> types = new List<DartType>(parameterCount);
@@ -5846,6 +5773,57 @@
 }
 
 /**
+ * Instances of the class `ImplicitLabelScope` represent the scope statements
+ * that can be the target of unlabeled break and continue statements.
+ */
+class ImplicitLabelScope {
+  /**
+   * The implicit label scope associated with the top level of a function.
+   */
+  static const ImplicitLabelScope ROOT = const ImplicitLabelScope._(null, null);
+
+  /**
+   * The implicit label scope enclosing this implicit label scope.
+   */
+  final ImplicitLabelScope outerScope;
+
+  /**
+   * The statement that acts as a target for break and/or continue statements
+   * at this scoping level.
+   */
+  final Statement statement;
+
+  /**
+   * Private constructor.
+   */
+  const ImplicitLabelScope._(this.outerScope, this.statement);
+
+  /**
+   * Get the statement which should be the target of an unlabeled `break` or
+   * `continue` statement, or `null` if there is no appropriate target.
+   */
+  Statement getTarget(bool isContinue) {
+    if (outerScope == null) {
+      // This scope represents the toplevel of a function body, so it doesn't
+      // match either break or continue.
+      return null;
+    }
+    if (isContinue && statement is SwitchStatement) {
+      return outerScope.getTarget(isContinue);
+    }
+    return statement;
+  }
+
+  /**
+   * Initialize a newly created scope to represent a switch statement or loop
+   * nested within the current scope.  [statement] is the statement associated
+   * with the newly created scope.
+   */
+  ImplicitLabelScope nest(Statement statement) =>
+      new ImplicitLabelScope._(this, statement);
+}
+
+/**
  * Instances of the class `ImportsVerifier` visit all of the referenced libraries in the
  * source code verifying that all of the imports are used, otherwise a
  * [HintCode.UNUSED_IMPORT] is generated with
@@ -5927,7 +5905,12 @@
     this._duplicateImports = new List<ImportDirective>();
     this._libraryMap = new HashMap<LibraryElement, List<ImportDirective>>();
     this._namespaceMap = new HashMap<ImportDirective, Namespace>();
-    this._prefixElementMap = new HashMap<PrefixElement, List<ImportDirective>>();
+    this._prefixElementMap =
+        new HashMap<PrefixElement, List<ImportDirective>>();
+  }
+
+  void set inDefiningCompilationUnit(bool inDefiningCompilationUnit) {
+    this._inDefiningCompilationUnit = inDefiningCompilationUnit;
   }
 
   /**
@@ -5940,7 +5923,9 @@
    */
   void generateDuplicateImportHints(ErrorReporter errorReporter) {
     for (ImportDirective duplicateImport in _duplicateImports) {
-      errorReporter.reportErrorForNode(HintCode.DUPLICATE_IMPORT, duplicateImport.uri);
+      errorReporter.reportErrorForNode(
+          HintCode.DUPLICATE_IMPORT,
+          duplicateImport.uri);
     }
   }
 
@@ -5962,7 +5947,9 @@
           continue;
         }
       }
-      errorReporter.reportErrorForNode(HintCode.UNUSED_IMPORT, unusedImport.uri);
+      errorReporter.reportErrorForNode(
+          HintCode.UNUSED_IMPORT,
+          unusedImport.uri);
     }
   }
 
@@ -5985,7 +5972,8 @@
                 Element element = prefixIdentifier.staticElement;
                 if (element is PrefixElement) {
                   PrefixElement prefixElementKey = element;
-                  List<ImportDirective> list = _prefixElementMap[prefixElementKey];
+                  List<ImportDirective> list =
+                      _prefixElementMap[prefixElementKey];
                   if (list == null) {
                     list = new List<ImportDirective>();
                     _prefixElementMap[prefixElementKey] = list;
@@ -6000,29 +5988,35 @@
             //
             _putIntoLibraryMap(libraryElement, importDirective);
             //
-            // For this new addition to the libraryMap, also recursively add any exports from the
-            // libraryElement
+            // For this new addition to the libraryMap, also recursively add any
+            // exports from the libraryElement.
             //
-            _addAdditionalLibrariesForExports(libraryElement, importDirective, new List<LibraryElement>());
+            _addAdditionalLibrariesForExports(
+                libraryElement,
+                importDirective,
+                new List<LibraryElement>());
           }
         }
       }
     }
-    // If there are no imports in this library, don't visit the identifiers in the library- there
-    // can be no unused imports.
+    // If there are no imports in this library, don't visit the identifiers in
+    // the library- there can be no unused imports.
     if (_unusedImports.isEmpty) {
       return null;
     }
     if (_unusedImports.length > 1) {
-      // order the list of unusedImports to find duplicates in faster than O(n^2) time
-      List<ImportDirective> importDirectiveArray = new List.from(_unusedImports);
+      // order the list of unusedImports to find duplicates in faster than
+      // O(n^2) time
+      List<ImportDirective> importDirectiveArray =
+          new List.from(_unusedImports);
       importDirectiveArray.sort(ImportDirective.COMPARATOR);
       ImportDirective currentDirective = importDirectiveArray[0];
       for (int i = 1; i < importDirectiveArray.length; i++) {
         ImportDirective nextDirective = importDirectiveArray[i];
         if (ImportDirective.COMPARATOR(currentDirective, nextDirective) == 0) {
-          // Add either the currentDirective or nextDirective depending on which comes second, this
-          // guarantees that the first of the duplicates won't be highlighted.
+          // Add either the currentDirective or nextDirective depending on which
+          // comes second, this guarantees that the first of the duplicates
+          // won't be highlighted.
           if (currentDirective.offset < nextDirective.offset) {
             _duplicateImports.add(nextDirective);
           } else {
@@ -6058,9 +6052,9 @@
     if (_unusedImports.isEmpty) {
       return null;
     }
-    // If the prefixed identifier references some A.B, where A is a library prefix, then we can
-    // lookup the associated ImportDirective in prefixElementMap and remove it from the
-    // unusedImports list.
+    // If the prefixed identifier references some A.B, where A is a library
+    // prefix, then we can lookup the associated ImportDirective in
+    // prefixElementMap and remove it from the unusedImports list.
     SimpleIdentifier prefixIdentifier = node.prefix;
     Element element = prefixIdentifier.staticElement;
     if (element is PrefixElement) {
@@ -6072,7 +6066,8 @@
       }
       return null;
     }
-    // Otherwise, pass the prefixed identifier element and name onto visitIdentifier.
+    // Otherwise, pass the prefixed identifier element and name onto
+    // visitIdentifier.
     return _visitIdentifier(element, prefixIdentifier.name);
   }
 
@@ -6084,21 +6079,21 @@
     return _visitIdentifier(node.staticElement, node.name);
   }
 
-  void set inDefiningCompilationUnit(bool inDefiningCompilationUnit) {
-    this._inDefiningCompilationUnit = inDefiningCompilationUnit;
-  }
-
   /**
    * Recursively add any exported library elements into the [libraryMap].
    */
-  void _addAdditionalLibrariesForExports(LibraryElement library, ImportDirective importDirective, List<LibraryElement> exportPath) {
+  void _addAdditionalLibrariesForExports(LibraryElement library,
+      ImportDirective importDirective, List<LibraryElement> exportPath) {
     if (exportPath.contains(library)) {
       return;
     }
     exportPath.add(library);
     for (LibraryElement exportedLibraryElt in library.exportedLibraries) {
       _putIntoLibraryMap(exportedLibraryElt, importDirective);
-      _addAdditionalLibrariesForExports(exportedLibraryElt, importDirective, exportPath);
+      _addAdditionalLibrariesForExports(
+          exportedLibraryElt,
+          importDirective,
+          exportPath);
     }
   }
 
@@ -6113,7 +6108,8 @@
   Namespace _computeNamespace(ImportDirective importDirective) {
     Namespace namespace = _namespaceMap[importDirective];
     if (namespace == null) {
-      // If the namespace isn't in the namespaceMap, then compute and put it in the map
+      // If the namespace isn't in the namespaceMap, then compute and put it in
+      // the map.
       ImportElement importElement = importDirective.element;
       if (importElement != null) {
         NamespaceBuilder builder = new NamespaceBuilder();
@@ -6130,7 +6126,8 @@
    * used to simply add the mapping between the library element an an import directive without
    * needing to check to see if a list needs to be created.
    */
-  void _putIntoLibraryMap(LibraryElement libraryElement, ImportDirective importDirective) {
+  void _putIntoLibraryMap(LibraryElement libraryElement,
+      ImportDirective importDirective) {
     List<ImportDirective> importList = _libraryMap[libraryElement];
     if (importList == null) {
       importList = new List<ImportDirective>();
@@ -6143,8 +6140,8 @@
     if (element == null) {
       return null;
     }
-    // If the element is multiply defined then call this method recursively for each of the
-    // conflicting elements.
+    // If the element is multiply defined then call this method recursively for
+    // each of the conflicting elements.
     if (element is MultiplyDefinedElement) {
       MultiplyDefinedElement multiplyDefinedElement = element;
       for (Element elt in multiplyDefinedElement.conflictingElements) {
@@ -6160,9 +6157,10 @@
       }
       return null;
     } else if (element.enclosingElement is! CompilationUnitElement) {
-      // Identifiers that aren't a prefix element and whose enclosing element isn't a
-      // CompilationUnit are ignored- this covers the case the identifier is a relative-reference,
-      // a reference to an identifier not imported by this library.
+      // Identifiers that aren't a prefix element and whose enclosing element
+      // isn't a CompilationUnit are ignored- this covers the case the
+      // identifier is a relative-reference, a reference to an identifier not
+      // imported by this library.
       return null;
     }
     LibraryElement containingLibrary = element.library;
@@ -6173,13 +6171,15 @@
     if (_currentLibrary == containingLibrary) {
       return null;
     }
-    List<ImportDirective> importsFromSameLibrary = _libraryMap[containingLibrary];
+    List<ImportDirective> importsFromSameLibrary =
+        _libraryMap[containingLibrary];
     if (importsFromSameLibrary == null) {
       return null;
     }
     if (importsFromSameLibrary.length == 1) {
-      // If there is only one import directive for this library, then it must be the directive that
-      // this element is imported with, remove it from the unusedImports list.
+      // If there is only one import directive for this library, then it must be
+      // the directive that this element is imported with, remove it from the
+      // unusedImports list.
       ImportDirective usedImportDirective = importsFromSameLibrary[0];
       _unusedImports.remove(usedImportDirective);
     } else {
@@ -6211,291 +6211,11 @@
 }
 
 /**
- * Instances of the class `IncrementalResolver` resolve the smallest portion of an AST
- * structure that we currently know how to resolve.
- */
-class IncrementalResolver {
-  /**
-   * The element for the library containing the compilation unit being visited.
-   */
-  final LibraryElement _definingLibrary;
-
-  /**
-   * The source representing the compilation unit being visited.
-   */
-  final Source _source;
-
-  /**
-   * The object used to access the types from the core library.
-   */
-  final TypeProvider _typeProvider;
-
-  /**
-   * The error listener that will be informed of any errors that are found during resolution.
-   */
-  final AnalysisErrorListener _errorListener;
-
-  /**
-   * Initialize a newly created incremental resolver to resolve a node in the given source in the
-   * given library, reporting errors to the given error listener.
-   *
-   * @param definingLibrary the element for the library containing the compilation unit being
-   *          visited
-   * @param source the source representing the compilation unit being visited
-   * @param typeProvider the object used to access the types from the core library
-   * @param errorListener the error listener that will be informed of any errors that are found
-   *          during resolution
-   */
-  IncrementalResolver(this._definingLibrary, this._source, this._typeProvider, this._errorListener);
-
-  /**
-   * Resolve the given node, reporting any errors or warnings to the given listener.
-   *
-   * @param node the root of the AST structure to be resolved
-   * @throws AnalysisException if the node could not be resolved
-   */
-  void resolve(AstNode node) {
-    AstNode rootNode = _findResolutionRoot(node);
-    Scope scope = ScopeBuilder.scopeFor(rootNode, _errorListener);
-    if (_elementModelChanged(rootNode.parent)) {
-      throw new AnalysisException("Cannot resolve node: element model changed");
-    }
-    _resolveTypes(node, scope);
-    _resolveVariables(node, scope);
-    _resolveReferences(node, scope);
-  }
-
-  /**
-   * Return `true` if the given node can be resolved independently of any other nodes.
-   *
-   * <b>Note:</b> This method needs to be kept in sync with [ScopeBuilder.scopeForAstNode].
-   *
-   * @param node the node being tested
-   * @return `true` if the given node can be resolved independently of any other nodes
-   */
-  bool _canBeResolved(AstNode node) => node is ClassDeclaration || node is ClassTypeAlias || node is CompilationUnit || node is ConstructorDeclaration || node is FunctionDeclaration || node is FunctionTypeAlias || node is MethodDeclaration;
-
-  /**
-   * Return `true` if the portion of the element model defined by the given node has changed.
-   *
-   * @param node the node defining the portion of the element model being tested
-   * @return `true` if the element model defined by the given node has changed
-   * @throws AnalysisException if the correctness of the element model cannot be determined
-   */
-  bool _elementModelChanged(AstNode node) {
-    Element element = _getElement(node);
-    if (element == null) {
-      throw new AnalysisException("Cannot resolve node: a ${node.runtimeType} does not define an element");
-    }
-    DeclarationMatcher matcher = new DeclarationMatcher();
-    return !matcher.matches(node, element);
-  }
-
-  /**
-   * Starting at the given node, find the smallest AST node that can be resolved independently of
-   * any other nodes. Return the node that was found.
-   *
-   * @param node the node at which the search is to begin
-   * @return the smallest AST node that can be resolved independently of any other nodes
-   * @throws AnalysisException if there is no such node
-   */
-  AstNode _findResolutionRoot(AstNode node) {
-    AstNode result = node;
-    AstNode parent = result.parent;
-    while (parent != null && !_canBeResolved(parent)) {
-      result = parent;
-      parent = result.parent;
-    }
-    if (parent == null) {
-      throw new AnalysisException("Cannot resolve node: no resolvable node");
-    }
-    return result;
-  }
-
-  /**
-   * Return the element defined by the given node, or `null` if the node does not define an
-   * element.
-   *
-   * @param node the node defining the element to be returned
-   * @return the element defined by the given node
-   */
-  Element _getElement(AstNode node) {
-    if (node is Declaration) {
-      return node.element;
-    } else if (node is CompilationUnit) {
-      return node.element;
-    }
-    return null;
-  }
-
-  void _resolveReferences(AstNode node, Scope scope) {
-    ResolverVisitor visitor = new ResolverVisitor.con3(_definingLibrary, _source, _typeProvider, scope, _errorListener);
-    node.accept(visitor);
-  }
-
-  void _resolveTypes(AstNode node, Scope scope) {
-    TypeResolverVisitor visitor = new TypeResolverVisitor.con3(_definingLibrary, _source, _typeProvider, scope, _errorListener);
-    node.accept(visitor);
-  }
-
-  void _resolveVariables(AstNode node, Scope scope) {
-    VariableResolverVisitor visitor = new VariableResolverVisitor.con2(_definingLibrary, _source, _typeProvider, scope, _errorListener);
-    node.accept(visitor);
-  }
-}
-
-/**
  * Instances of the class `InheritanceManager` manage the knowledge of where class members
  * (methods, getters & setters) are inherited from.
  */
 class InheritanceManager {
   /**
-   * Given some array of [ExecutableElement]s, this method creates a synthetic element as
-   * described in 8.1.1:
-   *
-   * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a
-   * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote the number of
-   * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denote the set of all
-   * named parameters of the <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i>. Then let
-   * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i>
-   * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i>
-   * Then <i>I</i> has a method named <i>n</i>, with <i>r</i> required parameters of type
-   * <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</b>, named parameters
-   * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>.
-   *
-   */
-  static ExecutableElement _computeMergedExecutableElement(List<ExecutableElement> elementArrayToMerge) {
-    int h = _getNumOfPositionalParameters(elementArrayToMerge[0]);
-    int r = _getNumOfRequiredParameters(elementArrayToMerge[0]);
-    Set<String> namedParametersList = new HashSet<String>();
-    for (int i = 1; i < elementArrayToMerge.length; i++) {
-      ExecutableElement element = elementArrayToMerge[i];
-      int numOfPositionalParams = _getNumOfPositionalParameters(element);
-      if (h < numOfPositionalParams) {
-        h = numOfPositionalParams;
-      }
-      int numOfRequiredParams = _getNumOfRequiredParameters(element);
-      if (r > numOfRequiredParams) {
-        r = numOfRequiredParams;
-      }
-      namedParametersList.addAll(_getNamedParameterNames(element));
-    }
-    return _createSyntheticExecutableElement(elementArrayToMerge, elementArrayToMerge[0].displayName, r, h - r, new List.from(namedParametersList));
-  }
-
-  /**
-   * Used by [computeMergedExecutableElement] to actually create the
-   * synthetic element.
-   *
-   * @param elementArrayToMerge the array used to create the synthetic element
-   * @param name the name of the method, getter or setter
-   * @param numOfRequiredParameters the number of required parameters
-   * @param numOfPositionalParameters the number of positional parameters
-   * @param namedParameters the list of [String]s that are the named parameters
-   * @return the created synthetic element
-   */
-  static ExecutableElement _createSyntheticExecutableElement(List<ExecutableElement> elementArrayToMerge, String name, int numOfRequiredParameters, int numOfPositionalParameters, List<String> namedParameters) {
-    DynamicTypeImpl dynamicType = DynamicTypeImpl.instance;
-    SimpleIdentifier nameIdentifier = new SimpleIdentifier(new sc.StringToken(sc.TokenType.IDENTIFIER, name, 0));
-    ExecutableElementImpl executable;
-    if (elementArrayToMerge[0] is MethodElement) {
-      MultiplyInheritedMethodElementImpl unionedMethod = new MultiplyInheritedMethodElementImpl(nameIdentifier);
-      unionedMethod.inheritedElements = elementArrayToMerge;
-      executable = unionedMethod;
-    } else {
-      MultiplyInheritedPropertyAccessorElementImpl unionedPropertyAccessor = new MultiplyInheritedPropertyAccessorElementImpl(nameIdentifier);
-      unionedPropertyAccessor.getter = (elementArrayToMerge[0] as PropertyAccessorElement).isGetter;
-      unionedPropertyAccessor.setter = (elementArrayToMerge[0] as PropertyAccessorElement).isSetter;
-      unionedPropertyAccessor.inheritedElements = elementArrayToMerge;
-      executable = unionedPropertyAccessor;
-    }
-    int numOfParameters = numOfRequiredParameters + numOfPositionalParameters + namedParameters.length;
-    List<ParameterElement> parameters = new List<ParameterElement>(numOfParameters);
-    int i = 0;
-    for (int j = 0; j < numOfRequiredParameters; j++, i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl("", 0);
-      parameter.type = dynamicType;
-      parameter.parameterKind = ParameterKind.REQUIRED;
-      parameters[i] = parameter;
-    }
-    for (int k = 0; k < numOfPositionalParameters; k++, i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl("", 0);
-      parameter.type = dynamicType;
-      parameter.parameterKind = ParameterKind.POSITIONAL;
-      parameters[i] = parameter;
-    }
-    for (int m = 0; m < namedParameters.length; m++, i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl(namedParameters[m], 0);
-      parameter.type = dynamicType;
-      parameter.parameterKind = ParameterKind.NAMED;
-      parameters[i] = parameter;
-    }
-    executable.returnType = dynamicType;
-    executable.parameters = parameters;
-    FunctionTypeImpl methodType = new FunctionTypeImpl.con1(executable);
-    executable.type = methodType;
-    return executable;
-  }
-
-  /**
-   * Given some [ExecutableElement], return the list of named parameters.
-   */
-  static List<String> _getNamedParameterNames(ExecutableElement executableElement) {
-    List<String> namedParameterNames = new List<String>();
-    List<ParameterElement> parameters = executableElement.parameters;
-    for (int i = 0; i < parameters.length; i++) {
-      ParameterElement parameterElement = parameters[i];
-      if (parameterElement.parameterKind == ParameterKind.NAMED) {
-        namedParameterNames.add(parameterElement.name);
-      }
-    }
-    return namedParameterNames;
-  }
-
-  /**
-   * Given some [ExecutableElement] return the number of parameters of the specified kind.
-   */
-  static int _getNumOfParameters(ExecutableElement executableElement, ParameterKind parameterKind) {
-    int parameterCount = 0;
-    List<ParameterElement> parameters = executableElement.parameters;
-    for (int i = 0; i < parameters.length; i++) {
-      ParameterElement parameterElement = parameters[i];
-      if (parameterElement.parameterKind == parameterKind) {
-        parameterCount++;
-      }
-    }
-    return parameterCount;
-  }
-
-  /**
-   * Given some [ExecutableElement] return the number of positional parameters.
-   *
-   * Note: by positional we mean [ParameterKind.REQUIRED] or [ParameterKind.POSITIONAL].
-   */
-  static int _getNumOfPositionalParameters(ExecutableElement executableElement) => _getNumOfParameters(executableElement, ParameterKind.REQUIRED) + _getNumOfParameters(executableElement, ParameterKind.POSITIONAL);
-
-  /**
-   * Given some [ExecutableElement] return the number of required parameters.
-   */
-  static int _getNumOfRequiredParameters(ExecutableElement executableElement) => _getNumOfParameters(executableElement, ParameterKind.REQUIRED);
-
-  /**
-   * Given some [ExecutableElement] returns `true` if it is an abstract member of a
-   * class.
-   *
-   * @param executableElement some [ExecutableElement] to evaluate
-   * @return `true` if the given element is an abstract member of a class
-   */
-  static bool _isAbstract(ExecutableElement executableElement) {
-    if (executableElement is MethodElement) {
-      return executableElement.isAbstract;
-    } else if (executableElement is PropertyAccessorElement) {
-      return executableElement.isAbstract;
-    }
-    return false;
-  }
-
-  /**
    * The [LibraryElement] that is managed by this manager.
    */
   LibraryElement _library;
@@ -6516,7 +6236,8 @@
    * A map between each visited [ClassElement] and the set of [AnalysisError]s found on
    * the class element.
    */
-  HashMap<ClassElement, HashSet<AnalysisError>> _errorsInClassElement = new HashMap<ClassElement, HashSet<AnalysisError>>();
+  HashMap<ClassElement, HashSet<AnalysisError>> _errorsInClassElement =
+      new HashMap<ClassElement, HashSet<AnalysisError>>();
 
   /**
    * Initialize a newly created inheritance manager.
@@ -6530,6 +6251,15 @@
   }
 
   /**
+   * Set the new library element context.
+   *
+   * @param library the new library element
+   */
+  void set libraryElement(LibraryElement library) {
+    this._library = library;
+  }
+
+  /**
    * Return the set of [AnalysisError]s found on the passed [ClassElement], or
    * `null` if there are none.
    *
@@ -6537,7 +6267,8 @@
    * @return the set of [AnalysisError]s found on the passed [ClassElement], or
    *         `null` if there are none
    */
-  HashSet<AnalysisError> getErrors(ClassElement classElt) => _errorsInClassElement[classElt];
+  HashSet<AnalysisError> getErrors(ClassElement classElt) =>
+      _errorsInClassElement[classElt];
 
   /**
    * Get and return a mapping between the set of all string names of the members inherited from the
@@ -6547,7 +6278,8 @@
    * @return a mapping between the set of all members inherited from the passed [ClassElement]
    *         superclass hierarchy, and the associated [ExecutableElement]
    */
-  MemberMap getMapOfMembersInheritedFromClasses(ClassElement classElt) => _computeClassChainLookupMap(classElt, new HashSet<ClassElement>());
+  MemberMap getMapOfMembersInheritedFromClasses(ClassElement classElt) =>
+      _computeClassChainLookupMap(classElt, new HashSet<ClassElement>());
 
   /**
    * Get and return a mapping between the set of all string names of the members inherited from the
@@ -6557,7 +6289,8 @@
    * @return a mapping between the set of all string names of the members inherited from the passed
    *         [ClassElement] interface hierarchy, and the associated [ExecutableElement].
    */
-  MemberMap getMapOfMembersInheritedFromInterfaces(ClassElement classElt) => _computeInterfaceLookupMap(classElt, new HashSet<ClassElement>());
+  MemberMap getMapOfMembersInheritedFromInterfaces(ClassElement classElt) =>
+      _computeInterfaceLookupMap(classElt, new HashSet<ClassElement>());
 
   /**
    * Given some [ClassElement] and some member name, this returns the
@@ -6570,13 +6303,18 @@
    * @return the inherited executable element with the member name, or `null` if no such
    *         member exists
    */
-  ExecutableElement lookupInheritance(ClassElement classElt, String memberName) {
+  ExecutableElement lookupInheritance(ClassElement classElt,
+      String memberName) {
     if (memberName == null || memberName.isEmpty) {
       return null;
     }
-    ExecutableElement executable = _computeClassChainLookupMap(classElt, new HashSet<ClassElement>()).get(memberName);
+    ExecutableElement executable = _computeClassChainLookupMap(
+        classElt,
+        new HashSet<ClassElement>()).get(memberName);
     if (executable == null) {
-      return _computeInterfaceLookupMap(classElt, new HashSet<ClassElement>()).get(memberName);
+      return _computeInterfaceLookupMap(
+          classElt,
+          new HashSet<ClassElement>()).get(memberName);
     }
     return executable;
   }
@@ -6610,12 +6348,17 @@
    * @param memberName the name of the executable element to find and return
    * @return the member's function type, or `null` if no such member exists
    */
-  FunctionType lookupMemberType(InterfaceType interfaceType, String memberName) {
-    ExecutableElement iteratorMember = lookupMember(interfaceType.element, memberName);
+  FunctionType lookupMemberType(InterfaceType interfaceType,
+      String memberName) {
+    ExecutableElement iteratorMember =
+        lookupMember(interfaceType.element, memberName);
     if (iteratorMember == null) {
       return null;
     }
-    return substituteTypeArgumentsInMemberFromInheritance(iteratorMember.type, memberName, interfaceType);
+    return substituteTypeArgumentsInMemberFromInheritance(
+        iteratorMember.type,
+        memberName,
+        interfaceType);
   }
 
   /**
@@ -6628,19 +6371,23 @@
    * @param memberName the name of the class member to query
    * @return a list of overridden methods
    */
-  List<ExecutableElement> lookupOverrides(ClassElement classElt, String memberName) {
+  List<ExecutableElement> lookupOverrides(ClassElement classElt,
+      String memberName) {
     List<ExecutableElement> result = new List<ExecutableElement>();
     if (memberName == null || memberName.isEmpty) {
       return result;
     }
-    List<MemberMap> interfaceMaps = _gatherInterfaceLookupMaps(classElt, new HashSet<ClassElement>());
+    List<MemberMap> interfaceMaps =
+        _gatherInterfaceLookupMaps(classElt, new HashSet<ClassElement>());
     if (interfaceMaps != null) {
       for (MemberMap interfaceMap in interfaceMaps) {
         ExecutableElement overriddenElement = interfaceMap.get(memberName);
         if (overriddenElement != null) {
           if (overriddenElement is MultiplyInheritedExecutableElement) {
-            MultiplyInheritedExecutableElement multiplyInheritedElement = overriddenElement;
-            for (ExecutableElement element in multiplyInheritedElement.inheritedElements) {
+            MultiplyInheritedExecutableElement multiplyInheritedElement =
+                overriddenElement;
+            for (ExecutableElement element in
+                multiplyInheritedElement.inheritedElements) {
               result.add(element);
             }
           } else {
@@ -6653,15 +6400,6 @@
   }
 
   /**
-   * Set the new library element context.
-   *
-   * @param library the new library element
-   */
-  void set libraryElement(LibraryElement library) {
-    this._library = library;
-  }
-
-  /**
    * This method takes some inherited [FunctionType], and resolves all the parameterized types
    * in the function type, dependent on the class in which it is being overridden.
    *
@@ -6671,9 +6409,13 @@
    * @param definingType the type that is overriding the member
    * @return the passed function type with any parameterized types substituted
    */
-  FunctionType substituteTypeArgumentsInMemberFromInheritance(FunctionType baseFunctionType, String memberName, InterfaceType definingType) {
-    // if the baseFunctionType is null, or does not have any parameters, return it.
-    if (baseFunctionType == null || baseFunctionType.typeArguments.length == 0) {
+  FunctionType
+      substituteTypeArgumentsInMemberFromInheritance(FunctionType baseFunctionType,
+      String memberName, InterfaceType definingType) {
+    // if the baseFunctionType is null, or does not have any parameters,
+    // return it.
+    if (baseFunctionType == null ||
+        baseFunctionType.typeArguments.length == 0) {
       return baseFunctionType;
     }
     // First, generate the path from the defining type to the overridden member
@@ -6689,7 +6431,8 @@
       InterfaceType lastType = inheritancePath.removeLast();
       List<DartType> parameterTypes = lastType.element.type.typeArguments;
       List<DartType> argumentTypes = lastType.typeArguments;
-      functionTypeToReturn = functionTypeToReturn.substitute2(argumentTypes, parameterTypes);
+      functionTypeToReturn =
+          functionTypeToReturn.substitute2(argumentTypes, parameterTypes);
     }
     return functionTypeToReturn;
   }
@@ -6705,7 +6448,8 @@
    * @return a mapping between the set of all string names of the members inherited from the passed
    *         [ClassElement] superclass hierarchy, and the associated [ExecutableElement]
    */
-  MemberMap _computeClassChainLookupMap(ClassElement classElt, HashSet<ClassElement> visitedClasses) {
+  MemberMap _computeClassChainLookupMap(ClassElement classElt,
+      HashSet<ClassElement> visitedClasses) {
     MemberMap resultMap = _classLookup[classElt];
     if (resultMap != null) {
       return resultMap;
@@ -6725,7 +6469,8 @@
       if (!visitedClasses.contains(superclassElt)) {
         visitedClasses.add(superclassElt);
         try {
-          resultMap = new MemberMap.con2(_computeClassChainLookupMap(superclassElt, visitedClasses));
+          resultMap =
+              new MemberMap.con2(_computeClassChainLookupMap(superclassElt, visitedClasses));
           //
           // Substitute the super types down the hierarchy.
           //
@@ -6738,8 +6483,9 @@
           visitedClasses.remove(superclassElt);
         }
       } else {
-        // This case happens only when the superclass was previously visited and not in the lookup,
-        // meaning this is meant to shorten the compute for recursive cases.
+        // This case happens only when the superclass was previously visited and
+        // not in the lookup, meaning this is meant to shorten the compute for
+        // recursive cases.
         _classLookup[superclassElt] = resultMap;
         return resultMap;
       }
@@ -6754,7 +6500,8 @@
         if (!visitedClasses.contains(mixinElement)) {
           visitedClasses.add(mixinElement);
           try {
-            MemberMap map = new MemberMap.con2(_computeClassChainLookupMap(mixinElement, visitedClasses));
+            MemberMap map =
+                new MemberMap.con2(_computeClassChainLookupMap(mixinElement, visitedClasses));
             //
             // Substitute the super types down the hierarchy.
             //
@@ -6770,7 +6517,8 @@
               String key = map.getKey(j);
               ExecutableElement value = map.getValue(j);
               if (key != null) {
-                if (resultMap.get(key) == null || (resultMap.get(key) != null && !_isAbstract(value))) {
+                if (resultMap.get(key) == null ||
+                    (resultMap.get(key) != null && !_isAbstract(value))) {
                   resultMap.put(key, value);
                 }
               }
@@ -6779,8 +6527,9 @@
             visitedClasses.remove(mixinElement);
           }
         } else {
-          // This case happens only when the superclass was previously visited and not in the lookup,
-          // meaning this is meant to shorten the compute for recursive cases.
+          // This case happens only when the superclass was previously visited
+          // and not in the lookup, meaning this is meant to shorten the compute
+          // for recursive cases.
           _classLookup[mixinElement] = resultMap;
           return resultMap;
         }
@@ -6799,9 +6548,11 @@
    * @param currentType the current type in the inheritance path
    * @param memberName the name of the member that is being looked up the inheritance path
    */
-  void _computeInheritancePath(Queue<InterfaceType> chain, InterfaceType currentType, String memberName) {
-    // TODO (jwren) create a public version of this method which doesn't require the initial chain
-    // to be provided, then provided tests for this functionality in InheritanceManagerTest
+  void _computeInheritancePath(Queue<InterfaceType> chain,
+      InterfaceType currentType, String memberName) {
+    // TODO (jwren) create a public version of this method which doesn't require
+    // the initial chain to be provided, then provided tests for this
+    // functionality in InheritanceManagerTest
     chain.add(currentType);
     ClassElement classElt = currentType.element;
     InterfaceType supertype = classElt.supertype;
@@ -6826,7 +6577,8 @@
       if (mixinElement != null) {
         ExecutableElement elt = _lookupMemberInClass(mixinElement, memberName);
         if (elt != null) {
-          // this is equivalent (but faster than) calling this method recursively
+          // this is equivalent (but faster than) calling this method
+          // recursively
           // (return computeInheritancePath(chain, mixins[i], memberName);)
           chain.add(mixins[i]);
           return;
@@ -6843,7 +6595,8 @@
     List<InterfaceType> interfaces = classElt.interfaces;
     for (InterfaceType interfaceType in interfaces) {
       ClassElement interfaceElement = interfaceType.element;
-      if (interfaceElement != null && lookupMember(interfaceElement, memberName) != null) {
+      if (interfaceElement != null &&
+          lookupMember(interfaceElement, memberName) != null) {
         _computeInheritancePath(chain, interfaceType, memberName);
         return;
       }
@@ -6861,16 +6614,19 @@
    * @return a mapping between the set of all string names of the members inherited from the passed
    *         [ClassElement] interface hierarchy, and the associated [ExecutableElement]
    */
-  MemberMap _computeInterfaceLookupMap(ClassElement classElt, HashSet<ClassElement> visitedInterfaces) {
+  MemberMap _computeInterfaceLookupMap(ClassElement classElt,
+      HashSet<ClassElement> visitedInterfaces) {
     MemberMap resultMap = _interfaceLookup[classElt];
     if (resultMap != null) {
       return resultMap;
     }
-    List<MemberMap> lookupMaps = _gatherInterfaceLookupMaps(classElt, visitedInterfaces);
+    List<MemberMap> lookupMaps =
+        _gatherInterfaceLookupMaps(classElt, visitedInterfaces);
     if (lookupMaps == null) {
       resultMap = new MemberMap();
     } else {
-      HashMap<String, List<ExecutableElement>> unionMap = _unionInterfaceLookupMaps(lookupMaps);
+      HashMap<String, List<ExecutableElement>> unionMap =
+          _unionInterfaceLookupMaps(lookupMaps);
       resultMap = _resolveInheritanceLookup(classElt, unionMap);
     }
     _interfaceLookup[classElt] = resultMap;
@@ -6891,9 +6647,11 @@
    *         are no classes above this one in the class hierarchy. Otherwise, a list of interface
    *         lookup maps.
    */
-  List<MemberMap> _gatherInterfaceLookupMaps(ClassElement classElt, HashSet<ClassElement> visitedInterfaces) {
+  List<MemberMap> _gatherInterfaceLookupMaps(ClassElement classElt,
+      HashSet<ClassElement> visitedInterfaces) {
     InterfaceType supertype = classElt.supertype;
-    ClassElement superclassElement = supertype != null ? supertype.element : null;
+    ClassElement superclassElement =
+        supertype != null ? supertype.element : null;
     List<InterfaceType> mixins = classElt.mixins;
     List<InterfaceType> interfaces = classElt.interfaces;
     // Recursively collect the list of mappings from all of the interface types
@@ -6908,7 +6666,8 @@
           //
           // Recursively compute the map for the super type.
           //
-          MemberMap map = _computeInterfaceLookupMap(superclassElement, visitedInterfaces);
+          MemberMap map =
+              _computeInterfaceLookupMap(superclassElement, visitedInterfaces);
           map = new MemberMap.con2(map);
           //
           // Substitute the super type down the hierarchy.
@@ -6939,7 +6698,8 @@
             //
             // Recursively compute the map for the mixin.
             //
-            MemberMap map = _computeInterfaceLookupMap(mixinElement, visitedInterfaces);
+            MemberMap map =
+                _computeInterfaceLookupMap(mixinElement, visitedInterfaces);
             map = new MemberMap.con2(map);
             //
             // Substitute the mixin type down the hierarchy.
@@ -6970,7 +6730,8 @@
             //
             // Recursively compute the map for the interfaces.
             //
-            MemberMap map = _computeInterfaceLookupMap(interfaceElement, visitedInterfaces);
+            MemberMap map =
+                _computeInterfaceLookupMap(interfaceElement, visitedInterfaces);
             map = new MemberMap.con2(map);
             //
             // Substitute the supertypes down the hierarchy
@@ -7004,16 +6765,21 @@
    * @param memberName the name of the member to lookup in the class
    * @return the found [ExecutableElement], or `null` if no such member was found
    */
-  ExecutableElement _lookupMemberInClass(ClassElement classElt, String memberName) {
+  ExecutableElement _lookupMemberInClass(ClassElement classElt,
+      String memberName) {
     List<MethodElement> methods = classElt.methods;
     for (MethodElement method in methods) {
-      if (memberName == method.name && method.isAccessibleIn(_library) && !method.isStatic) {
+      if (memberName == method.name &&
+          method.isAccessibleIn(_library) &&
+          !method.isStatic) {
         return method;
       }
     }
     List<PropertyAccessorElement> accessors = classElt.accessors;
     for (PropertyAccessorElement accessor in accessors) {
-      if (memberName == accessor.name && accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+      if (memberName == accessor.name &&
+          accessor.isAccessibleIn(_library) &&
+          !accessor.isStatic) {
         return accessor;
       }
     }
@@ -7029,16 +6795,21 @@
    * @param type the type that will be recorded into the passed map
    * @param doIncludeAbstract `true` if abstract members will be put into the map
    */
-  void _recordMapWithClassMembers(MemberMap map, InterfaceType type, bool doIncludeAbstract) {
+  void _recordMapWithClassMembers(MemberMap map, InterfaceType type,
+      bool doIncludeAbstract) {
     List<MethodElement> methods = type.methods;
     for (MethodElement method in methods) {
-      if (method.isAccessibleIn(_library) && !method.isStatic && (doIncludeAbstract || !method.isAbstract)) {
+      if (method.isAccessibleIn(_library) &&
+          !method.isStatic &&
+          (doIncludeAbstract || !method.isAbstract)) {
         map.put(method.name, method);
       }
     }
     List<PropertyAccessorElement> accessors = type.accessors;
     for (PropertyAccessorElement accessor in accessors) {
-      if (accessor.isAccessibleIn(_library) && !accessor.isStatic && (doIncludeAbstract || !accessor.isAbstract)) {
+      if (accessor.isAccessibleIn(_library) &&
+          !accessor.isStatic &&
+          (doIncludeAbstract || !accessor.isAbstract)) {
         map.put(accessor.name, accessor);
       }
     }
@@ -7055,13 +6826,15 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  void _reportError(ClassElement classElt, int offset, int length, ErrorCode errorCode, List<Object> arguments) {
+  void _reportError(ClassElement classElt, int offset, int length,
+      ErrorCode errorCode, List<Object> arguments) {
     HashSet<AnalysisError> errorSet = _errorsInClassElement[classElt];
     if (errorSet == null) {
       errorSet = new HashSet<AnalysisError>();
       _errorsInClassElement[classElt] = errorSet;
     }
-    errorSet.add(new AnalysisError.con2(classElt.source, offset, length, errorCode, arguments));
+    errorSet.add(
+        new AnalysisError.con2(classElt.source, offset, length, errorCode, arguments));
   }
 
   /**
@@ -7076,16 +6849,18 @@
    *          defined in superclasses of [classElt].
    * @return the inheritance lookup map for [classElt].
    */
-  MemberMap _resolveInheritanceLookup(ClassElement classElt, HashMap<String, List<ExecutableElement>> unionMap) {
+  MemberMap _resolveInheritanceLookup(ClassElement classElt, HashMap<String,
+      List<ExecutableElement>> unionMap) {
     MemberMap resultMap = new MemberMap();
     unionMap.forEach((String key, List<ExecutableElement> list) {
       int numOfEltsWithMatchingNames = list.length;
       if (numOfEltsWithMatchingNames == 1) {
         //
-        // Example: class A inherits only 1 method named 'm'.  Since it is the only such method, it
-        // is inherited.
-        // Another example: class A inherits 2 methods named 'm' from 2 different interfaces, but
-        // they both have the same signature, so it is the method inherited.
+        // Example: class A inherits only 1 method named 'm'.
+        // Since it is the only such method, it is inherited.
+        // Another example: class A inherits 2 methods named 'm' from 2
+        // different interfaces, but they both have the same signature, so it is
+        // the method inherited.
         //
         resultMap.put(key, list[0]);
       } else {
@@ -7109,15 +6884,17 @@
           }
         }
         //
-        // If there isn't a mixture of methods with getters, then continue, otherwise create a
-        // warning.
+        // If there isn't a mixture of methods with getters, then continue,
+        // otherwise create a warning.
         //
         if (allMethods || allGetters || allSetters) {
           //
-          // Compute the element whose type is the subtype of all of the other types.
+          // Compute the element whose type is the subtype of all of the other
+          // types.
           //
           List<ExecutableElement> elements = new List.from(list);
-          List<FunctionType> executableElementTypes = new List<FunctionType>(numOfEltsWithMatchingNames);
+          List<FunctionType> executableElementTypes =
+              new List<FunctionType>(numOfEltsWithMatchingNames);
           for (int i = 0; i < numOfEltsWithMatchingNames; i++) {
             executableElementTypes[i] = elements[i].type;
           }
@@ -7128,7 +6905,8 @@
               continue;
             }
             bool subtypeOfAllTypes = true;
-            for (int j = 0; j < numOfEltsWithMatchingNames && subtypeOfAllTypes; j++) {
+            for (int j =
+                0; j < numOfEltsWithMatchingNames && subtypeOfAllTypes; j++) {
               if (i != j) {
                 if (!subtype.isSubtypeOf(executableElementTypes[j])) {
                   subtypeOfAllTypes = false;
@@ -7141,22 +6919,25 @@
             }
           }
           //
-          // The following is split into three cases determined by the number of elements in subtypesOfAllOtherTypes
+          // The following is split into three cases determined by the number of
+          // elements in subtypesOfAllOtherTypes
           //
           if (subtypesOfAllOtherTypesIndexes.length == 1) {
             //
-            // Example: class A inherited only 2 method named 'm'. One has the function type
-            // '() -> dynamic' and one has the function type '([int]) -> dynamic'. Since the second
-            // method is a subtype of all the others, it is the inherited method.
-            // Tests: InheritanceManagerTest.test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_*
+            // Example: class A inherited only 2 method named 'm'.
+            // One has the function type '() -> dynamic' and one has the
+            // function type '([int]) -> dynamic'. Since the second method is a
+            // subtype of all the others, it is the inherited method.
+            // Tests: InheritanceManagerTest.
+            // test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_*
             //
             resultMap.put(key, elements[subtypesOfAllOtherTypesIndexes[0]]);
           } else {
             if (subtypesOfAllOtherTypesIndexes.isEmpty) {
               //
-              // Determine if the current class has a method or accessor with the member name, if it
-              // does then then this class does not "inherit" from any of the supertypes.
-              // See issue 16134.
+              // Determine if the current class has a method or accessor with
+              // the member name, if it does then then this class does not
+              // "inherit" from any of the supertypes. See issue 16134.
               //
               bool classHasMember = false;
               if (allMethods) {
@@ -7170,32 +6951,49 @@
                 }
               }
               //
-              // Example: class A inherited only 2 method named 'm'. One has the function type
-              // '() -> int' and one has the function type '() -> String'. Since neither is a subtype
-              // of the other, we create a warning, and have this class inherit nothing.
+              // Example: class A inherited only 2 method named 'm'.
+              // One has the function type '() -> int' and one has the function
+              // type '() -> String'. Since neither is a subtype of the other,
+              // we create a warning, and have this class inherit nothing.
               //
               if (!classHasMember) {
-                String firstTwoFuntionTypesStr = "${executableElementTypes[0]}, ${executableElementTypes[1]}";
-                _reportError(classElt, classElt.nameOffset, classElt.displayName.length, StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE, [key, firstTwoFuntionTypesStr]);
+                String firstTwoFuntionTypesStr =
+                    "${executableElementTypes[0]}, ${executableElementTypes[1]}";
+                _reportError(
+                    classElt,
+                    classElt.nameOffset,
+                    classElt.displayName.length,
+                    StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE,
+                    [key, firstTwoFuntionTypesStr]);
               }
             } else {
               //
-              // Example: class A inherits 2 methods named 'm'. One has the function type
-              // '(int) -> dynamic' and one has the function type '(num) -> dynamic'. Since they are
-              // both a subtype of the other, a synthetic function '(dynamic) -> dynamic' is
+              // Example: class A inherits 2 methods named 'm'.
+              // One has the function type '(int) -> dynamic' and one has the
+              // function type '(num) -> dynamic'. Since they are both a subtype
+              // of the other, a synthetic function '(dynamic) -> dynamic' is
               // inherited.
-              // Tests: test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_*
+              // Tests: test_getMapOfMembersInheritedFromInterfaces_
+              // union_multipleSubtypes_*
               //
-              List<ExecutableElement> elementArrayToMerge = new List<ExecutableElement>(subtypesOfAllOtherTypesIndexes.length);
+              List<ExecutableElement> elementArrayToMerge =
+                  new List<ExecutableElement>(subtypesOfAllOtherTypesIndexes.length);
               for (int i = 0; i < elementArrayToMerge.length; i++) {
-                elementArrayToMerge[i] = elements[subtypesOfAllOtherTypesIndexes[i]];
+                elementArrayToMerge[i] =
+                    elements[subtypesOfAllOtherTypesIndexes[i]];
               }
-              ExecutableElement mergedExecutableElement = _computeMergedExecutableElement(elementArrayToMerge);
+              ExecutableElement mergedExecutableElement =
+                  _computeMergedExecutableElement(elementArrayToMerge);
               resultMap.put(key, mergedExecutableElement);
             }
           }
         } else {
-          _reportError(classElt, classElt.nameOffset, classElt.displayName.length, StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD, [key]);
+          _reportError(
+              classElt,
+              classElt.nameOffset,
+              classElt.displayName.length,
+              StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
+              [key]);
         }
       }
     });
@@ -7209,14 +7007,18 @@
    * @param superType the supertype to substitute into the members of the [MemberMap]
    * @param map the MemberMap to perform the substitutions on
    */
-  void _substituteTypeParametersDownHierarchy(InterfaceType superType, MemberMap map) {
+  void _substituteTypeParametersDownHierarchy(InterfaceType superType,
+      MemberMap map) {
     for (int i = 0; i < map.size; i++) {
       ExecutableElement executableElement = map.getValue(i);
       if (executableElement is MethodMember) {
-        executableElement = MethodMember.from(executableElement as MethodMember, superType);
+        executableElement =
+            MethodMember.from(executableElement as MethodMember, superType);
         map.setValue(i, executableElement);
       } else if (executableElement is PropertyAccessorMember) {
-        executableElement = PropertyAccessorMember.from(executableElement as PropertyAccessorMember, superType);
+        executableElement = PropertyAccessorMember.from(
+            executableElement as PropertyAccessorMember,
+            superType);
         map.setValue(i, executableElement);
       }
     }
@@ -7231,8 +7033,10 @@
    * @param lookupMaps the maps to be unioned together.
    * @return the resulting union map.
    */
-  HashMap<String, List<ExecutableElement>> _unionInterfaceLookupMaps(List<MemberMap> lookupMaps) {
-    HashMap<String, List<ExecutableElement>> unionMap = new HashMap<String, List<ExecutableElement>>();
+  HashMap<String, List<ExecutableElement>>
+      _unionInterfaceLookupMaps(List<MemberMap> lookupMaps) {
+    HashMap<String, List<ExecutableElement>> unionMap =
+        new HashMap<String, List<ExecutableElement>>();
     for (MemberMap lookupMap in lookupMaps) {
       int lookupMapSize = lookupMap.size;
       for (int i = 0; i < lookupMapSize; i++) {
@@ -7243,8 +7047,8 @@
         }
         // Get the list value out of the unionMap
         List<ExecutableElement> list = unionMap[key];
-        // If we haven't created such a map for this key yet, do create it and put the list entry
-        // into the unionMap.
+        // If we haven't created such a map for this key yet, do create it and
+        // put the list entry into the unionMap.
         if (list == null) {
           list = new List<ExecutableElement>();
           unionMap[key] = list;
@@ -7255,14 +7059,15 @@
           // If the list is empty, just the new value
           list.add(newExecutableElementEntry);
         } else {
-          // Otherwise, only add the newExecutableElementEntry if it isn't already in the list, this
-          // covers situation where a class inherits two methods (or two getters) that are
-          // identical.
+          // Otherwise, only add the newExecutableElementEntry if it isn't
+          // already in the list, this covers situation where a class inherits
+          // two methods (or two getters) that are identical.
           bool alreadyInList = false;
           bool isMethod1 = newExecutableElementEntry is MethodElement;
           for (ExecutableElement executableElementInList in list) {
             bool isMethod2 = executableElementInList is MethodElement;
-            if (isMethod1 == isMethod2 && executableElementInList.type == newExecutableElementEntry.type) {
+            if (isMethod1 == isMethod2 &&
+                executableElementInList.type == newExecutableElementEntry.type) {
               alreadyInList = true;
               break;
             }
@@ -7275,6 +7080,203 @@
     }
     return unionMap;
   }
+
+  /**
+   * Given some array of [ExecutableElement]s, this method creates a synthetic element as
+   * described in 8.1.1:
+   *
+   * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a
+   * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote the number of
+   * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denote the set of all
+   * named parameters of the <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i>. Then let
+   * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i>
+   * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i>
+   * Then <i>I</i> has a method named <i>n</i>, with <i>r</i> required parameters of type
+   * <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</b>, named parameters
+   * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>.
+   *
+   */
+  static ExecutableElement
+      _computeMergedExecutableElement(List<ExecutableElement> elementArrayToMerge) {
+    int h = _getNumOfPositionalParameters(elementArrayToMerge[0]);
+    int r = _getNumOfRequiredParameters(elementArrayToMerge[0]);
+    Set<String> namedParametersList = new HashSet<String>();
+    for (int i = 1; i < elementArrayToMerge.length; i++) {
+      ExecutableElement element = elementArrayToMerge[i];
+      int numOfPositionalParams = _getNumOfPositionalParameters(element);
+      if (h < numOfPositionalParams) {
+        h = numOfPositionalParams;
+      }
+      int numOfRequiredParams = _getNumOfRequiredParameters(element);
+      if (r > numOfRequiredParams) {
+        r = numOfRequiredParams;
+      }
+      namedParametersList.addAll(_getNamedParameterNames(element));
+    }
+    return _createSyntheticExecutableElement(
+        elementArrayToMerge,
+        elementArrayToMerge[0].displayName,
+        r,
+        h - r,
+        new List.from(namedParametersList));
+  }
+
+  /**
+   * Used by [computeMergedExecutableElement] to actually create the
+   * synthetic element.
+   *
+   * @param elementArrayToMerge the array used to create the synthetic element
+   * @param name the name of the method, getter or setter
+   * @param numOfRequiredParameters the number of required parameters
+   * @param numOfPositionalParameters the number of positional parameters
+   * @param namedParameters the list of [String]s that are the named parameters
+   * @return the created synthetic element
+   */
+  static ExecutableElement
+      _createSyntheticExecutableElement(List<ExecutableElement> elementArrayToMerge,
+      String name, int numOfRequiredParameters, int numOfPositionalParameters,
+      List<String> namedParameters) {
+    DynamicTypeImpl dynamicType = DynamicTypeImpl.instance;
+    SimpleIdentifier nameIdentifier =
+        new SimpleIdentifier(new sc.StringToken(sc.TokenType.IDENTIFIER, name, 0));
+    ExecutableElementImpl executable;
+    if (elementArrayToMerge[0] is MethodElement) {
+      MultiplyInheritedMethodElementImpl unionedMethod =
+          new MultiplyInheritedMethodElementImpl(nameIdentifier);
+      unionedMethod.inheritedElements = elementArrayToMerge;
+      executable = unionedMethod;
+    } else {
+      MultiplyInheritedPropertyAccessorElementImpl unionedPropertyAccessor =
+          new MultiplyInheritedPropertyAccessorElementImpl(nameIdentifier);
+      unionedPropertyAccessor.getter =
+          (elementArrayToMerge[0] as PropertyAccessorElement).isGetter;
+      unionedPropertyAccessor.setter =
+          (elementArrayToMerge[0] as PropertyAccessorElement).isSetter;
+      unionedPropertyAccessor.inheritedElements = elementArrayToMerge;
+      executable = unionedPropertyAccessor;
+    }
+    int numOfParameters =
+        numOfRequiredParameters +
+        numOfPositionalParameters +
+        namedParameters.length;
+    List<ParameterElement> parameters =
+        new List<ParameterElement>(numOfParameters);
+    int i = 0;
+    for (int j = 0; j < numOfRequiredParameters; j++, i++) {
+      ParameterElementImpl parameter = new ParameterElementImpl("", 0);
+      parameter.type = dynamicType;
+      parameter.parameterKind = ParameterKind.REQUIRED;
+      parameters[i] = parameter;
+    }
+    for (int k = 0; k < numOfPositionalParameters; k++, i++) {
+      ParameterElementImpl parameter = new ParameterElementImpl("", 0);
+      parameter.type = dynamicType;
+      parameter.parameterKind = ParameterKind.POSITIONAL;
+      parameters[i] = parameter;
+    }
+    for (int m = 0; m < namedParameters.length; m++, i++) {
+      ParameterElementImpl parameter =
+          new ParameterElementImpl(namedParameters[m], 0);
+      parameter.type = dynamicType;
+      parameter.parameterKind = ParameterKind.NAMED;
+      parameters[i] = parameter;
+    }
+    executable.returnType = dynamicType;
+    executable.parameters = parameters;
+    FunctionTypeImpl methodType = new FunctionTypeImpl.con1(executable);
+    executable.type = methodType;
+    return executable;
+  }
+
+  /**
+   * Given some [ExecutableElement], return the list of named parameters.
+   */
+  static List<String>
+      _getNamedParameterNames(ExecutableElement executableElement) {
+    List<String> namedParameterNames = new List<String>();
+    List<ParameterElement> parameters = executableElement.parameters;
+    for (int i = 0; i < parameters.length; i++) {
+      ParameterElement parameterElement = parameters[i];
+      if (parameterElement.parameterKind == ParameterKind.NAMED) {
+        namedParameterNames.add(parameterElement.name);
+      }
+    }
+    return namedParameterNames;
+  }
+
+  /**
+   * Given some [ExecutableElement] return the number of parameters of the specified kind.
+   */
+  static int _getNumOfParameters(ExecutableElement executableElement,
+      ParameterKind parameterKind) {
+    int parameterCount = 0;
+    List<ParameterElement> parameters = executableElement.parameters;
+    for (int i = 0; i < parameters.length; i++) {
+      ParameterElement parameterElement = parameters[i];
+      if (parameterElement.parameterKind == parameterKind) {
+        parameterCount++;
+      }
+    }
+    return parameterCount;
+  }
+
+  /**
+   * Given some [ExecutableElement] return the number of positional parameters.
+   *
+   * Note: by positional we mean [ParameterKind.REQUIRED] or [ParameterKind.POSITIONAL].
+   */
+  static int
+      _getNumOfPositionalParameters(ExecutableElement executableElement) =>
+      _getNumOfParameters(executableElement, ParameterKind.REQUIRED) +
+          _getNumOfParameters(executableElement, ParameterKind.POSITIONAL);
+
+  /**
+   * Given some [ExecutableElement] return the number of required parameters.
+   */
+  static int _getNumOfRequiredParameters(ExecutableElement executableElement) =>
+      _getNumOfParameters(executableElement, ParameterKind.REQUIRED);
+
+  /**
+   * Given some [ExecutableElement] returns `true` if it is an abstract member of a
+   * class.
+   *
+   * @param executableElement some [ExecutableElement] to evaluate
+   * @return `true` if the given element is an abstract member of a class
+   */
+  static bool _isAbstract(ExecutableElement executableElement) {
+    if (executableElement is MethodElement) {
+      return executableElement.isAbstract;
+    } else if (executableElement is PropertyAccessorElement) {
+      return executableElement.isAbstract;
+    }
+    return false;
+  }
+}
+
+/**
+ * This enum holds one of four states of a field initialization state through a constructor
+ * signature, not initialized, initialized in the field declaration, initialized in the field
+ * formal, and finally, initialized in the initializers list.
+ */
+class INIT_STATE extends Enum<INIT_STATE> {
+  static const INIT_STATE NOT_INIT = const INIT_STATE('NOT_INIT', 0);
+
+  static const INIT_STATE INIT_IN_DECLARATION =
+      const INIT_STATE('INIT_IN_DECLARATION', 1);
+
+  static const INIT_STATE INIT_IN_FIELD_FORMAL =
+      const INIT_STATE('INIT_IN_FIELD_FORMAL', 2);
+
+  static const INIT_STATE INIT_IN_INITIALIZERS =
+      const INIT_STATE('INIT_IN_INITIALIZERS', 3);
+
+  static const List<INIT_STATE> values = const [
+      NOT_INIT,
+      INIT_IN_DECLARATION,
+      INIT_IN_FIELD_FORMAL,
+      INIT_IN_INITIALIZERS];
+
+  const INIT_STATE(String name, int ordinal) : super(name, ordinal);
 }
 
 /**
@@ -7294,49 +7296,28 @@
   /**
    * The element to which the label resolves.
    */
-  final LabelElement _element;
+  final LabelElement element;
 
   /**
-   * The marker used to look up a label element for an unlabeled `break` or `continue`.
+   * The AST node to which the label resolves.
    */
-  static String EMPTY_LABEL = "";
+  final AstNode node;
 
   /**
-   * The label element returned for scopes that can be the target of an unlabeled `break` or
-   * `continue`.
+   * Initialize a newly created scope to represent the label [_label].
+   * [_outerScope] is the scope enclosing the new label scope.  [node] is the
+   * AST node the label resolves to.  [element] is the element the label
+   * resolves to.
    */
-  static SimpleIdentifier _EMPTY_LABEL_IDENTIFIER = new SimpleIdentifier(new sc.StringToken(sc.TokenType.IDENTIFIER, "", 0));
+  LabelScope(this._outerScope, this._label, this.node, this.element);
 
   /**
-   * Initialize a newly created scope to represent the potential target of an unlabeled
-   * `break` or `continue`.
-   *
-   * @param outerScope the label scope enclosing the new label scope
-   * @param onSwitchStatement `true` if this label is associated with a `switch`
-   *          statement
-   * @param onSwitchMember `true` if this label is associated with a `switch` member
+   * Return the LabelScope which defines [targetLabel], or `null` if it is not
+   * defined in this scope.
    */
-  LabelScope.con1(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) : this.con2(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
-
-  /**
-   * Initialize a newly created scope to represent the given label.
-   *
-   * @param outerScope the label scope enclosing the new label scope
-   * @param label the label defined in this scope
-   * @param element the element to which the label resolves
-   */
-  LabelScope.con2(this._outerScope, this._label, this._element);
-
-  /**
-   * Return the label element corresponding to the given label, or `null` if the given label
-   * is not defined in this scope.
-   *
-   * @param targetLabel the label being looked up
-   * @return the label element corresponding to the given label
-   */
-  LabelElement lookup(String targetLabel) {
+  LabelScope lookup(String targetLabel) {
     if (_label == targetLabel) {
-      return _element;
+      return this;
     } else if (_outerScope != null) {
       return _outerScope.lookup(targetLabel);
     } else {
@@ -7352,6 +7333,16 @@
  */
 class Library {
   /**
+   * An empty list that can be used to initialize lists of libraries.
+   */
+  static const List<Library> _EMPTY_ARRAY = const <Library>[];
+
+  /**
+   * The prefix of a URI using the dart-ext scheme to reference a native code library.
+   */
+  static String _DART_EXT_SCHEME = "dart-ext:";
+
+  /**
    * The analysis context in which this library is being analyzed.
    */
   final InternalAnalysisContext _analysisContext;
@@ -7384,7 +7375,8 @@
   /**
    * A table mapping URI-based directive to the actual URI value.
    */
-  HashMap<UriBasedDirective, String> _directiveUris = new HashMap<UriBasedDirective, String>();
+  HashMap<UriBasedDirective, String> _directiveUris =
+      new HashMap<UriBasedDirective, String>();
 
   /**
    * A flag indicating whether this library explicitly imports core.
@@ -7400,7 +7392,8 @@
    * A table mapping the sources for the compilation units in this library to their corresponding
    * AST structures.
    */
-  HashMap<Source, CompilationUnit> _astMap = new HashMap<Source, CompilationUnit>();
+  HashMap<Source, CompilationUnit> _astMap =
+      new HashMap<Source, CompilationUnit>();
 
   /**
    * The library scope used when resolving elements within this library's compilation units.
@@ -7408,16 +7401,6 @@
   LibraryScope _libraryScope;
 
   /**
-   * An empty array that can be used to initialize lists of libraries.
-   */
-  static List<Library> _EMPTY_ARRAY = new List<Library>(0);
-
-  /**
-   * The prefix of a URI using the dart-ext scheme to reference a native code library.
-   */
-  static String _DART_EXT_SCHEME = "dart-ext:";
-
-  /**
    * Initialize a newly created data holder that can maintain the data associated with a library.
    *
    * @param analysisContext the analysis context in which this library is being analyzed
@@ -7425,23 +7408,8 @@
    * @param librarySource the source specifying the defining compilation unit of this library
    */
   Library(this._analysisContext, this._errorListener, this.librarySource) {
-    this._libraryElement = _analysisContext.getLibraryElement(librarySource) as LibraryElementImpl;
-  }
-
-  /**
-   * Return the AST structure associated with the given source.
-   *
-   * @param source the source representing the compilation unit whose AST is to be returned
-   * @return the AST structure associated with the given source
-   * @throws AnalysisException if an AST structure could not be created for the compilation unit
-   */
-  CompilationUnit getAST(Source source) {
-    CompilationUnit unit = _astMap[source];
-    if (unit == null) {
-      unit = _analysisContext.computeResolvableCompilationUnit(source);
-      _astMap[source] = unit;
-    }
-    return unit;
+    this._libraryElement =
+        _analysisContext.getLibraryElement(librarySource) as LibraryElementImpl;
   }
 
   /**
@@ -7480,6 +7448,15 @@
   CompilationUnit get definingCompilationUnit => getAST(librarySource);
 
   /**
+   * Set the libraries that are exported by this library to be those in the given array.
+   *
+   * @param exportedLibraries the libraries that are exported by this library
+   */
+  void set exportedLibraries(List<Library> exportedLibraries) {
+    this._exportedLibraries = exportedLibraries;
+  }
+
+  /**
    * Return an array containing the libraries that are exported from this library.
    *
    * @return an array containing the libraries that are exported from this library
@@ -7487,6 +7464,15 @@
   List<Library> get exports => _exportedLibraries;
 
   /**
+   * Set the libraries that are imported into this library to be those in the given array.
+   *
+   * @param importedLibraries the libraries that are imported into this library
+   */
+  void set importedLibraries(List<Library> importedLibraries) {
+    this._importedLibraries = importedLibraries;
+  }
+
+  /**
    * Return an array containing the libraries that are imported into this library.
    *
    * @return an array containing the libraries that are imported into this library
@@ -7530,7 +7516,8 @@
   LibraryElementImpl get libraryElement {
     if (_libraryElement == null) {
       try {
-        _libraryElement = _analysisContext.computeLibraryElement(librarySource) as LibraryElementImpl;
+        _libraryElement =
+            _analysisContext.computeLibraryElement(librarySource) as LibraryElementImpl;
       } on AnalysisException catch (exception, stackTrace) {
         AnalysisEngine.instance.logger.logError(
             "Could not compute library element for ${librarySource.fullName}",
@@ -7541,6 +7528,18 @@
   }
 
   /**
+   * Set the library element representing this library to the given library element.
+   *
+   * @param libraryElement the library element representing this library
+   */
+  void set libraryElement(LibraryElementImpl libraryElement) {
+    this._libraryElement = libraryElement;
+    if (_inheritanceManager != null) {
+      _inheritanceManager.libraryElement = libraryElement;
+    }
+  }
+
+  /**
    * Return the library scope used when resolving elements within this library's compilation units.
    *
    * @return the library scope used when resolving elements within this library's compilation units
@@ -7553,6 +7552,22 @@
   }
 
   /**
+   * Return the AST structure associated with the given source.
+   *
+   * @param source the source representing the compilation unit whose AST is to be returned
+   * @return the AST structure associated with the given source
+   * @throws AnalysisException if an AST structure could not be created for the compilation unit
+   */
+  CompilationUnit getAST(Source source) {
+    CompilationUnit unit = _astMap[source];
+    if (unit == null) {
+      unit = _analysisContext.computeResolvableCompilationUnit(source);
+      _astMap[source] = unit;
+    }
+    return unit;
+  }
+
+  /**
    * Return the result of resolving the URI of the given URI-based directive against the URI of the
    * library, or `null` if the URI is not valid. If the URI is not valid, report the error.
    *
@@ -7562,25 +7577,44 @@
   Source getSource(UriBasedDirective directive) {
     StringLiteral uriLiteral = directive.uri;
     if (uriLiteral is StringInterpolation) {
-      _errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION));
+      _errorListener.onError(
+          new AnalysisError.con2(
+              librarySource,
+              uriLiteral.offset,
+              uriLiteral.length,
+              CompileTimeErrorCode.URI_WITH_INTERPOLATION));
       return null;
     }
     String uriContent = uriLiteral.stringValue.trim();
     _directiveUris[directive] = uriContent;
     uriContent = Uri.encodeFull(uriContent);
-    if (directive is ImportDirective && uriContent.startsWith(_DART_EXT_SCHEME)) {
+    if (directive is ImportDirective &&
+        uriContent.startsWith(_DART_EXT_SCHEME)) {
       _libraryElement.hasExtUri = true;
       return null;
     }
     try {
       parseUriWithException(uriContent);
-      Source source = _analysisContext.sourceFactory.resolveUri(librarySource, uriContent);
+      Source source =
+          _analysisContext.sourceFactory.resolveUri(librarySource, uriContent);
       if (!_analysisContext.exists(source)) {
-        _errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_DOES_NOT_EXIST, [uriContent]));
+        _errorListener.onError(
+            new AnalysisError.con2(
+                librarySource,
+                uriLiteral.offset,
+                uriLiteral.length,
+                CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+                [uriContent]));
       }
       return source;
     } on URISyntaxException catch (exception) {
-      _errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.INVALID_URI, [uriContent]));
+      _errorListener.onError(
+          new AnalysisError.con2(
+              librarySource,
+              uriLiteral.offset,
+              uriLiteral.length,
+              CompileTimeErrorCode.INVALID_URI,
+              [uriContent]));
     }
     return null;
   }
@@ -7600,36 +7634,6 @@
     _astMap[librarySource] = unit;
   }
 
-  /**
-   * Set the libraries that are exported by this library to be those in the given array.
-   *
-   * @param exportedLibraries the libraries that are exported by this library
-   */
-  void set exportedLibraries(List<Library> exportedLibraries) {
-    this._exportedLibraries = exportedLibraries;
-  }
-
-  /**
-   * Set the libraries that are imported into this library to be those in the given array.
-   *
-   * @param importedLibraries the libraries that are imported into this library
-   */
-  void set importedLibraries(List<Library> importedLibraries) {
-    this._importedLibraries = importedLibraries;
-  }
-
-  /**
-   * Set the library element representing this library to the given library element.
-   *
-   * @param libraryElement the library element representing this library
-   */
-  void set libraryElement(LibraryElementImpl libraryElement) {
-    this._libraryElement = libraryElement;
-    if (_inheritanceManager != null) {
-      _inheritanceManager.libraryElement = libraryElement;
-    }
-  }
-
   @override
   String toString() => librarySource.shortName;
 }
@@ -7639,6 +7643,11 @@
  */
 class LibraryElementBuilder {
   /**
+   * The name of the function used as an entry point.
+   */
+  static String ENTRY_POINT_NAME = "main";
+
+  /**
    * The analysis context in which the element model will be built.
    */
   final InternalAnalysisContext _analysisContext;
@@ -7649,11 +7658,6 @@
   final AnalysisErrorListener _errorListener;
 
   /**
-   * The name of the function used as an entry point.
-   */
-  static String ENTRY_POINT_NAME = "main";
-
-  /**
    * Initialize a newly created library element builder.
    *
    * @param analysisContext the analysis context in which the element model will be built
@@ -7672,19 +7676,23 @@
     CompilationUnitBuilder builder = new CompilationUnitBuilder();
     Source librarySource = library.librarySource;
     CompilationUnit definingCompilationUnit = library.definingCompilationUnit;
-    CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit(librarySource, definingCompilationUnit);
+    CompilationUnitElementImpl definingCompilationUnitElement =
+        builder.buildCompilationUnit(librarySource, definingCompilationUnit);
     NodeList<Directive> directives = definingCompilationUnit.directives;
     LibraryIdentifier libraryNameNode = null;
     bool hasPartDirective = false;
-    FunctionElement entryPoint = _findEntryPoint(definingCompilationUnitElement);
+    FunctionElement entryPoint =
+        _findEntryPoint(definingCompilationUnitElement);
     List<Directive> directivesToResolve = new List<Directive>();
-    List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>();
+    List<CompilationUnitElementImpl> sourcedCompilationUnits =
+        new List<CompilationUnitElementImpl>();
     for (Directive directive in directives) {
       //
-      // We do not build the elements representing the import and export directives at this point.
-      // That is not done until we get to LibraryResolver.buildDirectiveModels() because we need the
-      // LibraryElements for the referenced libraries, which might not exist at this point (due to
-      // the possibility of circular references).
+      // We do not build the elements representing the import and export
+      // directives at this point. That is not done until we get to
+      // LibraryResolver.buildDirectiveModels() because we need the
+      // LibraryElements for the referenced libraries, which might not exist at
+      // this point (due to the possibility of circular references).
       //
       if (directive is LibraryDirective) {
         if (libraryNameNode == null) {
@@ -7698,23 +7706,38 @@
         if (_analysisContext.exists(partSource)) {
           hasPartDirective = true;
           CompilationUnit partUnit = library.getAST(partSource);
-          CompilationUnitElementImpl part = builder.buildCompilationUnit(partSource, partUnit);
+          CompilationUnitElementImpl part =
+              builder.buildCompilationUnit(partSource, partUnit);
           part.uriOffset = partUri.offset;
           part.uriEnd = partUri.end;
           part.uri = partDirective.uriContent;
           //
-          // Validate that the part contains a part-of directive with the same name as the library.
+          // Validate that the part contains a part-of directive with the same
+          // name as the library.
           //
-          String partLibraryName = _getPartLibraryName(partSource, partUnit, directivesToResolve);
+          String partLibraryName =
+              _getPartLibraryName(partSource, partUnit, directivesToResolve);
           if (partLibraryName == null) {
-            _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, CompileTimeErrorCode.PART_OF_NON_PART, [partUri.toSource()]));
+            _errorListener.onError(
+                new AnalysisError.con2(
+                    librarySource,
+                    partUri.offset,
+                    partUri.length,
+                    CompileTimeErrorCode.PART_OF_NON_PART,
+                    [partUri.toSource()]));
           } else if (libraryNameNode == null) {
-            // TODO(brianwilkerson) Collect the names declared by the part. If they are all the same
-            // then we can use that name as the inferred name of the library and present it in a
-            // quick-fix.
+            // TODO(brianwilkerson) Collect the names declared by the part.
+            // If they are all the same then we can use that name as the
+            // inferred name of the library and present it in a quick-fix.
             // partLibraryNames.add(partLibraryName);
           } else if (libraryNameNode.name != partLibraryName) {
-            _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [libraryNameNode.name, partLibraryName]));
+            _errorListener.onError(
+                new AnalysisError.con2(
+                    librarySource,
+                    partUri.offset,
+                    partUri.length,
+                    StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+                    [libraryNameNode.name, partLibraryName]));
           }
           if (entryPoint == null) {
             entryPoint = _findEntryPoint(part);
@@ -7725,12 +7748,17 @@
       }
     }
     if (hasPartDirective && libraryNameNode == null) {
-      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
+      _errorListener.onError(
+          new AnalysisError.con1(
+              librarySource,
+              ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
     }
     //
     // Create and populate the library element.
     //
-    LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(_analysisContext.getContextFor(librarySource), libraryNameNode);
+    LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(
+        _analysisContext.getContextFor(librarySource),
+        libraryNameNode);
     libraryElement.definingCompilationUnit = definingCompilationUnitElement;
     if (entryPoint != null) {
       libraryElement.entryPoint = entryPoint;
@@ -7758,19 +7786,23 @@
     CompilationUnitBuilder builder = new CompilationUnitBuilder();
     Source librarySource = library.librarySource;
     CompilationUnit definingCompilationUnit = library.definingCompilationUnit;
-    CompilationUnitElementImpl definingCompilationUnitElement = builder.buildCompilationUnit(librarySource, definingCompilationUnit);
+    CompilationUnitElementImpl definingCompilationUnitElement =
+        builder.buildCompilationUnit(librarySource, definingCompilationUnit);
     NodeList<Directive> directives = definingCompilationUnit.directives;
     LibraryIdentifier libraryNameNode = null;
     bool hasPartDirective = false;
-    FunctionElement entryPoint = _findEntryPoint(definingCompilationUnitElement);
+    FunctionElement entryPoint =
+        _findEntryPoint(definingCompilationUnitElement);
     List<Directive> directivesToResolve = new List<Directive>();
-    List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>();
+    List<CompilationUnitElementImpl> sourcedCompilationUnits =
+        new List<CompilationUnitElementImpl>();
     for (Directive directive in directives) {
       //
-      // We do not build the elements representing the import and export directives at this point.
-      // That is not done until we get to LibraryResolver.buildDirectiveModels() because we need the
-      // LibraryElements for the referenced libraries, which might not exist at this point (due to
-      // the possibility of circular references).
+      // We do not build the elements representing the import and export
+      // directives at this point. That is not done until we get to
+      // LibraryResolver.buildDirectiveModels() because we need the
+      // LibraryElements for the referenced libraries, which might not exist at
+      // this point (due to the possibility of circular references).
       //
       if (directive is LibraryDirective) {
         if (libraryNameNode == null) {
@@ -7785,23 +7817,38 @@
           hasPartDirective = true;
           CompilationUnit partUnit = library.getAST(partSource);
           if (partUnit != null) {
-            CompilationUnitElementImpl part = builder.buildCompilationUnit(partSource, partUnit);
+            CompilationUnitElementImpl part =
+                builder.buildCompilationUnit(partSource, partUnit);
             part.uriOffset = partUri.offset;
             part.uriEnd = partUri.end;
             part.uri = partDirective.uriContent;
             //
-            // Validate that the part contains a part-of directive with the same name as the library.
+            // Validate that the part contains a part-of directive with the same
+            // name as the library.
             //
-            String partLibraryName = _getPartLibraryName(partSource, partUnit, directivesToResolve);
+            String partLibraryName =
+                _getPartLibraryName(partSource, partUnit, directivesToResolve);
             if (partLibraryName == null) {
-              _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, CompileTimeErrorCode.PART_OF_NON_PART, [partUri.toSource()]));
+              _errorListener.onError(
+                  new AnalysisError.con2(
+                      librarySource,
+                      partUri.offset,
+                      partUri.length,
+                      CompileTimeErrorCode.PART_OF_NON_PART,
+                      [partUri.toSource()]));
             } else if (libraryNameNode == null) {
-              // TODO(brianwilkerson) Collect the names declared by the part. If they are all the same
-              // then we can use that name as the inferred name of the library and present it in a
-              // quick-fix.
+              // TODO(brianwilkerson) Collect the names declared by the part.
+              // If they are all the same then we can use that name as the
+              // inferred name of the library and present it in a quick-fix.
               // partLibraryNames.add(partLibraryName);
             } else if (libraryNameNode.name != partLibraryName) {
-              _errorListener.onError(new AnalysisError.con2(librarySource, partUri.offset, partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [libraryNameNode.name, partLibraryName]));
+              _errorListener.onError(
+                  new AnalysisError.con2(
+                      librarySource,
+                      partUri.offset,
+                      partUri.length,
+                      StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+                      [libraryNameNode.name, partLibraryName]));
             }
             if (entryPoint == null) {
               entryPoint = _findEntryPoint(part);
@@ -7813,12 +7860,17 @@
       }
     }
     if (hasPartDirective && libraryNameNode == null) {
-      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
+      _errorListener.onError(
+          new AnalysisError.con1(
+              librarySource,
+              ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
     }
     //
     // Create and populate the library element.
     //
-    LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(_analysisContext.getContextFor(librarySource), libraryNameNode);
+    LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(
+        _analysisContext.getContextFor(librarySource),
+        libraryNameNode);
     libraryElement.definingCompilationUnit = definingCompilationUnitElement;
     if (entryPoint != null) {
       libraryElement.entryPoint = entryPoint;
@@ -7843,7 +7895,8 @@
    * @param setters the list to which setters are to be added
    * @param unit the compilation unit defining the accessors that are potentially being added
    */
-  void _collectAccessors(HashMap<String, PropertyAccessorElement> getters, List<PropertyAccessorElement> setters, CompilationUnitElement unit) {
+  void _collectAccessors(HashMap<String, PropertyAccessorElement> getters,
+      List<PropertyAccessorElement> setters, CompilationUnitElement unit) {
     for (PropertyAccessorElement accessor in unit.accessors) {
       if (accessor.isGetter) {
         if (!accessor.isSynthetic && accessor.correspondingSetter == null) {
@@ -7883,7 +7936,8 @@
    *          built
    * @return the name of the library that the given part is declared to be a part of
    */
-  String _getPartLibraryName(Source partSource, CompilationUnit partUnit, List<Directive> directivesToResolve) {
+  String _getPartLibraryName(Source partSource, CompilationUnit partUnit,
+      List<Directive> directivesToResolve) {
     for (Directive directive in partUnit.directives) {
       if (directive is PartOfDirective) {
         directivesToResolve.add(directive);
@@ -7904,7 +7958,8 @@
    * @param libraryElement the library defining the compilation units to be processed
    */
   void _patchTopLevelAccessors(LibraryElementImpl libraryElement) {
-    HashMap<String, PropertyAccessorElement> getters = new HashMap<String, PropertyAccessorElement>();
+    HashMap<String, PropertyAccessorElement> getters =
+        new HashMap<String, PropertyAccessorElement>();
     List<PropertyAccessorElement> setters = new List<PropertyAccessorElement>();
     _collectAccessors(getters, setters, libraryElement.definingCompilationUnit);
     for (CompilationUnitElement unit in libraryElement.parts) {
@@ -7913,7 +7968,8 @@
     for (PropertyAccessorElement setter in setters) {
       PropertyAccessorElement getter = getters[setter.displayName];
       if (getter != null) {
-        PropertyInducingElementImpl variable = getter.variable as PropertyInducingElementImpl;
+        PropertyInducingElementImpl variable =
+            getter.variable as PropertyInducingElementImpl;
         variable.setter = setter;
         (setter as PropertyAccessorElementImpl).variable = variable;
       }
@@ -7970,7 +8026,8 @@
   }
 
   @override
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) {
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary) {
     Element foundElement = localLookup(name, referencingLibrary);
     if (foundElement != null) {
       return foundElement;
@@ -7982,25 +8039,36 @@
         if (foundElement == null) {
           foundElement = element;
         } else if (!identical(foundElement, element)) {
-          foundElement = MultiplyDefinedElementImpl.fromElements(_definingLibrary.context, foundElement, element);
+          foundElement = MultiplyDefinedElementImpl.fromElements(
+              _definingLibrary.context,
+              foundElement,
+              element);
         }
       }
     }
     if (foundElement is MultiplyDefinedElementImpl) {
-      foundElement = _removeSdkElements(identifier, name, foundElement as MultiplyDefinedElementImpl);
+      foundElement = _removeSdkElements(
+          identifier,
+          name,
+          foundElement as MultiplyDefinedElementImpl);
     }
     if (foundElement is MultiplyDefinedElementImpl) {
       String foundEltName = foundElement.displayName;
-      List<Element> conflictingMembers = (foundElement as MultiplyDefinedElementImpl).conflictingElements;
+      List<Element> conflictingMembers =
+          (foundElement as MultiplyDefinedElementImpl).conflictingElements;
       int count = conflictingMembers.length;
       List<String> libraryNames = new List<String>(count);
       for (int i = 0; i < count; i++) {
         libraryNames[i] = _getLibraryName(conflictingMembers[i]);
       }
       libraryNames.sort();
-      errorListener.onError(new AnalysisError.con2(getSource(identifier), identifier.offset, identifier.length, StaticWarningCode.AMBIGUOUS_IMPORT, [
-          foundEltName,
-          StringUtilities.printListOfQuotedNames(libraryNames)]));
+      errorListener.onError(
+          new AnalysisError.con2(
+              getSource(identifier),
+              identifier.offset,
+              identifier.length,
+              StaticWarningCode.AMBIGUOUS_IMPORT,
+              [foundEltName, StringUtilities.printListOfQuotedNames(libraryNames)]));
       return foundElement;
     }
     if (foundElement != null) {
@@ -8022,7 +8090,8 @@
     int count = imports.length;
     _importedNamespaces = new List<Namespace>(count);
     for (int i = 0; i < count; i++) {
-      _importedNamespaces[i] = builder.createImportNamespaceForDirective(imports[i]);
+      _importedNamespaces[i] =
+          builder.createImportNamespaceForDirective(imports[i]);
     }
   }
 
@@ -8051,9 +8120,11 @@
     for (int i = 0; i < count; i++) {
       LibraryElement importedLibrary = imports[i].importedLibrary;
       if (importedLibrary != null) {
-        for (LibraryElement exportedLibrary in importedLibrary.exportedLibraries) {
+        for (LibraryElement exportedLibrary in
+            importedLibrary.exportedLibraries) {
           if (identical(exportedLibrary, library)) {
-            indirectSources.add(importedLibrary.definingCompilationUnit.displayName);
+            indirectSources.add(
+                importedLibrary.definingCompilationUnit.displayName);
           }
         }
       }
@@ -8084,7 +8155,8 @@
    * @param foundElement the element encapsulating the collection of elements
    * @return all of the elements that are not defined in the SDK
    */
-  Element _removeSdkElements(Identifier identifier, String name, MultiplyDefinedElementImpl foundElement) {
+  Element _removeSdkElements(Identifier identifier, String name,
+      MultiplyDefinedElementImpl foundElement) {
     List<Element> conflictingMembers = foundElement.conflictingElements;
     int length = conflictingMembers.length;
     int to = 0;
@@ -8099,7 +8171,13 @@
     if (sdkElement != null && to > 0) {
       String sdkLibName = _getLibraryName(sdkElement);
       String otherLibName = _getLibraryName(conflictingMembers[0]);
-      errorListener.onError(new AnalysisError.con2(getSource(identifier), identifier.offset, identifier.length, StaticWarningCode.CONFLICTING_DART_IMPORT, [name, sdkLibName, otherLibName]));
+      errorListener.onError(
+          new AnalysisError.con2(
+              getSource(identifier),
+              identifier.offset,
+              identifier.length,
+              StaticWarningCode.CONFLICTING_DART_IMPORT,
+              [name, sdkLibName, otherLibName]));
     }
     if (to == length) {
       // None of the members were removed
@@ -8109,7 +8187,8 @@
       return conflictingMembers[0];
     } else if (to == 0) {
       // All members were removed
-      AnalysisEngine.instance.logger.logInformation("Multiply defined SDK element: $foundElement");
+      AnalysisEngine.instance.logger.logInformation(
+          "Multiply defined SDK element: $foundElement");
       return foundElement;
     }
     List<Element> remaining = new List<Element>(to);
@@ -8167,7 +8246,8 @@
    */
   LibraryResolver(this.analysisContext) {
     this._errorListener = new RecordingErrorListener();
-    _coreLibrarySource = analysisContext.sourceFactory.forUri(DartSdk.DART_CORE);
+    _coreLibrarySource =
+        analysisContext.sourceFactory.forUri(DartSdk.DART_CORE);
   }
 
   /**
@@ -8185,6 +8265,21 @@
   Set<Library> get resolvedLibraries => _librariesInCycles;
 
   /**
+   * Create an object to represent the information about the library defined by the compilation unit
+   * with the given source.
+   *
+   * @param librarySource the source of the library's defining compilation unit
+   * @return the library object that was created
+   * @throws AnalysisException if the library source is not valid
+   */
+  Library createLibrary(Source librarySource) {
+    Library library =
+        new Library(analysisContext, _errorListener, librarySource);
+    _libraryMap[librarySource] = library;
+    return library;
+  }
+
+  /**
    * Resolve the library specified by the given source in the given context. The library is assumed
    * to be embedded in the given source.
    *
@@ -8195,21 +8290,27 @@
    * @return the element representing the resolved library
    * @throws AnalysisException if the library could not be resolved for some reason
    */
-  LibraryElement resolveEmbeddedLibrary(Source librarySource, CompilationUnit unit, bool fullAnalysis) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.LibraryResolver.resolveEmbeddedLibrary");
+  LibraryElement resolveEmbeddedLibrary(Source librarySource,
+      CompilationUnit unit, bool fullAnalysis) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.LibraryResolver.resolveEmbeddedLibrary");
     try {
       instrumentation.metric("fullAnalysis", fullAnalysis);
       instrumentation.data3("fullName", librarySource.fullName);
       //
-      // Create the objects representing the library being resolved and the core library.
+      // Create the objects representing the library being resolved and the core
+      // library.
       //
       Library targetLibrary = _createLibraryWithUnit(librarySource, unit);
       _coreLibrary = _libraryMap[_coreLibrarySource];
       if (_coreLibrary == null) {
-        // This will be true unless the library being analyzed is the core library.
+        // This will be true unless the library being analyzed is the core
+        // library.
         _coreLibrary = createLibrary(_coreLibrarySource);
         if (_coreLibrary == null) {
-          LibraryResolver2.missingCoreLibrary(analysisContext, _coreLibrarySource);
+          LibraryResolver2.missingCoreLibrary(
+              analysisContext,
+              _coreLibrarySource);
         }
       }
       instrumentation.metric3("createLibrary", "complete");
@@ -8219,18 +8320,20 @@
       _computeEmbeddedLibraryDependencies(targetLibrary, unit);
       _librariesInCycles = _computeLibrariesInCycles(targetLibrary);
       //
-      // Build the element models representing the libraries being resolved. This is done in three
-      // steps:
+      // Build the element models representing the libraries being resolved.
+      // This is done in three steps:
       //
-      // 1. Build the basic element models without making any connections between elements other than
-      //    the basic parent/child relationships. This includes building the elements representing the
-      //    libraries.
-      // 2. Build the elements for the import and export directives. This requires that we have the
-      //    elements built for the referenced libraries, but because of the possibility of circular
-      //    references needs to happen after all of the library elements have been created.
-      // 3. Build the rest of the type model by connecting superclasses, mixins, and interfaces. This
-      //    requires that we be able to compute the names visible in the libraries being resolved,
-      //    which in turn requires that we have resolved the import directives.
+      // 1. Build the basic element models without making any connections
+      //    between elements other than the basic parent/child relationships.
+      //    This includes building the elements representing the libraries.
+      // 2. Build the elements for the import and export directives. This
+      //    requires that we have the elements built for the referenced
+      //    libraries, but because of the possibility of circular references
+      //    needs to happen after all of the library elements have been created.
+      // 3. Build the rest of the type model by connecting superclasses, mixins,
+      //    and interfaces. This requires that we be able to compute the names
+      //    visible in the libraries being resolved, which in turn requires that
+      //    we have resolved the import directives.
       //
       _buildElementModels();
       instrumentation.metric3("buildElementModels", "complete");
@@ -8247,11 +8350,13 @@
       //
       // Perform resolution and type analysis.
       //
-      // TODO(brianwilkerson) Decide whether we want to resolve all of the libraries or whether we
-      // want to only resolve the target library. The advantage to resolving everything is that we
-      // have already done part of the work so we'll avoid duplicated effort. The disadvantage of
-      // resolving everything is that we might do extra work that we don't really care about. Another
-      // possibility is to add a parameter to this method and punt the decision to the clients.
+      // TODO(brianwilkerson) Decide whether we want to resolve all of the
+      // libraries or whether we want to only resolve the target library.
+      // The advantage to resolving everything is that we have already done part
+      // of the work so we'll avoid duplicated effort. The disadvantage of
+      // resolving everything is that we might do extra work that we don't
+      // really care about. Another possibility is to add a parameter to this
+      // method and punt the decision to the clients.
       //
       //if (analyzeAll) {
       _resolveReferencesAndTypes();
@@ -8281,20 +8386,25 @@
    * @throws AnalysisException if the library could not be resolved for some reason
    */
   LibraryElement resolveLibrary(Source librarySource, bool fullAnalysis) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.LibraryResolver.resolveLibrary");
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.LibraryResolver.resolveLibrary");
     try {
       instrumentation.metric("fullAnalysis", fullAnalysis);
       instrumentation.data3("fullName", librarySource.fullName);
       //
-      // Create the objects representing the library being resolved and the core library.
+      // Create the objects representing the library being resolved and the core
+      // library.
       //
       Library targetLibrary = createLibrary(librarySource);
       _coreLibrary = _libraryMap[_coreLibrarySource];
       if (_coreLibrary == null) {
-        // This will be true unless the library being analyzed is the core library.
+        // This will be true unless the library being analyzed is the core
+        // library.
         _coreLibrary = _createLibraryOrNull(_coreLibrarySource);
         if (_coreLibrary == null) {
-          LibraryResolver2.missingCoreLibrary(analysisContext, _coreLibrarySource);
+          LibraryResolver2.missingCoreLibrary(
+              analysisContext,
+              _coreLibrarySource);
         }
       }
       instrumentation.metric3("createLibrary", "complete");
@@ -8304,19 +8414,22 @@
       _computeLibraryDependencies(targetLibrary);
       _librariesInCycles = _computeLibrariesInCycles(targetLibrary);
       //
-      // Build the element models representing the libraries being resolved. This is done in three
-      // steps:
+      // Build the element models representing the libraries being resolved.
+      // This is done in three steps:
       //
-      // 1. Build the basic element models without making any connections between elements other
-      //    than the basic parent/child relationships. This includes building the elements
-      //    representing the libraries, but excludes members defined in enums.
-      // 2. Build the elements for the import and export directives. This requires that we have the
-      //    elements built for the referenced libraries, but because of the possibility of circular
-      //    references needs to happen after all of the library elements have been created.
+      // 1. Build the basic element models without making any connections
+      //    between elements other than the basic parent/child relationships.
+      //    This includes building the elements representing the libraries, but
+      //    excludes members defined in enums.
+      // 2. Build the elements for the import and export directives. This
+      //    requires that we have the elements built for the referenced
+      //    libraries, but because of the possibility of circular references
+      //    needs to happen after all of the library elements have been created.
       // 3. Build the members in enum declarations.
-      // 4. Build the rest of the type model by connecting superclasses, mixins, and interfaces. This
-      //    requires that we be able to compute the names visible in the libraries being resolved,
-      //    which in turn requires that we have resolved the import directives.
+      // 4. Build the rest of the type model by connecting superclasses, mixins,
+      //    and interfaces. This requires that we be able to compute the names
+      //    visible in the libraries being resolved, which in turn requires that
+      //    we have resolved the import directives.
       //
       _buildElementModels();
       instrumentation.metric3("buildElementModels", "complete");
@@ -8335,11 +8448,13 @@
       //
       // Perform resolution and type analysis.
       //
-      // TODO(brianwilkerson) Decide whether we want to resolve all of the libraries or whether we
-      // want to only resolve the target library. The advantage to resolving everything is that we
-      // have already done part of the work so we'll avoid duplicated effort. The disadvantage of
-      // resolving everything is that we might do extra work that we don't really care about. Another
-      // possibility is to add a parameter to this method and punt the decision to the clients.
+      // TODO(brianwilkerson) Decide whether we want to resolve all of the
+      // libraries or whether we want to only resolve the target library. The
+      // advantage to resolving everything is that we have already done part of
+      // the work so we'll avoid duplicated effort. The disadvantage of
+      // resolving everything is that we might do extra work that we don't
+      // really care about. Another possibility is to add a parameter to this
+      // method and punt the decision to the clients.
       //
       //if (analyzeAll) {
       _resolveReferencesAndTypes();
@@ -8351,7 +8466,9 @@
       instrumentation.metric3("performConstantEvaluation", "complete");
       instrumentation.metric2("librariesInCycles", _librariesInCycles.length);
       for (Library lib in _librariesInCycles) {
-        instrumentation.metric2("librariesInCycles-CompilationUnitSources-Size", lib.compilationUnitSources.length);
+        instrumentation.metric2(
+            "librariesInCycles-CompilationUnitSources-Size",
+            lib.compilationUnitSources.length);
       }
       return targetLibrary.libraryElement;
     } finally {
@@ -8361,27 +8478,14 @@
   }
 
   /**
-   * Create an object to represent the information about the library defined by the compilation unit
-   * with the given source.
-   *
-   * @param librarySource the source of the library's defining compilation unit
-   * @return the library object that was created
-   * @throws AnalysisException if the library source is not valid
-   */
-  Library createLibrary(Source librarySource) {
-    Library library = new Library(analysisContext, _errorListener, librarySource);
-    _libraryMap[librarySource] = library;
-    return library;
-  }
-
-  /**
    * Add a dependency to the given map from the referencing library to the referenced library.
    *
    * @param dependencyMap the map to which the dependency is to be added
    * @param referencingLibrary the library that references the referenced library
    * @param referencedLibrary the library referenced by the referencing library
    */
-  void _addDependencyToMap(HashMap<Library, List<Library>> dependencyMap, Library referencingLibrary, Library referencedLibrary) {
+  void _addDependencyToMap(HashMap<Library, List<Library>> dependencyMap,
+      Library referencingLibrary, Library referencedLibrary) {
     List<Library> dependentLibraries = dependencyMap[referencedLibrary];
     if (dependentLibraries == null) {
       dependentLibraries = new List<Library>();
@@ -8400,12 +8504,16 @@
    * @param dependencyMap a table mapping libraries to the collection of libraries from which those
    *          libraries are referenced
    */
-  void _addLibrariesInCycle(Library library, Set<Library> librariesInCycle, HashMap<Library, List<Library>> dependencyMap) {
+  void _addLibrariesInCycle(Library library, Set<Library> librariesInCycle,
+      HashMap<Library, List<Library>> dependencyMap) {
     if (librariesInCycle.add(library)) {
       List<Library> dependentLibraries = dependencyMap[library];
       if (dependentLibraries != null) {
         for (Library dependentLibrary in dependentLibraries) {
-          _addLibrariesInCycle(dependentLibrary, librariesInCycle, dependencyMap);
+          _addLibrariesInCycle(
+              dependentLibrary,
+              librariesInCycle,
+              dependencyMap);
         }
       }
     }
@@ -8420,7 +8528,8 @@
    * @param visitedLibraries the libraries that have already been visited, used to prevent infinite
    *          recursion
    */
-  void _addToDependencyMap(Library library, HashMap<Library, List<Library>> dependencyMap, Set<Library> visitedLibraries) {
+  void _addToDependencyMap(Library library, HashMap<Library,
+      List<Library>> dependencyMap, Set<Library> visitedLibraries) {
     if (visitedLibraries.add(library)) {
       for (Library referencedLibrary in library.importsAndExports) {
         _addDependencyToMap(dependencyMap, library, referencedLibrary);
@@ -8449,7 +8558,8 @@
         ShowElementCombinatorImpl show = new ShowElementCombinatorImpl();
         show.offset = combinator.offset;
         show.end = combinator.end;
-        show.shownNames = _getIdentifiers((combinator as ShowCombinator).shownNames);
+        show.shownNames =
+            _getIdentifiers((combinator as ShowCombinator).shownNames);
         combinators.add(show);
       }
     }
@@ -8465,7 +8575,8 @@
    */
   void _buildDirectiveModels() {
     for (Library library in _librariesInCycles) {
-      HashMap<String, PrefixElementImpl> nameToPrefixMap = new HashMap<String, PrefixElementImpl>();
+      HashMap<String, PrefixElementImpl> nameToPrefixMap =
+          new HashMap<String, PrefixElementImpl>();
       List<ImportElement> imports = new List<ImportElement>();
       List<ExportElement> exports = new List<ExportElement>();
       for (Directive directive in library.definingCompilationUnit.directives) {
@@ -8477,17 +8588,20 @@
           }
           Source importedSource = importDirective.source;
           if (importedSource != null) {
-            // The imported source will be null if the URI in the import directive was invalid.
+            // The imported source will be null if the URI in the import
+            // directive was invalid.
             Library importedLibrary = _libraryMap[importedSource];
             if (importedLibrary != null) {
-              ImportElementImpl importElement = new ImportElementImpl(directive.offset);
+              ImportElementImpl importElement =
+                  new ImportElementImpl(directive.offset);
               StringLiteral uriLiteral = importDirective.uri;
               importElement.uriOffset = uriLiteral.offset;
               importElement.uriEnd = uriLiteral.end;
               importElement.uri = uriContent;
               importElement.deferred = importDirective.deferredToken != null;
               importElement.combinators = _buildCombinators(importDirective);
-              LibraryElement importedLibraryElement = importedLibrary.libraryElement;
+              LibraryElement importedLibraryElement =
+                  importedLibrary.libraryElement;
               if (importedLibraryElement != null) {
                 importElement.importedLibrary = importedLibraryElement;
               }
@@ -8505,9 +8619,18 @@
               }
               directive.element = importElement;
               imports.add(importElement);
-              if (analysisContext.computeKindOf(importedSource) != SourceKind.LIBRARY) {
-                ErrorCode errorCode = (importElement.isDeferred ? StaticWarningCode.IMPORT_OF_NON_LIBRARY : CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY);
-                _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, errorCode, [uriLiteral.toSource()]));
+              if (analysisContext.computeKindOf(importedSource) !=
+                  SourceKind.LIBRARY) {
+                ErrorCode errorCode = (importElement.isDeferred ?
+                    StaticWarningCode.IMPORT_OF_NON_LIBRARY :
+                    CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY);
+                _errorListener.onError(
+                    new AnalysisError.con2(
+                        library.librarySource,
+                        uriLiteral.offset,
+                        uriLiteral.length,
+                        errorCode,
+                        [uriLiteral.toSource()]));
               }
             }
           }
@@ -8515,7 +8638,8 @@
           ExportDirective exportDirective = directive;
           Source exportedSource = exportDirective.source;
           if (exportedSource != null) {
-            // The exported source will be null if the URI in the export directive was invalid.
+            // The exported source will be null if the URI in the export
+            // directive was invalid.
             Library exportedLibrary = _libraryMap[exportedSource];
             if (exportedLibrary != null) {
               ExportElementImpl exportElement = new ExportElementImpl();
@@ -8524,21 +8648,30 @@
               exportElement.uriEnd = uriLiteral.end;
               exportElement.uri = exportDirective.uriContent;
               exportElement.combinators = _buildCombinators(exportDirective);
-              LibraryElement exportedLibraryElement = exportedLibrary.libraryElement;
+              LibraryElement exportedLibraryElement =
+                  exportedLibrary.libraryElement;
               if (exportedLibraryElement != null) {
                 exportElement.exportedLibrary = exportedLibraryElement;
               }
               directive.element = exportElement;
               exports.add(exportElement);
-              if (analysisContext.computeKindOf(exportedSource) != SourceKind.LIBRARY) {
-                _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, [uriLiteral.toSource()]));
+              if (analysisContext.computeKindOf(exportedSource) !=
+                  SourceKind.LIBRARY) {
+                _errorListener.onError(
+                    new AnalysisError.con2(
+                        library.librarySource,
+                        uriLiteral.offset,
+                        uriLiteral.length,
+                        CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
+                        [uriLiteral.toSource()]));
               }
             }
           }
         }
       }
       Source librarySource = library.librarySource;
-      if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource) {
+      if (!library.explicitlyImportsCore &&
+          _coreLibrarySource != librarySource) {
         ImportElementImpl importElement = new ImportElementImpl(-1);
         importElement.importedLibrary = _coreLibrary.libraryElement;
         importElement.synthetic = true;
@@ -8548,7 +8681,8 @@
       libraryElement.imports = imports;
       libraryElement.exports = exports;
       if (libraryElement.entryPoint == null) {
-        Namespace namespace = new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
+        Namespace namespace =
+            new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
         Element element = namespace.get(LibraryElementBuilder.ENTRY_POINT_NAME);
         if (element is FunctionElement) {
           libraryElement.entryPoint = element;
@@ -8564,7 +8698,8 @@
    */
   void _buildElementModels() {
     for (Library library in _librariesInCycles) {
-      LibraryElementBuilder builder = new LibraryElementBuilder(analysisContext, errorListener);
+      LibraryElementBuilder builder =
+          new LibraryElementBuilder(analysisContext, errorListener);
       LibraryElementImpl libraryElement = builder.buildLibrary(library);
       library.libraryElement = libraryElement;
     }
@@ -8578,7 +8713,8 @@
    * @throws AnalysisException if any of the enum members could not be built
    */
   void _buildEnumMembers() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
@@ -8598,11 +8734,13 @@
    * @throws AnalysisException if any of the type hierarchies could not be resolved
    */
   void _buildImplicitConstructors() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
-          ImplicitConstructorBuilder visitor = new ImplicitConstructorBuilder.con1(library, source, _typeProvider);
+          ImplicitConstructorBuilder visitor =
+              new ImplicitConstructorBuilder.con1(library, source, _typeProvider);
           library.getAST(source).accept(visitor);
         }
       }
@@ -8618,23 +8756,27 @@
    * @throws AnalysisException if any of the function type aliases could not be resolved
    */
   void _buildTypeAliases() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
-      List<LibraryResolver_TypeAliasInfo> typeAliases = new List<LibraryResolver_TypeAliasInfo>();
+      List<LibraryResolver_TypeAliasInfo> typeAliases =
+          new List<LibraryResolver_TypeAliasInfo>();
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
           CompilationUnit ast = library.getAST(source);
           for (CompilationUnitMember member in ast.declarations) {
             if (member is FunctionTypeAlias) {
-              typeAliases.add(new LibraryResolver_TypeAliasInfo(library, source, member));
+              typeAliases.add(
+                  new LibraryResolver_TypeAliasInfo(library, source, member));
             }
           }
         }
       }
-      // TODO(brianwilkerson) We need to sort the type aliases such that all aliases referenced by
-      // an alias T are resolved before we resolve T.
+      // TODO(brianwilkerson) We need to sort the type aliases such that all
+      // aliases referenced by an alias T are resolved before we resolve T.
       for (LibraryResolver_TypeAliasInfo info in typeAliases) {
-        TypeResolverVisitor visitor = new TypeResolverVisitor.con1(info._library, info._source, _typeProvider);
+        TypeResolverVisitor visitor =
+            new TypeResolverVisitor.con1(info._library, info._source, _typeProvider);
         info._typeAlias.accept(visitor);
       }
     } finally {
@@ -8649,11 +8791,13 @@
    * @throws AnalysisException if any of the type hierarchies could not be resolved
    */
   void _buildTypeHierarchies() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
-          TypeResolverVisitor visitor = new TypeResolverVisitor.con1(library, source, _typeProvider);
+          TypeResolverVisitor visitor =
+              new TypeResolverVisitor.con1(library, source, _typeProvider);
           library.getAST(source).accept(visitor);
         }
       }
@@ -8674,7 +8818,8 @@
    * @param library the library currently being added to the dependency map
    */
   HashMap<Library, List<Library>> _computeDependencyMap(Library library) {
-    HashMap<Library, List<Library>> dependencyMap = new HashMap<Library, List<Library>>();
+    HashMap<Library, List<Library>> dependencyMap =
+        new HashMap<Library, List<Library>>();
     _addToDependencyMap(library, dependencyMap, new HashSet<Library>());
     return dependencyMap;
   }
@@ -8686,7 +8831,8 @@
    * @param library the library to be processed to find libraries that have not yet been traversed
    * @throws AnalysisException if some portion of the library graph could not be traversed
    */
-  void _computeEmbeddedLibraryDependencies(Library library, CompilationUnit unit) {
+  void _computeEmbeddedLibraryDependencies(Library library,
+      CompilationUnit unit) {
     Source librarySource = library.librarySource;
     HashSet<Source> exportedSources = new HashSet<Source>();
     HashSet<Source> importedSources = new HashSet<Source>();
@@ -8703,7 +8849,10 @@
         }
       }
     }
-    _computeLibraryDependenciesFromDirectives(library, new List.from(importedSources), new List.from(exportedSources));
+    _computeLibraryDependenciesFromDirectives(
+        library,
+        new List.from(importedSources),
+        new List.from(exportedSources));
   }
 
   /**
@@ -8715,7 +8864,8 @@
    *         back to the given library
    */
   Set<Library> _computeLibrariesInCycles(Library library) {
-    HashMap<Library, List<Library>> dependencyMap = _computeDependencyMap(library);
+    HashMap<Library, List<Library>> dependencyMap =
+        _computeDependencyMap(library);
     Set<Library> librariesInCycle = new HashSet<Library>();
     _addLibrariesInCycle(library, librariesInCycle, dependencyMap);
     return librariesInCycle;
@@ -8730,7 +8880,10 @@
    */
   void _computeLibraryDependencies(Library library) {
     Source librarySource = library.librarySource;
-    _computeLibraryDependenciesFromDirectives(library, analysisContext.computeImportedLibraries(librarySource), analysisContext.computeExportedLibraries(librarySource));
+    _computeLibraryDependenciesFromDirectives(
+        library,
+        analysisContext.computeImportedLibraries(librarySource),
+        analysisContext.computeExportedLibraries(librarySource));
   }
 
   /**
@@ -8742,7 +8895,8 @@
    * @param exportedSources an array containing the sources that are exported from the given library
    * @throws AnalysisException if some portion of the library graph could not be traversed
    */
-  void _computeLibraryDependenciesFromDirectives(Library library, List<Source> importedSources, List<Source> exportedSources) {
+  void _computeLibraryDependenciesFromDirectives(Library library,
+      List<Source> importedSources, List<Source> exportedSources) {
     List<Library> importedLibraries = new List<Library>();
     bool explicitlyImportsCore = false;
     for (Source importedSource in importedSources) {
@@ -8799,7 +8953,8 @@
     if (!analysisContext.exists(librarySource)) {
       return null;
     }
-    Library library = new Library(analysisContext, _errorListener, librarySource);
+    Library library =
+        new Library(analysisContext, _errorListener, librarySource);
     _libraryMap[librarySource] = library;
     return library;
   }
@@ -8814,7 +8969,8 @@
    * @throws AnalysisException if the library source is not valid
    */
   Library _createLibraryWithUnit(Source librarySource, CompilationUnit unit) {
-    Library library = new Library(analysisContext, _errorListener, librarySource);
+    Library library =
+        new Library(analysisContext, _errorListener, librarySource);
     library.setDefiningCompilationUnit(unit);
     _libraryMap[librarySource] = library;
     return library;
@@ -8839,9 +8995,11 @@
    * Compute a value for all of the constants in the libraries being analyzed.
    */
   void _performConstantEvaluation() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
-      ConstantValueComputer computer = new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
+      ConstantValueComputer computer =
+          new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
           try {
@@ -8863,15 +9021,15 @@
         for (Source source in library.compilationUnitSources) {
           try {
             CompilationUnit unit = library.getAST(source);
-            ErrorReporter errorReporter = new ErrorReporter(
-                _errorListener, source);
-            ConstantVerifier constantVerifier = new ConstantVerifier(
-                errorReporter, library.libraryElement, _typeProvider);
+            ErrorReporter errorReporter =
+                new ErrorReporter(_errorListener, source);
+            ConstantVerifier constantVerifier =
+                new ConstantVerifier(errorReporter, library.libraryElement, _typeProvider);
             unit.accept(constantVerifier);
           } on AnalysisException catch (exception, stackTrace) {
             AnalysisEngine.instance.logger.logError(
                 "Internal Error: Could not access AST for ${source.fullName} "
-                "during constant verification",
+                    "during constant verification",
                 new CaughtException(exception, stackTrace));
           }
         }
@@ -8901,12 +9059,15 @@
    *           the library cannot be analyzed
    */
   void _resolveReferencesAndTypesInLibrary(Library library) {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (Source source in library.compilationUnitSources) {
         CompilationUnit ast = library.getAST(source);
-        ast.accept(new VariableResolverVisitor.con1(library, source, _typeProvider));
-        ResolverVisitor visitor = new ResolverVisitor.con1(library, source, _typeProvider);
+        ast.accept(
+            new VariableResolverVisitor.con1(library, source, _typeProvider));
+        ResolverVisitor visitor =
+            new ResolverVisitor.con1(library, source, _typeProvider);
         ast.accept(visitor);
       }
     } finally {
@@ -8962,18 +9123,6 @@
  */
 class LibraryResolver2 {
   /**
-   * Report that the core library could not be resolved in the given analysis context and throw an
-   * exception.
-   *
-   * @param analysisContext the analysis context in which the failure occurred
-   * @param coreLibrarySource the source representing the core library
-   * @throws AnalysisException always
-   */
-  static void missingCoreLibrary(AnalysisContext analysisContext, Source coreLibrarySource) {
-    throw new AnalysisException("Could not resolve dart:core");
-  }
-
-  /**
    * The analysis context in which the libraries are being analyzed.
    */
   final InternalAnalysisContext analysisContext;
@@ -9003,7 +9152,8 @@
   /**
    * A table mapping library sources to the information being maintained for those libraries.
    */
-  HashMap<Source, ResolvableLibrary> _libraryMap = new HashMap<Source, ResolvableLibrary>();
+  HashMap<Source, ResolvableLibrary> _libraryMap =
+      new HashMap<Source, ResolvableLibrary>();
 
   /**
    * A collection containing the libraries that are being resolved together.
@@ -9017,7 +9167,8 @@
    */
   LibraryResolver2(this.analysisContext) {
     this._errorListener = new RecordingErrorListener();
-    _coreLibrarySource = analysisContext.sourceFactory.forUri(DartSdk.DART_CORE);
+    _coreLibrarySource =
+        analysisContext.sourceFactory.forUri(DartSdk.DART_CORE);
   }
 
   /**
@@ -9047,8 +9198,10 @@
    * @return the element representing the resolved library
    * @throws AnalysisException if the library could not be resolved for some reason
    */
-  LibraryElement resolveLibrary(Source librarySource, List<ResolvableLibrary> librariesInCycle) {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.LibraryResolver.resolveLibrary");
+  LibraryElement resolveLibrary(Source librarySource,
+      List<ResolvableLibrary> librariesInCycle) {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.LibraryResolver.resolveLibrary");
     try {
       instrumentation.data3("fullName", librarySource.fullName);
       //
@@ -9060,19 +9213,22 @@
       _coreLibrary = _libraryMap[_coreLibrarySource];
       instrumentation.metric3("buildLibraryMap", "complete");
       //
-      // Build the element models representing the libraries being resolved. This is done in three
-      // steps:
+      // Build the element models representing the libraries being resolved.
+      // This is done in three steps:
       //
-      // 1. Build the basic element models without making any connections between elements other
-      //    than the basic parent/child relationships. This includes building the elements
-      //    representing the libraries, but excludes members defined in enums.
-      // 2. Build the elements for the import and export directives. This requires that we have the
-      //    elements built for the referenced libraries, but because of the possibility of circular
-      //    references needs to happen after all of the library elements have been created.
+      // 1. Build the basic element models without making any connections
+      //    between elements other than the basic parent/child relationships.
+      //    This includes building the elements representing the libraries, but
+      //    excludes members defined in enums.
+      // 2. Build the elements for the import and export directives. This
+      //    requires that we have the elements built for the referenced
+      //    libraries, but because of the possibility of circular references
+      //    needs to happen after all of the library elements have been created.
       // 3. Build the members in enum declarations.
-      // 4. Build the rest of the type model by connecting superclasses, mixins, and interfaces. This
-      //    requires that we be able to compute the names visible in the libraries being resolved,
-      //    which in turn requires that we have resolved the import directives.
+      // 4. Build the rest of the type model by connecting superclasses, mixins,
+      //    and interfaces. This requires that we be able to compute the names
+      //    visible in the libraries being resolved, which in turn requires that
+      //    we have resolved the import directives.
       //
       _buildElementModels();
       instrumentation.metric3("buildElementModels", "complete");
@@ -9091,11 +9247,13 @@
       //
       // Perform resolution and type analysis.
       //
-      // TODO(brianwilkerson) Decide whether we want to resolve all of the libraries or whether we
-      // want to only resolve the target library. The advantage to resolving everything is that we
-      // have already done part of the work so we'll avoid duplicated effort. The disadvantage of
-      // resolving everything is that we might do extra work that we don't really care about. Another
-      // possibility is to add a parameter to this method and punt the decision to the clients.
+      // TODO(brianwilkerson) Decide whether we want to resolve all of the
+      // libraries or whether we want to only resolve the target library. The
+      // advantage to resolving everything is that we have already done part of
+      // the work so we'll avoid duplicated effort. The disadvantage of
+      // resolving everything is that we might do extra work that we don't
+      // really care about. Another possibility is to add a parameter to this
+      // method and punt the decision to the clients.
       //
       //if (analyzeAll) {
       _resolveReferencesAndTypes();
@@ -9107,7 +9265,9 @@
       instrumentation.metric3("performConstantEvaluation", "complete");
       instrumentation.metric2("librariesInCycles", librariesInCycle.length);
       for (ResolvableLibrary lib in librariesInCycle) {
-        instrumentation.metric2("librariesInCycles-CompilationUnitSources-Size", lib.compilationUnitSources.length);
+        instrumentation.metric2(
+            "librariesInCycles-CompilationUnitSources-Size",
+            lib.compilationUnitSources.length);
       }
       return targetLibrary.libraryElement;
     } finally {
@@ -9132,7 +9292,8 @@
         ShowElementCombinatorImpl show = new ShowElementCombinatorImpl();
         show.offset = combinator.offset;
         show.end = combinator.end;
-        show.shownNames = _getIdentifiers((combinator as ShowCombinator).shownNames);
+        show.shownNames =
+            _getIdentifiers((combinator as ShowCombinator).shownNames);
         combinators.add(show);
       }
     }
@@ -9148,7 +9309,8 @@
    */
   void _buildDirectiveModels() {
     for (ResolvableLibrary library in _librariesInCycle) {
-      HashMap<String, PrefixElementImpl> nameToPrefixMap = new HashMap<String, PrefixElementImpl>();
+      HashMap<String, PrefixElementImpl> nameToPrefixMap =
+          new HashMap<String, PrefixElementImpl>();
       List<ImportElement> imports = new List<ImportElement>();
       List<ExportElement> exports = new List<ExportElement>();
       for (Directive directive in library.definingCompilationUnit.directives) {
@@ -9159,11 +9321,14 @@
             library.libraryElement.hasExtUri = true;
           }
           Source importedSource = importDirective.source;
-          if (importedSource != null && analysisContext.exists(importedSource)) {
-            // The imported source will be null if the URI in the import directive was invalid.
+          if (importedSource != null &&
+              analysisContext.exists(importedSource)) {
+            // The imported source will be null if the URI in the import
+            // directive was invalid.
             ResolvableLibrary importedLibrary = _libraryMap[importedSource];
             if (importedLibrary != null) {
-              ImportElementImpl importElement = new ImportElementImpl(directive.offset);
+              ImportElementImpl importElement =
+                  new ImportElementImpl(directive.offset);
               StringLiteral uriLiteral = importDirective.uri;
               if (uriLiteral != null) {
                 importElement.uriOffset = uriLiteral.offset;
@@ -9172,7 +9337,8 @@
               importElement.uri = uriContent;
               importElement.deferred = importDirective.deferredToken != null;
               importElement.combinators = _buildCombinators(importDirective);
-              LibraryElement importedLibraryElement = importedLibrary.libraryElement;
+              LibraryElement importedLibraryElement =
+                  importedLibrary.libraryElement;
               if (importedLibraryElement != null) {
                 importElement.importedLibrary = importedLibraryElement;
               }
@@ -9190,17 +9356,28 @@
               }
               directive.element = importElement;
               imports.add(importElement);
-              if (analysisContext.computeKindOf(importedSource) != SourceKind.LIBRARY) {
-                ErrorCode errorCode = (importElement.isDeferred ? StaticWarningCode.IMPORT_OF_NON_LIBRARY : CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY);
-                _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, errorCode, [uriLiteral.toSource()]));
+              if (analysisContext.computeKindOf(importedSource) !=
+                  SourceKind.LIBRARY) {
+                ErrorCode errorCode = (importElement.isDeferred ?
+                    StaticWarningCode.IMPORT_OF_NON_LIBRARY :
+                    CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY);
+                _errorListener.onError(
+                    new AnalysisError.con2(
+                        library.librarySource,
+                        uriLiteral.offset,
+                        uriLiteral.length,
+                        errorCode,
+                        [uriLiteral.toSource()]));
               }
             }
           }
         } else if (directive is ExportDirective) {
           ExportDirective exportDirective = directive;
           Source exportedSource = exportDirective.source;
-          if (exportedSource != null && analysisContext.exists(exportedSource)) {
-            // The exported source will be null if the URI in the export directive was invalid.
+          if (exportedSource != null &&
+              analysisContext.exists(exportedSource)) {
+            // The exported source will be null if the URI in the export
+            // directive was invalid.
             ResolvableLibrary exportedLibrary = _libraryMap[exportedSource];
             if (exportedLibrary != null) {
               ExportElementImpl exportElement = new ExportElementImpl();
@@ -9211,21 +9388,30 @@
               }
               exportElement.uri = exportDirective.uriContent;
               exportElement.combinators = _buildCombinators(exportDirective);
-              LibraryElement exportedLibraryElement = exportedLibrary.libraryElement;
+              LibraryElement exportedLibraryElement =
+                  exportedLibrary.libraryElement;
               if (exportedLibraryElement != null) {
                 exportElement.exportedLibrary = exportedLibraryElement;
               }
               directive.element = exportElement;
               exports.add(exportElement);
-              if (analysisContext.computeKindOf(exportedSource) != SourceKind.LIBRARY) {
-                _errorListener.onError(new AnalysisError.con2(library.librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, [uriLiteral.toSource()]));
+              if (analysisContext.computeKindOf(exportedSource) !=
+                  SourceKind.LIBRARY) {
+                _errorListener.onError(
+                    new AnalysisError.con2(
+                        library.librarySource,
+                        uriLiteral.offset,
+                        uriLiteral.length,
+                        CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
+                        [uriLiteral.toSource()]));
               }
             }
           }
         }
       }
       Source librarySource = library.librarySource;
-      if (!library.explicitlyImportsCore && _coreLibrarySource != librarySource) {
+      if (!library.explicitlyImportsCore &&
+          _coreLibrarySource != librarySource) {
         ImportElementImpl importElement = new ImportElementImpl(-1);
         importElement.importedLibrary = _coreLibrary.libraryElement;
         importElement.synthetic = true;
@@ -9235,7 +9421,8 @@
       libraryElement.imports = imports;
       libraryElement.exports = exports;
       if (libraryElement.entryPoint == null) {
-        Namespace namespace = new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
+        Namespace namespace =
+            new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
         Element element = namespace.get(LibraryElementBuilder.ENTRY_POINT_NAME);
         if (element is FunctionElement) {
           libraryElement.entryPoint = element;
@@ -9251,7 +9438,8 @@
    */
   void _buildElementModels() {
     for (ResolvableLibrary library in _librariesInCycle) {
-      LibraryElementBuilder builder = new LibraryElementBuilder(analysisContext, errorListener);
+      LibraryElementBuilder builder =
+          new LibraryElementBuilder(analysisContext, errorListener);
       LibraryElementImpl libraryElement = builder.buildLibrary2(library);
       library.libraryElement = libraryElement;
     }
@@ -9265,7 +9453,8 @@
    * @throws AnalysisException if any of the enum members could not be built
    */
   void _buildEnumMembers() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (ResolvableLibrary library in _librariesInCycle) {
         for (Source source in library.compilationUnitSources) {
@@ -9285,13 +9474,16 @@
    * @throws AnalysisException if any of the type hierarchies could not be resolved
    */
   void _buildImplicitConstructors() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (ResolvableLibrary library in _librariesInCycle) {
-        for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
+        for (ResolvableCompilationUnit unit in
+            library.resolvableCompilationUnits) {
           Source source = unit.source;
           CompilationUnit ast = unit.compilationUnit;
-          ImplicitConstructorBuilder visitor = new ImplicitConstructorBuilder.con2(library, source, _typeProvider);
+          ImplicitConstructorBuilder visitor =
+              new ImplicitConstructorBuilder.con2(library, source, _typeProvider);
           ast.accept(visitor);
         }
       }
@@ -9301,7 +9493,8 @@
   }
 
   HashMap<Source, ResolvableLibrary> _buildLibraryMap() {
-    HashMap<Source, ResolvableLibrary> libraryMap = new HashMap<Source, ResolvableLibrary>();
+    HashMap<Source, ResolvableLibrary> libraryMap =
+        new HashMap<Source, ResolvableLibrary>();
     int libraryCount = _librariesInCycle.length;
     for (int i = 0; i < libraryCount; i++) {
       ResolvableLibrary library = _librariesInCycle[i];
@@ -9325,22 +9518,28 @@
    * @throws AnalysisException if any of the function type aliases could not be resolved
    */
   void _buildTypeAliases() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
-      List<LibraryResolver2_TypeAliasInfo> typeAliases = new List<LibraryResolver2_TypeAliasInfo>();
+      List<LibraryResolver2_TypeAliasInfo> typeAliases =
+          new List<LibraryResolver2_TypeAliasInfo>();
       for (ResolvableLibrary library in _librariesInCycle) {
-        for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
-          for (CompilationUnitMember member in unit.compilationUnit.declarations) {
+        for (ResolvableCompilationUnit unit in
+            library.resolvableCompilationUnits) {
+          for (CompilationUnitMember member in
+              unit.compilationUnit.declarations) {
             if (member is FunctionTypeAlias) {
-              typeAliases.add(new LibraryResolver2_TypeAliasInfo(library, unit.source, member));
+              typeAliases.add(
+                  new LibraryResolver2_TypeAliasInfo(library, unit.source, member));
             }
           }
         }
       }
-      // TODO(brianwilkerson) We need to sort the type aliases such that all aliases referenced by
-      // an alias T are resolved before we resolve T.
+      // TODO(brianwilkerson) We need to sort the type aliases such that all
+      // aliases referenced by an alias T are resolved before we resolve T.
       for (LibraryResolver2_TypeAliasInfo info in typeAliases) {
-        TypeResolverVisitor visitor = new TypeResolverVisitor.con4(info._library, info._source, _typeProvider);
+        TypeResolverVisitor visitor =
+            new TypeResolverVisitor.con4(info._library, info._source, _typeProvider);
         info._typeAlias.accept(visitor);
       }
     } finally {
@@ -9355,13 +9554,16 @@
    * @throws AnalysisException if any of the type hierarchies could not be resolved
    */
   void _buildTypeHierarchies() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
       for (ResolvableLibrary library in _librariesInCycle) {
-        for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
+        for (ResolvableCompilationUnit unit in
+            library.resolvableCompilationUnits) {
           Source source = unit.source;
           CompilationUnit ast = unit.compilationUnit;
-          TypeResolverVisitor visitor = new TypeResolverVisitor.con4(library, source, _typeProvider);
+          TypeResolverVisitor visitor =
+              new TypeResolverVisitor.con4(library, source, _typeProvider);
           ast.accept(visitor);
         }
       }
@@ -9389,11 +9591,14 @@
    * Compute a value for all of the constants in the libraries being analyzed.
    */
   void _performConstantEvaluation() {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
-      ConstantValueComputer computer = new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
+      ConstantValueComputer computer =
+          new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
       for (ResolvableLibrary library in _librariesInCycle) {
-        for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
+        for (ResolvableCompilationUnit unit in
+            library.resolvableCompilationUnits) {
           CompilationUnit ast = unit.compilationUnit;
           if (ast != null) {
             computer.add(ast);
@@ -9407,10 +9612,10 @@
         for (ResolvableCompilationUnit unit in
             library.resolvableCompilationUnits) {
           CompilationUnit ast = unit.compilationUnit;
-          ErrorReporter errorReporter = new ErrorReporter(
-              _errorListener, unit.source);
-          ConstantVerifier constantVerifier = new ConstantVerifier(
-              errorReporter, library.libraryElement, _typeProvider);
+          ErrorReporter errorReporter =
+              new ErrorReporter(_errorListener, unit.source);
+          ConstantVerifier constantVerifier =
+              new ConstantVerifier(errorReporter, library.libraryElement, _typeProvider);
           ast.accept(constantVerifier);
         }
       }
@@ -9439,13 +9644,17 @@
    *           the library cannot be analyzed
    */
   void _resolveReferencesAndTypesInLibrary(ResolvableLibrary library) {
-    TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
+    TimeCounter_TimeCounterHandle timeCounter =
+        PerformanceStatistics.resolve.start();
     try {
-      for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
+      for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits)
+          {
         Source source = unit.source;
         CompilationUnit ast = unit.compilationUnit;
-        ast.accept(new VariableResolverVisitor.con3(library, source, _typeProvider));
-        ResolverVisitor visitor = new ResolverVisitor.con4(library, source, _typeProvider);
+        ast.accept(
+            new VariableResolverVisitor.con3(library, source, _typeProvider));
+        ResolverVisitor visitor =
+            new ResolverVisitor.con4(library, source, _typeProvider);
         ast.accept(visitor);
       }
     } finally {
@@ -9454,7 +9663,8 @@
     // Angular
     timeCounter = PerformanceStatistics.angular.start();
     try {
-      for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
+      for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits)
+          {
         Source source = unit.source;
         CompilationUnit ast = unit.compilationUnit;
         new AngularCompilationUnitBuilder(_errorListener, source, ast).build();
@@ -9473,6 +9683,19 @@
       timeCounter.stop();
     }
   }
+
+  /**
+   * Report that the core library could not be resolved in the given analysis context and throw an
+   * exception.
+   *
+   * @param analysisContext the analysis context in which the failure occurred
+   * @param coreLibrarySource the source representing the core library
+   * @throws AnalysisException always
+   */
+  static void missingCoreLibrary(AnalysisContext analysisContext,
+      Source coreLibrarySource) {
+    throw new AnalysisException("Could not resolve dart:core");
+  }
 }
 
 /**
@@ -9526,14 +9749,17 @@
    * @param definingLibrary the element representing the library represented by this scope
    * @param errorListener the listener that is to be informed when an error is encountered
    */
-  LibraryScope(LibraryElement definingLibrary, AnalysisErrorListener errorListener) : super(new LibraryImportScope(definingLibrary, errorListener)) {
+  LibraryScope(LibraryElement definingLibrary,
+      AnalysisErrorListener errorListener)
+      : super(new LibraryImportScope(definingLibrary, errorListener)) {
     _defineTopLevelNames(definingLibrary);
   }
 
   @override
   AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
     if (existing is PrefixElement) {
-      // TODO(scheglov) consider providing actual 'nameOffset' from the synthetic accessor
+      // TODO(scheglov) consider providing actual 'nameOffset' from the
+      // synthetic accessor
       int offset = duplicate.nameOffset;
       if (duplicate is PropertyAccessorElement) {
         PropertyAccessorElement accessor = duplicate;
@@ -9541,7 +9767,12 @@
           offset = accessor.variable.nameOffset;
         }
       }
-      return new AnalysisError.con2(duplicate.source, offset, duplicate.displayName.length, CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, [existing.displayName]);
+      return new AnalysisError.con2(
+          duplicate.source,
+          offset,
+          duplicate.displayName.length,
+          CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
+          [existing.displayName]);
     }
     return super.getErrorForDuplicate(existing, duplicate);
   }
@@ -9563,7 +9794,8 @@
     for (FunctionElement element in compilationUnit.functions) {
       define(element);
     }
-    for (FunctionTypeAliasElement element in compilationUnit.functionTypeAliases) {
+    for (FunctionTypeAliasElement element in
+        compilationUnit.functionTypeAliases) {
       define(element);
     }
     for (ClassElement element in compilationUnit.types) {
@@ -9635,6 +9867,13 @@
   }
 
   /**
+   * The size of the map.
+   *
+   * @return the size of the map.
+   */
+  int get size => _size;
+
+  /**
    * Given some key, return the ExecutableElement value from the map, if the key does not exist in
    * the map, `null` is returned.
    *
@@ -9663,13 +9902,6 @@
   String getKey(int i) => _keys[i];
 
   /**
-   * The size of the map.
-   *
-   * @return the size of the map.
-   */
-  int get size => _size;
-
-  /**
    * Get and return the ExecutableElement at the specified location. If the key/value pair has been
    * removed from the set, then then `null` is returned.
    *
@@ -9695,11 +9927,13 @@
         return;
       }
     }
-    // If needed, double the size of our arrays and copy values over in both arrays
+    // If needed, double the size of our arrays and copy values over in both
+    // arrays
     if (_size == _keys.length) {
       int newArrayLength = _size * 2;
       List<String> keys_new_array = new List<String>(newArrayLength);
-      List<ExecutableElement> values_new_array = new List<ExecutableElement>(newArrayLength);
+      List<ExecutableElement> values_new_array =
+          new List<ExecutableElement>(newArrayLength);
       for (int i = 0; i < _size; i++) {
         keys_new_array[i] = _keys[i];
       }
@@ -9757,17 +9991,17 @@
  */
 class Namespace {
   /**
+   * An empty namespace.
+   */
+  static Namespace EMPTY = new Namespace(new HashMap<String, Element>());
+
+  /**
    * A table mapping names that are defined in this namespace to the element representing the thing
    * declared with that name.
    */
   final HashMap<String, Element> _definedNames;
 
   /**
-   * An empty namespace.
-   */
-  static Namespace EMPTY = new Namespace(new HashMap<String, Element>());
-
-  /**
    * Initialize a newly created namespace to have the given defined names.
    *
    * @param definedNames the mapping from names that are defined in this namespace to the
@@ -9776,6 +10010,14 @@
   Namespace(this._definedNames);
 
   /**
+   * Return a table containing the same mappings as those defined by this namespace.
+   *
+   * @return a table containing the same mappings as those defined by this namespace
+   */
+  Map<String, Element> get definedNames =>
+      new HashMap<String, Element>.from(_definedNames);
+
+  /**
    * Return the element in this namespace that is available to the containing scope using the given
    * name.
    *
@@ -9783,13 +10025,6 @@
    * @return the element represented by the given identifier
    */
   Element get(String name) => _definedNames[name];
-
-  /**
-   * Return a table containing the same mappings as those defined by this namespace.
-   *
-   * @return a table containing the same mappings as those defined by this namespace
-   */
-  Map<String, Element> get definedNames => new HashMap<String, Element>.from(_definedNames);
 }
 
 /**
@@ -9807,11 +10042,13 @@
     LibraryElement exportedLibrary = element.exportedLibrary;
     if (exportedLibrary == null) {
       //
-      // The exported library will be null if the URI does not reference a valid library.
+      // The exported library will be null if the URI does not reference a valid
+      // library.
       //
       return Namespace.EMPTY;
     }
-    HashMap<String, Element> definedNames = _createExportMapping(exportedLibrary, new HashSet<LibraryElement>());
+    HashMap<String, Element> definedNames =
+        _createExportMapping(exportedLibrary, new HashSet<LibraryElement>());
     definedNames = _applyCombinators(definedNames, element.combinators);
     return new Namespace(definedNames);
   }
@@ -9822,7 +10059,8 @@
    * @param library the library whose export namespace is to be created
    * @return the export namespace that was created
    */
-  Namespace createExportNamespaceForLibrary(LibraryElement library) => new Namespace(_createExportMapping(library, new HashSet<LibraryElement>()));
+  Namespace createExportNamespaceForLibrary(LibraryElement library) =>
+      new Namespace(_createExportMapping(library, new HashSet<LibraryElement>()));
 
   /**
    * Create a namespace representing the import namespace of the given library.
@@ -9834,11 +10072,13 @@
     LibraryElement importedLibrary = element.importedLibrary;
     if (importedLibrary == null) {
       //
-      // The imported library will be null if the URI does not reference a valid library.
+      // The imported library will be null if the URI does not reference a valid
+      // library.
       //
       return Namespace.EMPTY;
     }
-    HashMap<String, Element> definedNames = _createExportMapping(importedLibrary, new HashSet<LibraryElement>());
+    HashMap<String, Element> definedNames =
+        _createExportMapping(importedLibrary, new HashSet<LibraryElement>());
     definedNames = _applyCombinators(definedNames, element.combinators);
     definedNames = _applyPrefix(definedNames, element.prefix);
     return new Namespace(definedNames);
@@ -9865,7 +10105,8 @@
    * @param definedNames the mapping table to which the names in the given namespace are to be added
    * @param namespace the namespace containing the names to be added to this namespace
    */
-  void _addAllFromMap(Map<String, Element> definedNames, Map<String, Element> newNames) {
+  void _addAllFromMap(Map<String, Element> definedNames, Map<String,
+      Element> newNames) {
     newNames.forEach((String name, Element element) {
       definedNames[name] = element;
     });
@@ -9877,7 +10118,8 @@
    * @param definedNames the mapping table to which the names in the given namespace are to be added
    * @param namespace the namespace containing the names to be added to this namespace
    */
-  void _addAllFromNamespace(Map<String, Element> definedNames, Namespace namespace) {
+  void _addAllFromNamespace(Map<String, Element> definedNames,
+      Namespace namespace) {
     if (namespace != null) {
       _addAllFromMap(definedNames, namespace.definedNames);
     }
@@ -9904,14 +10146,16 @@
    * @param compilationUnit the compilation unit defining the top-level names to be added to this
    *          namespace
    */
-  void _addPublicNames(Map<String, Element> definedNames, CompilationUnitElement compilationUnit) {
+  void _addPublicNames(Map<String, Element> definedNames,
+      CompilationUnitElement compilationUnit) {
     for (PropertyAccessorElement element in compilationUnit.accessors) {
       _addIfPublic(definedNames, element);
     }
     for (FunctionElement element in compilationUnit.functions) {
       _addIfPublic(definedNames, element);
     }
-    for (FunctionTypeAliasElement element in compilationUnit.functionTypeAliases) {
+    for (FunctionTypeAliasElement element in
+        compilationUnit.functionTypeAliases) {
       _addIfPublic(definedNames, element);
     }
     for (ClassElement element in compilationUnit.types) {
@@ -9925,7 +10169,8 @@
    * @param definedNames the mapping table to which the namespace operations are to be applied
    * @param combinators the combinators to be applied
    */
-  HashMap<String, Element> _applyCombinators(HashMap<String, Element> definedNames, List<NamespaceCombinator> combinators) {
+  HashMap<String, Element> _applyCombinators(HashMap<String,
+      Element> definedNames, List<NamespaceCombinator> combinators) {
     for (NamespaceCombinator combinator in combinators) {
       if (combinator is HideElementCombinator) {
         _hide(definedNames, combinator.hiddenNames);
@@ -9933,7 +10178,8 @@
         definedNames = _show(definedNames, combinator.shownNames);
       } else {
         // Internal error.
-        AnalysisEngine.instance.logger.logError("Unknown type of combinator: ${combinator.runtimeType}");
+        AnalysisEngine.instance.logger.logError(
+            "Unknown type of combinator: ${combinator.runtimeType}");
       }
     }
     return definedNames;
@@ -9945,7 +10191,8 @@
    * @param definedNames the names that were defined before this operation
    * @param prefixElement the element defining the prefix to be added to the names
    */
-  HashMap<String, Element> _applyPrefix(HashMap<String, Element> definedNames, PrefixElement prefixElement) {
+  HashMap<String, Element> _applyPrefix(HashMap<String, Element> definedNames,
+      PrefixElement prefixElement) {
     if (prefixElement != null) {
       String prefix = prefixElement.name;
       HashMap<String, Element> newNames = new HashMap<String, Element>();
@@ -9967,22 +10214,28 @@
    *          be added by another library
    * @return the mapping table that was created
    */
-  HashMap<String, Element> _createExportMapping(LibraryElement library, HashSet<LibraryElement> visitedElements) {
+  HashMap<String, Element> _createExportMapping(LibraryElement library,
+      HashSet<LibraryElement> visitedElements) {
     visitedElements.add(library);
     try {
       HashMap<String, Element> definedNames = new HashMap<String, Element>();
       for (ExportElement element in library.exports) {
         LibraryElement exportedLibrary = element.exportedLibrary;
-        if (exportedLibrary != null && !visitedElements.contains(exportedLibrary)) {
+        if (exportedLibrary != null &&
+            !visitedElements.contains(exportedLibrary)) {
           //
-          // The exported library will be null if the URI does not reference a valid library.
+          // The exported library will be null if the URI does not reference a
+          // valid library.
           //
-          HashMap<String, Element> exportedNames = _createExportMapping(exportedLibrary, visitedElements);
+          HashMap<String, Element> exportedNames =
+              _createExportMapping(exportedLibrary, visitedElements);
           exportedNames = _applyCombinators(exportedNames, element.combinators);
           _addAllFromMap(definedNames, exportedNames);
         }
       }
-      _addAllFromNamespace(definedNames, (library.context as InternalAnalysisContext).getPublicNamespace(library));
+      _addAllFromNamespace(
+          definedNames,
+          (library.context as InternalAnalysisContext).getPublicNamespace(library));
       return definedNames;
     } finally {
       visitedElements.remove(library);
@@ -10009,7 +10262,8 @@
    * @param definedNames the names that were defined before this operation
    * @param shownNames the names to be shown
    */
-  HashMap<String, Element> _show(HashMap<String, Element> definedNames, List<String> shownNames) {
+  HashMap<String, Element> _show(HashMap<String, Element> definedNames,
+      List<String> shownNames) {
     HashMap<String, Element> newNames = new HashMap<String, Element>();
     for (String name in shownNames) {
       Element element = definedNames[name];
@@ -10055,12 +10309,18 @@
     if (_isOverride(element)) {
       if (_getOverriddenMember(element) == null) {
         if (element is MethodElement) {
-          _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, node.name);
+          _errorReporter.reportErrorForNode(
+              HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD,
+              node.name);
         } else if (element is PropertyAccessorElement) {
           if (element.isGetter) {
-            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, node.name);
+            _errorReporter.reportErrorForNode(
+                HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER,
+                node.name);
           } else {
-            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, node.name);
+            _errorReporter.reportErrorForNode(
+                HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER,
+                node.name);
           }
         }
       }
@@ -10079,7 +10339,8 @@
     if (library == null) {
       return null;
     }
-    ClassElement classElement = member.getAncestor((element) => element is ClassElement);
+    ClassElement classElement =
+        member.getAncestor((element) => element is ClassElement);
     if (classElement == null) {
       return null;
     }
@@ -10102,23 +10363,6 @@
 class PolymerCompilationUnitBuilder {
   static String _CUSTOM_TAG = "CustomTag";
 
-  static Element getElement(AstNode node, int offset) {
-    // maybe node is not SimpleStringLiteral
-    if (node is! SimpleStringLiteral) {
-      return null;
-    }
-    SimpleStringLiteral literal = node as SimpleStringLiteral;
-    // maybe has PolymerElement
-    {
-      Element element = literal.toolkitElement;
-      if (element is PolymerElement) {
-        return element;
-      }
-    }
-    // no Element
-    return null;
-  }
-
   /**
    * The compilation unit with built Dart element models.
    */
@@ -10193,12 +10437,30 @@
         SimpleStringLiteral nameLiteral = nameExpression;
         String name = nameLiteral.value;
         int nameOffset = nameLiteral.contentsOffset;
-        PolymerTagDartElementImpl element = new PolymerTagDartElementImpl(name, nameOffset, _classElement);
+        PolymerTagDartElementImpl element =
+            new PolymerTagDartElementImpl(name, nameOffset, _classElement);
         _classElement.addToolkitObjects(element);
         nameLiteral.toolkitElement = element;
       }
     }
   }
+
+  static Element getElement(AstNode node, int offset) {
+    // maybe node is not SimpleStringLiteral
+    if (node is! SimpleStringLiteral) {
+      return null;
+    }
+    SimpleStringLiteral literal = node as SimpleStringLiteral;
+    // maybe has PolymerElement
+    {
+      Element element = literal.toolkitElement;
+      if (element is PolymerElement) {
+        return element;
+      }
+    }
+    // no Element
+    return null;
+  }
 }
 
 /**
@@ -10206,7 +10468,7 @@
  * pub best practices.
  */
 class PubVerifier extends RecursiveAstVisitor<Object> {
-  static String _PUBSPEC_YAML = "pubspec.yaml";
+//  static String _PUBSPEC_YAML = "pubspec.yaml";
 
   /**
    * The analysis context containing the sources to be analyzed
@@ -10225,217 +10487,182 @@
     return null;
   }
 
-  /**
-   * This verifies that the passed file import directive is not contained in a source inside a
-   * package "lib" directory hierarchy referencing a source outside that package "lib" directory
-   * hierarchy.
-   *
-   * @param uriLiteral the import URL (not `null`)
-   * @param path the file path being verified (not `null`)
-   * @return `true` if and only if an error code is generated on the passed node
-   * See [PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE].
-   */
-  bool _checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral, String path) {
-    Source source = _getSource(uriLiteral);
-    String fullName = _getSourceFullName(source);
-    if (fullName != null) {
-      int pathIndex = 0;
-      int fullNameIndex = fullName.length;
-      while (pathIndex < path.length && StringUtilities.startsWith3(path, pathIndex, 0x2E, 0x2E, 0x2F)) {
-        fullNameIndex = JavaString.lastIndexOf(fullName, '/', fullNameIndex);
-        if (fullNameIndex < 4) {
-          return false;
-        }
-        // Check for "/lib" at a specified place in the fullName
-        if (StringUtilities.startsWith4(fullName, fullNameIndex - 4, 0x2F, 0x6C, 0x69, 0x62)) {
-          String relativePubspecPath = path.substring(0, pathIndex + 3) + _PUBSPEC_YAML;
-          Source pubspecSource = _context.sourceFactory.resolveUri(source, relativePubspecPath);
-          if (_context.exists(pubspecSource)) {
-            // Files inside the lib directory hierarchy should not reference files outside
-            _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, uriLiteral);
-          }
-          return true;
-        }
-        pathIndex += 3;
-      }
-    }
-    return false;
-  }
+//  /**
+//   * This verifies that the passed file import directive is not contained in a source inside a
+//   * package "lib" directory hierarchy referencing a source outside that package "lib" directory
+//   * hierarchy.
+//   *
+//   * @param uriLiteral the import URL (not `null`)
+//   * @param path the file path being verified (not `null`)
+//   * @return `true` if and only if an error code is generated on the passed node
+//   * See [PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE].
+//   */
+//  bool
+//      _checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral,
+//      String path) {
+//    Source source = _getSource(uriLiteral);
+//    String fullName = _getSourceFullName(source);
+//    if (fullName != null) {
+//      int pathIndex = 0;
+//      int fullNameIndex = fullName.length;
+//      while (pathIndex < path.length &&
+//          StringUtilities.startsWith3(path, pathIndex, 0x2E, 0x2E, 0x2F)) {
+//        fullNameIndex = JavaString.lastIndexOf(fullName, '/', fullNameIndex);
+//        if (fullNameIndex < 4) {
+//          return false;
+//        }
+//        // Check for "/lib" at a specified place in the fullName
+//        if (StringUtilities.startsWith4(
+//            fullName,
+//            fullNameIndex - 4,
+//            0x2F,
+//            0x6C,
+//            0x69,
+//            0x62)) {
+//          String relativePubspecPath =
+//              path.substring(0, pathIndex + 3) +
+//              _PUBSPEC_YAML;
+//          Source pubspecSource =
+//              _context.sourceFactory.resolveUri(source, relativePubspecPath);
+//          if (_context.exists(pubspecSource)) {
+//            // Files inside the lib directory hierarchy should not reference
+//            // files outside
+//            _errorReporter.reportErrorForNode(
+//                HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
+//                uriLiteral);
+//          }
+//          return true;
+//        }
+//        pathIndex += 3;
+//      }
+//    }
+//    return false;
+//  }
 
-  /**
-   * This verifies that the passed file import directive is not contained in a source outside a
-   * package "lib" directory hierarchy referencing a source inside that package "lib" directory
-   * hierarchy.
-   *
-   * @param uriLiteral the import URL (not `null`)
-   * @param path the file path being verified (not `null`)
-   * @return `true` if and only if an error code is generated on the passed node
-   * See [PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE].
-   */
-  bool _checkForFileImportOutsideLibReferencesFileInside(StringLiteral uriLiteral, String path) {
-    if (StringUtilities.startsWith4(path, 0, 0x6C, 0x69, 0x62, 0x2F)) {
-      if (_checkForFileImportOutsideLibReferencesFileInsideAtIndex(uriLiteral, path, 0)) {
-        return true;
-      }
-    }
-    int pathIndex = StringUtilities.indexOf5(path, 0, 0x2F, 0x6C, 0x69, 0x62, 0x2F);
-    while (pathIndex != -1) {
-      if (_checkForFileImportOutsideLibReferencesFileInsideAtIndex(uriLiteral, path, pathIndex + 1)) {
-        return true;
-      }
-      pathIndex = StringUtilities.indexOf5(path, pathIndex + 4, 0x2F, 0x6C, 0x69, 0x62, 0x2F);
-    }
-    return false;
-  }
+//  /**
+//   * This verifies that the passed file import directive is not contained in a source outside a
+//   * package "lib" directory hierarchy referencing a source inside that package "lib" directory
+//   * hierarchy.
+//   *
+//   * @param uriLiteral the import URL (not `null`)
+//   * @param path the file path being verified (not `null`)
+//   * @return `true` if and only if an error code is generated on the passed node
+//   * See [PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE].
+//   */
+//  bool
+//      _checkForFileImportOutsideLibReferencesFileInside(StringLiteral uriLiteral,
+//      String path) {
+//    if (StringUtilities.startsWith4(path, 0, 0x6C, 0x69, 0x62, 0x2F)) {
+//      if (_checkForFileImportOutsideLibReferencesFileInsideAtIndex(
+//          uriLiteral,
+//          path,
+//          0)) {
+//        return true;
+//      }
+//    }
+//    int pathIndex =
+//        StringUtilities.indexOf5(path, 0, 0x2F, 0x6C, 0x69, 0x62, 0x2F);
+//    while (pathIndex != -1) {
+//      if (_checkForFileImportOutsideLibReferencesFileInsideAtIndex(
+//          uriLiteral,
+//          path,
+//          pathIndex + 1)) {
+//        return true;
+//      }
+//      pathIndex =
+//          StringUtilities.indexOf5(path, pathIndex + 4, 0x2F, 0x6C, 0x69, 0x62, 0x2F);
+//    }
+//    return false;
+//  }
 
-  bool _checkForFileImportOutsideLibReferencesFileInsideAtIndex(StringLiteral uriLiteral, String path, int pathIndex) {
-    Source source = _getSource(uriLiteral);
-    String relativePubspecPath = path.substring(0, pathIndex) + _PUBSPEC_YAML;
-    Source pubspecSource = _context.sourceFactory.resolveUri(source, relativePubspecPath);
-    if (!_context.exists(pubspecSource)) {
-      return false;
-    }
-    String fullName = _getSourceFullName(source);
-    if (fullName != null) {
-      if (StringUtilities.indexOf5(fullName, 0, 0x2F, 0x6C, 0x69, 0x62, 0x2F) < 0) {
-        // Files outside the lib directory hierarchy should not reference files inside
-        // ... use package: url instead
-        _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, uriLiteral);
-        return true;
-      }
-    }
-    return false;
-  }
+//  bool
+//      _checkForFileImportOutsideLibReferencesFileInsideAtIndex(StringLiteral uriLiteral,
+//      String path, int pathIndex) {
+//    Source source = _getSource(uriLiteral);
+//    String relativePubspecPath = path.substring(0, pathIndex) + _PUBSPEC_YAML;
+//    Source pubspecSource =
+//        _context.sourceFactory.resolveUri(source, relativePubspecPath);
+//    if (!_context.exists(pubspecSource)) {
+//      return false;
+//    }
+//    String fullName = _getSourceFullName(source);
+//    if (fullName != null) {
+//      if (StringUtilities.indexOf5(fullName, 0, 0x2F, 0x6C, 0x69, 0x62, 0x2F) <
+//          0) {
+//        // Files outside the lib directory hierarchy should not reference files
+//        // inside ... use package: url instead
+//        _errorReporter.reportErrorForNode(
+//            HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
+//            uriLiteral);
+//        return true;
+//      }
+//    }
+//    return false;
+//  }
 
-  /**
-   * This verifies that the passed package import directive does not contain ".."
-   *
-   * @param uriLiteral the import URL (not `null`)
-   * @param path the path to be validated (not `null`)
-   * @return `true` if and only if an error code is generated on the passed node
-   * See [PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT].
-   */
-  bool _checkForPackageImportContainsDotDot(StringLiteral uriLiteral, String path) {
-    if (StringUtilities.startsWith3(path, 0, 0x2E, 0x2E, 0x2F) || StringUtilities.indexOf4(path, 0, 0x2F, 0x2E, 0x2E, 0x2F) >= 0) {
-      // Package import should not to contain ".."
-      _errorReporter.reportErrorForNode(HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT, uriLiteral);
-      return true;
-    }
-    return false;
-  }
+//  /**
+//   * This verifies that the passed package import directive does not contain ".."
+//   *
+//   * @param uriLiteral the import URL (not `null`)
+//   * @param path the path to be validated (not `null`)
+//   * @return `true` if and only if an error code is generated on the passed node
+//   * See [PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT].
+//   */
+//  bool _checkForPackageImportContainsDotDot(StringLiteral uriLiteral,
+//      String path) {
+//    if (StringUtilities.startsWith3(path, 0, 0x2E, 0x2E, 0x2F) ||
+//        StringUtilities.indexOf4(path, 0, 0x2F, 0x2E, 0x2E, 0x2F) >= 0) {
+//      // Package import should not to contain ".."
+//      _errorReporter.reportErrorForNode(
+//          HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT,
+//          uriLiteral);
+//      return true;
+//    }
+//    return false;
+//  }
 
-  /**
-   * Answer the source associated with the compilation unit containing the given AST node.
-   *
-   * @param node the node (not `null`)
-   * @return the source or `null` if it could not be determined
-   */
-  Source _getSource(AstNode node) {
-    Source source = null;
-    CompilationUnit unit = node.getAncestor((node) => node is CompilationUnit);
-    if (unit != null) {
-      CompilationUnitElement element = unit.element;
-      if (element != null) {
-        source = element.source;
-      }
-    }
-    return source;
-  }
+//  /**
+//   * Answer the source associated with the compilation unit containing the given AST node.
+//   *
+//   * @param node the node (not `null`)
+//   * @return the source or `null` if it could not be determined
+//   */
+//  Source _getSource(AstNode node) {
+//    Source source = null;
+//    CompilationUnit unit = node.getAncestor((node) => node is CompilationUnit);
+//    if (unit != null) {
+//      CompilationUnitElement element = unit.element;
+//      if (element != null) {
+//        source = element.source;
+//      }
+//    }
+//    return source;
+//  }
 
-  /**
-   * Answer the full name of the given source. The returned value will have all
-   * [File.separatorChar] replace by '/'.
-   *
-   * @param source the source
-   * @return the full name or `null` if it could not be determined
-   */
-  String _getSourceFullName(Source source) {
-    if (source != null) {
-      String fullName = source.fullName;
-      if (fullName != null) {
-        return fullName.replaceAll(r'\', '/');
-      }
-    }
-    return null;
-  }
+//  /**
+//   * Answer the full name of the given source. The returned value will have all
+//   * [File.separatorChar] replace by '/'.
+//   *
+//   * @param source the source
+//   * @return the full name or `null` if it could not be determined
+//   */
+//  String _getSourceFullName(Source source) {
+//    if (source != null) {
+//      String fullName = source.fullName;
+//      if (fullName != null) {
+//        return fullName.replaceAll(r'\', '/');
+//      }
+//    }
+//    return null;
+//  }
 }
 
-class RecursiveAstVisitor_AngularCompilationUnitBuilder_parseScopeProperties extends RecursiveAstVisitor<Object> {
-  List<AngularScopePropertyElement> properties;
-
-  RecursiveAstVisitor_AngularCompilationUnitBuilder_parseScopeProperties(this.properties) : super();
-
-  @override
-  Object visitAssignmentExpression(AssignmentExpression node) {
-    _addProperty(node);
-    return super.visitAssignmentExpression(node);
-  }
-
-  void _addProperty(AssignmentExpression node) {
-    // try to find "name" in scope[name]
-    SimpleStringLiteral nameNode = _getNameNode(node.leftHandSide);
-    if (nameNode == null) {
-      return;
-    }
-    // prepare unique
-    String name = nameNode.stringValue;
-    if (_hasPropertyWithName(name)) {
-      return;
-    }
-    // do add property
-    int nameOffset = nameNode.contentsOffset;
-    AngularScopePropertyElement property = new AngularScopePropertyElementImpl(name, nameOffset, node.rightHandSide.bestType);
-    nameNode.toolkitElement = property;
-    properties.add(property);
-  }
-
-  SimpleStringLiteral _getNameNode(Expression node) {
-    if (node is IndexExpression) {
-      IndexExpression indexExpression = node;
-      Expression target = indexExpression.target;
-      Expression index = indexExpression.index;
-      if (index is SimpleStringLiteral && _isContext(target)) {
-        return index;
-      }
-    }
-    return null;
-  }
-
-  bool _hasPropertyWithName(String name) {
-    for (AngularScopePropertyElement property in properties) {
-      if (property.name == name) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  bool _isContext(Expression target) {
-    if (target is PrefixedIdentifier) {
-      PrefixedIdentifier prefixed = target;
-      SimpleIdentifier prefix = prefixed.prefix;
-      SimpleIdentifier identifier = prefixed.identifier;
-      return (identifier.name == "context") && _isScope(prefix);
-    }
-    return false;
-  }
-
-  bool _isScope(Expression target) {
-    if (target != null) {
-      DartType type = target.bestType;
-      if (type is InterfaceType) {
-        InterfaceType interfaceType = type;
-        return interfaceType.name == "Scope";
-      }
-    }
-    return false;
-  }
-}
-
-class RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews extends RecursiveAstVisitor<Object> {
+class RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews extends
+    RecursiveAstVisitor<Object> {
   List<AngularViewElement> views;
 
-  RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(this.views) : super();
+  RecursiveAstVisitor_AngularCompilationUnitBuilder_parseViews(this.views)
+      : super();
 
   @override
   Object visitMethodInvocation(MethodInvocation node) {
@@ -10486,70 +10713,20 @@
   }
 }
 
-class RecursiveAstVisitor_ResolverVisitor_isVariableAccessedInClosure extends RecursiveAstVisitor<Object> {
-  final Element variable;
-
-  bool result = false;
-
-  RecursiveAstVisitor_ResolverVisitor_isVariableAccessedInClosure(this.variable);
-
-  bool _inClosure = false;
-
-  @override
-  Object visitFunctionExpression(FunctionExpression node) {
-    bool inClosure = this._inClosure;
-    try {
-      this._inClosure = true;
-      return super.visitFunctionExpression(node);
-    } finally {
-      this._inClosure = inClosure;
-    }
-  }
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    if (result) {
-      return null;
-    }
-    if (_inClosure && identical(node.staticElement, variable)) {
-      result = true;
-    }
-    return null;
-  }
-}
-
-class RecursiveAstVisitor_ResolverVisitor_isVariablePotentiallyMutatedIn extends RecursiveAstVisitor<Object> {
-  final Element variable;
-
-  bool result = false;
-
-  RecursiveAstVisitor_ResolverVisitor_isVariablePotentiallyMutatedIn(this.variable);
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    if (result) {
-      return null;
-    }
-    if (identical(node.staticElement, variable)) {
-      if (node.inSetterContext()) {
-        result = true;
-      }
-    }
-    return null;
-  }
-}
-
 /**
  * Kind of the redirecting constructor.
  */
 class RedirectingConstructorKind extends Enum<RedirectingConstructorKind> {
-  static const RedirectingConstructorKind CONST = const RedirectingConstructorKind('CONST', 0);
+  static const RedirectingConstructorKind CONST =
+      const RedirectingConstructorKind('CONST', 0);
 
-  static const RedirectingConstructorKind NORMAL = const RedirectingConstructorKind('NORMAL', 1);
+  static const RedirectingConstructorKind NORMAL =
+      const RedirectingConstructorKind('NORMAL', 1);
 
   static const List<RedirectingConstructorKind> values = const [CONST, NORMAL];
 
-  const RedirectingConstructorKind(String name, int ordinal) : super(name, ordinal);
+  const RedirectingConstructorKind(String name, int ordinal)
+      : super(name, ordinal);
 }
 
 /**
@@ -10559,6 +10736,11 @@
  */
 class ResolvableLibrary {
   /**
+   * An empty array that can be used to initialize lists of libraries.
+   */
+  static List<ResolvableLibrary> _EMPTY_ARRAY = new List<ResolvableLibrary>(0);
+
+  /**
    * The source specifying the defining compilation unit of this library.
    */
   final Source librarySource;
@@ -10600,11 +10782,6 @@
   InheritanceManager _inheritanceManager;
 
   /**
-   * An empty array that can be used to initialize lists of libraries.
-   */
-  static List<ResolvableLibrary> _EMPTY_ARRAY = new List<ResolvableLibrary>(0);
-
-  /**
    * The library scope used when resolving elements within this library's compilation units.
    */
   LibraryScope _libraryScope;
@@ -10618,24 +10795,6 @@
   ResolvableLibrary(this.librarySource);
 
   /**
-   * Return the AST structure associated with the given source, or `null` if the source does
-   * not represent a compilation unit that is included in this library.
-   *
-   * @param source the source representing the compilation unit whose AST is to be returned
-   * @return the AST structure associated with the given source
-   * @throws AnalysisException if an AST structure could not be created for the compilation unit
-   */
-  CompilationUnit getAST(Source source) {
-    int count = _compilationUnits.length;
-    for (int i = 0; i < count; i++) {
-      if (_compilationUnits[i].source == source) {
-        return _compilationUnits[i].compilationUnit;
-      }
-    }
-    return null;
-  }
-
-  /**
    * Return an array of the [CompilationUnit]s that make up the library. The first unit is
    * always the defining unit.
    *
@@ -10673,7 +10832,26 @@
    * @throws AnalysisException if an AST structure could not be created for the defining compilation
    *           unit
    */
-  CompilationUnit get definingCompilationUnit => _compilationUnits[0].compilationUnit;
+  CompilationUnit get definingCompilationUnit =>
+      _compilationUnits[0].compilationUnit;
+
+  /**
+   * Set the listener to which analysis errors will be reported to be the given listener.
+   *
+   * @param errorListener the listener to which analysis errors will be reported
+   */
+  void set errorListener(AnalysisErrorListener errorListener) {
+    this._errorListener = errorListener;
+  }
+
+  /**
+   * Set the libraries that are exported by this library to be those in the given array.
+   *
+   * @param exportedLibraries the libraries that are exported by this library
+   */
+  void set exportedLibraries(List<ResolvableLibrary> exportedLibraries) {
+    this._exportedLibraries = exportedLibraries;
+  }
 
   /**
    * Return an array containing the libraries that are exported from this library.
@@ -10683,6 +10861,15 @@
   List<ResolvableLibrary> get exports => _exportedLibraries;
 
   /**
+   * Set the libraries that are imported into this library to be those in the given array.
+   *
+   * @param importedLibraries the libraries that are imported into this library
+   */
+  void set importedLibraries(List<ResolvableLibrary> importedLibraries) {
+    this._importedLibraries = importedLibraries;
+  }
+
+  /**
    * Return an array containing the libraries that are imported into this library.
    *
    * @return an array containing the libraries that are imported into this library
@@ -10726,6 +10913,18 @@
   LibraryElementImpl get libraryElement => _libraryElement;
 
   /**
+   * Set the library element representing this library to the given library element.
+   *
+   * @param libraryElement the library element representing this library
+   */
+  void set libraryElement(LibraryElementImpl libraryElement) {
+    this._libraryElement = libraryElement;
+    if (_inheritanceManager != null) {
+      _inheritanceManager.libraryElement = libraryElement;
+    }
+  }
+
+  /**
    * Return the library scope used when resolving elements within this library's compilation units.
    *
    * @return the library scope used when resolving elements within this library's compilation units
@@ -10743,7 +10942,8 @@
    *
    * @return the compilation units that comprise this library
    */
-  List<ResolvableCompilationUnit> get resolvableCompilationUnits => _compilationUnits;
+  List<ResolvableCompilationUnit> get resolvableCompilationUnits =>
+      _compilationUnits;
 
   /**
    * Set the compilation unit in this library to the given compilation units. The defining
@@ -10756,42 +10956,21 @@
   }
 
   /**
-   * Set the listener to which analysis errors will be reported to be the given listener.
+   * Return the AST structure associated with the given source, or `null` if the source does
+   * not represent a compilation unit that is included in this library.
    *
-   * @param errorListener the listener to which analysis errors will be reported
+   * @param source the source representing the compilation unit whose AST is to be returned
+   * @return the AST structure associated with the given source
+   * @throws AnalysisException if an AST structure could not be created for the compilation unit
    */
-  void set errorListener(AnalysisErrorListener errorListener) {
-    this._errorListener = errorListener;
-  }
-
-  /**
-   * Set the libraries that are exported by this library to be those in the given array.
-   *
-   * @param exportedLibraries the libraries that are exported by this library
-   */
-  void set exportedLibraries(List<ResolvableLibrary> exportedLibraries) {
-    this._exportedLibraries = exportedLibraries;
-  }
-
-  /**
-   * Set the libraries that are imported into this library to be those in the given array.
-   *
-   * @param importedLibraries the libraries that are imported into this library
-   */
-  void set importedLibraries(List<ResolvableLibrary> importedLibraries) {
-    this._importedLibraries = importedLibraries;
-  }
-
-  /**
-   * Set the library element representing this library to the given library element.
-   *
-   * @param libraryElement the library element representing this library
-   */
-  void set libraryElement(LibraryElementImpl libraryElement) {
-    this._libraryElement = libraryElement;
-    if (_inheritanceManager != null) {
-      _inheritanceManager.libraryElement = libraryElement;
+  CompilationUnit getAST(Source source) {
+    int count = _compilationUnits.length;
+    for (int i = 0; i < count; i++) {
+      if (_compilationUnits[i].source == source) {
+        return _compilationUnits[i].compilationUnit;
+      }
     }
+    return null;
   }
 
   @override
@@ -10806,18 +10985,18 @@
  * the problem can be corrected.
  */
 class ResolverErrorCode extends ErrorCode {
-  static const ResolverErrorCode BREAK_LABEL_ON_SWITCH_MEMBER
-      = const ResolverErrorCode(
+  static const ResolverErrorCode BREAK_LABEL_ON_SWITCH_MEMBER =
+      const ResolverErrorCode(
           'BREAK_LABEL_ON_SWITCH_MEMBER',
           "Break label resolves to case or default statement");
 
-  static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH
-      = const ResolverErrorCode(
+  static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH =
+      const ResolverErrorCode(
           'CONTINUE_LABEL_ON_SWITCH',
           "A continue label resolves to switch, must be loop or switch member");
 
-  static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART
-      = const ResolverErrorCode(
+  static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART =
+      const ResolverErrorCode(
           'MISSING_LIBRARY_DIRECTIVE_WITH_PART',
           "Libraries that have parts must have a library directive");
 
@@ -10858,10 +11037,10 @@
   StaticTypeAnalyzer _typeAnalyzer;
 
   /**
-   * The class element representing the class containing the current node, or `null` if the
-   * current node is not contained in a class.
+   * The class element representing the class containing the current node,
+   * or `null` if the current node is not contained in a class.
    */
-  ClassElement _enclosingClass = null;
+  ClassElement enclosingClass = null;
 
   /**
    * The class declaration representing the class containing the current node, or `null` if
@@ -10904,7 +11083,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
+  ResolverVisitor.con1(Library library, Source source,
+      TypeProvider typeProvider)
+      : super.con1(library, source, typeProvider) {
     this._inheritanceManager = library.inheritanceManager;
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
@@ -10920,7 +11101,10 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  ResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, InheritanceManager inheritanceManager, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
+  ResolverVisitor.con2(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, InheritanceManager inheritanceManager,
+      AnalysisErrorListener errorListener)
+      : super.con2(definingLibrary, source, typeProvider, errorListener) {
     this._inheritanceManager = inheritanceManager;
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
@@ -10936,7 +11120,14 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  ResolverVisitor.con3(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener) : super.con3(definingLibrary, source, typeProvider, nameScope, errorListener) {
+  ResolverVisitor.con3(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener)
+      : super.con3(
+          definingLibrary,
+          source,
+          typeProvider,
+          nameScope,
+          errorListener) {
     this._inheritanceManager = new InheritanceManager(definingLibrary);
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
@@ -10949,12 +11140,34 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ResolverVisitor.con4(ResolvableLibrary library, Source source, TypeProvider typeProvider) : super.con4(library, source, typeProvider) {
+  ResolverVisitor.con4(ResolvableLibrary library, Source source,
+      TypeProvider typeProvider)
+      : super.con4(library, source, typeProvider) {
     this._inheritanceManager = library.inheritanceManager;
     this._elementResolver = new ElementResolver(this);
     this._typeAnalyzer = new StaticTypeAnalyzer(this);
   }
 
+  get elementResolver_J2DAccessor => _elementResolver;
+
+  set elementResolver_J2DAccessor(__v) => _elementResolver = __v;
+
+  /**
+   * Return the element representing the function containing the current node, or `null` if
+   * the current node is not contained in a function.
+   *
+   * @return the element representing the function containing the current node
+   */
+  ExecutableElement get enclosingFunction => _enclosingFunction;
+
+  get labelScope_J2DAccessor => _labelScope;
+
+  set labelScope_J2DAccessor(__v) => _labelScope = __v;
+
+  get nameScope_J2DAccessor => _nameScope;
+
+  set nameScope_J2DAccessor(__v) => _nameScope = __v;
+
   /**
    * Return the object keeping track of which elements have had their types overridden.
    *
@@ -10969,647 +11182,9 @@
    */
   TypePromotionManager get promoteManager => _promoteManager;
 
-  @override
-  Object visitAnnotation(Annotation node) {
-    AstNode parent = node.parent;
-    if (identical(parent, _enclosingClassDeclaration) || identical(parent, _enclosingFunctionTypeAlias)) {
-      return null;
-    }
-    return super.visitAnnotation(node);
-  }
+  get typeAnalyzer_J2DAccessor => _typeAnalyzer;
 
-  @override
-  Object visitAsExpression(AsExpression node) {
-    super.visitAsExpression(node);
-    // Since an as-statement doesn't actually change the type, we don't
-    // let it affect the propagated type when it would result in a loss
-    // of precision.
-    overrideExpression(node.expression, node.type.type, false);
-    return null;
-  }
-
-  @override
-  Object visitAssertStatement(AssertStatement node) {
-    super.visitAssertStatement(node);
-    _propagateTrueState(node.condition);
-    return null;
-  }
-
-  @override
-  Object visitBinaryExpression(BinaryExpression node) {
-    sc.TokenType operatorType = node.operator.type;
-    Expression leftOperand = node.leftOperand;
-    Expression rightOperand = node.rightOperand;
-    if (operatorType == sc.TokenType.AMPERSAND_AMPERSAND) {
-      safelyVisit(leftOperand);
-      if (rightOperand != null) {
-        _overrideManager.enterScope();
-        try {
-          _promoteManager.enterScope();
-          try {
-            _propagateTrueState(leftOperand);
-            // Type promotion.
-            _promoteTypes(leftOperand);
-            _clearTypePromotionsIfPotentiallyMutatedIn(leftOperand);
-            _clearTypePromotionsIfPotentiallyMutatedIn(rightOperand);
-            _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(rightOperand);
-            // Visit right operand.
-            rightOperand.accept(this);
-          } finally {
-            _promoteManager.exitScope();
-          }
-        } finally {
-          _overrideManager.exitScope();
-        }
-      }
-    } else if (operatorType == sc.TokenType.BAR_BAR) {
-      safelyVisit(leftOperand);
-      if (rightOperand != null) {
-        _overrideManager.enterScope();
-        try {
-          _propagateFalseState(leftOperand);
-          rightOperand.accept(this);
-        } finally {
-          _overrideManager.exitScope();
-        }
-      }
-    } else {
-      safelyVisit(leftOperand);
-      safelyVisit(rightOperand);
-    }
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitBlockFunctionBody(BlockFunctionBody node) {
-    safelyVisit(_commentBeforeFunction);
-    _overrideManager.enterScope();
-    try {
-      super.visitBlockFunctionBody(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitBreakStatement(BreakStatement node) {
-    //
-    // We do not visit the label because it needs to be visited in the context of the statement.
-    //
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    //
-    // Resolve the metadata in the library scope.
-    //
-    if (node.metadata != null) {
-      node.metadata.accept(this);
-    }
-    _enclosingClassDeclaration = node;
-    //
-    // Continue the class resolution.
-    //
-    ClassElement outerType = _enclosingClass;
-    try {
-      _enclosingClass = node.element;
-      _typeAnalyzer.thisType = _enclosingClass == null ? null : _enclosingClass.type;
-      super.visitClassDeclaration(node);
-      node.accept(_elementResolver);
-      node.accept(_typeAnalyzer);
-    } finally {
-      _typeAnalyzer.thisType = outerType == null ? null : outerType.type;
-      _enclosingClass = outerType;
-      _enclosingClassDeclaration = null;
-    }
-    return null;
-  }
-
-  @override
-  Object visitComment(Comment node) {
-    if (node.parent is FunctionDeclaration || node.parent is ConstructorDeclaration || node.parent is MethodDeclaration) {
-      if (!identical(node, _commentBeforeFunction)) {
-        _commentBeforeFunction = node;
-        return null;
-      }
-    }
-    super.visitComment(node);
-    _commentBeforeFunction = null;
-    return null;
-  }
-
-  @override
-  Object visitCommentReference(CommentReference node) {
-    //
-    // We do not visit the identifier because it needs to be visited in the context of the reference.
-    //
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitCompilationUnit(CompilationUnit node) {
-    //
-    // TODO(brianwilkerson) The goal of the code below is to visit the declarations in such an
-    // order that we can infer type information for top-level variables before we visit references
-    // to them. This is better than making no effort, but still doesn't completely satisfy that
-    // goal (consider for example "final var a = b; final var b = 0;"; we'll infer a type of 'int'
-    // for 'b', but not for 'a' because of the order of the visits). Ideally we would create a
-    // dependency graph, but that would require references to be resolved, which they are not.
-    //
-    _overrideManager.enterScope();
-    try {
-      NodeList<Directive> directives = node.directives;
-      int directiveCount = directives.length;
-      for (int i = 0; i < directiveCount; i++) {
-        directives[i].accept(this);
-      }
-      NodeList<CompilationUnitMember> declarations = node.declarations;
-      int declarationCount = declarations.length;
-      for (int i = 0; i < declarationCount; i++) {
-        CompilationUnitMember declaration = declarations[i];
-        if (declaration is! ClassDeclaration) {
-          declaration.accept(this);
-        }
-      }
-      for (int i = 0; i < declarationCount; i++) {
-        CompilationUnitMember declaration = declarations[i];
-        if (declaration is ClassDeclaration) {
-          declaration.accept(this);
-        }
-      }
-    } finally {
-      _overrideManager.exitScope();
-    }
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitConditionalExpression(ConditionalExpression node) {
-    Expression condition = node.condition;
-    safelyVisit(condition);
-    Expression thenExpression = node.thenExpression;
-    if (thenExpression != null) {
-      _overrideManager.enterScope();
-      try {
-        _promoteManager.enterScope();
-        try {
-          _propagateTrueState(condition);
-          // Type promotion.
-          _promoteTypes(condition);
-          _clearTypePromotionsIfPotentiallyMutatedIn(thenExpression);
-          _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(thenExpression);
-          // Visit "then" expression.
-          thenExpression.accept(this);
-        } finally {
-          _promoteManager.exitScope();
-        }
-      } finally {
-        _overrideManager.exitScope();
-      }
-    }
-    Expression elseExpression = node.elseExpression;
-    if (elseExpression != null) {
-      _overrideManager.enterScope();
-      try {
-        _propagateFalseState(condition);
-        elseExpression.accept(this);
-      } finally {
-        _overrideManager.exitScope();
-      }
-    }
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    bool thenIsAbrupt = _isAbruptTerminationExpression(thenExpression);
-    bool elseIsAbrupt = _isAbruptTerminationExpression(elseExpression);
-    if (elseIsAbrupt && !thenIsAbrupt) {
-      _propagateTrueState(condition);
-      _propagateState(thenExpression);
-    } else if (thenIsAbrupt && !elseIsAbrupt) {
-      _propagateFalseState(condition);
-      _propagateState(elseExpression);
-    }
-    return null;
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    ExecutableElement outerFunction = _enclosingFunction;
-    try {
-      _enclosingFunction = node.element;
-      super.visitConstructorDeclaration(node);
-    } finally {
-      _enclosingFunction = outerFunction;
-    }
-    return null;
-  }
-
-  @override
-  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    //
-    // We visit the expression, but do not visit the field name because it needs to be visited in
-    // the context of the constructor field initializer node.
-    //
-    safelyVisit(node.expression);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitConstructorName(ConstructorName node) {
-    //
-    // We do not visit either the type name, because it won't be visited anyway, or the name,
-    // because it needs to be visited in the context of the constructor name.
-    //
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitContinueStatement(ContinueStatement node) {
-    //
-    // We do not visit the label because it needs to be visited in the context of the statement.
-    //
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitDoStatement(DoStatement node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitDoStatement(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    // TODO(brianwilkerson) If the loop can only be exited because the condition is false, then
-    // propagateFalseState(node.getCondition());
-    return null;
-  }
-
-  @override
-  Object visitEmptyFunctionBody(EmptyFunctionBody node) {
-    safelyVisit(_commentBeforeFunction);
-    return super.visitEmptyFunctionBody(node);
-  }
-
-  @override
-  Object visitEnumDeclaration(EnumDeclaration node) {
-    //
-    // Resolve the metadata in the library scope.
-    //
-    if (node.metadata != null) {
-      node.metadata.accept(this);
-    }
-    //
-    // There is nothing else to do because everything else was resolved by the element builder.
-    //
-    return null;
-  }
-
-  @override
-  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    safelyVisit(_commentBeforeFunction);
-    _overrideManager.enterScope();
-    try {
-      super.visitExpressionFunctionBody(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitFieldDeclaration(FieldDeclaration node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitFieldDeclaration(node);
-    } finally {
-      Map<VariableElement, DartType> overrides = _overrideManager.captureOverrides(node.fields);
-      _overrideManager.exitScope();
-      _overrideManager.applyOverrides(overrides);
-    }
-    return null;
-  }
-
-  @override
-  Object visitForEachStatement(ForEachStatement node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitForEachStatement(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitForStatement(ForStatement node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitForStatement(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitFunctionDeclaration(FunctionDeclaration node) {
-    ExecutableElement outerFunction = _enclosingFunction;
-    try {
-      SimpleIdentifier functionName = node.name;
-      _enclosingFunction = functionName.staticElement as ExecutableElement;
-      super.visitFunctionDeclaration(node);
-    } finally {
-      _enclosingFunction = outerFunction;
-    }
-    return null;
-  }
-
-  @override
-  Object visitFunctionExpression(FunctionExpression node) {
-    ExecutableElement outerFunction = _enclosingFunction;
-    try {
-      _enclosingFunction = node.element;
-      _overrideManager.enterScope();
-      try {
-        super.visitFunctionExpression(node);
-      } finally {
-        _overrideManager.exitScope();
-      }
-    } finally {
-      _enclosingFunction = outerFunction;
-    }
-    return null;
-  }
-
-  @override
-  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
-    safelyVisit(node.function);
-    node.accept(_elementResolver);
-    _inferFunctionExpressionsParametersTypes(node.argumentList);
-    safelyVisit(node.argumentList);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    // Resolve the metadata in the library scope.
-    if (node.metadata != null) {
-      node.metadata.accept(this);
-    }
-    FunctionTypeAlias outerAlias = _enclosingFunctionTypeAlias;
-    _enclosingFunctionTypeAlias = node;
-    try {
-      super.visitFunctionTypeAlias(node);
-    } finally {
-      _enclosingFunctionTypeAlias = outerAlias;
-    }
-    return null;
-  }
-
-  @override
-  Object visitHideCombinator(HideCombinator node) => null;
-
-  @override
-  Object visitIfStatement(IfStatement node) {
-    Expression condition = node.condition;
-    safelyVisit(condition);
-    Map<VariableElement, DartType> thenOverrides = new HashMap<VariableElement, DartType>();
-    Statement thenStatement = node.thenStatement;
-    if (thenStatement != null) {
-      _overrideManager.enterScope();
-      try {
-        _promoteManager.enterScope();
-        try {
-          _propagateTrueState(condition);
-          // Type promotion.
-          _promoteTypes(condition);
-          _clearTypePromotionsIfPotentiallyMutatedIn(thenStatement);
-          _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(thenStatement);
-          // Visit "then".
-          visitStatementInScope(thenStatement);
-        } finally {
-          _promoteManager.exitScope();
-        }
-      } finally {
-        thenOverrides = _overrideManager.captureLocalOverrides();
-        _overrideManager.exitScope();
-      }
-    }
-    Map<VariableElement, DartType> elseOverrides = new HashMap<VariableElement, DartType>();
-    Statement elseStatement = node.elseStatement;
-    if (elseStatement != null) {
-      _overrideManager.enterScope();
-      try {
-        _propagateFalseState(condition);
-        visitStatementInScope(elseStatement);
-      } finally {
-        elseOverrides = _overrideManager.captureLocalOverrides();
-        _overrideManager.exitScope();
-      }
-    }
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    // Join overrides.
-    bool thenIsAbrupt = _isAbruptTerminationStatement(thenStatement);
-    bool elseIsAbrupt = _isAbruptTerminationStatement(elseStatement);
-    if (elseIsAbrupt && !thenIsAbrupt) {
-      _propagateTrueState(condition);
-      _overrideManager.applyOverrides(thenOverrides);
-    } else if (thenIsAbrupt && !elseIsAbrupt) {
-      _propagateFalseState(condition);
-      _overrideManager.applyOverrides(elseOverrides);
-    } else if (!thenIsAbrupt && !elseIsAbrupt) {
-      if (AnalysisEngine.instance.enableUnionTypes) {
-        List<Map<VariableElement, DartType>> perBranchOverrides = new List<Map<VariableElement, DartType>>();
-        perBranchOverrides.add(thenOverrides);
-        perBranchOverrides.add(elseOverrides);
-        _overrideManager.joinOverrides(perBranchOverrides);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitLabel(Label node) => null;
-
-  @override
-  Object visitLibraryIdentifier(LibraryIdentifier node) => null;
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    ExecutableElement outerFunction = _enclosingFunction;
-    try {
-      _enclosingFunction = node.element;
-      super.visitMethodDeclaration(node);
-    } finally {
-      _enclosingFunction = outerFunction;
-    }
-    return null;
-  }
-
-  @override
-  Object visitMethodInvocation(MethodInvocation node) {
-    //
-    // We visit the target and argument list, but do not visit the method name because it needs to
-    // be visited in the context of the invocation.
-    //
-    safelyVisit(node.target);
-    node.accept(_elementResolver);
-    _inferFunctionExpressionsParametersTypes(node.argumentList);
-    safelyVisit(node.argumentList);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitNode(AstNode node) {
-    node.visitChildren(this);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    //
-    // We visit the prefix, but do not visit the identifier because it needs to be visited in the
-    // context of the prefix.
-    //
-    safelyVisit(node.prefix);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitPropertyAccess(PropertyAccess node) {
-    //
-    // We visit the target, but do not visit the property name because it needs to be visited in the
-    // context of the property access node.
-    //
-    safelyVisit(node.target);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    //
-    // We visit the argument list, but do not visit the optional identifier because it needs to be
-    // visited in the context of the constructor invocation.
-    //
-    safelyVisit(node.argumentList);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitShowCombinator(ShowCombinator node) => null;
-
-  @override
-  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    //
-    // We visit the argument list, but do not visit the optional identifier because it needs to be
-    // visited in the context of the constructor invocation.
-    //
-    safelyVisit(node.argumentList);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  @override
-  Object visitSwitchCase(SwitchCase node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitSwitchCase(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitSwitchDefault(SwitchDefault node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitSwitchDefault(node);
-    } finally {
-      _overrideManager.exitScope();
-    }
-    return null;
-  }
-
-  @override
-  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
-    _overrideManager.enterScope();
-    try {
-      super.visitTopLevelVariableDeclaration(node);
-    } finally {
-      Map<VariableElement, DartType> overrides = _overrideManager.captureOverrides(node.variables);
-      _overrideManager.exitScope();
-      _overrideManager.applyOverrides(overrides);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeName(TypeName node) => null;
-
-  @override
-  Object visitWhileStatement(WhileStatement node) {
-    Expression condition = node.condition;
-    safelyVisit(condition);
-    Statement body = node.body;
-    if (body != null) {
-      _overrideManager.enterScope();
-      try {
-        _propagateTrueState(condition);
-        visitStatementInScope(body);
-      } finally {
-        _overrideManager.exitScope();
-      }
-    }
-    // TODO(brianwilkerson) If the loop can only be exited because the condition is false, then
-    // propagateFalseState(condition);
-    node.accept(_elementResolver);
-    node.accept(_typeAnalyzer);
-    return null;
-  }
-
-  /**
-   * Return the class element representing the class containing the current node, or `null` if
-   * the current node is not contained in a class.
-   *
-   * @return the class element representing the class containing the current node
-   */
-  ClassElement get enclosingClass => _enclosingClass;
-
-  /**
-   * Return the element representing the function containing the current node, or `null` if
-   * the current node is not contained in a function.
-   *
-   * @return the element representing the function containing the current node
-   */
-  ExecutableElement get enclosingFunction => _enclosingFunction;
+  set typeAnalyzer_J2DAccessor(__v) => _typeAnalyzer = __v;
 
   /**
    * Return the propagated element associated with the given expression whose type can be
@@ -11694,7 +11269,8 @@
    * @param potentialType the potential type of the elements
    * @param allowPrecisionLoss see @{code overrideVariable} docs
    */
-  void overrideExpression(Expression expression, DartType potentialType, bool allowPrecisionLoss) {
+  void overrideExpression(Expression expression, DartType potentialType,
+      bool allowPrecisionLoss) {
     VariableElement element = getOverridableStaticElement(expression);
     if (element != null) {
       overrideVariable(element, potentialType, allowPrecisionLoss);
@@ -11714,45 +11290,435 @@
    * @param allowPrecisionLoss true if `potentialType` is allowed to be less precise than the
    *          current best type
    */
-  void overrideVariable(VariableElement element, DartType potentialType, bool allowPrecisionLoss) {
+  void overrideVariable(VariableElement element, DartType potentialType,
+      bool allowPrecisionLoss) {
     if (potentialType == null || potentialType.isBottom) {
       return;
     }
     DartType currentType = _overrideManager.getBestType(element);
-    // If we aren't allowing precision loss then the third and fourth conditions check that we
-    // aren't losing precision.
+
+    // If we aren't allowing precision loss then the third and fourth conditions
+    // check that we aren't losing precision.
     //
-    // Let [C] be the current type and [P] be the potential type.  When we aren't allowing
-    // precision loss -- which is the case for is-checks -- we check that [! (C << P)] or  [P << C].
-    // The second check, that [P << C], is analogous to part of the Dart Language Spec rule
-    // for type promotion under is-checks (in the analogy [T] is [P] and [S] is [C]):
+    // Let [C] be the current type and [P] be the potential type.  When we
+    // aren't allowing precision loss -- which is the case for is-checks -- we
+    // check that [! (C << P)] or  [P << C]. The second check, that [P << C], is
+    // analogous to part of the Dart Language Spec rule for type promotion under
+    // is-checks (in the analogy [T] is [P] and [S] is [C]):
     //
-    //   An is-expression of the form [v is T] shows that [v] has type [T] iff [T] is more
-    //   specific than the type [S] of the expression [v] and both [T != dynamic] and
-    //   [S != dynamic].
+    //   An is-expression of the form [v is T] shows that [v] has type [T] iff
+    //   [T] is more specific than the type [S] of the expression [v] and both
+    //   [T != dynamic] and [S != dynamic].
     //
-    // It also covers an important case that is not applicable in the spec: for union types, we
-    // want an is-check to promote from an union type to (a subtype of) any of its members.
+    // It also covers an important case that is not applicable in the spec:
+    // for union types, we want an is-check to promote from an union type to
+    // (a subtype of) any of its members.
     //
-    // The first check, that [! (C << P)], covers the case where [P] and [C] are unrelated types;
-    // This case is not addressed in the spec for static types.
-    if (currentType == null || allowPrecisionLoss || !currentType.isMoreSpecificThan(potentialType) || potentialType.isMoreSpecificThan(currentType)) {
+    // The first check, that [! (C << P)], covers the case where [P] and [C] are
+    // unrelated types; This case is not addressed in the spec for static types.
+    if (currentType == null ||
+        allowPrecisionLoss ||
+        !currentType.isMoreSpecificThan(potentialType) ||
+        potentialType.isMoreSpecificThan(currentType)) {
       if (element is PropertyInducingElement) {
         PropertyInducingElement variable = element;
         if (!variable.isConst && !variable.isFinal) {
           return;
         }
-        (variable as PropertyInducingElementImpl).propagatedType = potentialType;
+        (variable as PropertyInducingElementImpl).propagatedType =
+            potentialType;
       }
       _overrideManager.setType(element, potentialType);
     }
   }
 
   @override
+  Object visitAnnotation(Annotation node) {
+    AstNode parent = node.parent;
+    if (identical(parent, _enclosingClassDeclaration) ||
+        identical(parent, _enclosingFunctionTypeAlias)) {
+      return null;
+    }
+    return super.visitAnnotation(node);
+  }
+
+  @override
+  Object visitAsExpression(AsExpression node) {
+    super.visitAsExpression(node);
+    // Since an as-statement doesn't actually change the type, we don't
+    // let it affect the propagated type when it would result in a loss
+    // of precision.
+    overrideExpression(node.expression, node.type.type, false);
+    return null;
+  }
+
+  @override
+  Object visitAssertStatement(AssertStatement node) {
+    super.visitAssertStatement(node);
+    _propagateTrueState(node.condition);
+    return null;
+  }
+
+  @override
+  Object visitBinaryExpression(BinaryExpression node) {
+    sc.TokenType operatorType = node.operator.type;
+    Expression leftOperand = node.leftOperand;
+    Expression rightOperand = node.rightOperand;
+    if (operatorType == sc.TokenType.AMPERSAND_AMPERSAND) {
+      safelyVisit(leftOperand);
+      if (rightOperand != null) {
+        _overrideManager.enterScope();
+        try {
+          _promoteManager.enterScope();
+          try {
+            _propagateTrueState(leftOperand);
+            // Type promotion.
+            _promoteTypes(leftOperand);
+            _clearTypePromotionsIfPotentiallyMutatedIn(leftOperand);
+            _clearTypePromotionsIfPotentiallyMutatedIn(rightOperand);
+            _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(
+                rightOperand);
+            // Visit right operand.
+            rightOperand.accept(this);
+          } finally {
+            _promoteManager.exitScope();
+          }
+        } finally {
+          _overrideManager.exitScope();
+        }
+      }
+    } else if (operatorType == sc.TokenType.BAR_BAR) {
+      safelyVisit(leftOperand);
+      if (rightOperand != null) {
+        _overrideManager.enterScope();
+        try {
+          _propagateFalseState(leftOperand);
+          rightOperand.accept(this);
+        } finally {
+          _overrideManager.exitScope();
+        }
+      }
+    } else {
+      safelyVisit(leftOperand);
+      safelyVisit(rightOperand);
+    }
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    safelyVisit(_commentBeforeFunction);
+    _overrideManager.enterScope();
+    try {
+      super.visitBlockFunctionBody(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
+  Object visitBreakStatement(BreakStatement node) {
+    //
+    // We do not visit the label because it needs to be visited in the context
+    // of the statement.
+    //
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitClassDeclaration(ClassDeclaration node) {
+    //
+    // Resolve the metadata in the library scope.
+    //
+    if (node.metadata != null) {
+      node.metadata.accept(this);
+    }
+    _enclosingClassDeclaration = node;
+    //
+    // Continue the class resolution.
+    //
+    ClassElement outerType = enclosingClass;
+    try {
+      enclosingClass = node.element;
+      _typeAnalyzer.thisType =
+          enclosingClass == null ? null : enclosingClass.type;
+      super.visitClassDeclaration(node);
+      node.accept(_elementResolver);
+      node.accept(_typeAnalyzer);
+    } finally {
+      _typeAnalyzer.thisType = outerType == null ? null : outerType.type;
+      enclosingClass = outerType;
+      _enclosingClassDeclaration = null;
+    }
+    return null;
+  }
+
+  /**
+   * Implementation of this method should be synchronized with
+   * [visitClassDeclaration].
+   */
+  visitClassDeclarationIncrementally(ClassDeclaration node) {
+    //
+    // Resolve the metadata in the library scope.
+    //
+    if (node.metadata != null) {
+      node.metadata.accept(this);
+    }
+    _enclosingClassDeclaration = node;
+    //
+    // Continue the class resolution.
+    //
+    enclosingClass = node.element;
+    _typeAnalyzer.thisType =
+        enclosingClass == null ? null : enclosingClass.type;
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+  }
+
+  @override
+  Object visitComment(Comment node) {
+    if (node.parent is FunctionDeclaration ||
+        node.parent is ConstructorDeclaration ||
+        node.parent is MethodDeclaration) {
+      if (!identical(node, _commentBeforeFunction)) {
+        _commentBeforeFunction = node;
+        return null;
+      }
+    }
+    super.visitComment(node);
+    _commentBeforeFunction = null;
+    return null;
+  }
+
+  @override
+  Object visitCommentReference(CommentReference node) {
+    //
+    // We do not visit the identifier because it needs to be visited in the
+    // context of the reference.
+    //
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitCompilationUnit(CompilationUnit node) {
+    //
+    // TODO(brianwilkerson) The goal of the code below is to visit the
+    // declarations in such an order that we can infer type information for
+    // top-level variables before we visit references to them. This is better
+    // than making no effort, but still doesn't completely satisfy that goal
+    // (consider for example "final var a = b; final var b = 0;"; we'll infer a
+    // type of 'int' for 'b', but not for 'a' because of the order of the
+    // visits). Ideally we would create a dependency graph, but that would
+    // require references to be resolved, which they are not.
+    //
+    _overrideManager.enterScope();
+    try {
+      NodeList<Directive> directives = node.directives;
+      int directiveCount = directives.length;
+      for (int i = 0; i < directiveCount; i++) {
+        directives[i].accept(this);
+      }
+      NodeList<CompilationUnitMember> declarations = node.declarations;
+      int declarationCount = declarations.length;
+      for (int i = 0; i < declarationCount; i++) {
+        CompilationUnitMember declaration = declarations[i];
+        if (declaration is! ClassDeclaration) {
+          declaration.accept(this);
+        }
+      }
+      for (int i = 0; i < declarationCount; i++) {
+        CompilationUnitMember declaration = declarations[i];
+        if (declaration is ClassDeclaration) {
+          declaration.accept(this);
+        }
+      }
+    } finally {
+      _overrideManager.exitScope();
+    }
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitConditionalExpression(ConditionalExpression node) {
+    Expression condition = node.condition;
+    safelyVisit(condition);
+    Expression thenExpression = node.thenExpression;
+    if (thenExpression != null) {
+      _overrideManager.enterScope();
+      try {
+        _promoteManager.enterScope();
+        try {
+          _propagateTrueState(condition);
+          // Type promotion.
+          _promoteTypes(condition);
+          _clearTypePromotionsIfPotentiallyMutatedIn(thenExpression);
+          _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(
+              thenExpression);
+          // Visit "then" expression.
+          thenExpression.accept(this);
+        } finally {
+          _promoteManager.exitScope();
+        }
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    Expression elseExpression = node.elseExpression;
+    if (elseExpression != null) {
+      _overrideManager.enterScope();
+      try {
+        _propagateFalseState(condition);
+        elseExpression.accept(this);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    }
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    bool thenIsAbrupt = _isAbruptTerminationExpression(thenExpression);
+    bool elseIsAbrupt = _isAbruptTerminationExpression(elseExpression);
+    if (elseIsAbrupt && !thenIsAbrupt) {
+      _propagateTrueState(condition);
+      _propagateState(thenExpression);
+    } else if (thenIsAbrupt && !elseIsAbrupt) {
+      _propagateFalseState(condition);
+      _propagateState(elseExpression);
+    }
+    return null;
+  }
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    ExecutableElement outerFunction = _enclosingFunction;
+    try {
+      _enclosingFunction = node.element;
+      super.visitConstructorDeclaration(node);
+    } finally {
+      _enclosingFunction = outerFunction;
+    }
+    return null;
+  }
+
+  @override
+  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    //
+    // We visit the expression, but do not visit the field name because it needs
+    // to be visited in the context of the constructor field initializer node.
+    //
+    safelyVisit(node.expression);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitConstructorName(ConstructorName node) {
+    //
+    // We do not visit either the type name, because it won't be visited anyway,
+    // or the name, because it needs to be visited in the context of the
+    // constructor name.
+    //
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitContinueStatement(ContinueStatement node) {
+    //
+    // We do not visit the label because it needs to be visited in the context
+    // of the statement.
+    //
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitDoStatement(DoStatement node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitDoStatement(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    // TODO(brianwilkerson) If the loop can only be exited because the condition
+    // is false, then propagateFalseState(node.getCondition());
+    return null;
+  }
+
+  @override
+  Object visitEmptyFunctionBody(EmptyFunctionBody node) {
+    safelyVisit(_commentBeforeFunction);
+    return super.visitEmptyFunctionBody(node);
+  }
+
+  @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    //
+    // Resolve the metadata in the library scope.
+    //
+    if (node.metadata != null) {
+      node.metadata.accept(this);
+    }
+    //
+    // There is nothing else to do because everything else was resolved by the
+    // element builder.
+    //
+    return null;
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    safelyVisit(_commentBeforeFunction);
+    _overrideManager.enterScope();
+    try {
+      super.visitExpressionFunctionBody(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
+  Object visitFieldDeclaration(FieldDeclaration node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitFieldDeclaration(node);
+    } finally {
+      Map<VariableElement, DartType> overrides =
+          _overrideManager.captureOverrides(node.fields);
+      _overrideManager.exitScope();
+      _overrideManager.applyOverrides(overrides);
+    }
+    return null;
+  }
+
+  @override
+  Object visitForEachStatement(ForEachStatement node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitForEachStatement(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
   void visitForEachStatementInScope(ForEachStatement node) {
     //
-    // We visit the iterator before the loop variable because the loop variable cannot be in scope
-    // while visiting the iterator.
+    // We visit the iterator before the loop variable because the loop variable
+    // cannot be in scope while visiting the iterator.
     //
     Expression iterable = node.iterable;
     safelyVisit(iterable);
@@ -11789,6 +11755,17 @@
   }
 
   @override
+  Object visitForStatement(ForStatement node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitForStatement(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
   void visitForStatementInScope(ForStatement node) {
     safelyVisit(node.variables);
     safelyVisit(node.initialization);
@@ -11801,8 +11778,293 @@
     } finally {
       _overrideManager.exitScope();
     }
-    // TODO(brianwilkerson) If the loop can only be exited because the condition is false, then
-    // propagateFalseState(condition);
+    // TODO(brianwilkerson) If the loop can only be exited because the condition
+    // is false, then propagateFalseState(condition);
+  }
+
+  @override
+  Object visitFunctionDeclaration(FunctionDeclaration node) {
+    ExecutableElement outerFunction = _enclosingFunction;
+    try {
+      SimpleIdentifier functionName = node.name;
+      _enclosingFunction = functionName.staticElement as ExecutableElement;
+      super.visitFunctionDeclaration(node);
+    } finally {
+      _enclosingFunction = outerFunction;
+    }
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpression(FunctionExpression node) {
+    ExecutableElement outerFunction = _enclosingFunction;
+    try {
+      _enclosingFunction = node.element;
+      _overrideManager.enterScope();
+      try {
+        super.visitFunctionExpression(node);
+      } finally {
+        _overrideManager.exitScope();
+      }
+    } finally {
+      _enclosingFunction = outerFunction;
+    }
+    return null;
+  }
+
+  @override
+  Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    safelyVisit(node.function);
+    node.accept(_elementResolver);
+    _inferFunctionExpressionsParametersTypes(node.argumentList);
+    safelyVisit(node.argumentList);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
+    // Resolve the metadata in the library scope.
+    if (node.metadata != null) {
+      node.metadata.accept(this);
+    }
+    FunctionTypeAlias outerAlias = _enclosingFunctionTypeAlias;
+    _enclosingFunctionTypeAlias = node;
+    try {
+      super.visitFunctionTypeAlias(node);
+    } finally {
+      _enclosingFunctionTypeAlias = outerAlias;
+    }
+    return null;
+  }
+
+  @override
+  Object visitHideCombinator(HideCombinator node) => null;
+
+  @override
+  Object visitIfStatement(IfStatement node) {
+    Expression condition = node.condition;
+    safelyVisit(condition);
+    Map<VariableElement, DartType> thenOverrides =
+        new HashMap<VariableElement, DartType>();
+    Statement thenStatement = node.thenStatement;
+    if (thenStatement != null) {
+      _overrideManager.enterScope();
+      try {
+        _promoteManager.enterScope();
+        try {
+          _propagateTrueState(condition);
+          // Type promotion.
+          _promoteTypes(condition);
+          _clearTypePromotionsIfPotentiallyMutatedIn(thenStatement);
+          _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(
+              thenStatement);
+          // Visit "then".
+          visitStatementInScope(thenStatement);
+        } finally {
+          _promoteManager.exitScope();
+        }
+      } finally {
+        thenOverrides = _overrideManager.captureLocalOverrides();
+        _overrideManager.exitScope();
+      }
+    }
+    Map<VariableElement, DartType> elseOverrides =
+        new HashMap<VariableElement, DartType>();
+    Statement elseStatement = node.elseStatement;
+    if (elseStatement != null) {
+      _overrideManager.enterScope();
+      try {
+        _propagateFalseState(condition);
+        visitStatementInScope(elseStatement);
+      } finally {
+        elseOverrides = _overrideManager.captureLocalOverrides();
+        _overrideManager.exitScope();
+      }
+    }
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    // Join overrides.
+    bool thenIsAbrupt = _isAbruptTerminationStatement(thenStatement);
+    bool elseIsAbrupt = _isAbruptTerminationStatement(elseStatement);
+    if (elseIsAbrupt && !thenIsAbrupt) {
+      _propagateTrueState(condition);
+      _overrideManager.applyOverrides(thenOverrides);
+    } else if (thenIsAbrupt && !elseIsAbrupt) {
+      _propagateFalseState(condition);
+      _overrideManager.applyOverrides(elseOverrides);
+    } else if (!thenIsAbrupt && !elseIsAbrupt) {
+      if (AnalysisEngine.instance.enableUnionTypes) {
+        List<Map<VariableElement, DartType>> perBranchOverrides =
+            new List<Map<VariableElement, DartType>>();
+        perBranchOverrides.add(thenOverrides);
+        perBranchOverrides.add(elseOverrides);
+        _overrideManager.joinOverrides(perBranchOverrides);
+      }
+    }
+    return null;
+  }
+
+  @override
+  Object visitLabel(Label node) => null;
+
+  @override
+  Object visitLibraryIdentifier(LibraryIdentifier node) => null;
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    ExecutableElement outerFunction = _enclosingFunction;
+    try {
+      _enclosingFunction = node.element;
+      super.visitMethodDeclaration(node);
+    } finally {
+      _enclosingFunction = outerFunction;
+    }
+    return null;
+  }
+
+  @override
+  Object visitMethodInvocation(MethodInvocation node) {
+    //
+    // We visit the target and argument list, but do not visit the method name
+    // because it needs to be visited in the context of the invocation.
+    //
+    safelyVisit(node.target);
+    node.accept(_elementResolver);
+    _inferFunctionExpressionsParametersTypes(node.argumentList);
+    safelyVisit(node.argumentList);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitNode(AstNode node) {
+    node.visitChildren(this);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
+    //
+    // We visit the prefix, but do not visit the identifier because it needs to
+    // be visited in the context of the prefix.
+    //
+    safelyVisit(node.prefix);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitPropertyAccess(PropertyAccess node) {
+    //
+    // We visit the target, but do not visit the property name because it needs
+    // to be visited in the context of the property access node.
+    //
+    safelyVisit(node.target);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object
+      visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    //
+    // We visit the argument list, but do not visit the optional identifier
+    // because it needs to be visited in the context of the constructor
+    // invocation.
+    //
+    safelyVisit(node.argumentList);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitShowCombinator(ShowCombinator node) => null;
+
+  @override
+  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    //
+    // We visit the argument list, but do not visit the optional identifier
+    // because it needs to be visited in the context of the constructor
+    // invocation.
+    //
+    safelyVisit(node.argumentList);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
+  }
+
+  @override
+  Object visitSwitchCase(SwitchCase node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitSwitchCase(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
+  Object visitSwitchDefault(SwitchDefault node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitSwitchDefault(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+    return null;
+  }
+
+  @override
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitTopLevelVariableDeclaration(node);
+    } finally {
+      Map<VariableElement, DartType> overrides =
+          _overrideManager.captureOverrides(node.variables);
+      _overrideManager.exitScope();
+      _overrideManager.applyOverrides(overrides);
+    }
+    return null;
+  }
+
+  @override
+  Object visitTypeName(TypeName node) => null;
+
+  @override
+  Object visitWhileStatement(WhileStatement node) {
+    // Note: since we don't call the base class, we have to maintain
+    // _implicitLabelScope ourselves.
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
+    try {
+      _implicitLabelScope = _implicitLabelScope.nest(node);
+      Expression condition = node.condition;
+      safelyVisit(condition);
+      Statement body = node.body;
+      if (body != null) {
+        _overrideManager.enterScope();
+        try {
+          _propagateTrueState(condition);
+          visitStatementInScope(body);
+        } finally {
+          _overrideManager.exitScope();
+        }
+      }
+    } finally {
+      _implicitLabelScope = outerImplicitScope;
+    }
+    // TODO(brianwilkerson) If the loop can only be exited because the condition
+    // is false, then propagateFalseState(condition);
+    node.accept(_elementResolver);
+    node.accept(_typeAnalyzer);
+    return null;
   }
 
   /**
@@ -11812,7 +12074,8 @@
    * If the variable <i>v</i> is accessed by a closure in <i>s<sub>1</sub></i> then the variable
    * <i>v</i> is not potentially mutated anywhere in the scope of <i>v</i>.
    */
-  void _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(AstNode target) {
+  void
+      _clearTypePromotionsIfAccessedInClosureAndProtentiallyMutated(AstNode target) {
     for (Element element in _promoteManager.promotedElements) {
       if ((element as VariableElementImpl).isPotentiallyMutatedInScope) {
         if (_isVariableAccessedInClosure(element, target)) {
@@ -11848,7 +12111,8 @@
     DartType expressionType = iteratorExpression.bestType;
     if (expressionType is InterfaceType) {
       InterfaceType interfaceType = expressionType;
-      FunctionType iteratorFunction = _inheritanceManager.lookupMemberType(interfaceType, "iterator");
+      FunctionType iteratorFunction =
+          _inheritanceManager.lookupMemberType(interfaceType, "iterator");
       if (iteratorFunction == null) {
         // TODO(brianwilkerson) Should we report this error?
         return null;
@@ -11856,7 +12120,8 @@
       DartType iteratorType = iteratorFunction.returnType;
       if (iteratorType is InterfaceType) {
         InterfaceType iteratorInterfaceType = iteratorType;
-        FunctionType currentFunction = _inheritanceManager.lookupMemberType(iteratorInterfaceType, "current");
+        FunctionType currentFunction =
+            _inheritanceManager.lookupMemberType(iteratorInterfaceType, "current");
         if (currentFunction == null) {
           // TODO(brianwilkerson) Should we report this error?
           return null;
@@ -11871,7 +12136,8 @@
    * If given "mayBeClosure" is [FunctionExpression] without explicit parameters types and its
    * required type is [FunctionType], then infer parameters types from [FunctionType].
    */
-  void _inferFunctionExpressionParametersTypes(Expression mayBeClosure, DartType mayByFunctionType) {
+  void _inferFunctionExpressionParametersTypes(Expression mayBeClosure,
+      DartType mayByFunctionType) {
     // prepare closure
     if (mayBeClosure is! FunctionExpression) {
       return;
@@ -11882,9 +12148,12 @@
       return;
     }
     FunctionType expectedClosureType = mayByFunctionType as FunctionType;
-    // If the expectedClosureType is not more specific than the static type, return.
-    DartType staticClosureType = (closure.element != null ? closure.element.type : null) as DartType;
-    if (staticClosureType != null && !expectedClosureType.isMoreSpecificThan(staticClosureType)) {
+    // If the expectedClosureType is not more specific than the static type,
+    // return.
+    DartType staticClosureType =
+        (closure.element != null ? closure.element.type : null) as DartType;
+    if (staticClosureType != null &&
+        !expectedClosureType.isMoreSpecificThan(staticClosureType)) {
       return;
     }
     // set propagated type for the closure
@@ -11892,7 +12161,8 @@
     // set inferred types for parameters
     NodeList<FormalParameter> parameters = closure.parameters.parameters;
     List<ParameterElement> expectedParameters = expectedClosureType.parameters;
-    for (int i = 0; i < parameters.length && i < expectedParameters.length; i++) {
+    for (int i =
+        0; i < parameters.length && i < expectedParameters.length; i++) {
       FormalParameter parameter = parameters[i];
       ParameterElement element = parameter.element;
       DartType currentType = _overrideManager.getBestType(element);
@@ -11927,9 +12197,10 @@
    * @return `true` if the given expression terminates abruptly
    */
   bool _isAbruptTerminationExpression(Expression expression) {
-    // TODO(brianwilkerson) This needs to be significantly improved. Ideally we would eventually
-    // turn this into a method on Expression that returns a termination indication (normal, abrupt
-    // with no exception, abrupt with an exception).
+    // TODO(brianwilkerson) This needs to be significantly improved. Ideally we
+    // would eventually turn this into a method on Expression that returns a
+    // termination indication (normal, abrupt with no exception, abrupt with an
+    // exception).
     while (expression is ParenthesizedExpression) {
       expression = (expression as ParenthesizedExpression).expression;
     }
@@ -11944,18 +12215,19 @@
    * @return `true` if the given statement terminates abruptly
    */
   bool _isAbruptTerminationStatement(Statement statement) {
-    // TODO(brianwilkerson) This needs to be significantly improved. Ideally we would eventually
-    // turn this into a method on Statement that returns a termination indication (normal, abrupt
-    // with no exception, abrupt with an exception).
+    // TODO(brianwilkerson) This needs to be significantly improved. Ideally we
+    // would eventually turn this into a method on Statement that returns a
+    // termination indication (normal, abrupt with no exception, abrupt with an
+    // exception).
     //
-    // collinsn: it is unsound to assume that [break] and [continue] are "abrupt".
-    // See: https://code.google.com/p/dart/issues/detail?id=19929#c4 (tests are
-    // included in TypePropagationTest.java).
+    // collinsn: it is unsound to assume that [break] and [continue] are
+    // "abrupt". See: https://code.google.com/p/dart/issues/detail?id=19929#c4
+    // (tests are included in TypePropagationTest.java).
     // In general, the difficulty is loopy control flow.
     //
-    // In the presence of exceptions things become much more complicated, but while
-    // we only use this to propagate at [if]-statement join points, checking for [return]
-    // may work well enough in the common case.
+    // In the presence of exceptions things become much more complicated, but
+    // while we only use this to propagate at [if]-statement join points,
+    // checking for [return] may work well enough in the common case.
     if (statement is ReturnStatement) {
       return true;
     } else if (statement is ExpressionStatement) {
@@ -11966,8 +12238,10 @@
       if (size == 0) {
         return false;
       }
-      // This last-statement-is-return heuristic is unsound for adversarial code,
-      // but probably works well in the common case:
+
+
+      // This last-statement-is-return heuristic is unsound for adversarial
+      // code, but probably works well in the common case:
       //
       //   var x = 123;
       //   var c = true;
@@ -11979,8 +12253,9 @@
       //   }
       //   print(x);
       //
-      // Unsound to assume that [x = "hello";] never executed after the if-statement.
-      // Of course, a dead-code analysis could point out that [return] here is dead.
+      // Unsound to assume that [x = "hello";] never executed after the
+      // if-statement. Of course, a dead-code analysis could point out that
+      // [return] here is dead.
       return _isAbruptTerminationStatement(statements[size - 1]);
     }
     return false;
@@ -11996,8 +12271,8 @@
    * @return `true` if this variable is potentially mutated somewhere in the given ASTNode
    */
   bool _isVariableAccessedInClosure(Element variable, AstNode target) {
-    RecursiveAstVisitor_ResolverVisitor_isVariableAccessedInClosure visitor
-        = new RecursiveAstVisitor_ResolverVisitor_isVariableAccessedInClosure(variable);
+    _ResolverVisitor_isVariableAccessedInClosure visitor =
+        new _ResolverVisitor_isVariableAccessedInClosure(variable);
     target.accept(visitor);
     return visitor.result;
   }
@@ -12011,8 +12286,8 @@
    * @return `true` if this variable is potentially mutated somewhere in the given ASTNode
    */
   bool _isVariablePotentiallyMutatedIn(Element variable, AstNode target) {
-    RecursiveAstVisitor_ResolverVisitor_isVariablePotentiallyMutatedIn visitor
-        = new RecursiveAstVisitor_ResolverVisitor_isVariablePotentiallyMutatedIn(variable);
+    _ResolverVisitor_isVariablePotentiallyMutatedIn visitor =
+        new _ResolverVisitor_isVariablePotentiallyMutatedIn(variable);
     target.accept(visitor);
     return visitor.result;
   }
@@ -12161,26 +12436,6 @@
       expression.propagatedType = type;
     }
   }
-
-  get elementResolver_J2DAccessor => _elementResolver;
-
-  set elementResolver_J2DAccessor(__v) => _elementResolver = __v;
-
-  get labelScope_J2DAccessor => _labelScope;
-
-  set labelScope_J2DAccessor(__v) => _labelScope = __v;
-
-  get nameScope_J2DAccessor => _nameScope;
-
-  set nameScope_J2DAccessor(__v) => _nameScope = __v;
-
-  get typeAnalyzer_J2DAccessor => _typeAnalyzer;
-
-  set typeAnalyzer_J2DAccessor(__v) => _typeAnalyzer = __v;
-
-  get enclosingClass_J2DAccessor => _enclosingClass;
-
-  set enclosingClass_J2DAccessor(__v) => _enclosingClass = __v;
 }
 
 /**
@@ -12206,14 +12461,6 @@
   static String UNARY_MINUS = "unary-";
 
   /**
-   * Return `true` if the given name is a library-private name.
-   *
-   * @param name the name being tested
-   * @return `true` if the given name is a library-private name
-   */
-  static bool isPrivateName(String name) => name != null && StringUtilities.startsWithChar(name, PRIVATE_NAME_PREFIX);
-
-  /**
    * A table mapping names that are defined in this scope to the element representing the thing
    * declared with that name.
    */
@@ -12225,6 +12472,20 @@
   bool _hasName = false;
 
   /**
+   * Return the scope in which this scope is lexically enclosed.
+   *
+   * @return the scope in which this scope is lexically enclosed
+   */
+  Scope get enclosingScope => null;
+
+  /**
+   * Return the listener that is to be informed when an error is encountered.
+   *
+   * @return the listener that is to be informed when an error is encountered
+   */
+  AnalysisErrorListener get errorListener;
+
+  /**
    * Add the given element to this scope. If there is already an element with the given name defined
    * in this scope, then an error will be generated and the original element will continue to be
    * mapped to the name. If there is an element with the given name in an enclosing scope, then a
@@ -12236,7 +12497,8 @@
     String name = _getName(element);
     if (name != null && !name.isEmpty) {
       if (_definedNames.containsKey(name)) {
-        errorListener.onError(getErrorForDuplicate(_definedNames[name], element));
+        errorListener.onError(
+            getErrorForDuplicate(_definedNames[name], element));
       } else {
         _definedNames[name] = element;
         _hasName = true;
@@ -12245,24 +12507,6 @@
   }
 
   /**
-   * Return the scope in which this scope is lexically enclosed.
-   *
-   * @return the scope in which this scope is lexically enclosed
-   */
-  Scope get enclosingScope => null;
-
-  /**
-   * Return the element with which the given identifier is associated, or `null` if the name
-   * is not defined within this scope.
-   *
-   * @param identifier the identifier associated with the element to be returned
-   * @param referencingLibrary the library that contains the reference to the name, used to
-   *          implement library-level privacy
-   * @return the element with which the given identifier is associated
-   */
-  Element lookup(Identifier identifier, LibraryElement referencingLibrary) => internalLookup(identifier, identifier.name, referencingLibrary);
-
-  /**
    * Add the given element to this scope without checking for duplication or hiding.
    *
    * @param name the name of the element to be added
@@ -12292,21 +12536,20 @@
    * @return the error code used to report duplicate names within a scope
    */
   AnalysisError getErrorForDuplicate(Element existing, Element duplicate) {
-    // TODO(brianwilkerson) Customize the error message based on the types of elements that share
-    // the same name.
-    // TODO(jwren) There are 4 error codes for duplicate, but only 1 is being generated.
+    // TODO(brianwilkerson) Customize the error message based on the types of
+    // elements that share the same name.
+    // TODO(jwren) There are 4 error codes for duplicate, but only 1 is being
+    // generated.
     Source source = duplicate.source;
-    return new AnalysisError.con2(source, duplicate.nameOffset, duplicate.displayName.length, CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.displayName]);
+    return new AnalysisError.con2(
+        source,
+        duplicate.nameOffset,
+        duplicate.displayName.length,
+        CompileTimeErrorCode.DUPLICATE_DEFINITION,
+        [existing.displayName]);
   }
 
   /**
-   * Return the listener that is to be informed when an error is encountered.
-   *
-   * @return the listener that is to be informed when an error is encountered
-   */
-  AnalysisErrorListener get errorListener;
-
-  /**
    * Return the source that contains the given identifier, or the source associated with this scope
    * if the source containing the identifier could not be determined.
    *
@@ -12335,7 +12578,8 @@
    *          implement library-level privacy
    * @return the element with which the given name is associated
    */
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary);
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary);
 
   /**
    * Return the element with which the given name is associated, or `null` if the name is not
@@ -12355,6 +12599,18 @@
   }
 
   /**
+   * Return the element with which the given identifier is associated, or `null` if the name
+   * is not defined within this scope.
+   *
+   * @param identifier the identifier associated with the element to be returned
+   * @param referencingLibrary the library that contains the reference to the name, used to
+   *          implement library-level privacy
+   * @return the element with which the given identifier is associated
+   */
+  Element lookup(Identifier identifier, LibraryElement referencingLibrary) =>
+      internalLookup(identifier, identifier.name, referencingLibrary);
+
+  /**
    * Return the name that will be used to look up the given element.
    *
    * @param element the element whose look-up name is to be returned
@@ -12369,123 +12625,15 @@
     }
     return element.name;
   }
-}
-
-/**
- * Instances of the class `ScopeBuilder` build the scope for a given node in an AST structure.
- * At the moment, this class only handles top-level and class-level declarations.
- */
-class ScopeBuilder {
-  /**
-   * Return the scope in which the given AST structure should be resolved.
-   *
-   * @param node the root of the AST structure to be resolved
-   * @param errorListener the listener to which analysis errors will be reported
-   * @return the scope in which the given AST structure should be resolved
-   * @throws AnalysisException if the AST structure has not been resolved or is not part of a
-   *           [CompilationUnit]
-   */
-  static Scope scopeFor(AstNode node, AnalysisErrorListener errorListener) {
-    if (node == null) {
-      throw new AnalysisException("Cannot create scope: node is null");
-    } else if (node is CompilationUnit) {
-      ScopeBuilder builder = new ScopeBuilder(errorListener);
-      return builder._scopeForAstNode(node);
-    }
-    AstNode parent = node.parent;
-    if (parent == null) {
-      throw new AnalysisException("Cannot create scope: node is not part of a CompilationUnit");
-    }
-    ScopeBuilder builder = new ScopeBuilder(errorListener);
-    return builder._scopeForAstNode(parent);
-  }
 
   /**
-   * The listener to which analysis errors will be reported.
-   */
-  final AnalysisErrorListener _errorListener;
-
-  /**
-   * Initialize a newly created scope builder to generate a scope that will report errors to the
-   * given listener.
+   * Return `true` if the given name is a library-private name.
    *
-   * @param errorListener the listener to which analysis errors will be reported
+   * @param name the name being tested
+   * @return `true` if the given name is a library-private name
    */
-  ScopeBuilder(this._errorListener);
-
-  /**
-   * Return the scope in which the given AST structure should be resolved.
-   *
-   * <b>Note:</b> This method needs to be kept in sync with
-   * [IncrementalResolver.canBeResolved].
-   *
-   * @param node the root of the AST structure to be resolved
-   * @return the scope in which the given AST structure should be resolved
-   * @throws AnalysisException if the AST structure has not been resolved or is not part of a
-   *           [CompilationUnit]
-   */
-  Scope _scopeForAstNode(AstNode node) {
-    if (node is CompilationUnit) {
-      return _scopeForCompilationUnit(node);
-    }
-    AstNode parent = node.parent;
-    if (parent == null) {
-      throw new AnalysisException("Cannot create scope: node is not part of a CompilationUnit");
-    }
-    Scope scope = _scopeForAstNode(parent);
-    if (node is ClassDeclaration) {
-      ClassElement element = node.element;
-      if (element == null) {
-        throw new AnalysisException("Cannot build a scope for an unresolved class");
-      }
-      scope = new ClassScope(new TypeParameterScope(scope, element), element);
-    } else if (node is ClassTypeAlias) {
-      ClassElement element = node.element;
-      if (element == null) {
-        throw new AnalysisException("Cannot build a scope for an unresolved class type alias");
-      }
-      scope = new ClassScope(new TypeParameterScope(scope, element), element);
-    } else if (node is ConstructorDeclaration) {
-      ConstructorElement element = node.element;
-      if (element == null) {
-        throw new AnalysisException("Cannot build a scope for an unresolved constructor");
-      }
-      FunctionScope functionScope = new FunctionScope(scope, element);
-      functionScope.defineParameters();
-      scope = functionScope;
-    } else if (node is FunctionDeclaration) {
-      ExecutableElement element = node.element;
-      if (element == null) {
-        throw new AnalysisException("Cannot build a scope for an unresolved function");
-      }
-      FunctionScope functionScope = new FunctionScope(scope, element);
-      functionScope.defineParameters();
-      scope = functionScope;
-    } else if (node is FunctionTypeAlias) {
-      scope = new FunctionTypeScope(scope, node.element);
-    } else if (node is MethodDeclaration) {
-      ExecutableElement element = node.element;
-      if (element == null) {
-        throw new AnalysisException("Cannot build a scope for an unresolved method");
-      }
-      FunctionScope functionScope = new FunctionScope(scope, element);
-      functionScope.defineParameters();
-      scope = functionScope;
-    }
-    return scope;
-  }
-
-  Scope _scopeForCompilationUnit(CompilationUnit node) {
-    CompilationUnitElement unitElement = node.element;
-    if (unitElement == null) {
-      throw new AnalysisException("Cannot create scope: compilation unit is not resolved");
-    }
-    LibraryElement libraryElement = unitElement.library;
-    if (libraryElement == null) {
-      throw new AnalysisException("Cannot create scope: compilation unit is not part of a library");
-    }
-    return new LibraryScope(libraryElement, _errorListener);
-  }
+  static bool isPrivateName(String name) =>
+      name != null && StringUtilities.startsWithChar(name, PRIVATE_NAME_PREFIX);
 }
 
 /**
@@ -12519,6 +12667,11 @@
   final TypeProvider typeProvider;
 
   /**
+   * The scope used to resolve unlabeled `break` and `continue` statements.
+   */
+  ImplicitLabelScope _implicitLabelScope = ImplicitLabelScope.ROOT;
+
+  /**
    * The scope used to resolve labels for `break` and `continue` statements, or
    * `null` if no labels have been defined in the current context.
    */
@@ -12528,7 +12681,7 @@
    * The class containing the AST nodes being visited,
    * or `null` if we are not in the scope of a class.
    */
-  ClassElement _enclosingClass;
+  ClassElement enclosingClass;
 
   /**
    * Initialize a newly created visitor to resolve the nodes in a compilation unit.
@@ -12554,7 +12707,8 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  ScopedVisitor.con2(LibraryElement definingLibrary, this.source, this.typeProvider, AnalysisErrorListener errorListener) {
+  ScopedVisitor.con2(LibraryElement definingLibrary, this.source,
+      this.typeProvider, AnalysisErrorListener errorListener) {
     this._definingLibrary = definingLibrary;
     this._errorListener = errorListener;
     this._nameScope = new LibraryScope(definingLibrary, errorListener);
@@ -12571,7 +12725,8 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  ScopedVisitor.con3(LibraryElement definingLibrary, this.source, this.typeProvider, Scope nameScope, AnalysisErrorListener errorListener) {
+  ScopedVisitor.con3(LibraryElement definingLibrary, this.source,
+      this.typeProvider, Scope nameScope, AnalysisErrorListener errorListener) {
     this._definingLibrary = definingLibrary;
     this._errorListener = errorListener;
     this._nameScope = nameScope;
@@ -12584,7 +12739,8 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  ScopedVisitor.con4(ResolvableLibrary library, this.source, this.typeProvider) {
+  ScopedVisitor.con4(ResolvableLibrary library, this.source, this.typeProvider)
+      {
     this._definingLibrary = library.libraryElement;
     LibraryScope libraryScope = library.libraryScope;
     this._errorListener = libraryScope.errorListener;
@@ -12599,6 +12755,26 @@
   LibraryElement get definingLibrary => _definingLibrary;
 
   /**
+   * Return the implicit label scope in which the current node is being
+   * resolved.
+   */
+  ImplicitLabelScope get implicitLabelScope => _implicitLabelScope;
+
+  /**
+   * Return the label scope in which the current node is being resolved.
+   *
+   * @return the label scope in which the current node is being resolved
+   */
+  LabelScope get labelScope => _labelScope;
+
+  /**
+   * Return the name scope in which the current node is being resolved.
+   *
+   * @return the name scope in which the current node is being resolved
+   */
+  Scope get nameScope => _nameScope;
+
+  /**
    * Replaces the current [Scope] with the enclosing [Scope].
    *
    * @return the enclosing [Scope].
@@ -12619,6 +12795,62 @@
     return _nameScope;
   }
 
+  /**
+   * Report an error with the given error code and arguments.
+   *
+   * @param errorCode the error code of the error to be reported
+   * @param node the node specifying the location of the error
+   * @param arguments the arguments to the error, used to compose the error message
+   */
+  void reportErrorForNode(ErrorCode errorCode, AstNode node,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(source, node.offset, node.length, errorCode, arguments));
+  }
+
+  /**
+   * Report an error with the given error code and arguments.
+   *
+   * @param errorCode the error code of the error to be reported
+   * @param offset the offset of the location of the error
+   * @param length the length of the location of the error
+   * @param arguments the arguments to the error, used to compose the error message
+   */
+  void reportErrorForOffset(ErrorCode errorCode, int offset, int length,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(source, offset, length, errorCode, arguments));
+  }
+
+  /**
+   * Report an error with the given error code and arguments.
+   *
+   * @param errorCode the error code of the error to be reported
+   * @param token the token specifying the location of the error
+   * @param arguments the arguments to the error, used to compose the error message
+   */
+  void reportErrorForToken(ErrorCode errorCode, sc.Token token,
+      [List<Object> arguments]) {
+    _errorListener.onError(
+        new AnalysisError.con2(
+            source,
+            token.offset,
+            token.length,
+            errorCode,
+            arguments));
+  }
+
+  /**
+   * Visit the given AST node if it is not null.
+   *
+   * @param node the node to be visited
+   */
+  void safelyVisit(AstNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+
   @override
   Object visitBlock(Block node) {
     Scope outerScope = _nameScope;
@@ -12634,6 +12866,18 @@
   }
 
   @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    ImplicitLabelScope implicitOuterScope = _implicitLabelScope;
+    try {
+      _implicitLabelScope = ImplicitLabelScope.ROOT;
+      super.visitBlockFunctionBody(node);
+    } finally {
+      _implicitLabelScope = implicitOuterScope;
+    }
+    return null;
+  }
+
+  @override
   Object visitCatchClause(CatchClause node) {
     SimpleIdentifier exception = node.exceptionParameter;
     if (exception != null) {
@@ -12666,15 +12910,15 @@
             new CaughtException(new AnalysisException(), null));
         super.visitClassDeclaration(node);
       } else {
-        ClassElement outerClass = _enclosingClass;
+        ClassElement outerClass = enclosingClass;
         try {
-          _enclosingClass = node.element;
+          enclosingClass = node.element;
           _nameScope = new TypeParameterScope(_nameScope, classElement);
           visitClassDeclarationInScope(node);
           _nameScope = new ClassScope(_nameScope, classElement);
           visitClassMembersInScope(node);
         } finally {
-          _enclosingClass = outerClass;
+          enclosingClass = outerClass;
         }
       }
     } finally {
@@ -12683,12 +12927,28 @@
     return null;
   }
 
+  void visitClassDeclarationInScope(ClassDeclaration node) {
+    safelyVisit(node.name);
+    safelyVisit(node.typeParameters);
+    safelyVisit(node.extendsClause);
+    safelyVisit(node.withClause);
+    safelyVisit(node.implementsClause);
+    safelyVisit(node.nativeClause);
+  }
+
+  void visitClassMembersInScope(ClassDeclaration node) {
+    safelyVisit(node.documentationComment);
+    node.metadata.accept(this);
+    node.members.accept(this);
+  }
+
   @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
     Scope outerScope = _nameScope;
     try {
       ClassElement element = node.element;
-      _nameScope = new ClassScope(new TypeParameterScope(_nameScope, element), element);
+      _nameScope =
+          new ClassScope(new TypeParameterScope(_nameScope, element), element);
       super.visitClassTypeAlias(node);
     } finally {
       _nameScope = outerScope;
@@ -12736,13 +12996,13 @@
 
   @override
   Object visitDoStatement(DoStatement node) {
-    LabelScope outerLabelScope = _labelScope;
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
     try {
-      _labelScope = new LabelScope.con1(_labelScope, false, false);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
       visitStatementInScope(node.body);
       safelyVisit(node.condition);
     } finally {
-      _labelScope = outerLabelScope;
+      _implicitLabelScope = outerImplicitScope;
     }
     return null;
   }
@@ -12750,22 +13010,41 @@
   @override
   Object visitForEachStatement(ForEachStatement node) {
     Scope outerNameScope = _nameScope;
-    LabelScope outerLabelScope = _labelScope;
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
     try {
       _nameScope = new EnclosedScope(_nameScope);
-      _labelScope = new LabelScope.con1(outerLabelScope, false, false);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
       visitForEachStatementInScope(node);
     } finally {
-      _labelScope = outerLabelScope;
       _nameScope = outerNameScope;
+      _implicitLabelScope = outerImplicitScope;
     }
     return null;
   }
 
+  /**
+   * Visit the given statement after it's scope has been created. This replaces the normal call to
+   * the inherited visit method so that ResolverVisitor can intervene when type propagation is
+   * enabled.
+   *
+   * @param node the statement to be visited
+   */
+  void visitForEachStatementInScope(ForEachStatement node) {
+    //
+    // We visit the iterator before the loop variable because the loop variable
+    // cannot be in scope while visiting the iterator.
+    //
+    safelyVisit(node.identifier);
+    safelyVisit(node.iterable);
+    safelyVisit(node.loopVariable);
+    visitStatementInScope(node.body);
+  }
+
   @override
   Object visitFormalParameterList(FormalParameterList node) {
     super.visitFormalParameterList(node);
-    // We finished resolving function signature, now include formal parameters scope.
+    // We finished resolving function signature, now include formal parameters
+    // scope.
     if (_nameScope is FunctionScope) {
       (_nameScope as FunctionScope).defineParameters();
     }
@@ -12778,18 +13057,33 @@
   @override
   Object visitForStatement(ForStatement node) {
     Scope outerNameScope = _nameScope;
-    LabelScope outerLabelScope = _labelScope;
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
     try {
       _nameScope = new EnclosedScope(_nameScope);
-      _labelScope = new LabelScope.con1(outerLabelScope, false, false);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
       visitForStatementInScope(node);
     } finally {
-      _labelScope = outerLabelScope;
       _nameScope = outerNameScope;
+      _implicitLabelScope = outerImplicitScope;
     }
     return null;
   }
 
+  /**
+   * Visit the given statement after it's scope has been created. This replaces the normal call to
+   * the inherited visit method so that ResolverVisitor can intervene when type propagation is
+   * enabled.
+   *
+   * @param node the statement to be visited
+   */
+  void visitForStatementInScope(ForStatement node) {
+    safelyVisit(node.variables);
+    safelyVisit(node.initialization);
+    safelyVisit(node.condition);
+    node.updaters.accept(this);
+    visitStatementInScope(node.body);
+  }
+
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     ExecutableElement functionElement = node.element;
@@ -12829,7 +13123,8 @@
           while (parent != null) {
             if (parent is Declaration) {
               Element parentElement = (parent as Declaration).element;
-              buffer.write(parentElement == null ? "<unknown> " : "${parentElement.name} ");
+              buffer.write(
+                  parentElement == null ? "<unknown> " : "${parentElement.name} ");
             }
             parent = parent.parent;
           }
@@ -12871,7 +13166,7 @@
 
   @override
   Object visitLabeledStatement(LabeledStatement node) {
-    LabelScope outerScope = _addScopesFor(node.labels);
+    LabelScope outerScope = _addScopesFor(node.labels, node.unlabeled);
     try {
       super.visitLabeledStatement(node);
     } finally {
@@ -12899,6 +13194,28 @@
     return null;
   }
 
+  /**
+   * Visit the given statement after it's scope has been created. This is used by ResolverVisitor to
+   * correctly visit the 'then' and 'else' statements of an 'if' statement.
+   *
+   * @param node the statement to be visited
+   */
+  void visitStatementInScope(Statement node) {
+    if (node is Block) {
+      // Don't create a scope around a block because the block will create it's
+      // own scope.
+      visitBlock(node);
+    } else if (node != null) {
+      Scope outerNameScope = _nameScope;
+      try {
+        _nameScope = new EnclosedScope(_nameScope);
+        node.accept(this);
+      } finally {
+        _nameScope = outerNameScope;
+      }
+    }
+  }
+
   @override
   Object visitSwitchCase(SwitchCase node) {
     node.expression.accept(this);
@@ -12927,18 +13244,21 @@
   @override
   Object visitSwitchStatement(SwitchStatement node) {
     LabelScope outerScope = _labelScope;
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
     try {
-      _labelScope = new LabelScope.con1(outerScope, true, false);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
       for (SwitchMember member in node.members) {
         for (Label label in member.labels) {
           SimpleIdentifier labelName = label.label;
           LabelElement labelElement = labelName.staticElement as LabelElement;
-          _labelScope = new LabelScope.con2(_labelScope, labelName.name, labelElement);
+          _labelScope =
+              new LabelScope(_labelScope, labelName.name, member, labelElement);
         }
       }
       super.visitSwitchStatement(node);
     } finally {
       _labelScope = outerScope;
+      _implicitLabelScope = outerImplicitScope;
     }
     return null;
   }
@@ -12946,7 +13266,8 @@
   @override
   Object visitVariableDeclaration(VariableDeclaration node) {
     super.visitVariableDeclaration(node);
-    if (node.parent.parent is! TopLevelVariableDeclaration && node.parent.parent is! FieldDeclaration) {
+    if (node.parent.parent is! TopLevelVariableDeclaration &&
+        node.parent.parent is! FieldDeclaration) {
       VariableElement element = node.element;
       if (element != null) {
         _nameScope.define(element);
@@ -12957,158 +13278,30 @@
 
   @override
   Object visitWhileStatement(WhileStatement node) {
-    LabelScope outerScope = _labelScope;
+    safelyVisit(node.condition);
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
     try {
-      _labelScope = new LabelScope.con1(outerScope, false, false);
-      safelyVisit(node.condition);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
       visitStatementInScope(node.body);
     } finally {
-      _labelScope = outerScope;
+      _implicitLabelScope = outerImplicitScope;
     }
     return null;
   }
 
   /**
-   * Return the label scope in which the current node is being resolved.
-   *
-   * @return the label scope in which the current node is being resolved
-   */
-  LabelScope get labelScope => _labelScope;
-
-  /**
-   * Return the name scope in which the current node is being resolved.
-   *
-   * @return the name scope in which the current node is being resolved
-   */
-  Scope get nameScope => _nameScope;
-
-  /**
-   * Report an error with the given error code and arguments.
-   *
-   * @param errorCode the error code of the error to be reported
-   * @param node the node specifying the location of the error
-   * @param arguments the arguments to the error, used to compose the error message
-   */
-  void reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(source, node.offset, node.length, errorCode, arguments));
-  }
-
-  /**
-   * Report an error with the given error code and arguments.
-   *
-   * @param errorCode the error code of the error to be reported
-   * @param offset the offset of the location of the error
-   * @param length the length of the location of the error
-   * @param arguments the arguments to the error, used to compose the error message
-   */
-  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(source, offset, length, errorCode, arguments));
-  }
-
-  /**
-   * Report an error with the given error code and arguments.
-   *
-   * @param errorCode the error code of the error to be reported
-   * @param token the token specifying the location of the error
-   * @param arguments the arguments to the error, used to compose the error message
-   */
-  void reportErrorForToken(ErrorCode errorCode, sc.Token token, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(source, token.offset, token.length, errorCode, arguments));
-  }
-
-  /**
-   * Visit the given AST node if it is not null.
-   *
-   * @param node the node to be visited
-   */
-  void safelyVisit(AstNode node) {
-    if (node != null) {
-      node.accept(this);
-    }
-  }
-
-  void visitClassDeclarationInScope(ClassDeclaration node) {
-    safelyVisit(node.name);
-    safelyVisit(node.typeParameters);
-    safelyVisit(node.extendsClause);
-    safelyVisit(node.withClause);
-    safelyVisit(node.implementsClause);
-    safelyVisit(node.nativeClause);
-  }
-
-  void visitClassMembersInScope(ClassDeclaration node) {
-    safelyVisit(node.documentationComment);
-    node.metadata.accept(this);
-    node.members.accept(this);
-  }
-
-  /**
-   * Visit the given statement after it's scope has been created. This replaces the normal call to
-   * the inherited visit method so that ResolverVisitor can intervene when type propagation is
-   * enabled.
-   *
-   * @param node the statement to be visited
-   */
-  void visitForEachStatementInScope(ForEachStatement node) {
-    //
-    // We visit the iterator before the loop variable because the loop variable cannot be in scope
-    // while visiting the iterator.
-    //
-    safelyVisit(node.identifier);
-    safelyVisit(node.iterable);
-    safelyVisit(node.loopVariable);
-    visitStatementInScope(node.body);
-  }
-
-  /**
-   * Visit the given statement after it's scope has been created. This replaces the normal call to
-   * the inherited visit method so that ResolverVisitor can intervene when type propagation is
-   * enabled.
-   *
-   * @param node the statement to be visited
-   */
-  void visitForStatementInScope(ForStatement node) {
-    safelyVisit(node.variables);
-    safelyVisit(node.initialization);
-    safelyVisit(node.condition);
-    node.updaters.accept(this);
-    visitStatementInScope(node.body);
-  }
-
-  /**
-   * Visit the given statement after it's scope has been created. This is used by ResolverVisitor to
-   * correctly visit the 'then' and 'else' statements of an 'if' statement.
-   *
-   * @param node the statement to be visited
-   */
-  void visitStatementInScope(Statement node) {
-    if (node is Block) {
-      // Don't create a scope around a block because the block will create it's own scope.
-      visitBlock(node);
-    } else if (node != null) {
-      Scope outerNameScope = _nameScope;
-      try {
-        _nameScope = new EnclosedScope(_nameScope);
-        node.accept(this);
-      } finally {
-        _nameScope = outerNameScope;
-      }
-    }
-  }
-
-  /**
    * Add scopes for each of the given labels.
    *
    * @param labels the labels for which new scopes are to be added
    * @return the scope that was in effect before the new scopes were added
    */
-  LabelScope _addScopesFor(NodeList<Label> labels) {
+  LabelScope _addScopesFor(NodeList<Label> labels, AstNode node) {
     LabelScope outerScope = _labelScope;
     for (Label label in labels) {
       SimpleIdentifier labelNameNode = label.label;
       String labelName = labelNameNode.name;
       LabelElement labelElement = labelNameNode.staticElement as LabelElement;
-      _labelScope = new LabelScope.con2(_labelScope, labelName, labelElement);
+      _labelScope = new LabelScope(_labelScope, labelName, node, labelElement);
     }
     return outerScope;
   }
@@ -13146,7 +13339,8 @@
    * A map between [ClassElement]s and a set of [ClassElement]s that are subtypes of the
    * key.
    */
-  HashMap<ClassElement, HashSet<ClassElement>> _subtypeMap = new HashMap<ClassElement, HashSet<ClassElement>>();
+  HashMap<ClassElement, HashSet<ClassElement>> _subtypeMap =
+      new HashMap<ClassElement, HashSet<ClassElement>>();
 
   /**
    * The set of all [LibraryElement]s that have been visited by the manager. This is used both
@@ -13163,9 +13357,13 @@
   HashSet<ClassElement> computeAllSubtypes(ClassElement classElement) {
     // Ensure that we have generated the subtype map for the library
     _computeSubtypesInLibrary(classElement.library);
-    // use the subtypeMap to compute the set of all subtypes and subtype's subtypes
+    // use the subtypeMap to compute the set of all subtypes and subtype's
+    // subtypes
     HashSet<ClassElement> allSubtypes = new HashSet<ClassElement>();
-    _safelyComputeAllSubtypes(classElement, new HashSet<ClassElement>(), allSubtypes);
+    _safelyComputeAllSubtypes(
+        classElement,
+        new HashSet<ClassElement>(),
+        allSubtypes);
     return allSubtypes;
   }
 
@@ -13257,7 +13455,8 @@
    * @param supertypeElement the key for the [subtypeMap] map
    * @param subtypeElement the value for the [subtypeMap] map
    */
-  void _putInSubtypeMap(ClassElement supertypeElement, ClassElement subtypeElement) {
+  void _putInSubtypeMap(ClassElement supertypeElement,
+      ClassElement subtypeElement) {
     HashSet<ClassElement> subtypes = _subtypeMap[supertypeElement];
     if (subtypes == null) {
       subtypes = new HashSet<ClassElement>();
@@ -13274,7 +13473,8 @@
    * @param visitedClasses the set of class elements that this method has already recursively seen
    * @param allSubtypes the computed set of subtypes of the passed class element
    */
-  void _safelyComputeAllSubtypes(ClassElement classElement, HashSet<ClassElement> visitedClasses, HashSet<ClassElement> allSubtypes) {
+  void _safelyComputeAllSubtypes(ClassElement classElement,
+      HashSet<ClassElement> visitedClasses, HashSet<ClassElement> allSubtypes) {
     if (!visitedClasses.add(classElement)) {
       // if this class has already been called on this class element
       return;
@@ -13326,7 +13526,8 @@
     while (token != null && token.type != sc.TokenType.EOF) {
       sc.Token commentToken = token.precedingComments;
       while (commentToken != null) {
-        if (commentToken.type == sc.TokenType.SINGLE_LINE_COMMENT || commentToken.type == sc.TokenType.MULTI_LINE_COMMENT) {
+        if (commentToken.type == sc.TokenType.SINGLE_LINE_COMMENT ||
+            commentToken.type == sc.TokenType.MULTI_LINE_COMMENT) {
           _scrapeTodoComment(commentToken);
         }
         commentToken = commentToken.next;
@@ -13341,11 +13542,19 @@
    * @param commentToken the comment token to analyze
    */
   void _scrapeTodoComment(sc.Token commentToken) {
-    JavaPatternMatcher matcher = new JavaPatternMatcher(TodoCode.TODO_REGEX, commentToken.lexeme);
+    JavaPatternMatcher matcher =
+        new JavaPatternMatcher(TodoCode.TODO_REGEX, commentToken.lexeme);
     if (matcher.find()) {
-      int offset = commentToken.offset + matcher.start() + matcher.group(1).length;
+      int offset =
+          commentToken.offset +
+          matcher.start() +
+          matcher.group(1).length;
       int length = matcher.group(2).length;
-      _errorReporter.reportErrorForOffset(TodoCode.TODO, offset, length, [matcher.group(2)]);
+      _errorReporter.reportErrorForOffset(
+          TodoCode.TODO,
+          offset,
+          length,
+          [matcher.group(2)]);
     }
   }
 }
@@ -13380,7 +13589,8 @@
    */
   Map<VariableElement, DartType> captureLocalOverrides() {
     if (_currentScope == null) {
-      throw new IllegalStateException("Cannot capture local overrides without a scope");
+      throw new IllegalStateException(
+          "Cannot capture local overrides without a scope");
     }
     return _currentScope.captureLocalOverrides();
   }
@@ -13392,9 +13602,11 @@
    * @param variableList the list of variables whose overriding types are to be captured
    * @return a table mapping elements to their overriding types
    */
-  Map<VariableElement, DartType> captureOverrides(VariableDeclarationList variableList) {
+  Map<VariableElement, DartType>
+      captureOverrides(VariableDeclarationList variableList) {
     if (_currentScope == null) {
-      throw new IllegalStateException("Cannot capture overrides without a scope");
+      throw new IllegalStateException(
+          "Cannot capture overrides without a scope");
     }
     return _currentScope.captureOverrides(variableList);
   }
@@ -13477,10 +13689,12 @@
    */
   void joinOverrides(List<Map<VariableElement, DartType>> perBranchOverrides) {
     if (perBranchOverrides.length < 2) {
-      throw new IllegalArgumentException("There is no point in joining zero or one override sets.");
+      throw new IllegalArgumentException(
+          "There is no point in joining zero or one override sets.");
     }
     Set<VariableElement> allElements = new HashSet<VariableElement>();
-    Set<VariableElement> commonElements = new HashSet<VariableElement>.from(perBranchOverrides[0].keys.toSet());
+    Set<VariableElement> commonElements =
+        new HashSet<VariableElement>.from(perBranchOverrides[0].keys.toSet());
     for (Map<VariableElement, DartType> os in perBranchOverrides) {
       // Union: elements updated in some branch.
       allElements.addAll(os.keys.toSet());
@@ -13490,7 +13704,8 @@
     Set<VariableElement> uncommonElements = allElements;
     // Difference: elements updated in some but not all branches.
     uncommonElements.removeAll(commonElements);
-    Map<VariableElement, DartType> joinOverrides = new HashMap<VariableElement, DartType>();
+    Map<VariableElement, DartType> joinOverrides =
+        new HashMap<VariableElement, DartType>();
     // The common elements were updated in all branches, so their type
     // before branching can be ignored.
     for (VariableElement e in commonElements) {
@@ -13539,7 +13754,8 @@
   /**
    * A table mapping elements to the overridden type of that element.
    */
-  Map<VariableElement, DartType> _overridenTypes = new HashMap<VariableElement, DartType>();
+  Map<VariableElement, DartType> _overridenTypes =
+      new HashMap<VariableElement, DartType>();
 
   /**
    * Initialize a newly created scope to be an empty child of the given scope.
@@ -13574,8 +13790,10 @@
    * @param variableList the list of variables whose overriding types are to be captured
    * @return a table mapping elements to their overriding types
    */
-  Map<VariableElement, DartType> captureOverrides(VariableDeclarationList variableList) {
-    Map<VariableElement, DartType> overrides = new HashMap<VariableElement, DartType>();
+  Map<VariableElement, DartType>
+      captureOverrides(VariableDeclarationList variableList) {
+    Map<VariableElement, DartType> overrides =
+        new HashMap<VariableElement, DartType>();
     if (variableList.isConst || variableList.isFinal) {
       for (VariableDeclaration variable in variableList.variables) {
         VariableElement element = variable.element;
@@ -13632,7 +13850,8 @@
    * @param enclosingScope the scope in which this scope is lexically enclosed
    * @param typeElement the element representing the type represented by this scope
    */
-  TypeParameterScope(Scope enclosingScope, ClassElement typeElement) : super(enclosingScope) {
+  TypeParameterScope(Scope enclosingScope, ClassElement typeElement)
+      : super(enclosingScope) {
     if (typeElement == null) {
       throw new IllegalArgumentException("class element cannot be null");
     }
@@ -13662,6 +13881,11 @@
   TypePromotionManager_TypePromoteScope _currentScope;
 
   /**
+   * Returns the elements with promoted types.
+   */
+  Iterable<Element> get promotedElements => _currentScope.promotedElements;
+
+  /**
    * Enter a new promotions scope.
    */
   void enterScope() {
@@ -13679,11 +13903,6 @@
   }
 
   /**
-   * Returns the elements with promoted types.
-   */
-  Iterable<Element> get promotedElements => _currentScope.promotedElements;
-
-  /**
    * Returns static type of the given variable - declared or promoted.
    *
    * @return the static type of the given variable - declared or promoted
@@ -14066,7 +14285,8 @@
   InterfaceType _getType(Namespace namespace, String typeName) {
     Element element = namespace.get(typeName);
     if (element == null) {
-      AnalysisEngine.instance.logger.logInformation("No definition of type $typeName");
+      AnalysisEngine.instance.logger.logInformation(
+          "No definition of type $typeName");
       return null;
     }
     return (element as ClassElement).type;
@@ -14078,7 +14298,8 @@
    * @param library the library containing the definitions of the core types
    */
   void _initializeFrom(LibraryElement library) {
-    Namespace namespace = new NamespaceBuilder().createPublicNamespaceForLibrary(library);
+    Namespace namespace =
+        new NamespaceBuilder().createPublicNamespaceForLibrary(library);
     _boolType = _getType(namespace, "bool");
     _bottomType = BottomTypeImpl.instance;
     _deprecatedType = _getType(namespace, "Deprecated");
@@ -14107,31 +14328,6 @@
  */
 class TypeResolverVisitor extends ScopedVisitor {
   /**
-   * @return `true` if the name of the given [TypeName] is an built-in identifier.
-   */
-  static bool _isBuiltInIdentifier(TypeName node) {
-    sc.Token token = node.name.beginToken;
-    return token.type == sc.TokenType.KEYWORD;
-  }
-
-  /**
-   * @return `true` if given [TypeName] is used as a type annotation.
-   */
-  static bool _isTypeAnnotation(TypeName node) {
-    AstNode parent = node.parent;
-    if (parent is VariableDeclarationList) {
-      return identical(parent.type, node);
-    }
-    if (parent is FieldFormalParameter) {
-      return identical(parent.type, node);
-    }
-    if (parent is SimpleFormalParameter) {
-      return identical(parent.type, node);
-    }
-    return false;
-  }
-
-  /**
    * The type representing the type 'dynamic'.
    */
   DartType _dynamicType;
@@ -14153,7 +14349,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  TypeResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
+  TypeResolverVisitor.con1(Library library, Source source,
+      TypeProvider typeProvider)
+      : super.con1(library, source, typeProvider) {
     _dynamicType = typeProvider.dynamicType;
     _undefinedType = typeProvider.undefinedType;
   }
@@ -14168,7 +14366,9 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  TypeResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
+  TypeResolverVisitor.con2(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, AnalysisErrorListener errorListener)
+      : super.con2(definingLibrary, source, typeProvider, errorListener) {
     _dynamicType = typeProvider.dynamicType;
     _undefinedType = typeProvider.undefinedType;
   }
@@ -14183,7 +14383,14 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  TypeResolverVisitor.con3(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener) : super.con3(definingLibrary, source, typeProvider, nameScope, errorListener) {
+  TypeResolverVisitor.con3(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener)
+      : super.con3(
+          definingLibrary,
+          source,
+          typeProvider,
+          nameScope,
+          errorListener) {
     _dynamicType = typeProvider.dynamicType;
     _undefinedType = typeProvider.undefinedType;
   }
@@ -14195,7 +14402,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  TypeResolverVisitor.con4(ResolvableLibrary library, Source source, TypeProvider typeProvider) : super.con4(library, source, typeProvider) {
+  TypeResolverVisitor.con4(ResolvableLibrary library, Source source,
+      TypeProvider typeProvider)
+      : super.con4(library, source, typeProvider) {
     _dynamicType = typeProvider.dynamicType;
     _undefinedType = typeProvider.undefinedType;
   }
@@ -14203,25 +14412,31 @@
   @override
   Object visitAnnotation(Annotation node) {
     //
-    // Visit annotations, if the annotation is @proxy, on a class, and "proxy" resolves to the proxy
-    // annotation in dart.core, then create create the ElementAnnotationImpl and set it as the
-    // metadata on the enclosing class.
+    // Visit annotations, if the annotation is @proxy, on a class, and "proxy"
+    // resolves to the proxy annotation in dart.core, then create create the
+    // ElementAnnotationImpl and set it as the metadata on the enclosing class.
     //
-    // Element resolution is done in the ElementResolver, and this work will be done in the general
-    // case for all annotations in the ElementResolver. The reason we resolve this particular
-    // element early is so that ClassElement.isProxy() returns the correct information during all
+    // Element resolution is done in the ElementResolver, and this work will be
+    // done in the general case for all annotations in the ElementResolver.
+    // The reason we resolve this particular element early is so that
+    // ClassElement.isProxy() returns the correct information during all
     // phases of the ElementResolver.
     //
     super.visitAnnotation(node);
     Identifier identifier = node.name;
-    if (identifier.name.endsWith(ElementAnnotationImpl.PROXY_VARIABLE_NAME) && node.parent is ClassDeclaration) {
+    if (identifier.name.endsWith(ElementAnnotationImpl.PROXY_VARIABLE_NAME) &&
+        node.parent is ClassDeclaration) {
       Element element = nameScope.lookup(identifier, definingLibrary);
-      if (element != null && element.library.isDartCore && element is PropertyAccessorElement) {
+      if (element != null &&
+          element.library.isDartCore &&
+          element is PropertyAccessorElement) {
         // This is the @proxy from dart.core
         ClassDeclaration classDeclaration = node.parent as ClassDeclaration;
-        ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(element);
+        ElementAnnotationImpl elementAnnotation =
+            new ElementAnnotationImpl(element);
         node.elementAnnotation = elementAnnotation;
-        (classDeclaration.element as ClassElementImpl).metadata = <ElementAnnotationImpl> [elementAnnotation];
+        (classDeclaration.element as ClassElementImpl).metadata =
+            <ElementAnnotationImpl>[elementAnnotation];
       }
     }
     return null;
@@ -14232,8 +14447,9 @@
     super.visitCatchClause(node);
     SimpleIdentifier exception = node.exceptionParameter;
     if (exception != null) {
-      // If an 'on' clause is provided the type of the exception parameter is the type in the 'on'
-      // clause. Otherwise, the type of the exception parameter is 'Object'.
+      // If an 'on' clause is provided the type of the exception parameter is
+      // the type in the 'on' clause. Otherwise, the type of the exception
+      // parameter is 'Object'.
       TypeName exceptionTypeName = node.exceptionType;
       DartType exceptionType;
       if (exceptionTypeName == null) {
@@ -14266,8 +14482,14 @@
     ClassElementImpl classElement = _getClassElement(node.name);
     InterfaceType superclassType = null;
     if (extendsClause != null) {
-      ErrorCode errorCode = (withClause == null ? CompileTimeErrorCode.EXTENDS_NON_CLASS : CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS);
-      superclassType = _resolveType(extendsClause.superclass, errorCode, CompileTimeErrorCode.EXTENDS_ENUM, errorCode);
+      ErrorCode errorCode = (withClause == null ?
+          CompileTimeErrorCode.EXTENDS_NON_CLASS :
+          CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS);
+      superclassType = _resolveType(
+          extendsClause.superclass,
+          errorCode,
+          CompileTimeErrorCode.EXTENDS_ENUM,
+          errorCode);
       if (!identical(superclassType, typeProvider.objectType)) {
         classElement.validMixin = false;
       }
@@ -14287,10 +14509,29 @@
   }
 
   @override
+  void visitClassMembersInScope(ClassDeclaration node) {
+    //
+    // Process field declarations before constructors and methods so that the
+    // types of field formal parameters can be correctly resolved.
+    //
+    List<ClassMember> nonFields = new List<ClassMember>();
+    node.visitChildren(
+        new _TypeResolverVisitor_visitClassMembersInScope(this, nonFields));
+    int count = nonFields.length;
+    for (int i = 0; i < count; i++) {
+      nonFields[i].accept(this);
+    }
+  }
+
+  @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
     super.visitClassTypeAlias(node);
     ErrorCode errorCode = CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS;
-    InterfaceType superclassType = _resolveType(node.superclass, errorCode, CompileTimeErrorCode.EXTENDS_ENUM, errorCode);
+    InterfaceType superclassType = _resolveType(
+        node.superclass,
+        errorCode,
+        CompileTimeErrorCode.EXTENDS_ENUM,
+        errorCode);
     if (superclassType == null) {
       superclassType = typeProvider.objectType;
     }
@@ -14307,7 +14548,8 @@
     super.visitConstructorDeclaration(node);
     ExecutableElementImpl element = node.element as ExecutableElementImpl;
     if (element == null) {
-      ClassDeclaration classNode = node.getAncestor((node) => node is ClassDeclaration);
+      ClassDeclaration classNode =
+          node.getAncestor((node) => node is ClassDeclaration);
       StringBuffer buffer = new StringBuffer();
       buffer.write("The element for the constructor ");
       buffer.write(node.name == null ? "<unnamed>" : node.name.name);
@@ -14361,7 +14603,8 @@
         if (typeName == null) {
           type = _dynamicType;
           if (parameter is FieldFormalParameterElement) {
-            FieldElement fieldElement = (parameter as FieldFormalParameterElement).field;
+            FieldElement fieldElement =
+                (parameter as FieldFormalParameterElement).field;
             if (fieldElement != null) {
               type = fieldElement.type;
             }
@@ -14396,7 +14639,8 @@
     }
     element.returnType = _computeReturnType(node.returnType);
     FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
-    ClassElement definingClass = element.getAncestor((element) => element is ClassElement);
+    ClassElement definingClass =
+        element.getAncestor((element) => element is ClassElement);
     if (definingClass != null) {
       type.typeArguments = definingClass.type.typeArguments;
     }
@@ -14406,7 +14650,8 @@
 
   @override
   Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    FunctionTypeAliasElementImpl element = node.element as FunctionTypeAliasElementImpl;
+    FunctionTypeAliasElementImpl element =
+        node.element as FunctionTypeAliasElementImpl;
     if (element.returnType == null) {
       // Only visit function type aliases once.
       super.visitFunctionTypeAlias(node);
@@ -14432,7 +14677,8 @@
     super.visitMethodDeclaration(node);
     ExecutableElementImpl element = node.element as ExecutableElementImpl;
     if (element == null) {
-      ClassDeclaration classNode = node.getAncestor((node) => node is ClassDeclaration);
+      ClassDeclaration classNode =
+          node.getAncestor((node) => node is ClassDeclaration);
       StringBuffer buffer = new StringBuffer();
       buffer.write("The element for the method ");
       buffer.write(node.name.name);
@@ -14451,14 +14697,16 @@
     }
     element.returnType = _computeReturnType(node.returnType);
     FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
-    ClassElement definingClass = element.getAncestor((element) => element is ClassElement);
+    ClassElement definingClass =
+        element.getAncestor((element) => element is ClassElement);
     if (definingClass != null) {
       type.typeArguments = definingClass.type.typeArguments;
     }
     element.type = type;
     if (element is PropertyAccessorElement) {
       PropertyAccessorElement accessor = element as PropertyAccessorElement;
-      PropertyInducingElementImpl variable = accessor.variable as PropertyInducingElementImpl;
+      PropertyInducingElementImpl variable =
+          accessor.variable as PropertyInducingElementImpl;
       if (accessor.isGetter) {
         variable.type = type.returnType;
       } else if (variable.type == null) {
@@ -14504,14 +14752,15 @@
     Element element = nameScope.lookup(typeName, definingLibrary);
     if (element == null) {
       //
-      // Check to see whether the type name is either 'dynamic' or 'void', neither of which are in
-      // the name scope and hence will not be found by normal means.
+      // Check to see whether the type name is either 'dynamic' or 'void',
+      // neither of which are in the name scope and hence will not be found by
+      // normal means.
       //
       if (typeName.name == _dynamicType.name) {
         _setElement(typeName, _dynamicType.element);
         if (argumentList != null) {
           // TODO(brianwilkerson) Report this error
-          // reporter.reportError(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, dynamicType.getName(), 0, argumentList.getArguments().size());
+//          reporter.reportError(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, dynamicType.getName(), 0, argumentList.getArguments().size());
         }
         typeName.staticType = _dynamicType;
         node.type = _dynamicType;
@@ -14522,40 +14771,53 @@
         // There is no element for 'void'.
         if (argumentList != null) {
           // TODO(brianwilkerson) Report this error
-          // reporter.reportError(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, voidType.getName(), 0, argumentList.getArguments().size());
+//          reporter.reportError(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, voidType.getName(), 0, argumentList.getArguments().size());
         }
         typeName.staticType = voidType;
         node.type = voidType;
         return null;
       }
       //
-      // If not, the look to see whether we might have created the wrong AST structure for a
-      // constructor name. If so, fix the AST structure and then proceed.
+      // If not, the look to see whether we might have created the wrong AST
+      // structure for a constructor name. If so, fix the AST structure and then
+      // proceed.
       //
       AstNode parent = node.parent;
-      if (typeName is PrefixedIdentifier && parent is ConstructorName && argumentList == null) {
+      if (typeName is PrefixedIdentifier &&
+          parent is ConstructorName &&
+          argumentList == null) {
         ConstructorName name = parent;
         if (name.name == null) {
-          PrefixedIdentifier prefixedIdentifier = typeName as PrefixedIdentifier;
+          PrefixedIdentifier prefixedIdentifier =
+              typeName as PrefixedIdentifier;
           SimpleIdentifier prefix = prefixedIdentifier.prefix;
           element = nameScope.lookup(prefix, definingLibrary);
           if (element is PrefixElement) {
-            if (parent.parent is InstanceCreationExpression && (parent.parent as InstanceCreationExpression).isConst) {
+            if (parent.parent is InstanceCreationExpression &&
+                (parent.parent as InstanceCreationExpression).isConst) {
               // If, if this is a const expression, then generate a
               // CompileTimeErrorCode.CONST_WITH_NON_TYPE error.
-              reportErrorForNode(CompileTimeErrorCode.CONST_WITH_NON_TYPE, prefixedIdentifier.identifier, [prefixedIdentifier.identifier.name]);
+              reportErrorForNode(
+                  CompileTimeErrorCode.CONST_WITH_NON_TYPE,
+                  prefixedIdentifier.identifier,
+                  [prefixedIdentifier.identifier.name]);
             } else {
-              // Else, if this expression is a new expression, report a NEW_WITH_NON_TYPE warning.
-              reportErrorForNode(StaticWarningCode.NEW_WITH_NON_TYPE, prefixedIdentifier.identifier, [prefixedIdentifier.identifier.name]);
+              // Else, if this expression is a new expression, report a
+              // NEW_WITH_NON_TYPE warning.
+              reportErrorForNode(
+                  StaticWarningCode.NEW_WITH_NON_TYPE,
+                  prefixedIdentifier.identifier,
+                  [prefixedIdentifier.identifier.name]);
             }
             _setElement(prefix, element);
             return null;
           } else if (element != null) {
             //
-            // Rewrite the constructor name. The parser, when it sees a constructor named "a.b",
-            // cannot tell whether "a" is a prefix and "b" is a class name, or whether "a" is a
-            // class name and "b" is a constructor name. It arbitrarily chooses the former, but
-            // in this case was wrong.
+            // Rewrite the constructor name. The parser, when it sees a
+            // constructor named "a.b", cannot tell whether "a" is a prefix and
+            // "b" is a class name, or whether "a" is a class name and "b" is a
+            // constructor name. It arbitrarily chooses the former, but in this
+            // case was wrong.
             //
             name.name = prefixedIdentifier.identifier;
             name.period = prefixedIdentifier.period;
@@ -14567,47 +14829,86 @@
     }
     // check element
     bool elementValid = element is! MultiplyDefinedElement;
-    if (elementValid && element is! ClassElement && _isTypeNameInInstanceCreationExpression(node)) {
+    if (elementValid &&
+        element is! ClassElement &&
+        _isTypeNameInInstanceCreationExpression(node)) {
       SimpleIdentifier typeNameSimple = _getTypeSimpleIdentifier(typeName);
-      InstanceCreationExpression creation = node.parent.parent as InstanceCreationExpression;
+      InstanceCreationExpression creation =
+          node.parent.parent as InstanceCreationExpression;
       if (creation.isConst) {
         if (element == null) {
-          reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CLASS, typeNameSimple, [typeName]);
+          reportErrorForNode(
+              CompileTimeErrorCode.UNDEFINED_CLASS,
+              typeNameSimple,
+              [typeName]);
         } else {
-          reportErrorForNode(CompileTimeErrorCode.CONST_WITH_NON_TYPE, typeNameSimple, [typeName]);
+          reportErrorForNode(
+              CompileTimeErrorCode.CONST_WITH_NON_TYPE,
+              typeNameSimple,
+              [typeName]);
         }
         elementValid = false;
       } else {
         if (element != null) {
-          reportErrorForNode(StaticWarningCode.NEW_WITH_NON_TYPE, typeNameSimple, [typeName]);
+          reportErrorForNode(
+              StaticWarningCode.NEW_WITH_NON_TYPE,
+              typeNameSimple,
+              [typeName]);
           elementValid = false;
         }
       }
     }
     if (elementValid && element == null) {
       // We couldn't resolve the type name.
-      // TODO(jwren) Consider moving the check for CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE
-      // from the ErrorVerifier, so that we don't have two errors on a built in identifier being
-      // used as a class name. See CompileTimeErrorCodeTest.test_builtInIdentifierAsType().
+      // TODO(jwren) Consider moving the check for
+      // CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE from the
+      // ErrorVerifier, so that we don't have two errors on a built in
+      // identifier being used as a class name.
+      // See CompileTimeErrorCodeTest.test_builtInIdentifierAsType().
       SimpleIdentifier typeNameSimple = _getTypeSimpleIdentifier(typeName);
       RedirectingConstructorKind redirectingConstructorKind;
       if (_isBuiltInIdentifier(node) && _isTypeAnnotation(node)) {
-        reportErrorForNode(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, typeName, [typeName.name]);
+        reportErrorForNode(
+            CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE,
+            typeName,
+            [typeName.name]);
       } else if (typeNameSimple.name == "boolean") {
-        reportErrorForNode(StaticWarningCode.UNDEFINED_CLASS_BOOLEAN, typeNameSimple, []);
+        reportErrorForNode(
+            StaticWarningCode.UNDEFINED_CLASS_BOOLEAN,
+            typeNameSimple,
+            []);
       } else if (_isTypeNameInCatchClause(node)) {
-        reportErrorForNode(StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE,
+            typeName,
+            [typeName.name]);
       } else if (_isTypeNameInAsExpression(node)) {
-        reportErrorForNode(StaticWarningCode.CAST_TO_NON_TYPE, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticWarningCode.CAST_TO_NON_TYPE,
+            typeName,
+            [typeName.name]);
       } else if (_isTypeNameInIsExpression(node)) {
-        reportErrorForNode(StaticWarningCode.TYPE_TEST_NON_TYPE, typeName, [typeName.name]);
-      } else if ((redirectingConstructorKind = _getRedirectingConstructorKind(node)) != null) {
-        ErrorCode errorCode = (redirectingConstructorKind == RedirectingConstructorKind.CONST ? CompileTimeErrorCode.REDIRECT_TO_NON_CLASS : StaticWarningCode.REDIRECT_TO_NON_CLASS);
+        reportErrorForNode(
+            StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME,
+            typeName,
+            [typeName.name]);
+      } else if ((redirectingConstructorKind =
+          _getRedirectingConstructorKind(node)) != null) {
+        ErrorCode errorCode =
+            (redirectingConstructorKind == RedirectingConstructorKind.CONST ?
+                CompileTimeErrorCode.REDIRECT_TO_NON_CLASS :
+                StaticWarningCode.REDIRECT_TO_NON_CLASS);
         reportErrorForNode(errorCode, typeName, [typeName.name]);
       } else if (_isTypeNameInTypeArgumentList(node)) {
-        reportErrorForNode(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
+            typeName,
+            [typeName.name]);
       } else {
-        reportErrorForNode(StaticWarningCode.UNDEFINED_CLASS, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticWarningCode.UNDEFINED_CLASS,
+            typeName,
+            [typeName.name]);
       }
       elementValid = false;
     }
@@ -14637,7 +14938,8 @@
         //      resolver.reportError(ResolverErrorCode.?, keyType);
       }
     } else if (element is MultiplyDefinedElement) {
-      List<Element> elements = (element as MultiplyDefinedElement).conflictingElements;
+      List<Element> elements =
+          (element as MultiplyDefinedElement).conflictingElements;
       type = _getTypeWhenMultiplyDefined(elements);
       if (type != null) {
         node.type = type;
@@ -14646,25 +14948,47 @@
       // The name does not represent a type.
       RedirectingConstructorKind redirectingConstructorKind;
       if (_isTypeNameInCatchClause(node)) {
-        reportErrorForNode(StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE,
+            typeName,
+            [typeName.name]);
       } else if (_isTypeNameInAsExpression(node)) {
-        reportErrorForNode(StaticWarningCode.CAST_TO_NON_TYPE, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticWarningCode.CAST_TO_NON_TYPE,
+            typeName,
+            [typeName.name]);
       } else if (_isTypeNameInIsExpression(node)) {
-        reportErrorForNode(StaticWarningCode.TYPE_TEST_NON_TYPE, typeName, [typeName.name]);
-      } else if ((redirectingConstructorKind = _getRedirectingConstructorKind(node)) != null) {
-        ErrorCode errorCode = (redirectingConstructorKind == RedirectingConstructorKind.CONST ? CompileTimeErrorCode.REDIRECT_TO_NON_CLASS : StaticWarningCode.REDIRECT_TO_NON_CLASS);
+        reportErrorForNode(
+            StaticWarningCode.TYPE_TEST_WITH_NON_TYPE,
+            typeName,
+            [typeName.name]);
+      } else if ((redirectingConstructorKind =
+          _getRedirectingConstructorKind(node)) != null) {
+        ErrorCode errorCode =
+            (redirectingConstructorKind == RedirectingConstructorKind.CONST ?
+                CompileTimeErrorCode.REDIRECT_TO_NON_CLASS :
+                StaticWarningCode.REDIRECT_TO_NON_CLASS);
         reportErrorForNode(errorCode, typeName, [typeName.name]);
       } else if (_isTypeNameInTypeArgumentList(node)) {
-        reportErrorForNode(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, typeName, [typeName.name]);
+        reportErrorForNode(
+            StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
+            typeName,
+            [typeName.name]);
       } else {
         AstNode parent = typeName.parent;
         while (parent is TypeName) {
           parent = parent.parent;
         }
-        if (parent is ExtendsClause || parent is ImplementsClause || parent is WithClause || parent is ClassTypeAlias) {
+        if (parent is ExtendsClause ||
+            parent is ImplementsClause ||
+            parent is WithClause ||
+            parent is ClassTypeAlias) {
           // Ignored. The error will be reported elsewhere.
         } else {
-          reportErrorForNode(StaticWarningCode.NOT_A_TYPE, typeName, [typeName.name]);
+          reportErrorForNode(
+              StaticWarningCode.NOT_A_TYPE,
+              typeName,
+              [typeName.name]);
         }
       }
       _setElement(typeName, _dynamicType.element);
@@ -14688,7 +15012,10 @@
           typeArguments[i] = argumentType;
         }
       } else {
-        reportErrorForNode(_getInvalidTypeParametersErrorCode(node), node, [typeName.name, parameterCount, argumentCount]);
+        reportErrorForNode(
+            _getInvalidTypeParametersErrorCode(node),
+            node,
+            [typeName.name, parameterCount, argumentCount]);
         for (int i = 0; i < parameterCount; i++) {
           typeArguments[i] = _dynamicType;
         }
@@ -14704,7 +15031,8 @@
       }
     } else {
       //
-      // Check for the case where there are no type arguments given for a parameterized type.
+      // Check for the case where there are no type arguments given for a
+      // parameterized type.
       //
       List<DartType> parameters = _getTypeArguments(type);
       int parameterCount = parameters.length;
@@ -14727,7 +15055,8 @@
     super.visitTypeParameter(node);
     TypeName bound = node.bound;
     if (bound != null) {
-      TypeParameterElementImpl typeParameter = node.name.staticElement as TypeParameterElementImpl;
+      TypeParameterElementImpl typeParameter =
+          node.name.staticElement as TypeParameterElementImpl;
       if (typeParameter != null) {
         typeParameter.bound = bound.type;
       }
@@ -14750,15 +15079,18 @@
       (element as VariableElementImpl).type = declaredType;
       if (element is PropertyInducingElement) {
         PropertyInducingElement variableElement = element;
-        PropertyAccessorElementImpl getter = variableElement.getter as PropertyAccessorElementImpl;
+        PropertyAccessorElementImpl getter =
+            variableElement.getter as PropertyAccessorElementImpl;
         getter.returnType = declaredType;
         FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
-        ClassElement definingClass = element.getAncestor((element) => element is ClassElement);
+        ClassElement definingClass =
+            element.getAncestor((element) => element is ClassElement);
         if (definingClass != null) {
           getterType.typeArguments = definingClass.type.typeArguments;
         }
         getter.type = getterType;
-        PropertyAccessorElementImpl setter = variableElement.setter as PropertyAccessorElementImpl;
+        PropertyAccessorElementImpl setter =
+            variableElement.setter as PropertyAccessorElementImpl;
         if (setter != null) {
           List<ParameterElement> parameters = setter.parameters;
           if (parameters.length > 0) {
@@ -14778,20 +15110,6 @@
     return null;
   }
 
-  @override
-  void visitClassMembersInScope(ClassDeclaration node) {
-    //
-    // Process field declarations before constructors and methods so that the types of field formal
-    // parameters can be correctly resolved.
-    //
-    List<ClassMember> nonFields = new List<ClassMember>();
-    node.visitChildren(new UnifyingAstVisitor_TypeResolverVisitor_visitClassMembersInScope(this, nonFields));
-    int count = nonFields.length;
-    for (int i = 0; i < count; i++) {
-      nonFields[i].accept(this);
-    }
-  }
-
   /**
    * Given a type name representing the return type of a function, compute the return type of the
    * function.
@@ -14814,10 +15132,12 @@
    * @return the class element that represents the class
    */
   ClassElementImpl _getClassElement(SimpleIdentifier identifier) {
-    // TODO(brianwilkerson) Seems like we should be using ClassDeclaration.getElement().
+    // TODO(brianwilkerson) Seems like we should be using
+    // ClassDeclaration.getElement().
     if (identifier == null) {
       // TODO(brianwilkerson) Report this
-      // Internal error: We should never build a class declaration without a name.
+      // Internal error: We should never build a class declaration without a
+      // name.
       return null;
     }
     Element element = identifier.staticElement;
@@ -14839,7 +15159,8 @@
   List<ParameterElement> _getElements(FormalParameterList parameterList) {
     List<ParameterElement> elements = new List<ParameterElement>();
     for (FormalParameter parameter in parameterList.parameters) {
-      ParameterElement element = parameter.identifier.staticElement as ParameterElement;
+      ParameterElement element =
+          parameter.identifier.staticElement as ParameterElement;
       // TODO(brianwilkerson) Understand why the element would be null.
       if (element != null) {
         elements.add(element);
@@ -14885,8 +15206,11 @@
       ConstructorName constructorName = parent as ConstructorName;
       parent = constructorName.parent;
       if (parent is ConstructorDeclaration) {
-        ConstructorDeclaration constructorDeclaration = parent as ConstructorDeclaration;
-        if (identical(constructorDeclaration.redirectedConstructor, constructorName)) {
+        ConstructorDeclaration constructorDeclaration =
+            parent as ConstructorDeclaration;
+        if (identical(
+            constructorDeclaration.redirectedConstructor,
+            constructorName)) {
           if (constructorDeclaration.constKeyword != null) {
             return RedirectingConstructorKind.CONST;
           }
@@ -14999,9 +15323,11 @@
    */
   bool _isTypeNameInInstanceCreationExpression(TypeName typeName) {
     AstNode parent = typeName.parent;
-    if (parent is ConstructorName && parent.parent is InstanceCreationExpression) {
+    if (parent is ConstructorName &&
+        parent.parent is InstanceCreationExpression) {
       ConstructorName constructorName = parent;
-      return constructorName != null && identical(constructorName.type, typeName);
+      return constructorName != null &&
+          identical(constructorName.type, typeName);
     }
     return false;
   }
@@ -15027,7 +15353,8 @@
    * @param typeName the type name to analyzer
    * @return `true` if the given type name is in a type argument list
    */
-  bool _isTypeNameInTypeArgumentList(TypeName typeName) => typeName.parent is TypeArgumentList;
+  bool _isTypeNameInTypeArgumentList(TypeName typeName) =>
+      typeName.parent is TypeArgumentList;
 
   /**
    * Record that the static type of the given node is the given type.
@@ -15053,16 +15380,25 @@
    * @param withClause the with clause to be resolved
    * @param implementsClause the implements clause to be resolved
    */
-  void _resolve(ClassElementImpl classElement, WithClause withClause, ImplementsClause implementsClause) {
+  void _resolve(ClassElementImpl classElement, WithClause withClause,
+      ImplementsClause implementsClause) {
     if (withClause != null) {
-      List<InterfaceType> mixinTypes = _resolveTypes(withClause.mixinTypes, CompileTimeErrorCode.MIXIN_OF_NON_CLASS, CompileTimeErrorCode.MIXIN_OF_ENUM, CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
+      List<InterfaceType> mixinTypes = _resolveTypes(
+          withClause.mixinTypes,
+          CompileTimeErrorCode.MIXIN_OF_NON_CLASS,
+          CompileTimeErrorCode.MIXIN_OF_ENUM,
+          CompileTimeErrorCode.MIXIN_OF_NON_CLASS);
       if (classElement != null) {
         classElement.mixins = mixinTypes;
       }
     }
     if (implementsClause != null) {
       NodeList<TypeName> interfaces = implementsClause.interfaces;
-      List<InterfaceType> interfaceTypes = _resolveTypes(interfaces, CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, CompileTimeErrorCode.IMPLEMENTS_ENUM, CompileTimeErrorCode.IMPLEMENTS_DYNAMIC);
+      List<InterfaceType> interfaceTypes = _resolveTypes(
+          interfaces,
+          CompileTimeErrorCode.IMPLEMENTS_NON_CLASS,
+          CompileTimeErrorCode.IMPLEMENTS_ENUM,
+          CompileTimeErrorCode.IMPLEMENTS_DYNAMIC);
       if (classElement != null) {
         classElement.interfaces = interfaceTypes;
       }
@@ -15083,7 +15419,10 @@
             Element element2 = identifier2.staticElement;
             if (element != null && element == element2) {
               detectedRepeatOnIndex[j] = true;
-              reportErrorForNode(CompileTimeErrorCode.IMPLEMENTS_REPEATED, typeName2, [name2]);
+              reportErrorForNode(
+                  CompileTimeErrorCode.IMPLEMENTS_REPEATED,
+                  typeName2,
+                  [name2]);
             }
           }
         }
@@ -15101,7 +15440,8 @@
    * @param dynamicTypeError the error to produce if the type name is "dynamic"
    * @return the type specified by the type name
    */
-  InterfaceType _resolveType(TypeName typeName, ErrorCode nonTypeError, ErrorCode enumTypeError, ErrorCode dynamicTypeError) {
+  InterfaceType _resolveType(TypeName typeName, ErrorCode nonTypeError,
+      ErrorCode enumTypeError, ErrorCode dynamicTypeError) {
     DartType type = typeName.type;
     if (type is InterfaceType) {
       ClassElement element = type.element;
@@ -15111,7 +15451,8 @@
       }
       return type;
     }
-    // If the type is not an InterfaceType, then visitTypeName() sets the type to be a DynamicTypeImpl
+    // If the type is not an InterfaceType, then visitTypeName() sets the type
+    // to be a DynamicTypeImpl
     Identifier name = typeName.name;
     if (name.name == sc.Keyword.DYNAMIC.syntax) {
       reportErrorForNode(dynamicTypeError, name, [name.name]);
@@ -15131,10 +15472,12 @@
    * @param dynamicTypeError the error to produce if the type name is "dynamic"
    * @return an array containing all of the types that were resolved.
    */
-  List<InterfaceType> _resolveTypes(NodeList<TypeName> typeNames, ErrorCode nonTypeError, ErrorCode enumTypeError, ErrorCode dynamicTypeError) {
+  List<InterfaceType> _resolveTypes(NodeList<TypeName> typeNames,
+      ErrorCode nonTypeError, ErrorCode enumTypeError, ErrorCode dynamicTypeError) {
     List<InterfaceType> types = new List<InterfaceType>();
     for (TypeName typeName in typeNames) {
-      InterfaceType type = _resolveType(typeName, nonTypeError, enumTypeError, dynamicTypeError);
+      InterfaceType type =
+          _resolveType(typeName, nonTypeError, enumTypeError, dynamicTypeError);
       if (type != null) {
         types.add(type);
       }
@@ -15146,7 +15489,6 @@
     if (element != null) {
       if (typeName is SimpleIdentifier) {
         typeName.staticElement = element;
-        _markTypeNameElementUsed(typeName, element);
       } else if (typeName is PrefixedIdentifier) {
         PrefixedIdentifier identifier = typeName;
         identifier.identifier.staticElement = element;
@@ -15160,31 +15502,6 @@
   }
 
   /**
-   * Marks [element] as used in its defining library.
-   */
-  void _markTypeNameElementUsed(Identifier typeName, Element element) {
-    if (identical(element, _enclosingClass)) {
-      return;
-    }
-    // ignore places where the element is not actually used
-    if (typeName.parent is TypeName) {
-      AstNode parent2 = typeName.parent.parent;
-      if (parent2 is IsExpression) {
-        return;
-      }
-      if (parent2 is VariableDeclarationList) {
-        return;
-      }
-    }
-    // check if the element is a local top-level element
-    if (element is ElementImpl &&
-        element.enclosingElement is CompilationUnitElement &&
-        identical(element.library, definingLibrary)) {
-      element.markUsed();
-    }
-  }
-
-  /**
    * Given a parameter element, create a function type based on the given return type and parameter
    * list and associate the created type with the element.
    *
@@ -15192,25 +15509,32 @@
    * @param returnType the (possibly `null`) return type of the function
    * @param parameterList the list of parameters to the function
    */
-  void _setFunctionTypedParameterType(ParameterElementImpl element, TypeName returnType, FormalParameterList parameterList) {
+  void _setFunctionTypedParameterType(ParameterElementImpl element,
+      TypeName returnType, FormalParameterList parameterList) {
     List<ParameterElement> parameters = _getElements(parameterList);
-    FunctionTypeAliasElementImpl aliasElement = new FunctionTypeAliasElementImpl.forNode(null);
+    FunctionTypeAliasElementImpl aliasElement =
+        new FunctionTypeAliasElementImpl.forNode(null);
     aliasElement.synthetic = true;
     aliasElement.shareParameters(parameters);
     aliasElement.returnType = _computeReturnType(returnType);
     // FunctionTypeAliasElementImpl assumes the enclosing element is a
-    // CompilationUnitElement (because non-synthetic function types can only be declared
-    // at top level), so to avoid breaking things, go find the compilation unit element.
-    aliasElement.enclosingElement = element.getAncestor((element) => element is CompilationUnitElement);
+    // CompilationUnitElement (because non-synthetic function types can only be
+    // declared at top level), so to avoid breaking things, go find the
+    // compilation unit element.
+    aliasElement.enclosingElement =
+        element.getAncestor((element) => element is CompilationUnitElement);
     FunctionTypeImpl type = new FunctionTypeImpl.con2(aliasElement);
-    ClassElement definingClass = element.getAncestor((element) => element is ClassElement);
+    ClassElement definingClass =
+        element.getAncestor((element) => element is ClassElement);
     if (definingClass != null) {
       aliasElement.shareTypeParameters(definingClass.typeParameters);
       type.typeArguments = definingClass.type.typeArguments;
     } else {
-      FunctionTypeAliasElement alias = element.getAncestor((element) => element is FunctionTypeAliasElement);
+      FunctionTypeAliasElement alias =
+          element.getAncestor((element) => element is FunctionTypeAliasElement);
       while (alias != null && alias.isSynthetic) {
-        alias = alias.getAncestor((element) => element is FunctionTypeAliasElement);
+        alias =
+            alias.getAncestor((element) => element is FunctionTypeAliasElement);
       }
       if (alias != null) {
         aliasElement.typeParameters = alias.typeParameters;
@@ -15221,61 +15545,31 @@
     }
     element.type = type;
   }
-}
 
-class UnifyingAstVisitor_ElementBuilder_visitClassDeclaration extends UnifyingAstVisitor<Object> {
-  final ElementBuilder ElementBuilder_this;
-
-  List<ClassMember> nonFields;
-
-  UnifyingAstVisitor_ElementBuilder_visitClassDeclaration(this.ElementBuilder_this, this.nonFields) : super();
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    nonFields.add(node);
-    return null;
+  /**
+   * @return `true` if the name of the given [TypeName] is an built-in identifier.
+   */
+  static bool _isBuiltInIdentifier(TypeName node) {
+    sc.Token token = node.name.beginToken;
+    return token.type == sc.TokenType.KEYWORD;
   }
 
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    nonFields.add(node);
-    return null;
+  /**
+   * @return `true` if given [TypeName] is used as a type annotation.
+   */
+  static bool _isTypeAnnotation(TypeName node) {
+    AstNode parent = node.parent;
+    if (parent is VariableDeclarationList) {
+      return identical(parent.type, node);
+    }
+    if (parent is FieldFormalParameter) {
+      return identical(parent.type, node);
+    }
+    if (parent is SimpleFormalParameter) {
+      return identical(parent.type, node);
+    }
+    return false;
   }
-
-  @override
-  Object visitNode(AstNode node) => node.accept(ElementBuilder_this);
-}
-
-class UnifyingAstVisitor_TypeResolverVisitor_visitClassMembersInScope extends UnifyingAstVisitor<Object> {
-  final TypeResolverVisitor TypeResolverVisitor_this;
-
-  List<ClassMember> nonFields;
-
-  UnifyingAstVisitor_TypeResolverVisitor_visitClassMembersInScope(this.TypeResolverVisitor_this, this.nonFields) : super();
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    nonFields.add(node);
-    return null;
-  }
-
-  @override
-  Object visitExtendsClause(ExtendsClause node) => null;
-
-  @override
-  Object visitImplementsClause(ImplementsClause node) => null;
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    nonFields.add(node);
-    return null;
-  }
-
-  @override
-  Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
-
-  @override
-  Object visitWithClause(WithClause node) => null;
 }
 
 /**
@@ -15296,7 +15590,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  VariableResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider);
+  VariableResolverVisitor.con1(Library library, Source source,
+      TypeProvider typeProvider)
+      : super.con1(library, source, typeProvider);
 
   /**
    * Initialize a newly created visitor to resolve the nodes in an AST node.
@@ -15308,7 +15604,14 @@
    * @param errorListener the error listener that will be informed of any errors that are found
    *          during resolution
    */
-  VariableResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener) : super.con3(definingLibrary, source, typeProvider, nameScope, errorListener);
+  VariableResolverVisitor.con2(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, Scope nameScope, AnalysisErrorListener errorListener)
+      : super.con3(
+          definingLibrary,
+          source,
+          typeProvider,
+          nameScope,
+          errorListener);
 
   /**
    * Initialize a newly created visitor to resolve the nodes in a compilation unit.
@@ -15317,7 +15620,9 @@
    * @param source the source representing the compilation unit being visited
    * @param typeProvider the object used to access the types from the core library
    */
-  VariableResolverVisitor.con3(ResolvableLibrary library, Source source, TypeProvider typeProvider) : super.con4(library, source, typeProvider);
+  VariableResolverVisitor.con3(ResolvableLibrary library, Source source,
+      TypeProvider typeProvider)
+      : super.con4(library, source, typeProvider);
 
   @override
   Object visitExportDirective(ExportDirective node) => null;
@@ -15385,35 +15690,23 @@
     ElementKind kind = element.kind;
     if (kind == ElementKind.LOCAL_VARIABLE) {
       node.staticElement = element;
-      LocalVariableElementImpl variableImpl = element as LocalVariableElementImpl;
+      LocalVariableElementImpl variableImpl =
+          element as LocalVariableElementImpl;
       if (node.inSetterContext()) {
         variableImpl.markPotentiallyMutatedInScope();
         if (element.enclosingElement != _enclosingFunction) {
           variableImpl.markPotentiallyMutatedInClosure();
         }
       }
-      if (node.inGetterContext()) {
-        if (parent.parent is ExpressionStatement &&
-            (parent is PrefixExpression ||
-             parent is PostfixExpression ||
-             parent is AssignmentExpression && parent.leftHandSide == node)) {
-          // v++;
-          // ++v;
-          // v += 2;
-        } else {
-          variableImpl.markUsed();
-        }
-      }
-      if (parent is MethodInvocation && parent.methodName == node) {
-        variableImpl.markUsed();
-      }
     } else if (kind == ElementKind.PARAMETER) {
       node.staticElement = element;
       if (node.inSetterContext()) {
         ParameterElementImpl parameterImpl = element as ParameterElementImpl;
         parameterImpl.markPotentiallyMutatedInScope();
-        // If we are in some closure, check if it is not the same as where variable is declared.
-        if (_enclosingFunction != null && (element.enclosingElement != _enclosingFunction)) {
+        // If we are in some closure, check if it is not the same as where
+        // variable is declared.
+        if (_enclosingFunction != null &&
+            (element.enclosingElement != _enclosingFunction)) {
           parameterImpl.markPotentiallyMutatedInClosure();
         }
       }
@@ -15422,197 +15715,581 @@
   }
 }
 
-/**
- * Instances of the class {@code HtmlTagInfoBuilder} gather information about the tags used in one
- * or more HTML structures.
- */
-class HtmlTagInfoBuilder implements ht.XmlVisitor {
-  /**
-   * The name of the 'id' attribute.
-   */
-  static final String ID_ATTRIBUTE = "id";
+class _AngularCompilationUnitBuilder_parseScopeProperties extends
+    RecursiveAstVisitor<Object> {
+  List<AngularScopePropertyElement> properties;
 
-  /**
-   * The name of the 'class' attribute.
-   */
-  static final String ID_CLASS = "class";
-
-  /**
-   * A set containing all of the tag names used in the HTML.
-   */
-  HashSet<String> tagSet = new HashSet<String>();
-
-  /**
-   * A table mapping the id's that are defined to the tag name with that id.
-   */
-  HashMap<String, String> idMap = new HashMap<String, String>();
-
-  /**
-   * A table mapping the classes that are defined to a set of the tag names with that class.
-   */
-  HashMap<String, HashSet<String>> classMap = new HashMap<String, HashSet<String>>();
-
-  /**
-   * Initialize a newly created HTML tag info builder.
-   */
-  HtmlTagInfoBuilder();
-
-  /**
-   * Create a tag information holder holding all of the information gathered about the tags in the
-   * HTML structures that were visited.
-   *
-   * @return the information gathered about the tags in the visited HTML structures
-   */
-  HtmlTagInfo getTagInfo() {
-    List<String> allTags = tagSet.toList();
-    HashMap<String, List<String>> classToTagsMap = new HashMap<String, List<String>>();
-    classMap.forEach((String key, Set<String> tags) {
-      classToTagsMap[key] = tags.toList();
-    });
-    return new HtmlTagInfo(allTags, idMap, classToTagsMap);
-  }
+  _AngularCompilationUnitBuilder_parseScopeProperties(this.properties)
+      : super();
 
   @override
-  visitHtmlScriptTagNode(ht.HtmlScriptTagNode node) {
-    visitXmlTagNode(node);
+  Object visitAssignmentExpression(AssignmentExpression node) {
+    _addProperty(node);
+    return super.visitAssignmentExpression(node);
   }
 
-  @override
-  visitHtmlUnit(ht.HtmlUnit node) {
-    node.visitChildren(this);
+  void _addProperty(AssignmentExpression node) {
+    // try to find "name" in scope[name]
+    SimpleStringLiteral nameNode = _getNameNode(node.leftHandSide);
+    if (nameNode == null) {
+      return;
+    }
+    // prepare unique
+    String name = nameNode.stringValue;
+    if (_hasPropertyWithName(name)) {
+      return;
+    }
+    // do add property
+    int nameOffset = nameNode.contentsOffset;
+    AngularScopePropertyElement property = new AngularScopePropertyElementImpl(
+        name,
+        nameOffset,
+        node.rightHandSide.bestType);
+    nameNode.toolkitElement = property;
+    properties.add(property);
   }
 
-  @override
-  visitXmlAttributeNode(ht.XmlAttributeNode node) {
+  SimpleStringLiteral _getNameNode(Expression node) {
+    if (node is IndexExpression) {
+      IndexExpression indexExpression = node;
+      Expression target = indexExpression.target;
+      Expression index = indexExpression.index;
+      if (index is SimpleStringLiteral && _isContext(target)) {
+        return index;
+      }
+    }
+    return null;
   }
 
+  bool _hasPropertyWithName(String name) {
+    for (AngularScopePropertyElement property in properties) {
+      if (property.name == name) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  bool _isContext(Expression target) {
+    if (target is PrefixedIdentifier) {
+      PrefixedIdentifier prefixed = target;
+      SimpleIdentifier prefix = prefixed.prefix;
+      SimpleIdentifier identifier = prefixed.identifier;
+      return (identifier.name == "context") && _isScope(prefix);
+    }
+    return false;
+  }
+
+  bool _isScope(Expression target) {
+    if (target != null) {
+      DartType type = target.bestType;
+      if (type is InterfaceType) {
+        InterfaceType interfaceType = type;
+        return interfaceType.name == "Scope";
+      }
+    }
+    return false;
+  }
+}
+
+class _ConstantVerifier_validateInitializerExpression extends ConstantVisitor {
+  final ConstantVerifier verifier;
+
+  List<ParameterElement> parameterElements;
+
+  _ConstantVerifier_validateInitializerExpression(TypeProvider arg0,
+      ErrorReporter arg1, this.verifier, this.parameterElements)
+      : super.con1(arg0, arg1);
+
   @override
-  visitXmlTagNode(ht.XmlTagNode node) {
-    node.visitChildren(this);
-    String tagName = node.tag;
-    tagSet.add(tagName);
-    for (ht.XmlAttributeNode attribute in node.attributes) {
-      String attributeName = attribute.name;
-      if (attributeName == ID_ATTRIBUTE) {
-        String attributeValue = attribute.text;
-        if (attributeValue != null) {
-          String tag = idMap[attributeValue];
-          if (tag == null) {
-            idMap[attributeValue] = tagName;
-          } else {
-//            reportError(HtmlWarningCode.MULTIPLY_DEFINED_ID, valueToken);
+  DartObjectImpl visitSimpleIdentifier(SimpleIdentifier node) {
+    Element element = node.staticElement;
+    for (ParameterElement parameterElement in parameterElements) {
+      if (identical(parameterElement, element) && parameterElement != null) {
+        DartType type = parameterElement.type;
+        if (type != null) {
+          if (type.isDynamic) {
+            return new DartObjectImpl(
+                verifier._typeProvider.objectType,
+                DynamicState.DYNAMIC_STATE);
+          } else if (type.isSubtypeOf(verifier._boolType)) {
+            return new DartObjectImpl(
+                verifier._typeProvider.boolType,
+                BoolState.UNKNOWN_VALUE);
+          } else if (type.isSubtypeOf(verifier._typeProvider.doubleType)) {
+            return new DartObjectImpl(
+                verifier._typeProvider.doubleType,
+                DoubleState.UNKNOWN_VALUE);
+          } else if (type.isSubtypeOf(verifier._intType)) {
+            return new DartObjectImpl(
+                verifier._typeProvider.intType,
+                IntState.UNKNOWN_VALUE);
+          } else if (type.isSubtypeOf(verifier._numType)) {
+            return new DartObjectImpl(
+                verifier._typeProvider.numType,
+                NumState.UNKNOWN_VALUE);
+          } else if (type.isSubtypeOf(verifier._stringType)) {
+            return new DartObjectImpl(
+                verifier._typeProvider.stringType,
+                StringState.UNKNOWN_VALUE);
           }
+          //
+          // We don't test for other types of objects (such as List, Map,
+          // Function or Type) because there are no operations allowed on such
+          // types other than '==' and '!=', which means that we don't need to
+          // know the type when there is no specific data about the state of
+          // such objects.
+          //
         }
-      } else if (attributeName == ID_CLASS) {
-        String attributeValue = attribute.text;
-        if (attributeValue != null) {
-          HashSet<String> tagList = classMap[attributeValue];
-          if (tagList == null) {
-            tagList = new HashSet<String>();
-            classMap[attributeValue] = tagList;
-          } else {
-//            reportError(HtmlWarningCode.MULTIPLY_DEFINED_ID, valueToken);
-          }
-          tagList.add(tagName);
+        return new DartObjectImpl(
+            type is InterfaceType ? type : verifier._typeProvider.objectType,
+            GenericState.UNKNOWN_VALUE);
+      }
+    }
+    return super.visitSimpleIdentifier(node);
+  }
+}
+
+class _ElementBuilder_visitClassDeclaration extends UnifyingAstVisitor<Object> {
+  final ElementBuilder builder;
+
+  List<ClassMember> nonFields;
+
+  _ElementBuilder_visitClassDeclaration(this.builder, this.nonFields)
+      : super();
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    nonFields.add(node);
+    return null;
+  }
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    nonFields.add(node);
+    return null;
+  }
+
+  @override
+  Object visitNode(AstNode node) => node.accept(builder);
+}
+
+class _GatherUsedElementsVisitor extends RecursiveAstVisitor {
+  final _UsedElements usedElements = new _UsedElements();
+
+  final LibraryElement _enclosingLibrary;
+  ClassElement _enclosingClass;
+  ExecutableElement _enclosingExec;
+
+  _GatherUsedElementsVisitor(this._enclosingLibrary);
+
+  @override
+  visitCatchClause(CatchClause node) {
+    SimpleIdentifier exceptionParameter = node.exceptionParameter;
+    _useStaticElement(exceptionParameter);
+    super.visitCatchClause(node);
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    ClassElement enclosingClassOld = _enclosingClass;
+    try {
+      _enclosingClass = node.element;
+      super.visitClassDeclaration(node);
+    } finally {
+      _enclosingClass = enclosingClassOld;
+    }
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    ExecutableElement enclosingExecOld = _enclosingExec;
+    try {
+      _enclosingExec = node.element;
+      super.visitFunctionDeclaration(node);
+    } finally {
+      _enclosingExec = enclosingExecOld;
+    }
+  }
+
+  @override
+  visitFunctionExpression(FunctionExpression node) {
+    if (node.parent is! FunctionDeclaration) {
+      _useElement(node.element);
+    }
+    super.visitFunctionExpression(node);
+  }
+
+  @override
+  visitMethodDeclaration(MethodDeclaration node) {
+    ExecutableElement enclosingExecOld = _enclosingExec;
+    try {
+      _enclosingExec = node.element;
+      super.visitMethodDeclaration(node);
+    } finally {
+      _enclosingExec = enclosingExecOld;
+    }
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    if (node.inDeclarationContext()) {
+      return;
+    }
+    Element element = node.staticElement;
+    bool isIdentifierRead = _isReadIdentifier(node);
+    if (element is LocalVariableElement) {
+      if (isIdentifierRead) {
+        _useElement(element);
+      }
+//    } else if (element is PropertyAccessorElement &&
+//        element.isSynthetic &&
+//        element.isPrivate) {
+//      PropertyInducingElement variable = element.variable;
+//      if (node.inGetterContext()) {
+//        AstNode parent = node.parent;
+//        if (parent.parent is ExpressionStatement &&
+//            (parent is PrefixExpression ||
+//             parent is PostfixExpression ||
+//             parent is AssignmentExpression && parent.leftHandSide == node)) {
+//          // f++;
+//          // ++f;
+//          // f += 2;
+//        } else {
+//          _useElement(variable);
+//        }
+//      }
+    } else {
+      _useIdentifierElement(node);
+      if (element == null ||
+          element is! LocalElement && !identical(element, _enclosingExec)) {
+        usedElements.members.add(node.name);
+        if (isIdentifierRead) {
+          usedElements.readMembers.add(node.name);
         }
       }
     }
   }
 
-//  /**
-//   * Report an error with the given error code at the given location. Use the given arguments to
-//   * compose the error message.
-//   *
-//   * @param errorCode the error code of the error to be reported
-//   * @param offset the offset of the first character to be highlighted
-//   * @param length the number of characters to be highlighted
-//   * @param arguments the arguments used to compose the error message
-//   */
-//  private void reportError(ErrorCode errorCode, Token token, Object... arguments) {
-//    errorListener.onError(new AnalysisError(
-//        htmlElement.getSource(),
-//        token.getOffset(),
-//        token.getLength(),
-//        errorCode,
-//        arguments));
-//  }
-//
-//  /**
-//   * Report an error with the given error code at the given location. Use the given arguments to
-//   * compose the error message.
-//   *
-//   * @param errorCode the error code of the error to be reported
-//   * @param offset the offset of the first character to be highlighted
-//   * @param length the number of characters to be highlighted
-//   * @param arguments the arguments used to compose the error message
-//   */
-//  private void reportError(ErrorCode errorCode, int offset, int length, Object... arguments) {
-//    errorListener.onError(new AnalysisError(
-//        htmlElement.getSource(),
-//        offset,
-//        length,
-//        errorCode,
-//        arguments));
-//  }
+  @override
+  visitTypeName(TypeName node) {
+    _useIdentifierElement(node.name);
+  }
+
+  _useElement(Element element) {
+    if (element != null) {
+      usedElements.elements.add(element);
+    }
+  }
+
+  /**
+   * Marks an [Element] of [node] as used in the library.
+   */
+  void _useIdentifierElement(Identifier node) {
+    Element element = node.staticElement;
+    if (element == null) {
+      return;
+    }
+    // check if a local element
+    if (!identical(element.library, _enclosingLibrary)) {
+      return;
+    }
+    // ignore references to an element from itself
+    if (identical(element, _enclosingClass)) {
+      return;
+    }
+    if (identical(element, _enclosingExec)) {
+      return;
+    }
+    // ignore places where the element is not actually used
+    if (node.parent is TypeName) {
+      AstNode parent2 = node.parent.parent;
+      if (parent2 is IsExpression) {
+        return;
+      }
+      if (parent2 is VariableDeclarationList) {
+        return;
+      }
+    }
+    // OK
+    _useElement(element);
+  }
+
+  void _useStaticElement(SimpleIdentifier identifier) {
+    if (identifier != null) {
+      _useElement(identifier.staticElement);
+    }
+  }
+
+  static bool _isReadIdentifier(SimpleIdentifier node) {
+    // not reading at all
+    if (!node.inGetterContext()) {
+      return false;
+    }
+    // check if useless reading
+    AstNode parent = node.parent;
+    if (parent.parent is ExpressionStatement &&
+        (parent is PrefixExpression ||
+            parent is PostfixExpression ||
+            parent is AssignmentExpression && parent.leftHandSide == node)) {
+      // v++;
+      // ++v;
+      // v += 2;
+      return false;
+    }
+    // OK
+    return true;
+  }
+}
+
+class _ResolverVisitor_isVariableAccessedInClosure extends
+    RecursiveAstVisitor<Object> {
+  final Element variable;
+
+  bool result = false;
+
+  bool _inClosure = false;
+
+  _ResolverVisitor_isVariableAccessedInClosure(this.variable);
+
+  @override
+  Object visitFunctionExpression(FunctionExpression node) {
+    bool inClosure = this._inClosure;
+    try {
+      this._inClosure = true;
+      return super.visitFunctionExpression(node);
+    } finally {
+      this._inClosure = inClosure;
+    }
+  }
+
+  @override
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    if (result) {
+      return null;
+    }
+    if (_inClosure && identical(node.staticElement, variable)) {
+      result = true;
+    }
+    return null;
+  }
+}
+
+
+class _ResolverVisitor_isVariablePotentiallyMutatedIn extends
+    RecursiveAstVisitor<Object> {
+  final Element variable;
+
+  bool result = false;
+
+  _ResolverVisitor_isVariablePotentiallyMutatedIn(this.variable);
+
+  @override
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    if (result) {
+      return null;
+    }
+    if (identical(node.staticElement, variable)) {
+      if (node.inSetterContext()) {
+        result = true;
+      }
+    }
+    return null;
+  }
+}
+
+
+class _TypeResolverVisitor_visitClassMembersInScope extends
+    UnifyingAstVisitor<Object> {
+  final TypeResolverVisitor TypeResolverVisitor_this;
+
+  List<ClassMember> nonFields;
+
+  _TypeResolverVisitor_visitClassMembersInScope(this.TypeResolverVisitor_this,
+      this.nonFields)
+      : super();
+
+  @override
+  Object visitConstructorDeclaration(ConstructorDeclaration node) {
+    nonFields.add(node);
+    return null;
+  }
+
+  @override
+  Object visitExtendsClause(ExtendsClause node) => null;
+
+  @override
+  Object visitImplementsClause(ImplementsClause node) => null;
+
+  @override
+  Object visitMethodDeclaration(MethodDeclaration node) {
+    nonFields.add(node);
+    return null;
+  }
+
+  @override
+  Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
+
+  @override
+  Object visitWithClause(WithClause node) => null;
 }
 
 
 /**
- * Instances of the class {@code HtmlTagInfo} record information about the tags used in an HTML
- * file.
+ * Instances of the class [_UnusedElementsVerifier] traverse an element
+ * structure looking for cases of [HintCode.UNUSED_ELEMENT] and
+ * [HintCode.UNUSED_LOCAL_VARIABLE].
  */
-class HtmlTagInfo {
+class _UnusedElementsVerifier extends RecursiveElementVisitor {
   /**
-   * An array containing all of the tags used in the HTML file.
+   * The error listener to which errors will be reported.
    */
-  List<String> allTags;
+  final AnalysisErrorListener _errorListener;
 
   /**
-   * A table mapping the id's defined in the HTML file to an array containing the names of tags with
-   * that identifier.
+   * The elements know to be used.
    */
-  HashMap<String, String> idToTagMap;
+  final _UsedElements _usedElements;
 
   /**
-   * A table mapping the classes defined in the HTML file to an array containing the names of tags
-   * with that class.
+   * Create a new instance of the [_UnusedElementsVerifier].
    */
-  HashMap<String, List<String>> classToTagsMap;
+  _UnusedElementsVerifier(this._errorListener, this._usedElements);
 
-  /**
-   * Initialize a newly created information holder to hold the given information about the tags in
-   * an HTML file.
-   *
-   * @param allTags an array containing all of the tags used in the HTML file
-   * @param idToTagMap a table mapping the id's defined in the HTML file to an array containing the
-   *          names of tags with that identifier
-   * @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;
+  @override
+  visitClassElement(ClassElement element) {
+    if (!_isUsedElement(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_ELEMENT,
+          element,
+          [element.kind.displayName, element.displayName]);
+    }
+    super.visitClassElement(element);
   }
 
-  /**
-   * Return an array containing the tags that have the given class, or {@code null} if there are no
-   * such tags.
-   *
-   * @return an array containing the tags that have the given class
-   */
-  List<String> getTagsWithClass(String identifier) {
-    return classToTagsMap[identifier];
+  @override
+  visitFieldElement(FieldElement element) {
+    if (!_isReadMember(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_FIELD,
+          element,
+          [element.displayName]);
+    }
+    super.visitFieldElement(element);
   }
 
-  /**
-   * Return the tag that has the given identifier, or {@code null} if there is no such tag (the
-   * identifier is not defined).
-   *
-   * @return the tag that has the given identifier
-   */
-  String getTagWithId(String identifier) {
-    return idToTagMap[identifier];
+  @override
+  visitFunctionElement(FunctionElement element) {
+    if (!_isUsedElement(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_ELEMENT,
+          element,
+          [element.kind.displayName, element.displayName]);
+    }
+    super.visitFunctionElement(element);
   }
+
+  @override
+  visitLocalVariableElement(LocalVariableElement element) {
+    if (!_isUsedElement(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_LOCAL_VARIABLE,
+          element,
+          [element.displayName]);
+    }
+  }
+
+  @override
+  visitMethodElement(MethodElement element) {
+    if (!_isUsedMember(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_ELEMENT,
+          element,
+          [element.kind.displayName, element.displayName]);
+    }
+    super.visitMethodElement(element);
+  }
+
+  @override
+  visitPropertyAccessorElement(PropertyAccessorElement element) {
+    if (!_isUsedMember(element)) {
+      _reportErrorForElement(
+          HintCode.UNUSED_ELEMENT,
+          element,
+          [element.kind.displayName, element.displayName]);
+    }
+    super.visitPropertyAccessorElement(element);
+  }
+
+  bool _isReadMember(Element element) {
+    if (element.isPublic) {
+      return true;
+    }
+    if (element.isSynthetic) {
+      return true;
+    }
+    return _usedElements.readMembers.contains(element.displayName);
+  }
+
+  bool _isUsedElement(Element element) {
+    if (element.isSynthetic) {
+      return true;
+    }
+    if (element is LocalVariableElement ||
+        element is FunctionElement && !element.isStatic) {
+      // local variable or function
+    } else {
+      if (element.isPublic) {
+        return true;
+      }
+    }
+    return _usedElements.elements.contains(element);
+  }
+
+  bool _isUsedMember(Element element) {
+    if (element.isPublic) {
+      return true;
+    }
+    if (element.isSynthetic) {
+      return true;
+    }
+    if (_usedElements.members.contains(element.displayName)) {
+      return true;
+    }
+    return _usedElements.elements.contains(element);
+  }
+
+  void _reportErrorForElement(ErrorCode errorCode, Element element,
+      List<Object> arguments) {
+    if (element != null) {
+      _errorListener.onError(
+          new AnalysisError.con2(
+              element.source,
+              element.nameOffset,
+              element.displayName.length,
+              errorCode,
+              arguments));
+    }
+  }
+}
+
+
+class _UsedElements {
+  /**
+   * Resolved, locally defined elements that are used or potentially can be
+   * used.
+   */
+  final HashSet<Element> elements = new HashSet<Element>();
+
+  /**
+   * Names of resolved or unresolved class members that are referenced in the
+   * library.
+   */
+  final HashSet<String> members = new HashSet<String>();
+
+  /**
+   * Names of resolved or unresolved class members that are read in the
+   * library.
+   */
+  final HashSet<String> readMembers = new HashSet<String>();
 }
diff --git a/pkg/analyzer/lib/src/generated/scanner.dart b/pkg/analyzer/lib/src/generated/scanner.dart
index 28fd8df..13808d5 100644
--- a/pkg/analyzer/lib/src/generated/scanner.dart
+++ b/pkg/analyzer/lib/src/generated/scanner.dart
@@ -2,24 +2,18 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.scanner;
 
 import 'dart:collection';
-import "dart:math" as math;
 
-import 'java_core.dart';
-import 'java_engine.dart';
-import 'source.dart';
 import 'error.dart';
 import 'instrumentation.dart';
-import 'utilities_collection.dart' show TokenMap;
+import 'java_engine.dart';
+import 'source.dart';
 
 /**
- * Instances of the class `BeginToken` represent the opening half of a grouping pair of
- * tokens. This is used for curly brackets ('{'), parentheses ('('), and square brackets ('[').
+ * A `BeginToken` is the opening half of a grouping pair of tokens. This is used
+ * for curly brackets ('{'), parentheses ('('), and square brackets ('[').
  */
 class BeginToken extends Token {
   /**
@@ -28,13 +22,14 @@
   Token endToken;
 
   /**
-   * Initialize a newly created token representing the opening half of a grouping pair of tokens.
-   *
-   * @param type the type of the token
-   * @param offset the offset from the beginning of the file to the first character in the token
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset].
    */
   BeginToken(TokenType type, int offset) : super(type, offset) {
-    assert((type == TokenType.OPEN_CURLY_BRACKET || type == TokenType.OPEN_PAREN || type == TokenType.OPEN_SQUARE_BRACKET || type == TokenType.STRING_INTERPOLATION_EXPRESSION));
+    assert(type == TokenType.OPEN_CURLY_BRACKET ||
+        type == TokenType.OPEN_PAREN ||
+        type == TokenType.OPEN_SQUARE_BRACKET ||
+        type == TokenType.STRING_INTERPOLATION_EXPRESSION);
   }
 
   @override
@@ -42,8 +37,7 @@
 }
 
 /**
- * Instances of the class `BeginTokenWithComment` represent a begin token that is preceded by
- * comments.
+ * A `BeginTokenWithComment` is a begin token that is preceded by comments.
  */
 class BeginTokenWithComment extends BeginToken {
   /**
@@ -52,17 +46,12 @@
   final Token _precedingComment;
 
   /**
-   * Initialize a newly created token to have the given type and offset and to be preceded by the
-   * comments reachable from the given comment.
-   *
-   * @param type the type of the token
-   * @param offset the offset from the beginning of the file to the first character in the token
-   * @param precedingComment the first comment in the list of comments that precede this token
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [comment].
    */
-  BeginTokenWithComment(TokenType type, int offset, this._precedingComment) : super(type, offset);
-
-  @override
-  Token copy() => new BeginTokenWithComment(type, offset, copyComments(_precedingComment));
+  BeginTokenWithComment(TokenType type, int offset, this._precedingComment)
+      : super(type, offset);
 
   @override
   Token get precedingComments => _precedingComment;
@@ -76,11 +65,15 @@
       token = token.next;
     }
   }
+
+  @override
+  Token copy() =>
+      new BeginTokenWithComment(type, offset, copyComments(_precedingComment));
 }
 
 /**
- * Instances of the class `CharSequenceReader` implement a [CharacterReader] that reads
- * characters from a character sequence.
+ * A `CharSequenceReader` is a [CharacterReader] that reads characters from a
+ * character sequence.
  */
 class CharSequenceReader implements CharacterReader {
   /**
@@ -99,9 +92,8 @@
   int _charOffset = 0;
 
   /**
-   * Initialize a newly created reader to read the characters in the given sequence.
-   *
-   * @param sequence the sequence from which characters will be read
+   * Initialize a newly created reader to read the characters in the given
+   * [_sequence].
    */
   CharSequenceReader(this._sequence) {
     this._stringLength = _sequence.length;
@@ -109,6 +101,14 @@
   }
 
   @override
+  int get offset => _charOffset;
+
+  @override
+  void set offset(int offset) {
+    _charOffset = offset;
+  }
+
+  @override
   int advance() {
     if (_charOffset + 1 >= _stringLength) {
       return -1;
@@ -117,394 +117,215 @@
   }
 
   @override
-  int get offset => _charOffset;
-
-  @override
-  String getString(int start, int endDelta) => _sequence.substring(start, _charOffset + 1 + endDelta).toString();
+  String getString(int start, int endDelta) =>
+      _sequence.substring(start, _charOffset + 1 + endDelta).toString();
 
   @override
   int peek() {
-    if (_charOffset + 1 >= _sequence.length) {
+    if (_charOffset + 1 >= _stringLength) {
       return -1;
     }
     return _sequence.codeUnitAt(_charOffset + 1);
   }
+}
+
+/**
+ * A `CharacterRangeReader` is a [CharacterReader] that reads a range of
+ * characters from another character reader.
+ */
+class CharacterRangeReader extends CharacterReader {
+  /**
+   * The reader from which the characters are actually being read.
+   */
+  final CharacterReader baseReader;
+
+  /**
+   * The last character to be read.
+   */
+  final int endIndex;
+
+  /**
+   * Initialize a newly created reader to read the characters from the given
+   * [baseReader] between the [startIndex] inclusive to [endIndex] exclusive.
+   */
+  CharacterRangeReader(this.baseReader, int startIndex, this.endIndex) {
+    baseReader.offset = startIndex - 1;
+  }
+
+  @override
+  int get offset => baseReader.offset;
 
   @override
   void set offset(int offset) {
-    _charOffset = offset;
+    baseReader.offset = offset;
+  }
+
+  @override
+  int advance() {
+    if (baseReader.offset + 1 >= endIndex) {
+      return -1;
+    }
+    return baseReader.advance();
+  }
+
+  @override
+  String getString(int start, int endDelta) =>
+      baseReader.getString(start, endDelta);
+
+  @override
+  int peek() {
+    if (baseReader.offset + 1 >= endIndex) {
+      return -1;
+    }
+    return baseReader.peek();
   }
 }
 
 /**
- * The interface `CharacterReader`
+ * A `CharacterReader` is used by the scanner to read the characters to be
+ * scanned.
  */
 abstract class CharacterReader {
   /**
-   * Advance the current position and return the character at the new current position.
-   *
-   * @return the character at the new current position
-   */
-  int advance();
-
-  /**
-   * Return the current offset relative to the beginning of the source. Return the initial offset if
-   * the scanner has not yet scanned the source code, and one (1) past the end of the source code if
-   * the entire source code has been scanned.
-   *
-   * @return the current offset of the scanner in the source
+   * The current offset relative to the beginning of the source. Return the
+   * initial offset if the scanner has not yet scanned the source code, and one
+   * (1) past the end of the source code if the entire source code has been
+   * scanned.
    */
   int get offset;
 
   /**
-   * Return the substring of the source code between the start offset and the modified current
-   * position. The current position is modified by adding the end delta.
-   *
-   * @param start the offset to the beginning of the string, relative to the start of the file
-   * @param endDelta the number of characters after the current location to be included in the
-   *          string, or the number of characters before the current location to be excluded if the
-   *          offset is negative
-   * @return the specified substring of the source code
+   * Set the current offset relative to the beginning of the source to the given
+   * [offset]. The new offset must be between the initial offset and one (1)
+   * past the end of the source code.
+   */
+  void set offset(int offset);
+
+  /**
+   * Advance the current position and return the character at the new current
+   * position.
+   */
+  int advance();
+
+  /**
+   * Return the substring of the source code between the [start] offset and the
+   * modified current position. The current position is modified by adding the
+   * [endDelta], which is the number of characters after the current location to
+   * be included in the string, or the number of characters before the current
+   * location to be excluded if the offset is negative.
    */
   String getString(int start, int endDelta);
 
   /**
-   * Return the character at the current position without changing the current position.
-   *
-   * @return the character at the current position
+   * Return the character at the current position without changing the current
+   * position.
    */
   int peek();
-
-  /**
-   * Set the current offset relative to the beginning of the source. The new offset must be between
-   * the initial offset and one (1) past the end of the source code.
-   *
-   * @param offset the new offset in the source
-   */
-  void set offset(int offset);
 }
 
 /**
- * Instances of the class `IncrementalScanner` implement a scanner that scans a subset of a
- * string and inserts the resulting tokens into the middle of an existing token stream.
+ * The enumeration `Keyword` defines the keywords in the Dart programming
+ * language.
  */
-class IncrementalScanner extends Scanner {
-  /**
-   * The reader used to access the characters in the source.
-   */
-  CharacterReader _reader;
+class Keyword {
+  static const Keyword ASSERT = const Keyword('ASSERT', "assert");
 
-  /**
-   * A map from tokens that were copied to the copies of the tokens.
-   */
-  TokenMap _tokenMap = new TokenMap();
+  static const Keyword BREAK = const Keyword('BREAK', "break");
 
-  /**
-   * The token in the new token stream immediately to the left of the range of tokens that were
-   * inserted, or the token immediately to the left of the modified region if there were no new
-   * tokens.
-   */
-  Token _leftToken;
+  static const Keyword CASE = const Keyword('CASE', "case");
 
-  /**
-   * The token in the new token stream immediately to the right of the range of tokens that were
-   * inserted, or the token immediately to the right of the modified region if there were no new
-   * tokens.
-   */
-  Token _rightToken;
+  static const Keyword CATCH = const Keyword('CATCH', "catch");
 
-  /**
-   * A flag indicating whether there were any tokens changed as a result of the modification.
-   */
-  bool _hasNonWhitespaceChange = false;
+  static const Keyword CLASS = const Keyword('CLASS', "class");
 
-  /**
-   * Initialize a newly created scanner.
-   *
-   * @param source the source being scanned
-   * @param reader the character reader used to read the characters in the source
-   * @param errorListener the error listener that will be informed of any errors that are found
-   */
-  IncrementalScanner(Source source, CharacterReader reader, AnalysisErrorListener errorListener) : super(source, reader, errorListener) {
-    this._reader = reader;
-  }
+  static const Keyword CONST = const Keyword('CONST', "const");
 
-  /**
-   * Return the token in the new token stream immediately to the left of the range of tokens that
-   * were inserted, or the token immediately to the left of the modified region if there were no new
-   * tokens.
-   *
-   * @return the token to the left of the inserted tokens
-   */
-  Token get leftToken => _leftToken;
+  static const Keyword CONTINUE = const Keyword('CONTINUE', "continue");
 
-  /**
-   * Return the token in the new token stream immediately to the right of the range of tokens that
-   * were inserted, or the token immediately to the right of the modified region if there were no
-   * new tokens.
-   *
-   * @return the token to the right of the inserted tokens
-   */
-  Token get rightToken => _rightToken;
+  static const Keyword DEFAULT = const Keyword('DEFAULT', "default");
 
-  /**
-   * Return a map from tokens that were copied to the copies of the tokens.
-   *
-   * @return a map from tokens that were copied to the copies of the tokens
-   */
-  TokenMap get tokenMap => _tokenMap;
+  static const Keyword DO = const Keyword('DO', "do");
 
-  /**
-   * Return `true` if there were any tokens either added or removed (or both) as a result of
-   * the modification.
-   *
-   * @return `true` if there were any tokens changed as a result of the modification
-   */
-  bool get hasNonWhitespaceChange => _hasNonWhitespaceChange;
+  static const Keyword ELSE = const Keyword('ELSE', "else");
 
-  /**
-   * Given the stream of tokens scanned from the original source, the modified source (the result of
-   * replacing one contiguous range of characters with another string of characters), and a
-   * specification of the modification that was made, return a stream of tokens scanned from the
-   * modified source. The original stream of tokens will not be modified.
-   *
-   * @param originalStream the stream of tokens scanned from the original source
-   * @param index the index of the first character in both the original and modified source that was
-   *          affected by the modification
-   * @param removedLength the number of characters removed from the original source
-   * @param insertedLength the number of characters added to the modified source
-   */
-  Token rescan(Token originalStream, int index, int removedLength, int insertedLength) {
-    //
-    // Copy all of the tokens in the originalStream whose end is less than the replacement start.
-    // (If the replacement start is equal to the end of an existing token, then it means that the
-    // existing token might have been modified, so we need to rescan it.)
-    //
-    while (originalStream.type != TokenType.EOF && originalStream.end < index) {
-      originalStream = _copyAndAdvance(originalStream, 0);
-    }
-    Token oldFirst = originalStream;
-    Token oldLeftToken = originalStream.previous;
-    _leftToken = tail;
-    //
-    // Skip tokens in the original stream until we find a token whose offset is greater than the end
-    // of the removed region. (If the end of the removed region is equal to the beginning of an
-    // existing token, then it means that the existing token might have been modified, so we need to
-    // rescan it.)
-    //
-    int removedEnd = index + (removedLength == 0 ? 0 : removedLength - 1);
-    while (originalStream.type != TokenType.EOF && originalStream.offset <= removedEnd) {
-      originalStream = originalStream.next;
-    }
-    Token oldLast;
-    Token oldRightToken;
-    if (originalStream.type != TokenType.EOF && removedEnd + 1 == originalStream.offset) {
-      oldLast = originalStream;
-      originalStream = originalStream.next;
-      oldRightToken = originalStream;
-    } else {
-      oldLast = originalStream.previous;
-      oldRightToken = originalStream;
-    }
-    //
-    // Compute the delta between the character index of characters after the modified region in the
-    // original source and the index of the corresponding character in the modified source.
-    //
-    int delta = insertedLength - removedLength;
-    //
-    // Compute the range of characters that are known to need to be rescanned. If the index is
-    // within an existing token, then we need to start at the beginning of the token.
-    //
-    int scanStart = math.min(oldFirst.offset, index);
-    int oldEnd = oldLast.end + delta - 1;
-    int newEnd = index + insertedLength - 1;
-    int scanEnd = math.max(newEnd, oldEnd);
-    //
-    // Starting at the start of the scan region, scan tokens from the modifiedSource until the end
-    // of the just scanned token is greater than or equal to end of the scan region in the modified
-    // source. Include trailing characters of any token that was split as a result of inserted text,
-    // as in "ab" --> "a.b".
-    //
-    _reader.offset = scanStart - 1;
-    int next = _reader.advance();
-    while (next != -1 && _reader.offset <= scanEnd) {
-      next = bigSwitch(next);
-    }
-    //
-    // Copy the remaining tokens in the original stream, but apply the delta to the token's offset.
-    //
-    if (originalStream.type == TokenType.EOF) {
-      _copyAndAdvance(originalStream, delta);
-      _rightToken = tail;
-      _rightToken.setNextWithoutSettingPrevious(_rightToken);
-    } else {
-      originalStream = _copyAndAdvance(originalStream, delta);
-      _rightToken = tail;
-      while (originalStream.type != TokenType.EOF) {
-        originalStream = _copyAndAdvance(originalStream, delta);
-      }
-      Token eof = _copyAndAdvance(originalStream, delta);
-      eof.setNextWithoutSettingPrevious(eof);
-    }
-    //
-    // If the index is immediately after an existing token and the inserted characters did not
-    // change that original token, then adjust the leftToken to be the next token. For example, in
-    // "a; c;" --> "a;b c;", the leftToken was ";", but this code advances it to "b" since "b" is
-    // the first new token.
-    //
-    Token newFirst = _leftToken.next;
-    while (!identical(newFirst, _rightToken) && !identical(oldFirst, oldRightToken) && newFirst.type != TokenType.EOF && _equalTokens(oldFirst, newFirst)) {
-      _tokenMap.put(oldFirst, newFirst);
-      oldLeftToken = oldFirst;
-      oldFirst = oldFirst.next;
-      _leftToken = newFirst;
-      newFirst = newFirst.next;
-    }
-    Token newLast = _rightToken.previous;
-    while (!identical(newLast, _leftToken) && !identical(oldLast, oldLeftToken) && newLast.type != TokenType.EOF && _equalTokens(oldLast, newLast)) {
-      _tokenMap.put(oldLast, newLast);
-      oldRightToken = oldLast;
-      oldLast = oldLast.previous;
-      _rightToken = newLast;
-      newLast = newLast.previous;
-    }
-    _hasNonWhitespaceChange = !identical(_leftToken.next, _rightToken) || !identical(oldLeftToken.next, oldRightToken);
-    //
-    // TODO(brianwilkerson) Begin tokens are not getting associated with the corresponding end
-    //     tokens (because the end tokens have not been copied when we're copying the begin tokens).
-    //     This could have implications for parsing.
-    // TODO(brianwilkerson) Update the lineInfo.
-    //
-    return firstToken;
-  }
+  static const Keyword ENUM = const Keyword('ENUM', "enum");
 
-  Token _copyAndAdvance(Token originalToken, int delta) {
-    Token copiedToken = originalToken.copy();
-    _tokenMap.put(originalToken, copiedToken);
-    copiedToken.applyDelta(delta);
-    appendToken(copiedToken);
-    Token originalComment = originalToken.precedingComments;
-    Token copiedComment = originalToken.precedingComments;
-    while (originalComment != null) {
-      _tokenMap.put(originalComment, copiedComment);
-      originalComment = originalComment.next;
-      copiedComment = copiedComment.next;
-    }
-    return originalToken.next;
-  }
+  static const Keyword EXTENDS = const Keyword('EXTENDS', "extends");
 
-  /**
-   * Return `true` if the two tokens are equal to each other. For the purposes of the
-   * incremental scanner, two tokens are equal if they have the same type and lexeme.
-   *
-   * @param oldToken the token from the old stream that is being compared
-   * @param newToken the token from the new stream that is being compared
-   * @return `true` if the two tokens are equal to each other
-   */
-  bool _equalTokens(Token oldToken, Token newToken) => oldToken.type == newToken.type && oldToken.length == newToken.length && oldToken.lexeme == newToken.lexeme;
-}
+  static const Keyword FALSE = const Keyword('FALSE', "false");
 
-/**
- * The enumeration `Keyword` defines the keywords in the Dart programming language.
- */
-class Keyword extends Enum<Keyword> {
-  static const Keyword ASSERT = const Keyword.con1('ASSERT', 0, "assert");
+  static const Keyword FINAL = const Keyword('FINAL', "final");
 
-  static const Keyword BREAK = const Keyword.con1('BREAK', 1, "break");
+  static const Keyword FINALLY = const Keyword('FINALLY', "finally");
 
-  static const Keyword CASE = const Keyword.con1('CASE', 2, "case");
+  static const Keyword FOR = const Keyword('FOR', "for");
 
-  static const Keyword CATCH = const Keyword.con1('CATCH', 3, "catch");
+  static const Keyword IF = const Keyword('IF', "if");
 
-  static const Keyword CLASS = const Keyword.con1('CLASS', 4, "class");
+  static const Keyword IN = const Keyword('IN', "in");
 
-  static const Keyword CONST = const Keyword.con1('CONST', 5, "const");
+  static const Keyword IS = const Keyword('IS', "is");
 
-  static const Keyword CONTINUE = const Keyword.con1('CONTINUE', 6, "continue");
+  static const Keyword NEW = const Keyword('NEW', "new");
 
-  static const Keyword DEFAULT = const Keyword.con1('DEFAULT', 7, "default");
+  static const Keyword NULL = const Keyword('NULL', "null");
 
-  static const Keyword DO = const Keyword.con1('DO', 8, "do");
+  static const Keyword RETHROW = const Keyword('RETHROW', "rethrow");
 
-  static const Keyword ELSE = const Keyword.con1('ELSE', 9, "else");
+  static const Keyword RETURN = const Keyword('RETURN', "return");
 
-  static const Keyword ENUM = const Keyword.con1('ENUM', 10, "enum");
+  static const Keyword SUPER = const Keyword('SUPER', "super");
 
-  static const Keyword EXTENDS = const Keyword.con1('EXTENDS', 11, "extends");
+  static const Keyword SWITCH = const Keyword('SWITCH', "switch");
 
-  static const Keyword FALSE = const Keyword.con1('FALSE', 12, "false");
+  static const Keyword THIS = const Keyword('THIS', "this");
 
-  static const Keyword FINAL = const Keyword.con1('FINAL', 13, "final");
+  static const Keyword THROW = const Keyword('THROW', "throw");
 
-  static const Keyword FINALLY = const Keyword.con1('FINALLY', 14, "finally");
+  static const Keyword TRUE = const Keyword('TRUE', "true");
 
-  static const Keyword FOR = const Keyword.con1('FOR', 15, "for");
+  static const Keyword TRY = const Keyword('TRY', "try");
 
-  static const Keyword IF = const Keyword.con1('IF', 16, "if");
+  static const Keyword VAR = const Keyword('VAR', "var");
 
-  static const Keyword IN = const Keyword.con1('IN', 17, "in");
+  static const Keyword VOID = const Keyword('VOID', "void");
 
-  static const Keyword IS = const Keyword.con1('IS', 18, "is");
+  static const Keyword WHILE = const Keyword('WHILE', "while");
 
-  static const Keyword NEW = const Keyword.con1('NEW', 19, "new");
+  static const Keyword WITH = const Keyword('WITH', "with");
 
-  static const Keyword NULL = const Keyword.con1('NULL', 20, "null");
+  static const Keyword ABSTRACT = const Keyword('ABSTRACT', "abstract", true);
 
-  static const Keyword RETHROW = const Keyword.con1('RETHROW', 21, "rethrow");
+  static const Keyword AS = const Keyword('AS', "as", true);
 
-  static const Keyword RETURN = const Keyword.con1('RETURN', 22, "return");
+  static const Keyword DEFERRED = const Keyword('DEFERRED', "deferred", true);
 
-  static const Keyword SUPER = const Keyword.con1('SUPER', 23, "super");
+  static const Keyword DYNAMIC = const Keyword('DYNAMIC', "dynamic", true);
 
-  static const Keyword SWITCH = const Keyword.con1('SWITCH', 24, "switch");
+  static const Keyword EXPORT = const Keyword('EXPORT', "export", true);
 
-  static const Keyword THIS = const Keyword.con1('THIS', 25, "this");
+  static const Keyword EXTERNAL = const Keyword('EXTERNAL', "external", true);
 
-  static const Keyword THROW = const Keyword.con1('THROW', 26, "throw");
+  static const Keyword FACTORY = const Keyword('FACTORY', "factory", true);
 
-  static const Keyword TRUE = const Keyword.con1('TRUE', 27, "true");
+  static const Keyword GET = const Keyword('GET', "get", true);
 
-  static const Keyword TRY = const Keyword.con1('TRY', 28, "try");
+  static const Keyword IMPLEMENTS =
+      const Keyword('IMPLEMENTS', "implements", true);
 
-  static const Keyword VAR = const Keyword.con1('VAR', 29, "var");
+  static const Keyword IMPORT = const Keyword('IMPORT', "import", true);
 
-  static const Keyword VOID = const Keyword.con1('VOID', 30, "void");
+  static const Keyword LIBRARY = const Keyword('LIBRARY', "library", true);
 
-  static const Keyword WHILE = const Keyword.con1('WHILE', 31, "while");
+  static const Keyword OPERATOR = const Keyword('OPERATOR', "operator", true);
 
-  static const Keyword WITH = const Keyword.con1('WITH', 32, "with");
+  static const Keyword PART = const Keyword('PART', "part", true);
 
-  static const Keyword ABSTRACT = const Keyword.con2('ABSTRACT', 33, "abstract", true);
+  static const Keyword SET = const Keyword('SET', "set", true);
 
-  static const Keyword AS = const Keyword.con2('AS', 34, "as", true);
+  static const Keyword STATIC = const Keyword('STATIC', "static", true);
 
-  static const Keyword DEFERRED = const Keyword.con2('DEFERRED', 35, "deferred", true);
-
-  static const Keyword DYNAMIC = const Keyword.con2('DYNAMIC', 36, "dynamic", true);
-
-  static const Keyword EXPORT = const Keyword.con2('EXPORT', 37, "export", true);
-
-  static const Keyword EXTERNAL = const Keyword.con2('EXTERNAL', 38, "external", true);
-
-  static const Keyword FACTORY = const Keyword.con2('FACTORY', 39, "factory", true);
-
-  static const Keyword GET = const Keyword.con2('GET', 40, "get", true);
-
-  static const Keyword IMPLEMENTS = const Keyword.con2('IMPLEMENTS', 41, "implements", true);
-
-  static const Keyword IMPORT = const Keyword.con2('IMPORT', 42, "import", true);
-
-  static const Keyword LIBRARY = const Keyword.con2('LIBRARY', 43, "library", true);
-
-  static const Keyword OPERATOR = const Keyword.con2('OPERATOR', 44, "operator", true);
-
-  static const Keyword PART = const Keyword.con2('PART', 45, "part", true);
-
-  static const Keyword SET = const Keyword.con2('SET', 46, "set", true);
-
-  static const Keyword STATIC = const Keyword.con2('STATIC', 47, "static", true);
-
-  static const Keyword TYPEDEF = const Keyword.con2('TYPEDEF', 48, "typedef", true);
+  static const Keyword TYPEDEF = const Keyword('TYPEDEF', "typedef", true);
 
   static const List<Keyword> values = const [
       ASSERT,
@@ -558,55 +379,51 @@
       TYPEDEF];
 
   /**
+   * A table mapping the lexemes of keywords to the corresponding keyword.
+   */
+  static final Map<String, Keyword> keywords = _createKeywordMap();
+
+  /**
+   * The name of the keyword type.
+   */
+  final String name;
+
+  /**
    * The lexeme for the keyword.
    */
   final String syntax;
 
   /**
-   * A flag indicating whether the keyword is a pseudo-keyword. Pseudo keywords can be used as
-   * identifiers.
+   * A flag indicating whether the keyword is a pseudo-keyword. Pseudo keywords
+   * can be used as identifiers.
    */
   final bool isPseudoKeyword;
 
   /**
-   * A table mapping the lexemes of keywords to the corresponding keyword.
+   * Initialize a newly created keyword to have the given [name] and [syntax].
+   * The keyword is a pseudo-keyword if the [isPseudoKeyword] flag is `true`.
    */
-  static Map<String, Keyword> keywords = _createKeywordMap();
+  const Keyword(this.name, this.syntax, [this.isPseudoKeyword = false]);
+
+  @override
+  String toString() => name;
 
   /**
-   * Create a table mapping the lexemes of keywords to the corresponding keyword.
-   *
-   * @return the table that was created
+   * Create a table mapping the lexemes of keywords to the corresponding keyword
+   * and return the table that was created.
    */
   static Map<String, Keyword> _createKeywordMap() {
-    LinkedHashMap<String, Keyword> result = new LinkedHashMap<String, Keyword>();
+    LinkedHashMap<String, Keyword> result =
+        new LinkedHashMap<String, Keyword>();
     for (Keyword keyword in values) {
       result[keyword.syntax] = keyword;
     }
     return result;
   }
-
-  /**
-   * Initialize a newly created keyword to have the given syntax. The keyword is not a
-   * pseudo-keyword.
-   *
-   * @param syntax the lexeme for the keyword
-   */
-  const Keyword.con1(String name, int ordinal, String syntax) : this.con2(name, ordinal, syntax, false);
-
-  /**
-   * Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if
-   * the given flag is `true`.
-   *
-   * @param syntax the lexeme for the keyword
-   * @param isPseudoKeyword `true` if this keyword is a pseudo-keyword
-   */
-  const Keyword.con2(String name, int ordinal, this.syntax, this.isPseudoKeyword) : super(name, ordinal);
 }
 
 /**
- * Instances of the abstract class `KeywordState` represent a state in a state machine used to
- * scan keywords.
+ * A `KeywordState` is a state in a state machine used to scan keywords.
  */
 class KeywordState {
   /**
@@ -617,22 +434,60 @@
   /**
    * The initial state in the state machine.
    */
-  static KeywordState KEYWORD_STATE = _createKeywordStateTable();
+  static final KeywordState KEYWORD_STATE = _createKeywordStateTable();
 
   /**
-   * Create the next state in the state machine where we have already recognized the subset of
-   * strings in the given array of strings starting at the given offset and having the given length.
-   * All of these strings have a common prefix and the next character is at the given start index.
-   *
-   * @param start the index of the character in the strings used to transition to a new state
-   * @param strings an array containing all of the strings that will be recognized by the state
-   *          machine
-   * @param offset the offset of the first string in the array that has the prefix that is assumed
-   *          to have been recognized by the time we reach the state being built
-   * @param length the number of strings in the array that pass through the state being built
-   * @return the state that was created
+   * A table mapping characters to the states to which those characters will
+   * transition. (The index into the array is the offset from the character
+   * `'a'` to the transitioning character.)
    */
-  static KeywordState _computeKeywordStateTable(int start, List<String> strings, int offset, int length) {
+  final List<KeywordState> _table;
+
+  /**
+   * The keyword that is recognized by this state, or `null` if this state is
+   * not a terminal state.
+   */
+  Keyword _keyword;
+
+  /**
+   * Initialize a newly created state to have the given transitions and to
+   * recognize the keyword with the given [syntax].
+   */
+  KeywordState(this._table, String syntax) {
+    this._keyword = (syntax == null) ? null : Keyword.keywords[syntax];
+  }
+
+  /**
+   * Return the keyword that was recognized by this state, or `null` if this
+   * state does not recognized a keyword.
+   */
+  Keyword keyword() => _keyword;
+
+  /**
+   * Return the state that follows this state on a transition of the given
+   * [character], or `null` if there is no valid state reachable from this state
+   * with such a transition.
+   */
+  KeywordState next(int character) => _table[character - 0x61];
+
+  /**
+   * Create the next state in the state machine where we have already recognized
+   * the subset of strings in the given array of [strings] starting at the given
+   * [offset] and having the given [length]. All of these strings have a common
+   * prefix and the next character is at the given [start] index.
+   *
+   * [start] the index of the character in the strings used to transition to a
+   * new state
+   * [strings] an array containing all of the strings that will be recognized by
+   * the state machine
+   * [offset] the offset of the first string in the array that has the prefix
+   * that is assumed to have been recognized by the time we reach the state
+   * being built
+   * [length] the number of strings in the array that pass through the state
+   * being built
+   */
+  static KeywordState _computeKeywordStateTable(int start, List<String> strings,
+      int offset, int length) {
     List<KeywordState> result = new List<KeywordState>(26);
     assert(length != 0);
     int chunk = 0x0;
@@ -646,7 +501,8 @@
         int c = strings[i].codeUnitAt(start);
         if (chunk != c) {
           if (chunkStart != -1) {
-            result[chunk - 0x61] = _computeKeywordStateTable(start + 1, strings, chunkStart, i - chunkStart);
+            result[chunk - 0x61] =
+                _computeKeywordStateTable(start + 1, strings, chunkStart, i - chunkStart);
           }
           chunkStart = i;
           chunk = c;
@@ -655,7 +511,12 @@
     }
     if (chunkStart != -1) {
       assert(result[chunk - 0x61] == null);
-      result[chunk - 0x61] = _computeKeywordStateTable(start + 1, strings, chunkStart, offset + length - chunkStart);
+      result[chunk -
+          0x61] = _computeKeywordStateTable(
+              start + 1,
+              strings,
+              chunkStart,
+              offset + length - chunkStart);
     } else {
       assert(length == 1);
       return new KeywordState(_EMPTY_TABLE, strings[offset]);
@@ -668,9 +529,7 @@
   }
 
   /**
-   * Create the initial state in the state machine.
-   *
-   * @return the state that was created
+   * Create and return the initial state in the state machine.
    */
   static KeywordState _createKeywordStateTable() {
     List<Keyword> values = Keyword.values;
@@ -681,50 +540,10 @@
     strings.sort();
     return _computeKeywordStateTable(0, strings, 0, strings.length);
   }
-
-  /**
-   * A table mapping characters to the states to which those characters will transition. (The index
-   * into the array is the offset from the character `'a'` to the transitioning character.)
-   */
-  final List<KeywordState> _table;
-
-  /**
-   * The keyword that is recognized by this state, or `null` if this state is not a terminal
-   * state.
-   */
-  Keyword _keyword;
-
-  /**
-   * Initialize a newly created state to have the given transitions and to recognize the keyword
-   * with the given syntax.
-   *
-   * @param table a table mapping characters to the states to which those characters will transition
-   * @param syntax the syntax of the keyword that is recognized by the state
-   */
-  KeywordState(this._table, String syntax) {
-    this._keyword = (syntax == null) ? null : Keyword.keywords[syntax];
-  }
-
-  /**
-   * Return the keyword that was recognized by this state, or `null` if this state does not
-   * recognized a keyword.
-   *
-   * @return the keyword that was matched by reaching this state
-   */
-  Keyword keyword() => _keyword;
-
-  /**
-   * Return the state that follows this state on a transition of the given character, or
-   * `null` if there is no valid state reachable from this state with such a transition.
-   *
-   * @param c the character used to transition from this state to another state
-   * @return the state that follows this state on a transition of the given character
-   */
-  KeywordState next(int c) => _table[c - 0x61];
 }
 
 /**
- * Instances of the class `KeywordToken` represent a keyword in the language.
+ * A `KeywordToken` is a keyword in the language.
  */
 class KeywordToken extends Token {
   /**
@@ -733,26 +552,23 @@
   final Keyword keyword;
 
   /**
-   * Initialize a newly created token to represent the given keyword.
-   *
-   * @param keyword the keyword being represented by this token
-   * @param offset the offset from the beginning of the file to the first character in the token
+   * Initialize a newly created token to represent the given [keyword] at the
+   * given [offset].
    */
   KeywordToken(this.keyword, int offset) : super(TokenType.KEYWORD, offset);
 
   @override
-  Token copy() => new KeywordToken(keyword, offset);
+  String get lexeme => keyword.syntax;
 
   @override
-  String get lexeme => keyword.syntax;
+  Token copy() => new KeywordToken(keyword, offset);
 
   @override
   Keyword value() => keyword;
 }
 
 /**
- * Instances of the class `KeywordTokenWithComment` implement a keyword token that is preceded
- * by comments.
+ * A `KeywordTokenWithComment` is a keyword token that is preceded by comments.
  */
 class KeywordTokenWithComment extends KeywordToken {
   /**
@@ -761,17 +577,12 @@
   final Token _precedingComment;
 
   /**
-   * Initialize a newly created token to to represent the given keyword and to be preceded by the
-   * comments reachable from the given comment.
-   *
-   * @param keyword the keyword being represented by this token
-   * @param offset the offset from the beginning of the file to the first character in the token
-   * @param precedingComment the first comment in the list of comments that precede this token
+   * Initialize a newly created token to to represent the given [keyword] at the
+   * given [offset] and to be preceded by the comments reachable from the given
+   * [comment].
    */
-  KeywordTokenWithComment(Keyword keyword, int offset, this._precedingComment) : super(keyword, offset);
-
-  @override
-  Token copy() => new KeywordTokenWithComment(keyword, offset, copyComments(_precedingComment));
+  KeywordTokenWithComment(Keyword keyword, int offset, this._precedingComment)
+      : super(keyword, offset);
 
   @override
   Token get precedingComments => _precedingComment;
@@ -785,16 +596,21 @@
       token = token.next;
     }
   }
+
+  @override
+  Token copy() =>
+      new KeywordTokenWithComment(keyword, offset, copyComments(_precedingComment));
 }
 
 /**
  * The class `Scanner` implements a scanner for Dart code.
  *
- * The lexical structure of Dart is ambiguous without knowledge of the context in which a token is
- * being scanned. For example, without context we cannot determine whether source of the form "<<"
- * should be scanned as a single left-shift operator or as two left angle brackets. This scanner
- * does not have any context, so it always resolves such conflicts by scanning the longest possible
- * token.
+ * The lexical structure of Dart is ambiguous without knowledge of the context
+ * in which a token is being scanned. For example, without context we cannot
+ * determine whether source of the form "<<" should be scanned as a single
+ * left-shift operator or as two left angle brackets. This scanner does not have
+ * any context, so it always resolves such conflicts by scanning the longest
+ * possible token.
  */
 class Scanner {
   /**
@@ -808,12 +624,13 @@
   final CharacterReader _reader;
 
   /**
-   * The error listener that will be informed of any errors that are found during the scan.
+   * The error listener that will be informed of any errors that are found
+   * during the scan.
    */
   final AnalysisErrorListener _errorListener;
 
   /**
-   * The flag specifying if documentation comments should be parsed.
+   * The flag specifying whether documentation comments should be parsed.
    */
   bool _preserveComments = true;
 
@@ -828,12 +645,14 @@
   Token _tail;
 
   /**
-   * The first token in the list of comment tokens found since the last non-comment token.
+   * The first token in the list of comment tokens found since the last
+   * non-comment token.
    */
   Token _firstComment;
 
   /**
-   * The last token in the list of comment tokens found since the last non-comment token.
+   * The last token in the list of comment tokens found since the last
+   * non-comment token.
    */
   Token _lastComment;
 
@@ -843,18 +662,21 @@
   int _tokenStart = 0;
 
   /**
-   * A list containing the offsets of the first character of each line in the source code.
+   * A list containing the offsets of the first character of each line in the
+   * source code.
    */
   List<int> _lineStarts = new List<int>();
 
   /**
-   * A list, treated something like a stack, of tokens representing the beginning of a matched pair.
-   * It is used to pair the end tokens with the begin tokens.
+   * A list, treated something like a stack, of tokens representing the
+   * beginning of a matched pair. It is used to pair the end tokens with the
+   * begin tokens.
    */
   List<BeginToken> _groupingStack = new List<BeginToken>();
 
   /**
-   * The index of the last item in the [groupingStack], or `-1` if the stack is empty.
+   * The index of the last item in the [_groupingStack], or `-1` if the stack is
+   * empty.
    */
   int _stackEnd = -1;
 
@@ -864,11 +686,10 @@
   bool _hasUnmatchedGroups = false;
 
   /**
-   * Initialize a newly created scanner.
-   *
-   * @param source the source being scanned
-   * @param reader the character reader used to read the characters in the source
-   * @param errorListener the error listener that will be informed of any errors that are found
+   * Initialize a newly created scanner to scan characters from the given
+   * [source]. The given character [_reader] will be used to read the characters
+   * in the source. The given [_errorListener] will be informed of any errors
+   * that are found.
    */
   Scanner(this.source, this._reader, this._errorListener) {
     _tokens = new Token(TokenType.EOF, -1);
@@ -879,79 +700,38 @@
   }
 
   /**
-   * Return an array containing the offsets of the first character of each line in the source code.
-   *
-   * @return an array containing the offsets of the first character of each line in the source code
+   * Return the first token in the token stream that was scanned.
    */
-  List<int> get lineStarts => _lineStarts;
+  Token get firstToken => _tokens.next;
 
   /**
    * Return `true` if any unmatched groups were found during the parse.
-   *
-   * @return `true` if any unmatched groups were found during the parse
    */
   bool get hasUnmatchedGroups => _hasUnmatchedGroups;
 
   /**
-   * Set whether documentation tokens should be scanned.
-   *
-   * @param preserveComments `true` if documentation tokens should be scanned
+   * Return an array containing the offsets of the first character of each line
+   * in the source code.
+   */
+  List<int> get lineStarts => _lineStarts;
+
+  /**
+   * Set whether documentation tokens should be preserved.
    */
   void set preserveComments(bool preserveComments) {
     this._preserveComments = preserveComments;
   }
 
   /**
-   * Record that the source begins on the given line and column at the current offset as given by
-   * the reader. The line starts for lines before the given line will not be correct.
-   *
-   * This method must be invoked at most one time and must be invoked before scanning begins. The
-   * values provided must be sensible. The results are undefined if these conditions are violated.
-   *
-   * @param line the one-based index of the line containing the first character of the source
-   * @param column the one-based index of the column in which the first character of the source
-   *          occurs
+   * Return the last token that was scanned.
    */
-  void setSourceStart(int line, int column) {
-    int offset = _reader.offset;
-    if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) {
-      return;
-    }
-    for (int i = 2; i < line; i++) {
-      _lineStarts.add(1);
-    }
-    _lineStarts.add(offset - column + 1);
-  }
+  Token get tail => _tail;
 
   /**
-   * Scan the source code to produce a list of tokens representing the source.
-   *
-   * @return the first token in the list of tokens that were produced
-   */
-  Token tokenize() {
-    InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engine.AbstractScanner.tokenize");
-    int tokenCounter = 0;
-    try {
-      int next = _reader.advance();
-      while (next != -1) {
-        tokenCounter++;
-        next = bigSwitch(next);
-      }
-      _appendEofToken();
-      instrumentation.metric2("tokensCount", tokenCounter);
-      return firstToken;
-    } finally {
-      instrumentation.log2(2);
-      //Log if over 1ms
-    }
-  }
-
-  /**
-   * Append the given token to the end of the token stream being scanned. This method is intended to
-   * be used by subclasses that copy existing tokens and should not normally be used because it will
-   * fail to correctly associate any comments with the token being passed in.
-   *
-   * @param token the token to be appended
+   * Append the given [token] to the end of the token stream being scanned. This
+   * method is intended to be used by subclasses that copy existing tokens and
+   * should not normally be used because it will fail to correctly associate any
+   * comments with the token being passed in.
    */
   void appendToken(Token token) {
     _tail = _tail.setNext(token);
@@ -1057,7 +837,9 @@
       return _reader.advance();
     }
     if (next == 0x5D) {
-      _appendEndToken(TokenType.CLOSE_SQUARE_BRACKET, TokenType.OPEN_SQUARE_BRACKET);
+      _appendEndToken(
+          TokenType.CLOSE_SQUARE_BRACKET,
+          TokenType.OPEN_SQUARE_BRACKET);
       return _reader.advance();
     }
     if (next == 0x60) {
@@ -1069,7 +851,9 @@
       return _reader.advance();
     }
     if (next == 0x7D) {
-      _appendEndToken(TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
+      _appendEndToken(
+          TokenType.CLOSE_CURLY_BRACKET,
+          TokenType.OPEN_CURLY_BRACKET);
       return _reader.advance();
     }
     if (next == 0x2F) {
@@ -1099,26 +883,60 @@
   }
 
   /**
-   * Return the first token in the token stream that was scanned.
-   *
-   * @return the first token in the token stream that was scanned
-   */
-  Token get firstToken => _tokens.next;
-
-  /**
-   * Return the last token that was scanned.
-   *
-   * @return the last token that was scanned
-   */
-  Token get tail => _tail;
-
-  /**
    * Record the fact that we are at the beginning of a new line in the source.
    */
   void recordStartOfLine() {
     _lineStarts.add(_reader.offset);
   }
 
+  /**
+   * Record that the source begins on the given [line] and [column] at the
+   * current offset as given by the reader. The line starts for lines before the
+   * given line will not be correct.
+   *
+   * This method must be invoked at most one time and must be invoked before
+   * scanning begins. The values provided must be sensible. The results are
+   * undefined if these conditions are violated.
+   *
+   * [line] the one-based index of the line containing the first character of
+   * the source
+   * [column] the one-based index of the column in which the first character of
+   * the source occurs
+   */
+  void setSourceStart(int line, int column) {
+    int offset = _reader.offset;
+    if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) {
+      return;
+    }
+    for (int i = 2; i < line; i++) {
+      _lineStarts.add(1);
+    }
+    _lineStarts.add(offset - column + 1);
+  }
+
+  /**
+   * Scan the source code to produce a list of tokens representing the source,
+   * and return the first token in the list of tokens that were produced.
+   */
+  Token tokenize() {
+    InstrumentationBuilder instrumentation =
+        Instrumentation.builder2("dart.engine.AbstractScanner.tokenize");
+    int tokenCounter = 0;
+    try {
+      int next = _reader.advance();
+      while (next != -1) {
+        tokenCounter++;
+        next = bigSwitch(next);
+      }
+      _appendEofToken();
+      instrumentation.metric2("tokensCount", tokenCounter);
+      return firstToken;
+    } finally {
+      instrumentation.log2(2);
+      //Log if over 1ms
+    }
+  }
+
   void _appendBeginToken(TokenType type) {
     BeginToken token;
     if (_firstComment == null) {
@@ -1143,7 +961,8 @@
       _firstComment = new StringToken(type, value, _tokenStart);
       _lastComment = _firstComment;
     } else {
-      _lastComment = _lastComment.setNext(new StringToken(type, value, _tokenStart));
+      _lastComment =
+          _lastComment.setNext(new StringToken(type, value, _tokenStart));
     }
   }
 
@@ -1171,11 +990,13 @@
     if (_firstComment == null) {
       eofToken = new Token(TokenType.EOF, _reader.offset + 1);
     } else {
-      eofToken = new TokenWithComment(TokenType.EOF, _reader.offset + 1, _firstComment);
+      eofToken =
+          new TokenWithComment(TokenType.EOF, _reader.offset + 1, _firstComment);
       _firstComment = null;
       _lastComment = null;
     }
-    // The EOF token points to itself so that there is always infinite look-ahead.
+    // The EOF token points to itself so that there is always infinite
+    // look-ahead.
     eofToken.setNext(eofToken);
     _tail = _tail.setNext(eofToken);
     if (_stackEnd >= 0) {
@@ -1188,7 +1009,8 @@
     if (_firstComment == null) {
       _tail = _tail.setNext(new KeywordToken(keyword, _tokenStart));
     } else {
-      _tail = _tail.setNext(new KeywordTokenWithComment(keyword, _tokenStart, _firstComment));
+      _tail = _tail.setNext(
+          new KeywordTokenWithComment(keyword, _tokenStart, _firstComment));
       _firstComment = null;
       _lastComment = null;
     }
@@ -1198,7 +1020,8 @@
     if (_firstComment == null) {
       _tail = _tail.setNext(new StringToken(type, value, _tokenStart));
     } else {
-      _tail = _tail.setNext(new StringTokenWithComment(type, value, _tokenStart, _firstComment));
+      _tail = _tail.setNext(
+          new StringTokenWithComment(type, value, _tokenStart, _firstComment));
       _firstComment = null;
       _lastComment = null;
     }
@@ -1208,7 +1031,8 @@
     if (_firstComment == null) {
       _tail = _tail.setNext(new StringToken(type, value, _tokenStart + offset));
     } else {
-      _tail = _tail.setNext(new StringTokenWithComment(type, value, _tokenStart + offset, _firstComment));
+      _tail = _tail.setNext(
+          new StringTokenWithComment(type, value, _tokenStart + offset, _firstComment));
       _firstComment = null;
       _lastComment = null;
     }
@@ -1218,7 +1042,8 @@
     if (_firstComment == null) {
       _tail = _tail.setNext(new Token(type, _tokenStart));
     } else {
-      _tail = _tail.setNext(new TokenWithComment(type, _tokenStart, _firstComment));
+      _tail =
+          _tail.setNext(new TokenWithComment(type, _tokenStart, _firstComment));
       _firstComment = null;
       _lastComment = null;
     }
@@ -1239,24 +1064,24 @@
   }
 
   /**
-   * Return the beginning token corresponding to a closing brace that was found while scanning
-   * inside a string interpolation expression. Tokens that cannot be matched with the closing brace
-   * will be dropped from the stack.
-   *
-   * @return the token to be paired with the closing brace
+   * Return the beginning token corresponding to a closing brace that was found
+   * while scanning inside a string interpolation expression. Tokens that cannot
+   * be matched with the closing brace will be dropped from the stack.
    */
   BeginToken _findTokenMatchingClosingBraceInInterpolationExpression() {
     while (_stackEnd >= 0) {
       BeginToken begin = _groupingStack[_stackEnd];
-      if (begin.type == TokenType.OPEN_CURLY_BRACKET || begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
+      if (begin.type == TokenType.OPEN_CURLY_BRACKET ||
+          begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
         return begin;
       }
       _hasUnmatchedGroups = true;
       _groupingStack.removeAt(_stackEnd--);
     }
     //
-    // We should never get to this point because we wouldn't be inside a string interpolation
-    // expression unless we had previously found the start of the expression.
+    // We should never get to this point because we wouldn't be inside a string
+    // interpolation expression unless we had previously found the start of the
+    // expression.
     //
     return null;
   }
@@ -1264,11 +1089,12 @@
   /**
    * Report an error at the current offset.
    *
-   * @param errorCode the error code indicating the nature of the error
-   * @param arguments any arguments needed to complete the error message
+   * [errorCode] the error code indicating the nature of the error
+   * [arguments] any arguments needed to complete the error message
    */
   void _reportError(ScannerErrorCode errorCode, [List<Object> arguments]) {
-    _errorListener.onError(new AnalysisError.con2(source, _reader.offset, 1, errorCode, arguments));
+    _errorListener.onError(
+        new AnalysisError.con2(source, _reader.offset, 1, errorCode, arguments));
   }
 
   int _select(int choice, TokenType yesType, TokenType noType) {
@@ -1282,7 +1108,8 @@
     }
   }
 
-  int _selectWithOffset(int choice, TokenType yesType, TokenType noType, int offset) {
+  int _selectWithOffset(int choice, TokenType yesType, TokenType noType,
+      int offset) {
     int next = _reader.advance();
     if (next == choice) {
       _appendTokenOfTypeWithOffset(yesType, offset);
@@ -1323,7 +1150,8 @@
     }
   }
 
-  int _tokenizeCaret(int next) => _select(0x3D, TokenType.CARET_EQ, TokenType.CARET);
+  int _tokenizeCaret(int next) =>
+      _select(0x3D, TokenType.CARET_EQ, TokenType.CARET);
 
   int _tokenizeDotOrNumber(int next) {
     int start = _reader.offset;
@@ -1331,7 +1159,10 @@
     if (0x30 <= next && next <= 0x39) {
       return _tokenizeFractionPart(next, start);
     } else if (0x2E == next) {
-      return _select(0x2E, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD);
+      return _select(
+          0x2E,
+          TokenType.PERIOD_PERIOD_PERIOD,
+          TokenType.PERIOD_PERIOD);
     } else {
       _appendTokenOfType(TokenType.PERIOD);
       return next;
@@ -1401,12 +1232,18 @@
     if (!hasDigit) {
       _appendStringToken(TokenType.INT, _reader.getString(start, -2));
       if (0x2E == next) {
-        return _selectWithOffset(0x2E, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD, _reader.offset - 1);
+        return _selectWithOffset(
+            0x2E,
+            TokenType.PERIOD_PERIOD_PERIOD,
+            TokenType.PERIOD_PERIOD,
+            _reader.offset - 1);
       }
       _appendTokenOfTypeWithOffset(TokenType.PERIOD, _reader.offset - 1);
       return bigSwitch(next);
     }
-    _appendStringToken(TokenType.DOUBLE, _reader.getString(start, next < 0 ? 0 : -1));
+    _appendStringToken(
+        TokenType.DOUBLE,
+        _reader.getString(start, next < 0 ? 0 : -1));
     return next;
   }
 
@@ -1436,13 +1273,17 @@
     bool hasDigits = false;
     while (true) {
       next = _reader.advance();
-      if ((0x30 <= next && next <= 0x39) || (0x41 <= next && next <= 0x46) || (0x61 <= next && next <= 0x66)) {
+      if ((0x30 <= next && next <= 0x39) ||
+          (0x41 <= next && next <= 0x46) ||
+          (0x61 <= next && next <= 0x66)) {
         hasDigits = true;
       } else {
         if (!hasDigits) {
           _reportError(ScannerErrorCode.MISSING_HEX_DIGIT);
         }
-        _appendStringToken(TokenType.HEXADECIMAL, _reader.getString(start, next < 0 ? 0 : -1));
+        _appendStringToken(
+            TokenType.HEXADECIMAL,
+            _reader.getString(start, next < 0 ? 0 : -1));
         return next;
       }
     }
@@ -1458,10 +1299,16 @@
   }
 
   int _tokenizeIdentifier(int next, int start, bool allowDollar) {
-    while ((0x61 <= next && next <= 0x7A) || (0x41 <= next && next <= 0x5A) || (0x30 <= next && next <= 0x39) || next == 0x5F || (next == 0x24 && allowDollar)) {
+    while ((0x61 <= next && next <= 0x7A) ||
+        (0x41 <= next && next <= 0x5A) ||
+        (0x30 <= next && next <= 0x39) ||
+        next == 0x5F ||
+        (next == 0x24 && allowDollar)) {
       next = _reader.advance();
     }
-    _appendStringToken(TokenType.IDENTIFIER, _reader.getString(start, next < 0 ? 0 : -1));
+    _appendStringToken(
+        TokenType.IDENTIFIER,
+        _reader.getString(start, next < 0 ? 0 : -1));
     return next;
   }
 
@@ -1470,7 +1317,8 @@
     next = _reader.advance();
     while (next != -1) {
       if (next == 0x7D) {
-        BeginToken begin = _findTokenMatchingClosingBraceInInterpolationExpression();
+        BeginToken begin =
+            _findTokenMatchingClosingBraceInInterpolationExpression();
         if (begin == null) {
           _beginToken();
           _appendTokenOfType(TokenType.CLOSE_CURLY_BRACKET);
@@ -1479,12 +1327,16 @@
           return next;
         } else if (begin.type == TokenType.OPEN_CURLY_BRACKET) {
           _beginToken();
-          _appendEndToken(TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
+          _appendEndToken(
+              TokenType.CLOSE_CURLY_BRACKET,
+              TokenType.OPEN_CURLY_BRACKET);
           next = _reader.advance();
           _beginToken();
         } else if (begin.type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
           _beginToken();
-          _appendEndToken(TokenType.CLOSE_CURLY_BRACKET, TokenType.STRING_INTERPOLATION_EXPRESSION);
+          _appendEndToken(
+              TokenType.CLOSE_CURLY_BRACKET,
+              TokenType.STRING_INTERPOLATION_EXPRESSION);
           next = _reader.advance();
           _beginToken();
           return next;
@@ -1497,8 +1349,13 @@
   }
 
   int _tokenizeInterpolatedIdentifier(int next, int start) {
-    _appendStringTokenWithOffset(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 0);
-    if ((0x41 <= next && next <= 0x5A) || (0x61 <= next && next <= 0x7A) || next == 0x5F) {
+    _appendStringTokenWithOffset(
+        TokenType.STRING_INTERPOLATION_IDENTIFIER,
+        "\$",
+        0);
+    if ((0x41 <= next && next <= 0x5A) ||
+        (0x61 <= next && next <= 0x7A) ||
+        next == 0x5F) {
       _beginToken();
       next = _tokenizeKeywordOrIdentifier(next, false);
     }
@@ -1516,7 +1373,10 @@
     if (state == null || state.keyword() == null) {
       return _tokenizeIdentifier(next, start, allowDollar);
     }
-    if ((0x41 <= next && next <= 0x5A) || (0x30 <= next && next <= 0x39) || next == 0x5F || next == 0x24) {
+    if ((0x41 <= next && next <= 0x5A) ||
+        (0x30 <= next && next <= 0x39) ||
+        next == 0x5F ||
+        next == 0x24) {
       return _tokenizeIdentifier(next, start, allowDollar);
     } else if (next < 128) {
       _appendKeywordToken(state.keyword());
@@ -1561,14 +1421,18 @@
     while (true) {
       if (-1 == next) {
         _reportError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT);
-        _appendCommentToken(TokenType.MULTI_LINE_COMMENT, _reader.getString(_tokenStart, 0));
+        _appendCommentToken(
+            TokenType.MULTI_LINE_COMMENT,
+            _reader.getString(_tokenStart, 0));
         return next;
       } else if (0x2A == next) {
         next = _reader.advance();
         if (0x2F == next) {
           --nesting;
           if (0 == nesting) {
-            _appendCommentToken(TokenType.MULTI_LINE_COMMENT, _reader.getString(_tokenStart, 0));
+            _appendCommentToken(
+                TokenType.MULTI_LINE_COMMENT,
+                _reader.getString(_tokenStart, 0));
             return _reader.advance();
           } else {
             next = _reader.advance();
@@ -1690,7 +1554,8 @@
     return _reader.advance();
   }
 
-  int _tokenizeMultiply(int next) => _select(0x3D, TokenType.STAR_EQ, TokenType.STAR);
+  int _tokenizeMultiply(int next) =>
+      _select(0x3D, TokenType.STAR_EQ, TokenType.STAR);
 
   int _tokenizeNumber(int next) {
     int start = _reader.offset;
@@ -1703,7 +1568,9 @@
       } else if (next == 0x65 || next == 0x45) {
         return _tokenizeFractionPart(next, start);
       } else {
-        _appendStringToken(TokenType.INT, _reader.getString(start, next < 0 ? 0 : -1));
+        _appendStringToken(
+            TokenType.INT,
+            _reader.getString(start, next < 0 ? 0 : -1));
         return next;
       }
     }
@@ -1720,7 +1587,8 @@
     }
   }
 
-  int _tokenizePercent(int next) => _select(0x3D, TokenType.PERCENT_EQ, TokenType.PERCENT);
+  int _tokenizePercent(int next) =>
+      _select(0x3D, TokenType.PERCENT_EQ, TokenType.PERCENT);
 
   int _tokenizePlus(int next) {
     // + ++ +=
@@ -1741,10 +1609,14 @@
     while (true) {
       next = _reader.advance();
       if (-1 == next) {
-        _appendCommentToken(TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, 0));
+        _appendCommentToken(
+            TokenType.SINGLE_LINE_COMMENT,
+            _reader.getString(_tokenStart, 0));
         return next;
       } else if (0xA == next || 0xD == next) {
-        _appendCommentToken(TokenType.SINGLE_LINE_COMMENT, _reader.getString(_tokenStart, -1));
+        _appendCommentToken(
+            TokenType.SINGLE_LINE_COMMENT,
+            _reader.getString(_tokenStart, -1));
         return next;
       }
     }
@@ -1849,7 +1721,9 @@
         do {
           next = _reader.advance();
         } while (next != 0xA && next != 0xD && next > 0);
-        _appendStringToken(TokenType.SCRIPT_TAG, _reader.getString(_tokenStart, 0));
+        _appendStringToken(
+            TokenType.SCRIPT_TAG,
+            _reader.getString(_tokenStart, 0));
         return next;
       }
     }
@@ -1874,27 +1748,25 @@
  * detected by the scanner.
  */
 class ScannerErrorCode extends ErrorCode {
-  static const ScannerErrorCode ILLEGAL_CHARACTER
-      = const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character {0}");
+  static const ScannerErrorCode ILLEGAL_CHARACTER =
+      const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character {0}");
 
-  static const ScannerErrorCode MISSING_DIGIT
-      = const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected");
+  static const ScannerErrorCode MISSING_DIGIT =
+      const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected");
 
-  static const ScannerErrorCode MISSING_HEX_DIGIT
-      = const ScannerErrorCode(
-          'MISSING_HEX_DIGIT',
-          "Hexidecimal digit expected");
+  static const ScannerErrorCode MISSING_HEX_DIGIT =
+      const ScannerErrorCode('MISSING_HEX_DIGIT', "Hexidecimal digit expected");
 
-  static const ScannerErrorCode MISSING_QUOTE
-      = const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \")");
+  static const ScannerErrorCode MISSING_QUOTE =
+      const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \")");
 
-  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT
-      = const ScannerErrorCode(
+  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
+      const ScannerErrorCode(
           'UNTERMINATED_MULTI_LINE_COMMENT',
           "Unterminated multi-line comment");
 
-  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL
-      = const ScannerErrorCode(
+  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
+      const ScannerErrorCode(
           'UNTERMINATED_STRING_LITERAL',
           "Unterminated string literal");
 
@@ -1915,8 +1787,7 @@
 }
 
 /**
- * Instances of the class `StringToken` represent a token whose value is independent of it's
- * type.
+ * A `StringToken` is a token whose value is independent of it's type.
  */
 class StringToken extends Token {
   /**
@@ -1925,29 +1796,25 @@
   String _value;
 
   /**
-   * Initialize a newly created token to represent a token of the given type with the given value.
-   *
-   * @param type the type of the token
-   * @param value the lexeme represented by this token
-   * @param offset the offset from the beginning of the file to the first character in the token
+   * Initialize a newly created token to represent a token of the given [type]
+   * with the given [value] at the given [offset].
    */
   StringToken(TokenType type, String value, int offset) : super(type, offset) {
     this._value = StringUtilities.intern(value);
   }
 
   @override
-  Token copy() => new StringToken(type, _value, offset);
+  String get lexeme => _value;
 
   @override
-  String get lexeme => _value;
+  Token copy() => new StringToken(type, _value, offset);
 
   @override
   String value() => _value;
 }
 
 /**
- * Instances of the class `TokenWithComment` represent a string token that is preceded by
- * comments.
+ * A `StringTokenWithComment` is a string token that is preceded by comments.
  */
 class StringTokenWithComment extends StringToken {
   /**
@@ -1956,17 +1823,13 @@
   final Token _precedingComment;
 
   /**
-   * Initialize a newly created token to have the given type and offset and to be preceded by the
-   * comments reachable from the given comment.
-   *
-   * @param type the type of the token
-   * @param offset the offset from the beginning of the file to the first character in the token
-   * @param precedingComment the first comment in the list of comments that precede this token
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [comment].
    */
-  StringTokenWithComment(TokenType type, String value, int offset, this._precedingComment) : super(type, value, offset);
-
-  @override
-  Token copy() => new StringTokenWithComment(type, lexeme, offset, copyComments(_precedingComment));
+  StringTokenWithComment(TokenType type, String value, int offset,
+      this._precedingComment)
+      : super(type, value, offset);
 
   @override
   Token get precedingComments => _precedingComment;
@@ -1980,25 +1843,33 @@
       token = token.next;
     }
   }
+
+  @override
+  Token copy() =>
+      new StringTokenWithComment(
+          type,
+          lexeme,
+          offset,
+          copyComments(_precedingComment));
 }
 
 /**
- * Instances of the class `SubSequenceReader` implement a [CharacterReader] that reads
- * characters from a character sequence, but adds a delta when reporting the current character
- * offset so that the character sequence can be a subsequence from a larger sequence.
+ * A `SubSequenceReader` is a [CharacterReader] that reads characters from a
+ * character sequence, but adds a delta when reporting the current character
+ * offset so that the character sequence can be a subsequence from a larger
+ * sequence.
  */
 class SubSequenceReader extends CharSequenceReader {
   /**
-   * The offset from the beginning of the file to the beginning of the source being scanned.
+   * The offset from the beginning of the file to the beginning of the source
+   * being scanned.
    */
   final int _offsetDelta;
 
   /**
-   * Initialize a newly created reader to read the characters in the given sequence.
-   *
-   * @param sequence the sequence from which characters will be read
-   * @param offsetDelta the offset from the beginning of the file to the beginning of the source
-   *          being scanned
+   * Initialize a newly created reader to read the characters in the given
+   * [sequence]. The [_offsetDelta] is the offset from the beginning of the file
+   * to the beginning of the source being scanned
    */
   SubSequenceReader(String sequence, this._offsetDelta) : super(sequence);
 
@@ -2006,34 +1877,34 @@
   int get offset => _offsetDelta + super.offset;
 
   @override
-  String getString(int start, int endDelta) => super.getString(start - _offsetDelta, endDelta);
-
-  @override
   void set offset(int offset) {
     super.offset = offset - _offsetDelta;
   }
+
+  @override
+  String getString(int start, int endDelta) =>
+      super.getString(start - _offsetDelta, endDelta);
 }
 
 /**
- * Synthetic `StringToken` represent a token whose value is independent of it's type.
+ * A `SyntheticStringToken` is a token whose value is independent of it's type.
  */
 class SyntheticStringToken extends StringToken {
   /**
-   * Initialize a newly created token to represent a token of the given type with the given value.
-   *
-   * @param type the type of the token
-   * @param value the lexeme represented by this token
-   * @param offset the offset from the beginning of the file to the first character in the token
+   * Initialize a newly created token to represent a token of the given [type]
+   * with the given [value] at the given [offset].
    */
-  SyntheticStringToken(TokenType type, String value, int offset) : super(type, value, offset);
+  SyntheticStringToken(TokenType type, String value, int offset)
+      : super(type, value, offset);
 
   @override
   bool get isSynthetic => true;
 }
 
 /**
- * Instances of the class `Token` represent a token that was scanned from the input. Each
- * token knows which token follows it, acting as the head of a linked list of tokens.
+ * Instances of the class `Token` represent a token that was scanned from the
+ * input. Each token knows which tokens preceed and follow it, acting as a link
+ * in a doubly linked list of tokens.
  */
 class Token {
   /**
@@ -2042,7 +1913,8 @@
   final TokenType type;
 
   /**
-   * The offset from the beginning of the file to the first character in the token.
+   * The offset from the beginning of the file to the first character in the
+   * token.
    */
   int offset = 0;
 
@@ -2057,149 +1929,78 @@
   Token _next;
 
   /**
-   * Initialize a newly created token to have the given type and offset.
-   *
-   * @param type the type of the token
-   * @param offset the offset from the beginning of the file to the first character in the token
+   * Initialize a newly created token to have the given [type] and [offset].
    */
   Token(this.type, int offset) {
     this.offset = offset;
   }
 
   /**
-   * Return a newly created token that is a copy of this token but that is not a part of any token
-   * stream.
-   *
-   * @return a newly created token that is a copy of this token
-   */
-  Token copy() => new Token(type, offset);
-
-  /**
-   * Return the offset from the beginning of the file to the character after last character of the
-   * token.
-   *
-   * @return the offset from the beginning of the file to the first character after last character
-   *         of the token
+   * Return the offset from the beginning of the file to the character after the
+   * last character of the token.
    */
   int get end => offset + length;
 
   /**
+   * Return `true` if this token represents an operator.
+   */
+  bool get isOperator => type.isOperator;
+
+  /**
+   * Return `true` if this token is a synthetic token. A synthetic token is a
+   * token that was introduced by the parser in order to recover from an error
+   * in the code.
+   */
+  bool get isSynthetic => length == 0;
+
+  /**
+   * Return `true` if this token represents an operator that can be defined by
+   * users.
+   */
+  bool get isUserDefinableOperator => type.isUserDefinableOperator;
+
+  /**
    * Return the number of characters in the node's source range.
-   *
-   * @return the number of characters in the node's source range
    */
   int get length => lexeme.length;
 
   /**
    * Return the lexeme that represents this token.
-   *
-   * @return the lexeme that represents this token
    */
   String get lexeme => type.lexeme;
 
   /**
    * Return the next token in the token stream.
-   *
-   * @return the next token in the token stream
    */
   Token get next => _next;
 
   /**
-   * Return the first comment in the list of comments that precede this token, or `null` if
-   * there are no comments preceding this token. Additional comments can be reached by following the
-   * token stream using [getNext] until `null` is returned.
+   * Return the first comment in the list of comments that precede this token,
+   * or `null` if there are no comments preceding this token. Additional
+   * comments can be reached by following the token stream using [next] until
+   * `null` is returned.
    *
-   * @return the first comment in the list of comments that precede this token
+   * For example, if the original contents were "/* one */ /* two */ id", then
+   * the first precceding comment token will have a lexeme of "/* one */" and
+   * the next comment token will have a lexeme of "/* two */".
    */
   Token get precedingComments => null;
 
   /**
-   * Return `true` if this token represents an operator.
-   *
-   * @return `true` if this token represents an operator
-   */
-  bool get isOperator => type.isOperator;
-
-  /**
-   * Return `true` if this token is a synthetic token. A synthetic token is a token that was
-   * introduced by the parser in order to recover from an error in the code.
-   *
-   * @return `true` if this token is a synthetic token
-   */
-  bool get isSynthetic => length == 0;
-
-  /**
-   * Return `true` if this token represents an operator that can be defined by users.
-   *
-   * @return `true` if this token represents an operator that can be defined by users
-   */
-  bool get isUserDefinableOperator => type.isUserDefinableOperator;
-
-  /**
-   * Return `true` if this token has any one of the given types.
-   *
-   * @param types the types of token that are being tested for
-   * @return `true` if this token has any of the given types
-   */
-  bool matchesAny(List<TokenType> types) {
-    for (TokenType type in types) {
-      if (this.type == type) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Set the next token in the token stream to the given token. This has the side-effect of setting
-   * this token to be the previous token for the given token.
-   *
-   * @param token the next token in the token stream
-   * @return the token that was passed in
-   */
-  Token setNext(Token token) {
-    _next = token;
-    token.previous = this;
-    return token;
-  }
-
-  /**
-   * Set the next token in the token stream to the given token without changing which token is the
-   * previous token for the given token.
-   *
-   * @param token the next token in the token stream
-   * @return the token that was passed in
-   */
-  Token setNextWithoutSettingPrevious(Token token) {
-    _next = token;
-    return token;
-  }
-
-  @override
-  String toString() => lexeme;
-
-  /**
-   * Return the value of this token. For keyword tokens, this is the keyword associated with the
-   * token, for other tokens it is the lexeme associated with the token.
-   *
-   * @return the value of this token
-   */
-  Object value() => type.lexeme;
-
-  /**
-   * Apply (add) the given delta to this token's offset.
-   *
-   * @param delta the amount by which the offset is to be adjusted
+   * Apply (add) the given [delta] to this token's offset.
    */
   void applyDelta(int delta) {
     offset += delta;
   }
 
   /**
+   * Return a newly created token that is a copy of this token but that is not a
+   * part of any token stream.
+   */
+  Token copy() => new Token(type, offset);
+
+  /**
    * Copy a linked list of comment tokens identical to the given comment tokens.
-   *
-   * @param token the first token in the list, or `null` if there are no tokens to be copied
-   * @return the tokens that were created
    */
   Token copyComments(Token token) {
     if (token == null) {
@@ -2214,334 +2015,390 @@
     }
     return head;
   }
+
+  /**
+   * Return `true` if this token has any one of the given [types].
+   */
+  bool matchesAny(List<TokenType> types) {
+    for (TokenType type in types) {
+      if (this.type == type) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Set the next token in the token stream to the given [token]. This has the
+   * side-effect of setting this token to be the previous token for the given
+   * token. Return the token that was passed in.
+   */
+  Token setNext(Token token) {
+    _next = token;
+    token.previous = this;
+    return token;
+  }
+
+  /**
+   * Set the next token in the token stream to the given token without changing
+   * which token is the previous token for the given token. Return the token
+   * that was passed in.
+   */
+  Token setNextWithoutSettingPrevious(Token token) {
+    _next = token;
+    return token;
+  }
+
+  @override
+  String toString() => lexeme;
+
+  /**
+   * Return the value of this token. For keyword tokens, this is the keyword
+   * associated with the token, for other tokens it is the lexeme associated
+   * with the token.
+   */
+  Object value() => type.lexeme;
+
+  /**
+   * Compare the given [tokens] to find the token that appears first in the
+   * source being parsed. That is, return the left-most of all of the tokens.
+   * The list must be non-`null`, but the elements of the list are allowed to be
+   * `null`. Return the token with the smallest offset, or `null` if the list is
+   * empty or if all of the elements of the list are `null`.
+   */
+  static Token lexicallyFirst(List<Token> tokens) {
+    Token first = null;
+    int offset = -1;
+    for (Token token in tokens) {
+      if (token != null && (offset < 0 || token.offset < offset)) {
+        first = token;
+        offset = token.offset;
+      }
+    }
+    return first;
+  }
 }
 
 /**
- * The enumeration `TokenClass` represents classes (or groups) of tokens with a similar use.
+ * The enumeration `TokenClass` represents classes (or groups) of tokens with a
+ * similar use.
  */
-class TokenClass extends Enum<TokenClass> {
+class TokenClass {
   /**
-   * A value used to indicate that the token type is not part of any specific class of token.
+   * A value used to indicate that the token type is not part of any specific
+   * class of token.
    */
-  static const TokenClass NO_CLASS = const TokenClass.con1('NO_CLASS', 0);
+  static const TokenClass NO_CLASS = const TokenClass('NO_CLASS');
 
   /**
    * A value used to indicate that the token type is an additive operator.
    */
-  static const TokenClass ADDITIVE_OPERATOR = const TokenClass.con2('ADDITIVE_OPERATOR', 1, 12);
+  static const TokenClass ADDITIVE_OPERATOR =
+      const TokenClass('ADDITIVE_OPERATOR', 12);
 
   /**
    * A value used to indicate that the token type is an assignment operator.
    */
-  static const TokenClass ASSIGNMENT_OPERATOR = const TokenClass.con2('ASSIGNMENT_OPERATOR', 2, 1);
+  static const TokenClass ASSIGNMENT_OPERATOR =
+      const TokenClass('ASSIGNMENT_OPERATOR', 1);
 
   /**
    * A value used to indicate that the token type is a bitwise-and operator.
    */
-  static const TokenClass BITWISE_AND_OPERATOR = const TokenClass.con2('BITWISE_AND_OPERATOR', 3, 10);
+  static const TokenClass BITWISE_AND_OPERATOR =
+      const TokenClass('BITWISE_AND_OPERATOR', 10);
 
   /**
    * A value used to indicate that the token type is a bitwise-or operator.
    */
-  static const TokenClass BITWISE_OR_OPERATOR = const TokenClass.con2('BITWISE_OR_OPERATOR', 4, 8);
+  static const TokenClass BITWISE_OR_OPERATOR =
+      const TokenClass('BITWISE_OR_OPERATOR', 8);
 
   /**
    * A value used to indicate that the token type is a bitwise-xor operator.
    */
-  static const TokenClass BITWISE_XOR_OPERATOR = const TokenClass.con2('BITWISE_XOR_OPERATOR', 5, 9);
+  static const TokenClass BITWISE_XOR_OPERATOR =
+      const TokenClass('BITWISE_XOR_OPERATOR', 9);
 
   /**
    * A value used to indicate that the token type is a cascade operator.
    */
-  static const TokenClass CASCADE_OPERATOR = const TokenClass.con2('CASCADE_OPERATOR', 6, 2);
+  static const TokenClass CASCADE_OPERATOR =
+      const TokenClass('CASCADE_OPERATOR', 2);
 
   /**
    * A value used to indicate that the token type is a conditional operator.
    */
-  static const TokenClass CONDITIONAL_OPERATOR = const TokenClass.con2('CONDITIONAL_OPERATOR', 7, 3);
+  static const TokenClass CONDITIONAL_OPERATOR =
+      const TokenClass('CONDITIONAL_OPERATOR', 3);
 
   /**
    * A value used to indicate that the token type is an equality operator.
    */
-  static const TokenClass EQUALITY_OPERATOR = const TokenClass.con2('EQUALITY_OPERATOR', 8, 6);
+  static const TokenClass EQUALITY_OPERATOR =
+      const TokenClass('EQUALITY_OPERATOR', 6);
 
   /**
    * A value used to indicate that the token type is a logical-and operator.
    */
-  static const TokenClass LOGICAL_AND_OPERATOR = const TokenClass.con2('LOGICAL_AND_OPERATOR', 9, 5);
+  static const TokenClass LOGICAL_AND_OPERATOR =
+      const TokenClass('LOGICAL_AND_OPERATOR', 5);
 
   /**
    * A value used to indicate that the token type is a logical-or operator.
    */
-  static const TokenClass LOGICAL_OR_OPERATOR = const TokenClass.con2('LOGICAL_OR_OPERATOR', 10, 4);
+  static const TokenClass LOGICAL_OR_OPERATOR =
+      const TokenClass('LOGICAL_OR_OPERATOR', 4);
 
   /**
    * A value used to indicate that the token type is a multiplicative operator.
    */
-  static const TokenClass MULTIPLICATIVE_OPERATOR = const TokenClass.con2('MULTIPLICATIVE_OPERATOR', 11, 13);
+  static const TokenClass MULTIPLICATIVE_OPERATOR =
+      const TokenClass('MULTIPLICATIVE_OPERATOR', 13);
 
   /**
    * A value used to indicate that the token type is a relational operator.
    */
-  static const TokenClass RELATIONAL_OPERATOR = const TokenClass.con2('RELATIONAL_OPERATOR', 12, 7);
+  static const TokenClass RELATIONAL_OPERATOR =
+      const TokenClass('RELATIONAL_OPERATOR', 7);
 
   /**
    * A value used to indicate that the token type is a shift operator.
    */
-  static const TokenClass SHIFT_OPERATOR = const TokenClass.con2('SHIFT_OPERATOR', 13, 11);
+  static const TokenClass SHIFT_OPERATOR =
+      const TokenClass('SHIFT_OPERATOR', 11);
 
   /**
    * A value used to indicate that the token type is a unary operator.
    */
-  static const TokenClass UNARY_POSTFIX_OPERATOR = const TokenClass.con2('UNARY_POSTFIX_OPERATOR', 14, 15);
+  static const TokenClass UNARY_POSTFIX_OPERATOR =
+      const TokenClass('UNARY_POSTFIX_OPERATOR', 15);
 
   /**
    * A value used to indicate that the token type is a unary operator.
    */
-  static const TokenClass UNARY_PREFIX_OPERATOR = const TokenClass.con2('UNARY_PREFIX_OPERATOR', 15, 14);
-
-  static const List<TokenClass> values = const [
-      NO_CLASS,
-      ADDITIVE_OPERATOR,
-      ASSIGNMENT_OPERATOR,
-      BITWISE_AND_OPERATOR,
-      BITWISE_OR_OPERATOR,
-      BITWISE_XOR_OPERATOR,
-      CASCADE_OPERATOR,
-      CONDITIONAL_OPERATOR,
-      EQUALITY_OPERATOR,
-      LOGICAL_AND_OPERATOR,
-      LOGICAL_OR_OPERATOR,
-      MULTIPLICATIVE_OPERATOR,
-      RELATIONAL_OPERATOR,
-      SHIFT_OPERATOR,
-      UNARY_POSTFIX_OPERATOR,
-      UNARY_PREFIX_OPERATOR];
+  static const TokenClass UNARY_PREFIX_OPERATOR =
+      const TokenClass('UNARY_PREFIX_OPERATOR', 14);
 
   /**
-   * The precedence of tokens of this class, or `0` if the such tokens do not represent an
-   * operator.
+   * The name of the token class.
+   */
+  final String name;
+
+  /**
+   * The precedence of tokens of this class, or `0` if the such tokens do not
+   * represent an operator.
    */
   final int precedence;
 
-  const TokenClass.con1(String name, int ordinal) : this.con2(name, ordinal, 0);
+  const TokenClass(this.name, [this.precedence = 0]);
 
-  const TokenClass.con2(String name, int ordinal, this.precedence) : super(name, ordinal);
+  @override
+  String toString() => name;
 }
 
 /**
- * The enumeration `TokenType` defines the types of tokens that can be returned by the
- * scanner.
+ * The enumeration `TokenType` defines the types of tokens that can be returned
+ * by the scanner.
  */
-class TokenType extends Enum<TokenType> {
+class TokenType {
   /**
    * The type of the token that marks the end of the input.
    */
-  static const TokenType EOF = const TokenType_EOF('EOF', 0, TokenClass.NO_CLASS, "");
+  static const TokenType EOF = const TokenType_EOF('EOF');
 
-  static const TokenType DOUBLE = const TokenType.con1('DOUBLE', 1);
+  static const TokenType DOUBLE = const TokenType('DOUBLE');
 
-  static const TokenType HEXADECIMAL = const TokenType.con1('HEXADECIMAL', 2);
+  static const TokenType HEXADECIMAL = const TokenType('HEXADECIMAL');
 
-  static const TokenType IDENTIFIER = const TokenType.con1('IDENTIFIER', 3);
+  static const TokenType IDENTIFIER = const TokenType('IDENTIFIER');
 
-  static const TokenType INT = const TokenType.con1('INT', 4);
+  static const TokenType INT = const TokenType('INT');
 
-  static const TokenType KEYWORD = const TokenType.con1('KEYWORD', 5);
+  static const TokenType KEYWORD = const TokenType('KEYWORD');
 
-  static const TokenType MULTI_LINE_COMMENT = const TokenType.con1('MULTI_LINE_COMMENT', 6);
+  static const TokenType MULTI_LINE_COMMENT =
+      const TokenType('MULTI_LINE_COMMENT');
 
-  static const TokenType SCRIPT_TAG = const TokenType.con1('SCRIPT_TAG', 7);
+  static const TokenType SCRIPT_TAG = const TokenType('SCRIPT_TAG');
 
-  static const TokenType SINGLE_LINE_COMMENT = const TokenType.con1('SINGLE_LINE_COMMENT', 8);
+  static const TokenType SINGLE_LINE_COMMENT =
+      const TokenType('SINGLE_LINE_COMMENT');
 
-  static const TokenType STRING = const TokenType.con1('STRING', 9);
+  static const TokenType STRING = const TokenType('STRING');
 
-  static const TokenType AMPERSAND = const TokenType.con2('AMPERSAND', 10, TokenClass.BITWISE_AND_OPERATOR, "&");
+  static const TokenType AMPERSAND =
+      const TokenType('AMPERSAND', TokenClass.BITWISE_AND_OPERATOR, "&");
 
-  static const TokenType AMPERSAND_AMPERSAND = const TokenType.con2('AMPERSAND_AMPERSAND', 11, TokenClass.LOGICAL_AND_OPERATOR, "&&");
+  static const TokenType AMPERSAND_AMPERSAND =
+      const TokenType('AMPERSAND_AMPERSAND', TokenClass.LOGICAL_AND_OPERATOR, "&&");
 
-  static const TokenType AMPERSAND_EQ = const TokenType.con2('AMPERSAND_EQ', 12, TokenClass.ASSIGNMENT_OPERATOR, "&=");
+  static const TokenType AMPERSAND_EQ =
+      const TokenType('AMPERSAND_EQ', TokenClass.ASSIGNMENT_OPERATOR, "&=");
 
-  static const TokenType AT = const TokenType.con2('AT', 13, TokenClass.NO_CLASS, "@");
+  static const TokenType AT = const TokenType('AT', TokenClass.NO_CLASS, "@");
 
-  static const TokenType BANG = const TokenType.con2('BANG', 14, TokenClass.UNARY_PREFIX_OPERATOR, "!");
+  static const TokenType BANG =
+      const TokenType('BANG', TokenClass.UNARY_PREFIX_OPERATOR, "!");
 
-  static const TokenType BANG_EQ = const TokenType.con2('BANG_EQ', 15, TokenClass.EQUALITY_OPERATOR, "!=");
+  static const TokenType BANG_EQ =
+      const TokenType('BANG_EQ', TokenClass.EQUALITY_OPERATOR, "!=");
 
-  static const TokenType BAR = const TokenType.con2('BAR', 16, TokenClass.BITWISE_OR_OPERATOR, "|");
+  static const TokenType BAR =
+      const TokenType('BAR', TokenClass.BITWISE_OR_OPERATOR, "|");
 
-  static const TokenType BAR_BAR = const TokenType.con2('BAR_BAR', 17, TokenClass.LOGICAL_OR_OPERATOR, "||");
+  static const TokenType BAR_BAR =
+      const TokenType('BAR_BAR', TokenClass.LOGICAL_OR_OPERATOR, "||");
 
-  static const TokenType BAR_EQ = const TokenType.con2('BAR_EQ', 18, TokenClass.ASSIGNMENT_OPERATOR, "|=");
+  static const TokenType BAR_EQ =
+      const TokenType('BAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, "|=");
 
-  static const TokenType COLON = const TokenType.con2('COLON', 19, TokenClass.NO_CLASS, ":");
+  static const TokenType COLON =
+      const TokenType('COLON', TokenClass.NO_CLASS, ":");
 
-  static const TokenType COMMA = const TokenType.con2('COMMA', 20, TokenClass.NO_CLASS, ",");
+  static const TokenType COMMA =
+      const TokenType('COMMA', TokenClass.NO_CLASS, ",");
 
-  static const TokenType CARET = const TokenType.con2('CARET', 21, TokenClass.BITWISE_XOR_OPERATOR, "^");
+  static const TokenType CARET =
+      const TokenType('CARET', TokenClass.BITWISE_XOR_OPERATOR, "^");
 
-  static const TokenType CARET_EQ = const TokenType.con2('CARET_EQ', 22, TokenClass.ASSIGNMENT_OPERATOR, "^=");
+  static const TokenType CARET_EQ =
+      const TokenType('CARET_EQ', TokenClass.ASSIGNMENT_OPERATOR, "^=");
 
-  static const TokenType CLOSE_CURLY_BRACKET = const TokenType.con2('CLOSE_CURLY_BRACKET', 23, TokenClass.NO_CLASS, "}");
+  static const TokenType CLOSE_CURLY_BRACKET =
+      const TokenType('CLOSE_CURLY_BRACKET', TokenClass.NO_CLASS, "}");
 
-  static const TokenType CLOSE_PAREN = const TokenType.con2('CLOSE_PAREN', 24, TokenClass.NO_CLASS, ")");
+  static const TokenType CLOSE_PAREN =
+      const TokenType('CLOSE_PAREN', TokenClass.NO_CLASS, ")");
 
-  static const TokenType CLOSE_SQUARE_BRACKET = const TokenType.con2('CLOSE_SQUARE_BRACKET', 25, TokenClass.NO_CLASS, "]");
+  static const TokenType CLOSE_SQUARE_BRACKET =
+      const TokenType('CLOSE_SQUARE_BRACKET', TokenClass.NO_CLASS, "]");
 
-  static const TokenType EQ = const TokenType.con2('EQ', 26, TokenClass.ASSIGNMENT_OPERATOR, "=");
+  static const TokenType EQ =
+      const TokenType('EQ', TokenClass.ASSIGNMENT_OPERATOR, "=");
 
-  static const TokenType EQ_EQ = const TokenType.con2('EQ_EQ', 27, TokenClass.EQUALITY_OPERATOR, "==");
+  static const TokenType EQ_EQ =
+      const TokenType('EQ_EQ', TokenClass.EQUALITY_OPERATOR, "==");
 
-  static const TokenType FUNCTION = const TokenType.con2('FUNCTION', 28, TokenClass.NO_CLASS, "=>");
+  static const TokenType FUNCTION =
+      const TokenType('FUNCTION', TokenClass.NO_CLASS, "=>");
 
-  static const TokenType GT = const TokenType.con2('GT', 29, TokenClass.RELATIONAL_OPERATOR, ">");
+  static const TokenType GT =
+      const TokenType('GT', TokenClass.RELATIONAL_OPERATOR, ">");
 
-  static const TokenType GT_EQ = const TokenType.con2('GT_EQ', 30, TokenClass.RELATIONAL_OPERATOR, ">=");
+  static const TokenType GT_EQ =
+      const TokenType('GT_EQ', TokenClass.RELATIONAL_OPERATOR, ">=");
 
-  static const TokenType GT_GT = const TokenType.con2('GT_GT', 31, TokenClass.SHIFT_OPERATOR, ">>");
+  static const TokenType GT_GT =
+      const TokenType('GT_GT', TokenClass.SHIFT_OPERATOR, ">>");
 
-  static const TokenType GT_GT_EQ = const TokenType.con2('GT_GT_EQ', 32, TokenClass.ASSIGNMENT_OPERATOR, ">>=");
+  static const TokenType GT_GT_EQ =
+      const TokenType('GT_GT_EQ', TokenClass.ASSIGNMENT_OPERATOR, ">>=");
 
-  static const TokenType HASH = const TokenType.con2('HASH', 33, TokenClass.NO_CLASS, "#");
+  static const TokenType HASH =
+      const TokenType('HASH', TokenClass.NO_CLASS, "#");
 
-  static const TokenType INDEX = const TokenType.con2('INDEX', 34, TokenClass.UNARY_POSTFIX_OPERATOR, "[]");
+  static const TokenType INDEX =
+      const TokenType('INDEX', TokenClass.UNARY_POSTFIX_OPERATOR, "[]");
 
-  static const TokenType INDEX_EQ = const TokenType.con2('INDEX_EQ', 35, TokenClass.UNARY_POSTFIX_OPERATOR, "[]=");
+  static const TokenType INDEX_EQ =
+      const TokenType('INDEX_EQ', TokenClass.UNARY_POSTFIX_OPERATOR, "[]=");
 
-  static const TokenType IS = const TokenType.con2('IS', 36, TokenClass.RELATIONAL_OPERATOR, "is");
+  static const TokenType IS =
+      const TokenType('IS', TokenClass.RELATIONAL_OPERATOR, "is");
 
-  static const TokenType LT = const TokenType.con2('LT', 37, TokenClass.RELATIONAL_OPERATOR, "<");
+  static const TokenType LT =
+      const TokenType('LT', TokenClass.RELATIONAL_OPERATOR, "<");
 
-  static const TokenType LT_EQ = const TokenType.con2('LT_EQ', 38, TokenClass.RELATIONAL_OPERATOR, "<=");
+  static const TokenType LT_EQ =
+      const TokenType('LT_EQ', TokenClass.RELATIONAL_OPERATOR, "<=");
 
-  static const TokenType LT_LT = const TokenType.con2('LT_LT', 39, TokenClass.SHIFT_OPERATOR, "<<");
+  static const TokenType LT_LT =
+      const TokenType('LT_LT', TokenClass.SHIFT_OPERATOR, "<<");
 
-  static const TokenType LT_LT_EQ = const TokenType.con2('LT_LT_EQ', 40, TokenClass.ASSIGNMENT_OPERATOR, "<<=");
+  static const TokenType LT_LT_EQ =
+      const TokenType('LT_LT_EQ', TokenClass.ASSIGNMENT_OPERATOR, "<<=");
 
-  static const TokenType MINUS = const TokenType.con2('MINUS', 41, TokenClass.ADDITIVE_OPERATOR, "-");
+  static const TokenType MINUS =
+      const TokenType('MINUS', TokenClass.ADDITIVE_OPERATOR, "-");
 
-  static const TokenType MINUS_EQ = const TokenType.con2('MINUS_EQ', 42, TokenClass.ASSIGNMENT_OPERATOR, "-=");
+  static const TokenType MINUS_EQ =
+      const TokenType('MINUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, "-=");
 
-  static const TokenType MINUS_MINUS = const TokenType.con2('MINUS_MINUS', 43, TokenClass.UNARY_PREFIX_OPERATOR, "--");
+  static const TokenType MINUS_MINUS =
+      const TokenType('MINUS_MINUS', TokenClass.UNARY_PREFIX_OPERATOR, "--");
 
-  static const TokenType OPEN_CURLY_BRACKET = const TokenType.con2('OPEN_CURLY_BRACKET', 44, TokenClass.NO_CLASS, "{");
+  static const TokenType OPEN_CURLY_BRACKET =
+      const TokenType('OPEN_CURLY_BRACKET', TokenClass.NO_CLASS, "{");
 
-  static const TokenType OPEN_PAREN = const TokenType.con2('OPEN_PAREN', 45, TokenClass.UNARY_POSTFIX_OPERATOR, "(");
+  static const TokenType OPEN_PAREN =
+      const TokenType('OPEN_PAREN', TokenClass.UNARY_POSTFIX_OPERATOR, "(");
 
-  static const TokenType OPEN_SQUARE_BRACKET = const TokenType.con2('OPEN_SQUARE_BRACKET', 46, TokenClass.UNARY_POSTFIX_OPERATOR, "[");
+  static const TokenType OPEN_SQUARE_BRACKET =
+      const TokenType('OPEN_SQUARE_BRACKET', TokenClass.UNARY_POSTFIX_OPERATOR, "[");
 
-  static const TokenType PERCENT = const TokenType.con2('PERCENT', 47, TokenClass.MULTIPLICATIVE_OPERATOR, "%");
-
-  static const TokenType PERCENT_EQ = const TokenType.con2('PERCENT_EQ', 48, TokenClass.ASSIGNMENT_OPERATOR, "%=");
+  static const TokenType PERCENT =
+      const TokenType('PERCENT', TokenClass.MULTIPLICATIVE_OPERATOR, "%");
 
-  static const TokenType PERIOD = const TokenType.con2('PERIOD', 49, TokenClass.UNARY_POSTFIX_OPERATOR, ".");
+  static const TokenType PERCENT_EQ =
+      const TokenType('PERCENT_EQ', TokenClass.ASSIGNMENT_OPERATOR, "%=");
 
-  static const TokenType PERIOD_PERIOD = const TokenType.con2('PERIOD_PERIOD', 50, TokenClass.CASCADE_OPERATOR, "..");
+  static const TokenType PERIOD =
+      const TokenType('PERIOD', TokenClass.UNARY_POSTFIX_OPERATOR, ".");
 
-  static const TokenType PLUS = const TokenType.con2('PLUS', 51, TokenClass.ADDITIVE_OPERATOR, "+");
+  static const TokenType PERIOD_PERIOD =
+      const TokenType('PERIOD_PERIOD', TokenClass.CASCADE_OPERATOR, "..");
 
-  static const TokenType PLUS_EQ = const TokenType.con2('PLUS_EQ', 52, TokenClass.ASSIGNMENT_OPERATOR, "+=");
+  static const TokenType PLUS =
+      const TokenType('PLUS', TokenClass.ADDITIVE_OPERATOR, "+");
 
-  static const TokenType PLUS_PLUS = const TokenType.con2('PLUS_PLUS', 53, TokenClass.UNARY_PREFIX_OPERATOR, "++");
+  static const TokenType PLUS_EQ =
+      const TokenType('PLUS_EQ', TokenClass.ASSIGNMENT_OPERATOR, "+=");
 
-  static const TokenType QUESTION = const TokenType.con2('QUESTION', 54, TokenClass.CONDITIONAL_OPERATOR, "?");
+  static const TokenType PLUS_PLUS =
+      const TokenType('PLUS_PLUS', TokenClass.UNARY_PREFIX_OPERATOR, "++");
 
-  static const TokenType SEMICOLON = const TokenType.con2('SEMICOLON', 55, TokenClass.NO_CLASS, ";");
+  static const TokenType QUESTION =
+      const TokenType('QUESTION', TokenClass.CONDITIONAL_OPERATOR, "?");
 
-  static const TokenType SLASH = const TokenType.con2('SLASH', 56, TokenClass.MULTIPLICATIVE_OPERATOR, "/");
+  static const TokenType SEMICOLON =
+      const TokenType('SEMICOLON', TokenClass.NO_CLASS, ";");
 
-  static const TokenType SLASH_EQ = const TokenType.con2('SLASH_EQ', 57, TokenClass.ASSIGNMENT_OPERATOR, "/=");
+  static const TokenType SLASH =
+      const TokenType('SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, "/");
 
-  static const TokenType STAR = const TokenType.con2('STAR', 58, TokenClass.MULTIPLICATIVE_OPERATOR, "*");
+  static const TokenType SLASH_EQ =
+      const TokenType('SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, "/=");
 
-  static const TokenType STAR_EQ = const TokenType.con2('STAR_EQ', 59, TokenClass.ASSIGNMENT_OPERATOR, "*=");
+  static const TokenType STAR =
+      const TokenType('STAR', TokenClass.MULTIPLICATIVE_OPERATOR, "*");
 
-  static const TokenType STRING_INTERPOLATION_EXPRESSION = const TokenType.con2('STRING_INTERPOLATION_EXPRESSION', 60, TokenClass.NO_CLASS, "\${");
+  static const TokenType STAR_EQ =
+      const TokenType('STAR_EQ', TokenClass.ASSIGNMENT_OPERATOR, "*=");
 
-  static const TokenType STRING_INTERPOLATION_IDENTIFIER = const TokenType.con2('STRING_INTERPOLATION_IDENTIFIER', 61, TokenClass.NO_CLASS, "\$");
+  static const TokenType STRING_INTERPOLATION_EXPRESSION =
+      const TokenType('STRING_INTERPOLATION_EXPRESSION', TokenClass.NO_CLASS, "\${");
 
-  static const TokenType TILDE = const TokenType.con2('TILDE', 62, TokenClass.UNARY_PREFIX_OPERATOR, "~");
+  static const TokenType STRING_INTERPOLATION_IDENTIFIER =
+      const TokenType('STRING_INTERPOLATION_IDENTIFIER', TokenClass.NO_CLASS, "\$");
 
-  static const TokenType TILDE_SLASH = const TokenType.con2('TILDE_SLASH', 63, TokenClass.MULTIPLICATIVE_OPERATOR, "~/");
+  static const TokenType TILDE =
+      const TokenType('TILDE', TokenClass.UNARY_PREFIX_OPERATOR, "~");
 
-  static const TokenType TILDE_SLASH_EQ = const TokenType.con2('TILDE_SLASH_EQ', 64, TokenClass.ASSIGNMENT_OPERATOR, "~/=");
+  static const TokenType TILDE_SLASH =
+      const TokenType('TILDE_SLASH', TokenClass.MULTIPLICATIVE_OPERATOR, "~/");
 
-  static const TokenType BACKPING = const TokenType.con2('BACKPING', 65, TokenClass.NO_CLASS, "`");
+  static const TokenType TILDE_SLASH_EQ =
+      const TokenType('TILDE_SLASH_EQ', TokenClass.ASSIGNMENT_OPERATOR, "~/=");
 
-  static const TokenType BACKSLASH = const TokenType.con2('BACKSLASH', 66, TokenClass.NO_CLASS, "\\");
+  static const TokenType BACKPING =
+      const TokenType('BACKPING', TokenClass.NO_CLASS, "`");
 
-  static const TokenType PERIOD_PERIOD_PERIOD = const TokenType.con2('PERIOD_PERIOD_PERIOD', 67, TokenClass.NO_CLASS, "...");
+  static const TokenType BACKSLASH =
+      const TokenType('BACKSLASH', TokenClass.NO_CLASS, "\\");
 
-  static const List<TokenType> values = const [
-      EOF,
-      DOUBLE,
-      HEXADECIMAL,
-      IDENTIFIER,
-      INT,
-      KEYWORD,
-      MULTI_LINE_COMMENT,
-      SCRIPT_TAG,
-      SINGLE_LINE_COMMENT,
-      STRING,
-      AMPERSAND,
-      AMPERSAND_AMPERSAND,
-      AMPERSAND_EQ,
-      AT,
-      BANG,
-      BANG_EQ,
-      BAR,
-      BAR_BAR,
-      BAR_EQ,
-      COLON,
-      COMMA,
-      CARET,
-      CARET_EQ,
-      CLOSE_CURLY_BRACKET,
-      CLOSE_PAREN,
-      CLOSE_SQUARE_BRACKET,
-      EQ,
-      EQ_EQ,
-      FUNCTION,
-      GT,
-      GT_EQ,
-      GT_GT,
-      GT_GT_EQ,
-      HASH,
-      INDEX,
-      INDEX_EQ,
-      IS,
-      LT,
-      LT_EQ,
-      LT_LT,
-      LT_LT_EQ,
-      MINUS,
-      MINUS_EQ,
-      MINUS_MINUS,
-      OPEN_CURLY_BRACKET,
-      OPEN_PAREN,
-      OPEN_SQUARE_BRACKET,
-      PERCENT,
-      PERCENT_EQ,
-      PERIOD,
-      PERIOD_PERIOD,
-      PLUS,
-      PLUS_EQ,
-      PLUS_PLUS,
-      QUESTION,
-      SEMICOLON,
-      SLASH,
-      SLASH_EQ,
-      STAR,
-      STAR_EQ,
-      STRING_INTERPOLATION_EXPRESSION,
-      STRING_INTERPOLATION_IDENTIFIER,
-      TILDE,
-      TILDE_SLASH,
-      TILDE_SLASH_EQ,
-      BACKPING,
-      BACKSLASH,
-      PERIOD_PERIOD_PERIOD];
+  static const TokenType PERIOD_PERIOD_PERIOD =
+      const TokenType('PERIOD_PERIOD_PERIOD', TokenClass.NO_CLASS, "...");
 
   /**
    * The class of the token.
@@ -2549,124 +2406,144 @@
   final TokenClass _tokenClass;
 
   /**
-   * The lexeme that defines this type of token, or `null` if there is more than one possible
-   * lexeme for this type of token.
+   * The name of the token type.
+   */
+  final String name;
+
+  /**
+   * The lexeme that defines this type of token, or `null` if there is more than
+   * one possible lexeme for this type of token.
    */
   final String lexeme;
 
-  const TokenType.con1(String name, int ordinal) : this.con2(name, ordinal, TokenClass.NO_CLASS, null);
-
-  const TokenType.con2(String name, int ordinal, this._tokenClass, this.lexeme) : super(name, ordinal);
-
-  /**
-   * Return the precedence of the token, or `0` if the token does not represent an operator.
-   *
-   * @return the precedence of the token
-   */
-  int get precedence => _tokenClass.precedence;
+  const TokenType(this.name, [this._tokenClass = TokenClass.NO_CLASS,
+      this.lexeme = null]);
 
   /**
    * Return `true` if this type of token represents an additive operator.
-   *
-   * @return `true` if this type of token represents an additive operator
    */
   bool get isAdditiveOperator => _tokenClass == TokenClass.ADDITIVE_OPERATOR;
 
   /**
    * Return `true` if this type of token represents an assignment operator.
-   *
-   * @return `true` if this type of token represents an assignment operator
    */
-  bool get isAssignmentOperator => _tokenClass == TokenClass.ASSIGNMENT_OPERATOR;
+  bool get isAssignmentOperator =>
+      _tokenClass == TokenClass.ASSIGNMENT_OPERATOR;
 
   /**
-   * Return `true` if this type of token represents an associative operator. An associative
-   * operator is an operator for which the following equality is true:
-   * `(a * b) * c == a * (b * c)`. In other words, if the result of applying the operator to
-   * multiple operands does not depend on the order in which those applications occur.
+   * Return `true` if this type of token represents an associative operator. An
+   * associative operator is an operator for which the following equality is
+   * true: `(a * b) * c == a * (b * c)`. In other words, if the result of
+   * applying the operator to multiple operands does not depend on the order in
+   * which those applications occur.
    *
-   * Note: This method considers the logical-and and logical-or operators to be associative, even
-   * though the order in which the application of those operators can have an effect because
-   * evaluation of the right-hand operand is conditional.
-   *
-   * @return `true` if this type of token represents an associative operator
+   * Note: This method considers the logical-and and logical-or operators to be
+   * associative, even though the order in which the application of those
+   * operators can have an effect because evaluation of the right-hand operand
+   * is conditional.
    */
-  bool get isAssociativeOperator => this == AMPERSAND || this == AMPERSAND_AMPERSAND || this == BAR || this == BAR_BAR || this == CARET || this == PLUS || this == STAR;
+  bool get isAssociativeOperator =>
+      this == AMPERSAND ||
+          this == AMPERSAND_AMPERSAND ||
+          this == BAR ||
+          this == BAR_BAR ||
+          this == CARET ||
+          this == PLUS ||
+          this == STAR;
 
   /**
    * Return `true` if this type of token represents an equality operator.
-   *
-   * @return `true` if this type of token represents an equality operator
    */
   bool get isEqualityOperator => _tokenClass == TokenClass.EQUALITY_OPERATOR;
 
   /**
    * Return `true` if this type of token represents an increment operator.
-   *
-   * @return `true` if this type of token represents an increment operator
    */
-  bool get isIncrementOperator => identical(lexeme, "++") || identical(lexeme, "--");
+  bool get isIncrementOperator =>
+      identical(lexeme, "++") || identical(lexeme, "--");
 
   /**
    * Return `true` if this type of token represents a multiplicative operator.
-   *
-   * @return `true` if this type of token represents a multiplicative operator
    */
-  bool get isMultiplicativeOperator => _tokenClass == TokenClass.MULTIPLICATIVE_OPERATOR;
+  bool get isMultiplicativeOperator =>
+      _tokenClass == TokenClass.MULTIPLICATIVE_OPERATOR;
 
   /**
    * Return `true` if this token type represents an operator.
-   *
-   * @return `true` if this token type represents an operator
    */
-  bool get isOperator => _tokenClass != TokenClass.NO_CLASS && this != OPEN_PAREN && this != OPEN_SQUARE_BRACKET && this != PERIOD;
+  bool get isOperator =>
+      _tokenClass != TokenClass.NO_CLASS &&
+          this != OPEN_PAREN &&
+          this != OPEN_SQUARE_BRACKET &&
+          this != PERIOD;
 
   /**
    * Return `true` if this type of token represents a relational operator.
-   *
-   * @return `true` if this type of token represents a relational operator
    */
-  bool get isRelationalOperator => _tokenClass == TokenClass.RELATIONAL_OPERATOR;
+  bool get isRelationalOperator =>
+      _tokenClass == TokenClass.RELATIONAL_OPERATOR;
 
   /**
    * Return `true` if this type of token represents a shift operator.
-   *
-   * @return `true` if this type of token represents a shift operator
    */
   bool get isShiftOperator => _tokenClass == TokenClass.SHIFT_OPERATOR;
 
   /**
    * Return `true` if this type of token represents a unary postfix operator.
-   *
-   * @return `true` if this type of token represents a unary postfix operator
    */
-  bool get isUnaryPostfixOperator => _tokenClass == TokenClass.UNARY_POSTFIX_OPERATOR;
+  bool get isUnaryPostfixOperator =>
+      _tokenClass == TokenClass.UNARY_POSTFIX_OPERATOR;
 
   /**
    * Return `true` if this type of token represents a unary prefix operator.
-   *
-   * @return `true` if this type of token represents a unary prefix operator
    */
-  bool get isUnaryPrefixOperator => _tokenClass == TokenClass.UNARY_PREFIX_OPERATOR;
+  bool get isUnaryPrefixOperator =>
+      _tokenClass == TokenClass.UNARY_PREFIX_OPERATOR;
 
   /**
-   * Return `true` if this token type represents an operator that can be defined by users.
-   *
-   * @return `true` if this token type represents an operator that can be defined by users
+   * Return `true` if this token type represents an operator that can be defined
+   * by users.
    */
-  bool get isUserDefinableOperator => identical(lexeme, "==") || identical(lexeme, "~") || identical(lexeme, "[]") || identical(lexeme, "[]=") || identical(lexeme, "*") || identical(lexeme, "/") || identical(lexeme, "%") || identical(lexeme, "~/") || identical(lexeme, "+") || identical(lexeme, "-") || identical(lexeme, "<<") || identical(lexeme, ">>") || identical(lexeme, ">=") || identical(lexeme, ">") || identical(lexeme, "<=") || identical(lexeme, "<") || identical(lexeme, "&") || identical(lexeme, "^") || identical(lexeme, "|");
+  bool get isUserDefinableOperator =>
+      identical(lexeme, "==") ||
+          identical(lexeme, "~") ||
+          identical(lexeme, "[]") ||
+          identical(lexeme, "[]=") ||
+          identical(lexeme, "*") ||
+          identical(lexeme, "/") ||
+          identical(lexeme, "%") ||
+          identical(lexeme, "~/") ||
+          identical(lexeme, "+") ||
+          identical(lexeme, "-") ||
+          identical(lexeme, "<<") ||
+          identical(lexeme, ">>") ||
+          identical(lexeme, ">=") ||
+          identical(lexeme, ">") ||
+          identical(lexeme, "<=") ||
+          identical(lexeme, "<") ||
+          identical(lexeme, "&") ||
+          identical(lexeme, "^") ||
+          identical(lexeme, "|");
+
+  /**
+   * Return the precedence of the token, or `0` if the token does not represent
+   * an operator.
+   */
+  int get precedence => _tokenClass.precedence;
+
+  @override
+  String toString() => name;
 }
 
 class TokenType_EOF extends TokenType {
-  const TokenType_EOF(String name, int ordinal, TokenClass arg0, String arg1) : super.con2(name, ordinal, arg0, arg1);
+  const TokenType_EOF(String name) : super(name, TokenClass.NO_CLASS, "");
 
   @override
   String toString() => "-eof-";
 }
 
 /**
- * Instances of the class `TokenWithComment` represent a normal token that is preceded by
- * comments.
+ * A `TokenWithComment` is a normal token that is preceded by comments.
  */
 class TokenWithComment extends Token {
   /**
@@ -2675,18 +2552,16 @@
   final Token _precedingComment;
 
   /**
-   * Initialize a newly created token to have the given type and offset and to be preceded by the
-   * comments reachable from the given comment.
-   *
-   * @param type the type of the token
-   * @param offset the offset from the beginning of the file to the first character in the token
-   * @param precedingComment the first comment in the list of comments that precede this token
+   * Initialize a newly created token to have the given [type] at the given
+   * [offset] and to be preceded by the comments reachable from the given
+   * [comment].
    */
-  TokenWithComment(TokenType type, int offset, this._precedingComment) : super(type, offset);
-
-  @override
-  Token copy() => new TokenWithComment(type, offset, _precedingComment);
+  TokenWithComment(TokenType type, int offset, this._precedingComment)
+      : super(type, offset);
 
   @override
   Token get precedingComments => _precedingComment;
-}
\ No newline at end of file
+
+  @override
+  Token copy() => new TokenWithComment(type, offset, _precedingComment);
+}
diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart
index 494021c..9bd5a7f 100644
--- a/pkg/analyzer/lib/src/generated/sdk.dart
+++ b/pkg/analyzer/lib/src/generated/sdk.dart
@@ -8,9 +8,10 @@
 library engine.sdk;
 
 import 'dart:collection';
-import 'source.dart' show ContentCache, Source, UriKind;
+
 import 'ast.dart';
 import 'engine.dart' show AnalysisContext;
+import 'source.dart' show ContentCache, Source, UriKind;
 
 /**
  * Instances of the class `DartSdk` represent a Dart SDK installed in a specified location.
@@ -37,16 +38,6 @@
   static final String DEFAULT_VERSION = "0";
 
   /**
-   * Return a source representing the given file: URI if the file is in this SDK, or `null` if
-   * the file is not in this SDK.
-   *
-   * @param uri the file URI for which a source is to be returned
-   * @return the source representing the given URI
-   * @throws
-   */
-  Source fromFileUri(Uri uri);
-
-  /**
    * Return the [AnalysisContext] used for all of the sources in this [DartSdk].
    *
    * @return the [AnalysisContext] used for all of the sources in this [DartSdk]
@@ -61,15 +52,6 @@
   List<SdkLibrary> get sdkLibraries;
 
   /**
-   * Return the library representing the library with the given `dart:` URI, or `null`
-   * if the given URI does not denote a library in this SDK.
-   *
-   * @param dartUri the URI of the library to be returned
-   * @return the SDK library object
-   */
-  SdkLibrary getSdkLibrary(String dartUri);
-
-  /**
    * Return the revision number of this SDK, or `"0"` if the revision number cannot be
    * discovered.
    *
@@ -85,6 +67,25 @@
   List<String> get uris;
 
   /**
+   * Return a source representing the given file: URI if the file is in this SDK, or `null` if
+   * the file is not in this SDK.
+   *
+   * @param uri the file URI for which a source is to be returned
+   * @return the source representing the given URI
+   * @throws
+   */
+  Source fromFileUri(Uri uri);
+
+  /**
+   * Return the library representing the library with the given `dart:` URI, or `null`
+   * if the given URI does not denote a library in this SDK.
+   *
+   * @param dartUri the URI of the library to be returned
+   * @return the SDK library object
+   */
+  SdkLibrary getSdkLibrary(String dartUri);
+
+  /**
    * Return the source representing the library with the given `dart:` URI, or `null` if
    * the given URI does not denote a library in this SDK.
    *
@@ -102,15 +103,8 @@
   /**
    * A table mapping Dart library URI's to the library.
    */
-  HashMap<String, SdkLibraryImpl> _libraryMap = new HashMap<String, SdkLibraryImpl>();
-
-  /**
-   * Return the library with the given URI, or `null` if the URI does not map to a library.
-   *
-   * @param dartUri the URI of the library to be returned
-   * @return the library with the given URI
-   */
-  SdkLibrary getLibrary(String dartUri) => _libraryMap[dartUri];
+  HashMap<String, SdkLibraryImpl> _libraryMap =
+      new HashMap<String, SdkLibraryImpl>();
 
   /**
    * Return an array containing all the sdk libraries [SdkLibraryImpl] in the mapping
@@ -130,6 +124,14 @@
    * Return the library with the given URI, or `null` if the URI does not map to a library.
    *
    * @param dartUri the URI of the library to be returned
+   * @return the library with the given URI
+   */
+  SdkLibrary getLibrary(String dartUri) => _libraryMap[dartUri];
+
+  /**
+   * Return the library with the given URI, or `null` if the URI does not map to a library.
+   *
+   * @param dartUri the URI of the library to be returned
    * @param library the library with the given URI
    */
   void setLibrary(String dartUri, SdkLibraryImpl library) {
@@ -268,21 +270,6 @@
   String get category;
 
   /**
-   * Return the path to the file defining the library. The path is relative to the `lib`
-   * directory within the SDK.
-   *
-   * @return the path to the file defining the library
-   */
-  String get path;
-
-  /**
-   * Return the short name of the library. This is the URI of the library, including `dart:`.
-   *
-   * @return the short name of the library
-   */
-  String get shortName;
-
-  /**
    * Return `true` if this library can be compiled to JavaScript by dart2js.
    *
    * @return `true` if this library can be compiled to JavaScript by dart2js
@@ -323,6 +310,21 @@
    * @return `true` if this library can be run on the VM
    */
   bool get isVmLibrary;
+
+  /**
+   * Return the path to the file defining the library. The path is relative to the `lib`
+   * directory within the SDK.
+   *
+   * @return the path to the file defining the library
+   */
+  String get path;
+
+  /**
+   * Return the short name of the library. This is the URI of the library, including `dart:`.
+   *
+   * @return the short name of the library
+   */
+  String get shortName;
 }
 
 /**
@@ -331,6 +333,18 @@
  */
 class SdkLibraryImpl implements SdkLibrary {
   /**
+   * The bit mask used to access the bit representing the flag indicating whether a library is
+   * intended to work on the dart2js platform.
+   */
+  static int DART2JS_PLATFORM = 1;
+
+  /**
+   * The bit mask used to access the bit representing the flag indicating whether a library is
+   * intended to work on the VM platform.
+   */
+  static int VM_PLATFORM = 2;
+
+  /**
    * The short name of the library. This is the name used after `dart:` in a URI.
    */
   String _shortName = null;
@@ -363,18 +377,6 @@
   int _platforms = 0;
 
   /**
-   * The bit mask used to access the bit representing the flag indicating whether a library is
-   * intended to work on the dart2js platform.
-   */
-  static int DART2JS_PLATFORM = 1;
-
-  /**
-   * The bit mask used to access the bit representing the flag indicating whether a library is
-   * intended to work on the VM platform.
-   */
-  static int VM_PLATFORM = 2;
-
-  /**
    * Initialize a newly created library to represent the library with the given name.
    *
    * @param name the short name of the library
@@ -383,8 +385,23 @@
     this._shortName = name;
   }
 
-  @override
-  String get shortName => _shortName;
+  /**
+   * Set whether the library is documented to match the given value.
+   *
+   * @param documented `true` if the library is documented
+   */
+  void set documented(bool documented) {
+    this._documented = documented;
+  }
+
+  /**
+   * Set whether the library is an implementation library to match the given value.
+   *
+   * @param implementation `true` if the library is an implementation library
+   */
+  void set implementation(bool implementation) {
+    this._implementation = implementation;
+  }
 
   @override
   bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0;
@@ -412,6 +429,9 @@
   @override
   bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0;
 
+  @override
+  String get shortName => _shortName;
+
   /**
    * Record that this library can be compiled to JavaScript by dart2js.
    */
@@ -420,27 +440,9 @@
   }
 
   /**
-   * Set whether the library is documented to match the given value.
-   *
-   * @param documented `true` if the library is documented
-   */
-  void set documented(bool documented) {
-    this._documented = documented;
-  }
-
-  /**
-   * Set whether the library is an implementation library to match the given value.
-   *
-   * @param implementation `true` if the library is an implementation library
-   */
-  void set implementation(bool implementation) {
-    this._implementation = implementation;
-  }
-
-  /**
    * Record that this library can be run on the VM.
    */
   void setVmLibrary() {
     _platforms |= VM_PLATFORM;
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/sdk_io.dart b/pkg/analyzer/lib/src/generated/sdk_io.dart
index 565f080..4e92f02 100644
--- a/pkg/analyzer/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer/lib/src/generated/sdk_io.dart
@@ -9,16 +9,16 @@
 
 import 'package:analyzer/src/generated/java_engine.dart';
 
-import 'java_core.dart';
-import 'java_io.dart';
-import 'java_engine_io.dart';
-import 'source_io.dart';
-import 'error.dart';
-import 'scanner.dart';
 import 'ast.dart';
-import 'parser.dart';
-import 'sdk.dart';
 import 'engine.dart';
+import 'error.dart';
+import 'java_core.dart';
+import 'java_engine_io.dart';
+import 'java_io.dart';
+import 'parser.dart';
+import 'scanner.dart';
+import 'sdk.dart';
+import 'source_io.dart';
 
 /**
  * Instances of the class `DirectoryBasedDartSdk` represent a Dart SDK installed in a
@@ -40,51 +40,6 @@
  */
 class DirectoryBasedDartSdk implements DartSdk {
   /**
-   * The [AnalysisContext] which is used for all of the sources in this [DartSdk].
-   */
-  InternalAnalysisContext _analysisContext;
-
-  /**
-   * The directory containing the SDK.
-   */
-  JavaFile _sdkDirectory;
-
-  /**
-   * The revision number of this SDK, or `"0"` if the revision number cannot be discovered.
-   */
-  String _sdkVersion;
-
-  /**
-   * The file containing the dart2js executable.
-   */
-  JavaFile _dart2jsExecutable;
-
-  /**
-   * The file containing the dart formatter executable.
-   */
-  JavaFile _dartFmtExecutable;
-
-  /**
-   * The file containing the Dartium executable.
-   */
-  JavaFile _dartiumExecutable;
-
-  /**
-   * The file containing the pub executable.
-   */
-  JavaFile _pubExecutable;
-
-  /**
-   * The file containing the VM executable.
-   */
-  JavaFile _vmExecutable;
-
-  /**
-   * A mapping from Dart library URI's to the library represented by that URI.
-   */
-  LibraryMap _libraryMap;
-
-  /**
    * The default SDK, or `null` if the default SDK either has not yet been created or cannot
    * be created for some reason.
    */
@@ -128,7 +83,8 @@
   /**
    * The name of the file containing the Dartium executable on Macintosh.
    */
-  static String _DARTIUM_EXECUTABLE_NAME_MAC = "Chromium.app/Contents/MacOS/Chromium";
+  static String _DARTIUM_EXECUTABLE_NAME_MAC =
+      "Chromium.app/Contents/MacOS/Chromium";
 
   /**
    * The name of the file containing the Dartium executable on Windows.
@@ -218,7 +174,8 @@
    * @return the default directory for the Dart SDK
    */
   static JavaFile get defaultSdkDirectory {
-    String sdkProperty = JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NAME);
+    String sdkProperty =
+        JavaSystemIO.getProperty(_DEFAULT_DIRECTORY_PROPERTY_NAME);
     if (sdkProperty == null) {
       return null;
     }
@@ -230,6 +187,51 @@
   }
 
   /**
+   * The [AnalysisContext] which is used for all of the sources in this [DartSdk].
+   */
+  InternalAnalysisContext _analysisContext;
+
+  /**
+   * The directory containing the SDK.
+   */
+  JavaFile _sdkDirectory;
+
+  /**
+   * The revision number of this SDK, or `"0"` if the revision number cannot be discovered.
+   */
+  String _sdkVersion;
+
+  /**
+   * The file containing the dart2js executable.
+   */
+  JavaFile _dart2jsExecutable;
+
+  /**
+   * The file containing the dart formatter executable.
+   */
+  JavaFile _dartFmtExecutable;
+
+  /**
+   * The file containing the Dartium executable.
+   */
+  JavaFile _dartiumExecutable;
+
+  /**
+   * The file containing the pub executable.
+   */
+  JavaFile _pubExecutable;
+
+  /**
+   * The file containing the VM executable.
+   */
+  JavaFile _vmExecutable;
+
+  /**
+   * A mapping from Dart library URI's to the library represented by that URI.
+   */
+  LibraryMap _libraryMap;
+
+  /**
    * Initialize a newly created SDK to represent the Dart SDK installed in the given directory.
    *
    * @param sdkDirectory the directory containing the SDK
@@ -241,6 +243,208 @@
   }
 
   @override
+  AnalysisContext get context {
+    if (_analysisContext == null) {
+      _analysisContext = new SdkAnalysisContext();
+      SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
+      _analysisContext.sourceFactory = factory;
+      List<String> uris = this.uris;
+      ChangeSet changeSet = new ChangeSet();
+      for (String uri in uris) {
+        changeSet.addedSource(factory.forUri(uri));
+      }
+      _analysisContext.applyChanges(changeSet);
+    }
+    return _analysisContext;
+  }
+
+  /**
+   * Return the file containing the dart2js executable, or `null` if it does not exist.
+   *
+   * @return the file containing the dart2js executable
+   */
+  JavaFile get dart2JsExecutable {
+    if (_dart2jsExecutable == null) {
+      _dart2jsExecutable = _verifyExecutable(
+          new JavaFile.relative(
+              new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+              OSUtilities.isWindows() ?
+                  _DART2JS_EXECUTABLE_NAME_WIN :
+                  _DART2JS_EXECUTABLE_NAME));
+    }
+    return _dart2jsExecutable;
+  }
+
+  /**
+   * Return the file containing the dart formatter executable, or `null` if it does not exist.
+   *
+   * @return the file containing the dart formatter executable
+   */
+  JavaFile get dartFmtExecutable {
+    if (_dartFmtExecutable == null) {
+      _dartFmtExecutable = _verifyExecutable(
+          new JavaFile.relative(
+              new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+              OSUtilities.isWindows() ?
+                  _DARTFMT_EXECUTABLE_NAME_WIN :
+                  _DARTFMT_EXECUTABLE_NAME));
+    }
+    return _dartFmtExecutable;
+  }
+
+  /**
+   * Return the name of the file containing the Dartium executable.
+   *
+   * @return the name of the file containing the Dartium executable
+   */
+  String get dartiumBinaryName {
+    if (OSUtilities.isWindows()) {
+      return _DARTIUM_EXECUTABLE_NAME_WIN;
+    } else if (OSUtilities.isMac()) {
+      return _DARTIUM_EXECUTABLE_NAME_MAC;
+    } else {
+      return _DARTIUM_EXECUTABLE_NAME_LINUX;
+    }
+  }
+
+  /**
+   * Return the file containing the Dartium executable, or `null` if it does not exist.
+   *
+   * @return the file containing the Dartium executable
+   */
+  JavaFile get dartiumExecutable {
+    if (_dartiumExecutable == null) {
+      _dartiumExecutable = _verifyExecutable(
+          new JavaFile.relative(dartiumWorkingDirectory, dartiumBinaryName));
+    }
+    return _dartiumExecutable;
+  }
+
+  /**
+   * Return the directory where dartium can be found (the directory that will be the working
+   * directory is Dartium is invoked without changing the default).
+   *
+   * @return the directory where dartium can be found
+   */
+  JavaFile get dartiumWorkingDirectory =>
+      getDartiumWorkingDirectory(_sdkDirectory.getParentFile());
+
+  /**
+   * Return the directory containing the SDK.
+   *
+   * @return the directory containing the SDK
+   */
+  JavaFile get directory => _sdkDirectory;
+
+  /**
+   * Return the directory containing documentation for the SDK.
+   *
+   * @return the SDK's documentation directory
+   */
+  JavaFile get docDirectory =>
+      new JavaFile.relative(_sdkDirectory, _DOCS_DIRECTORY_NAME);
+
+  /**
+   * Return `true` if this SDK includes documentation.
+   *
+   * @return `true` if this installation of the SDK has documentation
+   */
+  bool get hasDocumentation => docDirectory.exists();
+
+  /**
+   * Return `true` if the Dartium binary is available.
+   *
+   * @return `true` if the Dartium binary is available
+   */
+  bool get isDartiumInstalled => dartiumExecutable != null;
+
+  /**
+   * Return the directory within the SDK directory that contains the libraries.
+   *
+   * @return the directory that contains the libraries
+   */
+  JavaFile get libraryDirectory =>
+      new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME);
+
+  /**
+   * Return the file containing the Pub executable, or `null` if it does not exist.
+   *
+   * @return the file containing the Pub executable
+   */
+  JavaFile get pubExecutable {
+    if (_pubExecutable == null) {
+      _pubExecutable = _verifyExecutable(
+          new JavaFile.relative(
+              new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+              OSUtilities.isWindows() ? _PUB_EXECUTABLE_NAME_WIN : _PUB_EXECUTABLE_NAME));
+    }
+    return _pubExecutable;
+  }
+
+  @override
+  List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries;
+
+  /**
+   * Return the revision number of this SDK, or `"0"` if the revision number cannot be
+   * discovered.
+   *
+   * @return the revision number of this SDK
+   */
+  @override
+  String get sdkVersion {
+    if (_sdkVersion == null) {
+      _sdkVersion = DartSdk.DEFAULT_VERSION;
+      JavaFile revisionFile =
+          new JavaFile.relative(_sdkDirectory, _VERSION_FILE_NAME);
+      try {
+        String revision = revisionFile.readAsStringSync();
+        if (revision != null) {
+          _sdkVersion = revision.trim();
+        }
+      } on JavaIOException catch (exception) {
+        // Fall through to return the default.
+      }
+    }
+    return _sdkVersion;
+  }
+
+  /**
+   * Return an array containing the library URI's for the libraries defined in this SDK.
+   *
+   * @return the library URI's for the libraries defined in this SDK
+   */
+  @override
+  List<String> get uris => _libraryMap.uris;
+
+  /**
+   * Return the name of the file containing the VM executable.
+   *
+   * @return the name of the file containing the VM executable
+   */
+  String get vmBinaryName {
+    if (OSUtilities.isWindows()) {
+      return _VM_EXECUTABLE_NAME_WIN;
+    } else {
+      return _VM_EXECUTABLE_NAME;
+    }
+  }
+
+  /**
+   * Return the file containing the VM executable, or `null` if it does not exist.
+   *
+   * @return the file containing the VM executable
+   */
+  JavaFile get vmExecutable {
+    if (_vmExecutable == null) {
+      _vmExecutable = _verifyExecutable(
+          new JavaFile.relative(
+              new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+              vmBinaryName));
+    }
+    return _vmExecutable;
+  }
+
+  @override
   Source fromFileUri(Uri uri) {
     JavaFile file = new JavaFile.fromUri(uri);
     String filePath = file.getAbsolutePath();
@@ -264,7 +468,8 @@
       }
       libraryPath = new JavaFile(libraryPath).getParent();
       if (filePath.startsWith("$libraryPath${JavaFile.separator}")) {
-        String path = "${library.shortName}/${filePath.substring(libraryPath.length + 1)}";
+        String path =
+            "${library.shortName}/${filePath.substring(libraryPath.length + 1)}";
         try {
           return new FileBasedSource.con2(parseUriWithException(path), file);
         } on URISyntaxException catch (exception, stackTrace) {
@@ -278,66 +483,6 @@
     return null;
   }
 
-  @override
-  AnalysisContext get context {
-    if (_analysisContext == null) {
-      _analysisContext = new SdkAnalysisContext();
-      SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
-      _analysisContext.sourceFactory = factory;
-      List<String> uris = this.uris;
-      ChangeSet changeSet = new ChangeSet();
-      for (String uri in uris) {
-        changeSet.addedSource(factory.forUri(uri));
-      }
-      _analysisContext.applyChanges(changeSet);
-    }
-    return _analysisContext;
-  }
-
-  /**
-   * Return the file containing the dart2js executable, or `null` if it does not exist.
-   *
-   * @return the file containing the dart2js executable
-   */
-  JavaFile get dart2JsExecutable {
-    if (_dart2jsExecutable == null) {
-      _dart2jsExecutable = _verifyExecutable(new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities.isWindows() ? _DART2JS_EXECUTABLE_NAME_WIN : _DART2JS_EXECUTABLE_NAME));
-    }
-    return _dart2jsExecutable;
-  }
-
-  /**
-   * Return the file containing the dart formatter executable, or `null` if it does not exist.
-   *
-   * @return the file containing the dart formatter executable
-   */
-  JavaFile get dartFmtExecutable {
-    if (_dartFmtExecutable == null) {
-      _dartFmtExecutable = _verifyExecutable(new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities.isWindows() ? _DARTFMT_EXECUTABLE_NAME_WIN : _DARTFMT_EXECUTABLE_NAME));
-    }
-    return _dartFmtExecutable;
-  }
-
-  /**
-   * Return the file containing the Dartium executable, or `null` if it does not exist.
-   *
-   * @return the file containing the Dartium executable
-   */
-  JavaFile get dartiumExecutable {
-    if (_dartiumExecutable == null) {
-      _dartiumExecutable = _verifyExecutable(new JavaFile.relative(dartiumWorkingDirectory, dartiumBinaryName));
-    }
-    return _dartiumExecutable;
-  }
-
-  /**
-   * Return the directory where dartium can be found (the directory that will be the working
-   * directory is Dartium is invoked without changing the default).
-   *
-   * @return the directory where dartium can be found
-   */
-  JavaFile get dartiumWorkingDirectory => getDartiumWorkingDirectory(_sdkDirectory.getParentFile());
-
   /**
    * Return the directory where dartium can be found (the directory that will be the working
    * directory is Dartium is invoked without changing the default).
@@ -345,21 +490,8 @@
    * @param installDir the installation directory
    * @return the directory where dartium can be found
    */
-  JavaFile getDartiumWorkingDirectory(JavaFile installDir) => new JavaFile.relative(installDir, _DARTIUM_DIRECTORY_NAME);
-
-  /**
-   * Return the directory containing the SDK.
-   *
-   * @return the directory containing the SDK
-   */
-  JavaFile get directory => _sdkDirectory;
-
-  /**
-   * Return the directory containing documentation for the SDK.
-   *
-   * @return the SDK's documentation directory
-   */
-  JavaFile get docDirectory => new JavaFile.relative(_sdkDirectory, _DOCS_DIRECTORY_NAME);
+  JavaFile getDartiumWorkingDirectory(JavaFile installDir) =>
+      new JavaFile.relative(installDir, _DARTIUM_DIRECTORY_NAME);
 
   /**
    * Return the auxiliary documentation file for the given library, or `null` if no such file
@@ -375,95 +507,39 @@
       return null;
     }
     JavaFile libDir = new JavaFile.relative(dir, libraryName);
-    JavaFile docFile = new JavaFile.relative(libDir, "$libraryName$_DOC_FILE_SUFFIX");
+    JavaFile docFile =
+        new JavaFile.relative(libDir, "$libraryName$_DOC_FILE_SUFFIX");
     if (docFile.exists()) {
       return docFile;
     }
     return null;
   }
 
-  /**
-   * Return the directory within the SDK directory that contains the libraries.
-   *
-   * @return the directory that contains the libraries
-   */
-  JavaFile get libraryDirectory => new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME);
-
-  /**
-   * Return the file containing the Pub executable, or `null` if it does not exist.
-   *
-   * @return the file containing the Pub executable
-   */
-  JavaFile get pubExecutable {
-    if (_pubExecutable == null) {
-      _pubExecutable = _verifyExecutable(new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities.isWindows() ? _PUB_EXECUTABLE_NAME_WIN : _PUB_EXECUTABLE_NAME));
-    }
-    return _pubExecutable;
-  }
-
-  @override
-  List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries;
-
   @override
   SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri);
 
   /**
-   * Return the revision number of this SDK, or `"0"` if the revision number cannot be
-   * discovered.
+   * Read all of the configuration files to initialize the library maps.
    *
-   * @return the revision number of this SDK
+   * @param useDart2jsPaths `true` if the dart2js path should be used when it is available
+   * @return the initialized library map
    */
-  @override
-  String get sdkVersion {
-    if (_sdkVersion == null) {
-      _sdkVersion = DartSdk.DEFAULT_VERSION;
-      JavaFile revisionFile = new JavaFile.relative(_sdkDirectory, _VERSION_FILE_NAME);
-      try {
-        String revision = revisionFile.readAsStringSync();
-        if (revision != null) {
-          _sdkVersion = revision.trim();
-        }
-      } on JavaIOException catch (exception) {
-        // Fall through to return the default.
-      }
+  LibraryMap initialLibraryMap(bool useDart2jsPaths) {
+    JavaFile librariesFile = new JavaFile.relative(
+        new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
+        _LIBRARIES_FILE);
+    try {
+      String contents = librariesFile.readAsStringSync();
+      return new SdkLibrariesReader(
+          useDart2jsPaths).readFromFile(librariesFile, contents);
+    } catch (exception, stackTrace) {
+      AnalysisEngine.instance.logger.logError(
+          "Could not initialize the library map from ${librariesFile.getAbsolutePath()}",
+          new CaughtException(exception, stackTrace));
+      return new LibraryMap();
     }
-    return _sdkVersion;
   }
 
-  /**
-   * Return an array containing the library URI's for the libraries defined in this SDK.
-   *
-   * @return the library URI's for the libraries defined in this SDK
-   */
-  @override
-  List<String> get uris => _libraryMap.uris;
-
-  /**
-   * Return the file containing the VM executable, or `null` if it does not exist.
-   *
-   * @return the file containing the VM executable
-   */
-  JavaFile get vmExecutable {
-    if (_vmExecutable == null) {
-      _vmExecutable = _verifyExecutable(new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), vmBinaryName));
-    }
-    return _vmExecutable;
-  }
-
-  /**
-   * Return `true` if this SDK includes documentation.
-   *
-   * @return `true` if this installation of the SDK has documentation
-   */
-  bool get hasDocumentation => docDirectory.exists();
-
-  /**
-   * Return `true` if the Dartium binary is available.
-   *
-   * @return `true` if the Dartium binary is available
-   */
-  bool get isDartiumInstalled => dartiumExecutable != null;
-
   @override
   Source mapDartUri(String dartUri) {
     String libraryName;
@@ -493,66 +569,13 @@
   }
 
   /**
-   * Read all of the configuration files to initialize the library maps.
-   *
-   * @param useDart2jsPaths `true` if the dart2js path should be used when it is available
-   * @return the initialized library map
-   */
-  LibraryMap initialLibraryMap(bool useDart2jsPaths) {
-    JavaFile librariesFile = new JavaFile.relative(new JavaFile.relative(libraryDirectory, _INTERNAL_DIR), _LIBRARIES_FILE);
-    try {
-      String contents = librariesFile.readAsStringSync();
-      return new SdkLibrariesReader(useDart2jsPaths).readFromFile(librariesFile, contents);
-    } catch (exception, stackTrace) {
-      AnalysisEngine.instance.logger.logError(
-          "Could not initialize the library map from ${librariesFile.getAbsolutePath()}",
-          new CaughtException(exception, stackTrace));
-      return new LibraryMap();
-    }
-  }
-
-  /**
-   * Ensure that the dart VM is executable. If it is not, make it executable and log that it was
-   * necessary for us to do so.
-   */
-  void _ensureVmIsExecutable() {
-  }
-
-  /**
-   * Return the name of the file containing the Dartium executable.
-   *
-   * @return the name of the file containing the Dartium executable
-   */
-  String get dartiumBinaryName {
-    if (OSUtilities.isWindows()) {
-      return _DARTIUM_EXECUTABLE_NAME_WIN;
-    } else if (OSUtilities.isMac()) {
-      return _DARTIUM_EXECUTABLE_NAME_MAC;
-    } else {
-      return _DARTIUM_EXECUTABLE_NAME_LINUX;
-    }
-  }
-
-  /**
-   * Return the name of the file containing the VM executable.
-   *
-   * @return the name of the file containing the VM executable
-   */
-  String get vmBinaryName {
-    if (OSUtilities.isWindows()) {
-      return _VM_EXECUTABLE_NAME_WIN;
-    } else {
-      return _VM_EXECUTABLE_NAME;
-    }
-  }
-
-  /**
    * Verify that the given executable file exists and is executable.
    *
    * @param file the binary file
    * @return the file if it exists and is executable, else `null`
    */
-  JavaFile _verifyExecutable(JavaFile file) => file.isExecutable() ? file : null;
+  JavaFile _verifyExecutable(JavaFile file) =>
+      file.isExecutable() ? file : null;
 }
 
 /**
@@ -599,7 +622,8 @@
    * @param libraryFileContents the contents from the library file
    * @return the library map read from the given source
    */
-  LibraryMap readFromFile(JavaFile file, String libraryFileContents) => readFromSource(new FileBasedSource.con1(file), libraryFileContents);
+  LibraryMap readFromFile(JavaFile file, String libraryFileContents) =>
+      readFromSource(new FileBasedSource.con1(file), libraryFileContents);
 
   /**
    * Return the library map read from the given source.
@@ -610,14 +634,19 @@
    */
   LibraryMap readFromSource(Source source, String libraryFileContents) {
     BooleanErrorListener errorListener = new BooleanErrorListener();
-    Scanner scanner = new Scanner(source, new CharSequenceReader(libraryFileContents), errorListener);
+    Scanner scanner = new Scanner(
+        source,
+        new CharSequenceReader(libraryFileContents),
+        errorListener);
     Parser parser = new Parser(source, errorListener);
     CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
-    SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
-    // If any syntactic errors were found then don't try to visit the AST structure.
+    SdkLibrariesReader_LibraryBuilder libraryBuilder =
+        new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
+    // If any syntactic errors were found then don't try to visit the AST
+    // structure.
     if (!errorListener.errorReported) {
       unit.accept(libraryBuilder);
     }
     return libraryBuilder.librariesMap;
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index da29487..6b87673 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -7,13 +7,13 @@
 
 library engine.source;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:collection';
 
-import 'java_core.dart';
-import 'sdk.dart' show DartSdk;
 import 'engine.dart';
+import 'java_core.dart';
 import 'java_engine.dart';
+import 'sdk.dart' show DartSdk;
 
 /**
  * Instances of class `ContentCache` hold content used to override the default content of a
@@ -79,7 +79,7 @@
       if (newStamp == oldStamp) {
         _stampMap[source] = newStamp + 1;
       }
-      String oldContent =_contentMap[source];
+      String oldContent = _contentMap[source];
       _contentMap[source] = contents;
       return oldContent;
     }
@@ -91,19 +91,6 @@
  */
 class DartUriResolver extends UriResolver {
   /**
-   * Return `true` if the given URI is a `dart-ext:` URI.
-   *
-   * @param uriContent the textual representation of the URI being tested
-   * @return `true` if the given URI is a `dart-ext:` URI
-   */
-  static bool isDartExtUri(String uriContent) => uriContent != null && uriContent.startsWith(_DART_EXT_SCHEME);
-
-  /**
-   * The Dart SDK against which URI's are to be resolved.
-   */
-  final DartSdk _sdk;
-
-  /**
    * The name of the `dart` scheme.
    */
   static String DART_SCHEME = "dart";
@@ -114,12 +101,9 @@
   static String _DART_EXT_SCHEME = "dart-ext:";
 
   /**
-   * Return `true` if the given URI is a `dart:` URI.
-   *
-   * @param uri the URI being tested
-   * @return `true` if the given URI is a `dart:` URI
+   * The Dart SDK against which URI's are to be resolved.
    */
-  static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme;
+  final DartSdk _sdk;
 
   /**
    * Initialize a newly created resolver to resolve Dart URI's against the given platform within the
@@ -143,6 +127,23 @@
     }
     return _sdk.mapDartUri(uri.toString());
   }
+
+  /**
+   * Return `true` if the given URI is a `dart-ext:` URI.
+   *
+   * @param uriContent the textual representation of the URI being tested
+   * @return `true` if the given URI is a `dart-ext:` URI
+   */
+  static bool isDartExtUri(String uriContent) =>
+      uriContent != null && uriContent.startsWith(_DART_EXT_SCHEME);
+
+  /**
+   * Return `true` if the given URI is a `dart:` URI.
+   *
+   * @param uri the URI being tested
+   * @return `true` if the given URI is a `dart:` URI
+   */
+  static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme;
 }
 
 /**
@@ -260,7 +261,8 @@
    * Instance of [LocalSourcePredicate] that returns `true` for all [Source]s
    * except of SDK.
    */
-  static final LocalSourcePredicate NOT_SDK = new LocalSourcePredicate_NOT_SDK();
+  static final LocalSourcePredicate NOT_SDK =
+      new LocalSourcePredicate_NOT_SDK();
 
   /**
    * Determines if the given [Source] is local.
@@ -297,18 +299,6 @@
   NonExistingSource(this._name, this.uriKind);
 
   @override
-  bool operator ==(Object obj) {
-    if (obj is NonExistingSource) {
-      NonExistingSource other = obj;
-      return other.uriKind == uriKind && (other._name == _name);
-    }
-    return false;
-  }
-
-  @override
-  bool exists() => false;
-
-  @override
   TimestampedData<String> get contents {
     throw new UnsupportedOperationException("${_name}does not exist.");
   }
@@ -322,6 +312,12 @@
   String get fullName => _name;
 
   @override
+  int get hashCode => _name.hashCode;
+
+  @override
+  bool get isInSystemLibrary => false;
+
+  @override
   int get modificationStamp => 0;
 
   @override
@@ -331,10 +327,16 @@
   Uri get uri => null;
 
   @override
-  int get hashCode => _name.hashCode;
+  bool operator ==(Object obj) {
+    if (obj is NonExistingSource) {
+      NonExistingSource other = obj;
+      return other.uriKind == uriKind && (other._name == _name);
+    }
+    return false;
+  }
 
   @override
-  bool get isInSystemLibrary => false;
+  bool exists() => false;
 
   @override
   Uri resolveRelativeUri(Uri relativeUri) {
@@ -364,32 +366,9 @@
  */
 abstract class Source {
   /**
-   * An empty array of sources.
+   * An empty list of sources.
    */
-  static final List<Source> EMPTY_ARRAY = new List<Source>(0);
-
-  /**
-   * Return `true` if the given object is a source that represents the same source code as
-   * this source.
-   *
-   * @param object the object to be compared with this object
-   * @return `true` if the given object is a source that represents the same source code as
-   *         this source
-   * See [Object.==].
-   */
-  @override
-  bool operator ==(Object object);
-
-  /**
-   * Return `true` if this source exists.
-   *
-   * Clients should consider using the the method [AnalysisContext.exists] because
-   * contexts can have local overrides of the content of a source that the source is not aware of
-   * and a source with local content is considered to exist even if there is no file on disk.
-   *
-   * @return `true` if this source exists
-   */
-  bool exists();
+  static const List<Source> EMPTY_ARRAY = const <Source>[];
 
   /**
    * Get the contents and timestamp of this source.
@@ -422,6 +401,22 @@
   String get fullName;
 
   /**
+   * Return a hash code for this source.
+   *
+   * @return a hash code for this source
+   * See [Object.hashCode].
+   */
+  @override
+  int get hashCode;
+
+  /**
+   * Return `true` if this source is in one of the system libraries.
+   *
+   * @return `true` if this is in a system library
+   */
+  bool get isInSystemLibrary;
+
+  /**
    * Return the modification stamp for this source. A modification stamp is a non-negative integer
    * with the property that if the contents of the source have not been modified since the last time
    * the modification stamp was accessed then the same value will be returned, but if the contents
@@ -462,20 +457,27 @@
   UriKind get uriKind;
 
   /**
-   * Return a hash code for this source.
+   * Return `true` if the given object is a source that represents the same source code as
+   * this source.
    *
-   * @return a hash code for this source
-   * See [Object.hashCode].
+   * @param object the object to be compared with this object
+   * @return `true` if the given object is a source that represents the same source code as
+   *         this source
+   * See [Object.==].
    */
   @override
-  int get hashCode;
+  bool operator ==(Object object);
 
   /**
-   * Return `true` if this source is in one of the system libraries.
+   * Return `true` if this source exists.
    *
-   * @return `true` if this is in a system library
+   * Clients should consider using the the method [AnalysisContext.exists] because
+   * contexts can have local overrides of the content of a source that the source is not aware of
+   * and a source with local content is considered to exist even if there is no file on disk.
+   *
+   * @return `true` if this source exists
    */
-  bool get isInSystemLibrary;
+  bool exists();
 
   /**
    * Resolve the relative URI against the URI associated with this source object.
@@ -494,6 +496,20 @@
 }
 
 /**
+ * The interface `ContentReceiver` defines the behavior of objects that can receive the
+ * content of a source.
+ */
+abstract class Source_ContentReceiver {
+  /**
+   * Accept the contents of a source.
+   *
+   * @param contents the contents of the source
+   * @param modificationTime the time at which the contents were last set
+   */
+  void accept(String contents, int modificationTime);
+}
+
+/**
  * The interface `SourceContainer` is used by clients to define a collection of sources
  *
  * Source containers are not used within analysis engine, but can be used by clients to group
@@ -539,6 +555,32 @@
   SourceFactory(this._resolvers);
 
   /**
+   * Return the [DartSdk] associated with this [SourceFactory], or `null` if there
+   * is no such SDK.
+   *
+   * @return the [DartSdk] associated with this [SourceFactory], or `null` if
+   *         there is no such SDK
+   */
+  DartSdk get dartSdk {
+    for (UriResolver resolver in _resolvers) {
+      if (resolver is DartUriResolver) {
+        DartUriResolver dartUriResolver = resolver;
+        return dartUriResolver.dartSdk;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Sets the [LocalSourcePredicate].
+   *
+   * @param localSourcePredicate the predicate to determine is [Source] is local
+   */
+  void set localSourcePredicate(LocalSourcePredicate localSourcePredicate) {
+    this._localSourcePredicate = localSourcePredicate;
+  }
+
+  /**
    * Return a source object representing the given absolute URI, or `null` if the URI is not a
    * valid URI or if it is not an absolute URI.
    *
@@ -596,23 +638,6 @@
   }
 
   /**
-   * Return the [DartSdk] associated with this [SourceFactory], or `null` if there
-   * is no such SDK.
-   *
-   * @return the [DartSdk] associated with this [SourceFactory], or `null` if
-   *         there is no such SDK
-   */
-  DartSdk get dartSdk {
-    for (UriResolver resolver in _resolvers) {
-      if (resolver is DartUriResolver) {
-        DartUriResolver dartUriResolver = resolver;
-        return dartUriResolver.dartSdk;
-      }
-    }
-    return null;
-  }
-
-  /**
    * Determines if the given [Source] is local.
    *
    * @param source the [Source] to analyze
@@ -636,7 +661,9 @@
     }
     try {
       // Force the creation of an escaped URI to deal with spaces, etc.
-      return _internalResolveUri(containingSource, parseUriWithException(containedUri));
+      return _internalResolveUri(
+          containingSource,
+          parseUriWithException(containedUri));
     } catch (exception, stackTrace) {
       String containingFullName =
           containingSource != null ? containingSource.fullName : '<null>';
@@ -665,15 +692,6 @@
   }
 
   /**
-   * Sets the [LocalSourcePredicate].
-   *
-   * @param localSourcePredicate the predicate to determine is [Source] is local
-   */
-  void set localSourcePredicate(LocalSourcePredicate localSourcePredicate) {
-    this._localSourcePredicate = localSourcePredicate;
-  }
-
-  /**
    * Return a source object representing the URI that results from resolving the given (possibly
    * relative) contained URI against the URI associated with an existing source object, or
    * `null` if the URI could not be resolved.
@@ -687,7 +705,8 @@
   Source _internalResolveUri(Source containingSource, Uri containedUri) {
     if (!containedUri.isAbsolute) {
       if (containingSource == null) {
-        throw new AnalysisException("Cannot resolve a relative URI without a containing source: $containedUri");
+        throw new AnalysisException(
+            "Cannot resolve a relative URI without a containing source: $containedUri");
       }
       containedUri = containingSource.resolveRelativeUri(containedUri);
     }
@@ -764,6 +783,24 @@
   SourceRange(this.offset, this.length);
 
   /**
+   * @return the 0-based index of the after-last character of the source code for this element,
+   *         relative to the source buffer in which this element is contained.
+   */
+  int get end => offset + length;
+
+  @override
+  int get hashCode => 31 * offset + length;
+
+  @override
+  bool operator ==(Object obj) {
+    if (obj is! SourceRange) {
+      return false;
+    }
+    SourceRange sourceRange = obj as SourceRange;
+    return sourceRange.offset == offset && sourceRange.length == length;
+  }
+
+  /**
    * @return `true` if <code>x</code> is in [offset, offset + length) interval.
    */
   bool contains(int x) => offset <= x && x < offset + length;
@@ -781,7 +818,8 @@
   /**
    * @return `true` if this [SourceRange] covers <code>otherRange</code>.
    */
-  bool covers(SourceRange otherRange) => offset <= otherRange.offset && otherRange.end <= end;
+  bool covers(SourceRange otherRange) =>
+      offset <= otherRange.offset && otherRange.end <= end;
 
   /**
    * @return `true` if this [SourceRange] ends in <code>otherRange</code>.
@@ -791,25 +829,11 @@
     return otherRange.contains(thisEnd);
   }
 
-  @override
-  bool operator ==(Object obj) {
-    if (obj is! SourceRange) {
-      return false;
-    }
-    SourceRange sourceRange = obj as SourceRange;
-    return sourceRange.offset == offset && sourceRange.length == length;
-  }
-
-  /**
-   * @return the 0-based index of the after-last character of the source code for this element,
-   *         relative to the source buffer in which this element is contained.
-   */
-  int get end => offset + length;
-
   /**
    * @return the expanded instance of [SourceRange], which has the same center.
    */
-  SourceRange getExpanded(int delta) => new SourceRange(offset - delta, delta + length + delta);
+  SourceRange getExpanded(int delta) =>
+      new SourceRange(offset - delta, delta + length + delta);
 
   /**
    * @return the instance of [SourceRange] with end moved on "delta".
@@ -819,7 +843,8 @@
   /**
    * @return the expanded translated of [SourceRange], with moved start and the same length.
    */
-  SourceRange getTranslated(int delta) => new SourceRange(offset + delta, length);
+  SourceRange getTranslated(int delta) =>
+      new SourceRange(offset + delta, length);
 
   /**
    * @return the minimal [SourceRange] that cover this and the given [SourceRange]s.
@@ -830,9 +855,6 @@
     return new SourceRange(newOffset, newEnd - newOffset);
   }
 
-  @override
-  int get hashCode => 31 * offset + length;
-
   /**
    * @return `true` if this [SourceRange] intersects with given.
    */
@@ -859,20 +881,6 @@
 }
 
 /**
- * The interface `ContentReceiver` defines the behavior of objects that can receive the
- * content of a source.
- */
-abstract class Source_ContentReceiver {
-  /**
-   * Accept the contents of a source.
-   *
-   * @param contents the contents of the source
-   * @param modificationTime the time at which the contents were last set
-   */
-  void accept(String contents, int modificationTime);
-}
-
-/**
  * The enumeration `UriKind` defines the different kinds of URI's that are known to the
  * analysis engine. These are used to keep track of the kind of URI associated with a given source.
  */
@@ -895,6 +903,18 @@
   static const List<UriKind> values = const [DART_URI, FILE_URI, PACKAGE_URI];
 
   /**
+   * The single character encoding used to identify this kind of URI.
+   */
+  final int encoding;
+
+  /**
+   * Initialize a newly created URI kind to have the given encoding.
+   *
+   * @param encoding the single character encoding used to identify this kind of URI.
+   */
+  const UriKind(String name, int ordinal, this.encoding) : super(name, ordinal);
+
+  /**
    * Return the URI kind represented by the given encoding, or `null` if there is no kind with
    * the given encoding.
    *
@@ -914,18 +934,6 @@
     }
     return null;
   }
-
-  /**
-   * The single character encoding used to identify this kind of URI.
-   */
-  final int encoding;
-
-  /**
-   * Initialize a newly created URI kind to have the given encoding.
-   *
-   * @param encoding the single character encoding used to identify this kind of URI.
-   */
-  const UriKind(String name, int ordinal, this.encoding) : super(name, ordinal);
 }
 
 /**
@@ -952,4 +960,4 @@
    * @return the absolute URI representing the given source
    */
   Uri restoreAbsolute(Source source) => null;
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index b7ec971..4918519 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -7,13 +7,14 @@
 
 library engine.source.io;
 
-import 'source.dart';
-import 'java_core.dart';
-import 'java_io.dart';
-import 'utilities_general.dart';
-import 'instrumentation.dart';
 import 'engine.dart';
+import 'instrumentation.dart';
+import 'java_core.dart';
 import 'java_engine.dart';
+import 'java_io.dart';
+import 'source.dart';
+import 'utilities_general.dart';
+
 export 'source.dart';
 
 /**
@@ -22,20 +23,6 @@
  */
 class DirectoryBasedSourceContainer implements SourceContainer {
   /**
-   * Append the system file separator to the given path unless the path already ends with a
-   * separator.
-   *
-   * @param path the path to which the file separator is to be added
-   * @return a path that ends with the system file separator
-   */
-  static String _appendFileSeparator(String path) {
-    if (path == null || path.length <= 0 || path.codeUnitAt(path.length - 1) == JavaFile.separatorChar) {
-      return path;
-    }
-    return "$path${JavaFile.separator}";
-  }
-
-  /**
    * The container's path (not `null`).
    */
   String _path;
@@ -47,7 +34,8 @@
    *
    * @param directory the directory (not `null`)
    */
-  DirectoryBasedSourceContainer.con1(JavaFile directory) : this.con2(directory.getPath());
+  DirectoryBasedSourceContainer.con1(JavaFile directory)
+      : this.con2(directory.getPath());
 
   /**
    * Construct a container representing the specified path and containing any sources whose
@@ -60,10 +48,7 @@
   }
 
   @override
-  bool contains(Source source) => source.fullName.startsWith(_path);
-
-  @override
-  bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && obj.path == path;
+  int get hashCode => _path.hashCode;
 
   /**
    * Answer the receiver's path, used to determine if a source is contained in the receiver.
@@ -73,10 +58,30 @@
   String get path => _path;
 
   @override
-  int get hashCode => _path.hashCode;
+  bool operator ==(Object obj) =>
+      (obj is DirectoryBasedSourceContainer) && obj.path == path;
+
+  @override
+  bool contains(Source source) => source.fullName.startsWith(_path);
 
   @override
   String toString() => "SourceContainer[$_path]";
+
+  /**
+   * Append the system file separator to the given path unless the path already ends with a
+   * separator.
+   *
+   * @param path the path to which the file separator is to be added
+   * @return a path that ends with the system file separator
+   */
+  static String _appendFileSeparator(String path) {
+    if (path == null ||
+        path.length <= 0 ||
+        path.codeUnitAt(path.length - 1) == JavaFile.separatorChar) {
+      return path;
+    }
+    return "$path${JavaFile.separator}";
+  }
 }
 
 /**
@@ -119,12 +124,6 @@
   FileBasedSource.con2(this.uri, this.file);
 
   @override
-  bool operator ==(Object object) => object != null && object is FileBasedSource && file == object.file;
-
-  @override
-  bool exists() => file.isFile();
-
-  @override
   TimestampedData<String> get contents {
     TimeCounter_TimeCounterHandle handle = PerformanceStatistics.io.start();
     try {
@@ -134,6 +133,23 @@
     }
   }
 
+  /**
+   * Get the contents and timestamp of the underlying file.
+   *
+   * Clients should consider using the the method [AnalysisContext.getContents]
+   * because contexts can have local overrides of the content of a source that the source is not
+   * aware of.
+   *
+   * @return the contents of the source paired with the modification stamp of the source
+   * @throws Exception if the contents of this source could not be accessed
+   * See [contents].
+   */
+  TimestampedData<String> get contentsFromFile {
+    return new TimestampedData<String>(
+        file.lastModified(),
+        file.readAsStringSync());
+  }
+
   @override
   String get encoding {
     if (_encoding == null) {
@@ -151,6 +167,12 @@
   }
 
   @override
+  int get hashCode => file.hashCode;
+
+  @override
+  bool get isInSystemLibrary => uri.scheme == DartUriResolver.DART_SCHEME;
+
+  @override
   int get modificationStamp => file.lastModified();
 
   @override
@@ -170,10 +192,11 @@
   }
 
   @override
-  int get hashCode => file.hashCode;
+  bool operator ==(Object object) =>
+      object != null && object is FileBasedSource && file == object.file;
 
   @override
-  bool get isInSystemLibrary => uri.scheme == DartUriResolver.DART_SCHEME;
+  bool exists() => file.isFile();
 
   @override
   Uri resolveRelativeUri(Uri containedUri) {
@@ -190,11 +213,14 @@
       }
       Uri result = baseUri.resolveUri(containedUri);
       if (isOpaque) {
-        result = parseUriWithException("${result.scheme}:${result.path.substring(1)}");
+        result =
+            parseUriWithException("${result.scheme}:${result.path.substring(1)}");
       }
       return result;
     } catch (exception, stackTrace) {
-      throw new AnalysisException("Could not resolve URI ($containedUri) relative to source ($uri)", new CaughtException(exception, stackTrace));
+      throw new AnalysisException(
+          "Could not resolve URI ($containedUri) relative to source ($uri)",
+          new CaughtException(exception, stackTrace));
     }
   }
 
@@ -207,21 +233,6 @@
   }
 
   /**
-   * Get the contents and timestamp of the underlying file.
-   *
-   * Clients should consider using the the method [AnalysisContext.getContents]
-   * because contexts can have local overrides of the content of a source that the source is not
-   * aware of.
-   *
-   * @return the contents of the source paired with the modification stamp of the source
-   * @throws Exception if the contents of this source could not be accessed
-   * See [contents].
-   */
-  TimestampedData<String> get contentsFromFile {
-    return new TimestampedData<String>(file.lastModified(), file.readAsStringSync());
-  }
-
-  /**
    * Record the time the IO took if it was slow
    */
   void _reportIfSlowIO(int nanos) {
@@ -247,14 +258,6 @@
    */
   static String FILE_SCHEME = "file";
 
-  /**
-   * Return `true` if the given URI is a `file` URI.
-   *
-   * @param uri the URI being tested
-   * @return `true` if the given URI is a `file` URI
-   */
-  static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
-
   @override
   Source resolveAbsolute(Uri uri) {
     if (!isFileUri(uri)) {
@@ -262,6 +265,14 @@
     }
     return new FileBasedSource.con2(uri, new JavaFile.fromUri(uri));
   }
+
+  /**
+   * Return `true` if the given URI is a `file` URI.
+   *
+   * @param uri the URI being tested
+   * @return `true` if the given URI is a `file` URI
+   */
+  static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
 }
 
 /**
@@ -283,7 +294,8 @@
    * Instance of [LocalSourcePredicate] that returns `true` for all [Source]s
    * except of SDK.
    */
-  static final LocalSourcePredicate NOT_SDK = new LocalSourcePredicate_NOT_SDK();
+  static final LocalSourcePredicate NOT_SDK =
+      new LocalSourcePredicate_NOT_SDK();
 
   /**
    * Determines if the given [Source] is local.
@@ -319,11 +331,6 @@
  */
 class PackageUriResolver extends UriResolver {
   /**
-   * The package directories that `package` URI's are assumed to be relative to.
-   */
-  final List<JavaFile> _packagesDirectories;
-
-  /**
    * The name of the `package` scheme.
    */
   static String PACKAGE_SCHEME = "package";
@@ -334,12 +341,9 @@
   static bool _CanLogRequiredKeyIoException = true;
 
   /**
-   * Return `true` if the given URI is a `package` URI.
-   *
-   * @param uri the URI being tested
-   * @return `true` if the given URI is a `package` URI
+   * The package directories that `package` URI's are assumed to be relative to.
    */
-  static bool isPackageUri(Uri uri) => PACKAGE_SCHEME == uri.scheme;
+  final List<JavaFile> _packagesDirectories;
 
   /**
    * Initialize a newly created resolver to resolve `package` URI's relative to the given
@@ -350,7 +354,8 @@
    */
   PackageUriResolver(this._packagesDirectories) {
     if (_packagesDirectories.length < 1) {
-      throw new IllegalArgumentException("At least one package directory must be provided");
+      throw new IllegalArgumentException(
+          "At least one package directory must be provided");
     }
   }
 
@@ -366,6 +371,37 @@
     return _packagesDirectories[0].getPath();
   }
 
+  /**
+   * Answer the canonical file for the specified package.
+   *
+   * @param packagesDirectory the "packages" directory (not `null`)
+   * @param pkgName the package name (not `null`, not empty)
+   * @param relPath the path relative to the package directory (not `null`, no leading slash,
+   *          but may be empty string)
+   * @return the file (not `null`)
+   */
+  JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName,
+      String relPath) {
+    JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName);
+    try {
+      pkgDir = pkgDir.getCanonicalFile();
+    } on JavaIOException catch (exception, stackTrace) {
+      if (!exception.toString().contains("Required key not available")) {
+        AnalysisEngine.instance.logger.logError(
+            "Canonical failed: $pkgDir",
+            new CaughtException(exception, stackTrace));
+      } else if (_CanLogRequiredKeyIoException) {
+        _CanLogRequiredKeyIoException = false;
+        AnalysisEngine.instance.logger.logError(
+            "Canonical failed: $pkgDir",
+            new CaughtException(exception, stackTrace));
+      }
+    }
+    return new JavaFile.relative(
+        pkgDir,
+        relPath.replaceAll('/', new String.fromCharCode(JavaFile.separatorChar)));
+  }
+
   @override
   Source resolveAbsolute(Uri uri) {
     if (!isPackageUri(uri)) {
@@ -396,14 +432,17 @@
     for (JavaFile packagesDirectory in _packagesDirectories) {
       JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path);
       if (resolvedFile.exists()) {
-        JavaFile canonicalFile = getCanonicalFile(packagesDirectory, pkgName, relPath);
+        JavaFile canonicalFile =
+            getCanonicalFile(packagesDirectory, pkgName, relPath);
         if (_isSelfReference(packagesDirectory, canonicalFile)) {
           uri = canonicalFile.toURI();
         }
         return new FileBasedSource.con2(uri, canonicalFile);
       }
     }
-    return new FileBasedSource.con2(uri, getCanonicalFile(_packagesDirectories[0], pkgName, relPath));
+    return new FileBasedSource.con2(
+        uri,
+        getCanonicalFile(_packagesDirectories[0], pkgName, relPath));
   }
 
   @override
@@ -417,7 +456,8 @@
             String pkgCanonicalPath = pkgFolder.getCanonicalPath();
             if (sourcePath.startsWith(pkgCanonicalPath)) {
               String relPath = sourcePath.substring(pkgCanonicalPath.length);
-              return parseUriWithException("$PACKAGE_SCHEME:${pkgFolder.getName()}$relPath");
+              return parseUriWithException(
+                  "$PACKAGE_SCHEME:${pkgFolder.getName()}$relPath");
             }
           } catch (e) {
           }
@@ -428,34 +468,6 @@
   }
 
   /**
-   * Answer the canonical file for the specified package.
-   *
-   * @param packagesDirectory the "packages" directory (not `null`)
-   * @param pkgName the package name (not `null`, not empty)
-   * @param relPath the path relative to the package directory (not `null`, no leading slash,
-   *          but may be empty string)
-   * @return the file (not `null`)
-   */
-  JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName, String relPath) {
-    JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName);
-    try {
-      pkgDir = pkgDir.getCanonicalFile();
-    } on JavaIOException catch (exception, stackTrace) {
-      if (!exception.toString().contains("Required key not available")) {
-        AnalysisEngine.instance.logger.logError(
-            "Canonical failed: $pkgDir",
-            new CaughtException(exception, stackTrace));
-      } else if (_CanLogRequiredKeyIoException) {
-        _CanLogRequiredKeyIoException = false;
-        AnalysisEngine.instance.logger.logError(
-            "Canonical failed: $pkgDir",
-            new CaughtException(exception, stackTrace));
-      }
-    }
-    return new JavaFile.relative(pkgDir, relPath.replaceAll('/', new String.fromCharCode(JavaFile.separatorChar)));
-  }
-
-  /**
    * @return `true` if "file" was found in "packagesDir", and it is part of the "lib" folder
    *         of the application that contains in this "packagesDir".
    */
@@ -468,6 +480,14 @@
     String filePath = file.getAbsolutePath();
     return filePath.startsWith("$rootPath/lib");
   }
+
+  /**
+   * Return `true` if the given URI is a `package` URI.
+   *
+   * @param uri the URI being tested
+   * @return `true` if the given URI is a `package` URI
+   */
+  static bool isPackageUri(Uri uri) => PACKAGE_SCHEME == uri.scheme;
 }
 
 /**
@@ -480,14 +500,6 @@
   static String FILE_SCHEME = "file";
 
   /**
-   * Return `true` if the given URI is a `file` URI.
-   *
-   * @param uri the URI being tested
-   * @return `true` if the given URI is a `file` URI
-   */
-  static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
-
-  /**
    * The directories for the relatvie URI's
    */
   final List<JavaFile> _relativeDirectories;
@@ -501,7 +513,8 @@
    * Initialize a newly created resolver to resolve `file` URI's relative to the given root
    * directory.
    */
-  RelativeFileUriResolver(this._rootDirectory, this._relativeDirectories) : super();
+  RelativeFileUriResolver(this._rootDirectory, this._relativeDirectories)
+      : super();
 
   @override
   Source resolveAbsolute(Uri uri) {
@@ -518,4 +531,12 @@
     }
     return null;
   }
-}
\ No newline at end of file
+
+  /**
+   * Return `true` if the given URI is a `file` URI.
+   *
+   * @param uri the URI being tested
+   * @return `true` if the given URI is a `file` URI
+   */
+  static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
+}
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 4744470..084b65d 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -6,39 +6,11 @@
 
 import 'dart:collection';
 
-import 'java_engine.dart';
-import 'scanner.dart' as sc;
 import 'ast.dart';
 import 'element.dart';
+import 'java_engine.dart';
 import 'resolver.dart';
-
-class GeneralizingAstVisitor_StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction extends GeneralizingAstVisitor<Object> {
-  DartType result = null;
-
-  GeneralizingAstVisitor_StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction();
-
-  @override
-  Object visitExpression(Expression node) => null;
-
-  @override
-  Object visitReturnStatement(ReturnStatement node) {
-    // prepare this 'return' type
-    DartType type;
-    Expression expression = node.expression;
-    if (expression != null) {
-      type = expression.bestType;
-    } else {
-      type = BottomTypeImpl.instance;
-    }
-    // merge types
-    if (result == null) {
-      result = type;
-    } else {
-      result = result.getLeastUpperBound(type);
-    }
-    return null;
-  }
-}
+import 'scanner.dart' as sc;
 
 /**
  * Instances of the class `StaticTypeAnalyzer` perform two type-related tasks. First, they
@@ -51,73 +23,11 @@
  */
 class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
   /**
-   * Create a table mapping HTML tag names to the names of the classes (in 'dart:html') that
-   * implement those tags.
-   *
-   * @return the table that was created
+   * A table mapping HTML tag names to the names of the classes (in 'dart:html') that implement
+   * those tags.
    */
-  static HashMap<String, String> _createHtmlTagToClassMap() {
-    HashMap<String, String> map = new HashMap<String, String>();
-    map["a"] = "AnchorElement";
-    map["area"] = "AreaElement";
-    map["br"] = "BRElement";
-    map["base"] = "BaseElement";
-    map["body"] = "BodyElement";
-    map["button"] = "ButtonElement";
-    map["canvas"] = "CanvasElement";
-    map["content"] = "ContentElement";
-    map["dl"] = "DListElement";
-    map["datalist"] = "DataListElement";
-    map["details"] = "DetailsElement";
-    map["div"] = "DivElement";
-    map["embed"] = "EmbedElement";
-    map["fieldset"] = "FieldSetElement";
-    map["form"] = "FormElement";
-    map["hr"] = "HRElement";
-    map["head"] = "HeadElement";
-    map["h1"] = "HeadingElement";
-    map["h2"] = "HeadingElement";
-    map["h3"] = "HeadingElement";
-    map["h4"] = "HeadingElement";
-    map["h5"] = "HeadingElement";
-    map["h6"] = "HeadingElement";
-    map["html"] = "HtmlElement";
-    map["iframe"] = "IFrameElement";
-    map["img"] = "ImageElement";
-    map["input"] = "InputElement";
-    map["keygen"] = "KeygenElement";
-    map["li"] = "LIElement";
-    map["label"] = "LabelElement";
-    map["legend"] = "LegendElement";
-    map["link"] = "LinkElement";
-    map["map"] = "MapElement";
-    map["menu"] = "MenuElement";
-    map["meter"] = "MeterElement";
-    map["ol"] = "OListElement";
-    map["object"] = "ObjectElement";
-    map["optgroup"] = "OptGroupElement";
-    map["output"] = "OutputElement";
-    map["p"] = "ParagraphElement";
-    map["param"] = "ParamElement";
-    map["pre"] = "PreElement";
-    map["progress"] = "ProgressElement";
-    map["script"] = "ScriptElement";
-    map["select"] = "SelectElement";
-    map["source"] = "SourceElement";
-    map["span"] = "SpanElement";
-    map["style"] = "StyleElement";
-    map["caption"] = "TableCaptionElement";
-    map["td"] = "TableCellElement";
-    map["col"] = "TableColElement";
-    map["table"] = "TableElement";
-    map["tr"] = "TableRowElement";
-    map["textarea"] = "TextAreaElement";
-    map["title"] = "TitleElement";
-    map["track"] = "TrackElement";
-    map["ul"] = "UListElement";
-    map["video"] = "VideoElement";
-    return map;
-  }
+  static HashMap<String, String> _HTML_ELEMENT_TO_CLASS_MAP =
+      _createHtmlTagToClassMap();
 
   /**
    * The resolver driving the resolution and type analysis.
@@ -135,10 +45,10 @@
   DartType _dynamicType;
 
   /**
-   * The type representing the class containing the nodes being analyzed, or `null` if the
-   * nodes are not within a class.
+   * The type representing the class containing the nodes being analyzed,
+   * or `null` if the nodes are not within a class.
    */
-  InterfaceType _thisType;
+  InterfaceType thisType;
 
   /**
    * The object keeping track of which elements have had their types overridden.
@@ -153,13 +63,8 @@
   /**
    * A table mapping [ExecutableElement]s to their propagated return types.
    */
-  HashMap<ExecutableElement, DartType> _propagatedReturnTypes = new HashMap<ExecutableElement, DartType>();
-
-  /**
-   * A table mapping HTML tag names to the names of the classes (in 'dart:html') that implement
-   * those tags.
-   */
-  static HashMap<String, String> _HTML_ELEMENT_TO_CLASS_MAP = _createHtmlTagToClassMap();
+  HashMap<ExecutableElement, DartType> _propagatedReturnTypes =
+      new HashMap<ExecutableElement, DartType>();
 
   /**
    * Initialize a newly created type analyzer.
@@ -174,15 +79,6 @@
   }
 
   /**
-   * Set the type of the class being analyzed to the given type.
-   *
-   * @param thisType the type representing the class containing the nodes being analyzed
-   */
-  void set thisType(InterfaceType thisType) {
-    this._thisType = thisType;
-  }
-
-  /**
    * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is
    * `String`.</blockquote>
    */
@@ -267,8 +163,10 @@
       _recordStaticType(node, staticType);
       MethodElement propagatedMethodElement = node.propagatedElement;
       if (!identical(propagatedMethodElement, staticMethodElement)) {
-        DartType propagatedType = _computeStaticReturnType(propagatedMethodElement);
-        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+        DartType propagatedType =
+            _computeStaticReturnType(propagatedMethodElement);
+        if (propagatedType != null &&
+            propagatedType.isMoreSpecificThan(staticType)) {
           _recordPropagatedType(node, propagatedType);
         }
       }
@@ -321,8 +219,10 @@
     _recordStaticType(node, staticType);
     MethodElement propagatedMethodElement = node.propagatedElement;
     if (!identical(propagatedMethodElement, staticMethodElement)) {
-      DartType propagatedType = _computeStaticReturnType(propagatedMethodElement);
-      if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+      DartType propagatedType =
+          _computeStaticReturnType(propagatedMethodElement);
+      if (propagatedType != null &&
+          propagatedType.isMoreSpecificThan(staticType)) {
         _recordPropagatedType(node, propagatedType);
       }
     }
@@ -386,8 +286,10 @@
       if (propagatedElseType == null) {
         propagatedElseType = staticElseType;
       }
-      DartType propagatedType = propagatedThenType.getLeastUpperBound(propagatedElseType);
-      if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+      DartType propagatedType =
+          propagatedThenType.getLeastUpperBound(propagatedElseType);
+      if (propagatedType != null &&
+          propagatedType.isMoreSpecificThan(staticType)) {
         _recordPropagatedType(node, propagatedType);
       }
     }
@@ -407,8 +309,10 @@
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     FunctionExpression function = node.functionExpression;
-    ExecutableElementImpl functionElement = node.element as ExecutableElementImpl;
-    functionElement.returnType = _computeStaticReturnTypeOfFunctionDeclaration(node);
+    ExecutableElementImpl functionElement =
+        node.element as ExecutableElementImpl;
+    functionElement.returnType =
+        _computeStaticReturnTypeOfFunctionDeclaration(node);
     _recordPropagatedTypeOfFunction(functionElement, function.body);
     _recordStaticType(function, functionElement.type);
     return null;
@@ -447,11 +351,14 @@
   @override
   Object visitFunctionExpression(FunctionExpression node) {
     if (node.parent is FunctionDeclaration) {
-      // The function type will be resolved and set when we visit the parent node.
+      // The function type will be resolved and set when we visit the parent
+      // node.
       return null;
     }
-    ExecutableElementImpl functionElement = node.element as ExecutableElementImpl;
-    functionElement.returnType = _computeStaticReturnTypeOfFunctionExpression(node);
+    ExecutableElementImpl functionElement =
+        node.element as ExecutableElementImpl;
+    functionElement.returnType =
+        _computeStaticReturnTypeOfFunctionExpression(node);
     _recordPropagatedTypeOfFunction(functionElement, node.body);
     _recordStaticType(node, node.element.type);
     return null;
@@ -476,20 +383,35 @@
     DartType staticStaticType = _computeStaticReturnType(staticMethodElement);
     _recordStaticType(node, staticStaticType);
     // Record propagated return type of the static element.
-    DartType staticPropagatedType = _computePropagatedReturnType(staticMethodElement);
-    if (staticPropagatedType != null && (staticStaticType == null || staticPropagatedType.isMoreSpecificThan(staticStaticType))) {
+    DartType staticPropagatedType =
+        _computePropagatedReturnType(staticMethodElement);
+    if (staticPropagatedType != null &&
+        (staticStaticType == null ||
+            staticPropagatedType.isMoreSpecificThan(staticStaticType))) {
       _recordPropagatedType(node, staticPropagatedType);
     }
     ExecutableElement propagatedMethodElement = node.propagatedElement;
     if (!identical(propagatedMethodElement, staticMethodElement)) {
       // Record static return type of the propagated element.
-      DartType propagatedStaticType = _computeStaticReturnType(propagatedMethodElement);
-      if (propagatedStaticType != null && (staticStaticType == null || propagatedStaticType.isMoreSpecificThan(staticStaticType)) && (staticPropagatedType == null || propagatedStaticType.isMoreSpecificThan(staticPropagatedType))) {
+      DartType propagatedStaticType =
+          _computeStaticReturnType(propagatedMethodElement);
+      if (propagatedStaticType != null &&
+          (staticStaticType == null ||
+              propagatedStaticType.isMoreSpecificThan(staticStaticType)) &&
+          (staticPropagatedType == null ||
+              propagatedStaticType.isMoreSpecificThan(staticPropagatedType))) {
         _recordPropagatedType(node, propagatedStaticType);
       }
       // Record propagated return type of the propagated element.
-      DartType propagatedPropagatedType = _computePropagatedReturnType(propagatedMethodElement);
-      if (propagatedPropagatedType != null && (staticStaticType == null || propagatedPropagatedType.isMoreSpecificThan(staticStaticType)) && (staticPropagatedType == null || propagatedPropagatedType.isMoreSpecificThan(staticPropagatedType)) && (propagatedStaticType == null || propagatedPropagatedType.isMoreSpecificThan(propagatedStaticType))) {
+      DartType propagatedPropagatedType =
+          _computePropagatedReturnType(propagatedMethodElement);
+      if (propagatedPropagatedType != null &&
+          (staticStaticType == null ||
+              propagatedPropagatedType.isMoreSpecificThan(staticStaticType)) &&
+          (staticPropagatedType == null ||
+              propagatedPropagatedType.isMoreSpecificThan(staticPropagatedType)) &&
+          (propagatedStaticType == null ||
+              propagatedPropagatedType.isMoreSpecificThan(propagatedStaticType))) {
         _recordPropagatedType(node, propagatedPropagatedType);
       }
     }
@@ -510,7 +432,8 @@
       MethodElement propagatedMethodElement = node.propagatedElement;
       if (!identical(propagatedMethodElement, staticMethodElement)) {
         DartType propagatedType = _computeArgumentType(propagatedMethodElement);
-        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+        if (propagatedType != null &&
+            propagatedType.isMoreSpecificThan(staticType)) {
           _recordPropagatedType(node, propagatedType);
         }
       }
@@ -520,8 +443,10 @@
       _recordStaticType(node, staticType);
       MethodElement propagatedMethodElement = node.propagatedElement;
       if (!identical(propagatedMethodElement, staticMethodElement)) {
-        DartType propagatedType = _computeStaticReturnType(propagatedMethodElement);
-        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+        DartType propagatedType =
+            _computeStaticReturnType(propagatedMethodElement);
+        if (propagatedType != null &&
+            propagatedType.isMoreSpecificThan(staticType)) {
           _recordPropagatedType(node, propagatedType);
         }
       }
@@ -547,12 +472,16 @@
       if (_isHtmlLibrary(library)) {
         String constructorName = element.name;
         if ("tag" == constructorName) {
-          DartType returnType = _getFirstArgumentAsTypeWithMap(library, node.argumentList, _HTML_ELEMENT_TO_CLASS_MAP);
+          DartType returnType = _getFirstArgumentAsTypeWithMap(
+              library,
+              node.argumentList,
+              _HTML_ELEMENT_TO_CLASS_MAP);
           if (returnType != null) {
             _recordPropagatedType(node, returnType);
           }
         } else {
-          DartType returnType = _getElementNameAsType(library, constructorName, _HTML_ELEMENT_TO_CLASS_MAP);
+          DartType returnType =
+              _getElementNameAsType(library, constructorName, _HTML_ELEMENT_TO_CLASS_MAP);
           if (returnType != null) {
             _recordPropagatedType(node, returnType);
           }
@@ -606,7 +535,9 @@
         }
       }
     }
-    _recordStaticType(node, _typeProvider.listType.substitute4(<DartType> [staticType]));
+    _recordStaticType(
+        node,
+        _typeProvider.listType.substitute4(<DartType>[staticType]));
     return null;
   }
 
@@ -642,7 +573,9 @@
         }
       }
     }
-    _recordStaticType(node, _typeProvider.mapType.substitute4(<DartType> [staticKeyType, staticValueType]));
+    _recordStaticType(
+        node,
+        _typeProvider.mapType.substitute4(<DartType>[staticKeyType, staticValueType]));
     return null;
   }
 
@@ -692,7 +625,8 @@
       DartType staticType = variable.type;
       _recordStaticType(methodNameNode, staticType);
       DartType propagatedType = _overrideManager.getType(variable);
-      if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+      if (propagatedType != null &&
+          propagatedType.isMoreSpecificThan(staticType)) {
         _recordPropagatedType(methodNameNode, propagatedType);
       }
     }
@@ -700,8 +634,11 @@
     DartType staticStaticType = _computeStaticReturnType(staticMethodElement);
     _recordStaticType(node, staticStaticType);
     // Record propagated return type of the static element.
-    DartType staticPropagatedType = _computePropagatedReturnType(staticMethodElement);
-    if (staticPropagatedType != null && (staticStaticType == null || staticPropagatedType.isMoreSpecificThan(staticStaticType))) {
+    DartType staticPropagatedType =
+        _computePropagatedReturnType(staticMethodElement);
+    if (staticPropagatedType != null &&
+        (staticStaticType == null ||
+            staticPropagatedType.isMoreSpecificThan(staticStaticType))) {
       _recordPropagatedType(node, staticPropagatedType);
     }
     bool needPropagatedType = true;
@@ -716,11 +653,13 @@
           // 2) Future<valueType>, if the closure returns a value.
           NodeList<Expression> arguments = node.argumentList.arguments;
           if (arguments.length == 1) {
-            // TODO(brianwilkerson) Handle the case where both arguments are provided.
+            // TODO(brianwilkerson) Handle the case where both arguments are
+            // provided.
             Expression closureArg = arguments[0];
             if (closureArg is FunctionExpression) {
               FunctionExpression closureExpr = closureArg;
-              DartType returnType = _computePropagatedReturnType(closureExpr.element);
+              DartType returnType =
+                  _computePropagatedReturnType(closureExpr.element);
               if (returnType != null) {
                 // prepare the type of the returned Future
                 InterfaceTypeImpl newFutureType;
@@ -728,8 +667,9 @@
                   newFutureType = returnType as InterfaceTypeImpl;
                 } else {
                   InterfaceType futureType = targetType as InterfaceType;
-                  newFutureType = new InterfaceTypeImpl.con1(futureType.element);
-                  newFutureType.typeArguments = <DartType> [returnType];
+                  newFutureType =
+                      new InterfaceTypeImpl.con1(futureType.element);
+                  newFutureType.typeArguments = <DartType>[returnType];
                 }
                 // set the 'then' invocation type
                 _recordPropagatedType(node, newFutureType);
@@ -744,10 +684,12 @@
       Expression target = node.realTarget;
       if (target != null) {
         DartType targetType = target.bestType;
-        if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
+        if (targetType is InterfaceType &&
+            (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
           LibraryElement library = targetType.element.library;
           if (_isHtmlLibrary(library)) {
-            DartType returnType = _getFirstArgumentAsType(library, node.argumentList);
+            DartType returnType =
+                _getFirstArgumentAsType(library, node.argumentList);
             if (returnType != null) {
               _recordPropagatedType(node, returnType);
               needPropagatedType = false;
@@ -762,7 +704,8 @@
         if (methodElement != null) {
           LibraryElement library = methodElement.library;
           if (_isHtmlLibrary(library)) {
-            DartType returnType = _getFirstArgumentAsQuery(library, node.argumentList);
+            DartType returnType =
+                _getFirstArgumentAsQuery(library, node.argumentList);
             if (returnType != null) {
               _recordPropagatedType(node, returnType);
               needPropagatedType = false;
@@ -771,10 +714,12 @@
         }
       } else {
         DartType targetType = target.bestType;
-        if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
+        if (targetType is InterfaceType &&
+            (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
           LibraryElement library = targetType.element.library;
           if (_isHtmlLibrary(library)) {
-            DartType returnType = _getFirstArgumentAsQuery(library, node.argumentList);
+            DartType returnType =
+                _getFirstArgumentAsQuery(library, node.argumentList);
             if (returnType != null) {
               _recordPropagatedType(node, returnType);
               needPropagatedType = false;
@@ -786,10 +731,12 @@
       Expression target = node.realTarget;
       if (target != null) {
         DartType targetType = target.bestType;
-        if (targetType is InterfaceType && (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
+        if (targetType is InterfaceType &&
+            (targetType.name == "HtmlDocument" || targetType.name == "Document")) {
           LibraryElement library = targetType.element.library;
           if (_isHtmlLibrary(library)) {
-            DartType returnType = _getFirstArgumentAsQuery(library, node.argumentList);
+            DartType returnType =
+                _getFirstArgumentAsQuery(library, node.argumentList);
             if (returnType != null) {
               _recordPropagatedType(node, returnType);
               needPropagatedType = false;
@@ -798,7 +745,9 @@
         }
       }
     } else if (methodName == "JS") {
-      DartType returnType = _getFirstArgumentAsType(_typeProvider.objectType.element.library, node.argumentList);
+      DartType returnType = _getFirstArgumentAsType(
+          _typeProvider.objectType.element.library,
+          node.argumentList);
       if (returnType != null) {
         _recordPropagatedType(node, returnType);
         needPropagatedType = false;
@@ -807,14 +756,16 @@
       Expression target = node.realTarget;
       if (target != null) {
         DartType targetType = target.bestType;
-        if (targetType is InterfaceType && (targetType.name == "CanvasElement")) {
+        if (targetType is InterfaceType &&
+            (targetType.name == "CanvasElement")) {
           NodeList<Expression> arguments = node.argumentList.arguments;
           if (arguments.length == 1) {
             Expression argument = arguments[0];
             if (argument is StringLiteral) {
               String value = argument.stringValue;
               if ("2d" == value) {
-                PropertyAccessorElement getter = targetType.element.getGetter("context2D");
+                PropertyAccessorElement getter =
+                    targetType.element.getGetter("context2D");
                 if (getter != null) {
                   DartType returnType = getter.returnType;
                   if (returnType != null) {
@@ -830,20 +781,33 @@
     }
     if (needPropagatedType) {
       Element propagatedElement = methodNameNode.propagatedElement;
-      // HACK: special case for object methods ([toString]) on dynamic expressions.
-      // More special cases in [visitPrefixedIdentfier].
+      // HACK: special case for object methods ([toString]) on dynamic
+      // expressions. More special cases in [visitPrefixedIdentfier].
       if (propagatedElement == null) {
-        propagatedElement = _typeProvider.objectType.getMethod(methodNameNode.name);
+        propagatedElement =
+            _typeProvider.objectType.getMethod(methodNameNode.name);
       }
       if (!identical(propagatedElement, staticMethodElement)) {
         // Record static return type of the propagated element.
-        DartType propagatedStaticType = _computeStaticReturnType(propagatedElement);
-        if (propagatedStaticType != null && (staticStaticType == null || propagatedStaticType.isMoreSpecificThan(staticStaticType)) && (staticPropagatedType == null || propagatedStaticType.isMoreSpecificThan(staticPropagatedType))) {
+        DartType propagatedStaticType =
+            _computeStaticReturnType(propagatedElement);
+        if (propagatedStaticType != null &&
+            (staticStaticType == null ||
+                propagatedStaticType.isMoreSpecificThan(staticStaticType)) &&
+            (staticPropagatedType == null ||
+                propagatedStaticType.isMoreSpecificThan(staticPropagatedType))) {
           _recordPropagatedType(node, propagatedStaticType);
         }
         // Record propagated return type of the propagated element.
-        DartType propagatedPropagatedType = _computePropagatedReturnType(propagatedElement);
-        if (propagatedPropagatedType != null && (staticStaticType == null || propagatedPropagatedType.isMoreSpecificThan(staticStaticType)) && (staticPropagatedType == null || propagatedPropagatedType.isMoreSpecificThan(staticPropagatedType)) && (propagatedStaticType == null || propagatedPropagatedType.isMoreSpecificThan(propagatedStaticType))) {
+        DartType propagatedPropagatedType =
+            _computePropagatedReturnType(propagatedElement);
+        if (propagatedPropagatedType != null &&
+            (staticStaticType == null ||
+                propagatedPropagatedType.isMoreSpecificThan(staticStaticType)) &&
+            (staticPropagatedType == null ||
+                propagatedPropagatedType.isMoreSpecificThan(staticPropagatedType)) &&
+            (propagatedStaticType == null ||
+                propagatedPropagatedType.isMoreSpecificThan(propagatedStaticType))) {
           _recordPropagatedType(node, propagatedPropagatedType);
         }
       }
@@ -908,7 +872,8 @@
     Expression operand = node.operand;
     DartType staticType = _getStaticType(operand);
     sc.TokenType operator = node.operator.type;
-    if (operator == sc.TokenType.MINUS_MINUS || operator == sc.TokenType.PLUS_PLUS) {
+    if (operator == sc.TokenType.MINUS_MINUS ||
+        operator == sc.TokenType.PLUS_PLUS) {
       DartType intType = _typeProvider.intType;
       if (identical(_getStaticType(node.operand), intType)) {
         staticType = intType;
@@ -944,7 +909,8 @@
       staticType = staticElement.type;
     } else if (staticElement is PropertyAccessorElement) {
       staticType = _getTypeOfProperty(staticElement, node.prefix.staticType);
-      propagatedType = _getPropertyPropagatedType(staticElement, propagatedType);
+      propagatedType =
+          _getPropertyPropagatedType(staticElement, propagatedType);
     } else if (staticElement is ExecutableElement) {
       staticType = staticElement.type;
     } else if (staticElement is TypeParameterElement) {
@@ -955,10 +921,11 @@
     _recordStaticType(prefixedIdentifier, staticType);
     _recordStaticType(node, staticType);
     Element propagatedElement = prefixedIdentifier.propagatedElement;
-    // HACK: special case for object getters ([hashCode] and [runtimeType]) on dynamic expressions.
-    // More special cases in [visitMethodInvocation].
+    // HACK: special case for object getters ([hashCode] and [runtimeType]) on
+    // dynamic expressions. More special cases in [visitMethodInvocation].
     if (propagatedElement == null) {
-      propagatedElement = _typeProvider.objectType.getGetter(prefixedIdentifier.name);
+      propagatedElement =
+          _typeProvider.objectType.getGetter(prefixedIdentifier.name);
     }
     if (propagatedElement is ClassElement) {
       if (_isNotTypeLiteral(node)) {
@@ -971,8 +938,11 @@
     } else if (propagatedElement is MethodElement) {
       propagatedType = (propagatedElement as MethodElement).type;
     } else if (propagatedElement is PropertyAccessorElement) {
-      propagatedType = _getTypeOfProperty(propagatedElement as PropertyAccessorElement, node.prefix.staticType);
-      propagatedType = _getPropertyPropagatedType(propagatedElement, propagatedType);
+      propagatedType = _getTypeOfProperty(
+          propagatedElement as PropertyAccessorElement,
+          node.prefix.staticType);
+      propagatedType =
+          _getPropertyPropagatedType(propagatedElement, propagatedType);
     } else if (propagatedElement is ExecutableElement) {
       propagatedType = (propagatedElement as ExecutableElement).type;
     } else if (propagatedElement is TypeParameterElement) {
@@ -981,10 +951,12 @@
       propagatedType = (propagatedElement as VariableElement).type;
     }
     DartType overriddenType = _overrideManager.getType(propagatedElement);
-    if (propagatedType == null || (overriddenType != null && overriddenType.isMoreSpecificThan(propagatedType))) {
+    if (propagatedType == null ||
+        (overriddenType != null && overriddenType.isMoreSpecificThan(propagatedType))) {
       propagatedType = overriddenType;
     }
-    if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+    if (propagatedType != null &&
+        propagatedType.isMoreSpecificThan(staticType)) {
       _recordPropagatedType(prefixedIdentifier, propagatedType);
       _recordPropagatedType(node, propagatedType);
     }
@@ -1005,7 +977,8 @@
       // The other cases are equivalent to invoking a method.
       ExecutableElement staticMethodElement = node.staticElement;
       DartType staticType = _computeStaticReturnType(staticMethodElement);
-      if (operator == sc.TokenType.MINUS_MINUS || operator == sc.TokenType.PLUS_PLUS) {
+      if (operator == sc.TokenType.MINUS_MINUS ||
+          operator == sc.TokenType.PLUS_PLUS) {
         DartType intType = _typeProvider.intType;
         if (identical(_getStaticType(node.operand), intType)) {
           staticType = intType;
@@ -1014,8 +987,10 @@
       _recordStaticType(node, staticType);
       MethodElement propagatedMethodElement = node.propagatedElement;
       if (!identical(propagatedMethodElement, staticMethodElement)) {
-        DartType propagatedType = _computeStaticReturnType(propagatedMethodElement);
-        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+        DartType propagatedType =
+            _computeStaticReturnType(propagatedMethodElement);
+        if (propagatedType != null &&
+            propagatedType.isMoreSpecificThan(staticType)) {
           _recordPropagatedType(node, propagatedType);
         }
       }
@@ -1073,7 +1048,9 @@
       staticType = staticElement.type;
     } else if (staticElement is PropertyAccessorElement) {
       Expression realTarget = node.realTarget;
-      staticType = _getTypeOfProperty(staticElement, realTarget != null ? _getStaticType(realTarget) : null);
+      staticType = _getTypeOfProperty(
+          staticElement,
+          realTarget != null ? _getStaticType(realTarget) : null);
     } else {
       // TODO(brianwilkerson) Report this internal error.
     }
@@ -1085,11 +1062,14 @@
       propagatedType = propagatedElement.type;
     } else if (propagatedElement is PropertyAccessorElement) {
       Expression realTarget = node.realTarget;
-      propagatedType = _getTypeOfProperty(propagatedElement, realTarget != null ? realTarget.bestType : null);
+      propagatedType = _getTypeOfProperty(
+          propagatedElement,
+          realTarget != null ? realTarget.bestType : null);
     } else {
       // TODO(brianwilkerson) Report this internal error.
     }
-    if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+    if (propagatedType != null &&
+        propagatedType.isMoreSpecificThan(staticType)) {
       _recordPropagatedType(propertyName, propagatedType);
       _recordPropagatedType(node, propagatedType);
     }
@@ -1179,16 +1159,18 @@
       staticType = _dynamicType;
     }
     _recordStaticType(node, staticType);
-    // TODO(brianwilkerson) I think we want to repeat the logic above using the propagated element
-    // to get another candidate for the propagated type.
+    // TODO(brianwilkerson) I think we want to repeat the logic above using the
+    // propagated element to get another candidate for the propagated type.
     DartType propagatedType = _getPropertyPropagatedType(element, null);
     if (propagatedType == null) {
       DartType overriddenType = _overrideManager.getType(element);
-      if (propagatedType == null || overriddenType != null && overriddenType.isMoreSpecificThan(propagatedType)) {
+      if (propagatedType == null ||
+          overriddenType != null && overriddenType.isMoreSpecificThan(propagatedType)) {
         propagatedType = overriddenType;
       }
     }
-    if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
+    if (propagatedType != null &&
+        propagatedType.isMoreSpecificThan(staticType)) {
       _recordPropagatedType(node, propagatedType);
     }
     return null;
@@ -1216,11 +1198,12 @@
 
   @override
   Object visitSuperExpression(SuperExpression node) {
-    if (_thisType == null) {
-      // TODO(brianwilkerson) Report this error if it hasn't already been reported
+    if (thisType == null) {
+      // TODO(brianwilkerson) Report this error if it hasn't already been
+      // reported.
       _recordStaticType(node, _dynamicType);
     } else {
-      _recordStaticType(node, _thisType);
+      _recordStaticType(node, thisType);
     }
     return null;
   }
@@ -1237,11 +1220,12 @@
    */
   @override
   Object visitThisExpression(ThisExpression node) {
-    if (_thisType == null) {
-      // TODO(brianwilkerson) Report this error if it hasn't already been reported
+    if (thisType == null) {
+      // TODO(brianwilkerson) Report this error if it hasn't already been
+      // reported.
       _recordStaticType(node, _dynamicType);
     } else {
-      _recordStaticType(node, _thisType);
+      _recordStaticType(node, thisType);
     }
     return null;
   }
@@ -1314,8 +1298,9 @@
       return expressionBody.expression.bestType;
     }
     if (body is BlockFunctionBody) {
-      GeneralizingAstVisitor_StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction visitor
-          = new GeneralizingAstVisitor_StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction();
+
+      _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction visitor =
+          new _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction();
       body.accept(visitor);
       return visitor.result;
     }
@@ -1331,8 +1316,8 @@
   DartType _computeStaticReturnType(Element element) {
     if (element is PropertyAccessorElement) {
       //
-      // This is a function invocation expression disguised as something else. We are invoking a
-      // getter and then invoking the returned function.
+      // This is a function invocation expression disguised as something else.
+      // We are invoking a getter and then invoking the returned function.
       //
       FunctionType propertyType = element.type;
       if (propertyType != null) {
@@ -1340,7 +1325,9 @@
         if (returnType.isDartCoreFunction) {
           return _dynamicType;
         } else if (returnType is InterfaceType) {
-          MethodElement callMethod = returnType.lookUpMethod(FunctionElement.CALL_METHOD_NAME, _resolver.definingLibrary);
+          MethodElement callMethod = returnType.lookUpMethod(
+              FunctionElement.CALL_METHOD_NAME,
+              _resolver.definingLibrary);
           if (callMethod != null) {
             return callMethod.type.returnType;
           }
@@ -1357,7 +1344,8 @@
     } else if (element is ExecutableElement) {
       FunctionType type = element.type;
       if (type != null) {
-        // TODO(brianwilkerson) Figure out the conditions under which the type is null.
+        // TODO(brianwilkerson) Figure out the conditions under which the type
+        // is null.
         return type.returnType;
       }
     } else if (element is VariableElement) {
@@ -1378,7 +1366,8 @@
    * @param node the function expression whose static return type is to be computed
    * @return the static return type that was computed
    */
-  DartType _computeStaticReturnTypeOfFunctionDeclaration(FunctionDeclaration node) {
+  DartType
+      _computeStaticReturnTypeOfFunctionDeclaration(FunctionDeclaration node) {
     TypeName returnType = node.returnType;
     if (returnType == null) {
       return _dynamicType;
@@ -1394,7 +1383,8 @@
    * @param node the function expression whose return type is to be computed
    * @return the return type that was computed
    */
-  DartType _computeStaticReturnTypeOfFunctionExpression(FunctionExpression node) {
+  DartType
+      _computeStaticReturnTypeOfFunctionExpression(FunctionExpression node) {
     FunctionBody body = node.body;
     if (body is ExpressionFunctionBody) {
       return _getStaticType(body.expression);
@@ -1411,7 +1401,8 @@
    * @param nameMap an optional map used to map the element name to a type name
    * @return the type specified by the first argument in the argument list
    */
-  DartType _getElementNameAsType(LibraryElement library, String elementName, HashMap<String, String> nameMap) {
+  DartType _getElementNameAsType(LibraryElement library, String elementName,
+      HashMap<String, String> nameMap) {
     if (elementName != null) {
       if (nameMap != null) {
         elementName = nameMap[elementName.toLowerCase()];
@@ -1433,7 +1424,8 @@
    * @param argumentList the list of arguments from which a type is to be extracted
    * @return the type specified by the first argument in the argument list
    */
-  DartType _getFirstArgumentAsQuery(LibraryElement library, ArgumentList argumentList) {
+  DartType _getFirstArgumentAsQuery(LibraryElement library,
+      ArgumentList argumentList) {
     String argumentValue = _getFirstArgumentAsString(argumentList);
     if (argumentValue != null) {
       //
@@ -1444,7 +1436,8 @@
         return null;
       }
       //
-      // Otherwise, try to extract the tag based on http://www.w3.org/TR/CSS2/selector.html.
+      // Otherwise, try to extract the tag based on
+      // http://www.w3.org/TR/CSS2/selector.html.
       //
       String tag = argumentValue;
       tag = StringUtilities.substringBeforeChar(tag, 0x3A);
@@ -1487,7 +1480,9 @@
    * @param argumentList the list of arguments from which a type is to be extracted
    * @return the type specified by the first argument in the argument list
    */
-  DartType _getFirstArgumentAsType(LibraryElement library, ArgumentList argumentList) => _getFirstArgumentAsTypeWithMap(library, argumentList, null);
+  DartType _getFirstArgumentAsType(LibraryElement library,
+      ArgumentList argumentList) =>
+      _getFirstArgumentAsTypeWithMap(library, argumentList, null);
 
   /**
    * If the given argument list contains at least one argument, and if the argument is a simple
@@ -1499,7 +1494,12 @@
    * @param nameMap an optional map used to map the element name to a type name
    * @return the type specified by the first argument in the argument list
    */
-  DartType _getFirstArgumentAsTypeWithMap(LibraryElement library, ArgumentList argumentList, HashMap<String, String> nameMap) => _getElementNameAsType(library, _getFirstArgumentAsString(argumentList), nameMap);
+  DartType _getFirstArgumentAsTypeWithMap(LibraryElement library,
+      ArgumentList argumentList, HashMap<String, String> nameMap) =>
+      _getElementNameAsType(
+          library,
+          _getFirstArgumentAsString(argumentList),
+          nameMap);
 
   /**
    * Return the propagated type of the given [Element], or `null`.
@@ -1510,7 +1510,8 @@
       if (accessor.isGetter) {
         PropertyInducingElement variable = accessor.variable;
         DartType propagatedType = variable.propagatedType;
-        if (currentType == null || propagatedType != null && propagatedType.isMoreSpecificThan(currentType)) {
+        if (currentType == null ||
+            propagatedType != null && propagatedType.isMoreSpecificThan(currentType)) {
           return propagatedType;
         }
       }
@@ -1527,7 +1528,8 @@
   DartType _getStaticType(Expression expression) {
     DartType type = expression.staticType;
     if (type == null) {
-      // TODO(brianwilkerson) Determine the conditions for which the static type is null.
+      // TODO(brianwilkerson) Determine the conditions for which the static type
+      // is null.
       return _dynamicType;
     }
     return type;
@@ -1542,7 +1544,8 @@
   DartType _getType(TypeName typeName) {
     DartType type = typeName.type;
     if (type == null) {
-      //TODO(brianwilkerson) Determine the conditions for which the type is null.
+      //TODO(brianwilkerson) Determine the conditions for which the type is
+      // null.
       return _dynamicType;
     }
     return type;
@@ -1558,12 +1561,14 @@
    *          specific type information
    * @return the type that should be recorded for a node that resolved to the given accessor
    */
-  DartType _getTypeOfProperty(PropertyAccessorElement accessor, DartType context) {
+  DartType _getTypeOfProperty(PropertyAccessorElement accessor,
+      DartType context) {
     FunctionType functionType = accessor.type;
     if (functionType == null) {
-      // TODO(brianwilkerson) Report this internal error. This happens when we are analyzing a
-      // reference to a property before we have analyzed the declaration of the property or when
-      // the property does not have a defined type.
+      // TODO(brianwilkerson) Report this internal error. This happens when we
+      // are analyzing a reference to a property before we have analyzed the
+      // declaration of the property or when the property does not have a
+      // defined type.
       return _dynamicType;
     }
     if (accessor.isSetter) {
@@ -1582,11 +1587,14 @@
     }
     DartType returnType = functionType.returnType;
     if (returnType is TypeParameterType && context is InterfaceType) {
-      // if the return type is a TypeParameter, we try to use the context [that the function is being
-      // called on] to get a more accurate returnType type
+      // if the return type is a TypeParameter, we try to use the context [that
+      // the function is being called on] to get a more accurate returnType type
       InterfaceType interfaceTypeContext = context;
       //      Type[] argumentTypes = interfaceTypeContext.getTypeArguments();
-      List<TypeParameterElement> typeParameterElements = interfaceTypeContext.element != null ? interfaceTypeContext.element.typeParameters : null;
+      List<TypeParameterElement> typeParameterElements =
+          interfaceTypeContext.element != null ?
+              interfaceTypeContext.element.typeParameters :
+              null;
       if (typeParameterElements != null) {
         for (int i = 0; i < typeParameterElements.length; i++) {
           TypeParameterElement typeParameterElement = typeParameterElements[i];
@@ -1595,8 +1603,8 @@
           }
         }
         // TODO(jwren) troubleshoot why call to substitute doesn't work
-        //        Type[] parameterTypes = TypeParameterTypeImpl.getTypes(parameterElements);
-        //        return returnType.substitute(argumentTypes, parameterTypes);
+//        Type[] parameterTypes = TypeParameterTypeImpl.getTypes(parameterElements);
+//        return returnType.substitute(argumentTypes, parameterTypes);
       }
     }
     return returnType;
@@ -1606,7 +1614,10 @@
    * Return `true` if the given [Type] is the `Future` form the 'dart:async'
    * library.
    */
-  bool _isAsyncFutureType(DartType type) => type is InterfaceType && type.name == "Future" && _isAsyncLibrary(type.element.library);
+  bool _isAsyncFutureType(DartType type) =>
+      type is InterfaceType &&
+          type.name == "Future" &&
+          _isAsyncLibrary(type.element.library);
 
   /**
    * Return `true` if the given library is the 'dart:async' library.
@@ -1622,7 +1633,8 @@
    * @param library the library being tested
    * @return `true` if the library is 'dart:html'
    */
-  bool _isHtmlLibrary(LibraryElement library) => library != null && "dart.dom.html" == library.name;
+  bool _isHtmlLibrary(LibraryElement library) =>
+      library != null && "dart.dom.html" == library.name;
 
   /**
    * Return `true` if the given node is not a type literal.
@@ -1632,7 +1644,11 @@
    */
   bool _isNotTypeLiteral(Identifier node) {
     AstNode parent = node.parent;
-    return parent is TypeName || (parent is PrefixedIdentifier && (parent.parent is TypeName || identical(parent.prefix, node))) || (parent is PropertyAccess && identical(parent.target, node)) || (parent is MethodInvocation && identical(node, parent.target));
+    return parent is TypeName ||
+        (parent is PrefixedIdentifier &&
+            (parent.parent is TypeName || identical(parent.prefix, node))) ||
+        (parent is PropertyAccess && identical(parent.target, node)) ||
+        (parent is MethodInvocation && identical(node, parent.target));
   }
 
   /**
@@ -1656,8 +1672,10 @@
    * @return the propagated return type that was computed, may be `null` if it is not more
    *         specific than the static return type.
    */
-  void _recordPropagatedTypeOfFunction(ExecutableElement functionElement, FunctionBody body) {
-    DartType propagatedReturnType = _computePropagatedReturnTypeOfFunction(body);
+  void _recordPropagatedTypeOfFunction(ExecutableElement functionElement,
+      FunctionBody body) {
+    DartType propagatedReturnType =
+        _computePropagatedReturnTypeOfFunction(body);
     if (propagatedReturnType == null) {
       return;
     }
@@ -1695,23 +1713,34 @@
    * @param staticType the static type of the expression as resolved
    * @return the better type guess, or the same static type as given
    */
-  DartType _refineBinaryExpressionType(BinaryExpression node, DartType staticType) {
+  DartType _refineBinaryExpressionType(BinaryExpression node,
+      DartType staticType) {
     sc.TokenType operator = node.operator.type;
     // bool
-    if (operator == sc.TokenType.AMPERSAND_AMPERSAND || operator == sc.TokenType.BAR_BAR || operator == sc.TokenType.EQ_EQ || operator == sc.TokenType.BANG_EQ) {
+    if (operator == sc.TokenType.AMPERSAND_AMPERSAND ||
+        operator == sc.TokenType.BAR_BAR ||
+        operator == sc.TokenType.EQ_EQ ||
+        operator == sc.TokenType.BANG_EQ) {
       return _typeProvider.boolType;
     }
     DartType intType = _typeProvider.intType;
     if (_getStaticType(node.leftOperand) == intType) {
       // int op double
-      if (operator == sc.TokenType.MINUS || operator == sc.TokenType.PERCENT || operator == sc.TokenType.PLUS || operator == sc.TokenType.STAR) {
+      if (operator == sc.TokenType.MINUS ||
+          operator == sc.TokenType.PERCENT ||
+          operator == sc.TokenType.PLUS ||
+          operator == sc.TokenType.STAR) {
         DartType doubleType = _typeProvider.doubleType;
         if (_getStaticType(node.rightOperand) == doubleType) {
           return doubleType;
         }
       }
       // int op int
-      if (operator == sc.TokenType.MINUS || operator == sc.TokenType.PERCENT || operator == sc.TokenType.PLUS || operator == sc.TokenType.STAR || operator == sc.TokenType.TILDE_SLASH) {
+      if (operator == sc.TokenType.MINUS ||
+          operator == sc.TokenType.PERCENT ||
+          operator == sc.TokenType.PLUS ||
+          operator == sc.TokenType.STAR ||
+          operator == sc.TokenType.TILDE_SLASH) {
         if (_getStaticType(node.rightOperand) == intType) {
           staticType = intType;
         }
@@ -1721,7 +1750,101 @@
     return staticType;
   }
 
-  get thisType_J2DAccessor => _thisType;
+  /**
+   * Create a table mapping HTML tag names to the names of the classes (in 'dart:html') that
+   * implement those tags.
+   *
+   * @return the table that was created
+   */
+  static HashMap<String, String> _createHtmlTagToClassMap() {
+    HashMap<String, String> map = new HashMap<String, String>();
+    map["a"] = "AnchorElement";
+    map["area"] = "AreaElement";
+    map["br"] = "BRElement";
+    map["base"] = "BaseElement";
+    map["body"] = "BodyElement";
+    map["button"] = "ButtonElement";
+    map["canvas"] = "CanvasElement";
+    map["content"] = "ContentElement";
+    map["dl"] = "DListElement";
+    map["datalist"] = "DataListElement";
+    map["details"] = "DetailsElement";
+    map["div"] = "DivElement";
+    map["embed"] = "EmbedElement";
+    map["fieldset"] = "FieldSetElement";
+    map["form"] = "FormElement";
+    map["hr"] = "HRElement";
+    map["head"] = "HeadElement";
+    map["h1"] = "HeadingElement";
+    map["h2"] = "HeadingElement";
+    map["h3"] = "HeadingElement";
+    map["h4"] = "HeadingElement";
+    map["h5"] = "HeadingElement";
+    map["h6"] = "HeadingElement";
+    map["html"] = "HtmlElement";
+    map["iframe"] = "IFrameElement";
+    map["img"] = "ImageElement";
+    map["input"] = "InputElement";
+    map["keygen"] = "KeygenElement";
+    map["li"] = "LIElement";
+    map["label"] = "LabelElement";
+    map["legend"] = "LegendElement";
+    map["link"] = "LinkElement";
+    map["map"] = "MapElement";
+    map["menu"] = "MenuElement";
+    map["meter"] = "MeterElement";
+    map["ol"] = "OListElement";
+    map["object"] = "ObjectElement";
+    map["optgroup"] = "OptGroupElement";
+    map["output"] = "OutputElement";
+    map["p"] = "ParagraphElement";
+    map["param"] = "ParamElement";
+    map["pre"] = "PreElement";
+    map["progress"] = "ProgressElement";
+    map["script"] = "ScriptElement";
+    map["select"] = "SelectElement";
+    map["source"] = "SourceElement";
+    map["span"] = "SpanElement";
+    map["style"] = "StyleElement";
+    map["caption"] = "TableCaptionElement";
+    map["td"] = "TableCellElement";
+    map["col"] = "TableColElement";
+    map["table"] = "TableElement";
+    map["tr"] = "TableRowElement";
+    map["textarea"] = "TextAreaElement";
+    map["title"] = "TitleElement";
+    map["track"] = "TrackElement";
+    map["ul"] = "UListElement";
+    map["video"] = "VideoElement";
+    return map;
+  }
+}
 
-  set thisType_J2DAccessor(__v) => _thisType = __v;
+class _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction extends
+    GeneralizingAstVisitor<Object> {
+  DartType result = null;
+
+  _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction();
+
+  @override
+  Object visitExpression(Expression node) => null;
+
+  @override
+  Object visitReturnStatement(ReturnStatement node) {
+    // prepare this 'return' type
+    DartType type;
+    Expression expression = node.expression;
+    if (expression != null) {
+      type = expression.bestType;
+    } else {
+      type = BottomTypeImpl.instance;
+    }
+    // merge types
+    if (result == null) {
+      result = type;
+    } else {
+      result = result.getLeastUpperBound(type);
+    }
+    return null;
+  }
 }
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
index d761f82..bc010ee 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
@@ -7,11 +7,11 @@
 
 library engine.testing.ast_factory;
 
-import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
 
 /**
  * The class `AstFactory` defines utility methods that can be used to create AST nodes. The
@@ -26,100 +26,185 @@
  * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'integerLiteral'.
  */
 class AstFactory {
-  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new AdjacentStrings(strings);
+  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
+      new AdjacentStrings(strings);
 
-  static Annotation annotation(Identifier name) => new Annotation(TokenFactory.tokenFromType(TokenType.AT), name, null, null, null);
+  static Annotation annotation(Identifier name) =>
+      new Annotation(
+          TokenFactory.tokenFromType(TokenType.AT),
+          name,
+          null,
+          null,
+          null);
 
-  static Annotation annotation2(Identifier name, SimpleIdentifier constructorName, ArgumentList arguments) => new Annotation(TokenFactory.tokenFromType(TokenType.AT), name, TokenFactory.tokenFromType(TokenType.PERIOD), constructorName, arguments);
+  static Annotation annotation2(Identifier name,
+      SimpleIdentifier constructorName, ArgumentList arguments) =>
+      new Annotation(
+          TokenFactory.tokenFromType(TokenType.AT),
+          name,
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          constructorName,
+          arguments);
 
-  static ArgumentList argumentList([List<Expression> arguments])
-      => new ArgumentList(
+  static ArgumentList argumentList([List<Expression> arguments]) =>
+      new ArgumentList(
           TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
           arguments,
           TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
 
-  static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
+  static AsExpression asExpression(Expression expression, TypeName type) =>
+      new AsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
 
-  static AssertStatement assertStatement(Expression condition) => new AssertStatement(TokenFactory.tokenFromKeyword(Keyword.ASSERT), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static AssertStatement assertStatement(Expression condition) =>
+      new AssertStatement(
+          TokenFactory.tokenFromKeyword(Keyword.ASSERT),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static AssignmentExpression assignmentExpression(Expression leftHandSide, TokenType operator, Expression rightHandSide) => new AssignmentExpression(leftHandSide, TokenFactory.tokenFromType(operator), rightHandSide);
+  static AssignmentExpression assignmentExpression(Expression leftHandSide,
+      TokenType operator, Expression rightHandSide) =>
+      new AssignmentExpression(
+          leftHandSide,
+          TokenFactory.tokenFromType(operator),
+          rightHandSide);
 
-  static BlockFunctionBody asyncBlockFunctionBody([List<Statement> statements])
-     => new BlockFunctionBody(
-         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
-         null,
-         block(statements));
+  static BlockFunctionBody
+      asyncBlockFunctionBody([List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          null,
+          block(statements));
 
-  static ExpressionFunctionBody asyncExpressionFunctionBody(Expression expression) => new ExpressionFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"), TokenFactory.tokenFromType(TokenType.FUNCTION), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ExpressionFunctionBody
+      asyncExpressionFunctionBody(Expression expression) =>
+      new ExpressionFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          TokenFactory.tokenFromType(TokenType.FUNCTION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static BlockFunctionBody asyncGeneratorBlockFunctionBody([List<Statement> statements])
-     => new BlockFunctionBody(
-         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+  static BlockFunctionBody
+      asyncGeneratorBlockFunctionBody([List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
           TokenFactory.tokenFromType(TokenType.STAR),
           block(statements));
 
-  static AwaitExpression awaitExpression(Expression expression) => new AwaitExpression(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"), expression);
+  static AwaitExpression awaitExpression(Expression expression) =>
+      new AwaitExpression(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"),
+          expression);
 
-  static BinaryExpression binaryExpression(Expression leftOperand, TokenType operator, Expression rightOperand) => new BinaryExpression(leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
+  static BinaryExpression binaryExpression(Expression leftOperand,
+      TokenType operator, Expression rightOperand) =>
+      new BinaryExpression(
+          leftOperand,
+          TokenFactory.tokenFromType(operator),
+          rightOperand);
 
-  static Block block([List<Statement> statements])
-      => new Block(
+  static Block block([List<Statement> statements]) =>
+      new Block(
           TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
           statements,
           TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static BlockFunctionBody blockFunctionBody(Block block)
-      => new BlockFunctionBody(null, null, block);
+  static BlockFunctionBody blockFunctionBody(Block block) =>
+      new BlockFunctionBody(null, null, block);
 
-  static BlockFunctionBody blockFunctionBody2([List<Statement> statements])
-      => new BlockFunctionBody(null, null, block(statements));
+  static BlockFunctionBody blockFunctionBody2([List<Statement> statements]) =>
+      new BlockFunctionBody(null, null, block(statements));
 
-  static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral(value ? TokenFactory.tokenFromKeyword(Keyword.TRUE) : TokenFactory.tokenFromKeyword(Keyword.FALSE), value);
+  static BooleanLiteral booleanLiteral(bool value) =>
+      new BooleanLiteral(
+          value ?
+              TokenFactory.tokenFromKeyword(Keyword.TRUE) :
+              TokenFactory.tokenFromKeyword(Keyword.FALSE),
+          value);
 
-  static BreakStatement breakStatement() => new BreakStatement(TokenFactory.tokenFromKeyword(Keyword.BREAK), null, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static BreakStatement breakStatement() =>
+      new BreakStatement(
+          TokenFactory.tokenFromKeyword(Keyword.BREAK),
+          null,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static BreakStatement breakStatement2(String label) => new BreakStatement(TokenFactory.tokenFromKeyword(Keyword.BREAK), identifier3(label), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static BreakStatement breakStatement2(String label) =>
+      new BreakStatement(
+          TokenFactory.tokenFromKeyword(Keyword.BREAK),
+          identifier3(label),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static IndexExpression cascadedIndexExpression(Expression index) => new IndexExpression.forCascade(TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+  static IndexExpression cascadedIndexExpression(Expression index) =>
+      new IndexExpression.forCascade(
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          index,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static MethodInvocation cascadedMethodInvocation(String methodName, [List<Expression> arguments])
-      => new MethodInvocation(
+  static MethodInvocation cascadedMethodInvocation(String methodName,
+      [List<Expression> arguments]) =>
+      new MethodInvocation(
           null,
           TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
           identifier3(methodName),
           argumentList(arguments));
 
-  static PropertyAccess cascadedPropertyAccess(String propertyName) => new PropertyAccess(null, TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), identifier3(propertyName));
+  static PropertyAccess cascadedPropertyAccess(String propertyName) =>
+      new PropertyAccess(
+          null,
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          identifier3(propertyName));
 
-  static CascadeExpression cascadeExpression(Expression target, [List<Expression> cascadeSections])
-      => new CascadeExpression(target, cascadeSections);
+  static CascadeExpression cascadeExpression(Expression target,
+      [List<Expression> cascadeSections]) =>
+      new CascadeExpression(target, cascadeSections);
 
-  static CatchClause catchClause(String exceptionParameter, [List<Statement> statements])
-      => catchClause5(null, exceptionParameter, null, statements);
+  static CatchClause catchClause(String exceptionParameter,
+      [List<Statement> statements]) =>
+      catchClause5(null, exceptionParameter, null, statements);
 
-  static CatchClause catchClause2(String exceptionParameter, String stackTraceParameter, [List<Statement> statements])
-      => catchClause5(null, exceptionParameter, stackTraceParameter, statements);
+  static CatchClause catchClause2(String exceptionParameter,
+      String stackTraceParameter, [List<Statement> statements]) =>
+      catchClause5(null, exceptionParameter, stackTraceParameter, statements);
 
-  static CatchClause catchClause3(TypeName exceptionType, [List<Statement> statements])
-      => catchClause5(exceptionType, null, null, statements);
+  static CatchClause catchClause3(TypeName exceptionType,
+      [List<Statement> statements]) =>
+      catchClause5(exceptionType, null, null, statements);
 
-  static CatchClause catchClause4(TypeName exceptionType, String exceptionParameter, [List<Statement> statements])
-      => catchClause5(exceptionType, exceptionParameter, null, statements);
+  static CatchClause catchClause4(TypeName exceptionType,
+      String exceptionParameter, [List<Statement> statements]) =>
+      catchClause5(exceptionType, exceptionParameter, null, statements);
 
-  static CatchClause catchClause5(TypeName exceptionType, String exceptionParameter, String stackTraceParameter, [List<Statement> statements])
-      => new CatchClause(
-          exceptionType == null ? null : TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"),
+  static CatchClause catchClause5(TypeName exceptionType,
+      String exceptionParameter, String stackTraceParameter,
+      [List<Statement> statements]) =>
+      new CatchClause(
+          exceptionType == null ?
+              null :
+              TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"),
           exceptionType,
-          exceptionParameter == null ? null : TokenFactory.tokenFromKeyword(Keyword.CATCH),
-          exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          exceptionParameter == null ?
+              null :
+              TokenFactory.tokenFromKeyword(Keyword.CATCH),
+          exceptionParameter == null ?
+              null :
+              TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
           exceptionParameter == null ? null : identifier3(exceptionParameter),
-          stackTraceParameter == null ? null : TokenFactory.tokenFromType(TokenType.COMMA),
+          stackTraceParameter == null ?
+              null :
+              TokenFactory.tokenFromType(TokenType.COMMA),
           stackTraceParameter == null ? null : identifier3(stackTraceParameter),
-          exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          exceptionParameter == null ?
+              null :
+              TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
           block(statements));
 
-  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, [List<ClassMember> members])
-      => new ClassDeclaration(
+  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name,
+      TypeParameterList typeParameters, ExtendsClause extendsClause,
+      WithClause withClause, ImplementsClause implementsClause,
+      [List<ClassMember> members]) =>
+      new ClassDeclaration(
           null,
           null,
           abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword),
@@ -133,69 +218,193 @@
           members,
           TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParameters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause) => new ClassTypeAlias(null, null, TokenFactory.tokenFromKeyword(Keyword.CLASS), identifier3(name), typeParameters, TokenFactory.tokenFromType(TokenType.EQ), abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword), superclass, withClause, implementsClause, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ClassTypeAlias classTypeAlias(String name,
+      TypeParameterList typeParameters, Keyword abstractKeyword, TypeName superclass,
+      WithClause withClause, ImplementsClause implementsClause) =>
+      new ClassTypeAlias(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.CLASS),
+          identifier3(name),
+          typeParameters,
+          TokenFactory.tokenFromType(TokenType.EQ),
+          abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword),
+          superclass,
+          withClause,
+          implementsClause,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static CompilationUnit compilationUnit() => compilationUnit8(null, null, null);
+  static CompilationUnit compilationUnit() =>
+      compilationUnit8(null, null, null);
 
-  static CompilationUnit compilationUnit2(List<CompilationUnitMember> declarations) => compilationUnit8(null, null, declarations);
+  static CompilationUnit
+      compilationUnit2(List<CompilationUnitMember> declarations) =>
+      compilationUnit8(null, null, declarations);
 
-  static CompilationUnit compilationUnit3(List<Directive> directives) => compilationUnit8(null, directives, null);
+  static CompilationUnit compilationUnit3(List<Directive> directives) =>
+      compilationUnit8(null, directives, null);
 
-  static CompilationUnit compilationUnit4(List<Directive> directives, List<CompilationUnitMember> declarations) => compilationUnit8(null, directives, declarations);
+  static CompilationUnit compilationUnit4(List<Directive> directives,
+      List<CompilationUnitMember> declarations) =>
+      compilationUnit8(null, directives, declarations);
 
-  static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8(scriptTag, null, null);
+  static CompilationUnit compilationUnit5(String scriptTag) =>
+      compilationUnit8(scriptTag, null, null);
 
-  static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnitMember> declarations) => compilationUnit8(scriptTag, null, declarations);
+  static CompilationUnit compilationUnit6(String scriptTag,
+      List<CompilationUnitMember> declarations) =>
+      compilationUnit8(scriptTag, null, declarations);
 
-  static CompilationUnit compilationUnit7(String scriptTag, List<Directive> directives) => compilationUnit8(scriptTag, directives, null);
+  static CompilationUnit compilationUnit7(String scriptTag,
+      List<Directive> directives) =>
+      compilationUnit8(scriptTag, directives, null);
 
-  static CompilationUnit compilationUnit8(String scriptTag, List<Directive> directives, List<CompilationUnitMember> declarations) => new CompilationUnit(TokenFactory.tokenFromType(TokenType.EOF), scriptTag == null ? null : AstFactory.scriptTag(scriptTag), directives == null ? new List<Directive>() : directives, declarations == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.tokenFromType(TokenType.EOF));
+  static CompilationUnit compilationUnit8(String scriptTag,
+      List<Directive> directives, List<CompilationUnitMember> declarations) =>
+      new CompilationUnit(
+          TokenFactory.tokenFromType(TokenType.EOF),
+          scriptTag == null ? null : AstFactory.scriptTag(scriptTag),
+          directives == null ? new List<Directive>() : directives,
+          declarations == null ? new List<CompilationUnitMember>() : declarations,
+          TokenFactory.tokenFromType(TokenType.EOF));
 
-  static ConditionalExpression conditionalExpression(Expression condition, Expression thenExpression, Expression elseExpression) => new ConditionalExpression(condition, TokenFactory.tokenFromType(TokenType.QUESTION), thenExpression, TokenFactory.tokenFromType(TokenType.COLON), elseExpression);
+  static ConditionalExpression conditionalExpression(Expression condition,
+      Expression thenExpression, Expression elseExpression) =>
+      new ConditionalExpression(
+          condition,
+          TokenFactory.tokenFromType(TokenType.QUESTION),
+          thenExpression,
+          TokenFactory.tokenFromType(TokenType.COLON),
+          elseExpression);
 
-  static ConstructorDeclaration constructorDeclaration(Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers) => new ConstructorDeclaration(null, null, TokenFactory.tokenFromKeyword(Keyword.EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), name == null ? null : identifier3(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.tokenFromType(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, emptyFunctionBody());
+  static ConstructorDeclaration constructorDeclaration(Identifier returnType,
+      String name, FormalParameterList parameters,
+      List<ConstructorInitializer> initializers) =>
+      new ConstructorDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
+          null,
+          null,
+          returnType,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          parameters,
+          initializers == null || initializers.isEmpty ?
+              null :
+              TokenFactory.tokenFromType(TokenType.PERIOD),
+          initializers == null ? new List<ConstructorInitializer>() : initializers,
+          null,
+          emptyFunctionBody());
 
-  static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Keyword factoryKeyword, Identifier returnType, String name, FormalParameterList parameters, List<ConstructorInitializer> initializers, FunctionBody body) => new ConstructorDeclaration(null, null, null, constKeyword == null ? null : TokenFactory.tokenFromKeyword(constKeyword), factoryKeyword == null ? null : TokenFactory.tokenFromKeyword(factoryKeyword), returnType, name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), name == null ? null : identifier3(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.tokenFromType(TokenType.PERIOD), initializers == null ? new List<ConstructorInitializer>() : initializers, null, body);
+  static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword,
+      Keyword factoryKeyword, Identifier returnType, String name,
+      FormalParameterList parameters, List<ConstructorInitializer> initializers,
+      FunctionBody body) =>
+      new ConstructorDeclaration(
+          null,
+          null,
+          null,
+          constKeyword == null ? null : TokenFactory.tokenFromKeyword(constKeyword),
+          factoryKeyword == null ? null : TokenFactory.tokenFromKeyword(factoryKeyword),
+          returnType,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          parameters,
+          initializers == null || initializers.isEmpty ?
+              null :
+              TokenFactory.tokenFromType(TokenType.PERIOD),
+          initializers == null ? new List<ConstructorInitializer>() : initializers,
+          null,
+          body);
 
-  static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWithThis, String fieldName, Expression expression) => new ConstructorFieldInitializer(prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null, prefixedWithThis ? TokenFactory.tokenFromType(TokenType.PERIOD) : null, identifier3(fieldName), TokenFactory.tokenFromType(TokenType.EQ), expression);
+  static ConstructorFieldInitializer
+      constructorFieldInitializer(bool prefixedWithThis, String fieldName,
+      Expression expression) =>
+      new ConstructorFieldInitializer(
+          prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null,
+          prefixedWithThis ? TokenFactory.tokenFromType(TokenType.PERIOD) : null,
+          identifier3(fieldName),
+          TokenFactory.tokenFromType(TokenType.EQ),
+          expression);
 
-  static ConstructorName constructorName(TypeName type, String name) => new ConstructorName(type, name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), name == null ? null : identifier3(name));
+  static ConstructorName constructorName(TypeName type, String name) =>
+      new ConstructorName(
+          type,
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name));
 
-  static ContinueStatement continueStatement([String label])
-      => new ContinueStatement(
+  static ContinueStatement continueStatement([String label]) =>
+      new ContinueStatement(
           TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
           label == null ? null : identifier3(label),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifier) => declaredIdentifier2(keyword, null, identifier);
+  static DeclaredIdentifier declaredIdentifier(Keyword keyword,
+      String identifier) =>
+      declaredIdentifier2(keyword, null, identifier);
 
-  static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, identifier3(identifier));
+  static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type,
+      String identifier) =>
+      new DeclaredIdentifier(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          identifier3(identifier));
 
-  static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredIdentifier2(null, null, identifier);
+  static DeclaredIdentifier declaredIdentifier3(String identifier) =>
+      declaredIdentifier2(null, null, identifier);
 
-  static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier) => declaredIdentifier2(null, type, identifier);
+  static DeclaredIdentifier declaredIdentifier4(TypeName type,
+      String identifier) =>
+      declaredIdentifier2(null, type, identifier);
 
-  static DoStatement doStatement(Statement body, Expression condition) => new DoStatement(TokenFactory.tokenFromKeyword(Keyword.DO), body, TokenFactory.tokenFromKeyword(Keyword.WHILE), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static DoStatement doStatement(Statement body, Expression condition) =>
+      new DoStatement(
+          TokenFactory.tokenFromKeyword(Keyword.DO),
+          body,
+          TokenFactory.tokenFromKeyword(Keyword.WHILE),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral(TokenFactory.tokenFromString(value.toString()), value);
+  static DoubleLiteral doubleLiteral(double value) =>
+      new DoubleLiteral(TokenFactory.tokenFromString(value.toString()), value);
 
-  static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody(TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static EmptyFunctionBody emptyFunctionBody() =>
+      new EmptyFunctionBody(TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static EmptyStatement emptyStatement() => new EmptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static EmptyStatement emptyStatement() =>
+      new EmptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static EnumDeclaration enumDeclaration(SimpleIdentifier name, List<EnumConstantDeclaration> constants) => new EnumDeclaration(null, null, TokenFactory.tokenFromKeyword(Keyword.ENUM), name, TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), constants, TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static EnumDeclaration enumDeclaration(SimpleIdentifier name,
+      List<EnumConstantDeclaration> constants) =>
+      new EnumDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.ENUM),
+          name,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          constants,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static EnumDeclaration enumDeclaration2(String name, List<String> constantNames) {
+  static EnumDeclaration enumDeclaration2(String name,
+      List<String> constantNames) {
     int count = constantNames.length;
-    List<EnumConstantDeclaration> constants = new List<EnumConstantDeclaration>(count);
+    List<EnumConstantDeclaration> constants =
+        new List<EnumConstantDeclaration>(count);
     for (int i = 0; i < count; i++) {
-      constants[i] = new EnumConstantDeclaration(null, null, identifier3(constantNames[i]));
+      constants[i] =
+          new EnumConstantDeclaration(null, null, identifier3(constantNames[i]));
     }
     return enumDeclaration(identifier3(name), constants);
   }
 
-  static ExportDirective exportDirective(List<Annotation> metadata, String uri, [List<Combinator> combinators])
-      => new ExportDirective(
+  static ExportDirective exportDirective(List<Annotation> metadata, String uri,
+      [List<Combinator> combinators]) =>
+      new ExportDirective(
           null,
           metadata,
           TokenFactory.tokenFromKeyword(Keyword.EXPORT),
@@ -203,88 +412,214 @@
           combinators,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ExportDirective exportDirective2(String uri, [List<Combinator> combinators])
-      => exportDirective(null, uri, combinators);
+  static ExportDirective exportDirective2(String uri,
+      [List<Combinator> combinators]) =>
+      exportDirective(null, uri, combinators);
 
-  static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody(null, TokenFactory.tokenFromType(TokenType.FUNCTION), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
+      new ExpressionFunctionBody(
+          null,
+          TokenFactory.tokenFromType(TokenType.FUNCTION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ExpressionStatement expressionStatement(Expression expression) => new ExpressionStatement(expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ExpressionStatement expressionStatement(Expression expression) =>
+      new ExpressionStatement(
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ExtendsClause extendsClause(TypeName type) => new ExtendsClause(TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
+  static ExtendsClause extendsClause(TypeName type) =>
+      new ExtendsClause(TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
 
-  static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new FieldDeclaration(null, null, isStatic ? TokenFactory.tokenFromKeyword(Keyword.STATIC) : null, variableDeclarationList(keyword, type, variables), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword,
+      TypeName type, List<VariableDeclaration> variables) =>
+      new FieldDeclaration(
+          null,
+          null,
+          isStatic ? TokenFactory.tokenFromKeyword(Keyword.STATIC) : null,
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List<VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, variables);
+  static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword,
+      List<VariableDeclaration> variables) =>
+      fieldDeclaration(isStatic, keyword, null, variables);
 
-  static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName type, String identifier, [FormalParameterList parameterList]) => new FieldFormalParameter(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, TokenFactory.tokenFromKeyword(Keyword.THIS), TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(identifier), parameterList);
+  static FieldFormalParameter fieldFormalParameter(Keyword keyword,
+      TypeName type, String identifier, [FormalParameterList parameterList]) =>
+      new FieldFormalParameter(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          TokenFactory.tokenFromKeyword(Keyword.THIS),
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(identifier),
+          parameterList);
 
-  static FieldFormalParameter fieldFormalParameter2(String identifier) => fieldFormalParameter(null, null, identifier);
+  static FieldFormalParameter fieldFormalParameter2(String identifier) =>
+      fieldFormalParameter(null, null, identifier);
 
-  static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expression iterator, Statement body) => new ForEachStatement.con1(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), loopVariable, TokenFactory.tokenFromKeyword(Keyword.IN), iterator, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
+  static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable,
+      Expression iterator, Statement body) =>
+      new ForEachStatement.con1(
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          loopVariable,
+          TokenFactory.tokenFromKeyword(Keyword.IN),
+          iterator,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
 
-  static ForEachStatement forEachStatement2(SimpleIdentifier identifier, Expression iterator, Statement body) => new ForEachStatement.con2(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), identifier, TokenFactory.tokenFromKeyword(Keyword.IN), iterator, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
+  static ForEachStatement forEachStatement2(SimpleIdentifier identifier,
+      Expression iterator, Statement body) =>
+      new ForEachStatement.con2(
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          identifier,
+          TokenFactory.tokenFromKeyword(Keyword.IN),
+          iterator,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
 
-  static FormalParameterList formalParameterList([List<FormalParameter> parameters])
-      => new FormalParameterList(
+  static FormalParameterList
+      formalParameterList([List<FormalParameter> parameters]) =>
+      new FormalParameterList(
           TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
           parameters,
           null,
           null,
           TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
 
-  static ForStatement forStatement(Expression initialization, Expression condition, List<Expression> updaters, Statement body) => new ForStatement(TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), null, initialization, TokenFactory.tokenFromType(TokenType.SEMICOLON), condition, TokenFactory.tokenFromType(TokenType.SEMICOLON), updaters, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
+  static ForStatement forStatement(Expression initialization,
+      Expression condition, List<Expression> updaters, Statement body) =>
+      new ForStatement(
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          null,
+          initialization,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          condition,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          updaters,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
 
-  static ForStatement forStatement2(VariableDeclarationList variableList, Expression condition, List<Expression> updaters, Statement body) => new ForStatement(TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), variableList, null, TokenFactory.tokenFromType(TokenType.SEMICOLON), condition, TokenFactory.tokenFromType(TokenType.SEMICOLON), updaters, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
+  static ForStatement forStatement2(VariableDeclarationList variableList,
+      Expression condition, List<Expression> updaters, Statement body) =>
+      new ForStatement(
+          TokenFactory.tokenFromKeyword(Keyword.FOR),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          variableList,
+          null,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          condition,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON),
+          updaters,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
 
-  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration(null, null, null, type, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), identifier3(name), functionExpression);
+  static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword,
+      String name, FunctionExpression functionExpression) =>
+      new FunctionDeclaration(
+          null,
+          null,
+          null,
+          type,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          identifier3(name),
+          functionExpression);
 
-  static FunctionDeclarationStatement functionDeclarationStatement(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclarationStatement(functionDeclaration(type, keyword, name, functionExpression));
+  static FunctionDeclarationStatement
+      functionDeclarationStatement(TypeName type, Keyword keyword, String name,
+      FunctionExpression functionExpression) =>
+      new FunctionDeclarationStatement(
+          functionDeclaration(type, keyword, name, functionExpression));
 
-  static FunctionExpression functionExpression() => new FunctionExpression(formalParameterList(), blockFunctionBody2());
+  static FunctionExpression functionExpression() =>
+      new FunctionExpression(formalParameterList(), blockFunctionBody2());
 
-  static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression(parameters, body);
+  static FunctionExpression functionExpression2(FormalParameterList parameters,
+      FunctionBody body) =>
+      new FunctionExpression(parameters, body);
 
-  static FunctionExpressionInvocation functionExpressionInvocation(Expression function, [List<Expression> arguments])
-      => new FunctionExpressionInvocation(function, argumentList(arguments));
+  static FunctionExpressionInvocation
+      functionExpressionInvocation(Expression function,
+      [List<Expression> arguments]) =>
+      new FunctionExpressionInvocation(function, argumentList(arguments));
 
-  static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName returnType, String identifier, [List<FormalParameter> parameters])
-      => new FunctionTypedFormalParameter(
+  static FunctionTypedFormalParameter
+      functionTypedFormalParameter(TypeName returnType, String identifier,
+      [List<FormalParameter> parameters]) =>
+      new FunctionTypedFormalParameter(
           null,
           null,
           returnType,
           identifier3(identifier),
           formalParameterList(parameters));
 
-  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers);
+  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) =>
+      new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers);
 
-  static HideCombinator hideCombinator2(List<String> identifiers)
-      => new HideCombinator(
+  static HideCombinator hideCombinator2(List<String> identifiers) =>
+      new HideCombinator(
           TokenFactory.tokenFromString("hide"),
           identifierList(identifiers));
 
-  static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier) => new PrefixedIdentifier(prefix, TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
+  static PrefixedIdentifier identifier(SimpleIdentifier prefix,
+      SimpleIdentifier identifier) =>
+      new PrefixedIdentifier(
+          prefix,
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier);
 
-  static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
+  static SimpleIdentifier identifier3(String lexeme) =>
+      new SimpleIdentifier(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
 
-  static PrefixedIdentifier identifier4(String prefix, SimpleIdentifier identifier) => new PrefixedIdentifier(identifier3(prefix), TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
+  static PrefixedIdentifier identifier4(String prefix,
+      SimpleIdentifier identifier) =>
+      new PrefixedIdentifier(
+          identifier3(prefix),
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier);
 
-  static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier(identifier3(prefix), TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(identifier));
+  static PrefixedIdentifier identifier5(String prefix, String identifier) =>
+      new PrefixedIdentifier(
+          identifier3(prefix),
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(identifier));
 
   static List<SimpleIdentifier> identifierList(List<String> identifiers) {
     if (identifiers == null) {
       return null;
     }
-    return identifiers.map((String identifier) => identifier3(identifier)).toList();
+    return identifiers.map(
+        (String identifier) => identifier3(identifier)).toList();
   }
 
-  static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null);
+  static IfStatement ifStatement(Expression condition,
+      Statement thenStatement) =>
+      ifStatement2(condition, thenStatement, null);
 
-  static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement(TokenFactory.tokenFromKeyword(Keyword.IF), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.tokenFromKeyword(Keyword.ELSE), elseStatement);
+  static IfStatement ifStatement2(Expression condition, Statement thenStatement,
+      Statement elseStatement) =>
+      new IfStatement(
+          TokenFactory.tokenFromKeyword(Keyword.IF),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          thenStatement,
+          elseStatement == null ? null : TokenFactory.tokenFromKeyword(Keyword.ELSE),
+          elseStatement);
 
-  static ImplementsClause implementsClause(List<TypeName> types) => new ImplementsClause(TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
+  static ImplementsClause implementsClause(List<TypeName> types) =>
+      new ImplementsClause(TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
 
-  static ImportDirective importDirective(List<Annotation> metadata, String uri, bool isDeferred, String prefix, [List<Combinator> combinators])
-      => new ImportDirective(
+  static ImportDirective importDirective(List<Annotation> metadata, String uri,
+      bool isDeferred, String prefix, [List<Combinator> combinators]) =>
+      new ImportDirective(
           null,
           metadata,
           TokenFactory.tokenFromKeyword(Keyword.IMPORT),
@@ -295,25 +630,35 @@
           combinators,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ImportDirective importDirective2(String uri, bool isDeferred, String prefix, [List<Combinator> combinators])
-      => importDirective(null, uri, isDeferred, prefix, combinators);
+  static ImportDirective importDirective2(String uri, bool isDeferred,
+      String prefix, [List<Combinator> combinators]) =>
+      importDirective(null, uri, isDeferred, prefix, combinators);
 
-  static ImportDirective importDirective3(String uri, String prefix, [List<Combinator> combinators])
-      => importDirective(null, uri, false, prefix, combinators);
+  static ImportDirective importDirective3(String uri, String prefix,
+      [List<Combinator> combinators]) =>
+      importDirective(null, uri, false, prefix, combinators);
 
-  static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget(array, TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+  static IndexExpression indexExpression(Expression array, Expression index) =>
+      new IndexExpression.forTarget(
+          array,
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          index,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, [List<Expression> arguments])
-      => new InstanceCreationExpression(
+  static InstanceCreationExpression instanceCreationExpression(Keyword keyword,
+      ConstructorName name, [List<Expression> arguments]) =>
+      new InstanceCreationExpression(
           keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
           name,
           argumentList(arguments));
 
-  static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, [List<Expression> arguments])
-      => instanceCreationExpression3(keyword, type, null, arguments);
+  static InstanceCreationExpression instanceCreationExpression2(Keyword keyword,
+      TypeName type, [List<Expression> arguments]) =>
+      instanceCreationExpression3(keyword, type, null, arguments);
 
-  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, [List<Expression> arguments])
-      => instanceCreationExpression(
+  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword,
+      TypeName type, String identifier, [List<Expression> arguments]) =>
+      instanceCreationExpression(
           keyword,
           new ConstructorName(
               type,
@@ -321,27 +666,60 @@
               identifier == null ? null : identifier3(identifier)),
           arguments);
 
-  static IntegerLiteral integer(int value) => new IntegerLiteral(TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()), value);
+  static IntegerLiteral integer(int value) =>
+      new IntegerLiteral(
+          TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()),
+          value);
 
-  static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression(TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_EXPRESSION), expression, TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static InterpolationExpression
+      interpolationExpression(Expression expression) =>
+      new InterpolationExpression(
+          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_EXPRESSION),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression(TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_IDENTIFIER), identifier3(identifier), null);
+  static InterpolationExpression interpolationExpression2(String identifier) =>
+      new InterpolationExpression(
+          TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_IDENTIFIER),
+          identifier3(identifier),
+          null);
 
-  static InterpolationString interpolationString(String contents, String value) => new InterpolationString(TokenFactory.tokenFromString(contents), value);
+  static InterpolationString interpolationString(String contents,
+      String value) =>
+      new InterpolationString(TokenFactory.tokenFromString(contents), value);
 
-  static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.IS), negated ? TokenFactory.tokenFromType(TokenType.BANG) : null, type);
+  static IsExpression isExpression(Expression expression, bool negated,
+      TypeName type) =>
+      new IsExpression(
+          expression,
+          TokenFactory.tokenFromKeyword(Keyword.IS),
+          negated ? TokenFactory.tokenFromType(TokenType.BANG) : null,
+          type);
 
-  static Label label(SimpleIdentifier label) => new Label(label, TokenFactory.tokenFromType(TokenType.COLON));
+  static Label label(SimpleIdentifier label) =>
+      new Label(label, TokenFactory.tokenFromType(TokenType.COLON));
 
   static Label label2(String label) => AstFactory.label(identifier3(label));
 
-  static LabeledStatement labeledStatement(List<Label> labels, Statement statement) => new LabeledStatement(labels, statement);
+  static LabeledStatement labeledStatement(List<Label> labels,
+      Statement statement) =>
+      new LabeledStatement(labels, statement);
 
-  static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIdentifier libraryName) => new LibraryDirective(null, metadata, TokenFactory.tokenFromKeyword(Keyword.LIBRARY), libraryName, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static LibraryDirective libraryDirective(List<Annotation> metadata,
+      LibraryIdentifier libraryName) =>
+      new LibraryDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.LIBRARY),
+          libraryName,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static LibraryDirective libraryDirective2(String libraryName) => libraryDirective(new List<Annotation>(), libraryIdentifier2([libraryName]));
+  static LibraryDirective libraryDirective2(String libraryName) =>
+      libraryDirective(new List<Annotation>(), libraryIdentifier2([libraryName]));
 
-  static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier(components);
+  static LibraryIdentifier
+      libraryIdentifier(List<SimpleIdentifier> components) =>
+      new LibraryIdentifier(components);
 
   static LibraryIdentifier libraryIdentifier2(List<String> components) {
     return new LibraryIdentifier(identifierList(components));
@@ -351,173 +729,356 @@
     return elements;
   }
 
-  static ListLiteral listLiteral([List<Expression> elements])
-      => listLiteral2(null, null, elements);
+  static ListLiteral listLiteral([List<Expression> elements]) =>
+      listLiteral2(null, null, elements);
 
-  static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArguments, [List<Expression> elements])
-      => new ListLiteral(
+  static ListLiteral listLiteral2(Keyword keyword,
+      TypeArgumentList typeArguments, [List<Expression> elements]) =>
+      new ListLiteral(
           keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
           typeArguments,
           TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
           elements,
           TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, [List<MapLiteralEntry> entries])
-      => new MapLiteral(
+  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments,
+      [List<MapLiteralEntry> entries]) =>
+      new MapLiteral(
           keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
           typeArguments,
           TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
           entries,
           TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static MapLiteral mapLiteral2([List<MapLiteralEntry> entries])
-      => mapLiteral(null, null, entries);
+  static MapLiteral mapLiteral2([List<MapLiteralEntry> entries]) =>
+      mapLiteral(null, null, entries);
 
-  static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new MapLiteralEntry(string2(key), TokenFactory.tokenFromType(TokenType.COLON), value);
+  static MapLiteralEntry mapLiteralEntry(String key, Expression value) =>
+      new MapLiteralEntry(
+          string2(key),
+          TokenFactory.tokenFromType(TokenType.COLON),
+          value);
 
-  static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterList parameters) => new MethodDeclaration(null, null, TokenFactory.tokenFromKeyword(Keyword.EXTERNAL), modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), returnType, property == null ? null : TokenFactory.tokenFromKeyword(property), operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, parameters, emptyFunctionBody());
+  static MethodDeclaration methodDeclaration(Keyword modifier,
+      TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name,
+      FormalParameterList parameters) =>
+      new MethodDeclaration(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.EXTERNAL),
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
+          name,
+          parameters,
+          emptyFunctionBody());
 
-  static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) => new MethodDeclaration(null, null, null, modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), returnType, property == null ? null : TokenFactory.tokenFromKeyword(property), operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, parameters, body);
+  static MethodDeclaration methodDeclaration2(Keyword modifier,
+      TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name,
+      FormalParameterList parameters, FunctionBody body) =>
+      new MethodDeclaration(
+          null,
+          null,
+          null,
+          modifier == null ? null : TokenFactory.tokenFromKeyword(modifier),
+          returnType,
+          property == null ? null : TokenFactory.tokenFromKeyword(property),
+          operator == null ? null : TokenFactory.tokenFromKeyword(operator),
+          name,
+          parameters,
+          body);
 
-  static MethodInvocation methodInvocation(Expression target, String methodName, [List<Expression> arguments])
-      => new MethodInvocation(
+  static MethodInvocation methodInvocation(Expression target, String methodName,
+      [List<Expression> arguments]) =>
+      new MethodInvocation(
           target,
           target == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
           identifier3(methodName),
           argumentList(arguments));
 
-  static MethodInvocation methodInvocation2(String methodName, [List<Expression> arguments])
-      => methodInvocation(null, methodName, arguments);
+  static MethodInvocation methodInvocation2(String methodName,
+      [List<Expression> arguments]) =>
+      methodInvocation(null, methodName, arguments);
 
-  static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression(label, expression);
+  static NamedExpression namedExpression(Label label, Expression expression) =>
+      new NamedExpression(label, expression);
 
-  static NamedExpression namedExpression2(String label, Expression expression) => namedExpression(label2(label), expression);
+  static NamedExpression namedExpression2(String label,
+      Expression expression) =>
+      namedExpression(label2(label), expression);
 
-  static DefaultFormalParameter namedFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter(parameter, ParameterKind.NAMED, expression == null ? null : TokenFactory.tokenFromType(TokenType.COLON), expression);
+  static DefaultFormalParameter
+      namedFormalParameter(NormalFormalParameter parameter, Expression expression) =>
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.NAMED,
+          expression == null ? null : TokenFactory.tokenFromType(TokenType.COLON),
+          expression);
 
-  static NativeClause nativeClause(String nativeCode) => new NativeClause(TokenFactory.tokenFromString("native"), string2(nativeCode));
+  static NativeClause nativeClause(String nativeCode) =>
+      new NativeClause(TokenFactory.tokenFromString("native"), string2(nativeCode));
 
-  static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new NativeFunctionBody(TokenFactory.tokenFromString("native"), string2(nativeMethodName), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static NativeFunctionBody nativeFunctionBody(String nativeMethodName) =>
+      new NativeFunctionBody(
+          TokenFactory.tokenFromString("native"),
+          string2(nativeMethodName),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static NullLiteral nullLiteral() => new NullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
+  static NullLiteral nullLiteral() =>
+      new NullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
 
-  static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression(TokenFactory.tokenFromType(TokenType.OPEN_PAREN), expression, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+  static ParenthesizedExpression
+      parenthesizedExpression(Expression expression) =>
+      new ParenthesizedExpression(
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
 
-  static PartDirective partDirective(List<Annotation> metadata, String url) => new PartDirective(null, metadata, TokenFactory.tokenFromKeyword(Keyword.PART), string2(url), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static PartDirective partDirective(List<Annotation> metadata, String url) =>
+      new PartDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.PART),
+          string2(url),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static PartDirective partDirective2(String url) => partDirective(new List<Annotation>(), url);
+  static PartDirective partDirective2(String url) =>
+      partDirective(new List<Annotation>(), url);
 
-  static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partOfDirective2(new List<Annotation>(), libraryName);
+  static PartOfDirective partOfDirective(LibraryIdentifier libraryName) =>
+      partOfDirective2(new List<Annotation>(), libraryName);
 
-  static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIdentifier libraryName) => new PartOfDirective(null, metadata, TokenFactory.tokenFromKeyword(Keyword.PART), TokenFactory.tokenFromString("of"), libraryName, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static PartOfDirective partOfDirective2(List<Annotation> metadata,
+      LibraryIdentifier libraryName) =>
+      new PartOfDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.PART),
+          TokenFactory.tokenFromString("of"),
+          libraryName,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ), expression);
+  static DefaultFormalParameter
+      positionalFormalParameter(NormalFormalParameter parameter,
+      Expression expression) =>
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.POSITIONAL,
+          expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ),
+          expression);
 
-  static PostfixExpression postfixExpression(Expression expression, TokenType operator) => new PostfixExpression(expression, TokenFactory.tokenFromType(operator));
+  static PostfixExpression postfixExpression(Expression expression,
+      TokenType operator) =>
+      new PostfixExpression(expression, TokenFactory.tokenFromType(operator));
 
-  static PrefixExpression prefixExpression(TokenType operator, Expression expression) => new PrefixExpression(TokenFactory.tokenFromType(operator), expression);
+  static PrefixExpression prefixExpression(TokenType operator,
+      Expression expression) =>
+      new PrefixExpression(TokenFactory.tokenFromType(operator), expression);
 
-  static PropertyAccess propertyAccess(Expression target, SimpleIdentifier propertyName) => new PropertyAccess(target, TokenFactory.tokenFromType(TokenType.PERIOD), propertyName);
+  static PropertyAccess propertyAccess(Expression target,
+      SimpleIdentifier propertyName) =>
+      new PropertyAccess(
+          target,
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          propertyName);
 
-  static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess(target, TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(propertyName));
+  static PropertyAccess propertyAccess2(Expression target,
+      String propertyName) =>
+      new PropertyAccess(
+          target,
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(propertyName));
 
-  static RedirectingConstructorInvocation redirectingConstructorInvocation([List<Expression> arguments])
-      => redirectingConstructorInvocation2(null, arguments);
+  static RedirectingConstructorInvocation
+      redirectingConstructorInvocation([List<Expression> arguments]) =>
+      redirectingConstructorInvocation2(null, arguments);
 
-  static RedirectingConstructorInvocation redirectingConstructorInvocation2(String constructorName, [List<Expression> arguments])
-      => new RedirectingConstructorInvocation(
+  static RedirectingConstructorInvocation
+      redirectingConstructorInvocation2(String constructorName,
+      [List<Expression> arguments]) =>
+      new RedirectingConstructorInvocation(
           TokenFactory.tokenFromKeyword(Keyword.THIS),
           constructorName == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
           constructorName == null ? null : identifier3(constructorName),
           argumentList(arguments));
 
-  static RethrowExpression rethrowExpression() => new RethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
+  static RethrowExpression rethrowExpression() =>
+      new RethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
 
   static ReturnStatement returnStatement() => returnStatement2(null);
 
-  static ReturnStatement returnStatement2(Expression expression) => new ReturnStatement(TokenFactory.tokenFromKeyword(Keyword.RETURN), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ReturnStatement returnStatement2(Expression expression) =>
+      new ReturnStatement(
+          TokenFactory.tokenFromKeyword(Keyword.RETURN),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ScriptTag scriptTag(String scriptTag) => new ScriptTag(TokenFactory.tokenFromString(scriptTag));
+  static ScriptTag scriptTag(String scriptTag) =>
+      new ScriptTag(TokenFactory.tokenFromString(scriptTag));
 
-  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => new ShowCombinator(TokenFactory.tokenFromString("show"), identifiers);
+  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) =>
+      new ShowCombinator(TokenFactory.tokenFromString("show"), identifiers);
 
-  static ShowCombinator showCombinator2(List<String> identifiers)
-      => new ShowCombinator(
+  static ShowCombinator showCombinator2(List<String> identifiers) =>
+      new ShowCombinator(
           TokenFactory.tokenFromString("show"),
           identifierList(identifiers));
 
-  static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String parameterName) => simpleFormalParameter2(keyword, null, parameterName);
+  static SimpleFormalParameter simpleFormalParameter(Keyword keyword,
+      String parameterName) =>
+      simpleFormalParameter2(keyword, null, parameterName);
 
-  static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, identifier3(parameterName));
+  static SimpleFormalParameter simpleFormalParameter2(Keyword keyword,
+      TypeName type, String parameterName) =>
+      new SimpleFormalParameter(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          identifier3(parameterName));
 
-  static SimpleFormalParameter simpleFormalParameter3(String parameterName) => simpleFormalParameter2(null, null, parameterName);
+  static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
+      simpleFormalParameter2(null, null, parameterName);
 
-  static SimpleFormalParameter simpleFormalParameter4(TypeName type, String parameterName) => simpleFormalParameter2(null, type, parameterName);
+  static SimpleFormalParameter simpleFormalParameter4(TypeName type,
+      String parameterName) =>
+      simpleFormalParameter2(null, type, parameterName);
 
-  static StringInterpolation string([List<InterpolationElement> elements])
-      => new StringInterpolation(elements);
+  static StringInterpolation string([List<InterpolationElement> elements]) =>
+      new StringInterpolation(elements);
 
-  static SimpleStringLiteral string2(String content) => new SimpleStringLiteral(TokenFactory.tokenFromString("'$content'"), content);
+  static SimpleStringLiteral string2(String content) =>
+      new SimpleStringLiteral(TokenFactory.tokenFromString("'$content'"), content);
 
-  static SuperConstructorInvocation superConstructorInvocation([List<Expression> arguments])
-      => superConstructorInvocation2(null, arguments);
+  static SuperConstructorInvocation
+      superConstructorInvocation([List<Expression> arguments]) =>
+      superConstructorInvocation2(null, arguments);
 
-  static SuperConstructorInvocation superConstructorInvocation2(String name, [List<Expression> arguments])
-      => new SuperConstructorInvocation(
+  static SuperConstructorInvocation superConstructorInvocation2(String name,
+      [List<Expression> arguments]) =>
+      new SuperConstructorInvocation(
           TokenFactory.tokenFromKeyword(Keyword.SUPER),
           name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
           name == null ? null : identifier3(name),
           argumentList(arguments));
 
-  static SuperExpression superExpression() => new SuperExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
+  static SuperExpression superExpression() =>
+      new SuperExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
 
-  static SwitchCase switchCase(Expression expression, List<Statement> statements) => switchCase2(new List<Label>(), expression, statements);
+  static SwitchCase switchCase(Expression expression,
+      List<Statement> statements) =>
+      switchCase2(new List<Label>(), expression, statements);
 
-  static SwitchCase switchCase2(List<Label> labels, Expression expression, List<Statement> statements) => new SwitchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE), expression, TokenFactory.tokenFromType(TokenType.COLON), statements);
+  static SwitchCase switchCase2(List<Label> labels, Expression expression,
+      List<Statement> statements) =>
+      new SwitchCase(
+          labels,
+          TokenFactory.tokenFromKeyword(Keyword.CASE),
+          expression,
+          TokenFactory.tokenFromType(TokenType.COLON),
+          statements);
 
-  static SwitchDefault switchDefault(List<Label> labels, List<Statement> statements) => new SwitchDefault(labels, TokenFactory.tokenFromKeyword(Keyword.DEFAULT), TokenFactory.tokenFromType(TokenType.COLON), statements);
+  static SwitchDefault switchDefault(List<Label> labels,
+      List<Statement> statements) =>
+      new SwitchDefault(
+          labels,
+          TokenFactory.tokenFromKeyword(Keyword.DEFAULT),
+          TokenFactory.tokenFromType(TokenType.COLON),
+          statements);
 
-  static SwitchDefault switchDefault2(List<Statement> statements) => switchDefault(new List<Label>(), statements);
+  static SwitchDefault switchDefault2(List<Statement> statements) =>
+      switchDefault(new List<Label>(), statements);
 
-  static SwitchStatement switchStatement(Expression expression, List<SwitchMember> members) => new SwitchStatement(TokenFactory.tokenFromKeyword(Keyword.SWITCH), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), expression, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), members, TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static SwitchStatement switchStatement(Expression expression,
+      List<SwitchMember> members) =>
+      new SwitchStatement(
+          TokenFactory.tokenFromKeyword(Keyword.SWITCH),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          expression,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          members,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
   static SymbolLiteral symbolLiteral(List<String> components) {
     List<Token> identifierList = new List<Token>();
     for (String component in components) {
-      identifierList.add(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, component));
+      identifierList.add(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, component));
     }
-    return new SymbolLiteral(TokenFactory.tokenFromType(TokenType.HASH), identifierList);
+    return new SymbolLiteral(
+        TokenFactory.tokenFromType(TokenType.HASH),
+        identifierList);
   }
 
-  static BlockFunctionBody syncBlockFunctionBody([List<Statement> statements])
-      => new BlockFunctionBody(
+  static BlockFunctionBody
+      syncBlockFunctionBody([List<Statement> statements]) =>
+      new BlockFunctionBody(
           TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
           null,
           block(statements));
 
-  static BlockFunctionBody syncGeneratorBlockFunctionBody([List<Statement> statements])
-     => new BlockFunctionBody(
-         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
+  static BlockFunctionBody
+      syncGeneratorBlockFunctionBody([List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
           TokenFactory.tokenFromType(TokenType.STAR),
           block(statements));
 
-  static ThisExpression thisExpression() => new ThisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
+  static ThisExpression thisExpression() =>
+      new ThisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
 
   static ThrowExpression throwExpression() => throwExpression2(null);
 
-  static ThrowExpression throwExpression2(Expression expression) => new ThrowExpression(TokenFactory.tokenFromKeyword(Keyword.THROW), expression);
+  static ThrowExpression throwExpression2(Expression expression) =>
+      new ThrowExpression(TokenFactory.tokenFromKeyword(Keyword.THROW), expression);
 
-  static TopLevelVariableDeclaration topLevelVariableDeclaration(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration(null, null, variableDeclarationList(keyword, type, variables), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static TopLevelVariableDeclaration
+      topLevelVariableDeclaration(Keyword keyword, TypeName type,
+      List<VariableDeclaration> variables) =>
+      new TopLevelVariableDeclaration(
+          null,
+          null,
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static TopLevelVariableDeclaration topLevelVariableDeclaration2(Keyword keyword, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration(null, null, variableDeclarationList(keyword, null, variables), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static TopLevelVariableDeclaration
+      topLevelVariableDeclaration2(Keyword keyword,
+      List<VariableDeclaration> variables) =>
+      new TopLevelVariableDeclaration(
+          null,
+          null,
+          variableDeclarationList(keyword, null, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static TryStatement tryStatement(Block body, Block finallyClause) => tryStatement3(body, new List<CatchClause>(), finallyClause);
+  static TryStatement tryStatement(Block body, Block finallyClause) =>
+      tryStatement3(body, new List<CatchClause>(), finallyClause);
 
-  static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, catchClauses, null);
+  static TryStatement tryStatement2(Block body,
+      List<CatchClause> catchClauses) =>
+      tryStatement3(body, catchClauses, null);
 
-  static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement(TokenFactory.tokenFromKeyword(Keyword.TRY), body, catchClauses, finallyClause == null ? null : TokenFactory.tokenFromKeyword(Keyword.FINALLY), finallyClause);
+  static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses,
+      Block finallyClause) =>
+      new TryStatement(
+          TokenFactory.tokenFromKeyword(Keyword.TRY),
+          body,
+          catchClauses,
+          finallyClause == null ? null : TokenFactory.tokenFromKeyword(Keyword.FINALLY),
+          finallyClause);
 
-  static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParameterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlias(null, null, TokenFactory.tokenFromKeyword(Keyword.TYPEDEF), returnType, identifier3(name), typeParameters, parameters, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static FunctionTypeAlias typeAlias(TypeName returnType, String name,
+      TypeParameterList typeParameters, FormalParameterList parameters) =>
+      new FunctionTypeAlias(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.TYPEDEF),
+          returnType,
+          identifier3(name),
+          typeParameters,
+          parameters,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static TypeArgumentList typeArgumentList(List<TypeName> typeNames) {
     if (typeNames == null || typeNames.length == 0) {
@@ -544,15 +1105,22 @@
     return typeName;
   }
 
-  static TypeName typeName3(Identifier name, [List<TypeName> arguments])
-      => new TypeName(name, typeArgumentList(arguments));
+  static TypeName typeName3(Identifier name, [List<TypeName> arguments]) =>
+      new TypeName(name, typeArgumentList(arguments));
 
-  static TypeName typeName4(String name, [List<TypeName> arguments])
-      => new TypeName(identifier3(name), typeArgumentList(arguments));
+  static TypeName typeName4(String name, [List<TypeName> arguments]) =>
+      new TypeName(identifier3(name), typeArgumentList(arguments));
 
-  static TypeParameter typeParameter(String name) => new TypeParameter(null, null, identifier3(name), null, null);
+  static TypeParameter typeParameter(String name) =>
+      new TypeParameter(null, null, identifier3(name), null, null);
 
-  static TypeParameter typeParameter2(String name, TypeName bound) => new TypeParameter(null, null, identifier3(name), TokenFactory.tokenFromKeyword(Keyword.EXTENDS), bound);
+  static TypeParameter typeParameter2(String name, TypeName bound) =>
+      new TypeParameter(
+          null,
+          null,
+          identifier3(name),
+          TokenFactory.tokenFromKeyword(Keyword.EXTENDS),
+          bound);
 
   static TypeParameterList typeParameterList([List<String> typeNames]) {
     List<TypeParameter> typeParameters = null;
@@ -568,23 +1136,65 @@
         TokenFactory.tokenFromType(TokenType.GT));
   }
 
-  static VariableDeclaration variableDeclaration(String name) => new VariableDeclaration(null, null, identifier3(name), null, null);
+  static VariableDeclaration variableDeclaration(String name) =>
+      new VariableDeclaration(null, null, identifier3(name), null, null);
 
-  static VariableDeclaration variableDeclaration2(String name, Expression initializer) => new VariableDeclaration(null, null, identifier3(name), TokenFactory.tokenFromType(TokenType.EQ), initializer);
+  static VariableDeclaration variableDeclaration2(String name,
+      Expression initializer) =>
+      new VariableDeclaration(
+          null,
+          null,
+          identifier3(name),
+          TokenFactory.tokenFromType(TokenType.EQ),
+          initializer);
 
-  static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationList(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, variables);
+  static VariableDeclarationList variableDeclarationList(Keyword keyword,
+      TypeName type, List<VariableDeclaration> variables) =>
+      new VariableDeclarationList(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
+          variables);
 
-  static VariableDeclarationList variableDeclarationList2(Keyword keyword, List<VariableDeclaration> variables) => variableDeclarationList(keyword, null, variables);
+  static VariableDeclarationList variableDeclarationList2(Keyword keyword,
+      List<VariableDeclaration> variables) =>
+      variableDeclarationList(keyword, null, variables);
 
-  static VariableDeclarationStatement variableDeclarationStatement(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationStatement(variableDeclarationList(keyword, type, variables), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static VariableDeclarationStatement
+      variableDeclarationStatement(Keyword keyword, TypeName type,
+      List<VariableDeclaration> variables) =>
+      new VariableDeclarationStatement(
+          variableDeclarationList(keyword, type, variables),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static VariableDeclarationStatement variableDeclarationStatement2(Keyword keyword, List<VariableDeclaration> variables) => variableDeclarationStatement(keyword, null, variables);
+  static VariableDeclarationStatement
+      variableDeclarationStatement2(Keyword keyword,
+      List<VariableDeclaration> variables) =>
+      variableDeclarationStatement(keyword, null, variables);
 
-  static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement(TokenFactory.tokenFromKeyword(Keyword.WHILE), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
+  static WhileStatement whileStatement(Expression condition, Statement body) =>
+      new WhileStatement(
+          TokenFactory.tokenFromKeyword(Keyword.WHILE),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          body);
 
-  static WithClause withClause(List<TypeName> types) => new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
+  static WithClause withClause(List<TypeName> types) =>
+      new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
 
-  static YieldStatement yieldEachStatement(Expression expression) => new YieldStatement(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), TokenFactory.tokenFromType(TokenType.STAR), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static YieldStatement yieldEachStatement(Expression expression) =>
+      new YieldStatement(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static YieldStatement yieldStatement(Expression expression) => new YieldStatement(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), null, expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
-}
\ No newline at end of file
+  static YieldStatement yieldStatement(Expression expression) =>
+      new YieldStatement(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
+          null,
+          expression,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
+}
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index a7a52e2..c198284 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -8,14 +8,15 @@
 library engine.testing.element_factory;
 
 import 'dart:collection';
-import 'package:analyzer/src/generated/java_core.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
+
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/constant.dart';
-import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
 
 /**
  * The class `ElementFactory` defines utility methods used to create elements for testing
@@ -28,7 +29,17 @@
    */
   static ClassElementImpl _objectElement;
 
-  static ClassElementImpl classElement(String typeName, InterfaceType superclassType, [List<String> parameterNames]) {
+  static ClassElementImpl get object {
+    if (_objectElement == null) {
+      _objectElement = classElement("Object", null);
+    }
+    return _objectElement;
+  }
+
+  static InterfaceType get objectType => object.type;
+
+  static ClassElementImpl classElement(String typeName,
+      InterfaceType superclassType, [List<String> parameterNames]) {
     ClassElementImpl element = new ClassElementImpl(typeName, 0);
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
@@ -36,13 +47,13 @@
     if (parameterNames != null) {
       int count = parameterNames.length;
       if (count > 0) {
-        List<TypeParameterElementImpl> typeParameters
-            = new List<TypeParameterElementImpl>(count);
-        List<TypeParameterTypeImpl> typeParameterTypes
-            = new List<TypeParameterTypeImpl>(count);
+        List<TypeParameterElementImpl> typeParameters =
+            new List<TypeParameterElementImpl>(count);
+        List<TypeParameterTypeImpl> typeParameterTypes =
+            new List<TypeParameterTypeImpl>(count);
         for (int i = 0; i < count; i++) {
-          TypeParameterElementImpl typeParameter
-              = new TypeParameterElementImpl(parameterNames[i], 0);
+          TypeParameterElementImpl typeParameter =
+              new TypeParameterElementImpl(parameterNames[i], 0);
           typeParameters[i] = typeParameter;
           typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter);
           typeParameter.type = typeParameterTypes[i];
@@ -54,8 +65,9 @@
     return element;
   }
 
-  static ClassElementImpl classElement2(String typeName, [List<String> parameterNames])
-      => classElement(typeName, objectType, parameterNames);
+  static ClassElementImpl classElement2(String typeName,
+      [List<String> parameterNames]) =>
+      classElement(typeName, objectType, parameterNames);
 
   static CompilationUnitElementImpl compilationUnit(String fileName) {
     Source source = new NonExistingSource(fileName, UriKind.FILE_URI);
@@ -64,9 +76,12 @@
     return unit;
   }
 
-  static ConstructorElementImpl constructorElement(ClassElement definingClass, String name, bool isConst, [List<DartType> argumentTypes]) {
+  static ConstructorElementImpl constructorElement(ClassElement definingClass,
+      String name, bool isConst, [List<DartType> argumentTypes]) {
     DartType type = definingClass.type;
-    ConstructorElementImpl constructor = name == null ? new ConstructorElementImpl("", -1) : new ConstructorElementImpl(name, 0);
+    ConstructorElementImpl constructor = name == null ?
+        new ConstructorElementImpl("", -1) :
+        new ConstructorElementImpl(name, 0);
     constructor.const2 = isConst;
     if (argumentTypes != null) {
       int count = argumentTypes.length;
@@ -87,10 +102,12 @@
     return constructor;
   }
 
-  static ConstructorElementImpl constructorElement2(ClassElement definingClass, String name, [List<DartType> argumentTypes])
-      => constructorElement(definingClass, name, false, argumentTypes);
+  static ConstructorElementImpl constructorElement2(ClassElement definingClass,
+      String name, [List<DartType> argumentTypes]) =>
+      constructorElement(definingClass, name, false, argumentTypes);
 
-  static ClassElementImpl enumElement(TypeProvider typeProvider, String enumName, [List<String> constantNames]) {
+  static ClassElementImpl enumElement(TypeProvider typeProvider,
+      String enumName, [List<String> constantNames]) {
     //
     // Build the enum.
     //
@@ -117,7 +134,7 @@
     FieldElementImpl valuesField = new FieldElementImpl("values", -1);
     valuesField.static = true;
     valuesField.const3 = true;
-    valuesField.type = typeProvider.listType.substitute4(<DartType> [enumType]);
+    valuesField.type = typeProvider.listType.substitute4(<DartType>[enumType]);
     fields.add(valuesField);
     //
     // Build the enum constants.
@@ -126,14 +143,18 @@
       int constantCount = constantNames.length;
       for (int i = 0; i < constantCount; i++) {
         String constantName = constantNames[i];
-        FieldElementImpl constantElement = new ConstFieldElementImpl.con2(constantName, -1);
+        FieldElementImpl constantElement =
+            new ConstFieldElementImpl.con2(constantName, -1);
         constantElement.static = true;
         constantElement.const3 = true;
         constantElement.type = enumType;
-        HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
+        HashMap<String, DartObjectImpl> fieldMap =
+            new HashMap<String, DartObjectImpl>();
         fieldMap[indexFieldName] = new DartObjectImpl(intType, new IntState(i));
-        fieldMap[nameFieldName] = new DartObjectImpl(stringType, new StringState(constantName));
-        DartObjectImpl value = new DartObjectImpl(enumType, new GenericState(fieldMap));
+        fieldMap[nameFieldName] =
+            new DartObjectImpl(stringType, new StringState(constantName));
+        DartObjectImpl value =
+            new DartObjectImpl(enumType, new GenericState(fieldMap));
         constantElement.evaluationResult = new EvaluationResultImpl.con1(value);
         fields.add(constantElement);
       }
@@ -142,24 +163,28 @@
     // Finish building the enum.
     //
     enumElement.fields = fields;
-    // Client code isn't allowed to invoke the constructor, so we do not model it.
+
+        // Client code isn't allowed to invoke the constructor, so we do not model it.
     return enumElement;
   }
 
-  static ExportElementImpl exportFor(LibraryElement exportedLibrary, [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
+  static ExportElementImpl exportFor(LibraryElement exportedLibrary,
+      [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
     ExportElementImpl spec = new ExportElementImpl();
     spec.exportedLibrary = exportedLibrary;
     spec.combinators = combinators;
     return spec;
   }
 
-  static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal, bool isConst, DartType type) {
+  static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal,
+      bool isConst, DartType type) {
     FieldElementImpl field = new FieldElementImpl(name, 0);
     field.const3 = isConst;
     field.final2 = isFinal;
     field.static = isStatic;
     field.type = type;
-    PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(field);
+    PropertyAccessorElementImpl getter =
+        new PropertyAccessorElementImpl.forVariable(field);
     getter.getter = true;
     getter.synthetic = true;
     getter.variable = field;
@@ -168,11 +193,13 @@
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
     getter.type = getterType;
     if (!isConst && !isFinal) {
-      PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forVariable(field);
+      PropertyAccessorElementImpl setter =
+          new PropertyAccessorElementImpl.forVariable(field);
       setter.setter = true;
       setter.synthetic = true;
       setter.variable = field;
-      setter.parameters = <ParameterElement> [requiredParameter2("_$name", type)];
+      setter.parameters =
+          <ParameterElement>[requiredParameter2("_$name", type)];
       setter.returnType = VoidTypeImpl.instance;
       setter.type = new FunctionTypeImpl.con1(setter);
       field.setter = setter;
@@ -180,15 +207,23 @@
     return field;
   }
 
-  static FieldFormalParameterElementImpl fieldFormalParameter(Identifier name) => new FieldFormalParameterElementImpl(name);
+  static FieldFormalParameterElementImpl
+      fieldFormalParameter(Identifier name) =>
+      new FieldFormalParameterElementImpl(name);
 
-  static FunctionElementImpl functionElement(String functionName) => functionElement4(functionName, null, null, null, null);
+  static FunctionElementImpl functionElement(String functionName) =>
+      functionElement4(functionName, null, null, null, null);
 
-  static FunctionElementImpl functionElement2(String functionName, ClassElement returnElement) => functionElement3(functionName, returnElement, null, null);
+  static FunctionElementImpl functionElement2(String functionName,
+      ClassElement returnElement) =>
+      functionElement3(functionName, returnElement, null, null);
 
-  static FunctionElementImpl functionElement3(String functionName, ClassElement returnElement, List<ClassElement> normalParameters, List<ClassElement> optionalParameters) {
+  static FunctionElementImpl functionElement3(String functionName,
+      ClassElement returnElement, List<ClassElement> normalParameters,
+      List<ClassElement> optionalParameters) {
     // We don't create parameter elements because we don't have parameter names
-    FunctionElementImpl functionElement = new FunctionElementImpl(functionName, 0);
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl(functionName, 0);
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
     functionElement.type = functionType;
     // return type
@@ -199,7 +234,8 @@
     }
     // parameters
     int normalCount = normalParameters == null ? 0 : normalParameters.length;
-    int optionalCount = optionalParameters == null ? 0 : optionalParameters.length;
+    int optionalCount =
+        optionalParameters == null ? 0 : optionalParameters.length;
     int totalCount = normalCount + optionalCount;
     List<ParameterElement> parameters = new List<ParameterElement>(totalCount);
     for (int i = 0; i < totalCount; i++) {
@@ -218,8 +254,11 @@
     return functionElement;
   }
 
-  static FunctionElementImpl functionElement4(String functionName, ClassElement returnElement, List<ClassElement> normalParameters, List<String> names, List<ClassElement> namedParameters) {
-    FunctionElementImpl functionElement = new FunctionElementImpl(functionName, 0);
+  static FunctionElementImpl functionElement4(String functionName,
+      ClassElement returnElement, List<ClassElement> normalParameters,
+      List<String> names, List<ClassElement> namedParameters) {
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl(functionName, 0);
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
     functionElement.type = functionType;
     // parameters
@@ -227,7 +266,8 @@
     int nameCount = names == null ? 0 : names.length;
     int typeCount = namedParameters == null ? 0 : namedParameters.length;
     if (names != null && nameCount != typeCount) {
-      throw new IllegalStateException("The passed String[] and ClassElement[] arrays had different lengths.");
+      throw new IllegalStateException(
+          "The passed String[] and ClassElement[] arrays had different lengths.");
     }
     int totalCount = normalCount + nameCount;
     List<ParameterElement> parameters = new List<ParameterElement>(totalCount);
@@ -238,7 +278,8 @@
         parameter.parameterKind = ParameterKind.REQUIRED;
         parameters[i] = parameter;
       } else {
-        ParameterElementImpl parameter = new ParameterElementImpl(names[i - normalCount], i);
+        ParameterElementImpl parameter =
+            new ParameterElementImpl(names[i - normalCount], i);
         parameter.type = namedParameters[i - normalCount].type;
         parameter.parameterKind = ParameterKind.NAMED;
         parameters[i] = parameter;
@@ -254,36 +295,39 @@
     return functionElement;
   }
 
-  static FunctionElementImpl functionElement5(String functionName, List<ClassElement> normalParameters) => functionElement3(functionName, null, normalParameters, null);
+  static FunctionElementImpl functionElement5(String functionName,
+      List<ClassElement> normalParameters) =>
+      functionElement3(functionName, null, normalParameters, null);
 
-  static FunctionElementImpl functionElement6(String functionName, List<ClassElement> normalParameters, List<ClassElement> optionalParameters) => functionElement3(functionName, null, normalParameters, optionalParameters);
+  static FunctionElementImpl functionElement6(String functionName,
+      List<ClassElement> normalParameters, List<ClassElement> optionalParameters) =>
+      functionElement3(functionName, null, normalParameters, optionalParameters);
 
-  static FunctionElementImpl functionElement7(String functionName, List<ClassElement> normalParameters, List<String> names, List<ClassElement> namedParameters) => functionElement4(functionName, null, normalParameters, names, namedParameters);
+  static FunctionElementImpl functionElement7(String functionName,
+      List<ClassElement> normalParameters, List<String> names,
+      List<ClassElement> namedParameters) =>
+      functionElement4(functionName, null, normalParameters, names, namedParameters);
 
-  static FunctionElementImpl functionElementWithParameters(String functionName, DartType returnType, List<ParameterElement> parameters) {
-    FunctionElementImpl functionElement = new FunctionElementImpl(functionName, 0);
-    functionElement.returnType = returnType == null ? VoidTypeImpl.instance : returnType;
+  static FunctionElementImpl functionElementWithParameters(String functionName,
+      DartType returnType, List<ParameterElement> parameters) {
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl(functionName, 0);
+    functionElement.returnType =
+        returnType == null ? VoidTypeImpl.instance : returnType;
     functionElement.parameters = parameters;
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
     functionElement.type = functionType;
     return functionElement;
   }
 
-  static ClassElementImpl get object {
-    if (_objectElement == null) {
-      _objectElement = classElement("Object", null);
-    }
-    return _objectElement;
-  }
-
-  static InterfaceType get objectType => object.type;
-
-  static PropertyAccessorElementImpl getterElement(String name, bool isStatic, DartType type) {
+  static PropertyAccessorElementImpl getterElement(String name, bool isStatic,
+      DartType type) {
     FieldElementImpl field = new FieldElementImpl(name, -1);
     field.static = isStatic;
     field.synthetic = true;
     field.type = type;
-    PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(field);
+    PropertyAccessorElementImpl getter =
+        new PropertyAccessorElementImpl.forVariable(field);
     getter.getter = true;
     getter.variable = field;
     getter.returnType = type;
@@ -300,7 +344,9 @@
     return unit;
   }
 
-  static ImportElementImpl importFor(LibraryElement importedLibrary, PrefixElement prefix, [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
+  static ImportElementImpl importFor(LibraryElement importedLibrary,
+      PrefixElement prefix, [List<NamespaceCombinator> combinators =
+      NamespaceCombinator.EMPTY_ARRAY]) {
     ImportElementImpl spec = new ImportElementImpl(0);
     spec.importedLibrary = importedLibrary;
     spec.prefix = prefix;
@@ -308,19 +354,24 @@
     return spec;
   }
 
-  static LibraryElementImpl library(AnalysisContext context, String libraryName) {
+  static LibraryElementImpl library(AnalysisContext context,
+      String libraryName) {
     String fileName = "/$libraryName.dart";
     CompilationUnitElementImpl unit = compilationUnit(fileName);
-    LibraryElementImpl library = new LibraryElementImpl(context, libraryName, 0);
+    LibraryElementImpl library =
+        new LibraryElementImpl(context, libraryName, 0);
     library.definingCompilationUnit = unit;
     return library;
   }
 
-  static LocalVariableElementImpl localVariableElement(Identifier name) => new LocalVariableElementImpl.forNode(name);
+  static LocalVariableElementImpl localVariableElement(Identifier name) =>
+      new LocalVariableElementImpl.forNode(name);
 
-  static LocalVariableElementImpl localVariableElement2(String name) => new LocalVariableElementImpl(name, 0);
+  static LocalVariableElementImpl localVariableElement2(String name) =>
+      new LocalVariableElementImpl(name, 0);
 
-  static MethodElementImpl methodElement(String methodName, DartType returnType, [List<DartType> argumentTypes]) {
+  static MethodElementImpl methodElement(String methodName, DartType returnType,
+      [List<DartType> argumentTypes]) {
     MethodElementImpl method = new MethodElementImpl(methodName, 0);
     if (argumentTypes == null) {
       method.parameters = ParameterElementImpl.EMPTY_ARRAY;
@@ -341,7 +392,9 @@
     return method;
   }
 
-  static MethodElementImpl methodElementWithParameters(String methodName, List<DartType> typeArguments, DartType returnType, List<ParameterElement> parameters) {
+  static MethodElementImpl methodElementWithParameters(String methodName,
+      List<DartType> typeArguments, DartType returnType,
+      List<ParameterElement> parameters) {
     MethodElementImpl method = new MethodElementImpl(methodName, 0);
     method.parameters = parameters;
     method.returnType = returnType;
@@ -377,7 +430,8 @@
     return parameter;
   }
 
-  static PrefixElementImpl prefix(String name) => new PrefixElementImpl(name, 0);
+  static PrefixElementImpl prefix(String name) =>
+      new PrefixElementImpl(name, 0);
 
   static ParameterElementImpl requiredParameter(String name) {
     ParameterElementImpl parameter = new ParameterElementImpl(name, 0);
@@ -392,12 +446,14 @@
     return parameter;
   }
 
-  static PropertyAccessorElementImpl setterElement(String name, bool isStatic, DartType type) {
+  static PropertyAccessorElementImpl setterElement(String name, bool isStatic,
+      DartType type) {
     FieldElementImpl field = new FieldElementImpl(name, -1);
     field.static = isStatic;
     field.synthetic = true;
     field.type = type;
-    PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(field);
+    PropertyAccessorElementImpl getter =
+        new PropertyAccessorElementImpl.forVariable(field);
     getter.getter = true;
     getter.variable = field;
     getter.returnType = type;
@@ -405,27 +461,33 @@
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
     getter.type = getterType;
     ParameterElementImpl parameter = requiredParameter2("a", type);
-    PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forVariable(field);
+    PropertyAccessorElementImpl setter =
+        new PropertyAccessorElementImpl.forVariable(field);
     setter.setter = true;
     setter.synthetic = true;
     setter.variable = field;
-    setter.parameters = <ParameterElement> [parameter];
+    setter.parameters = <ParameterElement>[parameter];
     setter.returnType = VoidTypeImpl.instance;
     setter.type = new FunctionTypeImpl.con1(setter);
     field.setter = setter;
     return setter;
   }
 
-  static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) => new TopLevelVariableElementImpl.forNode(name);
+  static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) =>
+      new TopLevelVariableElementImpl.forNode(name);
 
-  static TopLevelVariableElementImpl topLevelVariableElement2(String name) => topLevelVariableElement3(name, false, false, null);
+  static TopLevelVariableElementImpl topLevelVariableElement2(String name) =>
+      topLevelVariableElement3(name, false, false, null);
 
-  static TopLevelVariableElementImpl topLevelVariableElement3(String name, bool isConst, bool isFinal, DartType type) {
-    TopLevelVariableElementImpl variable = new TopLevelVariableElementImpl(name, -1);
+  static TopLevelVariableElementImpl topLevelVariableElement3(String name,
+      bool isConst, bool isFinal, DartType type) {
+    TopLevelVariableElementImpl variable =
+        new TopLevelVariableElementImpl(name, -1);
     variable.const3 = isConst;
     variable.final2 = isFinal;
     variable.synthetic = true;
-    PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.forVariable(variable);
+    PropertyAccessorElementImpl getter =
+        new PropertyAccessorElementImpl.forVariable(variable);
     getter.getter = true;
     getter.synthetic = true;
     getter.variable = variable;
@@ -434,16 +496,18 @@
     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
     getter.type = getterType;
     if (!isFinal) {
-      PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.forVariable(variable);
+      PropertyAccessorElementImpl setter =
+          new PropertyAccessorElementImpl.forVariable(variable);
       setter.setter = true;
       setter.static = true;
       setter.synthetic = true;
       setter.variable = variable;
-      setter.parameters = <ParameterElement> [requiredParameter2("_$name", type)];
+      setter.parameters =
+          <ParameterElement>[requiredParameter2("_$name", type)];
       setter.returnType = VoidTypeImpl.instance;
       setter.type = new FunctionTypeImpl.con1(setter);
       variable.setter = setter;
     }
     return variable;
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/lib/src/generated/testing/html_factory.dart b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
index 4be90d1..b833a26 100644
--- a/pkg/analyzer/lib/src/generated/testing/html_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
@@ -24,15 +24,16 @@
     return new Token.con1(TokenType.GT, 0);
   }
 
-  static Token ltToken() {
-    return new Token.con1(TokenType.LT, 0);
-  }
-
   static Token ltsToken() {
     return new Token.con1(TokenType.LT_SLASH, 0);
   }
 
-  static HtmlScriptTagNode scriptTag([List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) {
+  static Token ltToken() {
+    return new Token.con1(TokenType.LT, 0);
+  }
+
+  static HtmlScriptTagNode scriptTag([List<XmlAttributeNode> attributes =
+      XmlAttributeNode.EMPTY_LIST]) {
     return new HtmlScriptTagNode(
         ltToken(),
         stringToken("script"),
@@ -70,7 +71,8 @@
     return new Token.con2(TokenType.STRING, 0, value);
   }
 
-  static XmlTagNode tagNode(String name, [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) {
+  static XmlTagNode tagNode(String name, [List<XmlAttributeNode> attributes =
+      XmlAttributeNode.EMPTY_LIST]) {
     return new XmlTagNode(
         ltToken(),
         stringToken(name),
diff --git a/pkg/analyzer/lib/src/generated/testing/token_factory.dart b/pkg/analyzer/lib/src/generated/testing/token_factory.dart
index 7902b7c..eeafab61 100644
--- a/pkg/analyzer/lib/src/generated/testing/token_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/token_factory.dart
@@ -13,11 +13,14 @@
  * The class `TokenFactory` defines utility methods that can be used to create tokens.
  */
 class TokenFactory {
-  static Token tokenFromKeyword(Keyword keyword) => new KeywordToken(keyword, 0);
+  static Token tokenFromKeyword(Keyword keyword) =>
+      new KeywordToken(keyword, 0);
 
-  static Token tokenFromString(String lexeme) => new StringToken(TokenType.STRING, lexeme, 0);
+  static Token tokenFromString(String lexeme) =>
+      new StringToken(TokenType.STRING, lexeme, 0);
 
   static Token tokenFromType(TokenType type) => new Token(type, 0);
 
-  static Token tokenFromTypeAndString(TokenType type, String lexeme) => new StringToken(type, lexeme, 0);
-}
\ No newline at end of file
+  static Token tokenFromTypeAndString(TokenType type, String lexeme) =>
+      new StringToken(type, lexeme, 0);
+}
diff --git a/pkg/analyzer/lib/src/generated/utilities_collection.dart b/pkg/analyzer/lib/src/generated/utilities_collection.dart
index 04d6177..47dd4f6 100644
--- a/pkg/analyzer/lib/src/generated/utilities_collection.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_collection.dart
@@ -7,8 +7,8 @@
 
 library engine.utilities.collection;
 
-import 'dart:collection';
 import "dart:math" as math;
+import 'dart:collection';
 
 import 'java_core.dart';
 import 'scanner.dart' show Token;
@@ -68,7 +68,8 @@
    * @return the updated value of the array
    * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
    */
-  static int setEnum(int array, Enum index, bool value) => set(array, index.ordinal, value);
+  static int setEnum(int array, Enum index, bool value) =>
+      set(array, index.ordinal, value);
 
   /**
    * Throw an exception if the index is not within the bounds allowed for an integer-encoded array
@@ -100,6 +101,25 @@
   HashMap<N, HashSet<N>> _edges = new HashMap<N, HashSet<N>>();
 
   /**
+   * Return `true` if this graph is empty.
+   *
+   * @return `true` if this graph is empty
+   */
+  bool get isEmpty => _edges.isEmpty;
+
+  /**
+   * Return the number of nodes in this graph.
+   *
+   * @return the number of nodes in this graph
+   */
+  int get nodeCount => _edges.length;
+
+  /**
+   * Return a set of all nodes in the graph.
+   */
+  Set<N> get nodes => _edges.keys.toSet();
+
+  /**
    * Add an edge from the given head node to the given tail node. Both nodes will be a part of the
    * graph after this method is invoked, whether or not they were before.
    *
@@ -170,18 +190,6 @@
   }
 
   /**
-   * Return the number of nodes in this graph.
-   *
-   * @return the number of nodes in this graph
-   */
-  int get nodeCount => _edges.length;
-
-  /**
-   * Return a set of all nodes in the graph.
-   */
-  Set<N> get nodes => _edges.keys.toSet();
-
-  /**
    * Return a set containing the tails of edges that have the given node as their head. The set will
    * be empty if there are no such edges or if the node is not part of the graph. Clients must not
    * modify the returned set.
@@ -198,13 +206,6 @@
   }
 
   /**
-   * Return `true` if this graph is empty.
-   *
-   * @return `true` if this graph is empty
-   */
-  bool get isEmpty => _edges.isEmpty;
-
-  /**
    * Remove all of the given nodes from this graph. As a consequence, any edges for which those
    * nodes were either a head or a tail will also be removed.
    *
@@ -358,7 +359,8 @@
   /**
    * A table mapping nodes to information about the nodes that is used by this algorithm.
    */
-  HashMap<N, DirectedGraph_NodeInfo<N>> _nodeMap = new HashMap<N, DirectedGraph_NodeInfo<N>>();
+  HashMap<N, DirectedGraph_NodeInfo<N>> _nodeMap =
+      new HashMap<N, DirectedGraph_NodeInfo<N>>();
 
   /**
    * A list of all strongly connected components found, in topological sort order (each node in a
@@ -514,6 +516,14 @@
   V get value;
 
   /**
+   * Set the value associated with the current element to the given value.
+   *
+   * @param newValue the new value to be associated with the current element
+   * @throws NoSuchElementException if there is no current element
+   */
+  void set value(V newValue);
+
+  /**
    * Advance to the next entry in the map. Return `true` if there is a current element that
    * can be accessed after this method returns. It is safe to invoke this method even if the
    * previous invocation returned `false`.
@@ -521,14 +531,6 @@
    * @return `true` if there is a current element that can be accessed
    */
   bool moveNext();
-
-  /**
-   * Set the value associated with the current element to the given value.
-   *
-   * @param newValue the new value to be associated with the current element
-   * @throws NoSuchElementException if there is no current element
-   */
-  void set value(V newValue);
 }
 
 /**
@@ -581,6 +583,14 @@
   }
 
   @override
+  void set value(V newValue) {
+    if (_currentIterator == null) {
+      throw new NoSuchElementException();
+    }
+    _currentIterator.value = newValue;
+  }
+
+  @override
   bool moveNext() {
     if (_iteratorIndex < 0) {
       if (_iterators.length == 0) {
@@ -604,14 +614,6 @@
     }
   }
 
-  @override
-  void set value(V newValue) {
-    if (_currentIterator == null) {
-      throw new NoSuchElementException();
-    }
-    _currentIterator.value = newValue;
-  }
-
   /**
    * Under the assumption that there are no more entries that can be returned using the current
    * iterator, advance to the next iterator that has entries.
@@ -633,47 +635,11 @@
 }
 
 /**
- * Instances of the class `TokenMap` map one set of tokens to another set of tokens.
- */
-class TokenMap {
-  /**
-   * A table mapping tokens to tokens. This should be replaced by a more performant implementation.
-   * One possibility is a pair of parallel arrays, with keys being sorted by their offset and a
-   * cursor indicating where to start searching.
-   */
-  HashMap<Token, Token> _map = new HashMap<Token, Token>();
-
-  /**
-   * Return the token that is mapped to the given token, or `null` if there is no token
-   * corresponding to the given token.
-   *
-   * @param key the token being mapped to another token
-   * @return the token that is mapped to the given token
-   */
-  Token get(Token key) => _map[key];
-
-  /**
-   * Map the key to the value.
-   *
-   * @param key the token being mapped to the value
-   * @param value the token to which the key will be mapped
-   */
-  void put(Token key, Token value) {
-    _map[key] = value;
-  }
-}
-
-/**
  * Instances of the class `SingleMapIterator` implement an iterator that can be used to access
  * the entries in a single map.
  */
 class SingleMapIterator<K, V> implements MapIterator<K, V> {
   /**
-   * Returns a new [SingleMapIterator] instance for the given [Map].
-   */
-  static SingleMapIterator forMap(Map map) => new SingleMapIterator(map);
-
-  /**
    * The [Map] containing the entries to be iterated over.
    */
   final Map<K, V> _map;
@@ -719,6 +685,15 @@
   }
 
   @override
+  void set value(V newValue) {
+    if (_currentKey == null) {
+      throw new NoSuchElementException();
+    }
+    _currentValue = newValue;
+    _map[_currentKey] = newValue;
+  }
+
+  @override
   bool moveNext() {
     if (_keyIterator.moveNext()) {
       _currentKey = _keyIterator.current;
@@ -730,12 +705,39 @@
     }
   }
 
-  @override
-  void set value(V newValue) {
-    if (_currentKey == null) {
-      throw new NoSuchElementException();
-    }
-    _currentValue = newValue;
-    _map[_currentKey] = newValue;
+  /**
+   * Returns a new [SingleMapIterator] instance for the given [Map].
+   */
+  static SingleMapIterator forMap(Map map) => new SingleMapIterator(map);
+}
+
+/**
+ * Instances of the class `TokenMap` map one set of tokens to another set of tokens.
+ */
+class TokenMap {
+  /**
+   * A table mapping tokens to tokens. This should be replaced by a more performant implementation.
+   * One possibility is a pair of parallel arrays, with keys being sorted by their offset and a
+   * cursor indicating where to start searching.
+   */
+  HashMap<Token, Token> _map = new HashMap<Token, Token>();
+
+  /**
+   * Return the token that is mapped to the given token, or `null` if there is no token
+   * corresponding to the given token.
+   *
+   * @param key the token being mapped to another token
+   * @return the token that is mapped to the given token
+   */
+  Token get(Token key) => _map[key];
+
+  /**
+   * Map the key to the value.
+   *
+   * @param key the token being mapped to the value
+   * @param value the token to which the key will be mapped
+   */
+  void put(Token key, Token value) {
+    _map[key] = value;
   }
 }
diff --git a/pkg/analyzer/lib/src/generated/utilities_dart.dart b/pkg/analyzer/lib/src/generated/utilities_dart.dart
index 40a07fc..26456a5 100644
--- a/pkg/analyzer/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_dart.dart
@@ -15,9 +15,11 @@
  * two kinds: positional optional and named optional.
  */
 class ParameterKind extends Enum<ParameterKind> {
-  static const ParameterKind REQUIRED = const ParameterKind('REQUIRED', 0, false);
+  static const ParameterKind REQUIRED =
+      const ParameterKind('REQUIRED', 0, false);
 
-  static const ParameterKind POSITIONAL = const ParameterKind('POSITIONAL', 1, true);
+  static const ParameterKind POSITIONAL =
+      const ParameterKind('POSITIONAL', 1, true);
 
   static const ParameterKind NAMED = const ParameterKind('NAMED', 2, true);
 
@@ -33,5 +35,6 @@
    *
    * @param isOptional `true` if this is an optional parameter
    */
-  const ParameterKind(String name, int ordinal, this.isOptional) : super(name, ordinal);
-}
\ No newline at end of file
+  const ParameterKind(String name, int ordinal, this.isOptional)
+      : super(name, ordinal);
+}
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index f5531a4..927f6d6 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.dart
@@ -56,7 +56,8 @@
    */
   int stop() {
     _counter._sw.stop();
-    int elapsed = (_counter._sw.elapsedMicroseconds - _startMicros) *
+    int elapsed =
+        (_counter._sw.elapsedMicroseconds - _startMicros) *
         TimeCounter.NANOS_PER_MICRO;
     // restore previous counter and resume it
     TimeCounter._current = _prev;
diff --git a/pkg/analyzer/lib/src/services/formatter_impl.dart b/pkg/analyzer/lib/src/services/formatter_impl.dart
index 4c0757a..8cc329d 100644
--- a/pkg/analyzer/lib/src/services/formatter_impl.dart
+++ b/pkg/analyzer/lib/src/services/formatter_impl.dart
@@ -59,10 +59,9 @@
 
 /// Specifies the kind of code snippet to format.
 class CodeKind {
+  final int ordinal;
 
-  final int _index;
-
-  const CodeKind._(this._index);
+  const CodeKind._(this.ordinal);
 
   /// A compilation unit snippet.
   static const COMPILATION_UNIT = const CodeKind._(0);
diff --git a/pkg/analyzer/lib/src/string_source.dart b/pkg/analyzer/lib/src/string_source.dart
index bfeedf0..789e74c 100644
--- a/pkg/analyzer/lib/src/string_source.dart
+++ b/pkg/analyzer/lib/src/string_source.dart
@@ -4,8 +4,8 @@
 
 library analyzer.string_source;
 
-import 'generated/source.dart';
 import 'generated/engine.dart' show TimestampedData;
+import 'generated/source.dart';
 
 /// An implementation of [Source] that's based on an in-memory Dart string.
 class StringSource implements Source {
@@ -16,7 +16,26 @@
   StringSource(this._contents, this.fullName)
       : modificationStamp = new DateTime.now().millisecondsSinceEpoch;
 
-  bool operator==(Object object) {
+  TimestampedData<String> get contents =>
+      new TimestampedData(modificationStamp, _contents);
+
+  String get encoding =>
+      throw new UnsupportedError("StringSource doesn't support " "encoding.");
+
+  int get hashCode => _contents.hashCode ^ fullName.hashCode;
+
+  bool get isInSystemLibrary => false;
+
+  String get shortName => fullName;
+
+  @override
+  Uri get uri =>
+      throw new UnsupportedError("StringSource doesn't support uri.");
+
+  UriKind get uriKind =>
+      throw new UnsupportedError("StringSource doesn't support " "uriKind.");
+
+  bool operator ==(Object object) {
     if (object is StringSource) {
       StringSource ssObject = object;
       return ssObject._contents == _contents && ssObject.fullName == fullName;
@@ -26,24 +45,6 @@
 
   bool exists() => true;
 
-  TimestampedData<String> get contents => new TimestampedData(modificationStamp, _contents);
-
-  String get encoding => throw new UnsupportedError("StringSource doesn't support "
-      "encoding.");
-
-  String get shortName => fullName;
-
-  UriKind get uriKind => throw new UnsupportedError("StringSource doesn't support "
-      "uriKind.");
-
-  int get hashCode => _contents.hashCode ^ fullName.hashCode;
-
-  bool get isInSystemLibrary => false;
-
-  @override
-  Uri get uri => throw new UnsupportedError(
-      "StringSource doesn't support uri.");
-
-  Uri resolveRelativeUri(Uri relativeUri) => throw new UnsupportedError(
-      "StringSource doesn't support resolveRelative.");
+  Uri resolveRelativeUri(Uri relativeUri) =>
+      throw new UnsupportedError("StringSource doesn't support resolveRelative.");
 }
diff --git a/pkg/analyzer/lib/src/task/task_dart.dart b/pkg/analyzer/lib/src/task/task_dart.dart
index 8e123b3..2ea6b9a 100644
--- a/pkg/analyzer/lib/src/task/task_dart.dart
+++ b/pkg/analyzer/lib/src/task/task_dart.dart
@@ -40,10 +40,19 @@
    * the given [source] in the given [library] based on the compilation [unit]
    * that was parsed.
    */
-  BuildUnitElementTask(InternalAnalysisContext context, this.source, this.library, this.unit)
+  BuildUnitElementTask(InternalAnalysisContext context, this.source,
+      this.library, this.unit)
       : super(context);
 
   @override
+  String get taskDescription {
+    if (source == null) {
+      return "build the unit element model for null source";
+    }
+    return "build the unit element model for " + source.fullName;
+  }
+
+  @override
   accept(AnalysisTaskVisitor visitor) {
     return visitor.visitBuildUnitElementTask(this);
   }
@@ -75,12 +84,4 @@
     CompilationUnitBuilder builder = new CompilationUnitBuilder();
     unitElement = builder.buildCompilationUnit(source, unit);
   }
-
-  @override
-  String get taskDescription {
-    if (source == null) {
-      return "build the unit element model for null source";
-    }
-    return "build the unit element model for " + source.fullName;
-  }
 }
diff --git a/pkg/analyzer/lib/src/util/utilities_timing.dart b/pkg/analyzer/lib/src/util/utilities_timing.dart
index 4d07fcd..7b8e122 100644
--- a/pkg/analyzer/lib/src/util/utilities_timing.dart
+++ b/pkg/analyzer/lib/src/util/utilities_timing.dart
@@ -26,14 +26,14 @@
   int get averageMilliseconds => elapsedMilliseconds ~/ stopCount;
 
   @override
-  void stop() {
-    super.stop();
-    stopCount++;
-  }
-
-  @override
   void reset() {
     super.reset();
     stopCount = 0;
   }
-}
\ No newline at end of file
+
+  @override
+  void stop() {
+    super.stop();
+    stopCount++;
+  }
+}
diff --git a/pkg/analyzer/test/enum_test.dart b/pkg/analyzer/test/enum_test.dart
index 22d1769..13d3782 100644
--- a/pkg/analyzer/test/enum_test.dart
+++ b/pkg/analyzer/test/enum_test.dart
@@ -6,7 +6,6 @@
 
 import 'dart:mirrors';
 
-import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
@@ -14,7 +13,6 @@
 import 'package:analyzer/src/generated/instrumentation.dart';
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/scanner.dart' as scanner;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:unittest/unittest.dart';
@@ -54,12 +52,6 @@
         ..check_explicit_values();
   }
 
-  void test_CommentType() {
-    new EnumTester<CommentType>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_ElementKind() {
     new EnumTester<ElementKind>()
         ..check_getters()
@@ -102,12 +94,6 @@
         ..check_explicit_values();
   }
 
-  void test_Keyword() {
-    new EnumTester<scanner.Keyword>(ignoreGetters: ['keywords'])
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_Modifier() {
     new EnumTester<Modifier>()
         ..check_getters()
@@ -132,12 +118,6 @@
         ..check_explicit_values();
   }
 
-  void test_scanner_TokenType() {
-    new EnumTester<scanner.TokenType>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_SourceKind() {
     new EnumTester<SourceKind>()
         ..check_getters()
@@ -150,24 +130,12 @@
         ..check_explicit_values();
   }
 
-  void test_TokenClass() {
-    new EnumTester<scanner.TokenClass>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_UriKind() {
     new EnumTester<UriKind>()
         ..check_getters()
         ..check_explicit_values();
   }
 
-  void test_UriValidationCode() {
-    new EnumTester<UriValidationCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_WrapperKind() {
     new EnumTester<WrapperKind>()
         ..check_getters()
diff --git a/pkg/analyzer/test/error_test.dart b/pkg/analyzer/test/error_test.dart
index 4c7861d..9724fde 100644
--- a/pkg/analyzer/test/error_test.dart
+++ b/pkg/analyzer/test/error_test.dart
@@ -10,46 +10,48 @@
 
 void main() {
   test("a valid Dart file doesn't throw any errors", () {
-    expect(
-        errorsForFile('void main() => print("Hello, world!");'),
-        isNull);
+    expect(errorsForFile('void main() => print("Hello, world!");'), isNull);
   });
 
   test("an empty Dart file doesn't throw any errors", () {
-      expect(
-          errorsForFile(''),
-          isNull);
-    });
+    expect(errorsForFile(''), isNull);
+  });
 
   test("an error on the first line", () {
-    expect(errorsForFile('void foo;\n'),
+    expect(
+        errorsForFile('void foo;\n'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 
   test("an error on the last line", () {
-    expect(errorsForFile('\nvoid foo;'),
+    expect(
+        errorsForFile('\nvoid foo;'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 
   test("an error in the middle", () {
-    expect(errorsForFile('\nvoid foo;\n'),
+    expect(
+        errorsForFile('\nvoid foo;\n'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 
   var veryLongString = new List.filled(107, ' ').join('');
 
   test("an error at the end of a very long line", () {
-    expect(errorsForFile('$veryLongString     void foo;'),
+    expect(
+        errorsForFile('$veryLongString     void foo;'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 
   test("an error at the beginning of a very long line", () {
-    expect(errorsForFile('void foo;     $veryLongString'),
+    expect(
+        errorsForFile('void foo;     $veryLongString'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 
   test("an error in the middle of a very long line", () {
-    expect(errorsForFile('$veryLongString void foo;$veryLongString'),
+    expect(
+        errorsForFile('$veryLongString void foo;$veryLongString'),
         equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
   });
 }
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index 458c2c4..ecd647e 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -6,13 +6,13 @@
 
 import 'dart:async';
 
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 import 'package:watcher/watcher.dart';
-import 'package:analyzer/file_system/memory_file_system.dart';
-import 'package:analyzer/file_system/file_system.dart';
 
 
 var _isFile = new isInstanceOf<File>();
@@ -34,7 +34,8 @@
       var exception = new MemoryResourceException('/my/path', 'my message');
       expect(exception.path, '/my/path');
       expect(exception.message, 'my message');
-      expect(exception.toString(),
+      expect(
+          exception.toString(),
           'MemoryResourceException(path=/my/path; message=my message)');
     });
 
@@ -469,7 +470,8 @@
         });
 
         test('resolveRelative', () {
-          Uri relative = source.resolveRelativeUri(new Uri.file('bar/baz.dart'));
+          Uri relative =
+              source.resolveRelativeUri(new Uri.file('bar/baz.dart'));
           expect(relative.path, '/foo/bar/baz.dart');
         });
       });
@@ -503,7 +505,8 @@
         });
 
         test('resolveRelative', () {
-          Uri relative = source.resolveRelativeUri(new Uri.file('bar/baz.dart'));
+          Uri relative =
+              source.resolveRelativeUri(new Uri.file('bar/baz.dart'));
           expect(relative.path, '/foo/bar/baz.dart');
         });
       });
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 3625a77..0590cec 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -41,8 +41,7 @@
         // Give the tests 1 second to detect the changes. While it may only
         // take up to a few hundred ms, a whole second gives a good margin
         // for when running tests.
-        return new Future.delayed(
-            new Duration(seconds: 1), computation);
+        return new Future.delayed(new Duration(seconds: 1), computation);
       }
 
       watchingFolder(String path, test(List<WatchEvent> changesReceived)) {
@@ -320,9 +319,15 @@
         expect(folder.canonicalizePath('baz'), equals(join(path, 'baz')));
         expect(folder.canonicalizePath(path2), equals(path2));
         expect(folder.canonicalizePath(join('..', 'folder2')), equals(path2));
-        expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(path3));
-        expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'baz')));
-        expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(path2, 'baz')));
+        expect(
+            folder.canonicalizePath(join(path2, '..', 'folder3')),
+            equals(path3));
+        expect(
+            folder.canonicalizePath(join('.', 'baz')),
+            equals(join(path, 'baz')));
+        expect(
+            folder.canonicalizePath(join(path2, '.', 'baz')),
+            equals(join(path2, 'baz')));
       });
     });
   });
diff --git a/pkg/analyzer/test/file_system/test_all.dart b/pkg/analyzer/test/file_system/test_all.dart
index 40cf4aa..e89490c 100644
--- a/pkg/analyzer/test/file_system/test_all.dart
+++ b/pkg/analyzer/test/file_system/test_all.dart
@@ -7,7 +7,8 @@
 import 'package:unittest/unittest.dart';
 
 import 'memory_file_system_test.dart' as memory_file_system_test;
-import 'physical_resource_provider_test.dart' as physical_resource_provider_test;
+import 'physical_resource_provider_test.dart' as
+    physical_resource_provider_test;
 import 'resource_uri_resolver_test.dart' as resource_uri_resolver_test;
 
 
@@ -19,4 +20,4 @@
     physical_resource_provider_test.main();
     resource_uri_resolver_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/test/generated/all_the_rest.dart b/pkg/analyzer/test/generated/all_the_rest.dart
index 128ea5d..a99cf0e 100644
--- a/pkg/analyzer/test/generated/all_the_rest.dart
+++ b/pkg/analyzer/test/generated/all_the_rest.dart
@@ -368,7 +368,8 @@
       }
       return ht.TokenType.TEXT;
     }
-    fail("Unknown expected token $count: ${expected != null ? expected.runtimeType : "null"}");
+    fail(
+        "Unknown expected token $count: ${expected != null ? expected.runtimeType : "null"}");
     return null;
   }
 
@@ -452,6 +453,20 @@
 
 
 class AngularCompilationUnitBuilderTest extends AngularTest {
+  void test_bad_notConstructorAnnotation() {
+    String mainContent = r'''
+const MY_ANNOTATION = null;
+@MY_ANNOTATION()
+class MyFilter {
+}''';
+    resolveMainSource(mainContent);
+    // prepare AngularFilterElement
+    ClassElement classElement = mainUnitElement.getType("MyFilter");
+    AngularFormatterElement filter =
+        getAngularElement(classElement, (e) => e is AngularFormatterElement);
+    expect(filter, isNull);
+  }
+
   void test_Decorator() {
     String mainContent = _createAngularSource(r'''
 @Decorator(selector: '[my-dir]',
@@ -566,6 +581,218 @@
     expect(filter, isNull);
   }
 
+  void test_getElement_component_name() {
+    resolveMainSource(_createAngularSource(r'''
+@Component(publishAs: 'ctrl', selector: 'myComp',
+             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
+class MyComponent {}'''));
+    SimpleStringLiteral node =
+        _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // find AngularComponentElement
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularComponentElement,
+        AngularComponentElement,
+        element);
+  }
+
+  void test_getElement_component_property_fromFieldAnnotation() {
+    resolveMainSource(_createAngularSource(r'''
+@Component(publishAs: 'ctrl', selector: 'myComp',
+             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
+class MyComponent {
+  @NgOneWay('prop')
+  var field;
+}'''));
+    // prepare node
+    SimpleStringLiteral node =
+        _findMainNode("prop'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // prepare Element
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    expect(element, isNotNull);
+    // check AngularPropertyElement
+    AngularPropertyElement property = element as AngularPropertyElement;
+    expect(property.name, "prop");
+  }
+
+  void test_getElement_component_property_fromMap() {
+    resolveMainSource(_createAngularSource(r'''
+@Component(publishAs: 'ctrl', selector: 'myComp',
+             templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
+             map: const {
+               'prop' : '@field',
+             })
+class MyComponent {
+  var field;
+}'''));
+    // AngularPropertyElement
+    {
+      SimpleStringLiteral node =
+          _findMainNode("prop'", (n) => n is SimpleStringLiteral);
+      int offset = node.offset;
+      // prepare Element
+      Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+      expect(element, isNotNull);
+      // check AngularPropertyElement
+      AngularPropertyElement property = element as AngularPropertyElement;
+      expect(property.name, "prop");
+    }
+    // FieldElement
+    {
+      SimpleStringLiteral node =
+          _findMainNode("@field'", (n) => n is SimpleStringLiteral);
+      int offset = node.offset;
+      // prepare Element
+      Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+      expect(element, isNotNull);
+      // check FieldElement
+      FieldElement field = element as FieldElement;
+      expect(field.name, "field");
+    }
+  }
+
+  void test_getElement_component_selector() {
+    resolveMainSource(_createAngularSource(r'''
+@Component(publishAs: 'ctrl', selector: 'myComp',
+             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
+class MyComponent {}'''));
+    SimpleStringLiteral node =
+        _findMainNode("myComp'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // find AngularSelectorElement
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularSelectorElement,
+        AngularSelectorElement,
+        element);
+  }
+
+  void test_getElement_controller_name() {
+    resolveMainSource(_createAngularSource(r'''
+@Controller(publishAs: 'ctrl', selector: '[myApp]')
+class MyController {
+}'''));
+    SimpleStringLiteral node =
+        _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // find AngularControllerElement
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularControllerElement,
+        AngularControllerElement,
+        element);
+  }
+
+  void test_getElement_directive_property() {
+    resolveMainSource(_createAngularSource(r'''
+@Decorator(selector: '[my-dir]',
+             map: const {
+               'my-dir' : '=>field'
+             })
+class MyDirective {
+  set field(value) {}
+}'''));
+    // prepare node
+    SimpleStringLiteral node =
+        _findMainNode("my-dir'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // prepare Element
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    expect(element, isNotNull);
+    // check AngularPropertyElement
+    AngularPropertyElement property = element as AngularPropertyElement;
+    expect(property.name, "my-dir");
+  }
+
+  void test_getElement_directive_selector() {
+    resolveMainSource(_createAngularSource(r'''
+@Decorator(selector: '[my-dir]')
+class MyDirective {}'''));
+    SimpleStringLiteral node =
+        _findMainNode("my-dir]'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // find AngularSelectorElement
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularSelectorElement,
+        AngularSelectorElement,
+        element);
+  }
+
+  void test_getElement_filter_name() {
+    resolveMainSource(_createAngularSource(r'''
+@Formatter(name: 'myFilter')
+class MyFilter {
+  call(p1, p2) {}
+}'''));
+    SimpleStringLiteral node =
+        _findMainNode("myFilter'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // find FilterElement
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        element);
+  }
+
+  void test_getElement_noClassDeclaration() {
+    resolveMainSource("var foo = 'bar';");
+    SimpleStringLiteral node =
+        _findMainNode("bar'", (n) => n is SimpleStringLiteral);
+    Element element = AngularCompilationUnitBuilder.getElement(node, 0);
+    expect(element, isNull);
+  }
+
+  void test_getElement_noClassElement() {
+    resolveMainSource(r'''
+class A {
+  const A(p);
+}
+
+@A('bar')
+class B {}''');
+    SimpleStringLiteral node =
+        _findMainNode("bar'", (n) => n is SimpleStringLiteral);
+    // reset B element
+    ClassDeclaration classDeclaration =
+        node.getAncestor((node) => node is ClassDeclaration);
+    classDeclaration.name.staticElement = null;
+    // class is not resolved - no element
+    Element element = AngularCompilationUnitBuilder.getElement(node, 0);
+    expect(element, isNull);
+  }
+
+  void test_getElement_noNode() {
+    Element element = AngularCompilationUnitBuilder.getElement(null, 0);
+    expect(element, isNull);
+  }
+
+  void test_getElement_notFound() {
+    resolveMainSource(r'''
+class MyComponent {
+  var str = 'some string';
+}''');
+    // prepare node
+    SimpleStringLiteral node =
+        _findMainNode("some string'", (n) => n is SimpleStringLiteral);
+    int offset = node.offset;
+    // no Element
+    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
+    expect(element, isNull);
+  }
+
+  void test_getElement_SimpleStringLiteral_withToolkitElement() {
+    SimpleStringLiteral literal = AstFactory.string2("foo");
+    Element element = new AngularScopePropertyElementImpl("foo", 0, null);
+    literal.toolkitElement = element;
+    expect(
+        AngularCompilationUnitBuilder.getElement(literal, -1),
+        same(element));
+  }
+
   void test_NgComponent_bad_cannotParseSelector() {
     contextHelper.addSource("/my_template.html", "");
     contextHelper.addSource("/my_styles.css", "");
@@ -599,8 +826,7 @@
   void test_NgComponent_bad_notHtmlTemplate() {
     contextHelper.addSource("/my_template", "");
     contextHelper.addSource("/my_styles.css", "");
-    addMainSource(
-        _createAngularSource(r'''
+    addMainSource(_createAngularSource(r'''
 @NgComponent(publishAs: 'ctrl', selector: 'myComp',
              templateUrl: 'my_template', cssUrl: 'my_styles.css')
 class MyComponent {
@@ -757,8 +983,7 @@
   void test_NgComponent_properties_fieldFromSuper() {
     contextHelper.addSource("/my_template.html", "");
     contextHelper.addSource("/my_styles.css", "");
-    resolveMainSourceNoErrors(
-        _createAngularSource(r'''
+    resolveMainSourceNoErrors(_createAngularSource(r'''
 class MySuper {
   var myPropA;
 }
@@ -792,8 +1017,7 @@
   void test_NgComponent_properties_fromFields() {
     contextHelper.addSource("/my_template.html", "");
     contextHelper.addSource("/my_styles.css", "");
-    resolveMainSourceNoErrors(
-        _createAngularSource(r'''
+    resolveMainSourceNoErrors(_createAngularSource(r'''
 @Component(publishAs: 'ctrl', selector: 'myComp',
              templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
 class MyComponent {
@@ -856,8 +1080,7 @@
   void test_NgComponent_properties_fromMap() {
     contextHelper.addSource("/my_template.html", "");
     contextHelper.addSource("/my_styles.css", "");
-    resolveMainSourceNoErrors(
-        _createAngularSource(r'''
+    resolveMainSourceNoErrors(_createAngularSource(r'''
 @Component(publishAs: 'ctrl', selector: 'myComp',
              templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
              map: const {
@@ -938,9 +1161,13 @@
     expect(component.nameOffset, AngularTest.findOffset(mainContent, "ctrl'"));
     _assertIsTagSelector(component.selector, "myComp");
     expect(component.templateUri, "my_template.html");
-    expect(component.templateUriOffset, AngularTest.findOffset(mainContent, "my_template.html'"));
+    expect(
+        component.templateUriOffset,
+        AngularTest.findOffset(mainContent, "my_template.html'"));
     expect(component.styleUri, "my_styles.css");
-    expect(component.styleUriOffset, AngularTest.findOffset(mainContent, "my_styles.css'"));
+    expect(
+        component.styleUriOffset,
+        AngularTest.findOffset(mainContent, "my_styles.css'"));
     expect(component.properties, hasLength(0));
   }
 
@@ -979,21 +1206,27 @@
       AngularScopePropertyElement property = scopeProperties[0];
       expect(findMainElement2("boolProp"), same(property));
       expect(property.name, "boolProp");
-      expect(property.nameOffset, AngularTest.findOffset(mainContent, "boolProp'"));
+      expect(
+          property.nameOffset,
+          AngularTest.findOffset(mainContent, "boolProp'"));
       expect(property.type.name, "bool");
     }
     {
       AngularScopePropertyElement property = scopeProperties[1];
       expect(findMainElement2("intProp"), same(property));
       expect(property.name, "intProp");
-      expect(property.nameOffset, AngularTest.findOffset(mainContent, "intProp'"));
+      expect(
+          property.nameOffset,
+          AngularTest.findOffset(mainContent, "intProp'"));
       expect(property.type.name, "int");
     }
     {
       AngularScopePropertyElement property = scopeProperties[2];
       expect(findMainElement2("stringProp"), same(property));
       expect(property.name, "stringProp");
-      expect(property.nameOffset, AngularTest.findOffset(mainContent, "stringProp'"));
+      expect(
+          property.nameOffset,
+          AngularTest.findOffset(mainContent, "stringProp'"));
       expect(property.type.name, "String");
     }
   }
@@ -1046,246 +1279,13 @@
   }
 
   void test_NgController_noAnnotationArguments() {
-    String mainContent =
-        _createAngularSource(r'''
+    String mainContent = _createAngularSource(r'''
 @NgController
 class MyController {
 }''');
     resolveMainSource(mainContent);
   }
 
-  void test_bad_notConstructorAnnotation() {
-    String mainContent = r'''
-const MY_ANNOTATION = null;
-@MY_ANNOTATION()
-class MyFilter {
-}''';
-    resolveMainSource(mainContent);
-    // prepare AngularFilterElement
-    ClassElement classElement = mainUnitElement.getType("MyFilter");
-    AngularFormatterElement filter =
-        getAngularElement(classElement, (e) => e is AngularFormatterElement);
-    expect(filter, isNull);
-  }
-
-  void test_getElement_SimpleStringLiteral_withToolkitElement() {
-    SimpleStringLiteral literal = AstFactory.string2("foo");
-    Element element = new AngularScopePropertyElementImpl("foo", 0, null);
-    literal.toolkitElement = element;
-    expect(AngularCompilationUnitBuilder.getElement(literal, -1), same(element));
-  }
-
-  void test_getElement_component_name() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
-             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {}'''));
-    SimpleStringLiteral node =
-        _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // find AngularComponentElement
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularComponentElement,
-        AngularComponentElement,
-        element);
-  }
-
-  void test_getElement_component_property_fromFieldAnnotation() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
-             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {
-  @NgOneWay('prop')
-  var field;
-}'''));
-    // prepare node
-    SimpleStringLiteral node =
-        _findMainNode("prop'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // prepare Element
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    expect(element, isNotNull);
-    // check AngularPropertyElement
-    AngularPropertyElement property = element as AngularPropertyElement;
-    expect(property.name, "prop");
-  }
-
-  void test_getElement_component_property_fromMap() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
-             templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
-             map: const {
-               'prop' : '@field',
-             })
-class MyComponent {
-  var field;
-}'''));
-    // AngularPropertyElement
-    {
-      SimpleStringLiteral node =
-          _findMainNode("prop'", (n) => n is SimpleStringLiteral);
-      int offset = node.offset;
-      // prepare Element
-      Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-      expect(element, isNotNull);
-      // check AngularPropertyElement
-      AngularPropertyElement property = element as AngularPropertyElement;
-      expect(property.name, "prop");
-    }
-    // FieldElement
-    {
-      SimpleStringLiteral node =
-          _findMainNode("@field'", (n) => n is SimpleStringLiteral);
-      int offset = node.offset;
-      // prepare Element
-      Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-      expect(element, isNotNull);
-      // check FieldElement
-      FieldElement field = element as FieldElement;
-      expect(field.name, "field");
-    }
-  }
-
-  void test_getElement_component_selector() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Component(publishAs: 'ctrl', selector: 'myComp',
-             templateUrl: 'my_template.html', cssUrl: 'my_styles.css')
-class MyComponent {}'''));
-    SimpleStringLiteral node =
-        _findMainNode("myComp'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // find AngularSelectorElement
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularSelectorElement,
-        AngularSelectorElement,
-        element);
-  }
-
-  void test_getElement_controller_name() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Controller(publishAs: 'ctrl', selector: '[myApp]')
-class MyController {
-}'''));
-    SimpleStringLiteral node =
-        _findMainNode("ctrl'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // find AngularControllerElement
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularControllerElement,
-        AngularControllerElement,
-        element);
-  }
-
-  void test_getElement_directive_property() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Decorator(selector: '[my-dir]',
-             map: const {
-               'my-dir' : '=>field'
-             })
-class MyDirective {
-  set field(value) {}
-}'''));
-    // prepare node
-    SimpleStringLiteral node =
-        _findMainNode("my-dir'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // prepare Element
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    expect(element, isNotNull);
-    // check AngularPropertyElement
-    AngularPropertyElement property = element as AngularPropertyElement;
-    expect(property.name, "my-dir");
-  }
-
-  void test_getElement_directive_selector() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Decorator(selector: '[my-dir]')
-class MyDirective {}'''));
-    SimpleStringLiteral node =
-        _findMainNode("my-dir]'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // find AngularSelectorElement
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularSelectorElement,
-        AngularSelectorElement,
-        element);
-  }
-
-  void test_getElement_filter_name() {
-    resolveMainSource(
-        _createAngularSource(r'''
-@Formatter(name: 'myFilter')
-class MyFilter {
-  call(p1, p2) {}
-}'''));
-    SimpleStringLiteral node =
-        _findMainNode("myFilter'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // find FilterElement
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        element);
-  }
-
-  void test_getElement_noClassDeclaration() {
-    resolveMainSource("var foo = 'bar';");
-    SimpleStringLiteral node =
-        _findMainNode("bar'", (n) => n is SimpleStringLiteral);
-    Element element = AngularCompilationUnitBuilder.getElement(node, 0);
-    expect(element, isNull);
-  }
-
-  void test_getElement_noClassElement() {
-    resolveMainSource(r'''
-class A {
-  const A(p);
-}
-
-@A('bar')
-class B {}''');
-    SimpleStringLiteral node =
-        _findMainNode("bar'", (n) => n is SimpleStringLiteral);
-    // reset B element
-    ClassDeclaration classDeclaration =
-        node.getAncestor((node) => node is ClassDeclaration);
-    classDeclaration.name.staticElement = null;
-    // class is not resolved - no element
-    Element element = AngularCompilationUnitBuilder.getElement(node, 0);
-    expect(element, isNull);
-  }
-
-  void test_getElement_noNode() {
-    Element element = AngularCompilationUnitBuilder.getElement(null, 0);
-    expect(element, isNull);
-  }
-
-  void test_getElement_notFound() {
-    resolveMainSource(r'''
-class MyComponent {
-  var str = 'some string';
-}''');
-    // prepare node
-    SimpleStringLiteral node =
-        _findMainNode("some string'", (n) => n is SimpleStringLiteral);
-    int offset = node.offset;
-    // no Element
-    Element element = AngularCompilationUnitBuilder.getElement(node, offset);
-    expect(element, isNull);
-  }
-
   void test_parseSelector_hasAttribute() {
     AngularSelectorElement selector =
         AngularCompilationUnitBuilder.parseSelector(42, "[name]");
@@ -1332,7 +1332,9 @@
     expect(selector.name, "tag[attr]");
     expect(selector.nameOffset, -1);
     expect((selector as IsTagHasAttributeSelectorElementImpl).tagName, "tag");
-    expect((selector as IsTagHasAttributeSelectorElementImpl).attributeName, "attr");
+    expect(
+        (selector as IsTagHasAttributeSelectorElementImpl).attributeName,
+        "attr");
   }
 
   void test_parseSelector_unknown() {
@@ -1366,14 +1368,18 @@
       expect(view.templateUri, "my_templateA.html");
       expect(view.name, null);
       expect(view.nameOffset, -1);
-      expect(view.templateUriOffset, AngularTest.findOffset(mainContent, "my_templateA.html'"));
+      expect(
+          view.templateUriOffset,
+          AngularTest.findOffset(mainContent, "my_templateA.html'"));
     }
     {
       AngularViewElement view = views[1];
       expect(view.templateUri, "my_templateB.html");
       expect(view.name, null);
       expect(view.nameOffset, -1);
-      expect(view.templateUriOffset, AngularTest.findOffset(mainContent, "my_templateB.html'"));
+      expect(
+          view.templateUriOffset,
+          AngularTest.findOffset(mainContent, "my_templateB.html'"));
     }
   }
 
@@ -1440,248 +1446,6 @@
 
 
 class AngularHtmlUnitResolverTest extends AngularTest {
-  void test_NgComponent_resolveTemplateFile() {
-    addMainSource(r'''
-import 'angular.dart';
-
-@Component(
-    templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
-    publishAs: 'ctrl',
-    selector: 'myComponent')
-class MyComponent {
-  String field;
-}''');
-    contextHelper.addSource(
-        "/entry-point.html",
-        AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
-<div>
-  {{ctrl.field}}
-</div>''');
-    contextHelper.addSource("/my_styles.css", "");
-    contextHelper.runTasks();
-    resolveIndex();
-    assertNoErrors();
-    assertResolvedIdentifier2("ctrl.", "MyComponent");
-    assertResolvedIdentifier2("field}}", "String");
-  }
-
-  void test_NgComponent_updateDartFile() {
-    Source componentSource = contextHelper.addSource(
-        "/my_component.dart",
-        r'''
-library my.component;
-import 'angular.dart';
-@Component(selector: 'myComponent')
-class MyComponent {
-}''');
-    contextHelper.addSource(
-        "/my_module.dart",
-        r'''
-library my.module;
-import 'my_component.dart';''');
-    addMainSource(r'''
-library main;
-import 'my_module.dart';''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController("<myComponent/>"));
-    // "myComponent" tag was resolved
-    {
-      ht.XmlTagNode tagNode =
-          ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
-      AngularSelectorElement tagElement =
-          tagNode.element as AngularSelectorElement;
-      expect(tagElement, isNotNull);
-      expect(tagElement.name, "myComponent");
-    }
-    // replace "myComponent" with "myComponent2"
-    // in my_component.dart and index.html
-    {
-      context.setContents(
-          componentSource,
-          _getSourceContent(componentSource).replaceAll("myComponent", "myComponent2"));
-      indexContent =
-          _getSourceContent(indexSource).replaceAll("myComponent", "myComponent2");
-      context.setContents(indexSource, indexContent);
-    }
-    contextHelper.runTasks();
-    resolveIndex();
-    // "myComponent2" tag should be resolved
-    {
-      ht.XmlTagNode tagNode =
-          ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent2"));
-      AngularSelectorElement tagElement =
-          tagNode.element as AngularSelectorElement;
-      expect(tagElement, isNotNull);
-      expect(tagElement.name, "myComponent2");
-    }
-  }
-
-  void test_NgComponent_use_resolveAttributes() {
-    contextHelper.addSource(
-        "/my_template.html",
-        r'''
-    <div>
-      {{ctrl.field}}
-    </div>''');
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@Component(
-    templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
-    publishAs: 'ctrl',
-    selector: 'myComponent', // selector
-    map: const {'attrA' : '=>setA', 'attrB' : '@setB'})
-class MyComponent {
-  set setA(value) {}
-  set setB(value) {}
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='someModel'/>
-<myComponent attrA='someModel' attrB='bbb'/>'''));
-    // "attrA" attribute expression was resolved
-    expect(findIdentifier("someModel"), isNotNull);
-    // "myComponent" tag was resolved
-    ht.XmlTagNode tagNode =
-        ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
-    AngularSelectorElement tagElement =
-        tagNode.element as AngularSelectorElement;
-    expect(tagElement, isNotNull);
-    expect(tagElement.name, "myComponent");
-    expect(tagElement.nameOffset, findMainOffset("myComponent', // selector"));
-    // "attrA" attribute was resolved
-    {
-      ht.XmlAttributeNode node =
-          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrA='"));
-      AngularPropertyElement element = node.element as AngularPropertyElement;
-      expect(element, isNotNull);
-      expect(element.name, "attrA");
-      expect(element.field.name, "setA");
-    }
-    // "attrB" attribute was resolved, even if it @binding
-    {
-      ht.XmlAttributeNode node =
-          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrB='"));
-      AngularPropertyElement element = node.element as AngularPropertyElement;
-      expect(element, isNotNull);
-      expect(element.name, "attrB");
-      expect(element.field.name, "setB");
-    }
-  }
-
-  void test_NgDirective_noAttribute() {
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive]', map: const {'foo': '=>input'})
-class MyDirective {
-  set input(value) {}
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<div my-directive>
-</div>'''));
-  }
-
-  void test_NgDirective_noExpression() {
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive]', map: const {'.': '=>input'})
-class MyDirective {
-  set input(value) {}
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<div my-directive>
-</div>'''));
-  }
-
-  void test_NgDirective_resolvedExpression() {
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@Decorator(selector: '[my-directive]')
-class MyDirective {
-  @NgOneWay('my-property')
-  String condition;
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive my-property='name != null'>
-</div>'''));
-    resolveMainNoErrors();
-    // "my-directive" attribute was resolved
-    {
-      AngularSelectorElement selector =
-          findMainElement(ElementKind.ANGULAR_SELECTOR, "my-directive");
-      ht.XmlAttributeNode attrNodeSelector =
-          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-directive"));
-      expect(attrNodeSelector, isNotNull);
-      expect(attrNodeSelector.element, same(selector));
-    }
-    // "my-property" attribute was resolved
-    {
-      ht.XmlAttributeNode attrNodeProperty =
-          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-property='"));
-      AngularPropertyElement propertyElement =
-          attrNodeProperty.element as AngularPropertyElement;
-      expect(propertyElement, isNotNull);
-      expect(propertyElement.propertyKind, same(AngularPropertyKind.ONE_WAY));
-      expect(propertyElement.field.name, "condition");
-    }
-    // "name" expression was resolved
-    expect(findIdentifier("name != null"), isNotNull);
-  }
-
-  void test_NgDirective_resolvedExpression_attrString() {
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@NgDirective(selector: '[my-directive])
-class MyDirective {
-  @NgAttr('my-property')
-  String property;
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive my-property='name != null'>
-</div>'''));
-    resolveMain();
-    // @NgAttr means "string attribute", which we don't parse
-    expect(findIdentifierMaybe("name != null"), isNull);
-  }
-
-  void test_NgDirective_resolvedExpression_dotAsName() {
-    addMainSource(r'''
-
-import 'angular.dart';
-
-@Decorator(
-    selector: '[my-directive]',
-    map: const {'.' : '=>condition'})
-class MyDirective {
-  set condition(value) {}
-}''');
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<input type='text' ng-model='name'>
-<div my-directive='name != null'>
-</div>'''));
-    // "name" attribute was resolved
-    expect(findIdentifier("name != null"), isNotNull);
-  }
-
   void fail_analysisContext_changeDart_invalidateApplication() {
     addMainSource(r'''
 
@@ -1696,9 +1460,7 @@
     contextHelper.addSource(
         "/entry-point.html",
         AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
+    addIndexSource2("/my_template.html", r'''
 <div>
   {{ctrl.noMethod()}}
 </div>''');
@@ -1719,6 +1481,168 @@
     }
   }
 
+  void fail_ngRepeat_additionalVariables() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='name in ctrl.names'>
+  {{$index}} {{$first}} {{$middle}} {{$last}} {{$even}} {{$odd}}
+</li>'''));
+    assertResolvedIdentifier2("\$index", "int");
+    assertResolvedIdentifier2("\$first", "bool");
+    assertResolvedIdentifier2("\$middle", "bool");
+    assertResolvedIdentifier2("\$last", "bool");
+    assertResolvedIdentifier2("\$even", "bool");
+    assertResolvedIdentifier2("\$odd", "bool");
+  }
+
+  void fail_ngRepeat_bad_expectedIdentifier() {
+    addMyController();
+    resolveIndex2(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='name + 42 in ctrl.names'>
+</li>'''));
+    assertErrors(indexSource, [AngularCode.INVALID_REPEAT_ITEM_SYNTAX]);
+  }
+
+  void fail_ngRepeat_bad_expectedIn() {
+    addMyController();
+    resolveIndex2(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='name : ctrl.names'>
+</li>'''));
+    assertErrors(indexSource, [AngularCode.INVALID_REPEAT_SYNTAX]);
+  }
+
+  void fail_ngRepeat_filters_filter_literal() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='item in ctrl.items | filter:42:null'/>
+</li>'''));
+    // filter "filter" is resolved
+    Element filterElement = assertResolvedIdentifier("filter");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        filterElement);
+  }
+
+  void fail_ngRepeat_filters_filter_propertyMap() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='item in ctrl.items | filter:{name:null, done:false}'/>
+</li>'''));
+    assertResolvedIdentifier2("name:", "String");
+    assertResolvedIdentifier2("done:", "bool");
+  }
+
+  void fail_ngRepeat_filters_missingColon() {
+    addMyController();
+    resolveIndex2(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'' true"/>
+</li>'''));
+    assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
+  }
+
+  void fail_ngRepeat_filters_noArgs() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy"/>
+</li>'''));
+    // filter "orderBy" is resolved
+    Element filterElement = assertResolvedIdentifier("orderBy");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        filterElement);
+  }
+
+  void fail_ngRepeat_filters_orderBy_emptyString() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'':true"/>
+</li>'''));
+    // filter "orderBy" is resolved
+    Element filterElement = assertResolvedIdentifier("orderBy");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        filterElement);
+  }
+
+  void fail_ngRepeat_filters_orderBy_propertyList() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:['name', 'done']"/>
+</li>'''));
+    assertResolvedIdentifier2("name'", "String");
+    assertResolvedIdentifier2("done'", "bool");
+  }
+
+  void fail_ngRepeat_filters_orderBy_propertyName() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'name'"/>
+</li>'''));
+    assertResolvedIdentifier2("name'", "String");
+  }
+
+  void fail_ngRepeat_filters_orderBy_propertyName_minus() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'-name'"/>
+</li>'''));
+    assertResolvedIdentifier2("name'", "String");
+  }
+
+  void fail_ngRepeat_filters_orderBy_propertyName_plus() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'+name'"/>
+</li>'''));
+    assertResolvedIdentifier2("name'", "String");
+  }
+
+  void fail_ngRepeat_filters_orderBy_propertyName_untypedItems() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.untypedItems | orderBy:'name'"/>
+</li>'''));
+    assertResolvedIdentifier2("name'", "dynamic");
+  }
+
+  void fail_ngRepeat_filters_two() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat="item in ctrl.items | orderBy:'+' | orderBy:'-'"/>
+</li>'''));
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        assertResolvedIdentifier("orderBy:'+'"));
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularFormatterElement,
+        AngularFormatterElement,
+        assertResolvedIdentifier("orderBy:'-'"));
+  }
+
+  void fail_ngRepeat_resolvedExpressions() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='name in ctrl.names'>
+  {{name}}
+</li>'''));
+    assertResolvedIdentifier2("name in", "String");
+    assertResolvedIdentifier2("ctrl.", "MyController");
+    assertResolvedIdentifier2("names'", "List<String>");
+    assertResolvedIdentifier2("name}}", "String");
+  }
+
+  void fail_ngRepeat_trackBy() {
+    addMyController();
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<li ng-repeat='name in ctrl.names track by name.length'/>
+</li>'''));
+    assertResolvedIdentifier2("length'", "int");
+  }
+
   void test_analysisContext_changeEntryPoint_clearAngularErrors_inDart() {
     addMainSource(r'''
 
@@ -1763,9 +1687,7 @@
     Source entrySource = contextHelper.addSource(
         "/entry-point.html",
         AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
+    addIndexSource2("/my_template.html", r'''
 <div>
   {{ctrl.noMethod()}}
 </div>''');
@@ -1821,8 +1743,7 @@
 
   void test_contextProperties() {
     addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithAngular(r'''
+    _resolveIndexNoErrors(AngularTest.createHtmlWithAngular(r'''
 <div>
   {{$id}}
   {{$parent}}
@@ -1845,7 +1766,9 @@
     // set AngularElement
     AngularElement angularElement = new AngularControllerElementImpl("ctrl", 0);
     local.toolkitObjects = <AngularElement>[angularElement];
-    expect(AngularHtmlUnitResolver.getAngularElement(local), same(angularElement));
+    expect(
+        AngularHtmlUnitResolver.getAngularElement(local),
+        same(angularElement));
   }
 
   void test_getAngularElement_notAngular() {
@@ -1864,10 +1787,239 @@
   void test_ngClick() {
     addMyController();
     _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r"<button ng-click='ctrl.doSomething($event)'/>"));
+        AngularTest.createHtmlWithMyController(
+            r"<button ng-click='ctrl.doSomething($event)'/>"));
     assertResolvedIdentifier("doSomething");
   }
 
+  void test_NgComponent_resolveTemplateFile() {
+    addMainSource(r'''
+import 'angular.dart';
+
+@Component(
+    templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
+    publishAs: 'ctrl',
+    selector: 'myComponent')
+class MyComponent {
+  String field;
+}''');
+    contextHelper.addSource(
+        "/entry-point.html",
+        AngularTest.createHtmlWithAngular(''));
+    addIndexSource2("/my_template.html", r'''
+<div>
+  {{ctrl.field}}
+</div>''');
+    contextHelper.addSource("/my_styles.css", "");
+    contextHelper.runTasks();
+    resolveIndex();
+    assertNoErrors();
+    assertResolvedIdentifier2("ctrl.", "MyComponent");
+    assertResolvedIdentifier2("field}}", "String");
+  }
+
+  void test_NgComponent_updateDartFile() {
+    Source componentSource = contextHelper.addSource("/my_component.dart", r'''
+library my.component;
+import 'angular.dart';
+@Component(selector: 'myComponent')
+class MyComponent {
+}''');
+    contextHelper.addSource("/my_module.dart", r'''
+library my.module;
+import 'my_component.dart';''');
+    addMainSource(r'''
+library main;
+import 'my_module.dart';''');
+    _resolveIndexNoErrors(
+        AngularTest.createHtmlWithMyController("<myComponent/>"));
+    // "myComponent" tag was resolved
+    {
+      ht.XmlTagNode tagNode =
+          ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
+      AngularSelectorElement tagElement =
+          tagNode.element as AngularSelectorElement;
+      expect(tagElement, isNotNull);
+      expect(tagElement.name, "myComponent");
+    }
+    // replace "myComponent" with "myComponent2"
+    // in my_component.dart and index.html
+    {
+      context.setContents(
+          componentSource,
+          _getSourceContent(componentSource).replaceAll("myComponent", "myComponent2"));
+      indexContent =
+          _getSourceContent(indexSource).replaceAll("myComponent", "myComponent2");
+      context.setContents(indexSource, indexContent);
+    }
+    contextHelper.runTasks();
+    resolveIndex();
+    // "myComponent2" tag should be resolved
+    {
+      ht.XmlTagNode tagNode =
+          ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent2"));
+      AngularSelectorElement tagElement =
+          tagNode.element as AngularSelectorElement;
+      expect(tagElement, isNotNull);
+      expect(tagElement.name, "myComponent2");
+    }
+  }
+
+  void test_NgComponent_use_resolveAttributes() {
+    contextHelper.addSource("/my_template.html", r'''
+    <div>
+      {{ctrl.field}}
+    </div>''');
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@Component(
+    templateUrl: 'my_template.html', cssUrl: 'my_styles.css',
+    publishAs: 'ctrl',
+    selector: 'myComponent', // selector
+    map: const {'attrA' : '=>setA', 'attrB' : '@setB'})
+class MyComponent {
+  set setA(value) {}
+  set setB(value) {}
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<input type='text' ng-model='someModel'/>
+<myComponent attrA='someModel' attrB='bbb'/>'''));
+    // "attrA" attribute expression was resolved
+    expect(findIdentifier("someModel"), isNotNull);
+    // "myComponent" tag was resolved
+    ht.XmlTagNode tagNode =
+        ht.HtmlUnitUtils.getTagNode(indexUnit, findOffset2("myComponent"));
+    AngularSelectorElement tagElement =
+        tagNode.element as AngularSelectorElement;
+    expect(tagElement, isNotNull);
+    expect(tagElement.name, "myComponent");
+    expect(tagElement.nameOffset, findMainOffset("myComponent', // selector"));
+    // "attrA" attribute was resolved
+    {
+      ht.XmlAttributeNode node =
+          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrA='"));
+      AngularPropertyElement element = node.element as AngularPropertyElement;
+      expect(element, isNotNull);
+      expect(element.name, "attrA");
+      expect(element.field.name, "setA");
+    }
+    // "attrB" attribute was resolved, even if it @binding
+    {
+      ht.XmlAttributeNode node =
+          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("attrB='"));
+      AngularPropertyElement element = node.element as AngularPropertyElement;
+      expect(element, isNotNull);
+      expect(element.name, "attrB");
+      expect(element.field.name, "setB");
+    }
+  }
+
+  void test_NgDirective_noAttribute() {
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@NgDirective(selector: '[my-directive]', map: const {'foo': '=>input'})
+class MyDirective {
+  set input(value) {}
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<div my-directive>
+</div>'''));
+  }
+
+  void test_NgDirective_noExpression() {
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@NgDirective(selector: '[my-directive]', map: const {'.': '=>input'})
+class MyDirective {
+  set input(value) {}
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<div my-directive>
+</div>'''));
+  }
+
+  void test_NgDirective_resolvedExpression() {
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@Decorator(selector: '[my-directive]')
+class MyDirective {
+  @NgOneWay('my-property')
+  String condition;
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<input type='text' ng-model='name'>
+<div my-directive my-property='name != null'>
+</div>'''));
+    resolveMainNoErrors();
+    // "my-directive" attribute was resolved
+    {
+      AngularSelectorElement selector =
+          findMainElement(ElementKind.ANGULAR_SELECTOR, "my-directive");
+      ht.XmlAttributeNode attrNodeSelector =
+          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-directive"));
+      expect(attrNodeSelector, isNotNull);
+      expect(attrNodeSelector.element, same(selector));
+    }
+    // "my-property" attribute was resolved
+    {
+      ht.XmlAttributeNode attrNodeProperty =
+          ht.HtmlUnitUtils.getAttributeNode(indexUnit, findOffset2("my-property='"));
+      AngularPropertyElement propertyElement =
+          attrNodeProperty.element as AngularPropertyElement;
+      expect(propertyElement, isNotNull);
+      expect(propertyElement.propertyKind, same(AngularPropertyKind.ONE_WAY));
+      expect(propertyElement.field.name, "condition");
+    }
+    // "name" expression was resolved
+    expect(findIdentifier("name != null"), isNotNull);
+  }
+
+  void test_NgDirective_resolvedExpression_attrString() {
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@NgDirective(selector: '[my-directive])
+class MyDirective {
+  @NgAttr('my-property')
+  String property;
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<input type='text' ng-model='name'>
+<div my-directive my-property='name != null'>
+</div>'''));
+    resolveMain();
+    // @NgAttr means "string attribute", which we don't parse
+    expect(findIdentifierMaybe("name != null"), isNull);
+  }
+
+  void test_NgDirective_resolvedExpression_dotAsName() {
+    addMainSource(r'''
+
+import 'angular.dart';
+
+@Decorator(
+    selector: '[my-directive]',
+    map: const {'.' : '=>condition'})
+class MyDirective {
+  set condition(value) {}
+}''');
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
+<input type='text' ng-model='name'>
+<div my-directive='name != null'>
+</div>'''));
+    // "name" attribute was resolved
+    expect(findIdentifier("name != null"), isNotNull);
+  }
+
   /**
    * Test that we resolve "ng-if" expression.
    */
@@ -1880,8 +2032,7 @@
 
   void test_ngModel_modelAfterUsage() {
     addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
 <h3>Hello {{name}}!</h3>
 <input type='text' ng-model='name'>'''));
     assertResolvedIdentifier2("name}}!", "String");
@@ -1890,8 +2041,7 @@
 
   void test_ngModel_modelBeforeUsage() {
     addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
+    _resolveIndexNoErrors(AngularTest.createHtmlWithMyController(r'''
 <input type='text' ng-model='name'>
 <h3>Hello {{name}}!</h3>'''));
     assertResolvedIdentifier2("name}}!", "String");
@@ -1903,7 +2053,8 @@
   void test_ngModel_notIdentifier() {
     addMyController();
     _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController("<input type='text' ng-model='ctrl.field'>"));
+        AngularTest.createHtmlWithMyController(
+            "<input type='text' ng-model='ctrl.field'>"));
     assertResolvedIdentifier2("field'>", "String");
   }
 
@@ -1913,188 +2064,11 @@
   void test_ngMouseOut() {
     addMyController();
     _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r"<button ng-mouseout='ctrl.doSomething($event)'/>"));
+        AngularTest.createHtmlWithMyController(
+            r"<button ng-mouseout='ctrl.doSomething($event)'/>"));
     assertResolvedIdentifier("doSomething");
   }
 
-  void fail_ngRepeat_additionalVariables() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names'>
-  {{$index}} {{$first}} {{$middle}} {{$last}} {{$even}} {{$odd}}
-</li>'''));
-    assertResolvedIdentifier2("\$index", "int");
-    assertResolvedIdentifier2("\$first", "bool");
-    assertResolvedIdentifier2("\$middle", "bool");
-    assertResolvedIdentifier2("\$last", "bool");
-    assertResolvedIdentifier2("\$even", "bool");
-    assertResolvedIdentifier2("\$odd", "bool");
-  }
-
-  void fail_ngRepeat_bad_expectedIdentifier() {
-    addMyController();
-    resolveIndex2(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name + 42 in ctrl.names'>
-</li>'''));
-    assertErrors(indexSource, [AngularCode.INVALID_REPEAT_ITEM_SYNTAX]);
-  }
-
-  void fail_ngRepeat_bad_expectedIn() {
-    addMyController();
-    resolveIndex2(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name : ctrl.names'>
-</li>'''));
-    assertErrors(indexSource, [AngularCode.INVALID_REPEAT_SYNTAX]);
-  }
-
-  void fail_ngRepeat_filters_filter_literal() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='item in ctrl.items | filter:42:null'/>
-</li>'''));
-    // filter "filter" is resolved
-    Element filterElement = assertResolvedIdentifier("filter");
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        filterElement);
-  }
-
-  void fail_ngRepeat_filters_filter_propertyMap() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='item in ctrl.items | filter:{name:null, done:false}'/>
-</li>'''));
-    assertResolvedIdentifier2("name:", "String");
-    assertResolvedIdentifier2("done:", "bool");
-  }
-
-  void fail_ngRepeat_filters_missingColon() {
-    addMyController();
-    resolveIndex2(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'' true"/>
-</li>'''));
-    assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
-  }
-
-  void fail_ngRepeat_filters_noArgs() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy"/>
-</li>'''));
-    // filter "orderBy" is resolved
-    Element filterElement = assertResolvedIdentifier("orderBy");
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        filterElement);
-  }
-
-  void fail_ngRepeat_filters_orderBy_emptyString() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'':true"/>
-</li>'''));
-    // filter "orderBy" is resolved
-    Element filterElement = assertResolvedIdentifier("orderBy");
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        filterElement);
-  }
-
-  void fail_ngRepeat_filters_orderBy_propertyList() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:['name', 'done']"/>
-</li>'''));
-    assertResolvedIdentifier2("name'", "String");
-    assertResolvedIdentifier2("done'", "bool");
-  }
-
-  void fail_ngRepeat_filters_orderBy_propertyName() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'name'"/>
-</li>'''));
-    assertResolvedIdentifier2("name'", "String");
-  }
-
-  void fail_ngRepeat_filters_orderBy_propertyName_minus() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'-name'"/>
-</li>'''));
-    assertResolvedIdentifier2("name'", "String");
-  }
-
-  void fail_ngRepeat_filters_orderBy_propertyName_plus() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'+name'"/>
-</li>'''));
-    assertResolvedIdentifier2("name'", "String");
-  }
-
-  void fail_ngRepeat_filters_orderBy_propertyName_untypedItems() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.untypedItems | orderBy:'name'"/>
-</li>'''));
-    assertResolvedIdentifier2("name'", "dynamic");
-  }
-
-  void fail_ngRepeat_filters_two() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat="item in ctrl.items | orderBy:'+' | orderBy:'-'"/>
-</li>'''));
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        assertResolvedIdentifier("orderBy:'+'"));
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularFormatterElement,
-        AngularFormatterElement,
-        assertResolvedIdentifier("orderBy:'-'"));
-  }
-
-  void fail_ngRepeat_resolvedExpressions() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names'>
-  {{name}}
-</li>'''));
-    assertResolvedIdentifier2("name in", "String");
-    assertResolvedIdentifier2("ctrl.", "MyController");
-    assertResolvedIdentifier2("names'", "List<String>");
-    assertResolvedIdentifier2("name}}", "String");
-  }
-
-  void fail_ngRepeat_trackBy() {
-    addMyController();
-    _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController(r'''
-<li ng-repeat='name in ctrl.names track by name.length'/>
-</li>'''));
-    assertResolvedIdentifier2("length'", "int");
-  }
-
   /**
    * Test that we resolve "ng-show" expression.
    */
@@ -2217,7 +2191,8 @@
   void test_resolveExpression_inAttribute() {
     addMyController();
     _resolveIndexNoErrors(
-        AngularTest.createHtmlWithMyController("<button title='{{ctrl.field}}'></button>"));
+        AngularTest.createHtmlWithMyController(
+            "<button title='{{ctrl.field}}'></button>"));
     assertResolvedIdentifier2("ctrl", "MyController");
   }
 
@@ -2246,7 +2221,8 @@
   void test_resolveExpression_withFormatter_missingColon() {
     addMyController();
     resolveIndex2(
-        AngularTest.createHtmlWithMyController("{{ctrl.field | uppercase, lowercase}}"));
+        AngularTest.createHtmlWithMyController(
+            "{{ctrl.field | uppercase, lowercase}}"));
     assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
   }
 
@@ -2276,9 +2252,7 @@
     contextHelper.addSource(
         "/entry-point.html",
         AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
+    addIndexSource2("/my_template.html", r'''
 <div>
   {{scopeProperty}}
 </div>''');
@@ -2313,9 +2287,7 @@
     contextHelper.addSource(
         "/entry-point.html",
         AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
+    addIndexSource2("/my_template.html", r'''
 <div>
   {{ctrl}}
 </div>''');
@@ -2353,9 +2325,7 @@
     contextHelper.addSource(
         "/entry-point.html",
         AngularTest.createHtmlWithAngular(''));
-    addIndexSource2(
-        "/my_template.html",
-        r'''
+    addIndexSource2("/my_template.html", r'''
 <div my-controller>
   {{ctrl.field}}
 </div>''');
@@ -2383,36 +2353,6 @@
  * Tests for [HtmlUnitUtils] for Angular HTMLs.
  */
 class AngularHtmlUnitUtilsTest extends AngularTest {
-  void test_getElementToOpen_controller() {
-    addMyController();
-    _resolveSimpleCtrlFieldHtml();
-    // prepare expression
-    int offset = indexContent.indexOf("ctrl");
-    Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
-    // get element
-    Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is AngularControllerElement,
-        AngularControllerElement,
-        element);
-    expect(element.name, "ctrl");
-  }
-
-  void test_getElementToOpen_field() {
-    addMyController();
-    _resolveSimpleCtrlFieldHtml();
-    // prepare expression
-    int offset = indexContent.indexOf("field");
-    Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
-    // get element
-    Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is PropertyAccessorElement,
-        PropertyAccessorElement,
-        element);
-    expect(element.name, "field");
-  }
-
   void test_getElement_forExpression() {
     addMyController();
     _resolveSimpleCtrlFieldHtml();
@@ -2453,6 +2393,36 @@
     }
   }
 
+  void test_getElementToOpen_controller() {
+    addMyController();
+    _resolveSimpleCtrlFieldHtml();
+    // prepare expression
+    int offset = indexContent.indexOf("ctrl");
+    Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
+    // get element
+    Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AngularControllerElement,
+        AngularControllerElement,
+        element);
+    expect(element.name, "ctrl");
+  }
+
+  void test_getElementToOpen_field() {
+    addMyController();
+    _resolveSimpleCtrlFieldHtml();
+    // prepare expression
+    int offset = indexContent.indexOf("field");
+    Expression expression = ht.HtmlUnitUtils.getExpression(indexUnit, offset);
+    // get element
+    Element element = ht.HtmlUnitUtils.getElementToOpen(indexUnit, expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PropertyAccessorElement,
+        PropertyAccessorElement,
+        element);
+    expect(element.name, "field");
+  }
+
   void test_getEnclosingTagNode() {
     resolveIndex2(r'''
 <html>
@@ -2484,7 +2454,9 @@
     expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset), isNotNull);
     expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset + 1), isNotNull);
     expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset + 2), isNotNull);
-    expect(ht.HtmlUnitUtils.getExpression(indexUnit, offset + "ctrl.field".length), isNotNull);
+    expect(
+        ht.HtmlUnitUtils.getExpression(indexUnit, offset + "ctrl.field".length),
+        isNotNull);
     // try without unit
     expect(ht.HtmlUnitUtils.getExpression(null, offset), isNull);
   }
@@ -2608,7 +2580,8 @@
    * @throws AssertionFailedError if a different number of errors have been reported than were
    *           expected
    */
-  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes =
+      ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     AnalysisErrorInfo errorsInfo = context.getErrors(source);
     for (AnalysisError error in errorsInfo.errors) {
@@ -2814,9 +2787,7 @@
   }
 
   void _configureForAngular(AnalysisContextHelper contextHelper) {
-    contextHelper.addSource(
-        "/angular.dart",
-        r'''
+    contextHelper.addSource("/angular.dart", r'''
 library angular;
 
 class Scope {
@@ -3183,25 +3154,25 @@
     _assertValue(false, "'a' == 'b'");
   }
 
-  void test_greaterThanOrEqual_int_int() {
-    _assertValue(false, "2 >= 3");
-  }
-
   void test_greaterThan_int_int() {
     _assertValue(false, "2 > 3");
   }
 
+  void test_greaterThanOrEqual_int_int() {
+    _assertValue(false, "2 >= 3");
+  }
+
   void test_leftShift_int_int() {
     _assertValue3(64, "16 << 2");
   }
-  void test_lessThanOrEqual_int_int() {
-    _assertValue(true, "2 <= 3");
-  }
-
   void test_lessThan_int_int() {
     _assertValue(true, "2 < 3");
   }
 
+  void test_lessThanOrEqual_int_int() {
+    _assertValue(true, "2 <= 3");
+  }
+
   void test_literal_boolean_false() {
     _assertValue(false, "false");
   }
@@ -3557,16 +3528,12 @@
   }
 
   void test_computeValues_multipleSources() {
-    Source librarySource = addNamedSource(
-        "/lib.dart",
-        r'''
+    Source librarySource = addNamedSource("/lib.dart", r'''
 library lib;
 part 'part.dart';
 const int c = b;
 const int a = 0;''');
-    Source partSource = addNamedSource(
-        "/part.dart",
-        r'''
+    Source partSource = addNamedSource("/part.dart", r'''
 part of lib;
 const int b = a;
 const int d = c;''');
@@ -3754,8 +3721,7 @@
 const A a = const A.foo();
 class A {
   const A.foo() : this.bar();
-}''',
-        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
+}''', [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
   }
 
   void test_dependencyOnNonFactoryRedirect_toNonConst() {
@@ -3804,11 +3770,15 @@
   }
 
   void test_fromEnvironment_bool_default_overridden() {
-    expect(_assertValidBool(_check_fromEnvironment_bool("false", "true")), false);
+    expect(
+        _assertValidBool(_check_fromEnvironment_bool("false", "true")),
+        false);
   }
 
   void test_fromEnvironment_bool_default_parseError() {
-    expect(_assertValidBool(_check_fromEnvironment_bool("parseError", "true")), true);
+    expect(
+        _assertValidBool(_check_fromEnvironment_bool("parseError", "true")),
+        true);
   }
 
   void test_fromEnvironment_bool_default_true() {
@@ -3820,7 +3790,9 @@
   }
 
   void test_fromEnvironment_bool_parseError() {
-    expect(_assertValidBool(_check_fromEnvironment_bool("parseError", null)), false);
+    expect(
+        _assertValidBool(_check_fromEnvironment_bool("parseError", null)),
+        false);
   }
 
   void test_fromEnvironment_bool_true() {
@@ -3836,7 +3808,9 @@
   }
 
   void test_fromEnvironment_int_default_parseError() {
-    expect(_assertValidInt(_check_fromEnvironment_int("parseError", "123")), 123);
+    expect(
+        _assertValidInt(_check_fromEnvironment_int("parseError", "123")),
+        123);
   }
 
   void test_fromEnvironment_int_default_undeclared() {
@@ -3864,11 +3838,15 @@
   }
 
   void test_fromEnvironment_string_default_overridden() {
-    expect(_assertValidString(_check_fromEnvironment_string("abc", "'def'")), "abc");
+    expect(
+        _assertValidString(_check_fromEnvironment_string("abc", "'def'")),
+        "abc");
   }
 
   void test_fromEnvironment_string_default_undeclared() {
-    expect(_assertValidString(_check_fromEnvironment_string(null, "'def'")), "def");
+    expect(
+        _assertValidString(_check_fromEnvironment_string(null, "'def'")),
+        "def");
   }
 
   void test_fromEnvironment_string_empty() {
@@ -3876,7 +3854,9 @@
   }
 
   void test_fromEnvironment_string_ok() {
-    expect(_assertValidString(_check_fromEnvironment_string("abc", null)), "abc");
+    expect(
+        _assertValidString(_check_fromEnvironment_string("abc", null)),
+        "abc");
   }
 
   void test_fromEnvironment_string_undeclared() {
@@ -4060,9 +4040,8 @@
   const A.a2() : x = 5;
   final int x;
 }''');
-    Map<String, DartObjectImpl> aFields = _assertType(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"),
-        "A");
+    Map<String, DartObjectImpl> aFields =
+        _assertType(_evaluateInstanceCreationExpression(compilationUnit, "foo"), "A");
     _assertIntField(aFields, 'x', 5);
   }
 
@@ -4074,9 +4053,8 @@
   const A.a2(x) : y = x + 10;
   final int y;
 }''');
-    Map<String, DartObjectImpl> aFields = _assertType(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"),
-        "A");
+    Map<String, DartObjectImpl> aFields =
+        _assertType(_evaluateInstanceCreationExpression(compilationUnit, "foo"), "A");
     _assertIntField(aFields, 'y', 111);
   }
 
@@ -4102,9 +4080,8 @@
   const A.a2([x = 100]) : y = x + 10;
   final int y;
 }''');
-    Map<String, DartObjectImpl> aFields = _assertType(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"),
-        "A");
+    Map<String, DartObjectImpl> aFields =
+        _assertType(_evaluateInstanceCreationExpression(compilationUnit, "foo"), "A");
     _assertIntField(aFields, 'y', 110);
   }
 
@@ -4145,9 +4122,8 @@
   const A() : x = 5;
   final int x;
 }''');
-    Map<String, DartObjectImpl> aFields = _assertType(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"),
-        "A");
+    Map<String, DartObjectImpl> aFields =
+        _assertType(_evaluateInstanceCreationExpression(compilationUnit, "foo"), "A");
     _assertIntField(aFields, 'x', 5);
   }
 
@@ -4165,6 +4141,44 @@
         "B");
   }
 
+  void test_instanceCreationExpression_redirect_cycle() {
+    // It is an error to have a cycle in factory redirects; however, we need
+    // to make sure that even if the error occurs, attempting to evaluate the
+    // constant will terminate.
+    CompilationUnit compilationUnit = resolveSource(r'''
+const foo = const A();
+class A {
+  const factory A() = A.b;
+  const factory A.b() = A;
+}''');
+    _assertValidUnknown(
+        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
+  }
+
+  void test_instanceCreationExpression_redirect_extern() {
+    CompilationUnit compilationUnit = resolveSource(r'''
+const foo = const A();
+class A {
+  external const factory A();
+}''');
+    _assertValidUnknown(
+        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
+  }
+
+  void test_instanceCreationExpression_redirect_nonConst() {
+    // It is an error for a const factory constructor redirect to a non-const
+    // constructor; however, we need to make sure that even if the error
+    // attempting to evaluate the constant won't cause a crash.
+    CompilationUnit compilationUnit = resolveSource(r'''
+const foo = const A();
+class A {
+  const factory A() = A.b;
+  A.b();
+}''');
+    _assertValidUnknown(
+        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
+  }
+
   void test_instanceCreationExpression_redirectWithTypeParams() {
     CompilationUnit compilationUnit = resolveSource(r'''
 class A {
@@ -4206,44 +4220,6 @@
     _assertIntField(fields, "x", 10);
   }
 
-  void test_instanceCreationExpression_redirect_cycle() {
-    // It is an error to have a cycle in factory redirects; however, we need
-    // to make sure that even if the error occurs, attempting to evaluate the
-    // constant will terminate.
-    CompilationUnit compilationUnit = resolveSource(r'''
-const foo = const A();
-class A {
-  const factory A() = A.b;
-  const factory A.b() = A;
-}''');
-    _assertValidUnknown(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
-  }
-
-  void test_instanceCreationExpression_redirect_extern() {
-    CompilationUnit compilationUnit = resolveSource(r'''
-const foo = const A();
-class A {
-  external const factory A();
-}''');
-    _assertValidUnknown(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
-  }
-
-  void test_instanceCreationExpression_redirect_nonConst() {
-    // It is an error for a const factory constructor redirect to a non-const
-    // constructor; however, we need to make sure that even if the error
-    // attempting to evaluate the constant won't cause a crash.
-    CompilationUnit compilationUnit = resolveSource(r'''
-const foo = const A();
-class A {
-  const factory A() = A.b;
-  A.b();
-}''');
-    _assertValidUnknown(
-        _evaluateInstanceCreationExpression(compilationUnit, "foo"));
-  }
-
   void test_instanceCreationExpression_symbol() {
     CompilationUnit compilationUnit =
         resolveSource("const foo = const Symbol('a');");
@@ -4395,33 +4371,46 @@
     expect(value.isUnknown, isTrue);
   }
 
-  void _checkInstanceCreationOptionalParams(bool isFieldFormal, bool isNamed,
-      bool hasDefault) {
-    String fieldName = "j";
-    String paramName = isFieldFormal ? fieldName : "i";
-    String formalParam =
-        "${isFieldFormal ? "this." : "int "}$paramName${hasDefault ? " = 3" : ""}";
-    CompilationUnit compilationUnit = resolveSource("""
-const x = const A();
-const y = const A(${isNamed ? '$paramName: ' : ''}10);
-class A {
-  const A(${isNamed ? "{$formalParam}" : "[$formalParam]"})${isFieldFormal ? "" : " : $fieldName = $paramName"};
-  final int $fieldName;
-}""");
-    EvaluationResultImpl x =
-        _evaluateInstanceCreationExpression(compilationUnit, "x");
-    Map<String, DartObjectImpl> fieldsOfX = _assertType(x, "A");
-    expect(fieldsOfX, hasLength(1));
-    if (hasDefault) {
-      _assertIntField(fieldsOfX, fieldName, 3);
-    } else {
-      _assertNullField(fieldsOfX, fieldName);
+  EvaluationResultImpl _check_fromEnvironment_bool(String valueInEnvironment,
+      String defaultExpr) {
+    String envVarName = "x";
+    String varName = "foo";
+    if (valueInEnvironment != null) {
+      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
     }
-    EvaluationResultImpl y =
-        _evaluateInstanceCreationExpression(compilationUnit, "y");
-    Map<String, DartObjectImpl> fieldsOfY = _assertType(y, "A");
-    expect(fieldsOfY, hasLength(1));
-    _assertIntField(fieldsOfY, fieldName, 10);
+    String defaultArg =
+        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
+    CompilationUnit compilationUnit = resolveSource(
+        "const $varName = const bool.fromEnvironment('$envVarName'$defaultArg);");
+    return _evaluateInstanceCreationExpression(compilationUnit, varName);
+  }
+
+  EvaluationResultImpl _check_fromEnvironment_int(String valueInEnvironment,
+      String defaultExpr) {
+    String envVarName = "x";
+    String varName = "foo";
+    if (valueInEnvironment != null) {
+      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
+    }
+    String defaultArg =
+        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
+    CompilationUnit compilationUnit = resolveSource(
+        "const $varName = const int.fromEnvironment('$envVarName'$defaultArg);");
+    return _evaluateInstanceCreationExpression(compilationUnit, varName);
+  }
+
+  EvaluationResultImpl _check_fromEnvironment_string(String valueInEnvironment,
+      String defaultExpr) {
+    String envVarName = "x";
+    String varName = "foo";
+    if (valueInEnvironment != null) {
+      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
+    }
+    String defaultArg =
+        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
+    CompilationUnit compilationUnit = resolveSource(
+        "const $varName = const String.fromEnvironment('$envVarName'$defaultArg);");
+    return _evaluateInstanceCreationExpression(compilationUnit, varName);
   }
 
   void _checkInstanceCreation_withSupertypeParams(bool isExplicit) {
@@ -4450,46 +4439,33 @@
     _assertFieldType(c_int_num_fields, GenericState.SUPERCLASS_FIELD, "A<num>");
   }
 
-  EvaluationResultImpl _check_fromEnvironment_bool(String valueInEnvironment,
-      String defaultExpr) {
-    String envVarName = "x";
-    String varName = "foo";
-    if (valueInEnvironment != null) {
-      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
+  void _checkInstanceCreationOptionalParams(bool isFieldFormal, bool isNamed,
+      bool hasDefault) {
+    String fieldName = "j";
+    String paramName = isFieldFormal ? fieldName : "i";
+    String formalParam =
+        "${isFieldFormal ? "this." : "int "}$paramName${hasDefault ? " = 3" : ""}";
+    CompilationUnit compilationUnit = resolveSource("""
+const x = const A();
+const y = const A(${isNamed ? '$paramName: ' : ''}10);
+class A {
+  const A(${isNamed ? "{$formalParam}" : "[$formalParam]"})${isFieldFormal ? "" : " : $fieldName = $paramName"};
+  final int $fieldName;
+}""");
+    EvaluationResultImpl x =
+        _evaluateInstanceCreationExpression(compilationUnit, "x");
+    Map<String, DartObjectImpl> fieldsOfX = _assertType(x, "A");
+    expect(fieldsOfX, hasLength(1));
+    if (hasDefault) {
+      _assertIntField(fieldsOfX, fieldName, 3);
+    } else {
+      _assertNullField(fieldsOfX, fieldName);
     }
-    String defaultArg =
-        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
-    CompilationUnit compilationUnit = resolveSource(
-                "const $varName = const bool.fromEnvironment('$envVarName'$defaultArg);");
-    return _evaluateInstanceCreationExpression(compilationUnit, varName);
-  }
-
-  EvaluationResultImpl _check_fromEnvironment_int(String valueInEnvironment,
-      String defaultExpr) {
-    String envVarName = "x";
-    String varName = "foo";
-    if (valueInEnvironment != null) {
-      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
-    }
-    String defaultArg =
-        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
-    CompilationUnit compilationUnit = resolveSource(
-                "const $varName = const int.fromEnvironment('$envVarName'$defaultArg);");
-    return _evaluateInstanceCreationExpression(compilationUnit, varName);
-  }
-
-  EvaluationResultImpl _check_fromEnvironment_string(String valueInEnvironment,
-      String defaultExpr) {
-    String envVarName = "x";
-    String varName = "foo";
-    if (valueInEnvironment != null) {
-      analysisContext2.declaredVariables.define(envVarName, valueInEnvironment);
-    }
-    String defaultArg =
-        defaultExpr == null ? "" : ", defaultValue: $defaultExpr";
-    CompilationUnit compilationUnit = resolveSource(
-                "const $varName = const String.fromEnvironment('$envVarName'$defaultArg);");
-    return _evaluateInstanceCreationExpression(compilationUnit, varName);
+    EvaluationResultImpl y =
+        _evaluateInstanceCreationExpression(compilationUnit, "y");
+    Map<String, DartObjectImpl> fieldsOfY = _assertType(y, "A");
+    expect(fieldsOfY, hasLength(1));
+    _assertIntField(fieldsOfY, fieldName, 10);
   }
 
   EvaluationResultImpl
@@ -4560,7 +4536,8 @@
     errorListener.assertNoErrors();
   }
 
-  void test_visitConditionalExpression_instanceCreation_invalidFieldInitializer() {
+  void
+      test_visitConditionalExpression_instanceCreation_invalidFieldInitializer() {
     TestTypeProvider typeProvider = new TestTypeProvider();
     LibraryElementImpl libraryElement = ElementFactory.library(null, "lib");
     String className = "C";
@@ -4659,8 +4636,7 @@
   }
 
   void test_visitSimpleIdentifier_inEnvironment() {
-    CompilationUnit compilationUnit =
-        resolveSource(r'''
+    CompilationUnit compilationUnit = resolveSource(r'''
 const a = b;
 const b = 3;''');
     Map<String, DartObjectImpl> environment = new Map<String, DartObjectImpl>();
@@ -4671,8 +4647,7 @@
   }
 
   void test_visitSimpleIdentifier_notInEnvironment() {
-    CompilationUnit compilationUnit =
-        resolveSource(r'''
+    CompilationUnit compilationUnit = resolveSource(r'''
 const a = b;
 const b = 3;''');
     Map<String, DartObjectImpl> environment = new Map<String, DartObjectImpl>();
@@ -4683,8 +4658,7 @@
   }
 
   void test_visitSimpleIdentifier_withoutEnvironment() {
-    CompilationUnit compilationUnit =
-        resolveSource(r'''
+    CompilationUnit compilationUnit = resolveSource(r'''
 const a = b;
 const b = 3;''');
     _assertValue(3, _evaluateConstant(compilationUnit, "a", null));
@@ -5050,12 +5024,16 @@
   }
 
   void test_equals_list_false_differentSizes() {
-    expect(_listValue([_boolValue(true)]) ==
-            _listValue([_boolValue(true), _boolValue(false)]), isFalse);
+    expect(
+        _listValue([_boolValue(true)]) ==
+            _listValue([_boolValue(true), _boolValue(false)]),
+        isFalse);
   }
 
   void test_equals_list_false_sameSize() {
-    expect(_listValue([_boolValue(true)]) == _listValue([_boolValue(false)]), isFalse);
+    expect(
+        _listValue([_boolValue(true)]) == _listValue([_boolValue(false)]),
+        isFalse);
   }
 
   void test_equals_list_true_empty() {
@@ -5150,6 +5128,70 @@
     expect(_stringValue(null).value, isNull);
   }
 
+  void test_greaterThan_knownDouble_knownDouble_false() {
+    _assertGreaterThan(_boolValue(false), _doubleValue(1.0), _doubleValue(2.0));
+  }
+
+  void test_greaterThan_knownDouble_knownDouble_true() {
+    _assertGreaterThan(_boolValue(true), _doubleValue(2.0), _doubleValue(1.0));
+  }
+
+  void test_greaterThan_knownDouble_knownInt_false() {
+    _assertGreaterThan(_boolValue(false), _doubleValue(1.0), _intValue(2));
+  }
+
+  void test_greaterThan_knownDouble_knownInt_true() {
+    _assertGreaterThan(_boolValue(true), _doubleValue(2.0), _intValue(1));
+  }
+
+  void test_greaterThan_knownDouble_unknownDouble() {
+    _assertGreaterThan(_boolValue(null), _doubleValue(1.0), _doubleValue(null));
+  }
+
+  void test_greaterThan_knownDouble_unknownInt() {
+    _assertGreaterThan(_boolValue(null), _doubleValue(1.0), _intValue(null));
+  }
+
+  void test_greaterThan_knownInt_knownInt_false() {
+    _assertGreaterThan(_boolValue(false), _intValue(1), _intValue(2));
+  }
+
+  void test_greaterThan_knownInt_knownInt_true() {
+    _assertGreaterThan(_boolValue(true), _intValue(2), _intValue(1));
+  }
+
+  void test_greaterThan_knownInt_knownString() {
+    _assertGreaterThan(null, _intValue(1), _stringValue("2"));
+  }
+
+  void test_greaterThan_knownInt_unknownDouble() {
+    _assertGreaterThan(_boolValue(null), _intValue(1), _doubleValue(null));
+  }
+
+  void test_greaterThan_knownInt_unknownInt() {
+    _assertGreaterThan(_boolValue(null), _intValue(1), _intValue(null));
+  }
+
+  void test_greaterThan_knownString_knownInt() {
+    _assertGreaterThan(null, _stringValue("1"), _intValue(2));
+  }
+
+  void test_greaterThan_unknownDouble_knownDouble() {
+    _assertGreaterThan(_boolValue(null), _doubleValue(null), _doubleValue(2.0));
+  }
+
+  void test_greaterThan_unknownDouble_knownInt() {
+    _assertGreaterThan(_boolValue(null), _doubleValue(null), _intValue(2));
+  }
+
+  void test_greaterThan_unknownInt_knownDouble() {
+    _assertGreaterThan(_boolValue(null), _intValue(null), _doubleValue(2.0));
+  }
+
+  void test_greaterThan_unknownInt_knownInt() {
+    _assertGreaterThan(_boolValue(null), _intValue(null), _intValue(2));
+  }
+
   void test_greaterThanOrEqual_knownDouble_knownDouble_false() {
     _assertGreaterThanOrEqual(
         _boolValue(false),
@@ -5244,70 +5286,6 @@
     _assertGreaterThanOrEqual(_boolValue(null), _intValue(null), _intValue(2));
   }
 
-  void test_greaterThan_knownDouble_knownDouble_false() {
-    _assertGreaterThan(_boolValue(false), _doubleValue(1.0), _doubleValue(2.0));
-  }
-
-  void test_greaterThan_knownDouble_knownDouble_true() {
-    _assertGreaterThan(_boolValue(true), _doubleValue(2.0), _doubleValue(1.0));
-  }
-
-  void test_greaterThan_knownDouble_knownInt_false() {
-    _assertGreaterThan(_boolValue(false), _doubleValue(1.0), _intValue(2));
-  }
-
-  void test_greaterThan_knownDouble_knownInt_true() {
-    _assertGreaterThan(_boolValue(true), _doubleValue(2.0), _intValue(1));
-  }
-
-  void test_greaterThan_knownDouble_unknownDouble() {
-    _assertGreaterThan(_boolValue(null), _doubleValue(1.0), _doubleValue(null));
-  }
-
-  void test_greaterThan_knownDouble_unknownInt() {
-    _assertGreaterThan(_boolValue(null), _doubleValue(1.0), _intValue(null));
-  }
-
-  void test_greaterThan_knownInt_knownInt_false() {
-    _assertGreaterThan(_boolValue(false), _intValue(1), _intValue(2));
-  }
-
-  void test_greaterThan_knownInt_knownInt_true() {
-    _assertGreaterThan(_boolValue(true), _intValue(2), _intValue(1));
-  }
-
-  void test_greaterThan_knownInt_knownString() {
-    _assertGreaterThan(null, _intValue(1), _stringValue("2"));
-  }
-
-  void test_greaterThan_knownInt_unknownDouble() {
-    _assertGreaterThan(_boolValue(null), _intValue(1), _doubleValue(null));
-  }
-
-  void test_greaterThan_knownInt_unknownInt() {
-    _assertGreaterThan(_boolValue(null), _intValue(1), _intValue(null));
-  }
-
-  void test_greaterThan_knownString_knownInt() {
-    _assertGreaterThan(null, _stringValue("1"), _intValue(2));
-  }
-
-  void test_greaterThan_unknownDouble_knownDouble() {
-    _assertGreaterThan(_boolValue(null), _doubleValue(null), _doubleValue(2.0));
-  }
-
-  void test_greaterThan_unknownDouble_knownInt() {
-    _assertGreaterThan(_boolValue(null), _doubleValue(null), _intValue(2));
-  }
-
-  void test_greaterThan_unknownInt_knownDouble() {
-    _assertGreaterThan(_boolValue(null), _intValue(null), _doubleValue(2.0));
-  }
-
-  void test_greaterThan_unknownInt_knownInt() {
-    _assertGreaterThan(_boolValue(null), _intValue(null), _intValue(2));
-  }
-
   void test_hasExactValue_bool_false() {
     expect(_boolValue(false).hasExactValue, isTrue);
   }
@@ -5357,15 +5335,21 @@
   }
 
   void test_hasExactValue_map_invalidKey() {
-    expect(_mapValue([_dynamicValue(), _stringValue("value")]).hasExactValue, isFalse);
+    expect(
+        _mapValue([_dynamicValue(), _stringValue("value")]).hasExactValue,
+        isFalse);
   }
 
   void test_hasExactValue_map_invalidValue() {
-    expect(_mapValue([_stringValue("key"), _dynamicValue()]).hasExactValue, isFalse);
+    expect(
+        _mapValue([_stringValue("key"), _dynamicValue()]).hasExactValue,
+        isFalse);
   }
 
   void test_hasExactValue_map_valid() {
-    expect(_mapValue([_stringValue("key"), _stringValue("value")]).hasExactValue, isTrue);
+    expect(
+        _mapValue([_stringValue("key"), _stringValue("value")]).hasExactValue,
+        isTrue);
   }
 
   void test_hasExactValue_null() {
@@ -5425,7 +5409,9 @@
   }
 
   void test_identical_list_false() {
-    _assertIdentical(_boolValue(false), _listValue(),
+    _assertIdentical(
+        _boolValue(false),
+        _listValue(),
         _listValue([_intValue(3)]));
   }
 
@@ -5434,7 +5420,9 @@
   }
 
   void test_identical_map_false() {
-    _assertIdentical(_boolValue(false), _mapValue(),
+    _assertIdentical(
+        _boolValue(false),
+        _mapValue(),
         _mapValue([_intValue(1), _intValue(2)]));
   }
 
@@ -5457,10 +5445,7 @@
   }
 
   void test_identical_string_unknown() {
-    _assertIdentical(
-        _boolValue(null),
-        _stringValue(null),
-        _stringValue("def"));
+    _assertIdentical(_boolValue(null), _stringValue(null), _stringValue("def"));
   }
 
   void test_integerDivide_knownDouble_knownDouble() {
@@ -5573,6 +5558,70 @@
     expect(_stringValue(null).isBoolNumStringOrNull, isTrue);
   }
 
+  void test_lessThan_knownDouble_knownDouble_false() {
+    _assertLessThan(_boolValue(false), _doubleValue(2.0), _doubleValue(1.0));
+  }
+
+  void test_lessThan_knownDouble_knownDouble_true() {
+    _assertLessThan(_boolValue(true), _doubleValue(1.0), _doubleValue(2.0));
+  }
+
+  void test_lessThan_knownDouble_knownInt_false() {
+    _assertLessThan(_boolValue(false), _doubleValue(2.0), _intValue(1));
+  }
+
+  void test_lessThan_knownDouble_knownInt_true() {
+    _assertLessThan(_boolValue(true), _doubleValue(1.0), _intValue(2));
+  }
+
+  void test_lessThan_knownDouble_unknownDouble() {
+    _assertLessThan(_boolValue(null), _doubleValue(1.0), _doubleValue(null));
+  }
+
+  void test_lessThan_knownDouble_unknownInt() {
+    _assertLessThan(_boolValue(null), _doubleValue(1.0), _intValue(null));
+  }
+
+  void test_lessThan_knownInt_knownInt_false() {
+    _assertLessThan(_boolValue(false), _intValue(2), _intValue(1));
+  }
+
+  void test_lessThan_knownInt_knownInt_true() {
+    _assertLessThan(_boolValue(true), _intValue(1), _intValue(2));
+  }
+
+  void test_lessThan_knownInt_knownString() {
+    _assertLessThan(null, _intValue(1), _stringValue("2"));
+  }
+
+  void test_lessThan_knownInt_unknownDouble() {
+    _assertLessThan(_boolValue(null), _intValue(1), _doubleValue(null));
+  }
+
+  void test_lessThan_knownInt_unknownInt() {
+    _assertLessThan(_boolValue(null), _intValue(1), _intValue(null));
+  }
+
+  void test_lessThan_knownString_knownInt() {
+    _assertLessThan(null, _stringValue("1"), _intValue(2));
+  }
+
+  void test_lessThan_unknownDouble_knownDouble() {
+    _assertLessThan(_boolValue(null), _doubleValue(null), _doubleValue(2.0));
+  }
+
+  void test_lessThan_unknownDouble_knownInt() {
+    _assertLessThan(_boolValue(null), _doubleValue(null), _intValue(2));
+  }
+
+  void test_lessThan_unknownInt_knownDouble() {
+    _assertLessThan(_boolValue(null), _intValue(null), _doubleValue(2.0));
+  }
+
+  void test_lessThan_unknownInt_knownInt() {
+    _assertLessThan(_boolValue(null), _intValue(null), _intValue(2));
+  }
+
   void test_lessThanOrEqual_knownDouble_knownDouble_false() {
     _assertLessThanOrEqual(
         _boolValue(false),
@@ -5655,70 +5704,6 @@
     _assertLessThanOrEqual(_boolValue(null), _intValue(null), _intValue(2));
   }
 
-  void test_lessThan_knownDouble_knownDouble_false() {
-    _assertLessThan(_boolValue(false), _doubleValue(2.0), _doubleValue(1.0));
-  }
-
-  void test_lessThan_knownDouble_knownDouble_true() {
-    _assertLessThan(_boolValue(true), _doubleValue(1.0), _doubleValue(2.0));
-  }
-
-  void test_lessThan_knownDouble_knownInt_false() {
-    _assertLessThan(_boolValue(false), _doubleValue(2.0), _intValue(1));
-  }
-
-  void test_lessThan_knownDouble_knownInt_true() {
-    _assertLessThan(_boolValue(true), _doubleValue(1.0), _intValue(2));
-  }
-
-  void test_lessThan_knownDouble_unknownDouble() {
-    _assertLessThan(_boolValue(null), _doubleValue(1.0), _doubleValue(null));
-  }
-
-  void test_lessThan_knownDouble_unknownInt() {
-    _assertLessThan(_boolValue(null), _doubleValue(1.0), _intValue(null));
-  }
-
-  void test_lessThan_knownInt_knownInt_false() {
-    _assertLessThan(_boolValue(false), _intValue(2), _intValue(1));
-  }
-
-  void test_lessThan_knownInt_knownInt_true() {
-    _assertLessThan(_boolValue(true), _intValue(1), _intValue(2));
-  }
-
-  void test_lessThan_knownInt_knownString() {
-    _assertLessThan(null, _intValue(1), _stringValue("2"));
-  }
-
-  void test_lessThan_knownInt_unknownDouble() {
-    _assertLessThan(_boolValue(null), _intValue(1), _doubleValue(null));
-  }
-
-  void test_lessThan_knownInt_unknownInt() {
-    _assertLessThan(_boolValue(null), _intValue(1), _intValue(null));
-  }
-
-  void test_lessThan_knownString_knownInt() {
-    _assertLessThan(null, _stringValue("1"), _intValue(2));
-  }
-
-  void test_lessThan_unknownDouble_knownDouble() {
-    _assertLessThan(_boolValue(null), _doubleValue(null), _doubleValue(2.0));
-  }
-
-  void test_lessThan_unknownDouble_knownInt() {
-    _assertLessThan(_boolValue(null), _doubleValue(null), _intValue(2));
-  }
-
-  void test_lessThan_unknownInt_knownDouble() {
-    _assertLessThan(_boolValue(null), _intValue(null), _doubleValue(2.0));
-  }
-
-  void test_lessThan_unknownInt_knownInt() {
-    _assertLessThan(_boolValue(null), _intValue(null), _intValue(2));
-  }
-
   void test_logicalAnd_false_false() {
     _assertLogicalAnd(_boolValue(false), _boolValue(false), _boolValue(false));
   }
@@ -6929,11 +6914,13 @@
     }
   }
 
-  DartObjectImpl _listValue([List<DartObjectImpl> elements = DartObjectImpl.EMPTY_LIST]) {
+  DartObjectImpl _listValue([List<DartObjectImpl> elements =
+      DartObjectImpl.EMPTY_LIST]) {
     return new DartObjectImpl(_typeProvider.listType, new ListState(elements));
   }
 
-  DartObjectImpl _mapValue([List<DartObjectImpl> keyElementPairs = DartObjectImpl.EMPTY_LIST]) {
+  DartObjectImpl _mapValue([List<DartObjectImpl> keyElementPairs =
+      DartObjectImpl.EMPTY_LIST]) {
     Map<DartObjectImpl, DartObjectImpl> map =
         new Map<DartObjectImpl, DartObjectImpl>();
     int count = keyElementPairs.length;
@@ -7049,7 +7036,8 @@
     TestTypeProvider typeProvider = new TestTypeProvider();
     String variableName = "var";
     DeclaredVariables variables = new DeclaredVariables();
-    _assertUnknownDartObject(typeProvider.boolType,
+    _assertUnknownDartObject(
+        typeProvider.boolType,
         variables.getBool(typeProvider, variableName));
   }
 
@@ -7067,7 +7055,8 @@
     TestTypeProvider typeProvider = new TestTypeProvider();
     String variableName = "var";
     DeclaredVariables variables = new DeclaredVariables();
-    _assertUnknownDartObject(typeProvider.intType,
+    _assertUnknownDartObject(
+        typeProvider.intType,
         variables.getInt(typeProvider, variableName));
   }
 
@@ -7096,7 +7085,8 @@
     TestTypeProvider typeProvider = new TestTypeProvider();
     String variableName = "var";
     DeclaredVariables variables = new DeclaredVariables();
-    _assertUnknownDartObject(typeProvider.stringType,
+    _assertUnknownDartObject(
+        typeProvider.stringType,
         variables.getString(typeProvider, variableName));
   }
 
@@ -7105,7 +7095,7 @@
   }
 
   void _assertUnknownDartObject(ParameterizedType expectedType,
-                                DartObject result) {
+      DartObject result) {
     expect((result as DartObjectImpl).isUnknown, isTrue);
     expect(result.type, expectedType);
   }
@@ -7126,7 +7116,9 @@
 
   void test_fromFile_invalid() {
     DirectoryBasedDartSdk sdk = _createDartSdk();
-    expect(sdk.fromFileUri(new JavaFile("/not/in/the/sdk.dart").toURI()), isNull);
+    expect(
+        sdk.fromFileUri(new JavaFile("/not/in/the/sdk.dart").toURI()),
+        isNull);
   }
 
   void test_fromFile_library() {
@@ -7212,7 +7204,11 @@
 
   DirectoryBasedDartSdk _createDartSdk() {
     JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
-    expect(sdkDirectory, isNotNull, reason: "No SDK configured; set the property 'com.google.dart.sdk' on the command line");
+    expect(
+        sdkDirectory,
+        isNotNull,
+        reason:
+            "No SDK configured; set the property 'com.google.dart.sdk' on the command line");
     return new DirectoryBasedDartSdk(sdkDirectory);
   }
 }
@@ -7398,8 +7394,13 @@
     ClassElement classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
-        AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstFactory.classTypeAlias(
+        'C',
+        null,
+        null,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     alias.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7427,8 +7428,13 @@
     ClassElement classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias classCAst = AstFactory.classTypeAlias('C', null,
-        Keyword.ABSTRACT, AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias classCAst = AstFactory.classTypeAlias(
+        'C',
+        null,
+        Keyword.ABSTRACT,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     classCAst.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7450,9 +7456,13 @@
     ClassElementImpl classM = ElementFactory.classElement2('M', []);
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
-    ClassTypeAlias classCAst = AstFactory.classTypeAlias('C',
-        AstFactory.typeParameterList(['T']), null,
-        AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias classCAst = AstFactory.classTypeAlias(
+        'C',
+        AstFactory.typeParameterList(['T']),
+        null,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     classCAst.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -8157,15 +8167,18 @@
         AstFactory.identifier3(methodName),
         AstFactory.formalParameterList(
             [AstFactory.simpleFormalParameter3(parameterName)]),
-        AstFactory.blockFunctionBody2([
-            AstFactory.variableDeclarationStatement2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration(localVariableName)]),
-            AstFactory.tryStatement2(
-                AstFactory.block([AstFactory.labeledStatement(
-                    [AstFactory.label2(labelName)],
-                    AstFactory.returnStatement())]),
-                [AstFactory.catchClause(exceptionParameterName)])]));
+        AstFactory.blockFunctionBody2(
+            [
+                AstFactory.variableDeclarationStatement2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration(localVariableName)]),
+                AstFactory.tryStatement2(
+                    AstFactory.block(
+                        [
+                            AstFactory.labeledStatement(
+                                [AstFactory.label2(labelName)],
+                                AstFactory.returnStatement())]),
+                    [AstFactory.catchClause(exceptionParameterName)])]));
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
@@ -8186,10 +8199,12 @@
     VariableElement secondVariable = localVariables[1];
     expect(firstVariable, isNotNull);
     expect(secondVariable, isNotNull);
-    expect((firstVariable.name == localVariableName &&
+    expect(
+        (firstVariable.name == localVariableName &&
             secondVariable.name == exceptionParameterName) ||
             (firstVariable.name == exceptionParameterName &&
-                secondVariable.name == localVariableName), isTrue);
+                secondVariable.name == localVariableName),
+        isTrue);
     List<LabelElement> labels = method.labels;
     expect(labels, hasLength(1));
     LabelElement label = labels[0];
@@ -8508,24 +8523,8 @@
     resetWithOptions(analysisOptions);
   }
 
-  void test_locateWithOffset_BinaryExpression() {
-    AstNode id = _findNodeIn("+", "var x = 3 + 4;");
-    Element element = ElementLocator.locateWithOffset(id, 0);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodElement,
-        MethodElement,
-        element);
-  }
-
-  void test_locateWithOffset_StringLiteral() {
-    AstNode id = _findNodeIn("abc", "var x = 'abc';");
-    Element element = ElementLocator.locateWithOffset(id, 1);
-    expect(element, isNull);
-  }
-
   void test_locate_AssignmentExpression() {
-    AstNode id =
-        _findNodeIn("+=", r'''
+    AstNode id = _findNodeIn("+=", r'''
 int x = 0;
 void main() {
   x += 1;
@@ -8563,8 +8562,7 @@
   }
 
   void test_locate_ConstructorDeclaration() {
-    AstNode id =
-        _findNodeIndexedIn("bar", 0, r'''
+    AstNode id = _findNodeIndexedIn("bar", 0, r'''
 class A {
   A.bar() {}
 }''');
@@ -8590,10 +8588,7 @@
 
   void
       test_locate_Identifier_annotationClass_namedConstructor_forSimpleFormalParameter() {
-    AstNode id = _findNodeIndexedIn(
-        "Class",
-        2,
-        r'''
+    AstNode id = _findNodeIndexedIn("Class", 2, r'''
 class Class {
   const Class.name();
 }
@@ -8608,10 +8603,7 @@
 
   void
       test_locate_Identifier_annotationClass_unnamedConstructor_forSimpleFormalParameter() {
-    AstNode id = _findNodeIndexedIn(
-        "Class",
-        2,
-        r'''
+    AstNode id = _findNodeIndexedIn("Class", 2, r'''
 class Class {
   const Class();
 }
@@ -8634,8 +8626,7 @@
   }
 
   void test_locate_Identifier_constructor_named() {
-    AstNode id =
-        _findNodeIndexedIn("bar", 0, r'''
+    AstNode id = _findNodeIndexedIn("bar", 0, r'''
 class A {
   A.bar() {}
 }''');
@@ -8668,8 +8659,7 @@
   }
 
   void test_locate_Identifier_propertAccess() {
-    AstNode id =
-        _findNodeIn("length", r'''
+    AstNode id = _findNodeIn("length", r'''
 void main() {
  int x = 'foo'.length;
 }''');
@@ -8690,10 +8680,7 @@
   }
 
   void test_locate_IndexExpression() {
-    AstNode id = _findNodeIndexedIn(
-        "\\[",
-        1,
-        r'''
+    AstNode id = _findNodeIndexedIn("\\[", 1, r'''
 void main() {
   List x = [1, 2];
   var y = x[0];
@@ -8706,8 +8693,7 @@
   }
 
   void test_locate_InstanceCreationExpression() {
-    AstNode node =
-        _findNodeIndexedIn("A(", 0, r'''
+    AstNode node = _findNodeIndexedIn("A(", 0, r'''
 class A {}
 void main() {
  new A();
@@ -8783,10 +8769,7 @@
   }
 
   void test_locate_MethodInvocation_method() {
-    AstNode id = _findNodeIndexedIn(
-        "bar",
-        1,
-        r'''
+    AstNode id = _findNodeIndexedIn("bar", 1, r'''
 class A {
   int bar() => 42;
 }
@@ -8801,8 +8784,7 @@
   }
 
   void test_locate_MethodInvocation_topLevel() {
-    String code =
-        r'''
+    String code = r'''
 foo(x) {}
 void main() {
  foo(0);
@@ -8828,18 +8810,8 @@
         element);
   }
 
-  void test_locate_PrefixExpression() {
-    AstNode id = _findNodeIn("++", "int addOne(int x) => ++x;");
-    Element element = ElementLocator.locate(id);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodElement,
-        MethodElement,
-        element);
-  }
-
   void test_locate_PrefixedIdentifier() {
-    AstNode id =
-        _findNodeIn("int", r'''
+    AstNode id = _findNodeIn("int", r'''
 import 'dart:core' as core;
 core.int value;''');
     PrefixedIdentifier identifier =
@@ -8851,6 +8823,15 @@
         element);
   }
 
+  void test_locate_PrefixExpression() {
+    AstNode id = _findNodeIn("++", "int addOne(int x) => ++x;");
+    Element element = ElementLocator.locate(id);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodElement,
+        MethodElement,
+        element);
+  }
+
   void test_locate_StringLiteral_exportUri() {
     addNamedSource("/foo.dart", "library foo;");
     AstNode id = _findNodeIn("'foo.dart'", "export 'foo.dart';");
@@ -8899,6 +8880,21 @@
         element);
   }
 
+  void test_locateWithOffset_BinaryExpression() {
+    AstNode id = _findNodeIn("+", "var x = 3 + 4;");
+    Element element = ElementLocator.locateWithOffset(id, 0);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodElement,
+        MethodElement,
+        element);
+  }
+
+  void test_locateWithOffset_StringLiteral() {
+    AstNode id = _findNodeIn("abc", "var x = 'abc';");
+    Element element = ElementLocator.locateWithOffset(id, 1);
+    expect(element, isNull);
+  }
+
   /**
    * Find the first AST node matching a pattern in the resolved AST for the given source.
    *
@@ -8919,8 +8915,7 @@
    * [code] the code to resolve.
    * Returns the matched node in the resolved AST for the given source lines
    */
-  AstNode _findNodeIndexedIn(String nodePattern, int index,
-                             String code) {
+  AstNode _findNodeIndexedIn(String nodePattern, int index, String code) {
     CompilationUnit cu = _resolveContents(code);
     int start = _getOffsetOfMatch(code, nodePattern, index);
     int end = start + nodePattern.length;
@@ -9100,39 +9095,57 @@
 
 class ErrorSeverityTest extends EngineTestCase {
   void test_max_error_error() {
-    expect(ErrorSeverity.ERROR.max(ErrorSeverity.ERROR), same(ErrorSeverity.ERROR));
+    expect(
+        ErrorSeverity.ERROR.max(ErrorSeverity.ERROR),
+        same(ErrorSeverity.ERROR));
   }
 
   void test_max_error_none() {
-    expect(ErrorSeverity.ERROR.max(ErrorSeverity.NONE), same(ErrorSeverity.ERROR));
+    expect(
+        ErrorSeverity.ERROR.max(ErrorSeverity.NONE),
+        same(ErrorSeverity.ERROR));
   }
 
   void test_max_error_warning() {
-    expect(ErrorSeverity.ERROR.max(ErrorSeverity.WARNING), same(ErrorSeverity.ERROR));
+    expect(
+        ErrorSeverity.ERROR.max(ErrorSeverity.WARNING),
+        same(ErrorSeverity.ERROR));
   }
 
   void test_max_none_error() {
-    expect(ErrorSeverity.NONE.max(ErrorSeverity.ERROR), same(ErrorSeverity.ERROR));
+    expect(
+        ErrorSeverity.NONE.max(ErrorSeverity.ERROR),
+        same(ErrorSeverity.ERROR));
   }
 
   void test_max_none_none() {
-    expect(ErrorSeverity.NONE.max(ErrorSeverity.NONE), same(ErrorSeverity.NONE));
+    expect(
+        ErrorSeverity.NONE.max(ErrorSeverity.NONE),
+        same(ErrorSeverity.NONE));
   }
 
   void test_max_none_warning() {
-    expect(ErrorSeverity.NONE.max(ErrorSeverity.WARNING), same(ErrorSeverity.WARNING));
+    expect(
+        ErrorSeverity.NONE.max(ErrorSeverity.WARNING),
+        same(ErrorSeverity.WARNING));
   }
 
   void test_max_warning_error() {
-    expect(ErrorSeverity.WARNING.max(ErrorSeverity.ERROR), same(ErrorSeverity.ERROR));
+    expect(
+        ErrorSeverity.WARNING.max(ErrorSeverity.ERROR),
+        same(ErrorSeverity.ERROR));
   }
 
   void test_max_warning_none() {
-    expect(ErrorSeverity.WARNING.max(ErrorSeverity.NONE), same(ErrorSeverity.WARNING));
+    expect(
+        ErrorSeverity.WARNING.max(ErrorSeverity.NONE),
+        same(ErrorSeverity.WARNING));
   }
 
   void test_max_warning_warning() {
-    expect(ErrorSeverity.WARNING.max(ErrorSeverity.WARNING), same(ErrorSeverity.WARNING));
+    expect(
+        ErrorSeverity.WARNING.max(ErrorSeverity.WARNING),
+        same(ErrorSeverity.WARNING));
   }
 }
 
@@ -9354,6 +9367,10 @@
     _assertFalse("(){};");
   }
 
+  void test_functionExpression_bodyThrows() {
+    _assertFalse("(int i) => throw '';");
+  }
+
   void test_functionExpressionInvocation() {
     _assertFalse("f(g);");
   }
@@ -9366,10 +9383,6 @@
     _assertTrue("throw ''(g);");
   }
 
-  void test_functionExpression_bodyThrows() {
-    _assertFalse("(int i) => throw '';");
-  }
-
   void test_identifier_prefixedIdentifier() {
     _assertFalse("a.b;");
   }
@@ -9378,22 +9391,6 @@
     _assertFalse("a;");
   }
 
-  void test_ifElse_bothReturn() {
-    _assertTrue("if (c) return 0; else return 1;");
-  }
-
-  void test_ifElse_elseReturn() {
-    _assertFalse("if (c) i++; else return 1;");
-  }
-
-  void test_ifElse_noReturn() {
-    _assertFalse("if (c) i++; else j++;");
-  }
-
-  void test_ifElse_thenReturn() {
-    _assertFalse("if (c) return 0; else j++;");
-  }
-
   void test_if_false_else_return() {
     _assertTrue("if (false) {} else { return 0; }");
   }
@@ -9422,6 +9419,22 @@
     _assertTrue("if (true) { return 0; }");
   }
 
+  void test_ifElse_bothReturn() {
+    _assertTrue("if (c) return 0; else return 1;");
+  }
+
+  void test_ifElse_elseReturn() {
+    _assertFalse("if (c) i++; else return 1;");
+  }
+
+  void test_ifElse_noReturn() {
+    _assertFalse("if (c) i++; else j++;");
+  }
+
+  void test_ifElse_thenReturn() {
+    _assertFalse("if (c) return 0; else j++;");
+  }
+
   void test_indexExpression() {
     _assertFalse("a[b];");
   }
@@ -9458,10 +9471,6 @@
     _assertTrue("label: throw '';");
   }
 
-  void test_literal_String() {
-    _assertFalse("'str';");
-  }
-
   void test_literal_boolean() {
     _assertFalse("true;");
   }
@@ -9478,6 +9487,10 @@
     _assertFalse("null;");
   }
 
+  void test_literal_String() {
+    _assertFalse("'str';");
+  }
+
   void test_methodInvocation() {
     _assertFalse("a.b(c);");
   }
@@ -9864,7 +9877,9 @@
     Source result =
         resolver.resolveAbsolute(parseUriWithException("file:/does/not/exist.dart"));
     expect(result, isNotNull);
-    expect(result.fullName, FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath());
+    expect(
+        result.fullName,
+        FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath());
   }
 
   void test_resolve_nonFile() {
@@ -9902,9 +9917,7 @@
             _t4(
                 "html",
                 [
-                    _t4(
-                        "body",
-                        [_t("script", _a(["type", "'application/dart'"]), scriptBody)])])]);
+                    _t4("body", [_t("script", _a(["type", "'application/dart'"]), scriptBody)])])]);
   }
   ht.HtmlUnit parse(String contents) {
 //    TestSource source =
@@ -10043,15 +10056,14 @@
   XmlValidator_Attributes _a(List<String> keyValuePairs) =>
       new XmlValidator_Attributes(keyValuePairs);
   XmlValidator_Tag _t(String tag, XmlValidator_Attributes attributes,
-      String content, [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
+      String content, [List<XmlValidator_Tag> children =
+      XmlValidator_Tag.EMPTY_LIST]) =>
       new XmlValidator_Tag(tag, attributes, content, children);
-  XmlValidator_Tag _t2(String tag, XmlValidator_Attributes attributes,
-      [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
-      new XmlValidator_Tag(tag, attributes, null, children);
   XmlValidator_Tag _t3(String tag, String content,
       [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
       new XmlValidator_Tag(tag, new XmlValidator_Attributes(), content, children);
-  XmlValidator_Tag _t4(String tag, [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
+  XmlValidator_Tag _t4(String tag, [List<XmlValidator_Tag> children =
+      XmlValidator_Tag.EMPTY_LIST]) =>
       new XmlValidator_Tag(tag, new XmlValidator_Attributes(), null, children);
   void _validate(ht.HtmlUnit htmlUnit, List<XmlValidator_Tag> expectedTags) {
     XmlValidator validator = new XmlValidator();
@@ -10154,13 +10166,11 @@
     changeSet.addedSource(source);
     _context.applyChanges(changeSet);
     HtmlUnitBuilder builder = new HtmlUnitBuilder(_context);
-    return builder.buildHtmlElement(
-        source,
-        _context.getModificationStamp(source),
-        _context.parseHtmlUnit(source));
+    return builder.buildHtmlElement(source, _context.parseHtmlUnit(source));
   }
   HtmlUnitBuilderTest_ExpectedLibrary
-      _l([List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables = HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]) =>
+      _l([List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables =
+      HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]) =>
       new HtmlUnitBuilderTest_ExpectedLibrary(this, expectedVariables);
   _ExpectedScript _s(HtmlUnitBuilderTest_ExpectedLibrary expectedLibrary) =>
       new _ExpectedScript.con1(expectedLibrary);
@@ -10189,7 +10199,10 @@
   void _validate(int scriptIndex, EmbeddedHtmlScriptElementImpl script) {
     LibraryElement library = script.scriptLibrary;
     expect(library, isNotNull, reason: "script $scriptIndex");
-    expect(script.context, same(HtmlUnitBuilderTest_this._context), reason: "script $scriptIndex");
+    expect(
+        script.context,
+        same(HtmlUnitBuilderTest_this._context),
+        reason: "script $scriptIndex");
     CompilationUnitElement unit = library.definingCompilationUnit;
     expect(unit, isNotNull, reason: "script $scriptIndex");
     List<TopLevelVariableElement> variables = unit.topLevelVariables;
@@ -10197,15 +10210,19 @@
     for (int index = 0; index < variables.length; index++) {
       _expectedVariables[index].validate(scriptIndex, variables[index]);
     }
-    expect(library.enclosingElement, same(script), reason: "script $scriptIndex");
+    expect(
+        library.enclosingElement,
+        same(script),
+        reason: "script $scriptIndex");
   }
 }
 
 
 class HtmlUnitBuilderTest_ExpectedVariable {
+  static const List<HtmlUnitBuilderTest_ExpectedVariable> EMPTY_LIST = const
+      <HtmlUnitBuilderTest_ExpectedVariable>[
+      ];
   final String _expectedName;
-  static const List<HtmlUnitBuilderTest_ExpectedVariable> EMPTY_LIST
-      = const <HtmlUnitBuilderTest_ExpectedVariable>[];
   HtmlUnitBuilderTest_ExpectedVariable(this._expectedName);
   void validate(int scriptIndex, TopLevelVariableElement variable) {
     expect(variable, isNotNull, reason: "script $scriptIndex");
@@ -10257,8 +10274,7 @@
     _verify(r'''
 <html>
 <script type='application/dart' src='ht:'/>
-</html>''',
-        [HtmlWarningCode.INVALID_URI]);
+</html>''', [HtmlWarningCode.INVALID_URI]);
     _assertErrorLocation2(_errors[0], "ht:");
   }
 
@@ -10266,8 +10282,7 @@
     _verify(r'''
 <html>
 <script type='application/dart' src='other.dart'/>
-</html>''',
-        [HtmlWarningCode.URI_DOES_NOT_EXIST]);
+</html>''', [HtmlWarningCode.URI_DOES_NOT_EXIST]);
     _assertErrorLocation2(_errors[0], "other.dart");
   }
 
@@ -10293,10 +10308,7 @@
     changeSet.addedSource(source);
     _context.applyChanges(changeSet);
     HtmlUnitBuilder builder = new HtmlUnitBuilder(_context);
-    builder.buildHtmlElement(
-        source,
-        _context.getModificationStamp(source),
-        _context.parseHtmlUnit(source));
+    builder.buildHtmlElement(source, _context.parseHtmlUnit(source));
     GatheringErrorListener errorListener = new GatheringErrorListener();
     errorListener.addAll2(builder.errorListener);
     errorListener.assertErrorsWithCodes(expectedErrorCodes);
@@ -10497,9 +10509,7 @@
 class SDKLibrariesReaderTest extends EngineTestCase {
   void test_readFrom_dart2js() {
     LibraryMap libraryMap = new SdkLibrariesReader(
-        true).readFromFile(
-            FileUtilities2.createFile("/libs.dart"),
-            r'''
+        true).readFromFile(FileUtilities2.createFile("/libs.dart"), r'''
 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
   'first' : const LibraryInfo(
     'first/first.dart',
@@ -10528,9 +10538,7 @@
   }
   void test_readFrom_normal() {
     LibraryMap libraryMap = new SdkLibrariesReader(
-        false).readFromFile(
-            FileUtilities2.createFile("/libs.dart"),
-            r'''
+        false).readFromFile(FileUtilities2.createFile("/libs.dart"), r'''
 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
   'first' : const LibraryInfo(
     'first/first.dart',
@@ -10597,8 +10605,7 @@
   }
   void test_resolveUri_absolute() {
     UriResolver_absolute resolver = new UriResolver_absolute();
-    SourceFactory factory =
-        new SourceFactory([resolver]);
+    SourceFactory factory = new SourceFactory([resolver]);
     factory.resolveUri(null, "dart:core");
     expect(resolver.invoked, isTrue);
   }
@@ -10609,7 +10616,9 @@
     Source containingSource =
         new FileBasedSource.con1(FileUtilities2.createFile("/does/not/exist.dart"));
     Source result = factory.resolveUri(containingSource, absolutePath);
-    expect(result.fullName, FileUtilities2.createFile(absolutePath).getAbsolutePath());
+    expect(
+        result.fullName,
+        FileUtilities2.createFile(absolutePath).getAbsolutePath());
   }
   void test_resolveUri_nonAbsolute_relative() {
     SourceFactory factory =
@@ -10617,7 +10626,9 @@
     Source containingSource =
         new FileBasedSource.con1(FileUtilities2.createFile("/does/not/have.dart"));
     Source result = factory.resolveUri(containingSource, "exist.dart");
-    expect(result.fullName, FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath());
+    expect(
+        result.fullName,
+        FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath());
   }
   void test_restoreUri() {
     JavaFile file1 = FileUtilities2.createFile("/some/file1.dart");
@@ -10714,22 +10725,6 @@
 }
 
 
-class UriResolver_SourceFactoryTest_test_fromEncoding_valid extends UriResolver
-    {
-  String encoding;
-
-  UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding);
-
-  @override
-  Source resolveAbsolute(Uri uri) {
-    if (uri.toString() == encoding) {
-      return new TestSource();
-    }
-    return null;
-  }
-}
-
-
 class UriResolver_absolute extends UriResolver {
   bool invoked = false;
 
@@ -10779,6 +10774,22 @@
 }
 
 
+class UriResolver_SourceFactoryTest_test_fromEncoding_valid extends UriResolver
+    {
+  String encoding;
+
+  UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding);
+
+  @override
+  Source resolveAbsolute(Uri uri) {
+    if (uri.toString() == encoding) {
+      return new TestSource();
+    }
+    return null;
+  }
+}
+
+
 class ValidatingConstantValueComputer extends ConstantValueComputer {
   AstNode _nodeBeingEvaluated;
   ValidatingConstantValueComputer(TypeProvider typeProvider,
@@ -10826,7 +10837,9 @@
       FormalParameter parameterNode =
           constructorNode.parameters.parameters[parameterIndex];
       expect(referenceGraph.nodes.contains(parameterNode), isTrue);
-      expect(referenceGraph.containsPath(_nodeBeingEvaluated, parameterNode), isTrue);
+      expect(
+          referenceGraph.containsPath(_nodeBeingEvaluated, parameterNode),
+          isTrue);
     }
   }
 
@@ -10973,7 +10986,8 @@
         while (!identical(token, lastToken)) {
           token = token.next;
           if (++count > 1000) {
-            fail("Expected $_expectedTagsIndex tag: ${expected._tag} to have a sequence of tokens from getAttributeEnd() to getContentEnd()");
+            fail(
+                "Expected $_expectedTagsIndex tag: ${expected._tag} to have a sequence of tokens from getAttributeEnd() to getContentEnd()");
             break;
           }
         }
@@ -11062,12 +11076,13 @@
 
 
 class XmlValidator_Tag {
+  static const List<XmlValidator_Tag> EMPTY_LIST = const <XmlValidator_Tag>[];
   final String _tag;
   final XmlValidator_Attributes _attributes;
   final String _content;
   final List<XmlValidator_Tag> _children;
-  static const List<XmlValidator_Tag> EMPTY_LIST = const <XmlValidator_Tag>[];
-  XmlValidator_Tag(this._tag, this._attributes, this._content, [this._children = EMPTY_LIST]);
+  XmlValidator_Tag(this._tag, this._attributes, this._content, [this._children =
+      EMPTY_LIST]);
 }
 
 
@@ -11110,7 +11125,8 @@
   }
   void _validateEmbedded(int scriptIndex, HtmlScriptElement script) {
     if (script is! EmbeddedHtmlScriptElementImpl) {
-      fail("Expected script $scriptIndex to be embedded, but found ${script != null ? script.runtimeType : "null"}");
+      fail(
+          "Expected script $scriptIndex to be embedded, but found ${script != null ? script.runtimeType : "null"}");
     }
     EmbeddedHtmlScriptElementImpl embeddedScript =
         script as EmbeddedHtmlScriptElementImpl;
@@ -11118,7 +11134,8 @@
   }
   void _validateExternal(int scriptIndex, HtmlScriptElement script) {
     if (script is! ExternalHtmlScriptElementImpl) {
-      fail("Expected script $scriptIndex to be external with src=$_expectedExternalScriptName but found ${script != null ? script.runtimeType : "null"}");
+      fail(
+          "Expected script $scriptIndex to be external with src=$_expectedExternalScriptName but found ${script != null ? script.runtimeType : "null"}");
     }
     ExternalHtmlScriptElementImpl externalScript =
         script as ExternalHtmlScriptElementImpl;
@@ -11128,7 +11145,10 @@
     } else {
       expect(scriptSource, isNotNull, reason: "script $scriptIndex");
       String actualExternalScriptName = scriptSource.shortName;
-      expect(actualExternalScriptName, _expectedExternalScriptName, reason: "script $scriptIndex");
+      expect(
+          actualExternalScriptName,
+          _expectedExternalScriptName,
+          reason: "script $scriptIndex");
     }
   }
 }
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 0cdbae7..7ab90f2 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -7,38 +7,63 @@
 
 library engine.ast_test;
 
-import 'package:analyzer/src/generated/java_core.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/java_engine.dart' show Predicate;
-import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/ast.dart';
-import 'package:unittest/unittest.dart';
-import 'parser_test.dart' show ParserTestCase;
-import 'test_support.dart';
+import 'package:analyzer/src/generated/java_core.dart';
+import 'package:analyzer/src/generated/java_engine.dart' show Predicate;
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/testing/ast_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import 'parser_test.dart' show ParserTestCase;
+import 'test_support.dart';
 
 
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(BreadthFirstVisitorTest);
+  runReflectiveTests(ClassDeclarationTest);
+  runReflectiveTests(ClassTypeAliasTest);
+  runReflectiveTests(ConstantEvaluatorTest);
+  runReflectiveTests(ConstructorDeclarationTest);
+  runReflectiveTests(IndexExpressionTest);
+  runReflectiveTests(NodeListTest);
+  runReflectiveTests(NodeLocatorTest);
+  runReflectiveTests(SimpleIdentifierTest);
+  runReflectiveTests(SimpleStringLiteralTest);
+  runReflectiveTests(StringInterpolationTest);
+  runReflectiveTests(ToSourceVisitorTest);
+  runReflectiveTests(VariableDeclarationTest);
+}
+
 class AssignmentKind extends Enum<AssignmentKind> {
   static const AssignmentKind BINARY = const AssignmentKind('BINARY', 0);
 
-  static const AssignmentKind COMPOUND_LEFT = const AssignmentKind('COMPOUND_LEFT', 1);
+  static const AssignmentKind COMPOUND_LEFT =
+      const AssignmentKind('COMPOUND_LEFT', 1);
 
-  static const AssignmentKind COMPOUND_RIGHT = const AssignmentKind('COMPOUND_RIGHT', 2);
+  static const AssignmentKind COMPOUND_RIGHT =
+      const AssignmentKind('COMPOUND_RIGHT', 2);
 
-  static const AssignmentKind POSTFIX_INC = const AssignmentKind('POSTFIX_INC', 3);
+  static const AssignmentKind POSTFIX_INC =
+      const AssignmentKind('POSTFIX_INC', 3);
 
-  static const AssignmentKind PREFIX_DEC = const AssignmentKind('PREFIX_DEC', 4);
+  static const AssignmentKind PREFIX_DEC =
+      const AssignmentKind('PREFIX_DEC', 4);
 
-  static const AssignmentKind PREFIX_INC = const AssignmentKind('PREFIX_INC', 5);
+  static const AssignmentKind PREFIX_INC =
+      const AssignmentKind('PREFIX_INC', 5);
 
-  static const AssignmentKind PREFIX_NOT = const AssignmentKind('PREFIX_NOT', 6);
+  static const AssignmentKind PREFIX_NOT =
+      const AssignmentKind('PREFIX_NOT', 6);
 
-  static const AssignmentKind SIMPLE_LEFT = const AssignmentKind('SIMPLE_LEFT', 7);
+  static const AssignmentKind SIMPLE_LEFT =
+      const AssignmentKind('SIMPLE_LEFT', 7);
 
-  static const AssignmentKind SIMPLE_RIGHT = const AssignmentKind('SIMPLE_RIGHT', 8);
+  static const AssignmentKind SIMPLE_RIGHT =
+      const AssignmentKind('SIMPLE_RIGHT', 8);
 
   static const AssignmentKind NONE = const AssignmentKind('NONE', 9);
 
@@ -57,6 +82,19 @@
   const AssignmentKind(String name, int ordinal) : super(name, ordinal);
 }
 
+class BreadthFirstVisitor_BreadthFirstVisitorTest_testIt extends
+    BreadthFirstVisitor<Object> {
+  List<AstNode> nodes;
+
+  BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(this.nodes) : super();
+
+  @override
+  Object visitNode(AstNode node) {
+    nodes.add(node);
+    return super.visitNode(node);
+  }
+}
+
 class BreadthFirstVisitorTest extends ParserTestCase {
   void test_it() {
     String source = r'''
@@ -80,37 +118,62 @@
 }''';
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(source);
     List<AstNode> nodes = new List<AstNode>();
-    BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(nodes);
+    BreadthFirstVisitor<Object> visitor =
+        new BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(nodes);
     visitor.visitAllNodes(unit);
     expect(nodes, hasLength(59));
-    EngineTestCase.assertInstanceOf((obj) => obj is CompilationUnit, CompilationUnit, nodes[0]);
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassDeclaration, ClassDeclaration, nodes[2]);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionDeclaration, FunctionDeclaration, nodes[3]);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionDeclarationStatement, FunctionDeclarationStatement, nodes[27]);
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, nodes[58]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is CompilationUnit,
+        CompilationUnit,
+        nodes[0]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassDeclaration,
+        ClassDeclaration,
+        nodes[2]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionDeclaration,
+        FunctionDeclaration,
+        nodes[3]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionDeclarationStatement,
+        FunctionDeclarationStatement,
+        nodes[27]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        nodes[58]);
     //3
   }
 }
 
-class BreadthFirstVisitor_BreadthFirstVisitorTest_testIt extends BreadthFirstVisitor<Object> {
-  List<AstNode> nodes;
-
-  BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(this.nodes) : super();
-
-  @override
-  Object visitNode(AstNode node) {
-    nodes.add(node);
-    return super.visitNode(node);
-  }
-}
-
 class ClassDeclarationTest extends ParserTestCase {
   void test_getConstructor() {
-    List<ConstructorInitializer> initializers = new List<ConstructorInitializer>();
-    ConstructorDeclaration defaultConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null, AstFactory.formalParameterList(), initializers);
-    ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "a", AstFactory.formalParameterList(), initializers);
-    ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "b", AstFactory.formalParameterList(), initializers);
-    ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, null, null, null, [defaultConstructor, aConstructor, bConstructor]);
+    List<ConstructorInitializer> initializers =
+        new List<ConstructorInitializer>();
+    ConstructorDeclaration defaultConstructor =
+        AstFactory.constructorDeclaration(
+            AstFactory.identifier3("Test"),
+            null,
+            AstFactory.formalParameterList(),
+            initializers);
+    ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(
+        AstFactory.identifier3("Test"),
+        "a",
+        AstFactory.formalParameterList(),
+        initializers);
+    ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(
+        AstFactory.identifier3("Test"),
+        "b",
+        AstFactory.formalParameterList(),
+        initializers);
+    ClassDeclaration clazz = AstFactory.classDeclaration(
+        null,
+        "Test",
+        null,
+        null,
+        null,
+        null,
+        [defaultConstructor, aConstructor, bConstructor]);
     expect(clazz.getConstructor(null), same(defaultConstructor));
     expect(clazz.getConstructor("a"), same(aConstructor));
     expect(clazz.getConstructor("b"), same(bConstructor));
@@ -121,9 +184,16 @@
     VariableDeclaration aVar = AstFactory.variableDeclaration("a");
     VariableDeclaration bVar = AstFactory.variableDeclaration("b");
     VariableDeclaration cVar = AstFactory.variableDeclaration("c");
-    ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, null, null, null, [
-        AstFactory.fieldDeclaration2(false, null, [aVar]),
-        AstFactory.fieldDeclaration2(false, null, [bVar, cVar])]);
+    ClassDeclaration clazz = AstFactory.classDeclaration(
+        null,
+        "Test",
+        null,
+        null,
+        null,
+        null,
+        [
+            AstFactory.fieldDeclaration2(false, null, [aVar]),
+            AstFactory.fieldDeclaration2(false, null, [bVar, cVar])]);
     expect(clazz.getField("a"), same(aVar));
     expect(clazz.getField("b"), same(bVar));
     expect(clazz.getField("c"), same(cVar));
@@ -131,24 +201,63 @@
   }
 
   void test_getMethod() {
-    MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("a"), AstFactory.formalParameterList());
-    MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("b"), AstFactory.formalParameterList());
-    ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, null, null, null, [aMethod, bMethod]);
+    MethodDeclaration aMethod = AstFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("a"),
+        AstFactory.formalParameterList());
+    MethodDeclaration bMethod = AstFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("b"),
+        AstFactory.formalParameterList());
+    ClassDeclaration clazz = AstFactory.classDeclaration(
+        null,
+        "Test",
+        null,
+        null,
+        null,
+        null,
+        [aMethod, bMethod]);
     expect(clazz.getMethod("a"), same(aMethod));
     expect(clazz.getMethod("b"), same(bMethod));
     expect(clazz.getMethod("noSuchMethod"), same(null));
   }
 
   void test_isAbstract() {
-    expect(AstFactory.classDeclaration(null, "A", null, null, null, null).isAbstract, isFalse);
-    expect(AstFactory.classDeclaration(Keyword.ABSTRACT, "B", null, null, null, null).isAbstract, isTrue);
+    expect(
+        AstFactory.classDeclaration(null, "A", null, null, null, null).isAbstract,
+        isFalse);
+    expect(
+        AstFactory.classDeclaration(
+            Keyword.ABSTRACT,
+            "B",
+            null,
+            null,
+            null,
+            null).isAbstract,
+        isTrue);
   }
 }
 
 class ClassTypeAliasTest extends ParserTestCase {
   void test_isAbstract() {
-    expect(AstFactory.classTypeAlias("A", null, null, null, null, null).isAbstract, isFalse);
-    expect(AstFactory.classTypeAlias("B", null, Keyword.ABSTRACT, null, null, null).isAbstract, isTrue);
+    expect(
+        AstFactory.classTypeAlias("A", null, null, null, null, null).isAbstract,
+        isFalse);
+    expect(
+        AstFactory.classTypeAlias(
+            "B",
+            null,
+            Keyword.ABSTRACT,
+            null,
+            null,
+            null).isAbstract,
+        isTrue);
   }
 }
 
@@ -465,89 +574,217 @@
     expect(value as int, -42);
   }
 
-  Object _getConstantValue(String source) => ParserTestCase.parseExpression(source).accept(new ConstantEvaluator());
+  Object _getConstantValue(String source) =>
+      ParserTestCase.parseExpression(source).accept(new ConstantEvaluator());
+}
+
+class ConstructorDeclarationTest extends EngineTestCase {
+  void test_firstTokenAfterCommentAndMetadata_all_inverted() {
+    Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+    externalKeyword.offset = 14;
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+        Keyword.CONST,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
+    declaration.externalKeyword = externalKeyword;
+    declaration.constKeyword.offset = 8;
+    Token factoryKeyword = declaration.factoryKeyword;
+    factoryKeyword.offset = 0;
+    expect(declaration.firstTokenAfterCommentAndMetadata, factoryKeyword);
+  }
+
+  void test_firstTokenAfterCommentAndMetadata_all_normal() {
+    Token token = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+    token.offset = 0;
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+        Keyword.CONST,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
+    declaration.externalKeyword = token;
+    declaration.constKeyword.offset = 9;
+    declaration.factoryKeyword.offset = 15;
+    expect(declaration.firstTokenAfterCommentAndMetadata, token);
+  }
+
+  void test_firstTokenAfterCommentAndMetadata_constOnly() {
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+        Keyword.CONST,
+        null,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
+    expect(
+        declaration.firstTokenAfterCommentAndMetadata,
+        declaration.constKeyword);
+  }
+
+  void test_firstTokenAfterCommentAndMetadata_externalOnly() {
+    Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
+    declaration.externalKeyword = externalKeyword;
+    expect(declaration.firstTokenAfterCommentAndMetadata, externalKeyword);
+  }
+
+  void test_firstTokenAfterCommentAndMetadata_factoryOnly() {
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
+        null,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
+    expect(
+        declaration.firstTokenAfterCommentAndMetadata,
+        declaration.factoryKeyword);
+  }
 }
 
 class IndexExpressionTest extends EngineTestCase {
   void test_inGetterContext_assignment_compound_left() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // a[b] += c
-    AstFactory.assignmentExpression(expression, TokenType.PLUS_EQ, AstFactory.identifier3("c"));
+    AstFactory.assignmentExpression(
+        expression,
+        TokenType.PLUS_EQ,
+        AstFactory.identifier3("c"));
     expect(expression.inGetterContext(), isTrue);
   }
 
   void test_inGetterContext_assignment_simple_left() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // a[b] = c
-    AstFactory.assignmentExpression(expression, TokenType.EQ, AstFactory.identifier3("c"));
+    AstFactory.assignmentExpression(
+        expression,
+        TokenType.EQ,
+        AstFactory.identifier3("c"));
     expect(expression.inGetterContext(), isFalse);
   }
 
   void test_inGetterContext_nonAssignment() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // a[b] + c
-    AstFactory.binaryExpression(expression, TokenType.PLUS, AstFactory.identifier3("c"));
+    AstFactory.binaryExpression(
+        expression,
+        TokenType.PLUS,
+        AstFactory.identifier3("c"));
     expect(expression.inGetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_compound_left() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // a[b] += c
-    AstFactory.assignmentExpression(expression, TokenType.PLUS_EQ, AstFactory.identifier3("c"));
+    AstFactory.assignmentExpression(
+        expression,
+        TokenType.PLUS_EQ,
+        AstFactory.identifier3("c"));
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_compound_right() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // c += a[b]
-    AstFactory.assignmentExpression(AstFactory.identifier3("c"), TokenType.PLUS_EQ, expression);
+    AstFactory.assignmentExpression(
+        AstFactory.identifier3("c"),
+        TokenType.PLUS_EQ,
+        expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_assignment_simple_left() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // a[b] = c
-    AstFactory.assignmentExpression(expression, TokenType.EQ, AstFactory.identifier3("c"));
+    AstFactory.assignmentExpression(
+        expression,
+        TokenType.EQ,
+        AstFactory.identifier3("c"));
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_assignment_simple_right() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // c = a[b]
-    AstFactory.assignmentExpression(AstFactory.identifier3("c"), TokenType.EQ, expression);
+    AstFactory.assignmentExpression(
+        AstFactory.identifier3("c"),
+        TokenType.EQ,
+        expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_nonAssignment() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
-    AstFactory.binaryExpression(expression, TokenType.PLUS, AstFactory.identifier3("c"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
+    AstFactory.binaryExpression(
+        expression,
+        TokenType.PLUS,
+        AstFactory.identifier3("c"));
     // a[b] + cc
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_postfix() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     AstFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
     // a[b]++
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_prefix_bang() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // !a[b]
     AstFactory.prefixExpression(TokenType.BANG, expression);
     expect(expression.inSetterContext(), isFalse);
   }
 
   void test_inSetterContext_prefix_minusMinus() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // --a[b]
     AstFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
     expect(expression.inSetterContext(), isTrue);
   }
 
   void test_inSetterContext_prefix_plusPlus() {
-    IndexExpression expression = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    IndexExpression expression = AstFactory.indexExpression(
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     // ++a[b]
     AstFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
     expect(expression.inSetterContext(), isTrue);
@@ -629,14 +866,6 @@
     expect(fourthNode.parent, same(parent));
   }
 
-  void test_create() {
-    AstNode owner = AstFactory.argumentList();
-    NodeList<AstNode> list = NodeList.create(owner);
-    expect(list, isNotNull);
-    expect(list, hasLength(0));
-    expect(list.owner, same(owner));
-  }
-
   void test_creation() {
     AstNode owner = AstFactory.argumentList();
     NodeList<AstNode> list = new NodeList<AstNode>(owner);
@@ -672,7 +901,8 @@
 
   void test_getBeginToken_nonEmpty() {
     NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
-    AstNode node = AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
+    AstNode node =
+        AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
     list.add(node);
     expect(list.beginToken, same(node.beginToken));
   }
@@ -684,7 +914,8 @@
 
   void test_getEndToken_nonEmpty() {
     NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
-    AstNode node = AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
+    AstNode node =
+        AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
     list.add(node);
     expect(list.endToken, same(node.endToken));
   }
@@ -789,8 +1020,14 @@
 
 class NodeLocatorTest extends ParserTestCase {
   void test_range() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;");
-    _assertLocate(unit, 4, 10, (node) => node is LibraryDirective, LibraryDirective);
+    CompilationUnit unit =
+        ParserTestCase.parseCompilationUnit("library myLib;");
+    _assertLocate(
+        unit,
+        4,
+        10,
+        (node) => node is LibraryDirective,
+        LibraryDirective);
   }
 
   void test_searchWithin_null() {
@@ -799,8 +1036,14 @@
   }
 
   void test_searchWithin_offset() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;");
-    _assertLocate(unit, 10, 10, (node) => node is SimpleIdentifier, SimpleIdentifier);
+    CompilationUnit unit =
+        ParserTestCase.parseCompilationUnit("library myLib;");
+    _assertLocate(
+        unit,
+        10,
+        10,
+        (node) => node is SimpleIdentifier,
+        SimpleIdentifier);
   }
 
   void test_searchWithin_offsetAfterNode() {
@@ -821,40 +1064,52 @@
     expect(node, isNull);
   }
 
-  void _assertLocate(CompilationUnit unit, int start, int end, Predicate<AstNode> predicate, Type expectedClass) {
+  void _assertLocate(CompilationUnit unit, int start, int end,
+      Predicate<AstNode> predicate, Type expectedClass) {
     NodeLocator locator = new NodeLocator.con2(start, end);
     AstNode node = locator.searchWithin(unit);
     expect(node, isNotNull);
     expect(locator.foundNode, same(node));
     expect(node.offset <= start, isTrue, reason: "Node starts after range");
-    expect(node.offset + node.length > end, isTrue, reason: "Node ends before range");
+    expect(
+        node.offset + node.length > end,
+        isTrue,
+        reason: "Node ends before range");
     EngineTestCase.assertInstanceOf(predicate, expectedClass, node);
   }
 }
 
 class SimpleIdentifierTest extends ParserTestCase {
   void test_inDeclarationContext_catch_exception() {
-    SimpleIdentifier identifier = AstFactory.catchClause("e").exceptionParameter;
+    SimpleIdentifier identifier =
+        AstFactory.catchClause("e").exceptionParameter;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_catch_stack() {
-    SimpleIdentifier identifier = AstFactory.catchClause2("e", "s").stackTraceParameter;
+    SimpleIdentifier identifier =
+        AstFactory.catchClause2("e", "s").stackTraceParameter;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_classDeclaration() {
-    SimpleIdentifier identifier = AstFactory.classDeclaration(null, "C", null, null, null, null).name;
+    SimpleIdentifier identifier =
+        AstFactory.classDeclaration(null, "C", null, null, null, null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_classTypeAlias() {
-    SimpleIdentifier identifier = AstFactory.classTypeAlias("C", null, null, null, null, null).name;
+    SimpleIdentifier identifier =
+        AstFactory.classTypeAlias("C", null, null, null, null, null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_constructorDeclaration() {
-    SimpleIdentifier identifier = AstFactory.constructorDeclaration(AstFactory.identifier3("C"), "c", null, null).name;
+    SimpleIdentifier identifier = AstFactory.constructorDeclaration(
+        AstFactory.identifier3("C"),
+        "c",
+        null,
+        null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -865,34 +1120,40 @@
   }
 
   void test_inDeclarationContext_enumConstantDeclaration() {
-    EnumDeclaration enumDeclaration = AstFactory.enumDeclaration2('MyEnum', ['CONST']);
+    EnumDeclaration enumDeclaration =
+        AstFactory.enumDeclaration2('MyEnum', ['CONST']);
     SimpleIdentifier identifier = enumDeclaration.constants[0].name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_enumDeclaration() {
-    EnumDeclaration enumDeclaration = AstFactory.enumDeclaration2('MyEnum', ['A', 'B', 'C']);
+    EnumDeclaration enumDeclaration =
+        AstFactory.enumDeclaration2('MyEnum', ['A', 'B', 'C']);
     SimpleIdentifier identifier = enumDeclaration.name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_fieldFormalParameter() {
-    SimpleIdentifier identifier = AstFactory.fieldFormalParameter2("p").identifier;
+    SimpleIdentifier identifier =
+        AstFactory.fieldFormalParameter2("p").identifier;
     expect(identifier.inDeclarationContext(), isFalse);
   }
 
   void test_inDeclarationContext_functionDeclaration() {
-    SimpleIdentifier identifier = AstFactory.functionDeclaration(null, null, "f", null).name;
+    SimpleIdentifier identifier =
+        AstFactory.functionDeclaration(null, null, "f", null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_functionTypeAlias() {
-    SimpleIdentifier identifier = AstFactory.typeAlias(null, "F", null, null).name;
+    SimpleIdentifier identifier =
+        AstFactory.typeAlias(null, "F", null, null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_label_false() {
-    SimpleIdentifier identifier = AstFactory.namedExpression2("l", AstFactory.integer(0)).name.label;
+    SimpleIdentifier identifier =
+        AstFactory.namedExpression2("l", AstFactory.integer(0)).name.label;
     expect(identifier.inDeclarationContext(), isFalse);
   }
 
@@ -905,17 +1166,26 @@
 
   void test_inDeclarationContext_methodDeclaration() {
     SimpleIdentifier identifier = AstFactory.identifier3("m");
-    AstFactory.methodDeclaration2(null, null, null, null, identifier, null, null);
+    AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        identifier,
+        null,
+        null);
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_prefix() {
-    SimpleIdentifier identifier = AstFactory.importDirective3("uri", "pref").prefix;
+    SimpleIdentifier identifier =
+        AstFactory.importDirective3("uri", "pref").prefix;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_simpleFormalParameter() {
-    SimpleIdentifier identifier = AstFactory.simpleFormalParameter3("p").identifier;
+    SimpleIdentifier identifier =
+        AstFactory.simpleFormalParameter3("p").identifier;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -940,7 +1210,9 @@
     for (WrapperKind wrapper in WrapperKind.values) {
       for (AssignmentKind assignment in AssignmentKind.values) {
         SimpleIdentifier identifier = _createIdentifier(wrapper, assignment);
-        if (assignment == AssignmentKind.SIMPLE_LEFT && wrapper != WrapperKind.PREFIXED_LEFT && wrapper != WrapperKind.PROPERTY_LEFT) {
+        if (assignment == AssignmentKind.SIMPLE_LEFT &&
+            wrapper != WrapperKind.PREFIXED_LEFT &&
+            wrapper != WrapperKind.PROPERTY_LEFT) {
           if (identifier.inGetterContext()) {
             fail("Expected ${_topMostNode(identifier).toSource()} to be false");
           }
@@ -963,7 +1235,9 @@
 
   void test_inReferenceContext() {
     SimpleIdentifier identifier = AstFactory.identifier3("id");
-    AstFactory.namedExpression(AstFactory.label(identifier), AstFactory.identifier3("_"));
+    AstFactory.namedExpression(
+        AstFactory.label(identifier),
+        AstFactory.identifier3("_"));
     expect(identifier.inGetterContext(), isFalse);
     expect(identifier.inSetterContext(), isFalse);
   }
@@ -972,7 +1246,13 @@
     for (WrapperKind wrapper in WrapperKind.values) {
       for (AssignmentKind assignment in AssignmentKind.values) {
         SimpleIdentifier identifier = _createIdentifier(wrapper, assignment);
-        if (wrapper == WrapperKind.PREFIXED_LEFT || wrapper == WrapperKind.PROPERTY_LEFT || assignment == AssignmentKind.BINARY || assignment == AssignmentKind.COMPOUND_RIGHT || assignment == AssignmentKind.PREFIX_NOT || assignment == AssignmentKind.SIMPLE_RIGHT || assignment == AssignmentKind.NONE) {
+        if (wrapper == WrapperKind.PREFIXED_LEFT ||
+            wrapper == WrapperKind.PROPERTY_LEFT ||
+            assignment == AssignmentKind.BINARY ||
+            assignment == AssignmentKind.COMPOUND_RIGHT ||
+            assignment == AssignmentKind.PREFIX_NOT ||
+            assignment == AssignmentKind.SIMPLE_RIGHT ||
+            assignment == AssignmentKind.NONE) {
           if (identifier.inSetterContext()) {
             fail("Expected ${_topMostNode(identifier).toSource()} to be false");
           }
@@ -994,13 +1274,17 @@
   }
 
   void test_isQualified_inMethodInvocation_noTarget() {
-    MethodInvocation invocation = AstFactory.methodInvocation2("test", [AstFactory.identifier3("arg0")]);
+    MethodInvocation invocation =
+        AstFactory.methodInvocation2("test", [AstFactory.identifier3("arg0")]);
     SimpleIdentifier identifier = invocation.methodName;
     expect(identifier.isQualified, isFalse);
   }
 
   void test_isQualified_inMethodInvocation_withTarget() {
-    MethodInvocation invocation = AstFactory.methodInvocation(AstFactory.identifier3("target"), "test", [AstFactory.identifier3("arg0")]);
+    MethodInvocation invocation = AstFactory.methodInvocation(
+        AstFactory.identifier3("target"),
+        "test",
+        [AstFactory.identifier3("arg0")]);
     SimpleIdentifier identifier = invocation.methodName;
     expect(identifier.isQualified, isTrue);
   }
@@ -1035,29 +1319,42 @@
     expect(identifier.isQualified, isFalse);
   }
 
-  SimpleIdentifier _createIdentifier(WrapperKind wrapper, AssignmentKind assignment) {
+  SimpleIdentifier _createIdentifier(WrapperKind wrapper,
+      AssignmentKind assignment) {
     SimpleIdentifier identifier = AstFactory.identifier3("a");
     Expression expression = identifier;
     while (true) {
       if (wrapper == WrapperKind.PREFIXED_LEFT) {
-        expression = AstFactory.identifier(identifier, AstFactory.identifier3("_"));
+        expression =
+            AstFactory.identifier(identifier, AstFactory.identifier3("_"));
       } else if (wrapper == WrapperKind.PREFIXED_RIGHT) {
-        expression = AstFactory.identifier(AstFactory.identifier3("_"), identifier);
+        expression =
+            AstFactory.identifier(AstFactory.identifier3("_"), identifier);
       } else if (wrapper == WrapperKind.PROPERTY_LEFT) {
         expression = AstFactory.propertyAccess2(expression, "_");
       } else if (wrapper == WrapperKind.PROPERTY_RIGHT) {
-        expression = AstFactory.propertyAccess(AstFactory.identifier3("_"), identifier);
+        expression =
+            AstFactory.propertyAccess(AstFactory.identifier3("_"), identifier);
       } else if (wrapper == WrapperKind.NONE) {
       }
       break;
     }
     while (true) {
       if (assignment == AssignmentKind.BINARY) {
-        AstFactory.binaryExpression(expression, TokenType.PLUS, AstFactory.identifier3("_"));
+        AstFactory.binaryExpression(
+            expression,
+            TokenType.PLUS,
+            AstFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.COMPOUND_LEFT) {
-        AstFactory.assignmentExpression(expression, TokenType.PLUS_EQ, AstFactory.identifier3("_"));
+        AstFactory.assignmentExpression(
+            expression,
+            TokenType.PLUS_EQ,
+            AstFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.COMPOUND_RIGHT) {
-        AstFactory.assignmentExpression(AstFactory.identifier3("_"), TokenType.PLUS_EQ, expression);
+        AstFactory.assignmentExpression(
+            AstFactory.identifier3("_"),
+            TokenType.PLUS_EQ,
+            expression);
       } else if (assignment == AssignmentKind.POSTFIX_INC) {
         AstFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
       } else if (assignment == AssignmentKind.PREFIX_DEC) {
@@ -1067,9 +1364,15 @@
       } else if (assignment == AssignmentKind.PREFIX_NOT) {
         AstFactory.prefixExpression(TokenType.BANG, expression);
       } else if (assignment == AssignmentKind.SIMPLE_LEFT) {
-        AstFactory.assignmentExpression(expression, TokenType.EQ, AstFactory.identifier3("_"));
+        AstFactory.assignmentExpression(
+            expression,
+            TokenType.EQ,
+            AstFactory.identifier3("_"));
       } else if (assignment == AssignmentKind.SIMPLE_RIGHT) {
-        AstFactory.assignmentExpression(AstFactory.identifier3("_"), TokenType.EQ, expression);
+        AstFactory.assignmentExpression(
+            AstFactory.identifier3("_"),
+            TokenType.EQ,
+            expression);
       } else if (assignment == AssignmentKind.NONE) {
       }
       break;
@@ -1095,26 +1398,152 @@
 }
 
 class SimpleStringLiteralTest extends ParserTestCase {
-  void test_contentsOffset() {
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").contentsOffset, 1);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").contentsOffset, 1);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").contentsOffset, 3);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X").contentsOffset, 3);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").contentsOffset, 2);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X").contentsOffset, 2);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").contentsOffset, 4);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X").contentsOffset, 4);
+  void test_contentsEnd() {
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").contentsEnd,
+        2);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").contentsEnd,
+        2);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""),
+            "X").contentsEnd,
+        4);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("'''X'''"),
+            "X").contentsEnd,
+        4);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").contentsEnd,
+        3);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"X\""),
+            "X").contentsEnd,
+        3);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""),
+            "X").contentsEnd,
+        5);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r'''X'''"),
+            "X").contentsEnd,
+        5);
   }
 
-  void test_contentsEnd() {
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").contentsEnd, 2);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").contentsEnd, 2);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").contentsEnd, 4);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X").contentsEnd, 4);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").contentsEnd, 3);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X").contentsEnd, 3);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").contentsEnd, 5);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X").contentsEnd, 5);
+  void test_contentsOffset() {
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("'X'"),
+            "X").contentsOffset,
+        1);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"X\""),
+            "X").contentsOffset,
+        1);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""),
+            "X").contentsOffset,
+        3);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("'''X'''"),
+            "X").contentsOffset,
+        3);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r'X'"),
+            "X").contentsOffset,
+        2);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"X\""),
+            "X").contentsOffset,
+        2);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""),
+            "X").contentsOffset,
+        4);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r'''X'''"),
+            "X").contentsOffset,
+        4);
+  }
+
+  void test_isMultiline() {
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"X\""),
+            "X").isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("'''X'''"),
+            "X").isMultiline,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r'''X'''"),
+            "X").isMultiline,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""),
+            "X").isMultiline,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""),
+            "X").isMultiline,
+        isTrue);
+  }
+
+  void test_isRaw() {
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""),
+            "X").isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X").isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X").isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""),
+            "X").isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X").isRaw,
+        isTrue);
   }
 
   void test_isSingleQuoted() {
@@ -1171,28 +1600,6 @@
     }
   }
 
-  void test_isMultiline() {
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X").isMultiline, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X").isMultiline, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").isMultiline, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").isMultiline, isTrue);
-  }
-
-  void test_isRaw() {
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X").isRaw, isTrue);
-  }
-
   void test_simple() {
     Token token = TokenFactory.tokenFromString("'value'");
     SimpleStringLiteral stringLiteral = new SimpleStringLiteral(token, "value");
@@ -1294,6 +1701,11 @@
     }
   }
 
+  void test_isRaw() {
+    StringInterpolation node = AstFactory.string();
+    expect(node.isRaw, isFalse);
+  }
+
   void test_isSingleQuoted() {
     var b = AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
     // "
@@ -1325,16 +1737,13 @@
       expect(node.isSingleQuoted, isTrue);
     }
   }
-
-  void test_isRaw() {
-    StringInterpolation node = AstFactory.string();
-    expect(node.isRaw, isFalse);
-  }
 }
 
 class ToSourceVisitorTest extends EngineTestCase {
   void test_visitAdjacentStrings() {
-    _assertSource("'a' 'b'", AstFactory.adjacentStrings([AstFactory.string2("a"), AstFactory.string2("b")]));
+    _assertSource(
+        "'a' 'b'",
+        AstFactory.adjacentStrings([AstFactory.string2("a"), AstFactory.string2("b")]));
   }
 
   void test_visitAnnotation_constant() {
@@ -1342,31 +1751,57 @@
   }
 
   void test_visitAnnotation_constructor() {
-    _assertSource("@A.c()", AstFactory.annotation2(AstFactory.identifier3("A"), AstFactory.identifier3("c"), AstFactory.argumentList()));
+    _assertSource(
+        "@A.c()",
+        AstFactory.annotation2(
+            AstFactory.identifier3("A"),
+            AstFactory.identifier3("c"),
+            AstFactory.argumentList()));
   }
 
   void test_visitArgumentList() {
-    _assertSource("(a, b)", AstFactory.argumentList([AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "(a, b)",
+        AstFactory.argumentList(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitAsExpression() {
-    _assertSource("e as T", AstFactory.asExpression(AstFactory.identifier3("e"), AstFactory.typeName4("T")));
+    _assertSource(
+        "e as T",
+        AstFactory.asExpression(
+            AstFactory.identifier3("e"),
+            AstFactory.typeName4("T")));
   }
 
   void test_visitAssertStatement() {
-    _assertSource("assert (a);", AstFactory.assertStatement(AstFactory.identifier3("a")));
+    _assertSource(
+        "assert (a);",
+        AstFactory.assertStatement(AstFactory.identifier3("a")));
   }
 
   void test_visitAssignmentExpression() {
-    _assertSource("a = b", AstFactory.assignmentExpression(AstFactory.identifier3("a"), TokenType.EQ, AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstFactory.assignmentExpression(
+            AstFactory.identifier3("a"),
+            TokenType.EQ,
+            AstFactory.identifier3("b")));
   }
 
   void test_visitAwaitExpression() {
-    _assertSource("await e;", AstFactory.awaitExpression(AstFactory.identifier3("e")));
+    _assertSource(
+        "await e;",
+        AstFactory.awaitExpression(AstFactory.identifier3("e")));
   }
 
   void test_visitBinaryExpression() {
-    _assertSource("a + b", AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS, AstFactory.identifier3("b")));
+    _assertSource(
+        "a + b",
+        AstFactory.binaryExpression(
+            AstFactory.identifier3("a"),
+            TokenType.PLUS,
+            AstFactory.identifier3("b")));
   }
 
   void test_visitBlock_empty() {
@@ -1374,7 +1809,9 @@
   }
 
   void test_visitBlock_nonEmpty() {
-    _assertSource("{break; break;}", AstFactory.block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
+    _assertSource(
+        "{break; break;}",
+        AstFactory.block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
   }
 
   void test_visitBlockFunctionBody_async() {
@@ -1414,21 +1851,33 @@
   }
 
   void test_visitCascadeExpression_field() {
-    _assertSource("a..b..c", AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-        AstFactory.cascadedPropertyAccess("b"),
-        AstFactory.cascadedPropertyAccess("c")]));
+    _assertSource(
+        "a..b..c",
+        AstFactory.cascadeExpression(
+            AstFactory.identifier3("a"),
+            [
+                AstFactory.cascadedPropertyAccess("b"),
+                AstFactory.cascadedPropertyAccess("c")]));
   }
 
   void test_visitCascadeExpression_index() {
-    _assertSource("a..[0]..[1]", AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-        AstFactory.cascadedIndexExpression(AstFactory.integer(0)),
-        AstFactory.cascadedIndexExpression(AstFactory.integer(1))]));
+    _assertSource(
+        "a..[0]..[1]",
+        AstFactory.cascadeExpression(
+            AstFactory.identifier3("a"),
+            [
+                AstFactory.cascadedIndexExpression(AstFactory.integer(0)),
+                AstFactory.cascadedIndexExpression(AstFactory.integer(1))]));
   }
 
   void test_visitCascadeExpression_method() {
-    _assertSource("a..b()..c()", AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-        AstFactory.cascadedMethodInvocation("b"),
-        AstFactory.cascadedMethodInvocation("c")]));
+    _assertSource(
+        "a..b()..c()",
+        AstFactory.cascadeExpression(
+            AstFactory.identifier3("a"),
+            [
+                AstFactory.cascadedMethodInvocation("b"),
+                AstFactory.cascadedMethodInvocation("c")]));
   }
 
   void test_visitCatchClause_catch_noStack() {
@@ -1440,123 +1889,322 @@
   }
 
   void test_visitCatchClause_on() {
-    _assertSource("on E {}", AstFactory.catchClause3(AstFactory.typeName4("E")));
+    _assertSource(
+        "on E {}",
+        AstFactory.catchClause3(AstFactory.typeName4("E")));
   }
 
   void test_visitCatchClause_on_catch() {
-    _assertSource("on E catch (e) {}", AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
+    _assertSource(
+        "on E catch (e) {}",
+        AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
   }
 
   void test_visitClassDeclaration_abstract() {
-    _assertSource("abstract class C {}", AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null));
+    _assertSource(
+        "abstract class C {}",
+        AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_empty() {
-    _assertSource("class C {}", AstFactory.classDeclaration(null, "C", null, null, null, null));
+    _assertSource(
+        "class C {}",
+        AstFactory.classDeclaration(null, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_extends() {
-    _assertSource("class C extends A {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+    _assertSource(
+        "class C extends A {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
+            null));
   }
 
   void test_visitClassDeclaration_extends_implements() {
-    _assertSource("class C extends A implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C extends A implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
-    _assertSource("class C extends A with M {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), null));
+    _assertSource(
+        "class C extends A with M {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
-    _assertSource("class C extends A with M implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C extends A with M implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_implements() {
-    _assertSource("class C implements B {}", AstFactory.classDeclaration(null, "C", null, null, null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            null,
+            null,
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_multipleMember() {
-    _assertSource("class C {var a; var b;}", AstFactory.classDeclaration(null, "C", null, null, null, null, [
-        AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("a")]),
-        AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("b")])]));
+    _assertSource(
+        "class C {var a; var b;}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            null,
+            null,
+            null,
+            [
+                AstFactory.fieldDeclaration2(
+                    false,
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")]),
+                AstFactory.fieldDeclaration2(
+                    false,
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("b")])]));
   }
 
   void test_visitClassDeclaration_parameters() {
-    _assertSource("class C<E> {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, null));
+    _assertSource(
+        "class C<E> {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            null,
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends() {
-    _assertSource("class C<E> extends A {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+    _assertSource(
+        "class C<E> extends A {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_implements() {
-    _assertSource("class C<E> extends A implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C<E> extends A implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
-    _assertSource("class C<E> extends A with M {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), null));
+    _assertSource(
+        "class C<E> extends A with M {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
-    _assertSource("class C<E> extends A with M implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C<E> extends A with M implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_implements() {
-    _assertSource("class C<E> implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C<E> implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            null,
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_singleMember() {
-    _assertSource("class C {var a;}", AstFactory.classDeclaration(null, "C", null, null, null, null, [AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("a")])]));
+    _assertSource(
+        "class C {var a;}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            null,
+            null,
+            null,
+            [
+                AstFactory.fieldDeclaration2(
+                    false,
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitClassDeclaration_withMetadata() {
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "C", null, null, null, null);
-    declaration.metadata = [
-        AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    ClassDeclaration declaration =
+        AstFactory.classDeclaration(null, "C", null, null, null, null);
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated class C {}", declaration);
   }
 
   void test_visitClassTypeAlias_abstract() {
-    _assertSource("abstract class C = S with M1;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+    _assertSource(
+        "abstract class C = S with M1;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_abstract_implements() {
-    _assertSource("abstract class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
+    _assertSource(
+        "abstract class C = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
-    _assertSource("class C<E> = S<E> with M1<E>;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S", [AstFactory.typeName4("E")]), AstFactory.withClause([AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]), null));
+    _assertSource(
+        "class C<E> = S<E> with M1<E>;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
+            AstFactory.withClause(
+                [AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]),
+            null));
   }
 
   void test_visitClassTypeAlias_implements() {
-    _assertSource("class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
+    _assertSource(
+        "class C = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_minimal() {
-    _assertSource("class C = S with M1;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+    _assertSource(
+        "class C = S with M1;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract() {
-    _assertSource("abstract class C<E> = S with M1;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+    _assertSource(
+        "abstract class C<E> = S with M1;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract_implements() {
-    _assertSource("abstract class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
+    _assertSource(
+        "abstract class C<E> = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
-    _assertSource("class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
+    _assertSource(
+        "class C<E> = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
-    ClassTypeAlias declaration = AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null);
-    declaration.metadata = [
-        AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    ClassTypeAlias declaration = AstFactory.classTypeAlias(
+        "C",
+        null,
+        null,
+        AstFactory.typeName4("S"),
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null);
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
   void test_visitComment() {
-    _assertSource("", Comment.createBlockComment(<Token> [TokenFactory.tokenFromString("/* comment */")]));
+    _assertSource(
+        "",
+        Comment.createBlockComment(
+            <Token>[TokenFactory.tokenFromString("/* comment */")]));
   }
 
   void test_visitCommentReference() {
@@ -1564,19 +2212,30 @@
   }
 
   void test_visitCompilationUnit_declaration() {
-    _assertSource("var a;", AstFactory.compilationUnit2([AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [AstFactory.variableDeclaration("a")])]));
+    _assertSource(
+        "var a;",
+        AstFactory.compilationUnit2(
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_directive() {
-    _assertSource("library l;", AstFactory.compilationUnit3([AstFactory.libraryDirective2("l")]));
+    _assertSource(
+        "library l;",
+        AstFactory.compilationUnit3([AstFactory.libraryDirective2("l")]));
   }
 
   void test_visitCompilationUnit_directive_declaration() {
-    _assertSource("library l; var a;", AstFactory.compilationUnit4(
-        [AstFactory.libraryDirective2("l")],
-        [AstFactory.topLevelVariableDeclaration2(
-            Keyword.VAR,
-            [AstFactory.variableDeclaration("a")])]));
+    _assertSource(
+        "library l; var a;",
+        AstFactory.compilationUnit4(
+            [AstFactory.libraryDirective2("l")],
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_empty() {
@@ -1584,100 +2243,198 @@
   }
 
   void test_visitCompilationUnit_script() {
-    _assertSource("!#/bin/dartvm", AstFactory.compilationUnit5("!#/bin/dartvm"));
+    _assertSource(
+        "!#/bin/dartvm",
+        AstFactory.compilationUnit5("!#/bin/dartvm"));
   }
 
   void test_visitCompilationUnit_script_declaration() {
-    _assertSource("!#/bin/dartvm var a;", AstFactory.compilationUnit6("!#/bin/dartvm", [AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [AstFactory.variableDeclaration("a")])]));
+    _assertSource(
+        "!#/bin/dartvm var a;",
+        AstFactory.compilationUnit6(
+            "!#/bin/dartvm",
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_script_directive() {
-    _assertSource("!#/bin/dartvm library l;", AstFactory.compilationUnit7("!#/bin/dartvm", [AstFactory.libraryDirective2("l")]));
+    _assertSource(
+        "!#/bin/dartvm library l;",
+        AstFactory.compilationUnit7(
+            "!#/bin/dartvm",
+            [AstFactory.libraryDirective2("l")]));
   }
 
   void test_visitCompilationUnit_script_directives_declarations() {
-    _assertSource("!#/bin/dartvm library l; var a;", AstFactory.compilationUnit8(
-        "!#/bin/dartvm",
-        [AstFactory.libraryDirective2("l")],
-        [AstFactory.topLevelVariableDeclaration2(
-            Keyword.VAR,
-            [AstFactory.variableDeclaration("a")])]));
+    _assertSource(
+        "!#/bin/dartvm library l; var a;",
+        AstFactory.compilationUnit8(
+            "!#/bin/dartvm",
+            [AstFactory.libraryDirective2("l")],
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitConditionalExpression() {
-    _assertSource("a ? b : c", AstFactory.conditionalExpression(AstFactory.identifier3("a"), AstFactory.identifier3("b"), AstFactory.identifier3("c")));
+    _assertSource(
+        "a ? b : c",
+        AstFactory.conditionalExpression(
+            AstFactory.identifier3("a"),
+            AstFactory.identifier3("b"),
+            AstFactory.identifier3("c")));
   }
 
   void test_visitConstructorDeclaration_const() {
-    _assertSource("const C() {}", AstFactory.constructorDeclaration2(Keyword.CONST, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "const C() {}",
+        AstFactory.constructorDeclaration2(
+            Keyword.CONST,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
-    _assertSource("external C();", AstFactory.constructorDeclaration(AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null));
+    _assertSource(
+        "external C();",
+        AstFactory.constructorDeclaration(
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            null));
   }
 
   void test_visitConstructorDeclaration_minimal() {
-    _assertSource("C() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C() {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
-    _assertSource("C() : a = b, c = d {}", AstFactory.constructorDeclaration2(
-        null,
-        null,
-        AstFactory.identifier3("C"),
-        null,
-        AstFactory.formalParameterList(),
-        [
-          AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
-          AstFactory.constructorFieldInitializer(false, "c", AstFactory.identifier3("d"))],
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C() : a = b, c = d {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            [
+                AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
+                AstFactory.constructorFieldInitializer(
+                    false,
+                    "c",
+                    AstFactory.identifier3("d"))],
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
-    _assertSource("C(var a, var b) {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C(var a, var b) {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(
+                [
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
-    _assertSource("C.m() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), "m", AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C.m() {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            "m",
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
-    _assertSource("C() : a = b {}", AstFactory.constructorDeclaration2(
+    _assertSource(
+        "C() : a = b {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            [
+                AstFactory.constructorFieldInitializer(
+                    false,
+                    "a",
+                    AstFactory.identifier3("b"))],
+            AstFactory.blockFunctionBody2()));
+  }
+
+  void test_visitConstructorDeclaration_withMetadata() {
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
         null,
         null,
         AstFactory.identifier3("C"),
         null,
         AstFactory.formalParameterList(),
-        [AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b"))],
-        AstFactory.blockFunctionBody2()));
-  }
-
-  void test_visitConstructorDeclaration_withMetadata() {
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2());
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+        null,
+        AstFactory.blockFunctionBody2());
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated C() {}", declaration);
   }
 
   void test_visitConstructorFieldInitializer_withoutThis() {
-    _assertSource("a = b", AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstFactory.constructorFieldInitializer(
+            false,
+            "a",
+            AstFactory.identifier3("b")));
   }
 
   void test_visitConstructorFieldInitializer_withThis() {
-    _assertSource("this.a = b", AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3("b")));
+    _assertSource(
+        "this.a = b",
+        AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3("b")));
   }
 
   void test_visitConstructorName_named_prefix() {
-    _assertSource("p.C.n", AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
+    _assertSource(
+        "p.C.n",
+        AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
   }
 
   void test_visitConstructorName_unnamed_noPrefix() {
-    _assertSource("C", AstFactory.constructorName(AstFactory.typeName4("C"), null));
+    _assertSource(
+        "C",
+        AstFactory.constructorName(AstFactory.typeName4("C"), null));
   }
 
   void test_visitConstructorName_unnamed_prefix() {
-    _assertSource("p.C", AstFactory.constructorName(AstFactory.typeName3(AstFactory.identifier5("p", "C")), null));
+    _assertSource(
+        "p.C",
+        AstFactory.constructorName(
+            AstFactory.typeName3(AstFactory.identifier5("p", "C")),
+            null));
   }
 
   void test_visitContinueStatement_label() {
@@ -1689,23 +2446,39 @@
   }
 
   void test_visitDefaultFormalParameter_named_noValue() {
-    _assertSource("p", AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p"), null));
+    _assertSource(
+        "p",
+        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p"), null));
   }
 
   void test_visitDefaultFormalParameter_named_value() {
-    _assertSource("p : 0", AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+    _assertSource(
+        "p : 0",
+        AstFactory.namedFormalParameter(
+            AstFactory.simpleFormalParameter3("p"),
+            AstFactory.integer(0)));
   }
 
   void test_visitDefaultFormalParameter_positional_noValue() {
-    _assertSource("p", AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p"), null));
+    _assertSource(
+        "p",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter3("p"),
+            null));
   }
 
   void test_visitDefaultFormalParameter_positional_value() {
-    _assertSource("p = 0", AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+    _assertSource(
+        "p = 0",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter3("p"),
+            AstFactory.integer(0)));
   }
 
   void test_visitDoStatement() {
-    _assertSource("do {} while (c);", AstFactory.doStatement(AstFactory.block(), AstFactory.identifier3("c")));
+    _assertSource(
+        "do {} while (c);",
+        AstFactory.doStatement(AstFactory.block(), AstFactory.identifier3("c")));
   }
 
   void test_visitDoubleLiteral() {
@@ -1721,7 +2494,9 @@
   }
 
   void test_visitEnumDeclaration_multiple() {
-    _assertSource("enum E {ONE, TWO}", AstFactory.enumDeclaration2("E", ["ONE", "TWO"]));
+    _assertSource(
+        "enum E {ONE, TWO}",
+        AstFactory.enumDeclaration2("E", ["ONE", "TWO"]));
   }
 
   void test_visitEnumDeclaration_single() {
@@ -1729,13 +2504,21 @@
   }
 
   void test_visitExportDirective_combinator() {
-    _assertSource("export 'a.dart' show A;", AstFactory.exportDirective2("a.dart", [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "export 'a.dart' show A;",
+        AstFactory.exportDirective2(
+            "a.dart",
+            [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
   }
 
   void test_visitExportDirective_combinators() {
-    _assertSource("export 'a.dart' show A hide B;", AstFactory.exportDirective2("a.dart", [
-        AstFactory.showCombinator([AstFactory.identifier3("A")]),
-        AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
+    _assertSource(
+        "export 'a.dart' show A hide B;",
+        AstFactory.exportDirective2(
+            "a.dart",
+            [
+                AstFactory.showCombinator([AstFactory.identifier3("A")]),
+                AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
   }
 
   void test_visitExportDirective_minimal() {
@@ -1744,66 +2527,126 @@
 
   void test_visitExportDirective_withMetadata() {
     ExportDirective directive = AstFactory.exportDirective2("a.dart");
-    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    directive.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated export 'a.dart';", directive);
   }
 
   void test_visitExpressionFunctionBody_async() {
-    _assertSource("async => a;", AstFactory.asyncExpressionFunctionBody(AstFactory.identifier3("a")));
+    _assertSource(
+        "async => a;",
+        AstFactory.asyncExpressionFunctionBody(AstFactory.identifier3("a")));
   }
 
   void test_visitExpressionFunctionBody_simple() {
-    _assertSource("=> a;", AstFactory.expressionFunctionBody(AstFactory.identifier3("a")));
+    _assertSource(
+        "=> a;",
+        AstFactory.expressionFunctionBody(AstFactory.identifier3("a")));
   }
 
   void test_visitExpressionStatement() {
-    _assertSource("a;", AstFactory.expressionStatement(AstFactory.identifier3("a")));
+    _assertSource(
+        "a;",
+        AstFactory.expressionStatement(AstFactory.identifier3("a")));
   }
 
   void test_visitExtendsClause() {
-    _assertSource("extends C", AstFactory.extendsClause(AstFactory.typeName4("C")));
+    _assertSource(
+        "extends C",
+        AstFactory.extendsClause(AstFactory.typeName4("C")));
   }
 
   void test_visitFieldDeclaration_instance() {
-    _assertSource("var a;", AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "var a;",
+        AstFactory.fieldDeclaration2(
+            false,
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_static() {
-    _assertSource("static var a;", AstFactory.fieldDeclaration2(true, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "static var a;",
+        AstFactory.fieldDeclaration2(
+            true,
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_withMetadata() {
-    FieldDeclaration declaration = AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("a")]);
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    FieldDeclaration declaration = AstFactory.fieldDeclaration2(
+        false,
+        Keyword.VAR,
+        [AstFactory.variableDeclaration("a")]);
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated var a;", declaration);
   }
 
   void test_visitFieldFormalParameter_functionTyped() {
-    _assertSource("A this.a(b)", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a", AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b")])));
+    _assertSource(
+        "A this.a(b)",
+        AstFactory.fieldFormalParameter(
+            null,
+            AstFactory.typeName4("A"),
+            "a",
+            AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_keyword() {
-    _assertSource("var this.a", AstFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
+    _assertSource(
+        "var this.a",
+        AstFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
   }
 
   void test_visitFieldFormalParameter_keywordAndType() {
-    _assertSource("final A this.a", AstFactory.fieldFormalParameter(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "final A this.a",
+        AstFactory.fieldFormalParameter(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
-    _assertSource("A this.a", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "A this.a",
+        AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitForEachStatement_declared() {
-    _assertSource("for (a in b) {}", AstFactory.forEachStatement(AstFactory.declaredIdentifier3("a"), AstFactory.identifier3("b"), AstFactory.block()));
+    _assertSource(
+        "for (a in b) {}",
+        AstFactory.forEachStatement(
+            AstFactory.declaredIdentifier3("a"),
+            AstFactory.identifier3("b"),
+            AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
-    _assertSource("for (a in b) {}", new ForEachStatement.con2(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+    _assertSource(
+        "for (a in b) {}",
+        new ForEachStatement.con2(
+            null,
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable_await() {
-    _assertSource("await for (a in b) {}", new ForEachStatement.con2(TokenFactory.tokenFromString("await"), TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+    _assertSource(
+        "await for (a in b) {}",
+        new ForEachStatement.con2(
+            TokenFactory.tokenFromString("await"),
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
@@ -1811,171 +2654,379 @@
   }
 
   void test_visitFormalParameterList_n() {
-    _assertSource("({a : 0})", AstFactory.formalParameterList([AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))]));
+    _assertSource(
+        "({a : 0})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("a"),
+                    AstFactory.integer(0))]));
   }
 
   void test_visitFormalParameterList_nn() {
-    _assertSource("({a : 0, b : 1})", AstFactory.formalParameterList([
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))]));
+    _assertSource(
+        "({a : 0, b : 1})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("a"),
+                    AstFactory.integer(0)),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1))]));
   }
 
   void test_visitFormalParameterList_p() {
-    _assertSource("([a = 0])", AstFactory.formalParameterList([AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))]));
+    _assertSource(
+        "([a = 0])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("a"),
+                    AstFactory.integer(0))]));
   }
 
   void test_visitFormalParameterList_pp() {
-    _assertSource("([a = 0, b = 1])", AstFactory.formalParameterList([
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))]));
+    _assertSource(
+        "([a = 0, b = 1])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("a"),
+                    AstFactory.integer(0)),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1))]));
   }
 
   void test_visitFormalParameterList_r() {
-    _assertSource("(a)", AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("a")]));
+    _assertSource(
+        "(a)",
+        AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("a")]));
   }
 
   void test_visitFormalParameterList_rn() {
-    _assertSource("(a, {b : 1})", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))]));
+    _assertSource(
+        "(a, {b : 1})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1))]));
   }
 
   void test_visitFormalParameterList_rnn() {
-    _assertSource("(a, {b : 1, c : 2})", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1)),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(2))]));
+    _assertSource(
+        "(a, {b : 1, c : 2})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1)),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(2))]));
   }
 
   void test_visitFormalParameterList_rp() {
-    _assertSource("(a, [b = 1])", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))]));
+    _assertSource(
+        "(a, [b = 1])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1))]));
   }
 
   void test_visitFormalParameterList_rpp() {
-    _assertSource("(a, [b = 1, c = 2])", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1)),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(2))]));
+    _assertSource(
+        "(a, [b = 1, c = 2])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("b"),
+                    AstFactory.integer(1)),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(2))]));
   }
 
   void test_visitFormalParameterList_rr() {
-    _assertSource("(a, b)", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.simpleFormalParameter3("b")]));
+    _assertSource(
+        "(a, b)",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.simpleFormalParameter3("b")]));
   }
 
   void test_visitFormalParameterList_rrn() {
-    _assertSource("(a, b, {c : 3})", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.simpleFormalParameter3("b"),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3))]));
+    _assertSource(
+        "(a, b, {c : 3})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.simpleFormalParameter3("b"),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(3))]));
   }
 
   void test_visitFormalParameterList_rrnn() {
-    _assertSource("(a, b, {c : 3, d : 4})", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.simpleFormalParameter3("b"),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3)),
-        AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("d"), AstFactory.integer(4))]));
+    _assertSource(
+        "(a, b, {c : 3, d : 4})",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.simpleFormalParameter3("b"),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(3)),
+                AstFactory.namedFormalParameter(
+                    AstFactory.simpleFormalParameter3("d"),
+                    AstFactory.integer(4))]));
   }
 
   void test_visitFormalParameterList_rrp() {
-    _assertSource("(a, b, [c = 3])", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.simpleFormalParameter3("b"),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3))]));
+    _assertSource(
+        "(a, b, [c = 3])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.simpleFormalParameter3("b"),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(3))]));
   }
 
   void test_visitFormalParameterList_rrpp() {
-    _assertSource("(a, b, [c = 3, d = 4])", AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter3("a"),
-        AstFactory.simpleFormalParameter3("b"),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("c"), AstFactory.integer(3)),
-        AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("d"), AstFactory.integer(4))]));
+    _assertSource(
+        "(a, b, [c = 3, d = 4])",
+        AstFactory.formalParameterList(
+            [
+                AstFactory.simpleFormalParameter3("a"),
+                AstFactory.simpleFormalParameter3("b"),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("c"),
+                    AstFactory.integer(3)),
+                AstFactory.positionalFormalParameter(
+                    AstFactory.simpleFormalParameter3("d"),
+                    AstFactory.integer(4))]));
   }
 
   void test_visitForStatement_c() {
-    _assertSource("for (; c;) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), null, AstFactory.block()));
+    _assertSource(
+        "for (; c;) {}",
+        AstFactory.forStatement(
+            null,
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_cu() {
-    _assertSource("for (; c; u) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (; c; u) {}",
+        AstFactory.forStatement(
+            null,
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_e() {
-    _assertSource("for (e;;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, null, AstFactory.block()));
+    _assertSource(
+        "for (e;;) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            null,
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ec() {
-    _assertSource("for (e; c;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), null, AstFactory.block()));
+    _assertSource(
+        "for (e; c;) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ecu() {
-    _assertSource("for (e; c; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (e; c; u) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_eu() {
-    _assertSource("for (e;; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (e;; u) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_i() {
-    _assertSource("for (var i;;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, null, AstFactory.block()));
+    _assertSource(
+        "for (var i;;) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            null,
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ic() {
-    _assertSource("for (var i; c;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), null, AstFactory.block()));
+    _assertSource(
+        "for (var i; c;) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_icu() {
-    _assertSource("for (var i; c; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (var i; c; u) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_iu() {
-    _assertSource("for (var i;; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (var i;; u) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_u() {
-    _assertSource("for (;; u) {}", AstFactory.forStatement(null, null, [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (;; u) {}",
+        AstFactory.forStatement(
+            null,
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitFunctionDeclaration_getter() {
-    _assertSource("get f() {}", AstFactory.functionDeclaration(null, Keyword.GET, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "get f() {}",
+        AstFactory.functionDeclaration(
+            null,
+            Keyword.GET,
+            "f",
+            AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_local_blockBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression());
-    FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() {} 42;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
-        fStatement,
-        AstFactory.expressionStatement(AstFactory.integer(42))]))));
+    FunctionDeclaration f = AstFactory.functionDeclaration(
+        null,
+        null,
+        "f",
+        AstFactory.functionExpression());
+    FunctionDeclarationStatement fStatement =
+        new FunctionDeclarationStatement(f);
+    _assertSource(
+        "main() {f() {} 42;}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstFactory.functionExpression2(
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2(
+                    [fStatement, AstFactory.expressionStatement(AstFactory.integer(42))]))));
   }
 
   void test_visitFunctionDeclaration_local_expressionBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.expressionFunctionBody(AstFactory.integer(1))));
-    FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() => 1; 2;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
-        fStatement,
-        AstFactory.expressionStatement(AstFactory.integer(2))]))));
+    FunctionDeclaration f = AstFactory.functionDeclaration(
+        null,
+        null,
+        "f",
+        AstFactory.functionExpression2(
+            AstFactory.formalParameterList(),
+            AstFactory.expressionFunctionBody(AstFactory.integer(1))));
+    FunctionDeclarationStatement fStatement =
+        new FunctionDeclarationStatement(f);
+    _assertSource(
+        "main() {f() => 1; 2;}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstFactory.functionExpression2(
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2(
+                    [fStatement, AstFactory.expressionStatement(AstFactory.integer(2))]))));
   }
 
   void test_visitFunctionDeclaration_normal() {
-    _assertSource("f() {}", AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "f() {}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "f",
+            AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_setter() {
-    _assertSource("set f() {}", AstFactory.functionDeclaration(null, Keyword.SET, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "set f() {}",
+        AstFactory.functionDeclaration(
+            null,
+            Keyword.SET,
+            "f",
+            AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_withMetadata() {
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression());
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    FunctionDeclaration declaration = AstFactory.functionDeclaration(
+        null,
+        null,
+        "f",
+        AstFactory.functionExpression());
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated f() {}", declaration);
   }
 
   void test_visitFunctionDeclarationStatement() {
-    _assertSource("f() {}", AstFactory.functionDeclarationStatement(null, null, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "f() {}",
+        AstFactory.functionDeclarationStatement(
+            null,
+            null,
+            "f",
+            AstFactory.functionExpression()));
   }
 
   void test_visitFunctionExpression() {
@@ -1983,20 +3034,39 @@
   }
 
   void test_visitFunctionExpressionInvocation() {
-    _assertSource("f()", AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
+    _assertSource(
+        "f()",
+        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
   }
 
   void test_visitFunctionTypeAlias_generic() {
-    _assertSource("typedef A F<B>();", AstFactory.typeAlias(AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(["B"]), AstFactory.formalParameterList()));
+    _assertSource(
+        "typedef A F<B>();",
+        AstFactory.typeAlias(
+            AstFactory.typeName4("A"),
+            "F",
+            AstFactory.typeParameterList(["B"]),
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_nonGeneric() {
-    _assertSource("typedef A F();", AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null, AstFactory.formalParameterList()));
+    _assertSource(
+        "typedef A F();",
+        AstFactory.typeAlias(
+            AstFactory.typeName4("A"),
+            "F",
+            null,
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_withMetadata() {
-    FunctionTypeAlias declaration = AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null, AstFactory.formalParameterList());
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    FunctionTypeAlias declaration = AstFactory.typeAlias(
+        AstFactory.typeName4("A"),
+        "F",
+        null,
+        AstFactory.formalParameterList());
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated typedef A F();", declaration);
   }
 
@@ -2005,95 +3075,159 @@
   }
 
   void test_visitFunctionTypedFormalParameter_type() {
-    _assertSource("T f()", AstFactory.functionTypedFormalParameter(AstFactory.typeName4("T"), "f"));
+    _assertSource(
+        "T f()",
+        AstFactory.functionTypedFormalParameter(AstFactory.typeName4("T"), "f"));
   }
 
   void test_visitIfStatement_withElse() {
-    _assertSource("if (c) {} else {}", AstFactory.ifStatement2(AstFactory.identifier3("c"), AstFactory.block(), AstFactory.block()));
+    _assertSource(
+        "if (c) {} else {}",
+        AstFactory.ifStatement2(
+            AstFactory.identifier3("c"),
+            AstFactory.block(),
+            AstFactory.block()));
   }
 
   void test_visitIfStatement_withoutElse() {
-    _assertSource("if (c) {}", AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block()));
+    _assertSource(
+        "if (c) {}",
+        AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitImplementsClause_multiple() {
-    _assertSource("implements A, B", AstFactory.implementsClause([
-        AstFactory.typeName4("A"),
-        AstFactory.typeName4("B")]));
+    _assertSource(
+        "implements A, B",
+        AstFactory.implementsClause(
+            [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
   }
 
   void test_visitImplementsClause_single() {
-    _assertSource("implements A", AstFactory.implementsClause([AstFactory.typeName4("A")]));
+    _assertSource(
+        "implements A",
+        AstFactory.implementsClause([AstFactory.typeName4("A")]));
   }
 
   void test_visitImportDirective_combinator() {
-    _assertSource("import 'a.dart' show A;", AstFactory.importDirective3("a.dart", null, [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "import 'a.dart' show A;",
+        AstFactory.importDirective3(
+            "a.dart",
+            null,
+            [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
   }
 
   void test_visitImportDirective_combinators() {
-    _assertSource("import 'a.dart' show A hide B;", AstFactory.importDirective3("a.dart", null, [
-        AstFactory.showCombinator([AstFactory.identifier3("A")]),
-        AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
+    _assertSource(
+        "import 'a.dart' show A hide B;",
+        AstFactory.importDirective3(
+            "a.dart",
+            null,
+            [
+                AstFactory.showCombinator([AstFactory.identifier3("A")]),
+                AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
   }
 
   void test_visitImportDirective_deferred() {
-    _assertSource("import 'a.dart' deferred as p;", AstFactory.importDirective2("a.dart", true, "p"));
+    _assertSource(
+        "import 'a.dart' deferred as p;",
+        AstFactory.importDirective2("a.dart", true, "p"));
   }
 
   void test_visitImportDirective_minimal() {
-    _assertSource("import 'a.dart';", AstFactory.importDirective3("a.dart", null));
+    _assertSource(
+        "import 'a.dart';",
+        AstFactory.importDirective3("a.dart", null));
   }
 
   void test_visitImportDirective_prefix() {
-    _assertSource("import 'a.dart' as p;", AstFactory.importDirective3("a.dart", "p"));
+    _assertSource(
+        "import 'a.dart' as p;",
+        AstFactory.importDirective3("a.dart", "p"));
   }
 
   void test_visitImportDirective_prefix_combinator() {
-    _assertSource("import 'a.dart' as p show A;", AstFactory.importDirective3("a.dart", "p", [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "import 'a.dart' as p show A;",
+        AstFactory.importDirective3(
+            "a.dart",
+            "p",
+            [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
   }
 
   void test_visitImportDirective_prefix_combinators() {
-    _assertSource("import 'a.dart' as p show A hide B;", AstFactory.importDirective3("a.dart", "p", [
-        AstFactory.showCombinator([AstFactory.identifier3("A")]),
-        AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
+    _assertSource(
+        "import 'a.dart' as p show A hide B;",
+        AstFactory.importDirective3(
+            "a.dart",
+            "p",
+            [
+                AstFactory.showCombinator([AstFactory.identifier3("A")]),
+                AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
   }
 
   void test_visitImportDirective_withMetadata() {
     ImportDirective directive = AstFactory.importDirective3("a.dart", null);
-    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    directive.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated import 'a.dart';", directive);
   }
 
   void test_visitImportHideCombinator_multiple() {
-    _assertSource("hide a, b", AstFactory.hideCombinator([AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "hide a, b",
+        AstFactory.hideCombinator(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitImportHideCombinator_single() {
-    _assertSource("hide a", AstFactory.hideCombinator([AstFactory.identifier3("a")]));
+    _assertSource(
+        "hide a",
+        AstFactory.hideCombinator([AstFactory.identifier3("a")]));
   }
 
   void test_visitImportShowCombinator_multiple() {
-    _assertSource("show a, b", AstFactory.showCombinator([AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "show a, b",
+        AstFactory.showCombinator(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitImportShowCombinator_single() {
-    _assertSource("show a", AstFactory.showCombinator([AstFactory.identifier3("a")]));
+    _assertSource(
+        "show a",
+        AstFactory.showCombinator([AstFactory.identifier3("a")]));
   }
 
   void test_visitIndexExpression() {
-    _assertSource("a[i]", AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.identifier3("i")));
+    _assertSource(
+        "a[i]",
+        AstFactory.indexExpression(
+            AstFactory.identifier3("a"),
+            AstFactory.identifier3("i")));
   }
 
   void test_visitInstanceCreationExpression_const() {
-    _assertSource("const C()", AstFactory.instanceCreationExpression2(Keyword.CONST, AstFactory.typeName4("C")));
+    _assertSource(
+        "const C()",
+        AstFactory.instanceCreationExpression2(
+            Keyword.CONST,
+            AstFactory.typeName4("C")));
   }
 
   void test_visitInstanceCreationExpression_named() {
-    _assertSource("new C.c()", AstFactory.instanceCreationExpression3(Keyword.NEW, AstFactory.typeName4("C"), "c"));
+    _assertSource(
+        "new C.c()",
+        AstFactory.instanceCreationExpression3(
+            Keyword.NEW,
+            AstFactory.typeName4("C"),
+            "c"));
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
-    _assertSource("new C()", AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C")));
+    _assertSource(
+        "new C()",
+        AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
@@ -2101,7 +3235,9 @@
   }
 
   void test_visitInterpolationExpression_expression() {
-    _assertSource("\${a}", AstFactory.interpolationExpression(AstFactory.identifier3("a")));
+    _assertSource(
+        "\${a}",
+        AstFactory.interpolationExpression(AstFactory.identifier3("a")));
   }
 
   void test_visitInterpolationExpression_identifier() {
@@ -2113,11 +3249,21 @@
   }
 
   void test_visitIsExpression_negated() {
-    _assertSource("a is! C", AstFactory.isExpression(AstFactory.identifier3("a"), true, AstFactory.typeName4("C")));
+    _assertSource(
+        "a is! C",
+        AstFactory.isExpression(
+            AstFactory.identifier3("a"),
+            true,
+            AstFactory.typeName4("C")));
   }
 
   void test_visitIsExpression_normal() {
-    _assertSource("a is C", AstFactory.isExpression(AstFactory.identifier3("a"), false, AstFactory.typeName4("C")));
+    _assertSource(
+        "a is C",
+        AstFactory.isExpression(
+            AstFactory.identifier3("a"),
+            false,
+            AstFactory.typeName4("C")));
   }
 
   void test_visitLabel() {
@@ -2125,11 +3271,19 @@
   }
 
   void test_visitLabeledStatement_multiple() {
-    _assertSource("a: b: return;", AstFactory.labeledStatement([AstFactory.label2("a"), AstFactory.label2("b")], AstFactory.returnStatement()));
+    _assertSource(
+        "a: b: return;",
+        AstFactory.labeledStatement(
+            [AstFactory.label2("a"), AstFactory.label2("b")],
+            AstFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
-    _assertSource("a: return;", AstFactory.labeledStatement([AstFactory.label2("a")], AstFactory.returnStatement()));
+    _assertSource(
+        "a: return;",
+        AstFactory.labeledStatement(
+            [AstFactory.label2("a")],
+            AstFactory.returnStatement()));
   }
 
   void test_visitLibraryDirective() {
@@ -2138,19 +3292,25 @@
 
   void test_visitLibraryDirective_withMetadata() {
     LibraryDirective directive = AstFactory.libraryDirective2("l");
-    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    directive.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated library l;", directive);
   }
 
   void test_visitLibraryIdentifier_multiple() {
-    _assertSource("a.b.c", AstFactory.libraryIdentifier([
-        AstFactory.identifier3("a"),
-        AstFactory.identifier3("b"),
-        AstFactory.identifier3("c")]));
+    _assertSource(
+        "a.b.c",
+        AstFactory.libraryIdentifier(
+            [
+                AstFactory.identifier3("a"),
+                AstFactory.identifier3("b"),
+                AstFactory.identifier3("c")]));
   }
 
   void test_visitLibraryIdentifier_single() {
-    _assertSource("a", AstFactory.libraryIdentifier([AstFactory.identifier3("a")]));
+    _assertSource(
+        "a",
+        AstFactory.libraryIdentifier([AstFactory.identifier3("a")]));
   }
 
   void test_visitListLiteral_const() {
@@ -2162,10 +3322,13 @@
   }
 
   void test_visitListLiteral_nonEmpty() {
-    _assertSource("[a, b, c]", AstFactory.listLiteral([
-        AstFactory.identifier3("a"),
-        AstFactory.identifier3("b"),
-        AstFactory.identifier3("c")]));
+    _assertSource(
+        "[a, b, c]",
+        AstFactory.listLiteral(
+            [
+                AstFactory.identifier3("a"),
+                AstFactory.identifier3("b"),
+                AstFactory.identifier3("c")]));
   }
 
   void test_visitMapLiteral_const() {
@@ -2177,73 +3340,204 @@
   }
 
   void test_visitMapLiteral_nonEmpty() {
-    _assertSource("{'a' : a, 'b' : b, 'c' : c}", AstFactory.mapLiteral2([
-        AstFactory.mapLiteralEntry("a", AstFactory.identifier3("a")),
-        AstFactory.mapLiteralEntry("b", AstFactory.identifier3("b")),
-        AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))]));
+    _assertSource(
+        "{'a' : a, 'b' : b, 'c' : c}",
+        AstFactory.mapLiteral2(
+            [
+                AstFactory.mapLiteralEntry("a", AstFactory.identifier3("a")),
+                AstFactory.mapLiteralEntry("b", AstFactory.identifier3("b")),
+                AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))]));
   }
 
   void test_visitMapLiteralEntry() {
-    _assertSource("'a' : b", AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
+    _assertSource(
+        "'a' : b",
+        AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
   }
 
   void test_visitMethodDeclaration_external() {
-    _assertSource("external m();", AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList()));
+    _assertSource(
+        "external m();",
+        AstFactory.methodDeclaration(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_external_returnType() {
-    _assertSource("external T m();", AstFactory.methodDeclaration(null, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList()));
+    _assertSource(
+        "external T m();",
+        AstFactory.methodDeclaration(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_getter() {
-    _assertSource("get m {}", AstFactory.methodDeclaration2(null, null, Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "get m {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.GET,
+            null,
+            AstFactory.identifier3("m"),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
-    _assertSource("T get m {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T get m {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            Keyword.GET,
+            null,
+            AstFactory.identifier3("m"),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
-    _assertSource("T set m(var v) {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T set m(var v) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            Keyword.SET,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(
+                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
-    _assertSource("m() {}", AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "m() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
-    _assertSource("m(var a, var b) {}", AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([
-        AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "m(var a, var b) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(
+                [
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
-    _assertSource("operator +() {}", AstFactory.methodDeclaration2(null, null, null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "operator +() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            Keyword.OPERATOR,
+            AstFactory.identifier3("+"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
-    _assertSource("T operator +() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T operator +() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            Keyword.OPERATOR,
+            AstFactory.identifier3("+"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
-    _assertSource("T m() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T m() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
-    _assertSource("set m(var v) {}", AstFactory.methodDeclaration2(null, null, Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "set m(var v) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.SET,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(
+                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
-    _assertSource("static m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "static m() {}",
+        AstFactory.methodDeclaration2(
+            Keyword.STATIC,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
-    _assertSource("static T m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "static T m() {}",
+        AstFactory.methodDeclaration2(
+            Keyword.STATIC,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    MethodDeclaration declaration = AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated m() {}", declaration);
   }
 
@@ -2252,15 +3546,23 @@
   }
 
   void test_visitMethodInvocation_target() {
-    _assertSource("t.m()", AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
+    _assertSource(
+        "t.m()",
+        AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
   }
 
   void test_visitNamedExpression() {
-    _assertSource("a: b", AstFactory.namedExpression2("a", AstFactory.identifier3("b")));
+    _assertSource(
+        "a: b",
+        AstFactory.namedExpression2("a", AstFactory.identifier3("b")));
   }
 
   void test_visitNamedFormalParameter() {
-    _assertSource("var a : 0", AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter(Keyword.VAR, "a"), AstFactory.integer(0)));
+    _assertSource(
+        "var a : 0",
+        AstFactory.namedFormalParameter(
+            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstFactory.integer(0)));
   }
 
   void test_visitNativeClause() {
@@ -2276,7 +3578,9 @@
   }
 
   void test_visitParenthesizedExpression() {
-    _assertSource("(a)", AstFactory.parenthesizedExpression(AstFactory.identifier3("a")));
+    _assertSource(
+        "(a)",
+        AstFactory.parenthesizedExpression(AstFactory.identifier3("a")));
   }
 
   void test_visitPartDirective() {
@@ -2285,26 +3589,37 @@
 
   void test_visitPartDirective_withMetadata() {
     PartDirective directive = AstFactory.partDirective2("a.dart");
-    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    directive.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated part 'a.dart';", directive);
   }
 
   void test_visitPartOfDirective() {
-    _assertSource("part of l;", AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])));
+    _assertSource(
+        "part of l;",
+        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])));
   }
 
   void test_visitPartOfDirective_withMetadata() {
-    PartOfDirective directive = AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
-    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    PartOfDirective directive =
+        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
+    directive.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated part of l;", directive);
   }
 
   void test_visitPositionalFormalParameter() {
-    _assertSource("var a = 0", AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter(Keyword.VAR, "a"), AstFactory.integer(0)));
+    _assertSource(
+        "var a = 0",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstFactory.integer(0)));
   }
 
   void test_visitPostfixExpression() {
-    _assertSource("a++", AstFactory.postfixExpression(AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
+    _assertSource(
+        "a++",
+        AstFactory.postfixExpression(AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
   }
 
   void test_visitPrefixedIdentifier() {
@@ -2312,15 +3627,21 @@
   }
 
   void test_visitPrefixExpression() {
-    _assertSource("-a", AstFactory.prefixExpression(TokenType.MINUS, AstFactory.identifier3("a")));
+    _assertSource(
+        "-a",
+        AstFactory.prefixExpression(TokenType.MINUS, AstFactory.identifier3("a")));
   }
 
   void test_visitPropertyAccess() {
-    _assertSource("a.b", AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b"));
+    _assertSource(
+        "a.b",
+        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b"));
   }
 
   void test_visitRedirectingConstructorInvocation_named() {
-    _assertSource("this.c()", AstFactory.redirectingConstructorInvocation2("c"));
+    _assertSource(
+        "this.c()",
+        AstFactory.redirectingConstructorInvocation2("c"));
   }
 
   void test_visitRedirectingConstructorInvocation_unnamed() {
@@ -2332,7 +3653,9 @@
   }
 
   void test_visitReturnStatement_expression() {
-    _assertSource("return a;", AstFactory.returnStatement2(AstFactory.identifier3("a")));
+    _assertSource(
+        "return a;",
+        AstFactory.returnStatement2(AstFactory.identifier3("a")));
   }
 
   void test_visitReturnStatement_noExpression() {
@@ -2349,11 +3672,18 @@
   }
 
   void test_visitSimpleFormalParameter_keyword_type() {
-    _assertSource("final A a", AstFactory.simpleFormalParameter2(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "final A a",
+        AstFactory.simpleFormalParameter2(
+            Keyword.FINAL,
+            AstFactory.typeName4("A"),
+            "a"));
   }
 
   void test_visitSimpleFormalParameter_type() {
-    _assertSource("A a", AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "A a",
+        AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleIdentifier() {
@@ -2365,10 +3695,13 @@
   }
 
   void test_visitStringInterpolation() {
-    _assertSource("'a\${e}b'", AstFactory.string([
-        AstFactory.interpolationString("'a", "a"),
-        AstFactory.interpolationExpression(AstFactory.identifier3("e")),
-        AstFactory.interpolationString("b'", "b")]));
+    _assertSource(
+        "'a\${e}b'",
+        AstFactory.string(
+            [
+                AstFactory.interpolationString("'a", "a"),
+                AstFactory.interpolationExpression(AstFactory.identifier3("e")),
+                AstFactory.interpolationString("b'", "b")]));
   }
 
   void test_visitSuperConstructorInvocation() {
@@ -2384,41 +3717,71 @@
   }
 
   void test_visitSwitchCase_multipleLabels() {
-    _assertSource("l1: l2: case a: {}", AstFactory.switchCase2([AstFactory.label2("l1"), AstFactory.label2("l2")], AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertSource(
+        "l1: l2: case a: {}",
+        AstFactory.switchCase2(
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
+            AstFactory.identifier3("a"),
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
-    _assertSource("case a: {} {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block(), AstFactory.block()]));
+    _assertSource(
+        "case a: {} {}",
+        AstFactory.switchCase(
+            AstFactory.identifier3("a"),
+            [AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchCase_noLabels() {
-    _assertSource("case a: {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertSource(
+        "case a: {}",
+        AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_singleLabel() {
-    _assertSource("l1: case a: {}", AstFactory.switchCase2([AstFactory.label2("l1")], AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertSource(
+        "l1: case a: {}",
+        AstFactory.switchCase2(
+            [AstFactory.label2("l1")],
+            AstFactory.identifier3("a"),
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleLabels() {
-    _assertSource("l1: l2: default: {}", AstFactory.switchDefault([AstFactory.label2("l1"), AstFactory.label2("l2")], [AstFactory.block()]));
+    _assertSource(
+        "l1: l2: default: {}",
+        AstFactory.switchDefault(
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
-    _assertSource("default: {} {}", AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
+    _assertSource(
+        "default: {} {}",
+        AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_noLabels() {
-    _assertSource("default: {}", AstFactory.switchDefault2([AstFactory.block()]));
+    _assertSource(
+        "default: {}",
+        AstFactory.switchDefault2([AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_singleLabel() {
-    _assertSource("l1: default: {}", AstFactory.switchDefault([AstFactory.label2("l1")], [AstFactory.block()]));
+    _assertSource(
+        "l1: default: {}",
+        AstFactory.switchDefault([AstFactory.label2("l1")], [AstFactory.block()]));
   }
 
   void test_visitSwitchStatement() {
-    _assertSource("switch (a) {case 'b': {} default: {}}", AstFactory.switchStatement(AstFactory.identifier3("a"), [
-        AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
-        AstFactory.switchDefault2([AstFactory.block()])]));
+    _assertSource(
+        "switch (a) {case 'b': {} default: {}}",
+        AstFactory.switchStatement(
+            AstFactory.identifier3("a"),
+            [
+                AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
+                AstFactory.switchDefault2([AstFactory.block()])]));
   }
 
   void test_visitSymbolLiteral_multiple() {
@@ -2434,55 +3797,87 @@
   }
 
   void test_visitThrowStatement() {
-    _assertSource("throw e", AstFactory.throwExpression2(AstFactory.identifier3("e")));
+    _assertSource(
+        "throw e",
+        AstFactory.throwExpression2(AstFactory.identifier3("e")));
   }
 
   void test_visitTopLevelVariableDeclaration_multiple() {
-    _assertSource("var a;", AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "var a;",
+        AstFactory.topLevelVariableDeclaration2(
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitTopLevelVariableDeclaration_single() {
-    _assertSource("var a, b;", AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]));
+    _assertSource(
+        "var a, b;",
+        AstFactory.topLevelVariableDeclaration2(
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
   void test_visitTryStatement_catch() {
-    _assertSource("try {} on E {}", AstFactory.tryStatement2(AstFactory.block(), [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
+    _assertSource(
+        "try {} on E {}",
+        AstFactory.tryStatement2(
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
   }
 
   void test_visitTryStatement_catches() {
-    _assertSource("try {} on E {} on F {}", AstFactory.tryStatement2(AstFactory.block(), [
-        AstFactory.catchClause3(AstFactory.typeName4("E")),
-        AstFactory.catchClause3(AstFactory.typeName4("F"))]));
+    _assertSource(
+        "try {} on E {} on F {}",
+        AstFactory.tryStatement2(
+            AstFactory.block(),
+            [
+                AstFactory.catchClause3(AstFactory.typeName4("E")),
+                AstFactory.catchClause3(AstFactory.typeName4("F"))]));
   }
 
   void test_visitTryStatement_catchFinally() {
-    _assertSource("try {} on E {} finally {}", AstFactory.tryStatement3(AstFactory.block(), [AstFactory.catchClause3(AstFactory.typeName4("E"))], AstFactory.block()));
+    _assertSource(
+        "try {} on E {} finally {}",
+        AstFactory.tryStatement3(
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
+            AstFactory.block()));
   }
 
   void test_visitTryStatement_finally() {
-    _assertSource("try {} finally {}", AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
+    _assertSource(
+        "try {} finally {}",
+        AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
   }
 
   void test_visitTypeArgumentList_multiple() {
-    _assertSource("<E, F>", AstFactory.typeArgumentList([
-        AstFactory.typeName4("E"),
-        AstFactory.typeName4("F")]));
+    _assertSource(
+        "<E, F>",
+        AstFactory.typeArgumentList(
+            [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
   }
 
   void test_visitTypeArgumentList_single() {
-    _assertSource("<E>", AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
+    _assertSource(
+        "<E>",
+        AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_multipleArgs() {
-    _assertSource("C<D, E>", AstFactory.typeName4("C", [
-        AstFactory.typeName4("D"),
-        AstFactory.typeName4("E")]));
+    _assertSource(
+        "C<D, E>",
+        AstFactory.typeName4(
+            "C",
+            [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_nestedArg() {
-    _assertSource("C<D<E>>", AstFactory.typeName4("C", [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
+    _assertSource(
+        "C<D<E>>",
+        AstFactory.typeName4(
+            "C",
+            [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
   }
 
   void test_visitTypeName_noArgs() {
@@ -2490,16 +3885,21 @@
   }
 
   void test_visitTypeName_singleArg() {
-    _assertSource("C<D>", AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
+    _assertSource(
+        "C<D>",
+        AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
   }
 
   void test_visitTypeParameter_withExtends() {
-    _assertSource("E extends C", AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
+    _assertSource(
+        "E extends C",
+        AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
   }
 
   void test_visitTypeParameter_withMetadata() {
     TypeParameter parameter = AstFactory.typeParameter("E");
-    parameter.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    parameter.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated E", parameter);
   }
 
@@ -2516,7 +3916,9 @@
   }
 
   void test_visitVariableDeclaration_initialized() {
-    _assertSource("a = b", AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
   }
 
   void test_visitVariableDeclaration_uninitialized() {
@@ -2525,55 +3927,78 @@
 
   void test_visitVariableDeclaration_withMetadata() {
     VariableDeclaration declaration = AstFactory.variableDeclaration("a");
-    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated a", declaration);
   }
 
   void test_visitVariableDeclarationList_const_type() {
-    _assertSource("const C a, b", AstFactory.variableDeclarationList(Keyword.CONST, AstFactory.typeName4("C"), [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]));
+    _assertSource(
+        "const C a, b",
+        AstFactory.variableDeclarationList(
+            Keyword.CONST,
+            AstFactory.typeName4("C"),
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
   void test_visitVariableDeclarationList_final_noType() {
-    _assertSource("final a, b", AstFactory.variableDeclarationList2(Keyword.FINAL, [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]));
+    _assertSource(
+        "final a, b",
+        AstFactory.variableDeclarationList2(
+            Keyword.FINAL,
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
   void test_visitVariableDeclarationList_final_withMetadata() {
-    VariableDeclarationList declarationList = AstFactory.variableDeclarationList2(Keyword.FINAL, [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]);
-    declarationList.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    VariableDeclarationList declarationList =
+        AstFactory.variableDeclarationList2(
+            Keyword.FINAL,
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]);
+    declarationList.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated final a, b", declarationList);
   }
 
   void test_visitVariableDeclarationList_type() {
-    _assertSource("C a, b", AstFactory.variableDeclarationList(null, AstFactory.typeName4("C"), [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]));
+    _assertSource(
+        "C a, b",
+        AstFactory.variableDeclarationList(
+            null,
+            AstFactory.typeName4("C"),
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
   void test_visitVariableDeclarationList_var() {
-    _assertSource("var a, b", AstFactory.variableDeclarationList2(Keyword.VAR, [
-        AstFactory.variableDeclaration("a"),
-        AstFactory.variableDeclaration("b")]));
+    _assertSource(
+        "var a, b",
+        AstFactory.variableDeclarationList2(
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
   void test_visitVariableDeclarationStatement() {
-    _assertSource("C c;", AstFactory.variableDeclarationStatement(null, AstFactory.typeName4("C"), [AstFactory.variableDeclaration("c")]));
+    _assertSource(
+        "C c;",
+        AstFactory.variableDeclarationStatement(
+            null,
+            AstFactory.typeName4("C"),
+            [AstFactory.variableDeclaration("c")]));
   }
 
   void test_visitWhileStatement() {
-    _assertSource("while (c) {}", AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block()));
+    _assertSource(
+        "while (c) {}",
+        AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitWithClause_multiple() {
-    _assertSource("with A, B, C", AstFactory.withClause([
-        AstFactory.typeName4("A"),
-        AstFactory.typeName4("B"),
-        AstFactory.typeName4("C")]));
+    _assertSource(
+        "with A, B, C",
+        AstFactory.withClause(
+            [
+                AstFactory.typeName4("A"),
+                AstFactory.typeName4("B"),
+                AstFactory.typeName4("C")]));
   }
 
   void test_visitWithClause_single() {
@@ -2581,11 +4006,15 @@
   }
 
   void test_visitYieldStatement() {
-    _assertSource("yield e;", AstFactory.yieldStatement(AstFactory.identifier3("e")));
+    _assertSource(
+        "yield e;",
+        AstFactory.yieldStatement(AstFactory.identifier3("e")));
   }
 
   void test_visitYieldStatement_each() {
-    _assertSource("yield* e;", AstFactory.yieldEachStatement(AstFactory.identifier3("e")));
+    _assertSource(
+        "yield* e;",
+        AstFactory.yieldEachStatement(AstFactory.identifier3("e")));
   }
 
   /**
@@ -2606,7 +4035,8 @@
 class VariableDeclarationTest extends ParserTestCase {
   void test_getDocumentationComment_onGrandParent() {
     VariableDeclaration varDecl = AstFactory.variableDeclaration("a");
-    TopLevelVariableDeclaration decl = AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [varDecl]);
+    TopLevelVariableDeclaration decl =
+        AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [varDecl]);
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     expect(varDecl.documentationComment, isNull);
     decl.documentationComment = comment;
@@ -2623,13 +4053,17 @@
 }
 
 class WrapperKind extends Enum<WrapperKind> {
-  static const WrapperKind PREFIXED_LEFT = const WrapperKind('PREFIXED_LEFT', 0);
+  static const WrapperKind PREFIXED_LEFT =
+      const WrapperKind('PREFIXED_LEFT', 0);
 
-  static const WrapperKind PREFIXED_RIGHT = const WrapperKind('PREFIXED_RIGHT', 1);
+  static const WrapperKind PREFIXED_RIGHT =
+      const WrapperKind('PREFIXED_RIGHT', 1);
 
-  static const WrapperKind PROPERTY_LEFT = const WrapperKind('PROPERTY_LEFT', 2);
+  static const WrapperKind PROPERTY_LEFT =
+      const WrapperKind('PROPERTY_LEFT', 2);
 
-  static const WrapperKind PROPERTY_RIGHT = const WrapperKind('PROPERTY_RIGHT', 3);
+  static const WrapperKind PROPERTY_RIGHT =
+      const WrapperKind('PROPERTY_RIGHT', 3);
 
   static const WrapperKind NONE = const WrapperKind('NONE', 4);
 
@@ -2642,19 +4076,3 @@
 
   const WrapperKind(String name, int ordinal) : super(name, ordinal);
 }
-
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(ConstantEvaluatorTest);
-  runReflectiveTests(NodeLocatorTest);
-  runReflectiveTests(ToSourceVisitorTest);
-  runReflectiveTests(BreadthFirstVisitorTest);
-  runReflectiveTests(ClassDeclarationTest);
-  runReflectiveTests(ClassTypeAliasTest);
-  runReflectiveTests(IndexExpressionTest);
-  runReflectiveTests(NodeListTest);
-  runReflectiveTests(SimpleIdentifierTest);
-  runReflectiveTests(SimpleStringLiteralTest);
-  runReflectiveTests(StringInterpolationTest);
-  runReflectiveTests(VariableDeclarationTest);
-}
\ No newline at end of file
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 0ad4ace8..353a98a 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -4,21 +4,28 @@
 
 library engine.compile_time_error_code_test;
 
-import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
-import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source_io.dart';
 import 'package:unittest/unittest.dart' as _ut;
-import 'resolver_test.dart';
-import '../reflective_tests.dart';
 
+import '../reflective_tests.dart';
+import 'resolver_test.dart';
+
+
+main() {
+  _ut.groupSep = ' | ';
+  runReflectiveTests(CompileTimeErrorCodeTest);
+}
 
 class CompileTimeErrorCodeTest extends ResolverTestCase {
   void fail_compileTimeConstantRaisesException() {
     Source source = addSource(r'''
 ''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]);
     verify([source]);
   }
 
@@ -29,7 +36,9 @@
 }
 f() { return const C(); }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION]);
     verify([source]);
   }
 
@@ -100,7 +109,9 @@
     Source source = addSource(r'''
 ''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS]);
     verify([source]);
   }
 
@@ -111,7 +122,9 @@
   final m = const A();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
     verify([source]);
   }
 
@@ -120,7 +133,9 @@
 const x = y + 1;
 const y = x + 1;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
     verify([source]);
   }
 
@@ -133,7 +148,8 @@
   }
 
   void fail_yieldEachInNonGenerator_async() {
-    // TODO(brianwilkerson) We are currently parsing the yield statement as a binary expression.
+    // TODO(brianwilkerson) We are currently parsing the yield statement as a
+    // binary expression.
     resetWithAsync();
     Source source = addSource(r'''
 f() async {
@@ -145,7 +161,8 @@
   }
 
   void fail_yieldEachInNonGenerator_sync() {
-    // TODO(brianwilkerson) We are currently parsing the yield statement as a binary expression.
+    // TODO(brianwilkerson) We are currently parsing the yield statement as a
+    // binary expression.
     resetWithAsync();
     Source source = addSource(r'''
 f() {
@@ -157,7 +174,8 @@
   }
 
   void fail_yieldInNonGenerator_async() {
-    // TODO(brianwilkerson) We are currently trying to parse the yield statement as a binary expression.
+    // TODO(brianwilkerson) We are currently trying to parse the yield statement
+    // as a binary expression.
     resetWithAsync();
     Source source = addSource(r'''
 f() async {
@@ -169,7 +187,8 @@
   }
 
   void fail_yieldInNonGenerator_sync() {
-    // TODO(brianwilkerson) We are currently trying to parse the yield statement as a binary expression.
+    // TODO(brianwilkerson) We are currently trying to parse the yield statement
+    // as a binary expression.
     resetWithAsync();
     Source source = addSource(r'''
 f() {
@@ -181,9 +200,7 @@
   }
 
   void test_accessPrivateEnumField() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 String name(E e) {
@@ -249,7 +266,9 @@
 class B {}
 class as = A with B;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
     verify([source]);
   }
 
@@ -286,21 +305,27 @@
   void test_builtInIdentifierAsTypedefName_functionTypeAlias() {
     Source source = addSource("typedef bool as();");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
     verify([source]);
   }
 
   void test_builtInIdentifierAsTypeName() {
     Source source = addSource("class as {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]);
     verify([source]);
   }
 
   void test_builtInIdentifierAsTypeParameterName() {
     Source source = addSource("class A<as> {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME]);
     verify([source]);
   }
 
@@ -322,7 +347,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
 
@@ -333,7 +360,9 @@
   A.x() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]);
     verify([source]);
   }
 
@@ -344,7 +373,9 @@
   void x() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD]);
     verify([source]);
   }
 
@@ -405,7 +436,9 @@
 class T<T> {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS]);
     verify([source]);
   }
 
@@ -415,7 +448,9 @@
   var T;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
     verify([source]);
   }
 
@@ -425,7 +460,9 @@
   get T => null;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
     verify([source]);
   }
 
@@ -435,7 +472,9 @@
   T() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
     verify([source]);
   }
 
@@ -445,7 +484,9 @@
   static T() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
     verify([source]);
   }
 
@@ -455,7 +496,9 @@
   set T(x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
     verify([source]);
   }
 
@@ -494,7 +537,9 @@
   return 3;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST]);
     verify([source]);
   }
 
@@ -533,7 +578,9 @@
   const B(): super();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
     verify([source]);
   }
 
@@ -546,7 +593,9 @@
   const B();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
     verify([source]);
   }
 
@@ -559,9 +608,11 @@
   const B();
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN,
-        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN,
+            CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
     verify([source]);
   }
 
@@ -574,9 +625,11 @@
   const B();
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
-        CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
+            CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
     verify([source]);
   }
 
@@ -587,38 +640,40 @@
   const A();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
     verify([source]);
   }
 
   void test_constDeferredClass() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
 class A {
   const A();
-}''',
-        r'''
+}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 main() {
   const a.A();
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
   }
 
   void test_constDeferredClass_namedConstructor() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
 class A {
   const A.b();
-}''',
-        r'''
+}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 main() {
   const a.A.b();
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
   }
 
   void test_constEval_newInstance_constConstructor() {
@@ -628,7 +683,9 @@
 }
 const a = new A();''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
 
@@ -654,7 +711,9 @@
 final a = const A();
 const C = a.m;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
 
@@ -704,10 +763,12 @@
   void test_constEvalTypeBool_binary_leftTrue() {
     Source source = addSource("const C = (true || 0);");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-        StaticTypeWarningCode.NON_BOOL_OPERAND,
-        HintCode.DEAD_CODE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+            StaticTypeWarningCode.NON_BOOL_OPERAND,
+            HintCode.DEAD_CODE]);
     verify([source]);
   }
 
@@ -721,7 +782,9 @@
   const B(num p) : a = p == const A();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
     verify([source]);
   }
 
@@ -735,7 +798,9 @@
   const B(String p) : a = p != const A();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
     verify([source]);
   }
 
@@ -784,44 +849,52 @@
   const C = p;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
 
   void test_constInitializedWithNonConstValue_missingConstInListLiteral() {
     Source source = addSource("const List L = [0];");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
 
   void test_constInitializedWithNonConstValue_missingConstInMapLiteral() {
     Source source = addSource("const Map M = {'a' : 0};");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
     verify([source]);
   }
 
   void test_constInitializedWithNonConstValueFromDeferredClass() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const V = 1;''',
-        r'''
+const V = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-const B = a.V;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
+const B = a.V;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_constInitializedWithNonConstValueFromDeferredClass_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const V = 1;''',
-        r'''
+const V = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-const B = a.V + 1;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
+const B = a.V + 1;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_constInstanceField() {
@@ -844,7 +917,9 @@
   const {const A() : 0};
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
 
@@ -864,7 +939,9 @@
   const {B.a : 0};
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
 
@@ -882,7 +959,9 @@
   var m = const { const A(): 42 };
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
 
@@ -899,7 +978,9 @@
   const {const B() : 0};
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
     verify([source]);
   }
 
@@ -910,7 +991,9 @@
 }
 f() { return const A<A>(); }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
 
@@ -924,7 +1007,9 @@
   return const C<A>();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
 
@@ -938,7 +1023,9 @@
   return const C<A, A>();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
     verify([source]);
   }
 
@@ -963,7 +1050,9 @@
 main() {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
     verify([source]);
   }
 
@@ -974,7 +1063,9 @@
 }
 f(p) { return const A(p); }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
     verify([source]);
   }
 
@@ -1009,9 +1100,11 @@
   const A();
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
-        StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+            StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -1022,9 +1115,11 @@
   const A();
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
-        StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+            StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -1037,7 +1132,9 @@
   return const A.noSuchConstructor();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
     // no verify(), 'noSuchConstructor' is not resolved
   }
 
@@ -1050,28 +1147,36 @@
   return const A();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
     verify([source]);
   }
 
   void test_defaultValueInFunctionTypeAlias() {
     Source source = addSource("typedef F([x = 0]);");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
     verify([source]);
   }
 
   void test_defaultValueInFunctionTypedParameter_named() {
     Source source = addSource("f(g({p: null})) {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
     verify([source]);
   }
 
   void test_defaultValueInFunctionTypedParameter_optional() {
     Source source = addSource("f(g([p = null])) {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
     verify([source]);
   }
 
@@ -1085,7 +1190,9 @@
   B([int x = 1]) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1096,9 +1203,11 @@
   A.a() {}
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
-        CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
+            CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME]);
     verify([source]);
   }
 
@@ -1109,9 +1218,11 @@
   A() {}
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT,
-        CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT,
+            CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT]);
     verify([source]);
   }
 
@@ -1200,11 +1311,14 @@
   static int get x => 0;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
-  void test_duplicateDefinitionInheritance_instanceGetterAbstract_staticGetter() {
+  void
+      test_duplicateDefinitionInheritance_instanceGetterAbstract_staticGetter() {
     Source source = addSource(r'''
 abstract class A {
   int get x;
@@ -1213,7 +1327,9 @@
   static int get x => 0;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
@@ -1226,11 +1342,14 @@
   static x() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
-  void test_duplicateDefinitionInheritance_instanceMethodAbstract_staticMethod() {
+  void
+      test_duplicateDefinitionInheritance_instanceMethodAbstract_staticMethod() {
     Source source = addSource(r'''
 abstract class A {
   x();
@@ -1239,7 +1358,9 @@
   static x() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
@@ -1252,11 +1373,14 @@
   static set x(value) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
-  void test_duplicateDefinitionInheritance_instanceSetterAbstract_staticSetter() {
+  void
+      test_duplicateDefinitionInheritance_instanceSetterAbstract_staticSetter() {
     Source source = addSource(r'''
 abstract class A {
   set x(value);
@@ -1265,7 +1389,9 @@
   static set x(value) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE]);
     verify([source]);
   }
 
@@ -1298,79 +1424,91 @@
   }
 
   void test_extendsDeferredClass() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-class B extends a.A {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
+class B extends a.A {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
   }
 
   void test_extendsDeferredClass_classTypeAlias() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class M {}
-class C = a.A with M;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
+class C = a.A with M;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
   }
 
   void test_extendsDisallowedClass_class_bool() {
     Source source = addSource("class A extends bool {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
   void test_extendsDisallowedClass_class_double() {
     Source source = addSource("class A extends double {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
   void test_extendsDisallowedClass_class_int() {
     Source source = addSource("class A extends int {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
   void test_extendsDisallowedClass_class_Null() {
     Source source = addSource("class A extends Null {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
   void test_extendsDisallowedClass_class_num() {
     Source source = addSource("class A extends num {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
   void test_extendsDisallowedClass_class_String() {
     Source source = addSource("class A extends String {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -1379,8 +1517,11 @@
 class M {}
 class C = bool with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -1398,8 +1539,11 @@
 class M {}
 class C = int with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -1426,15 +1570,16 @@
 class M {}
 class C = String with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
   void test_extendsEnum() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 class A extends E {}''');
@@ -1492,7 +1637,9 @@
   A() : x = 0, x = 1 {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
     verify([source]);
   }
 
@@ -1503,9 +1650,11 @@
   A() : x = 0, x = 1, x = 2 {}
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-        CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+            CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
     verify([source]);
   }
 
@@ -1517,9 +1666,11 @@
   A() : x = 0, x = 1, y = 0, y = 1 {}
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-        CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+            CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
     verify([source]);
   }
 
@@ -1530,7 +1681,9 @@
   A(this.x) : x = 1 {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
     verify([source]);
   }
 
@@ -1541,7 +1694,9 @@
   factory A(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1553,9 +1708,11 @@
   m(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [
-        ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-        CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [
+            ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+            CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1566,7 +1723,9 @@
   m([this.x]) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1578,7 +1737,9 @@
   A() : this.named(), x = 42;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1590,7 +1751,9 @@
   A() : x = 42, this.named();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1602,7 +1765,9 @@
   A(this.x) : this.named();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1613,7 +1778,9 @@
   A() : x = 0, x = 0 {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
     verify([source]);
   }
 
@@ -1632,7 +1799,9 @@
   A(this.x) : x = 0 {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
     verify([source]);
   }
 
@@ -1643,7 +1812,9 @@
   A(this.x, this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES]);
     verify([source]);
   }
 
@@ -1679,23 +1850,28 @@
 var b1 = const bool.fromEnvironment(1);
 var b2 = const bool.fromEnvironment('x', defaultValue: 1);''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+            CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
   void test_fromEnvironment_bool_badDefault_whenDefined() {
-    // The type of the defaultValue needs to be correct even when the default value
-    // isn't used (because the variable is defined in the environment).
+    // The type of the defaultValue needs to be correct even when the default
+    // value isn't used (because the variable is defined in the environment).
     analysisContext2.declaredVariables.define("x", "true");
-    Source source = addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);");
+    Source source =
+        addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -1706,32 +1882,34 @@
   get x => 0;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME]);
     verify([source]);
   }
 
   void test_implementsDeferredClass() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-class B implements a.A {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
+class B implements a.A {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
   }
 
   void test_implementsDeferredClass_classTypeAlias() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class B {}
 class M {}
-class C = B with M implements a.A;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
+class C = B with M implements a.A;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
   }
 
   void test_implementsDisallowedClass_class_bool() {
@@ -1779,9 +1957,11 @@
   void test_implementsDisallowedClass_class_String_num() {
     Source source = addSource("class A implements String, num {}");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
 
@@ -1851,9 +2031,11 @@
 class M {}
 class C = A with M implements String, num;''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+            CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
     verify([source]);
   }
 
@@ -1865,9 +2047,7 @@
   }
 
   void test_implementsEnum() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 class A implements E {}''');
@@ -1910,10 +2090,12 @@
 class A {} class C{}
 class B implements A, A, A, A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_REPEATED,
-        CompileTimeErrorCode.IMPLEMENTS_REPEATED,
-        CompileTimeErrorCode.IMPLEMENTS_REPEATED]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.IMPLEMENTS_REPEATED,
+            CompileTimeErrorCode.IMPLEMENTS_REPEATED,
+            CompileTimeErrorCode.IMPLEMENTS_REPEATED]);
     verify([source]);
   }
 
@@ -1941,7 +2123,9 @@
   var f;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -1952,7 +2136,9 @@
   final y = x;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -1964,7 +2150,9 @@
   f() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -1975,11 +2163,14 @@
   m() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
-  void test_implicitThisReferenceInInitializer_redirectingConstructorInvocation() {
+  void
+      test_implicitThisReferenceInInitializer_redirectingConstructorInvocation() {
     Source source = addSource(r'''
 class A {
   A(p) {}
@@ -1987,7 +2178,9 @@
   var f;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -2001,33 +2194,37 @@
   var f;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
   void test_importInternalLibrary() {
     Source source = addSource("import 'dart:_interceptors';");
     resolve(source);
-    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while we could prevent
-    // the hint from being generated by testing the import directive for the error, this is such a
-    // minor corner case that we don't think we should add the additional computation time to figure
-    // out such cases.
-    assertErrors(source, [
-        CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
-        HintCode.UNUSED_IMPORT]);
+    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while
+    // we could prevent the hint from being generated by testing the import
+    // directive for the error, this is such a minor corner case that we don't
+    // think we should add the additional computation time to figure out such
+    // cases.
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
   void test_importInternalLibrary_js_helper() {
     Source source = addSource("import 'dart:_js_helper';");
     resolve(source);
-    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while we could prevent
-    // the hint from being generated by testing the import directive for the error, this is such a
-    // minor corner case that we don't think we should add the additional computation time to figure
-    // out such cases.
-    assertErrors(source, [
-        CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
-        HintCode.UNUSED_IMPORT]);
+    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while
+    // we could prevent the hint from being generated by testing the import
+    // directive for the error, this is such a minor corner case that we don't
+    // think we should add the additional computation time to figure out such
+    // cases.
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
@@ -2055,7 +2252,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
     verify([source]);
   }
 
@@ -2080,9 +2279,11 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
-        CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+            CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
     verify([source]);
   }
 
@@ -2099,9 +2300,11 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
-        CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+            CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
     verify([source]);
   }
 
@@ -2114,7 +2317,9 @@
 }
 A a = const A();''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
   }
 
   void test_initializerForNonExistent_initializer() {
@@ -2123,7 +2328,9 @@
   A() : x = 0 {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
   }
 
   void test_initializerForStaticField() {
@@ -2143,7 +2350,9 @@
   A(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
     verify([source]);
   }
 
@@ -2156,7 +2365,9 @@
   B(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
     verify([source]);
   }
 
@@ -2166,7 +2377,9 @@
   A([this.x]) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
     verify([source]);
   }
 
@@ -2177,7 +2390,9 @@
   A(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
     verify([source]);
   }
 
@@ -2188,7 +2403,9 @@
   A([this.x]) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD]);
     verify([source]);
   }
 
@@ -2203,7 +2420,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
     verify([source]);
   }
 
@@ -2218,7 +2437,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
     verify([source]);
   }
 
@@ -2231,7 +2452,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
     verify([source]);
   }
 
@@ -2244,7 +2467,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
     verify([source]);
   }
 
@@ -2257,14 +2482,14 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
     verify([source]);
   }
 
   void test_instantiateEnum_const() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 E e(String name) {
@@ -2276,9 +2501,7 @@
   }
 
   void test_instantiateEnum_new() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 E e(String name) {
@@ -2328,7 +2551,8 @@
     verify([source]);
   }
 
-  void test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() {
+  void
+      test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() {
     addNamedSource("/lib.dart", r'''
 library lib;
 typedef V();''');
@@ -2417,39 +2641,39 @@
 
   void test_invalidAnnotationFromDeferredLibrary() {
     // See test_invalidAnnotation_notConstantVariable
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
 class V { const V(); }
-const v = const V();''',
-        r'''
+const v = const V();''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-@a.v main () {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
+@a.v main () {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_invalidAnnotationFromDeferredLibrary_constructor() {
     // See test_invalidAnnotation_notConstantVariable
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class C { const C(); }''',
-        r'''
+class C { const C(); }''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-@a.C() main () {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
+@a.C() main () {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_invalidAnnotationFromDeferredLibrary_namedConstructor() {
     // See test_invalidAnnotation_notConstantVariable
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class C { const C.name(); }''',
-        r'''
+class C { const C.name(); }''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-@a.C.name() main () {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
+@a.C.name() main () {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_invalidConstructorName_notEnclosingClassName_defined() {
@@ -2480,7 +2704,9 @@
   factory B() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
     verify([source]);
   }
 
@@ -2490,7 +2716,9 @@
   factory B() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
     // no verify() call, "B" is not resolved
   }
 
@@ -2501,7 +2729,9 @@
   A() async {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -2512,7 +2742,9 @@
   A() async* {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -2523,7 +2755,9 @@
   A() sync* {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -2670,7 +2904,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
     verify([source]);
   }
 
@@ -2682,7 +2918,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
     verify([source]);
   }
 
@@ -2716,7 +2954,9 @@
     const <Foo<String>>[]); // (1)
 ''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -2737,7 +2977,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -2822,14 +3064,14 @@
   x(y) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME]);
     verify([source]);
   }
 
   void test_missingEnumConstantInSwitch() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE, TWO, THREE, FOUR }
 bool odd(E e) {
@@ -2840,9 +3082,11 @@
   return false;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
-        CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
+            CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH]);
     verify([source]);
   }
 
@@ -2869,26 +3113,26 @@
   }
 
   void test_mixinDeferredClass() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-class B extends Object with a.A {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
+class B extends Object with a.A {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
   }
 
   void test_mixinDeferredClass_classTypeAlias() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class B {}
-class C = B with a.A;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
+class C = B with a.A;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
   }
 
   void test_mixinHasNoConstructors_mixinApp() {
@@ -2912,8 +3156,69 @@
 class M {}
 class C extends B with M {}
 ''');
+    // Note: the implicit call from C's default constructor to B() should not
+    // generate a further error (despite the fact that it's not forwarded),
+    // since CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS does a better job
+    // of explaining the probem to the user.
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    verify([source]);
+  }
+
+  void test_mixinHasNoConstructors_mixinClass_explicitSuperCall() {
+    Source source = addSource(r'''
+class B {
+  B({x});
+}
+class M {}
+class C extends B with M {
+  C() : super();
+}
+''');
+    // Note: the explicit call from C() to B() should not generate a further
+    // error (despite the fact that it's not forwarded), since
+    // CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS does a better job of
+    // explaining the error to the user.
+    resolve(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    verify([source]);
+  }
+
+  void test_mixinHasNoConstructors_mixinClass_implicitSuperCall() {
+    Source source = addSource(r'''
+class B {
+  B({x});
+}
+class M {}
+class C extends B with M {
+  C();
+}
+''');
+    // Note: the implicit call from C() to B() should not generate a further
+    // error (despite the fact that it's not forwarded), since
+    // CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS does a better job of
+    // explaining the error to the user.
+    resolve(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    verify([source]);
+  }
+
+  void test_mixinHasNoConstructors_mixinClass_namedSuperCall() {
+    Source source = addSource(r'''
+class B {
+  B.named({x});
+}
+class M {}
+class C extends B with M {
+  C() : super.named();
+}
+''');
+    // Note: the explicit call from C() to B.named() should not generate a
+    // further error (despite the fact that it's not forwarded), since
+    // CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS does a better job of
+    // explaining the error to the user.
+    resolve(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -3058,16 +3363,16 @@
 class A {}
 class C = A with String, num;''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
+            CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
     verify([source]);
   }
 
   void test_mixinOfEnum() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { ONE }
 class A extends Object with E {}''');
@@ -3112,7 +3417,9 @@
 class B {}
 class C extends A with B {}''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
     verify([source]);
   }
 
@@ -3122,7 +3429,9 @@
 class B {}
 class C = A with B;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
     verify([source]);
   }
 
@@ -3134,7 +3443,9 @@
   A.b() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS]);
     verify([source]);
   }
 
@@ -3150,8 +3461,9 @@
   }
 
   void test_nativeClauseInNonSDKCode() {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser error code is generated
-    // through the ErrorVerifier, it is not a CompileTimeErrorCode.
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
     Source source = addSource("class A native 'string' {}");
     resolve(source);
     assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
@@ -3159,23 +3471,29 @@
   }
 
   void test_nativeFunctionBodyInNonSDKCode_function() {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser error code is generated
-    // through the ErrorVerifier, it is not a CompileTimeErrorCode.
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
     Source source = addSource("int m(a) native 'string';");
     resolve(source);
-    assertErrors(source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    assertErrors(
+        source,
+        [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
     verify([source]);
   }
 
   void test_nativeFunctionBodyInNonSDKCode_method() {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser error code is generated
-    // through the ErrorVerifier, it is not a CompileTimeErrorCode.
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
     Source source = addSource(r'''
 class A{
   static int m(a) native 'string';
 }''');
     resolve(source);
-    assertErrors(source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    assertErrors(
+        source,
+        [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
     verify([source]);
   }
 
@@ -3188,7 +3506,9 @@
 main() {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS]);
     verify([source]);
   }
 
@@ -3201,7 +3521,9 @@
   B() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
     verify([source]);
   }
 
@@ -3218,8 +3540,28 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinAppWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
     verify([source]);
   }
 
@@ -3236,29 +3578,12 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
     // Don't verify since call to super.named() can't be resolved.
   }
 
-  void test_noDefaultSuperConstructorExplicit_mixinAppWithNamedParam() {
-    Source source = addSource(r'''
-class M {}
-class B {
-  B({x});
-  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
-}
-class Mixed = B with M;
-class C extends Mixed {
-  C();
-}
-''');
-    resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
-    verify([source]);
-  }
-
   void test_noDefaultSuperConstructorExplicit_mixinAppWithOptionalParam() {
     Source source = addSource(r'''
 class M {}
@@ -3272,8 +3597,9 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
     verify([source]);
   }
 
@@ -3282,14 +3608,34 @@
 class M {}
 class B {
   B({x});
+  B.other();
 }
 class C extends B with M {
   C(x) : super();
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+  B.named();
+}
+class C extends B with M {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
     verify([source]);
   }
 
@@ -3298,46 +3644,34 @@
 class M {}
 class B {
   B.named({x});
+  B.other();
 }
 class C extends B with M {
   C(x) : super.named();
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
     // Don't verify since call to super.named() can't be resolved.
   }
 
-  void test_noDefaultSuperConstructorExplicit_mixinWithNamedParam() {
-    Source source = addSource(r'''
-class M {}
-class B {
-  B({x});
-}
-class C extends B with M {
-  C();
-}
-''');
-    resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
-    verify([source]);
-  }
-
   void test_noDefaultSuperConstructorExplicit_mixinWithOptionalParam() {
     Source source = addSource(r'''
 class M {}
 class B {
   B([x]);
+  B.other();
 }
 class C extends B with M {
   C();
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
     verify([source]);
   }
 
@@ -3352,8 +3686,9 @@
 class C extends Mixed {}
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3368,8 +3703,9 @@
 class C extends Mixed {}
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3378,12 +3714,14 @@
 class M {}
 class B {
   B({x});
+  B.other();
 }
 class C extends B with M {}
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3392,12 +3730,14 @@
 class M {}
 class B {
   B([x]);
+  B.other();
 }
 class C extends B with M {}
 ''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3409,7 +3749,9 @@
 class B extends A {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3418,7 +3760,9 @@
 class A { A.named() {} }
 class B extends A {}''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
     verify([source]);
   }
 
@@ -3431,7 +3775,9 @@
 main() {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -3444,7 +3790,9 @@
 main() {
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -3511,25 +3859,27 @@
   }
 
   void test_nonConstantDefaultValueFromDeferredLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const V = 1;''',
-        r'''
+const V = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-f({x : a.V}) {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
+f({x : a.V}) {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstantDefaultValueFromDeferredLibrary_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const V = 1;''',
-        r'''
+const V = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-f({x : a.V + 1}) {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
+f({x : a.V + 1}) {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstCaseExpression() {
@@ -3546,11 +3896,9 @@
   }
 
   void test_nonConstCaseExpressionFromDeferredLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 main (int p) {
@@ -3558,15 +3906,16 @@
     case a.c:
       break;
   }
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstCaseExpressionFromDeferredLibrary_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 main (int p) {
@@ -3574,7 +3923,10 @@
     case a.c + 1:
       break;
   }
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstListElement() {
@@ -3588,29 +3940,31 @@
   }
 
   void test_nonConstListElementFromDeferredLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const [a.c];
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstListElementFromDeferredLibrary_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const [a.c + 1];
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstMapAsExpressionStatement_begin() {
@@ -3619,7 +3973,9 @@
   {'a' : 0, 'b' : 1}.length;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
     verify([source]);
   }
 
@@ -3629,7 +3985,9 @@
   {'a' : 0, 'b' : 1};
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
     verify([source]);
   }
 
@@ -3644,29 +4002,29 @@
   }
 
   void test_nonConstMapKeyFromDeferredLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const {a.c : 0};
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstMapKeyFromDeferredLibrary_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const {a.c + 1 : 0};
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstMapValue() {
@@ -3680,29 +4038,29 @@
   }
 
   void test_nonConstMapValueFromDeferredLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const {'a' : a.c};
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstMapValueFromDeferredLibrary_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f() {
   return const {'a' : a.c + 1};
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstValueInInitializer_binary_notBool_left() {
@@ -3712,9 +4070,11 @@
   const A(String p) : a = p && true;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-        StaticTypeWarningCode.NON_BOOL_OPERAND]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+            StaticTypeWarningCode.NON_BOOL_OPERAND]);
     verify([source]);
   }
 
@@ -3725,9 +4085,11 @@
   const A(String p) : a = true && p;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-        StaticTypeWarningCode.NON_BOOL_OPERAND]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+            StaticTypeWarningCode.NON_BOOL_OPERAND]);
     verify([source]);
   }
 
@@ -3738,9 +4100,11 @@
   const A(String p) : a = 5 & p;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -3751,9 +4115,11 @@
   const A(String p) : a = 5 + p;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -3765,7 +4131,9 @@
   const A() : a = C;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -3780,7 +4148,9 @@
 }
 var b = const B();''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -3792,7 +4162,9 @@
   const A() : this.named(C);
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
     verify([source]);
   }
 
@@ -3806,58 +4178,61 @@
   const B() : super(C);
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
     verify([source]);
   }
 
   void test_nonConstValueInInitializerFromDeferredLibrary_field() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class A {
   final int x;
   const A() : x = a.c;
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstValueInInitializerFromDeferredLibrary_field_nested() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class A {
   final int x;
   const A() : x = a.c + 1;
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstValueInInitializerFromDeferredLibrary_redirecting() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class A {
   const A.named(p);
   const A() : this.named(a.c);
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonConstValueInInitializerFromDeferredLibrary_super() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-const int c = 1;''',
-        r'''
+const int c = 1;''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class A {
@@ -3865,7 +4240,10 @@
 }
 class B extends A {
   const B() : super(a.c);
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY]);
   }
 
   void test_nonGenerativeConstructor_explicit() {
@@ -3971,7 +4349,9 @@
 typedef p();
 p.A a;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
     verify([source]);
   }
 
@@ -3984,7 +4364,9 @@
 p() {}
 p.A a;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
     verify([source]);
   }
 
@@ -3997,7 +4379,9 @@
 var p = null;
 p.A a;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
     verify([source]);
   }
 
@@ -4010,7 +4394,9 @@
 class p {}
 p.A a;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
     verify([source]);
   }
 
@@ -4046,9 +4432,11 @@
   A.b() : this.a();
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT]);
     verify([source]);
   }
 
@@ -4074,13 +4462,15 @@
   factory C() = B;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4106,13 +4496,15 @@
   factory C() = B;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4128,13 +4520,15 @@
   factory C.nameC() = B.nameB;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4154,11 +4548,13 @@
   factory C() = B;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4167,9 +4563,11 @@
 class A extends B {}
 class B extends A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4178,9 +4576,11 @@
 class A extends B {}
 class B implements A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4189,9 +4589,11 @@
 class A implements B {}
 class B implements A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4200,9 +4602,11 @@
 class M1 = Object with M2;
 class M2 = Object with M1;''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4211,7 +4615,9 @@
 abstract class A implements A {}
 class B implements A {}''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
     verify([source]);
   }
 
@@ -4221,9 +4627,11 @@
 abstract class B implements A {}
 class C implements A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
@@ -4234,24 +4642,30 @@
 abstract class C implements A {}
 class D implements A {}''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-        CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+            CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE]);
     verify([source]);
   }
 
   void test_recursiveInterfaceInheritanceBaseCaseExtends() {
     Source source = addSource("class A extends A {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS]);
     verify([source]);
   }
 
   void test_recursiveInterfaceInheritanceBaseCaseImplements() {
     Source source = addSource("class A implements A {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
     verify([source]);
   }
 
@@ -4261,14 +4675,18 @@
 class M {}
 class B = A with M implements B;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS]);
     verify([source]);
   }
 
   void test_recursiveInterfaceInheritanceBaseCaseWith() {
     Source source = addSource("class M = Object with M;");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH]);
     verify([source]);
   }
 
@@ -4278,7 +4696,9 @@
   A() : this.noSuchConstructor();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
   }
 
   void test_redirectGenerativeToNonGenerativeConstructor() {
@@ -4288,7 +4708,9 @@
   factory A.x() => null;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4301,7 +4723,9 @@
   const factory B() = A.name;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
   }
 
   void test_redirectToMissingConstructor_unnamed() {
@@ -4313,7 +4737,9 @@
   const factory B() = A;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
   }
 
   void test_redirectToNonClass_notAType() {
@@ -4344,7 +4770,9 @@
   const factory A.b() = A.a;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4420,7 +4848,9 @@
   A() { return 0; }
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4430,7 +4860,9 @@
   A() => null;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4457,18 +4889,17 @@
   }
 
   void test_sharedDeferredPrefix() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-f1() {}''',
-        r'''
+f1() {}''', r'''
 library lib2;
-f2() {}''',
-        r'''
+f2() {}''', r'''
 library root;
 import 'lib1.dart' deferred as lib;
 import 'lib2.dart' as lib;
-main() { lib.f1(); lib.f2(); }'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]);
+main() { lib.f1(); lib.f2(); }'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]);
   }
 
   void test_superInInvalidContext_binaryExpression() {
@@ -4571,7 +5002,9 @@
   B.name() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4583,7 +5016,9 @@
   B.name() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -4595,13 +5030,15 @@
 var s4 = const Symbol('x', 'y');
 var s5 = const Symbol('x', foo: 'x');''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-        CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
-        CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
-        CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+            CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+            CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
+            CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
+            CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER]);
     verify([source]);
   }
 
@@ -4613,10 +5050,12 @@
   F foo(G g) => g;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-        CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-        StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+            CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+            StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
     verify([source]);
   }
 
@@ -4639,28 +5078,36 @@
   void test_typeAliasCannotReferenceItself_parameterType_named() {
     Source source = addSource("typedef A({A a});");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
   void test_typeAliasCannotReferenceItself_parameterType_positional() {
     Source source = addSource("typedef A([A a]);");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
   void test_typeAliasCannotReferenceItself_parameterType_required() {
     Source source = addSource("typedef A(A a);");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
   void test_typeAliasCannotReferenceItself_parameterType_typeArgument() {
     Source source = addSource("typedef A(List<A> a);");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
@@ -4680,7 +5127,9 @@
   void test_typeAliasCannotReferenceItself_returnType() {
     Source source = addSource("typedef A A();");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
@@ -4689,16 +5138,20 @@
 typedef B A();
 typedef A B();''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-        CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+            CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
   void test_typeAliasCannotReferenceItself_typeVariableBounds() {
     Source source = addSource("typedef A<T extends A>();");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
     verify([source]);
   }
 
@@ -4711,7 +5164,9 @@
 }
 f() { return const G<B>(); }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -4732,7 +5187,9 @@
   B() : super.named();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
     // no verify(), "super.named()" is not resolved
   }
 
@@ -4745,7 +5202,9 @@
   B() : super();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
     verify([source]);
   }
 
@@ -4758,7 +5217,9 @@
   B();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
     verify([source]);
   }
 
@@ -4796,10 +5257,13 @@
   void test_uriWithInterpolation_constant() {
     Source source = addSource("import 'stuff_\$platform.dart';");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.URI_WITH_INTERPOLATION,
-        StaticWarningCode.UNDEFINED_IDENTIFIER]);
-    // We cannot verify resolution with an unresolvable URI: 'stuff_$platform.dart'
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.URI_WITH_INTERPOLATION,
+            StaticWarningCode.UNDEFINED_IDENTIFIER]);
+    // We cannot verify resolution with an unresolvable
+    // URI: 'stuff_$platform.dart'
   }
 
   void test_uriWithInterpolation_nonConstant() {
@@ -4811,22 +5275,6 @@
     // We cannot verify resolution with an unresolvable URI: '${'a'}.dart'
   }
 
-  void test_wrongNumberOfParametersForOperator_minus() {
-    Source source = addSource(r'''
-class A {
-  operator -(a, b) {}
-}''');
-    resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS]);
-    verify([source]);
-    reset();
-  }
-
-  void test_wrongNumberOfParametersForOperator_tilde() {
-    _check_wrongNumberOfParametersForOperator("~", "a");
-    _check_wrongNumberOfParametersForOperator("~", "a, b");
-  }
-
   void test_wrongNumberOfParametersForOperator1() {
     _check_wrongNumberOfParametersForOperator1("<");
     _check_wrongNumberOfParametersForOperator1(">");
@@ -4845,31 +5293,57 @@
     _check_wrongNumberOfParametersForOperator1("[]");
   }
 
+  void test_wrongNumberOfParametersForOperator_minus() {
+    Source source = addSource(r'''
+class A {
+  operator -(a, b) {}
+}''');
+    resolve(source);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS]);
+    verify([source]);
+    reset();
+  }
+
+  void test_wrongNumberOfParametersForOperator_tilde() {
+    _check_wrongNumberOfParametersForOperator("~", "a");
+    _check_wrongNumberOfParametersForOperator("~", "a, b");
+  }
+
   void test_wrongNumberOfParametersForSetter_function_named() {
     Source source = addSource("set x({p}) {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
   void test_wrongNumberOfParametersForSetter_function_optional() {
     Source source = addSource("set x([p]) {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
   void test_wrongNumberOfParametersForSetter_function_tooFew() {
     Source source = addSource("set x() {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
   void test_wrongNumberOfParametersForSetter_function_tooMany() {
     Source source = addSource("set x(a, b) {}");
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
@@ -4879,7 +5353,9 @@
   set x({p}) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
@@ -4889,7 +5365,9 @@
   set x([p]) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
@@ -4899,7 +5377,9 @@
   set x() {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
@@ -4909,7 +5389,9 @@
   set x(a, b) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
     verify([source]);
   }
 
@@ -4933,9 +5415,11 @@
   const A(bool p) : a = $expr;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-        StaticTypeWarningCode.NON_BOOL_OPERAND]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+            StaticTypeWarningCode.NON_BOOL_OPERAND]);
     verify([source]);
     reset();
   }
@@ -4947,9 +5431,11 @@
   const A(int p) : a = $expr;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
     reset();
   }
@@ -4961,20 +5447,25 @@
   const A(num p) : a = $expr;
 }''');
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
     reset();
   }
 
-  void _check_wrongNumberOfParametersForOperator(String name, String parameters) {
+  void _check_wrongNumberOfParametersForOperator(String name,
+      String parameters) {
     Source source = addSource('''
 class A {
   operator $name($parameters) {}
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
     verify([source]);
     reset();
   }
@@ -4984,8 +5475,3 @@
     _check_wrongNumberOfParametersForOperator(name, "a, b");
   }
 }
-
-main() {
-  _ut.groupSep = ' | ';
-  runReflectiveTests(CompileTimeErrorCodeTest);
-}
diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
index 6c5f028..2d8d933 100644
--- a/pkg/analyzer/test/generated/element_test.dart
+++ b/pkg/analyzer/test/generated/element_test.dart
@@ -7,20 +7,39 @@
 
 library engine.element_test;
 
-import 'package:analyzer/src/generated/java_core.dart';
-import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart' show AnalysisContext, AnalysisContextImpl;
-import 'package:unittest/unittest.dart';
-import 'test_support.dart';
+import 'package:analyzer/src/generated/engine.dart' show AnalysisContext,
+    AnalysisContextImpl;
+import 'package:analyzer/src/generated/java_core.dart';
+import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/testing/ast_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
-import 'resolver_test.dart' show TestTypeProvider, AnalysisContextHelper;
+import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import 'resolver_test.dart' show TestTypeProvider, AnalysisContextHelper;
+import 'test_support.dart';
 
 
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(AngularPropertyKindTest);
+  runReflectiveTests(ElementKindTest);
+  runReflectiveTests(FunctionTypeImplTest);
+  runReflectiveTests(InterfaceTypeImplTest);
+  runReflectiveTests(TypeParameterTypeImplTest);
+  runReflectiveTests(UnionTypeImplTest);
+  runReflectiveTests(VoidTypeImplTest);
+  runReflectiveTests(ClassElementImplTest);
+  runReflectiveTests(CompilationUnitElementImplTest);
+  runReflectiveTests(ElementLocationImplTest);
+  runReflectiveTests(ElementImplTest);
+  runReflectiveTests(HtmlElementImplTest);
+  runReflectiveTests(LibraryElementImplTest);
+  runReflectiveTests(MultiplyDefinedElementImplTest);
+}
+
 class AngularPropertyKindTest extends EngineTestCase {
   void test_ATTR() {
     AngularPropertyKind kind = AngularPropertyKind.ATTR;
@@ -62,7 +81,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = elementC.type;
-    elementC.interfaces = <InterfaceType> [typeB];
+    elementC.interfaces = <InterfaceType>[typeB];
     List<InterfaceType> supers = elementC.allSupertypes;
     List<InterfaceType> types = new List<InterfaceType>();
     types.addAll(supers);
@@ -80,7 +99,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classC.mixins = <InterfaceType> [typeB];
+    classC.mixins = <InterfaceType>[typeB];
     List<InterfaceType> supers = classC.allSupertypes;
     List<InterfaceType> types = new List<InterfaceType>();
     types.addAll(supers);
@@ -101,8 +120,9 @@
   void test_getField() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String fieldName = "f";
-    FieldElementImpl field = ElementFactory.fieldElement(fieldName, false, false, false, null);
-    classA.fields = <FieldElement> [field];
+    FieldElementImpl field =
+        ElementFactory.fieldElement(fieldName, false, false, false, null);
+    classA.fields = <FieldElement>[field];
     expect(classA.getField(fieldName), same(field));
     // no such field
     expect(classA.getField("noSuchField"), same(null));
@@ -112,7 +132,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
+    classA.methods = <MethodElement>[method];
     expect(classA.getMethod(methodName), same(method));
   }
 
@@ -120,7 +140,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
+    classA.methods = <MethodElement>[method];
     expect(classA.getMethod("${methodName}x"), isNull);
   }
 
@@ -153,13 +173,15 @@
 
   void test_hasNonFinalField_false_const() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, true, classA.type)];
+    classA.fields = <FieldElement>[
+        ElementFactory.fieldElement("f", false, false, true, classA.type)];
     expect(classA.hasNonFinalField, isFalse);
   }
 
   void test_hasNonFinalField_false_final() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, true, false, classA.type)];
+    classA.fields = <FieldElement>[
+        ElementFactory.fieldElement("f", false, true, false, classA.type)];
     expect(classA.hasNonFinalField, isFalse);
   }
 
@@ -172,14 +194,16 @@
 
   void test_hasNonFinalField_true_immediate() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, false, classA.type)];
+    classA.fields = <FieldElement>[
+        ElementFactory.fieldElement("f", false, false, false, classA.type)];
     expect(classA.hasNonFinalField, isTrue);
   }
 
   void test_hasNonFinalField_true_inherited() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, false, classA.type)];
+    classA.fields = <FieldElement>[
+        ElementFactory.fieldElement("f", false, false, false, classA.type)];
     expect(classB.hasNonFinalField, isTrue);
   }
 
@@ -192,21 +216,23 @@
   void test_hasStaticMember_false_instanceMethod() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     MethodElement method = ElementFactory.methodElement("foo", null);
-    classA.methods = <MethodElement> [method];
+    classA.methods = <MethodElement>[method];
     expect(classA.hasStaticMember, isFalse);
   }
 
   void test_hasStaticMember_instanceGetter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    PropertyAccessorElement getter = ElementFactory.getterElement("foo", false, null);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement("foo", false, null);
+    classA.accessors = <PropertyAccessorElement>[getter];
     expect(classA.hasStaticMember, isFalse);
   }
 
   void test_hasStaticMember_true_getter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    PropertyAccessorElementImpl getter = ElementFactory.getterElement("foo", false, null);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElementImpl getter =
+        ElementFactory.getterElement("foo", false, null);
+    classA.accessors = <PropertyAccessorElement>[getter];
     // "foo" is static
     getter.static = true;
     expect(classA.hasStaticMember, isTrue);
@@ -215,7 +241,7 @@
   void test_hasStaticMember_true_method() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     MethodElementImpl method = ElementFactory.methodElement("foo", null);
-    classA.methods = <MethodElement> [method];
+    classA.methods = <MethodElement>[method];
     // "foo" is static
     method.static = true;
     expect(classA.hasStaticMember, isTrue);
@@ -223,8 +249,9 @@
 
   void test_hasStaticMember_true_setter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    PropertyAccessorElementImpl setter = ElementFactory.setterElement("foo", false, null);
-    classA.accessors = <PropertyAccessorElement> [setter];
+    PropertyAccessorElementImpl setter =
+        ElementFactory.setterElement("foo", false, null);
+    classA.accessors = <PropertyAccessorElement>[setter];
     // "foo" is static
     setter.static = true;
     expect(classA.hasStaticMember, isTrue);
@@ -234,12 +261,14 @@
     // class A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    classA.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpConcreteMethod(methodName, library), same(method));
   }
 
@@ -247,13 +276,15 @@
     // class A {
     //   m();
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
-    classA.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    classA.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpConcreteMethod(methodName, library), isNull);
   }
 
@@ -264,17 +295,22 @@
     // class B extends A {
     //   m();
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpConcreteMethod(methodName, library), same(inheritedMethod));
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpConcreteMethod_declaredAndInherited() {
@@ -284,15 +320,18 @@
     // class B extends A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpConcreteMethod(methodName, library), same(method));
   }
 
@@ -303,17 +342,20 @@
     // class B extends A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.abstract = true;
     String methodName = "m";
-    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null);
+    MethodElementImpl inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
     inheritedMethod.abstract = true;
-    classA.methods = <MethodElement> [inheritedMethod];
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpConcreteMethod(methodName, library), same(method));
   }
 
@@ -323,22 +365,29 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpConcreteMethod(methodName, library), same(inheritedMethod));
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpConcreteMethod_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpConcreteMethod("m", library), isNull);
   }
 
@@ -346,12 +395,15 @@
     // class A {
     //   get g {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getter];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getter];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpGetter(getterName, library), same(getter));
   }
 
@@ -361,22 +413,27 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpGetter(getterName, library), same(getter));
   }
 
   void test_lookUpGetter_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpGetter("g", library), isNull);
   }
 
@@ -385,11 +442,13 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classA.lookUpGetter("g", library), isNull);
   }
 
@@ -397,12 +456,15 @@
     // class A {
     //   get g {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getter];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getter];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteGetter(getterName, library), isNull);
   }
 
@@ -412,22 +474,29 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement inheritedGetter = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [inheritedGetter];
+    PropertyAccessorElement inheritedGetter =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[inheritedGetter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedConcreteGetter(getterName, library), same(inheritedGetter));
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedConcreteGetter(getterName, library),
+        same(inheritedGetter));
   }
 
   void test_lookUpInheritedConcreteGetter_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteGetter("g", library), isNull);
   }
 
@@ -436,11 +505,13 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classA.lookUpInheritedConcreteGetter("g", library), isNull);
   }
 
@@ -448,12 +519,14 @@
     // class A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    classA.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteMethod(methodName, library), isNull);
   }
 
@@ -464,17 +537,22 @@
     // class B extends A {
     //   m();
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedConcreteMethod_declaredAndInherited() {
@@ -484,16 +562,21 @@
     // class B extends A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedConcreteMethod_declaredAndInheritedAbstract() {
@@ -503,21 +586,25 @@
     // class B extends A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.abstract = true;
     String methodName = "m";
-    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null);
+    MethodElementImpl inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
     inheritedMethod.abstract = true;
-    classA.methods = <MethodElement> [inheritedMethod];
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpInheritedConcreteMethod(methodName, library), isNull);
   }
 
-  void test_lookUpInheritedConcreteMethod_declaredAndInheritedWithAbstractBetween() {
+  void
+      test_lookUpInheritedConcreteMethod_declaredAndInheritedWithAbstractBetween() {
     // class A {
     //   m() {}
     // }
@@ -527,20 +614,26 @@
     // class C extends B {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    MethodElementImpl abstractMethod = ElementFactory.methodElement(methodName, null);
+    MethodElementImpl abstractMethod =
+        ElementFactory.methodElement(methodName, null);
     abstractMethod.abstract = true;
-    classB.methods = <MethodElement> [abstractMethod];
+    classB.methods = <MethodElement>[abstractMethod];
     ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     MethodElementImpl method = ElementFactory.methodElement(methodName, null);
-    classC.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB, classC];
-    expect(classC.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
+    classC.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB, classC];
+    expect(
+        classC.lookUpInheritedConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedConcreteMethod_inherited() {
@@ -549,22 +642,29 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedConcreteMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedConcreteMethod_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteMethod("m", library), isNull);
   }
 
@@ -572,12 +672,15 @@
     // class A {
     //   set g(x) {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setter];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setter];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteSetter(setterName, library), isNull);
   }
 
@@ -587,22 +690,29 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setter];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedConcreteSetter(setterName, library), same(setter));
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedConcreteSetter(setterName, library),
+        same(setter));
   }
 
   void test_lookUpInheritedConcreteSetter_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedConcreteSetter("s", library), isNull);
   }
 
@@ -611,11 +721,13 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classA.lookUpInheritedConcreteSetter("s", library), isNull);
   }
 
@@ -623,12 +735,14 @@
     // class A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    classA.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedMethod(methodName, library), isNull);
   }
 
@@ -639,16 +753,21 @@
     // class B extends A {
     //   m() {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classB.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedMethod(methodName, library), same(inheritedMethod));
+    classB.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedMethod_inherited() {
@@ -657,59 +776,74 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [inheritedMethod];
+    MethodElement inheritedMethod =
+        ElementFactory.methodElement(methodName, null);
+    classA.methods = <MethodElement>[inheritedMethod];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
-    expect(classB.lookUpInheritedMethod(methodName, library), same(inheritedMethod));
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
+    expect(
+        classB.lookUpInheritedMethod(methodName, library),
+        same(inheritedMethod));
   }
 
   void test_lookUpInheritedMethod_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpInheritedMethod("m", library), isNull);
   }
 
   void test_lookUpMethod_declared() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    classA.methods = <MethodElement>[method];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpMethod(methodName, library), same(method));
   }
 
   void test_lookUpMethod_inherited() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElement method = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [method];
+    classA.methods = <MethodElement>[method];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpMethod(methodName, library), same(method));
   }
 
   void test_lookUpMethod_undeclared() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpMethod("m", library), isNull);
   }
 
   void test_lookUpMethod_undeclared_recursive() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classA.lookUpMethod("m", library), isNull);
   }
 
@@ -717,12 +851,15 @@
     // class A {
     //   set g(x) {}
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setter];
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setter];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpSetter(setterName, library), same(setter));
   }
 
@@ -732,22 +869,27 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setter];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setter];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classB.lookUpSetter(setterName, library), same(setter));
   }
 
   void test_lookUpSetter_undeclared() {
     // class A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA];
     expect(classA.lookUpSetter("s", library), isNull);
   }
 
@@ -756,11 +898,13 @@
     // }
     // class B extends A {
     // }
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classA, classB];
     expect(classA.lookUpSetter("s", library), isNull);
   }
 }
@@ -768,46 +912,55 @@
 class CompilationUnitElementImplTest extends EngineTestCase {
   void test_getEnum_declared() {
     TestTypeProvider typeProvider = new TestTypeProvider();
-    CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
+    CompilationUnitElementImpl unit =
+        ElementFactory.compilationUnit("/lib.dart");
     String enumName = "E";
-    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName);
-    unit.enums = <ClassElement> [enumElement];
+    ClassElement enumElement =
+        ElementFactory.enumElement(typeProvider, enumName);
+    unit.enums = <ClassElement>[enumElement];
     expect(unit.getEnum(enumName), same(enumElement));
   }
 
   void test_getEnum_undeclared() {
     TestTypeProvider typeProvider = new TestTypeProvider();
-    CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
+    CompilationUnitElementImpl unit =
+        ElementFactory.compilationUnit("/lib.dart");
     String enumName = "E";
-    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName);
-    unit.enums = <ClassElement> [enumElement];
+    ClassElement enumElement =
+        ElementFactory.enumElement(typeProvider, enumName);
+    unit.enums = <ClassElement>[enumElement];
     expect(unit.getEnum("${enumName}x"), isNull);
   }
 
   void test_getType_declared() {
-    CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
+    CompilationUnitElementImpl unit =
+        ElementFactory.compilationUnit("/lib.dart");
     String className = "C";
     ClassElement classElement = ElementFactory.classElement2(className);
-    unit.types = <ClassElement> [classElement];
+    unit.types = <ClassElement>[classElement];
     expect(unit.getType(className), same(classElement));
   }
 
   void test_getType_undeclared() {
-    CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
+    CompilationUnitElementImpl unit =
+        ElementFactory.compilationUnit("/lib.dart");
     String className = "C";
     ClassElement classElement = ElementFactory.classElement2(className);
-    unit.types = <ClassElement> [classElement];
+    unit.types = <ClassElement>[classElement];
     expect(unit.getType("${className}x"), isNull);
   }
 }
 
 class ElementImplTest extends EngineTestCase {
   void test_equals() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElementImpl classElement = ElementFactory.classElement2("C");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
-    FieldElement field = ElementFactory.fieldElement("next", false, false, false, classElement.type);
-    classElement.fields = <FieldElement> [field];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
+    FieldElement field =
+        ElementFactory.fieldElement("next", false, false, false, classElement.type);
+    classElement.fields = <FieldElement>[field];
     expect(field == field, isTrue);
     expect(field == field.getter, isFalse);
     expect(field == field.setter, isFalse);
@@ -818,15 +971,18 @@
     AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
     ClassElement classElement = ElementFactory.classElement2("_C");
-    (library1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
+    (library1.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
     LibraryElementImpl library2 = ElementFactory.library(context, "lib2");
     expect(classElement.isAccessibleIn(library2), isFalse);
   }
 
   void test_isAccessibleIn_private_sameLibrary() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElement classElement = ElementFactory.classElement2("_C");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
     expect(classElement.isAccessibleIn(library), isTrue);
   }
 
@@ -834,15 +990,18 @@
     AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
     ClassElement classElement = ElementFactory.classElement2("C");
-    (library1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
+    (library1.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
     LibraryElementImpl library2 = ElementFactory.library(context, "lib2");
     expect(classElement.isAccessibleIn(library2), isTrue);
   }
 
   void test_isAccessibleIn_public_sameLibrary() {
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     ClassElement classElement = ElementFactory.classElement2("C");
-    (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
+    (library.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
     expect(classElement.isAccessibleIn(library), isTrue);
   }
 
@@ -889,7 +1048,9 @@
 
 class ElementKindTest extends EngineTestCase {
   void test_of_nonNull() {
-    expect(ElementKind.of(ElementFactory.classElement2("A")), same(ElementKind.CLASS));
+    expect(
+        ElementKind.of(ElementFactory.classElement2("A")),
+        same(ElementKind.CLASS));
   }
 
   void test_of_null() {
@@ -963,30 +1124,37 @@
 
 class FunctionTypeImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f"))), isNotNull);
+    expect(
+        new FunctionTypeImpl.con1(
+            new FunctionElementImpl.forNode(AstFactory.identifier3("f"))),
+        isNotNull);
   }
 
   void test_getElement() {
-    FunctionElementImpl typeElement = new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+    FunctionElementImpl typeElement =
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
     FunctionTypeImpl type = new FunctionTypeImpl.con1(typeElement);
     expect(type.element, typeElement);
   }
 
   void test_getNamedParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     Map<String, DartType> types = type.namedParameterTypes;
     expect(types, hasLength(0));
   }
 
   void test_getNormalParameterTypes() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     List<DartType> types = type.normalParameterTypes;
     expect(types, hasLength(0));
   }
 
   void test_getReturnType() {
     DartType expectedReturnType = VoidTypeImpl.instance;
-    FunctionElementImpl functionElement = new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
     functionElement.returnType = expectedReturnType;
     FunctionTypeImpl type = new FunctionTypeImpl.con1(functionElement);
     DartType returnType = type.returnType;
@@ -994,13 +1162,15 @@
   }
 
   void test_getTypeArguments() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     List<DartType> types = type.typeArguments;
     expect(types, hasLength(0));
   }
 
   void test_hashCode_element() {
-    FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+    FunctionTypeImpl type = new FunctionTypeImpl.con1(
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     type.hashCode;
   }
 
@@ -1012,8 +1182,10 @@
   void test_isAssignableTo_normalAndPositionalArgs() {
     // ([a]) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
     // assignable iff subtype
@@ -1024,7 +1196,8 @@
   void test_isSubtypeOf_baseCase_classFunction() {
     // () -> void <: Function
     ClassElementImpl functionElement = ElementFactory.classElement2("Function");
-    InterfaceTypeImpl functionType = new InterfaceTypeImpl_FunctionTypeImplTest_test_isSubtypeOf_baseCase_classFunction(functionElement);
+    InterfaceTypeImpl functionType =
+        new _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(functionElement);
     FunctionType f = ElementFactory.functionElement("f").type;
     expect(f.isSubtypeOf(functionType), isTrue);
   }
@@ -1055,16 +1228,36 @@
     // ({name: B}) -> void <: ({name: A}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [b]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[a]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isTrue);
   }
 
   void test_isSubtypeOf_namedParameters_isNotAssignable() {
     // ! ({name: A}) -> void <: ({name: B}) -> void
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("A")]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("B")]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1076,8 +1269,18 @@
     // ! s <: t
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["diff"], <ClassElement> [b]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[a]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["diff"],
+        <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isFalse);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1087,8 +1290,18 @@
     // ({A: A, B: B}) -> void <: ({B: B, A: A}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["A", "B"], <ClassElement> [a, b]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B", "A"], <ClassElement> [b, a]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["A", "B"],
+        <ClassElement>[a, b]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["B", "A"],
+        <ClassElement>[b, a]).type;
     expect(t.isSubtypeOf(s), isTrue);
   }
 
@@ -1097,8 +1310,18 @@
     // ! ({B: B}) -> void <: ({B: B, A: A}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["B"], <ClassElement> [b]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B", "A"], <ClassElement> [b, a]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["B"],
+        <ClassElement>[b]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["B", "A"],
+        <ClassElement>[b, a]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1107,8 +1330,18 @@
     // ({A: A, B: B}) -> void <: ({A: A}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["A", "B"], <ClassElement> [a, b]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B"], <ClassElement> [b]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["A", "B"],
+        <ClassElement>[a, b]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["B"],
+        <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
   }
 
@@ -1117,8 +1350,18 @@
     // ! ({name: A}) -> void <: ({name: B, name2: B}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name", "name2"], <ClassElement> [b, b]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[a]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["name", "name2"],
+        <ClassElement>[b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1127,16 +1370,28 @@
     // ({name: A, name2: A}) -> void <: ({name: B}) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name", "name2"], <ClassElement> [a, a]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [b]).type;
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
+        <String>["name", "name2"],
+        <ClassElement>[a, a]).type;
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
+        <String>["name"],
+        <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
   }
 
   void test_isSubtypeOf_normalAndPositionalArgs_1() {
     // ([a]) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1144,8 +1399,12 @@
   void test_isSubtypeOf_normalAndPositionalArgs_2() {
     // (a, [a]) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", <ClassElement> [a], <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
+    FunctionType t = ElementFactory.functionElement6(
+        "t",
+        <ClassElement>[a],
+        <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1153,7 +1412,8 @@
   void test_isSubtypeOf_normalAndPositionalArgs_3() {
     // ([a]) -> void <: () -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
     FunctionType s = ElementFactory.functionElement("s").type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
@@ -1166,8 +1426,14 @@
     ClassElement c = ElementFactory.classElement2("C");
     ClassElement d = ElementFactory.classElement2("D");
     ClassElement e = ElementFactory.classElement2("E");
-    FunctionType t = ElementFactory.functionElement6("t", <ClassElement> [a, b], <ClassElement> [c, d, e]).type;
-    FunctionType s = ElementFactory.functionElement6("s", <ClassElement> [a, b, c], <ClassElement> [d]).type;
+    FunctionType t = ElementFactory.functionElement6(
+        "t",
+        <ClassElement>[a, b],
+        <ClassElement>[c, d, e]).type;
+    FunctionType s = ElementFactory.functionElement6(
+        "s",
+        <ClassElement>[a, b, c],
+        <ClassElement>[d]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1178,16 +1444,22 @@
     // (b) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b]).type;
+    FunctionType t =
+        ElementFactory.functionElement5("t", <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isTrue);
   }
 
   void test_isSubtypeOf_normalParameters_isNotAssignable() {
     // ! (a) -> void <: (b) -> void
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [ElementFactory.classElement2("A")]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [ElementFactory.classElement2("B")]).type;
+    FunctionType t = ElementFactory.functionElement5(
+        "t",
+        <ClassElement>[ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement5(
+        "s",
+        <ClassElement>[ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1196,8 +1468,10 @@
     // ! (a) -> void <: (b, b) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b, b]).type;
+    FunctionType t =
+        ElementFactory.functionElement5("t", <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1206,10 +1480,13 @@
     // ! (a, a) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a, a]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b]).type;
-    // note, this is a different assertion from the other "tHasMoreParams" tests, this is
-    // intentional as it is a difference of the "normal parameters"
+    FunctionType t =
+        ElementFactory.functionElement5("t", <ClassElement>[a, a]).type;
+    FunctionType s =
+        ElementFactory.functionElement5("s", <ClassElement>[b]).type;
+    // note, this is a different assertion from the other "tHasMoreParams"
+    // tests, this is intentional as it is a difference of the "normal
+    // parameters"
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1226,16 +1503,24 @@
     // ([b]) -> void <: ([a]) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement6("s", null, <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isTrue);
   }
 
   void test_isSubtypeOf_positionalParameters_isNotAssignable() {
     // ! ([a]) -> void <: ([b]) -> void
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [ElementFactory.classElement2("A")]).type;
-    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [ElementFactory.classElement2("B")]).type;
+    FunctionType t = ElementFactory.functionElement6(
+        "t",
+        null,
+        <ClassElement>[ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement6(
+        "s",
+        null,
+        <ClassElement>[ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1244,8 +1529,10 @@
     // ! ([a]) -> void <: ([b, b]) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b, b]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
+    FunctionType s =
+        ElementFactory.functionElement6("s", null, <ClassElement>[b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1254,8 +1541,10 @@
     // ([a, a]) -> void <: ([b]) -> void
     ClassElement a = ElementFactory.classElement2("A");
     ClassElement b = ElementFactory.classElement("B", a.type);
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a, a]).type;
-    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a, a]).type;
+    FunctionType s =
+        ElementFactory.functionElement6("s", null, <ClassElement>[b]).type;
     expect(t.isSubtypeOf(s), isTrue);
   }
 
@@ -1282,8 +1571,10 @@
 
   void test_isSubtypeOf_returnType_tNotAssignableToS() {
     // ! () -> A <: () -> B
-    FunctionType t = ElementFactory.functionElement2("t", ElementFactory.classElement2("A")).type;
-    FunctionType s = ElementFactory.functionElement2("s", ElementFactory.classElement2("B")).type;
+    FunctionType t =
+        ElementFactory.functionElement2("t", ElementFactory.classElement2("A")).type;
+    FunctionType s =
+        ElementFactory.functionElement2("s", ElementFactory.classElement2("B")).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1291,21 +1582,26 @@
     TestTypeProvider provider = new TestTypeProvider();
     InterfaceType boolType = provider.boolType;
     InterfaceType stringType = provider.stringType;
-    TypeParameterElementImpl parameterB = new TypeParameterElementImpl.forNode(AstFactory.identifier3("B"));
+    TypeParameterElementImpl parameterB =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("B"));
     parameterB.bound = boolType;
     TypeParameterTypeImpl typeB = new TypeParameterTypeImpl(parameterB);
-    TypeParameterElementImpl parameterS = new TypeParameterElementImpl.forNode(AstFactory.identifier3("S"));
+    TypeParameterElementImpl parameterS =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("S"));
     parameterS.bound = stringType;
     TypeParameterTypeImpl typeS = new TypeParameterTypeImpl(parameterS);
-    FunctionElementImpl functionAliasElement = new FunctionElementImpl.forNode(AstFactory.identifier3("func"));
-    functionAliasElement.parameters = <ParameterElement> [
+    FunctionElementImpl functionAliasElement =
+        new FunctionElementImpl.forNode(AstFactory.identifier3("func"));
+    functionAliasElement.parameters = <ParameterElement>[
         ElementFactory.requiredParameter2("a", typeB),
         ElementFactory.positionalParameter2("b", typeS)];
     functionAliasElement.returnType = stringType;
-    FunctionTypeImpl functionAliasType = new FunctionTypeImpl.con1(functionAliasElement);
+    FunctionTypeImpl functionAliasType =
+        new FunctionTypeImpl.con1(functionAliasElement);
     functionAliasElement.type = functionAliasType;
-    FunctionElementImpl functionElement = new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
-    functionElement.parameters = <ParameterElement> [
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+    functionElement.parameters = <ParameterElement>[
         ElementFactory.requiredParameter2("c", boolType),
         ElementFactory.positionalParameter2("d", stringType)];
     functionElement.returnType = provider.dynamicType;
@@ -1318,8 +1614,13 @@
     // ! (a) -> void <: ({name: A}) -> void
     // ! ({name: A}) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"], <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement5("t", <ClassElement>[a]).type;
+    FunctionType s = ElementFactory.functionElement7(
+        "s",
+        null,
+        <String>["name"],
+        <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isFalse);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1328,19 +1629,25 @@
     // ! ([a]) -> void <: ({name: A}) -> void
     // ! ({name: A}) -> void <: ([a]) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
-    FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"], <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
+    FunctionType s = ElementFactory.functionElement7(
+        "s",
+        null,
+        <String>["name"],
+        <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isFalse);
     expect(s.isSubtypeOf(t), isFalse);
   }
 
   void test_setTypeArguments() {
     ClassElementImpl enclosingClass = ElementFactory.classElement2("C", ["E"]);
-    MethodElementImpl methodElement = new MethodElementImpl.forNode(AstFactory.identifier3("m"));
-    enclosingClass.methods = <MethodElement> [methodElement];
+    MethodElementImpl methodElement =
+        new MethodElementImpl.forNode(AstFactory.identifier3("m"));
+    enclosingClass.methods = <MethodElement>[methodElement];
     FunctionTypeImpl type = new FunctionTypeImpl.con1(methodElement);
     DartType expectedType = enclosingClass.typeParameters[0].type;
-    type.typeArguments = <DartType> [expectedType];
+    type.typeArguments = <DartType>[expectedType];
     List<DartType> arguments = type.typeArguments;
     expect(arguments, hasLength(1));
     expect(arguments[0], expectedType);
@@ -1349,18 +1656,21 @@
   void test_substitute2_equal() {
     ClassElementImpl definingClass = ElementFactory.classElement2("C", ["E"]);
     TypeParameterType parameterType = definingClass.typeParameters[0].type;
-    MethodElementImpl functionElement = new MethodElementImpl.forNode(AstFactory.identifier3("m"));
+    MethodElementImpl functionElement =
+        new MethodElementImpl.forNode(AstFactory.identifier3("m"));
     String namedParameterName = "c";
-    functionElement.parameters = <ParameterElement> [
+    functionElement.parameters = <ParameterElement>[
         ElementFactory.requiredParameter2("a", parameterType),
         ElementFactory.positionalParameter2("b", parameterType),
         ElementFactory.namedParameter2(namedParameterName, parameterType)];
     functionElement.returnType = parameterType;
-    definingClass.methods = <MethodElement> [functionElement];
+    definingClass.methods = <MethodElement>[functionElement];
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
-    functionType.typeArguments = <DartType> [parameterType];
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("D")));
-    FunctionType result = functionType.substitute2(<DartType> [argumentType], <DartType> [parameterType]);
+    functionType.typeArguments = <DartType>[parameterType];
+    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("D")));
+    FunctionType result =
+        functionType.substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.returnType, argumentType);
     List<DartType> normalParameters = result.normalParameterTypes;
     expect(normalParameters, hasLength(1));
@@ -1374,21 +1684,29 @@
   }
 
   void test_substitute2_notEqual() {
-    DartType returnType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("R")));
-    DartType normalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("A")));
-    DartType optionalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("B")));
-    DartType namedParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("C")));
-    FunctionElementImpl functionElement = new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
+    DartType returnType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("R")));
+    DartType normalParameterType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+    DartType optionalParameterType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("B")));
+    DartType namedParameterType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("C")));
+    FunctionElementImpl functionElement =
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f"));
     String namedParameterName = "c";
-    functionElement.parameters = <ParameterElement> [
+    functionElement.parameters = <ParameterElement>[
         ElementFactory.requiredParameter2("a", normalParameterType),
         ElementFactory.positionalParameter2("b", optionalParameterType),
         ElementFactory.namedParameter2(namedParameterName, namedParameterType)];
     functionElement.returnType = returnType;
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
-    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("D")));
-    TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
-    FunctionType result = functionType.substitute2(<DartType> [argumentType], <DartType> [parameterType]);
+    InterfaceTypeImpl argumentType = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("D")));
+    TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
+    FunctionType result =
+        functionType.substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.returnType, returnType);
     List<DartType> normalParameters = result.normalParameterTypes;
     expect(normalParameters, hasLength(1));
@@ -1458,14 +1776,19 @@
     ClassElementImpl classC = ElementFactory.classElement2("C");
     ClassElementImpl classD = ElementFactory.classElement2("D");
     ClassElementImpl classE = ElementFactory.classElement2("E");
-    classB.interfaces = <InterfaceType> [classA.type];
-    classC.interfaces = <InterfaceType> [classA.type];
-    classD.interfaces = <InterfaceType> [classC.type];
-    classE.interfaces = <InterfaceType> [classB.type, classD.type];
-    // assertion: even though the longest path to Object for typeB is 2, and typeE implements typeB,
-    // the longest path for typeE is 4 since it also implements typeD
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type), 2);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type), 4);
+    classB.interfaces = <InterfaceType>[classA.type];
+    classC.interfaces = <InterfaceType>[classA.type];
+    classD.interfaces = <InterfaceType>[classC.type];
+    classE.interfaces = <InterfaceType>[classB.type, classD.type];
+    // assertion: even though the longest path to Object for typeB is 2, and
+    // typeE implements typeB, the longest path for typeE is 4 since it also
+    // implements typeD
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type),
+        2);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type),
+        4);
   }
 
   void test_computeLongestInheritancePathToObject_multipleSuperclassPaths() {
@@ -1485,11 +1808,16 @@
     ClassElement classC = ElementFactory.classElement("C", classA.type);
     ClassElement classD = ElementFactory.classElement("D", classC.type);
     ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
-    classE.interfaces = <InterfaceType> [classD.type];
-    // assertion: even though the longest path to Object for typeB is 2, and typeE extends typeB,
-    // the longest path for typeE is 4 since it also implements typeD
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type), 2);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type), 4);
+    classE.interfaces = <InterfaceType>[classD.type];
+    // assertion: even though the longest path to Object for typeB is 2, and
+    // typeE extends typeB, the longest path for typeE is 4 since it also
+    // implements typeD
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type),
+        2);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classE.type),
+        4);
   }
 
   void test_computeLongestInheritancePathToObject_object() {
@@ -1507,7 +1835,9 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 2);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type),
+        2);
   }
 
   void test_computeLongestInheritancePathToObject_singleInterfacePath() {
@@ -1523,11 +1853,17 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement2("B");
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classB.interfaces = <InterfaceType> [classA.type];
-    classC.interfaces = <InterfaceType> [classB.type];
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 1);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type), 2);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type), 3);
+    classB.interfaces = <InterfaceType>[classA.type];
+    classC.interfaces = <InterfaceType>[classB.type];
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type),
+        1);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type),
+        2);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type),
+        3);
   }
 
   void test_computeLongestInheritancePathToObject_singleSuperclassPath() {
@@ -1543,9 +1879,15 @@
     ClassElement classA = ElementFactory.classElement2("A");
     ClassElement classB = ElementFactory.classElement("B", classA.type);
     ClassElement classC = ElementFactory.classElement("C", classB.type);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 1);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type), 2);
-    expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type), 3);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type),
+        1);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type),
+        2);
+    expect(
+        InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type),
+        3);
   }
 
   void test_computeSuperinterfaceSet_genericInterfacePath() {
@@ -1563,27 +1905,30 @@
     ClassElementImpl classC = ElementFactory.classElement2("C", ["T"]);
     ClassElement classD = ElementFactory.classElement2("D");
     InterfaceType typeA = classA.type;
-    classB.interfaces = <InterfaceType> [typeA];
+    classB.interfaces = <InterfaceType>[typeA];
     InterfaceTypeImpl typeBT = new InterfaceTypeImpl.con1(classB);
     DartType typeT = classC.type.typeArguments[0];
-    typeBT.typeArguments = <DartType> [typeT];
-    classC.interfaces = <InterfaceType> [typeBT];
+    typeBT.typeArguments = <DartType>[typeT];
+    classC.interfaces = <InterfaceType>[typeBT];
     // A
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(typeA);
+    Set<InterfaceType> superinterfacesOfA =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeA);
     expect(superinterfacesOfA, hasLength(1));
     InterfaceType typeObject = ElementFactory.object.type;
     expect(superinterfacesOfA.contains(typeObject), isTrue);
     // B<D>
     InterfaceTypeImpl typeBD = new InterfaceTypeImpl.con1(classB);
-    typeBD.typeArguments = <DartType> [classD.type];
-    Set<InterfaceType> superinterfacesOfBD = InterfaceTypeImpl.computeSuperinterfaceSet(typeBD);
+    typeBD.typeArguments = <DartType>[classD.type];
+    Set<InterfaceType> superinterfacesOfBD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeBD);
     expect(superinterfacesOfBD, hasLength(2));
     expect(superinterfacesOfBD.contains(typeObject), isTrue);
     expect(superinterfacesOfBD.contains(typeA), isTrue);
     // C<D>
     InterfaceTypeImpl typeCD = new InterfaceTypeImpl.con1(classC);
-    typeCD.typeArguments = <DartType> [classD.type];
-    Set<InterfaceType> superinterfacesOfCD = InterfaceTypeImpl.computeSuperinterfaceSet(typeCD);
+    typeCD.typeArguments = <DartType>[classD.type];
+    Set<InterfaceType> superinterfacesOfCD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeCD);
     expect(superinterfacesOfCD, hasLength(3));
     expect(superinterfacesOfCD.contains(typeObject), isTrue);
     expect(superinterfacesOfCD.contains(typeA), isTrue);
@@ -1606,25 +1951,28 @@
     ClassElementImpl classC = ElementFactory.classElement2("C", ["T"]);
     InterfaceTypeImpl typeBT = new InterfaceTypeImpl.con1(classB);
     DartType typeT = classC.type.typeArguments[0];
-    typeBT.typeArguments = <DartType> [typeT];
+    typeBT.typeArguments = <DartType>[typeT];
     classC.supertype = typeBT;
     ClassElement classD = ElementFactory.classElement2("D");
     // A
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(typeA);
+    Set<InterfaceType> superinterfacesOfA =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeA);
     expect(superinterfacesOfA, hasLength(1));
     InterfaceType typeObject = ElementFactory.object.type;
     expect(superinterfacesOfA.contains(typeObject), isTrue);
     // B<D>
     InterfaceTypeImpl typeBD = new InterfaceTypeImpl.con1(classB);
-    typeBD.typeArguments = <DartType> [classD.type];
-    Set<InterfaceType> superinterfacesOfBD = InterfaceTypeImpl.computeSuperinterfaceSet(typeBD);
+    typeBD.typeArguments = <DartType>[classD.type];
+    Set<InterfaceType> superinterfacesOfBD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeBD);
     expect(superinterfacesOfBD, hasLength(2));
     expect(superinterfacesOfBD.contains(typeObject), isTrue);
     expect(superinterfacesOfBD.contains(typeA), isTrue);
     // C<D>
     InterfaceTypeImpl typeCD = new InterfaceTypeImpl.con1(classC);
-    typeCD.typeArguments = <DartType> [classD.type];
-    Set<InterfaceType> superinterfacesOfCD = InterfaceTypeImpl.computeSuperinterfaceSet(typeCD);
+    typeCD.typeArguments = <DartType>[classD.type];
+    Set<InterfaceType> superinterfacesOfCD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(typeCD);
     expect(superinterfacesOfCD, hasLength(3));
     expect(superinterfacesOfCD.contains(typeObject), isTrue);
     expect(superinterfacesOfCD.contains(typeA), isTrue);
@@ -1637,18 +1985,20 @@
     ClassElementImpl classC = ElementFactory.classElement2("C");
     ClassElementImpl classD = ElementFactory.classElement2("D");
     ClassElementImpl classE = ElementFactory.classElement2("E");
-    classB.interfaces = <InterfaceType> [classA.type];
-    classC.interfaces = <InterfaceType> [classA.type];
-    classD.interfaces = <InterfaceType> [classC.type];
-    classE.interfaces = <InterfaceType> [classB.type, classD.type];
+    classB.interfaces = <InterfaceType>[classA.type];
+    classC.interfaces = <InterfaceType>[classA.type];
+    classD.interfaces = <InterfaceType>[classC.type];
+    classE.interfaces = <InterfaceType>[classB.type, classD.type];
     // D
-    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
+    Set<InterfaceType> superinterfacesOfD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
     expect(superinterfacesOfD, hasLength(3));
     expect(superinterfacesOfD.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfD.contains(classA.type), isTrue);
     expect(superinterfacesOfD.contains(classC.type), isTrue);
     // E
-    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
+    Set<InterfaceType> superinterfacesOfE =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
     expect(superinterfacesOfE, hasLength(5));
     expect(superinterfacesOfE.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfE.contains(classA.type), isTrue);
@@ -1663,15 +2013,17 @@
     ClassElement classC = ElementFactory.classElement("C", classA.type);
     ClassElement classD = ElementFactory.classElement("D", classC.type);
     ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
-    classE.interfaces = <InterfaceType> [classD.type];
+    classE.interfaces = <InterfaceType>[classD.type];
     // D
-    Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
+    Set<InterfaceType> superinterfacesOfD =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
     expect(superinterfacesOfD, hasLength(3));
     expect(superinterfacesOfD.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfD.contains(classA.type), isTrue);
     expect(superinterfacesOfD.contains(classC.type), isTrue);
     // E
-    Set<InterfaceType> superinterfacesOfE = InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
+    Set<InterfaceType> superinterfacesOfE =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classE.type);
     expect(superinterfacesOfE, hasLength(5));
     expect(superinterfacesOfE.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfE.contains(classA.type), isTrue);
@@ -1684,7 +2036,8 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
+    Set<InterfaceType> superinterfacesOfB =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     expect(superinterfacesOfB, hasLength(2));
   }
 
@@ -1692,19 +2045,22 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement2("B");
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classB.interfaces = <InterfaceType> [classA.type];
-    classC.interfaces = <InterfaceType> [classB.type];
+    classB.interfaces = <InterfaceType>[classA.type];
+    classC.interfaces = <InterfaceType>[classB.type];
     // A
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
+    Set<InterfaceType> superinterfacesOfA =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
     expect(superinterfacesOfA, hasLength(1));
     expect(superinterfacesOfA.contains(ElementFactory.object.type), isTrue);
     // B
-    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
+    Set<InterfaceType> superinterfacesOfB =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     expect(superinterfacesOfB, hasLength(2));
     expect(superinterfacesOfB.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfB.contains(classA.type), isTrue);
     // C
-    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
+    Set<InterfaceType> superinterfacesOfC =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
     expect(superinterfacesOfC, hasLength(3));
     expect(superinterfacesOfC.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfC.contains(classA.type), isTrue);
@@ -1723,16 +2079,19 @@
     ClassElement classB = ElementFactory.classElement("B", classA.type);
     ClassElement classC = ElementFactory.classElement("C", classB.type);
     // A
-    Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
+    Set<InterfaceType> superinterfacesOfA =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
     expect(superinterfacesOfA, hasLength(1));
     expect(superinterfacesOfA.contains(ElementFactory.object.type), isTrue);
     // B
-    Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
+    Set<InterfaceType> superinterfacesOfB =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     expect(superinterfacesOfB, hasLength(2));
     expect(superinterfacesOfB.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfB.contains(classA.type), isTrue);
     // C
-    Set<InterfaceType> superinterfacesOfC = InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
+    Set<InterfaceType> superinterfacesOfC =
+        InterfaceTypeImpl.computeSuperinterfaceSet(classC.type);
     expect(superinterfacesOfC, hasLength(3));
     expect(superinterfacesOfC.contains(ElementFactory.object.type), isTrue);
     expect(superinterfacesOfC.contains(classA.type), isTrue);
@@ -1740,14 +2099,18 @@
   }
 
   void test_creation() {
-    expect(new InterfaceTypeImpl.con1(ElementFactory.classElement2("A")), isNotNull);
+    expect(
+        new InterfaceTypeImpl.con1(ElementFactory.classElement2("A")),
+        isNotNull);
   }
 
   void test_getAccessors() {
     ClassElementImpl typeElement = ElementFactory.classElement2("A");
-    PropertyAccessorElement getterG = ElementFactory.getterElement("g", false, null);
-    PropertyAccessorElement getterH = ElementFactory.getterElement("h", false, null);
-    typeElement.accessors = <PropertyAccessorElement> [getterG, getterH];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement("g", false, null);
+    PropertyAccessorElement getterH =
+        ElementFactory.getterElement("h", false, null);
+    typeElement.accessors = <PropertyAccessorElement>[getterG, getterH];
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.accessors.length, 2);
   }
@@ -1770,8 +2133,9 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     InterfaceType typeA = classA.type;
     expect(typeA.getGetter(getterName), same(getterG));
   }
@@ -1783,15 +2147,17 @@
     ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
     DartType typeE = classA.type.typeArguments[0];
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, typeE);
-    classA.accessors = <PropertyAccessorElement> [getterG];
-    (getterG.type as FunctionTypeImpl).typeArguments = classA.type.typeArguments;
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, typeE);
+    classA.accessors = <PropertyAccessorElement>[getterG];
+    (getterG.type as FunctionTypeImpl).typeArguments =
+        classA.type.typeArguments;
     //
     // A<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
-    typeAI.typeArguments = <DartType> [typeI];
+    typeAI.typeArguments = <DartType>[typeI];
     PropertyAccessorElement getter = typeAI.getGetter(getterName);
     expect(getter, isNotNull);
     FunctionType getterType = getter.type;
@@ -1816,7 +2182,7 @@
     ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeB = classB.type;
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.interfaces = <InterfaceType> [typeA, typeB];
+    classC.interfaces = <InterfaceType>[typeA, typeB];
     List<InterfaceType> interfaces = classC.type.interfaces;
     expect(interfaces, hasLength(2));
     if (identical(interfaces[0], typeA)) {
@@ -1836,14 +2202,14 @@
     ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
     InterfaceType typeB = classB.type;
     InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
-    typeAF.typeArguments = <DartType> [typeB.typeArguments[0]];
-    classB.interfaces = <InterfaceType> [typeAF];
+    typeAF.typeArguments = <DartType>[typeB.typeArguments[0]];
+    classB.interfaces = <InterfaceType>[typeAF];
     //
     // B<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
-    typeBI.typeArguments = <DartType> [typeI];
+    typeBI.typeArguments = <DartType>[typeI];
     List<InterfaceType> interfaces = typeBI.interfaces;
     expect(interfaces, hasLength(1));
     InterfaceType result = interfaces[0];
@@ -1863,8 +2229,8 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classB.interfaces = <InterfaceType> [typeA];
-    classC.interfaces = <InterfaceType> [typeB];
+    classB.interfaces = <InterfaceType>[typeA];
+    classC.interfaces = <InterfaceType>[typeB];
     expect(typeB.getLeastUpperBound(typeC), typeB);
     expect(typeC.getLeastUpperBound(typeB), typeB);
   }
@@ -1886,7 +2252,8 @@
 
   void test_getLeastUpperBound_functionType() {
     DartType interfaceType = ElementFactory.classElement2("A").type;
-    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
+    FunctionTypeImpl functionType = new FunctionTypeImpl.con1(
+        new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     expect(interfaceType.getLeastUpperBound(functionType), isNull);
   }
 
@@ -1904,7 +2271,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     InterfaceType typeD = classD.type;
-    classD.mixins = <InterfaceType> [
+    classD.mixins = <InterfaceType>[
         ElementFactory.classElement2("M").type,
         ElementFactory.classElement2("N").type,
         ElementFactory.classElement2("O").type,
@@ -1984,8 +2351,8 @@
     InterfaceType typeA3 = classA3.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classB.interfaces = <InterfaceType> [typeA2];
-    classC.interfaces = <InterfaceType> [typeA3];
+    classB.interfaces = <InterfaceType>[typeA2];
+    classC.interfaces = <InterfaceType>[typeA3];
     expect(typeB.getLeastUpperBound(typeC), typeA);
     expect(typeC.getLeastUpperBound(typeB), typeA);
   }
@@ -1997,8 +2364,8 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classB.interfaces = <InterfaceType> [typeA];
-    classC.interfaces = <InterfaceType> [typeA];
+    classB.interfaces = <InterfaceType>[typeA];
+    classC.interfaces = <InterfaceType>[typeA];
     expect(typeB.getLeastUpperBound(typeC), typeA);
     expect(typeC.getLeastUpperBound(typeB), typeA);
   }
@@ -2012,9 +2379,9 @@
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
     InterfaceType typeD = classD.type;
-    classB.interfaces = <InterfaceType> [typeA];
-    classC.interfaces = <InterfaceType> [typeA];
-    classD.interfaces = <InterfaceType> [typeC];
+    classB.interfaces = <InterfaceType>[typeA];
+    classC.interfaces = <InterfaceType>[typeA];
+    classD.interfaces = <InterfaceType>[typeC];
     expect(typeB.getLeastUpperBound(typeD), typeA);
     expect(typeD.getLeastUpperBound(typeB), typeA);
   }
@@ -2028,9 +2395,9 @@
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
     InterfaceType typeD = classD.type;
-    classB.interfaces = <InterfaceType> [typeA];
-    classC.interfaces = <InterfaceType> [typeB];
-    classD.interfaces = <InterfaceType> [typeB];
+    classB.interfaces = <InterfaceType>[typeA];
+    classC.interfaces = <InterfaceType>[typeB];
+    classD.interfaces = <InterfaceType>[typeB];
     expect(typeC.getLeastUpperBound(typeD), typeB);
     expect(typeD.getLeastUpperBound(typeC), typeB);
   }
@@ -2046,8 +2413,8 @@
     InterfaceType typeA3 = classA3.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classB.interfaces = <InterfaceType> [typeA, typeA2];
-    classC.interfaces = <InterfaceType> [typeA, typeA3];
+    classB.interfaces = <InterfaceType>[typeA, typeA2];
+    classC.interfaces = <InterfaceType>[typeA, typeA3];
     expect(typeB.getLeastUpperBound(typeC), typeA);
     expect(typeC.getLeastUpperBound(typeB), typeA);
   }
@@ -2066,9 +2433,12 @@
     InterfaceType listType = _typeProvider.listType;
     InterfaceType intType = _typeProvider.intType;
     InterfaceType doubleType = _typeProvider.doubleType;
-    InterfaceType listOfIntType = listType.substitute4(<DartType> [intType]);
-    InterfaceType listOfDoubleType = listType.substitute4(<DartType> [doubleType]);
-    expect(listOfIntType.getLeastUpperBound(listOfDoubleType), _typeProvider.objectType);
+    InterfaceType listOfIntType = listType.substitute4(<DartType>[intType]);
+    InterfaceType listOfDoubleType =
+        listType.substitute4(<DartType>[doubleType]);
+    expect(
+        listOfIntType.getLeastUpperBound(listOfDoubleType),
+        _typeProvider.objectType);
   }
 
   void test_getLeastUpperBound_typeParameters_same() {
@@ -2078,7 +2448,7 @@
     //
     InterfaceType listType = _typeProvider.listType;
     InterfaceType intType = _typeProvider.intType;
-    InterfaceType listOfIntType = listType.substitute4(<DartType> [intType]);
+    InterfaceType listOfIntType = listType.substitute4(<DartType>[intType]);
     expect(listOfIntType.getLeastUpperBound(listOfIntType), listOfIntType);
   }
 
@@ -2089,7 +2459,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     InterfaceType typeA = classA.type;
     expect(typeA.getMethod(methodName), same(methodM));
   }
@@ -2101,15 +2471,17 @@
     ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
     DartType typeE = classA.type.typeArguments[0];
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
-    classA.methods = <MethodElement> [methodM];
-    (methodM.type as FunctionTypeImpl).typeArguments = classA.type.typeArguments;
+    MethodElementImpl methodM =
+        ElementFactory.methodElement(methodName, typeE, [typeE]);
+    classA.methods = <MethodElement>[methodM];
+    (methodM.type as FunctionTypeImpl).typeArguments =
+        classA.type.typeArguments;
     //
     // A<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
-    typeAI.typeArguments = <DartType> [typeI];
+    typeAI.typeArguments = <DartType>[typeI];
     MethodElement method = typeAI.getMethod(methodName);
     expect(method, isNotNull);
     FunctionType methodType = method.type;
@@ -2132,7 +2504,7 @@
     ClassElementImpl typeElement = ElementFactory.classElement2("A");
     MethodElementImpl methodOne = ElementFactory.methodElement("one", null);
     MethodElementImpl methodTwo = ElementFactory.methodElement("two", null);
-    typeElement.methods = <MethodElement> [methodOne, methodTwo];
+    typeElement.methods = <MethodElement>[methodOne, methodTwo];
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.methods.length, 2);
   }
@@ -2152,7 +2524,7 @@
     ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeB = classB.type;
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.mixins = <InterfaceType> [typeA, typeB];
+    classC.mixins = <InterfaceType>[typeA, typeB];
     List<InterfaceType> interfaces = classC.type.mixins;
     expect(interfaces, hasLength(2));
     if (identical(interfaces[0], typeA)) {
@@ -2172,14 +2544,14 @@
     ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
     InterfaceType typeB = classB.type;
     InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
-    typeAF.typeArguments = <DartType> [typeB.typeArguments[0]];
-    classB.mixins = <InterfaceType> [typeAF];
+    typeAF.typeArguments = <DartType>[typeB.typeArguments[0]];
+    classB.mixins = <InterfaceType>[typeAF];
     //
     // B<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
-    typeBI.typeArguments = <DartType> [typeI];
+    typeBI.typeArguments = <DartType>[typeI];
     List<InterfaceType> interfaces = typeBI.mixins;
     expect(interfaces, hasLength(1));
     InterfaceType result = interfaces[0];
@@ -2193,8 +2565,9 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     InterfaceType typeA = classA.type;
     expect(typeA.getSetter(setterName), same(setterS));
   }
@@ -2206,15 +2579,17 @@
     ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
     DartType typeE = classA.type.typeArguments[0];
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, typeE);
-    classA.accessors = <PropertyAccessorElement> [setterS];
-    (setterS.type as FunctionTypeImpl).typeArguments = classA.type.typeArguments;
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, typeE);
+    classA.accessors = <PropertyAccessorElement>[setterS];
+    (setterS.type as FunctionTypeImpl).typeArguments =
+        classA.type.typeArguments;
     //
     // A<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
-    typeAI.typeArguments = <DartType> [typeI];
+    typeAI.typeArguments = <DartType>[typeI];
     PropertyAccessorElement setter = typeAI.getSetter(setterName);
     expect(setter, isNotNull);
     FunctionType setterType = setter.type;
@@ -2252,14 +2627,14 @@
     ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
     InterfaceType typeB = classB.type;
     InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
-    typeAF.typeArguments = <DartType> [typeB.typeArguments[0]];
+    typeAF.typeArguments = <DartType>[typeB.typeArguments[0]];
     classB.supertype = typeAF;
     //
     // B<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
-    typeBI.typeArguments = <DartType> [typeI];
+    typeBI.typeArguments = <DartType>[typeI];
     InterfaceType superclass = typeBI.superclass;
     expect(superclass.element, same(classA));
     expect(superclass.typeArguments[0], same(typeI));
@@ -2289,14 +2664,16 @@
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B", ["F", "G"]);
     InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
-    typeAF.typeArguments = <DartType> [classB.typeParameters[0].type];
+    typeAF.typeArguments = <DartType>[classB.typeParameters[0].type];
     InterfaceTypeImpl typeAG = new InterfaceTypeImpl.con1(classA);
-    typeAG.typeArguments = <DartType> [classB.typeParameters[1].type];
+    typeAG.typeArguments = <DartType>[classB.typeParameters[1].type];
     expect(typeAG.isAssignableTo(typeAF), isFalse);
   }
 
   void test_isAssignableTo_void() {
-    expect(VoidTypeImpl.instance.isAssignableTo(_typeProvider.intType), isFalse);
+    expect(
+        VoidTypeImpl.instance.isAssignableTo(_typeProvider.intType),
+        isFalse);
   }
 
   void test_isDirectSupertypeOf_extends() {
@@ -2321,7 +2698,7 @@
     ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
-    classB.interfaces = <InterfaceType> [typeA];
+    classB.interfaces = <InterfaceType>[typeA];
     expect(typeA.isDirectSupertypeOf(typeB), isTrue);
   }
 
@@ -2330,7 +2707,7 @@
     ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
-    classB.mixins = <InterfaceType> [typeA];
+    classB.mixins = <InterfaceType>[typeA];
     expect(typeA.isDirectSupertypeOf(typeB), isTrue);
   }
 
@@ -2345,8 +2722,8 @@
     ClassElement classJ = ElementFactory.classElement("J", classI.type);
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(classA);
-    typeAI.typeArguments = <DartType> [classI.type];
-    typeAJ.typeArguments = <DartType> [classJ.type];
+    typeAI.typeArguments = <DartType>[classI.type];
+    typeAJ.typeArguments = <DartType>[classJ.type];
     expect(typeAJ.isMoreSpecificThan(typeAI), isTrue);
     expect(typeAI.isMoreSpecificThan(typeAJ), isFalse);
   }
@@ -2370,8 +2747,9 @@
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B");
     DartType dynamicType = DynamicTypeImpl.instance;
-    InterfaceType typeAOfDynamic = classA.type.substitute4(<DartType> [dynamicType]);
-    InterfaceType typeAOfB = classA.type.substitute4(<DartType> [classB.type]);
+    InterfaceType typeAOfDynamic =
+        classA.type.substitute4(<DartType>[dynamicType]);
+    InterfaceType typeAOfB = classA.type.substitute4(<DartType>[classB.type]);
     expect(typeAOfDynamic.isMoreSpecificThan(typeAOfB), isFalse);
     expect(typeAOfB.isMoreSpecificThan(typeAOfDynamic), isTrue);
   }
@@ -2390,7 +2768,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.interfaces = <InterfaceType> [classB.type];
+    classC.interfaces = <InterfaceType>[classB.type];
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeC.isMoreSpecificThan(typeA), isTrue);
@@ -2405,7 +2783,7 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.mixins = <InterfaceType> [classB.type];
+    classC.mixins = <InterfaceType>[classB.type];
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeC.isMoreSpecificThan(typeA), isTrue);
@@ -2460,11 +2838,12 @@
     ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    TypeParameterElementImpl parameterEA = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl parameterEA =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterType parameterAEType = new TypeParameterTypeImpl(parameterEA);
     parameterEA.bound = typeA;
     parameterEA.type = parameterAEType;
-    classB.typeParameters = <TypeParameterElementImpl> [parameterEA];
+    classB.typeParameters = <TypeParameterElementImpl>[parameterEA];
     expect(parameterAEType.isMoreSpecificThan(typeA), isTrue);
   }
 
@@ -2494,8 +2873,10 @@
     //
     InterfaceType stringType = _typeProvider.stringType;
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.methods = <MethodElement> [ElementFactory.methodElement("call", VoidTypeImpl.instance, [stringType])];
-    FunctionType functionType = ElementFactory.functionElement5("f", <ClassElement> [stringType.element]).type;
+    classA.methods = <MethodElement>[
+        ElementFactory.methodElement("call", VoidTypeImpl.instance, [stringType])];
+    FunctionType functionType =
+        ElementFactory.functionElement5("f", <ClassElement>[stringType.element]).type;
     expect(classA.type.isSubtypeOf(functionType), isTrue);
   }
 
@@ -2503,8 +2884,9 @@
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B");
     DartType dynamicType = DynamicTypeImpl.instance;
-    InterfaceType typeAOfDynamic = classA.type.substitute4(<DartType> [dynamicType]);
-    InterfaceType typeAOfB = classA.type.substitute4(<DartType> [classB.type]);
+    InterfaceType typeAOfDynamic =
+        classA.type.substitute4(<DartType>[dynamicType]);
+    InterfaceType typeAOfB = classA.type.substitute4(<DartType>[classB.type]);
     expect(typeAOfDynamic.isSubtypeOf(typeAOfB), isTrue);
     expect(typeAOfB.isSubtypeOf(typeAOfDynamic), isTrue);
   }
@@ -2517,7 +2899,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classC.interfaces = <InterfaceType> [typeB];
+    classC.interfaces = <InterfaceType>[typeB];
     expect(typeC.isSubtypeOf(typeB), isTrue);
     expect(typeC.isSubtypeOf(typeObject), isTrue);
     expect(typeC.isSubtypeOf(typeA), isTrue);
@@ -2537,7 +2919,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classC.mixins = <InterfaceType> [typeB];
+    classC.mixins = <InterfaceType>[typeB];
     expect(typeC.isSubtypeOf(typeB), isTrue);
     expect(typeC.isSubtypeOf(typeObject), isTrue);
     expect(typeC.isSubtypeOf(typeA), isTrue);
@@ -2590,13 +2972,13 @@
     ClassElement classJ = ElementFactory.classElement("J", classI.type);
     ClassElement classK = ElementFactory.classElement2("K");
     InterfaceType typeA = classA.type;
-    InterfaceType typeA_dynamic = typeA.substitute4(<DartType> [dynamicType]);
+    InterfaceType typeA_dynamic = typeA.substitute4(<DartType>[dynamicType]);
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(classA);
     InterfaceTypeImpl typeAK = new InterfaceTypeImpl.con1(classA);
-    typeAI.typeArguments = <DartType> [classI.type];
-    typeAJ.typeArguments = <DartType> [classJ.type];
-    typeAK.typeArguments = <DartType> [classK.type];
+    typeAI.typeArguments = <DartType>[classI.type];
+    typeAJ.typeArguments = <DartType>[classJ.type];
+    typeAK.typeArguments = <DartType>[classK.type];
     // A<J> <: A<I> since J <: I
     expect(typeAJ.isSubtypeOf(typeAI), isTrue);
     expect(typeAI.isSubtypeOf(typeAJ), isFalse);
@@ -2658,7 +3040,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classC.interfaces = <InterfaceType> [typeB];
+    classC.interfaces = <InterfaceType>[typeB];
     expect(typeB.isSupertypeOf(typeC), isTrue);
     expect(typeObject.isSupertypeOf(typeC), isTrue);
     expect(typeA.isSupertypeOf(typeC), isTrue);
@@ -2678,7 +3060,7 @@
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
-    classC.mixins = <InterfaceType> [typeB];
+    classC.mixins = <InterfaceType>[typeB];
     expect(typeB.isSupertypeOf(typeC), isTrue);
     expect(typeObject.isSupertypeOf(typeC), isTrue);
     expect(typeA.isSupertypeOf(typeC), isTrue);
@@ -2705,12 +3087,14 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpGetter(getterName, library), same(getterG));
   }
 
@@ -2721,13 +3105,15 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeB.lookUpGetter(getterName, library), same(getterG));
   }
 
@@ -2740,9 +3126,10 @@
     InterfaceType typeA = classA.type;
     ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeA.lookUpGetter("g", library), isNull);
   }
 
@@ -2752,9 +3139,10 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpGetter("g", library), isNull);
   }
 
@@ -2765,11 +3153,12 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpMethod(methodName, library), same(methodM));
   }
 
@@ -2781,12 +3170,13 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeB.lookUpMethod(methodName, library), same(methodM));
   }
 
@@ -2798,23 +3188,26 @@
     ClassElementImpl classA = ElementFactory.classElement2("A", ["E"]);
     DartType typeE = classA.type.typeArguments[0];
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
-    classA.methods = <MethodElement> [methodM];
-    (methodM.type as FunctionTypeImpl).typeArguments = classA.type.typeArguments;
+    MethodElementImpl methodM =
+        ElementFactory.methodElement(methodName, typeE, [typeE]);
+    classA.methods = <MethodElement>[methodM];
+    (methodM.type as FunctionTypeImpl).typeArguments =
+        classA.type.typeArguments;
     ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
     InterfaceType typeB = classB.type;
     InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
-    typeAF.typeArguments = <DartType> [typeB.typeArguments[0]];
+    typeAF.typeArguments = <DartType>[typeB.typeArguments[0]];
     classB.supertype = typeAF;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     //
     // B<I>
     //
     InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
-    typeBI.typeArguments = <DartType> [typeI];
+    typeBI.typeArguments = <DartType>[typeI];
     MethodElement method = typeBI.lookUpMethod(methodName, library);
     expect(method, isNotNull);
     FunctionType methodType = method.type;
@@ -2833,9 +3226,10 @@
     InterfaceType typeA = classA.type;
     ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeA.lookUpMethod("m", library), isNull);
   }
 
@@ -2845,9 +3239,10 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpMethod("m", library), isNull);
   }
 
@@ -2857,12 +3252,14 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpSetter(setterName, library), same(setterS));
   }
 
@@ -2873,13 +3270,15 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "g";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, null);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeB.lookUpSetter(setterName, library), same(setterS));
   }
 
@@ -2892,9 +3291,10 @@
     InterfaceType typeA = classA.type;
     ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA, classB];
     expect(typeA.lookUpSetter("s", library), isNull);
   }
 
@@ -2904,15 +3304,17 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
+    LibraryElementImpl library =
+        ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
-    (unit as CompilationUnitElementImpl).types = <ClassElement> [classA];
+    (unit as CompilationUnitElementImpl).types = <ClassElement>[classA];
     expect(typeA.lookUpSetter("s", library), isNull);
   }
 
   void test_setTypeArguments() {
-    InterfaceTypeImpl type = ElementFactory.classElement2("A").type as InterfaceTypeImpl;
-    List<DartType> typeArguments = <DartType> [
+    InterfaceTypeImpl type =
+        ElementFactory.classElement2("A").type as InterfaceTypeImpl;
+    List<DartType> typeArguments = <DartType>[
         ElementFactory.classElement2("B").type,
         ElementFactory.classElement2("C").type];
     type.typeArguments = typeArguments;
@@ -2937,23 +3339,29 @@
       ClassElementImpl classA = ElementFactory.classElement2("A");
       InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
       InterfaceType argumentType = ElementFactory.classElement2("B").type;
-      type.substitute2(<DartType> [argumentType], <DartType>[]);
-      fail("Expected to encounter exception, argument and parameter type array lengths not equal.");
+      type.substitute2(<DartType>[argumentType], <DartType>[]);
+      fail(
+          "Expected to encounter exception, argument and parameter type array lengths not equal.");
     } catch (e) {
       // Expected result
     }
   }
 
   void test_substitute_notEqual() {
-    // The [test_substitute_equals] above has a slightly higher level implementation.
+    // The [test_substitute_equals] above has a slightly higher level
+    // implementation.
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    TypeParameterElementImpl parameterElement = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl parameterElement =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
-    TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(parameterElement);
-    type.typeArguments = <DartType> [parameter];
+    TypeParameterTypeImpl parameter =
+        new TypeParameterTypeImpl(parameterElement);
+    type.typeArguments = <DartType>[parameter];
     InterfaceType argumentType = ElementFactory.classElement2("B").type;
-    TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
-    InterfaceType result = type.substitute2(<DartType> [argumentType], <DartType> [parameterType]);
+    TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
+    InterfaceType result =
+        type.substitute2(<DartType>[argumentType], <DartType>[parameterType]);
     expect(result.element, classA);
     List<DartType> resultArguments = result.typeArguments;
     expect(resultArguments, hasLength(1));
@@ -2961,16 +3369,13 @@
   }
 }
 
-class InterfaceTypeImpl_FunctionTypeImplTest_test_isSubtypeOf_baseCase_classFunction extends InterfaceTypeImpl {
-  InterfaceTypeImpl_FunctionTypeImplTest_test_isSubtypeOf_baseCase_classFunction(ClassElement arg0) : super.con1(arg0);
-
-  @override
-  bool get isDartCoreFunction => true;
-}
-
 class LibraryElementImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new LibraryElementImpl.forNode(createAnalysisContext(), AstFactory.libraryIdentifier2(["l"])), isNotNull);
+    expect(
+        new LibraryElementImpl.forNode(
+            createAnalysisContext(),
+            AstFactory.libraryIdentifier2(["l"])),
+        isNotNull);
   }
 
   void test_getImportedLibraries() {
@@ -2979,8 +3384,10 @@
     LibraryElementImpl library2 = ElementFactory.library(context, "l2");
     LibraryElementImpl library3 = ElementFactory.library(context, "l3");
     LibraryElementImpl library4 = ElementFactory.library(context, "l4");
-    PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
-    PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
+    PrefixElement prefixA =
+        new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
+    PrefixElement prefixB =
+        new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
         ElementFactory.importFor(library2, null),
         ElementFactory.importFor(library2, prefixB),
@@ -2990,14 +3397,18 @@
         ElementFactory.importFor(library4, prefixA)];
     library1.imports = imports;
     List<LibraryElement> libraries = library1.importedLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library2, library3, library4]));
+    expect(
+        libraries,
+        unorderedEquals(<LibraryElement>[library2, library3, library4]));
   }
 
   void test_getPrefixes() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "l1");
-    PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
-    PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
+    PrefixElement prefixA =
+        new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
+    PrefixElement prefixB =
+        new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
         ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
         ElementFactory.importFor(ElementFactory.library(context, "l3"), null),
@@ -3019,38 +3430,45 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "test");
     CompilationUnitElement unitLib = library.definingCompilationUnit;
-    CompilationUnitElementImpl unitA = ElementFactory.compilationUnit("unit_a.dart");
-    CompilationUnitElementImpl unitB = ElementFactory.compilationUnit("unit_b.dart");
-    library.parts = <CompilationUnitElement> [unitA, unitB];
-    expect(library.units, unorderedEquals(<CompilationUnitElement> [unitLib, unitA, unitB]));
+    CompilationUnitElementImpl unitA =
+        ElementFactory.compilationUnit("unit_a.dart");
+    CompilationUnitElementImpl unitB =
+        ElementFactory.compilationUnit("unit_b.dart");
+    library.parts = <CompilationUnitElement>[unitA, unitB];
+    expect(
+        library.units,
+        unorderedEquals(<CompilationUnitElement>[unitLib, unitA, unitB]));
   }
 
   void test_getVisibleLibraries_cycle() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(library, null)];
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
+    libraryA.imports =
+        <ImportElementImpl>[ElementFactory.importFor(library, null)];
+    library.imports =
+        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
+    expect(libraries, unorderedEquals(<LibraryElement>[library, libraryA]));
   }
 
   void test_getVisibleLibraries_directExports() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    library.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryA)];
+    library.exports = <ExportElementImpl>[ElementFactory.exportFor(libraryA)];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library]));
+    expect(libraries, unorderedEquals(<LibraryElement>[library]));
   }
 
   void test_getVisibleLibraries_directImports() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
+    library.imports =
+        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
+    expect(libraries, unorderedEquals(<LibraryElement>[library, libraryA]));
   }
 
   void test_getVisibleLibraries_indirectExports() {
@@ -3058,10 +3476,13 @@
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
-    libraryA.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryAA)];
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
+    libraryA.exports = <ExportElementImpl>[ElementFactory.exportFor(libraryAA)];
+    library.imports =
+        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libraryAA]));
+    expect(
+        libraries,
+        unorderedEquals(<LibraryElement>[library, libraryA, libraryAA]));
   }
 
   void test_getVisibleLibraries_indirectImports() {
@@ -3070,18 +3491,23 @@
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
     LibraryElementImpl libraryB = ElementFactory.library(context, "B");
-    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(libraryAA, null)];
-    library.imports = <ImportElementImpl> [
+    libraryA.imports =
+        <ImportElementImpl>[ElementFactory.importFor(libraryAA, null)];
+    library.imports = <ImportElementImpl>[
         ElementFactory.importFor(libraryA, null),
         ElementFactory.importFor(libraryB, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libraryAA, libraryB]));
+    expect(
+        libraries,
+        unorderedEquals(<LibraryElement>[library, libraryA, libraryAA, libraryB]));
   }
 
   void test_getVisibleLibraries_noImports() {
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
-    expect(library.visibleLibraries, unorderedEquals(<LibraryElement> [library]));
+    expect(
+        library.visibleLibraries,
+        unorderedEquals(<LibraryElement>[library]));
   }
 
   void test_isUpToDate() {
@@ -3091,13 +3517,15 @@
     context.setContents(library.definingCompilationUnit.source, "sdfsdff");
     // Assert that we are not up to date if the target has an old time stamp.
     expect(library.isUpToDate(0), isFalse);
-    // Assert that we are up to date with a target modification time in the future.
+    // Assert that we are up to date with a target modification time in the
+    // future.
     expect(library.isUpToDate(JavaSystem.currentTimeMillis() + 1000), isTrue);
   }
 
   void test_setImports() {
     AnalysisContext context = createAnalysisContext();
-    LibraryElementImpl library = new LibraryElementImpl.forNode(context, AstFactory.libraryIdentifier2(["l1"]));
+    LibraryElementImpl library =
+        new LibraryElementImpl.forNode(context, AstFactory.libraryIdentifier2(["l1"]));
     List<ImportElementImpl> expectedImports = [
         ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
         ElementFactory.importFor(ElementFactory.library(context, "l3"), null)];
@@ -3114,12 +3542,20 @@
   void test_fromElements_conflicting() {
     Element firstElement = ElementFactory.localVariableElement2("xx");
     Element secondElement = ElementFactory.localVariableElement2("yy");
-    Element result = MultiplyDefinedElementImpl.fromElements(null, firstElement, secondElement);
-    EngineTestCase.assertInstanceOf((obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, result);
-    List<Element> elements = (result as MultiplyDefinedElement).conflictingElements;
+    Element result =
+        MultiplyDefinedElementImpl.fromElements(null, firstElement, secondElement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MultiplyDefinedElement,
+        MultiplyDefinedElement,
+        result);
+    List<Element> elements =
+        (result as MultiplyDefinedElement).conflictingElements;
     expect(elements, hasLength(2));
     for (int i = 0; i < elements.length; i++) {
-      EngineTestCase.assertInstanceOf((obj) => obj is LocalVariableElement, LocalVariableElement, elements[i]);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is LocalVariableElement,
+          LocalVariableElement,
+          elements[i]);
     }
   }
 
@@ -3127,41 +3563,59 @@
     Element firstElement = ElementFactory.localVariableElement2("xx");
     Element secondElement = ElementFactory.localVariableElement2("yy");
     Element thirdElement = ElementFactory.localVariableElement2("zz");
-    Element result = MultiplyDefinedElementImpl.fromElements(null, MultiplyDefinedElementImpl.fromElements(null, firstElement, secondElement), thirdElement);
-    EngineTestCase.assertInstanceOf((obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, result);
-    List<Element> elements = (result as MultiplyDefinedElement).conflictingElements;
+    Element result = MultiplyDefinedElementImpl.fromElements(
+        null,
+        MultiplyDefinedElementImpl.fromElements(null, firstElement, secondElement),
+        thirdElement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MultiplyDefinedElement,
+        MultiplyDefinedElement,
+        result);
+    List<Element> elements =
+        (result as MultiplyDefinedElement).conflictingElements;
     expect(elements, hasLength(3));
     for (int i = 0; i < elements.length; i++) {
-      EngineTestCase.assertInstanceOf((obj) => obj is LocalVariableElement, LocalVariableElement, elements[i]);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is LocalVariableElement,
+          LocalVariableElement,
+          elements[i]);
     }
   }
 
   void test_fromElements_nonConflicting() {
     Element element = ElementFactory.localVariableElement2("xx");
-    expect(MultiplyDefinedElementImpl.fromElements(null, element, element), same(element));
+    expect(
+        MultiplyDefinedElementImpl.fromElements(null, element, element),
+        same(element));
   }
 }
 
 class TypeParameterTypeImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"))), isNotNull);
+    expect(
+        new TypeParameterTypeImpl(
+            new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"))),
+        isNotNull);
   }
 
   void test_getElement() {
-    TypeParameterElementImpl element = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl element =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     expect(type.element, element);
   }
 
   void test_isMoreSpecificThan_typeArguments_dynamic() {
-    TypeParameterElementImpl element = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl element =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << dynamic
     expect(type.isMoreSpecificThan(DynamicTypeImpl.instance), isTrue);
   }
 
   void test_isMoreSpecificThan_typeArguments_object() {
-    TypeParameterElementImpl element = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl element =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << Object
     expect(type.isMoreSpecificThan(ElementFactory.object.type), isTrue);
@@ -3169,10 +3623,14 @@
 
   void test_isMoreSpecificThan_typeArguments_resursive() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
-    TypeParameterElementImpl typeParameterU = new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
-    TypeParameterTypeImpl typeParameterTypeU = new TypeParameterTypeImpl(typeParameterU);
-    TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
-    TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);
+    TypeParameterElementImpl typeParameterU =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
+    TypeParameterTypeImpl typeParameterTypeU =
+        new TypeParameterTypeImpl(typeParameterU);
+    TypeParameterElementImpl typeParameterT =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+    TypeParameterTypeImpl typeParameterTypeT =
+        new TypeParameterTypeImpl(typeParameterT);
     typeParameterT.bound = typeParameterTypeU;
     typeParameterU.bound = typeParameterTypeU;
     // <T extends U> and <U extends T>
@@ -3181,7 +3639,8 @@
   }
 
   void test_isMoreSpecificThan_typeArguments_self() {
-    TypeParameterElementImpl element = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl element =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
     // E << E
     expect(type.isMoreSpecificThan(type), isTrue);
@@ -3195,9 +3654,11 @@
     ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
-    TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+    TypeParameterElementImpl typeParameterT =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
     typeParameterT.bound = typeB;
-    TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);
+    TypeParameterTypeImpl typeParameterTypeT =
+        new TypeParameterTypeImpl(typeParameterT);
     // <T extends B>
     // T << A
     expect(typeParameterTypeT.isMoreSpecificThan(typeA), isTrue);
@@ -3205,12 +3666,16 @@
 
   void test_isMoreSpecificThan_typeArguments_transitivity_typeParameters() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
-    TypeParameterElementImpl typeParameterU = new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
+    TypeParameterElementImpl typeParameterU =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
     typeParameterU.bound = classS.type;
-    TypeParameterTypeImpl typeParameterTypeU = new TypeParameterTypeImpl(typeParameterU);
-    TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+    TypeParameterTypeImpl typeParameterTypeU =
+        new TypeParameterTypeImpl(typeParameterU);
+    TypeParameterElementImpl typeParameterT =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
     typeParameterT.bound = typeParameterTypeU;
-    TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);
+    TypeParameterTypeImpl typeParameterTypeT =
+        new TypeParameterTypeImpl(typeParameterT);
     // <T extends U> and <U extends S>
     // T << S
     expect(typeParameterTypeT.isMoreSpecificThan(classS.type), isTrue);
@@ -3218,27 +3683,38 @@
 
   void test_isMoreSpecificThan_typeArguments_upperBound() {
     ClassElementImpl classS = ElementFactory.classElement2("A");
-    TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
+    TypeParameterElementImpl typeParameterT =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
     typeParameterT.bound = classS.type;
-    TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);
+    TypeParameterTypeImpl typeParameterTypeT =
+        new TypeParameterTypeImpl(typeParameterT);
     // <T extends S>
     // T << S
     expect(typeParameterTypeT.isMoreSpecificThan(classS.type), isTrue);
   }
 
   void test_substitute_equal() {
-    TypeParameterElementImpl element = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
+    TypeParameterElementImpl element =
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterTypeImpl type = new TypeParameterTypeImpl(element);
-    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
     TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(element);
-    expect(type.substitute2(<DartType> [argument], <DartType> [parameter]), same(argument));
+    expect(
+        type.substitute2(<DartType>[argument], <DartType>[parameter]),
+        same(argument));
   }
 
   void test_substitute_notEqual() {
-    TypeParameterTypeImpl type = new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
-    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(new ClassElementImpl.forNode(AstFactory.identifier3("A")));
-    TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
-    expect(type.substitute2(<DartType> [argument], <DartType> [parameter]), same(type));
+    TypeParameterTypeImpl type = new TypeParameterTypeImpl(
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("E")));
+    InterfaceTypeImpl argument = new InterfaceTypeImpl.con1(
+        new ClassElementImpl.forNode(AstFactory.identifier3("A")));
+    TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(
+        new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
+    expect(
+        type.substitute2(<DartType>[argument], <DartType>[parameter]),
+        same(type));
   }
 }
 
@@ -3261,6 +3737,20 @@
 
   List<DartType> _us;
 
+  @override
+  void setUp() {
+    super.setUp();
+    _classA = ElementFactory.classElement2("A");
+    _typeA = _classA.type;
+    _classB = ElementFactory.classElement("B", _typeA);
+    _typeB = _classB.type;
+    _uA = UnionTypeImpl.union([_typeA]);
+    _uB = UnionTypeImpl.union([_typeB]);
+    _uAB = UnionTypeImpl.union([_typeA, _typeB]);
+    _uBA = UnionTypeImpl.union([_typeB, _typeA]);
+    _us = <DartType>[_uA, _uB, _uAB, _uBA];
+  }
+
   void test_emptyUnionsNotAllowed() {
     try {
       UnionTypeImpl.union([]);
@@ -3315,7 +3805,8 @@
     }
   }
 
-  void test_isMoreSpecificThan_someElementOnLHSIsNotASubtypeOfAnyElementOnRHS() {
+  void
+      test_isMoreSpecificThan_someElementOnLHSIsNotASubtypeOfAnyElementOnRHS() {
     // Unions are subtypes when some element is a subtype
     expect(_uAB.isMoreSpecificThan(_uB), isTrue);
     expect(_uAB.isMoreSpecificThan(_typeB), isTrue);
@@ -3370,7 +3861,8 @@
   }
 
   void test_noLossage() {
-    UnionType u = UnionTypeImpl.union([_typeA, _typeB, _typeB, _typeA, _typeB, _typeB]) as UnionType;
+    UnionType u = UnionTypeImpl.union(
+        [_typeA, _typeB, _typeB, _typeA, _typeB, _typeB]) as UnionType;
     Set<DartType> elements = u.elements;
     expect(elements.contains(_typeA), isTrue);
     expect(elements.contains(_typeB), isTrue);
@@ -3385,7 +3877,9 @@
     List<DartType> params = [classAE.typeParameters[0].type];
     DartType typeAESubbed = typeAE.substitute2(args, params);
     expect(typeAE == typeAESubbed, isFalse);
-    expect(UnionTypeImpl.union([_typeA, typeAESubbed]), UnionTypeImpl.union([_typeA, typeAE]).substitute2(args, params));
+    expect(
+        UnionTypeImpl.union([_typeA, typeAESubbed]),
+        UnionTypeImpl.union([_typeA, typeAE]).substitute2(args, params));
   }
 
   void test_toString_pair() {
@@ -3400,36 +3894,26 @@
   }
 
   void test_unionTypeIsLessSpecificThan_function() {
-    // Based on [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
+    // Based on
+    // [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
     DartType uAT = UnionTypeImpl.union([_uA, t]);
     expect(t.isMoreSpecificThan(uAT), isTrue);
     expect(t.isMoreSpecificThan(_uAB), isFalse);
   }
 
   void test_unionTypeIsSuperTypeOf_function() {
-    // Based on [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
+    // Based on
+    // [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
+    FunctionType t =
+        ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
     DartType uAT = UnionTypeImpl.union([_uA, t]);
     expect(t.isSubtypeOf(uAT), isTrue);
     expect(t.isSubtypeOf(_uAB), isFalse);
   }
-
-  @override
-  void setUp() {
-    super.setUp();
-    _classA = ElementFactory.classElement2("A");
-    _typeA = _classA.type;
-    _classB = ElementFactory.classElement("B", _typeA);
-    _typeB = _classB.type;
-    _uA = UnionTypeImpl.union([_typeA]);
-    _uB = UnionTypeImpl.union([_typeB]);
-    _uAB = UnionTypeImpl.union([_typeA, _typeB]);
-    _uBA = UnionTypeImpl.union([_typeB, _typeA]);
-    _us = <DartType> [_uA, _uB, _uAB, _uBA];
-  }
 }
 
 class VoidTypeImplTest extends EngineTestCase {
@@ -3469,20 +3953,12 @@
   }
 }
 
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(AngularPropertyKindTest);
-  runReflectiveTests(ElementKindTest);
-  runReflectiveTests(FunctionTypeImplTest);
-  runReflectiveTests(InterfaceTypeImplTest);
-  runReflectiveTests(TypeParameterTypeImplTest);
-  runReflectiveTests(UnionTypeImplTest);
-  runReflectiveTests(VoidTypeImplTest);
-  runReflectiveTests(ClassElementImplTest);
-  runReflectiveTests(CompilationUnitElementImplTest);
-  runReflectiveTests(ElementLocationImplTest);
-  runReflectiveTests(ElementImplTest);
-  runReflectiveTests(HtmlElementImplTest);
-  runReflectiveTests(LibraryElementImplTest);
-  runReflectiveTests(MultiplyDefinedElementImplTest);
-}
\ No newline at end of file
+class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction extends
+    InterfaceTypeImpl {
+
+  _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0)
+      : super.con1(arg0);
+
+  @override
+  bool get isDartCoreFunction => true;
+}
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 1363afb..c18b03d 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -7,6 +7,7 @@
 
 library engine.engine_test;
 
+import 'dart:async';
 import 'dart:collection';
 
 import 'package:analyzer/src/generated/ast.dart';
@@ -27,14 +28,16 @@
 import 'package:analyzer/src/generated/testing/ast_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
+import 'package:analyzer/src/string_source.dart';
 import 'package:analyzer/src/task/task_dart.dart';
 import 'package:typed_mock/typed_mock.dart';
 import 'package:unittest/unittest.dart';
+import 'package:watcher/src/utils.dart';
 
+import '../reflective_tests.dart';
 import 'all_the_rest.dart';
 import 'resolver_test.dart';
 import 'test_support.dart';
-import '../reflective_tests.dart';
 
 
 main() {
@@ -59,6 +62,7 @@
   runReflectiveTests(ResolveHtmlTaskTest);
   runReflectiveTests(ScanDartTaskTest);
   runReflectiveTests(SdkCachePartitionTest);
+  runReflectiveTests(SourcesChangedEventTest);
   runReflectiveTests(UniversalCachePartitionTest);
   runReflectiveTests(WorkManagerTest);
 }
@@ -166,24 +170,37 @@
   }
 
   void fail_performAnalysisTask_importedLibraryDelete_html() {
-    Source htmlSource = _addSource(
-        "/page.html",
-        r'''
+    Source htmlSource = _addSource("/page.html", r'''
 <html><body><script type="application/dart">
   import 'libB.dart';
   main() {print('hello dart');}
 </script></body></html>''');
     Source libBSource = _addSource("/libB.dart", "library libB;");
     _analyzeAll_assertFinished();
-    expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull, reason: "htmlUnit resolved 1");
-    expect(_context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull, reason: "libB resolved 1");
-    expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)), isTrue, reason: "htmlSource doesn't have errors");
+    expect(
+        _context.getResolvedHtmlUnit(htmlSource),
+        isNotNull,
+        reason: "htmlUnit resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(libBSource, libBSource),
+        isNotNull,
+        reason: "libB resolved 1");
+    expect(
+        !_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
+        isTrue,
+        reason: "htmlSource doesn't have errors");
     // remove libB.dart content and analyze
     _context.setContents(libBSource, null);
     _analyzeAll_assertFinished();
-    expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull, reason: "htmlUnit resolved 1");
+    expect(
+        _context.getResolvedHtmlUnit(htmlSource),
+        isNotNull,
+        reason: "htmlUnit resolved 1");
     AnalysisErrorInfo errors = _context.getErrors(htmlSource);
-    expect(_hasAnalysisErrorWithErrorSeverity(errors), isTrue, reason: "htmlSource has an error");
+    expect(
+        _hasAnalysisErrorWithErrorSeverity(errors),
+        isTrue,
+        reason: "htmlSource has an error");
   }
 
   void fail_recordLibraryElements() {
@@ -211,55 +228,105 @@
     super.tearDown();
   }
 
-  void test_applyChanges_add() {
+  Future test_applyChanges_add() {
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
-    Source source = _addSource("/test.dart", "main() {}");
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    ChangeSet changeSet = new ChangeSet();
+    changeSet.addedSource(source);
+    _context.applyChanges(changeSet);
     expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertNoMoreEvents();
+    });
+  }
+
+  Future test_applyChanges_change() {
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
+    expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    ChangeSet changeSet1 = new ChangeSet();
+    changeSet1.addedSource(source);
+    _context.applyChanges(changeSet1);
+    expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+    Source source2 =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+    ChangeSet changeSet2 = new ChangeSet();
+    changeSet2.addedSource(source2);
+    changeSet2.changedSource(source);
+    _context.applyChanges(changeSet2);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+      listener.assertNoMoreEvents();
+    });
+  }
+
+  Future test_applyChanges_change_content() {
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
+    expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    ChangeSet changeSet1 = new ChangeSet();
+    changeSet1.addedSource(source);
+    _context.applyChanges(changeSet1);
+    expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+    Source source2 =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+    ChangeSet changeSet2 = new ChangeSet();
+    changeSet2.addedSource(source2);
+    changeSet2.changedContent(source, 'library test;');
+    _context.applyChanges(changeSet2);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+      listener.assertNoMoreEvents();
+    });
   }
 
   void test_applyChanges_change_flush_element() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource(
-        "/lib.dart",
-        r'''
+    Source librarySource = _addSource("/lib.dart", r'''
 library lib;
 int a = 0;''');
     expect(_context.computeLibraryElement(librarySource), isNotNull);
-    _context.setContents(
-        librarySource,
-        r'''
+    _context.setContents(librarySource, r'''
 library lib;
 int aa = 0;''');
     expect(_context.getLibraryElement(librarySource), isNull);
   }
 
-  void test_applyChanges_change_multiple() {
+  Future test_applyChanges_change_multiple() {
     _context = AnalysisContextFactory.contextWithCore();
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource(
-        "/lib.dart",
-        r'''
+    String libraryContents1 = r'''
 library lib;
 part 'part.dart';
-int a = 0;''');
-    Source partSource = _addSource(
-        "/part.dart",
-        r'''
+int a = 0;''';
+    Source librarySource = _addSource("/lib.dart", libraryContents1);
+    String partContents1 = r'''
 part of lib;
-int b = a;''');
+int b = a;''';
+    Source partSource = _addSource("/part.dart", partContents1);
     _context.computeLibraryElement(librarySource);
-    _context.setContents(
-        librarySource,
-        r'''
+    String libraryContents2 = r'''
 library lib;
 part 'part.dart';
-int aa = 0;''');
-    _context.setContents(
-        partSource,
-        r'''
+int aa = 0;''';
+    _context.setContents(librarySource, libraryContents2);
+    String partContents2 = r'''
 part of lib;
-int b = aa;''');
+int b = aa;''';
+    _context.setContents(partSource, partContents2);
     _context.computeLibraryElement(librarySource);
     CompilationUnit libraryUnit =
         _context.resolveCompilationUnit2(librarySource, librarySource);
@@ -272,7 +339,41 @@
         partUnit.declarations[0] as TopLevelVariableDeclaration;
     Element useElement =
         (use.variables.variables[0].initializer as SimpleIdentifier).staticElement;
-    expect((useElement as PropertyAccessorElement).variable, same(declarationElement));
+    expect(
+        (useElement as PropertyAccessorElement).variable,
+        same(declarationElement));
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [partSource]);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertEvent(changedSources: [partSource]);
+      listener.assertNoMoreEvents();
+    });
+  }
+
+  Future test_applyChanges_change_range() {
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
+    expect(_context.sourcesNeedingProcessing.isEmpty, isTrue);
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    ChangeSet changeSet1 = new ChangeSet();
+    changeSet1.addedSource(source);
+    _context.applyChanges(changeSet1);
+    expect(_context.sourcesNeedingProcessing.contains(source), isTrue);
+    Source source2 =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test2.dart"));
+    ChangeSet changeSet2 = new ChangeSet();
+    changeSet2.addedSource(source2);
+    changeSet2.changedRange(source, 'library test;', 0, 0, 13);
+    _context.applyChanges(changeSet2);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
+      listener.assertNoMoreEvents();
+    });
   }
 
   void test_applyChanges_empty() {
@@ -295,16 +396,17 @@
     expect(_context.sourcesNeedingProcessing, hasLength(0));
   }
 
-  void test_applyChanges_remove() {
+  Future test_applyChanges_remove() {
     _context = AnalysisContextFactory.contextWithCore();
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     _sourceFactory = _context.sourceFactory;
-    Source libA = _addSource(
-        "/libA.dart",
-        r'''
+    String libAContents = r'''
 library libA;
-import 'libB.dart';''');
-    Source libB =
-        _addSource("/libB.dart", "library libB;");
+import 'libB.dart';''';
+    Source libA = _addSource("/libA.dart", libAContents);
+    String libBContents = "library libB;";
+    Source libB = _addSource("/libB.dart", libBContents);
     LibraryElement libAElement = _context.computeLibraryElement(libA);
     List<LibraryElement> importedLibraries = libAElement.importedLibraries;
     expect(importedLibraries, hasLength(2));
@@ -319,37 +421,55 @@
     libAElement = _context.computeLibraryElement(libA);
     importedLibraries = libAElement.importedLibraries;
     expect(importedLibraries, hasLength(1));
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [libA]);
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [libB]);
+      listener.assertEvent(changedSources: [libB]);
+      listener.assertEvent(wereSourcesRemovedOrDeleted: true);
+      listener.assertNoMoreEvents();
+    });
   }
 
-  void test_applyChanges_removeContainer() {
+  Future test_applyChanges_removeContainer() {
     _context = AnalysisContextFactory.contextWithCore();
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     _sourceFactory = _context.sourceFactory;
-    Source libA = _addSource(
-        "/libA.dart",
-        r'''
+    String libAContents = r'''
 library libA;
-import 'libB.dart';''');
-    Source libB =
-        _addSource("/libB.dart", "library libB;");
+import 'libB.dart';''';
+    Source libA = _addSource("/libA.dart", libAContents);
+    String libBContents = "library libB;";
+    Source libB = _addSource("/libB.dart", libBContents);
     _context.computeLibraryElement(libA);
     _context.computeErrors(libA);
     _context.computeErrors(libB);
     expect(_context.sourcesNeedingProcessing, hasLength(0));
     ChangeSet changeSet = new ChangeSet();
-    changeSet.removedContainer(
-        new _AnalysisContextImplTest_test_applyChanges_removeContainer(libB));
+    SourceContainer removedContainer =
+        new _AnalysisContextImplTest_test_applyChanges_removeContainer(libB);
+    changeSet.removedContainer(removedContainer);
     _context.applyChanges(changeSet);
     List<Source> sources = _context.sourcesNeedingProcessing;
     expect(sources, hasLength(1));
     expect(sources[0], same(libA));
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [libA]);
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [libB]);
+      listener.assertEvent(wereSourcesRemovedOrDeleted: true);
+      listener.assertNoMoreEvents();
+    });
   }
 
   void test_computeDocumentationComment_block() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
     String comment = "/** Comment */";
-    Source source =
-        _addSource("/test.dart", """
+    Source source = _addSource("/test.dart", """
 $comment
 class A {}""");
     LibraryElement libraryElement = _context.computeLibraryElement(source);
@@ -362,8 +482,7 @@
   void test_computeDocumentationComment_none() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source source =
-        _addSource("/test.dart", "class A {}");
+    Source source = _addSource("/test.dart", "class A {}");
     LibraryElement libraryElement = _context.computeLibraryElement(source);
     expect(libraryElement, isNotNull);
     ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
@@ -499,9 +618,7 @@
   }
 
   void test_computeLineInfo_dart() {
-    Source source = _addSource(
-        "/test.dart",
-        r'''
+    Source source = _addSource("/test.dart", r'''
 library lib;
 
 main() {}''');
@@ -510,9 +627,7 @@
   }
 
   void test_computeLineInfo_html() {
-    Source source = _addSource(
-        "/test.html",
-        r'''
+    Source source = _addSource("/test.html", r'''
 <html>
   <body>
     <h1>A</h1>
@@ -575,7 +690,9 @@
   }
 
   void test_exists_true() {
-    expect(_context.exists(new AnalysisContextImplTest_Source_exists_true()), isTrue);
+    expect(
+        _context.exists(new AnalysisContextImplTest_Source_exists_true()),
+        isTrue);
   }
 
   void test_getAnalysisOptions() {
@@ -626,9 +743,7 @@
   }
 
   void test_getElement_constructor_named() {
-    Source source = _addSource(
-        "/lib.dart",
-        r'''
+    Source source = _addSource("/lib.dart", r'''
 class A {
   A.named() {}
 }''');
@@ -642,9 +757,7 @@
   }
 
   void test_getElement_constructor_unnamed() {
-    Source source = _addSource(
-        "/lib.dart",
-        r'''
+    Source source = _addSource("/lib.dart", r'''
 class A {
   A() {}
 }''');
@@ -695,9 +808,7 @@
   }
 
   void test_getErrors_html_some() {
-    Source source = _addSource(
-        "/test.html",
-        r'''
+    Source source = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 </head></html>''');
@@ -727,9 +838,7 @@
   void test_getHtmlFilesReferencing_html() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource(
-        "/test.html",
-        r'''
+    Source htmlSource = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -745,9 +854,7 @@
   }
 
   void test_getHtmlFilesReferencing_library() {
-    Source htmlSource = _addSource(
-        "/test.html",
-        r'''
+    Source htmlSource = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -764,9 +871,7 @@
   void test_getHtmlFilesReferencing_part() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource(
-        "/test.html",
-        r'''
+    Source htmlSource = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -822,9 +927,7 @@
     _sourceFactory = _context.sourceFactory;
     List<Source> sources = _context.launchableClientLibrarySources;
     expect(sources, hasLength(0));
-    Source source = _addSource(
-        "/test.dart",
-        r'''
+    Source source = _addSource("/test.dart", r'''
 import 'dart:html';
 main() {}''');
     _context.computeLibraryElement(source);
@@ -846,9 +949,7 @@
   void test_getLibrariesContaining() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource(
-        "/lib.dart",
-        r'''
+    Source librarySource = _addSource("/lib.dart", r'''
 library lib;
 part 'part.dart';''');
     Source partSource = _addSource("/part.dart", "part of lib;");
@@ -866,15 +967,11 @@
     _sourceFactory = _context.sourceFactory;
     Source libASource = _addSource("/libA.dart", "library libA;");
     _addSource("/libB.dart", "library libB;");
-    Source lib1Source = _addSource(
-        "/lib1.dart",
-        r'''
+    Source lib1Source = _addSource("/lib1.dart", r'''
 library lib1;
 import 'libA.dart';
 export 'libB.dart';''');
-    Source lib2Source = _addSource(
-        "/lib2.dart",
-        r'''
+    Source lib2Source = _addSource("/lib2.dart", r'''
 library lib2;
 import 'libB.dart';
 export 'libA.dart';''');
@@ -887,9 +984,7 @@
   void test_getLibrariesReferencedFromHtml() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource(
-        "/test.html",
-        r'''
+    Source htmlSource = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -905,9 +1000,7 @@
   void test_getLibrariesReferencedFromHtml_no() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource(
-        "/test.html",
-        r'''
+    Source htmlSource = _addSource("/test.html", r'''
 <html><head>
 <script type='application/dart' src='test.js'/>
 </head></html>''');
@@ -944,9 +1037,7 @@
   }
 
   void test_getLineInfo() {
-    Source source = _addSource(
-        "/test.dart",
-        r'''
+    Source source = _addSource("/test.dart", r'''
 library lib;
 
 main() {}''');
@@ -959,8 +1050,10 @@
 
   void test_getModificationStamp_fromSource() {
     int stamp = 42;
-    expect(_context.getModificationStamp(
-            new AnalysisContextImplTest_Source_getModificationStamp_fromSource(stamp)), stamp);
+    expect(
+        _context.getModificationStamp(
+            new AnalysisContextImplTest_Source_getModificationStamp_fromSource(stamp)),
+        stamp);
   }
 
   void test_getModificationStamp_overridden() {
@@ -1060,9 +1153,7 @@
   void test_isClientLibrary_dart() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source source = _addSource(
-        "/test.dart",
-        r'''
+    Source source = _addSource("/test.dart", r'''
 import 'dart:html';
 
 main() {}''');
@@ -1081,9 +1172,7 @@
   void test_isServerLibrary_dart() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source source = _addSource(
-        "/test.dart",
-        r'''
+    Source source = _addSource("/test.dart", r'''
 library lib;
 
 main() {}''');
@@ -1148,14 +1237,10 @@
   }
 
   void test_parseHtmlUnit_resolveDirectives() {
-    Source libSource = _addSource(
-        "/lib.dart",
-        r'''
+    Source libSource = _addSource("/lib.dart", r'''
 library lib;
 class ClassA {}''');
-    Source source = _addSource(
-        "/lib.html",
-        r'''
+    Source source = _addSource("/lib.html", r'''
 <html>
 <head>
   <script type='application/dart'>
@@ -1177,6 +1262,338 @@
     expect(importNode.source, libSource);
   }
 
+  void test_performAnalysisTask_addPart() {
+    Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';''');
+    // run all tasks without part
+    _analyzeAll_assertFinished();
+    // add part and run all tasks
+    Source partSource = _addSource("/part.dart", r'''
+part of lib;
+''');
+    _analyzeAll_assertFinished();
+    // "libSource" should be here
+    List<Source> librariesWithPart =
+        _context.getLibrariesContaining(partSource);
+    expect(librariesWithPart, unorderedEquals([libSource]));
+  }
+
+  void test_performAnalysisTask_changeLibraryContents() {
+    Source libSource =
+        _addSource("/test.dart", "library lib; part 'test-part.dart';");
+    Source partSource = _addSource("/test-part.dart", "part of lib;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 1");
+    // update and analyze #1
+    _context.setContents(libSource, "library lib;");
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 2");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part resolved 2");
+    // update and analyze #2
+    _context.setContents(libSource, "library lib; part 'test-part.dart';");
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 3");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 3");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 3");
+  }
+
+  void test_performAnalysisTask_changeLibraryThenPartContents() {
+    Source libSource =
+        _addSource("/test.dart", "library lib; part 'test-part.dart';");
+    Source partSource = _addSource("/test-part.dart", "part of lib;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 1");
+    // update and analyze #1
+    _context.setContents(libSource, "library lib;");
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 2");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part resolved 2");
+    // update and analyze #2
+    _context.setContents(partSource, "part of lib; // 1");
+    // Assert that changing the part's content does not effect the library
+    // now that it is no longer part of that library
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library changed 3");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 3");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 3");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part resolved 3");
+  }
+
+  void test_performAnalysisTask_changePartContents_makeItAPart() {
+    Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';
+void f(x) {}''');
+    Source partSource = _addSource("/part.dart", "void g() { f(null); }");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 1");
+    // update and analyze
+    _context.setContents(partSource, r'''
+part of lib;
+void g() { f(null); }''');
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 2");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 2");
+    expect(_context.getErrors(libSource).errors, hasLength(0));
+    expect(_context.getErrors(partSource).errors, hasLength(0));
+  }
+
+  /**
+   * https://code.google.com/p/dart/issues/detail?id=12424
+   */
+  void test_performAnalysisTask_changePartContents_makeItNotPart() {
+    Source libSource = _addSource("/lib.dart", r'''
+library lib;
+part 'part.dart';
+void f(x) {}''');
+    Source partSource = _addSource("/part.dart", r'''
+part of lib;
+void g() { f(null); }''');
+    _analyzeAll_assertFinished();
+    expect(_context.getErrors(libSource).errors, hasLength(0));
+    expect(_context.getErrors(partSource).errors, hasLength(0));
+    // Remove 'part' directive, which should make "f(null)" an error.
+    _context.setContents(partSource, r'''
+//part of lib;
+void g() { f(null); }''');
+    _analyzeAll_assertFinished();
+    expect(_context.getErrors(libSource).errors.length != 0, isTrue);
+  }
+
+  void test_performAnalysisTask_changePartContents_noSemanticChanges() {
+    Source libSource =
+        _addSource("/test.dart", "library lib; part 'test-part.dart';");
+    Source partSource = _addSource("/test-part.dart", "part of lib;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 1");
+    // update and analyze #1
+    _context.setContents(partSource, "part of lib; // 1");
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 2");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 2");
+    // update and analyze #2
+    _context.setContents(partSource, "part of lib; // 12");
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNull,
+        reason: "library changed 3");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNull,
+        reason: "part changed 3");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libSource, libSource),
+        isNotNull,
+        reason: "library resolved 3");
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, libSource),
+        isNotNull,
+        reason: "part resolved 3");
+  }
+
+  void test_performAnalysisTask_importedLibraryAdd() {
+    Source libASource =
+        _addSource("/libA.dart", "library libA; import 'libB.dart';");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libASource, libASource),
+        isNotNull,
+        reason: "libA resolved 1");
+    expect(
+        _hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+        isTrue,
+        reason: "libA has an error");
+    // add libB.dart and analyze
+    Source libBSource = _addSource("/libB.dart", "library libB;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libASource, libASource),
+        isNotNull,
+        reason: "libA resolved 2");
+    expect(
+        _context.getResolvedCompilationUnit2(libBSource, libBSource),
+        isNotNull,
+        reason: "libB resolved 2");
+    expect(
+        !_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+        isTrue,
+        reason: "libA doesn't have errors");
+  }
+
+  void test_performAnalysisTask_importedLibraryAdd_html() {
+    Source htmlSource = _addSource("/page.html", r'''
+<html><body><script type="application/dart">
+  import '/libB.dart';
+  main() {print('hello dart');}
+</script></body></html>''');
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedHtmlUnit(htmlSource),
+        isNotNull,
+        reason: "htmlUnit resolved 1");
+    expect(
+        _hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
+        isTrue,
+        reason: "htmlSource has an error");
+    // add libB.dart and analyze
+    Source libBSource = _addSource("/libB.dart", "library libB;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedHtmlUnit(htmlSource),
+        isNotNull,
+        reason: "htmlUnit resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(libBSource, libBSource),
+        isNotNull,
+        reason: "libB resolved 2");
+    AnalysisErrorInfo errors = _context.getErrors(htmlSource);
+    expect(
+        !_hasAnalysisErrorWithErrorSeverity(errors),
+        isTrue,
+        reason: "htmlSource doesn't have errors");
+  }
+
+  void test_performAnalysisTask_importedLibraryDelete() {
+    Source libASource =
+        _addSource("/libA.dart", "library libA; import 'libB.dart';");
+    Source libBSource = _addSource("/libB.dart", "library libB;");
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libASource, libASource),
+        isNotNull,
+        reason: "libA resolved 1");
+    expect(
+        _context.getResolvedCompilationUnit2(libBSource, libBSource),
+        isNotNull,
+        reason: "libB resolved 1");
+    expect(
+        !_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+        isTrue,
+        reason: "libA doesn't have errors");
+    // remove libB.dart content and analyze
+    _context.setContents(libBSource, null);
+    _analyzeAll_assertFinished();
+    expect(
+        _context.getResolvedCompilationUnit2(libASource, libASource),
+        isNotNull,
+        reason: "libA resolved 2");
+    expect(
+        _hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
+        isTrue,
+        reason: "libA has an error");
+  }
+
   void test_performAnalysisTask_IOException() {
     TestSource source = _addSourceWithException2("/test.dart", "library test;");
     int oldTimestamp = _context.getModificationStamp(source);
@@ -1193,207 +1610,14 @@
     expect(source.readCount, 2);
   }
 
-  void test_performAnalysisTask_addPart() {
-    Source libSource = _addSource(
-        "/lib.dart",
-        r'''
-library lib;
-part 'part.dart';''');
-    // run all tasks without part
-    _analyzeAll_assertFinished();
-    // add part and run all tasks
-    Source partSource =
-        _addSource("/part.dart", r'''
-part of lib;
-''');
-    _analyzeAll_assertFinished();
-    // "libSource" should be here
-    List<Source> librariesWithPart =
-        _context.getLibrariesContaining(partSource);
-    expect(librariesWithPart, unorderedEquals([libSource]));
-  }
-
-  void test_performAnalysisTask_changeLibraryContents() {
-    Source libSource =
-        _addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = _addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 1");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 1");
-    // update and analyze #1
-    _context.setContents(libSource, "library lib;");
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part resolved 2");
-    // update and analyze #2
-    _context.setContents(libSource, "library lib; part 'test-part.dart';");
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 3");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_changeLibraryThenPartContents() {
-    Source libSource =
-        _addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = _addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 1");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 1");
-    // update and analyze #1
-    _context.setContents(libSource, "library lib;");
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part resolved 2");
-    // update and analyze #2
-    _context.setContents(partSource, "part of lib; // 1");
-    // Assert that changing the part's content does not effect the library
-    // now that it is no longer part of that library
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library changed 3");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 3");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_changePartContents_makeItAPart() {
-    Source libSource = _addSource(
-        "/lib.dart",
-        r'''
-library lib;
-part 'part.dart';
-void f(x) {}''');
-    Source partSource = _addSource(
-        "/part.dart",
-        "void g() { f(null); }");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 1");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 1");
-    // update and analyze
-    _context.setContents(
-        partSource,
-        r'''
-part of lib;
-void g() { f(null); }''');
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 2");
-    expect(_context.getErrors(libSource).errors, hasLength(0));
-    expect(_context.getErrors(partSource).errors, hasLength(0));
-  }
-
-  /**
-   * https://code.google.com/p/dart/issues/detail?id=12424
-   */
-  void test_performAnalysisTask_changePartContents_makeItNotPart() {
-    Source libSource = _addSource(
-        "/lib.dart",
-        r'''
-library lib;
-part 'part.dart';
-void f(x) {}''');
-    Source partSource = _addSource(
-        "/part.dart",
-        r'''
-part of lib;
-void g() { f(null); }''');
-    _analyzeAll_assertFinished();
-    expect(_context.getErrors(libSource).errors, hasLength(0));
-    expect(_context.getErrors(partSource).errors, hasLength(0));
-    // Remove 'part' directive, which should make "f(null)" an error.
-    _context.setContents(
-        partSource,
-        r'''
-//part of lib;
-void g() { f(null); }''');
-    _analyzeAll_assertFinished();
-    expect(_context.getErrors(libSource).errors.length != 0, isTrue);
-  }
-
-  void test_performAnalysisTask_changePartContents_noSemanticChanges() {
-    Source libSource =
-        _addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = _addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 1");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 1");
-    // update and analyze #1
-    _context.setContents(partSource, "part of lib; // 1");
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 2");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 2");
-    // update and analyze #2
-    _context.setContents(partSource, "part of lib; // 12");
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull, reason: "library changed 3");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNull, reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, reason: "library resolved 3");
-    expect(_context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_importedLibraryAdd() {
-    Source libASource =
-        _addSource("/libA.dart", "library libA; import 'libB.dart';");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libASource, libASource), isNotNull, reason: "libA resolved 1");
-    expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)), isTrue, reason: "libA has an error");
-    // add libB.dart and analyze
-    Source libBSource = _addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libASource, libASource), isNotNull, reason: "libA resolved 2");
-    expect(_context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull, reason: "libB resolved 2");
-    expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)), isTrue, reason: "libA doesn't have errors");
-  }
-
-  void test_performAnalysisTask_importedLibraryAdd_html() {
-    Source htmlSource = _addSource(
-        "/page.html",
-        r'''
-<html><body><script type="application/dart">
-  import '/libB.dart';
-  main() {print('hello dart');}
-</script></body></html>''');
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull, reason: "htmlUnit resolved 1");
-    expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)), isTrue, reason: "htmlSource has an error");
-    // add libB.dart and analyze
-    Source libBSource = _addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull, reason: "htmlUnit resolved 1");
-    expect(_context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull, reason: "libB resolved 2");
-    AnalysisErrorInfo errors = _context.getErrors(htmlSource);
-    expect(!_hasAnalysisErrorWithErrorSeverity(errors), isTrue, reason: "htmlSource doesn't have errors");
-  }
-
-  void test_performAnalysisTask_importedLibraryDelete() {
-    Source libASource =
-        _addSource("/libA.dart", "library libA; import 'libB.dart';");
-    Source libBSource = _addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libASource, libASource), isNotNull, reason: "libA resolved 1");
-    expect(_context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull, reason: "libB resolved 1");
-    expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)), isTrue, reason: "libA doesn't have errors");
-    // remove libB.dart content and analyze
-    _context.setContents(libBSource, null);
-    _analyzeAll_assertFinished();
-    expect(_context.getResolvedCompilationUnit2(libASource, libASource), isNotNull, reason: "libA resolved 2");
-    expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)), isTrue, reason: "libA has an error");
-  }
-
   void test_performAnalysisTask_missingPart() {
     Source source =
         _addSource("/test.dart", "library lib; part 'no-such-file.dart';");
     _analyzeAll_assertFinished();
-    expect(_context.getLibraryElement(source), isNotNull, reason: "performAnalysisTask failed to compute an element model");
+    expect(
+        _context.getLibraryElement(source),
+        isNotNull,
+        reason: "performAnalysisTask failed to compute an element model");
   }
 
   void test_performAnalysisTask_modifiedAfterParse() {
@@ -1525,21 +1749,22 @@
     _context.analysisPriorityOrder = sources;
   }
 
-  void test_setChangedContents_libraryWithPart() {
+  Future test_setChangedContents_libraryWithPart() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
     options.incremental = true;
     _context = AnalysisContextFactory.contextWithCoreAndOptions(options);
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     _sourceFactory = _context.sourceFactory;
     String oldCode = r'''
 library lib;
 part 'part.dart';
 int a = 0;''';
     Source librarySource = _addSource("/lib.dart", oldCode);
-    Source partSource = _addSource(
-        "/part.dart",
-        r'''
+    String partContents = r'''
 part of lib;
-int b = a;''');
+int b = a;''';
+    Source partSource = _addSource("/part.dart", partContents);
     LibraryElement element = _context.computeLibraryElement(librarySource);
     CompilationUnit unit =
         _context.getResolvedCompilationUnit(librarySource, element);
@@ -1556,8 +1781,18 @@
         _getIncrementalAnalysisCache(_context);
     expect(incrementalCache.librarySource, librarySource);
     expect(incrementalCache.resolvedUnit, same(unit));
-    expect(_context.getResolvedCompilationUnit2(partSource, librarySource), isNull);
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, librarySource),
+        isNull);
     expect(incrementalCache.newContents, newCode);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [partSource]);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertNoMoreEvents();
+    });
   }
 
   void test_setChangedContents_notResolved() {
@@ -1567,14 +1802,12 @@
     options.incremental = true;
     _context.analysisOptions = options;
     _sourceFactory = _context.sourceFactory;
-    String oldCode =
-        r'''
+    String oldCode = r'''
 library lib;
 int a = 0;''';
     Source librarySource = _addSource("/lib.dart", oldCode);
     int offset = oldCode.indexOf("int a") + 4;
-    String newCode =
-        r'''
+    String newCode = r'''
 library lib;
 int ya = 0;''';
     _context.setChangedContents(librarySource, newCode, offset, 0, 1);
@@ -1582,20 +1815,20 @@
     expect(_getIncrementalAnalysisCache(_context), isNull);
   }
 
-  void test_setContents_libraryWithPart() {
+  Future test_setContents_libraryWithPart() {
     _context = AnalysisContextFactory.contextWithCore();
+    SourcesChangedListener listener = new SourcesChangedListener();
+    _context.onSourcesChanged.listen(listener.onData);
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource(
-        "/lib.dart",
-        r'''
+    String libraryContents1 = r'''
 library lib;
 part 'part.dart';
-int a = 0;''');
-    Source partSource = _addSource(
-        "/part.dart",
-        r'''
+int a = 0;''';
+    Source librarySource = _addSource("/lib.dart", libraryContents1);
+    String partContents1 = r'''
 part of lib;
-int b = a;''');
+int b = a;''';
+    Source partSource = _addSource("/part.dart", partContents1);
     _context.computeLibraryElement(librarySource);
     IncrementalAnalysisCache incrementalCache = new IncrementalAnalysisCache(
         librarySource,
@@ -1608,22 +1841,29 @@
         0);
     _setIncrementalAnalysisCache(_context, incrementalCache);
     expect(_getIncrementalAnalysisCache(_context), same(incrementalCache));
-    _context.setContents(
-        librarySource,
-        r'''
+    String libraryContents2 = r'''
 library lib;
 part 'part.dart';
-int aa = 0;''');
-    expect(_context.getResolvedCompilationUnit2(partSource, librarySource), isNull);
+int aa = 0;''';
+    _context.setContents(librarySource, libraryContents2);
+    expect(
+        _context.getResolvedCompilationUnit2(partSource, librarySource),
+        isNull);
     expect(_getIncrementalAnalysisCache(_context), isNull);
+    return pumpEventQueue().then((_) {
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertEvent(wereSourcesAdded: true);
+      listener.assertEvent(changedSources: [partSource]);
+      listener.assertEvent(changedSources: [librarySource]);
+      listener.assertNoMoreEvents();
+    });
   }
 
   void test_setContents_null() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource(
-        "/lib.dart",
-        r'''
+    Source librarySource = _addSource("/lib.dart", r'''
 library lib;
 int a = 0;''');
     _context.computeLibraryElement(librarySource);
@@ -1639,7 +1879,9 @@
     _setIncrementalAnalysisCache(_context, incrementalCache);
     expect(_getIncrementalAnalysisCache(_context), same(incrementalCache));
     _context.setContents(librarySource, null);
-    expect(_context.getResolvedCompilationUnit2(librarySource, librarySource), isNull);
+    expect(
+        _context.getResolvedCompilationUnit2(librarySource, librarySource),
+        isNull);
     expect(_getIncrementalAnalysisCache(_context), isNull);
   }
 
@@ -1653,14 +1895,10 @@
   void test_unreadableSource() {
     _context = AnalysisContextFactory.contextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source test1 = _addSource(
-        "/test1.dart",
-        r'''
+    Source test1 = _addSource("/test1.dart", r'''
 import 'test2.dart';
 library test1;''');
-    Source test2 = _addSource(
-        "/test2.dart",
-        r'''
+    Source test2 = _addSource("/test2.dart", r'''
 import 'test1.dart';
 import 'test3.dart';
 library test2;''');
@@ -1712,7 +1950,8 @@
     }
     List<ChangeNotice> notice = _context.performAnalysisTask().changeNotices;
     if (notice != null) {
-      fail("performAnalysisTask failed to terminate after analyzing all sources");
+      fail(
+          "performAnalysisTask failed to terminate after analyzing all sources");
     }
   }
 
@@ -1922,7 +2161,9 @@
 
   void test_getEnableDeferredLoading() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    expect(options.enableDeferredLoading, AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING);
+    expect(
+        options.enableDeferredLoading,
+        AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LOADING);
     bool value = !options.enableDeferredLoading;
     options.enableDeferredLoading = value;
     expect(options.enableDeferredLoading, value);
@@ -1966,16 +2207,6 @@
 }
 
 
-class AnalysisTaskTest extends EngineTestCase {
-  void test_perform_exception() {
-    InternalAnalysisContext context = new AnalysisContextImpl();
-    context.sourceFactory = new SourceFactory([new FileUriResolver()]);
-    AnalysisTask task = new AnalysisTask_test_perform_exception(context);
-    task.perform(new TestTaskVisitor<Object>());
-  }
-}
-
-
 class AnalysisTask_test_perform_exception extends AnalysisTask {
   AnalysisTask_test_perform_exception(InternalAnalysisContext arg0)
       : super(arg0);
@@ -1993,6 +2224,16 @@
 }
 
 
+class AnalysisTaskTest extends EngineTestCase {
+  void test_perform_exception() {
+    InternalAnalysisContext context = new AnalysisContextImpl();
+    context.sourceFactory = new SourceFactory([new FileUriResolver()]);
+    AnalysisTask task = new AnalysisTask_test_perform_exception(context);
+    task.perform(new TestTaskVisitor<Object>());
+  }
+}
+
+
 class CompilationUnitMock extends TypedMock implements CompilationUnit {
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
@@ -2006,9 +2247,7 @@
     entry.setValue(
         DartEntry.SCAN_ERRORS,
         <AnalysisError>[
-            new AnalysisError.con1(
-                source,
-                ScannerErrorCode.UNTERMINATED_STRING_LITERAL)]);
+            new AnalysisError.con1(source, ScannerErrorCode.UNTERMINATED_STRING_LITERAL)]);
     entry.setValue(
         DartEntry.PARSE_ERRORS,
         <AnalysisError>[
@@ -2024,9 +2263,7 @@
         DartEntry.VERIFICATION_ERRORS,
         source,
         <AnalysisError>[
-            new AnalysisError.con1(
-                source,
-                StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)]);
+            new AnalysisError.con1(source, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)]);
     entry.setValueInLibrary(
         DartEntry.ANGULAR_ERRORS,
         source,
@@ -2043,27 +2280,49 @@
     DartEntry entry = new DartEntry();
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.INVALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSE_ERRORS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSED_UNIT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.PUBLIC_NAMESPACE), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.PUBLIC_NAMESPACE),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SCAN_ERRORS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.INVALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource), same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource),
+        same(CacheState.INVALID));
   }
 
   void test_getResolvableCompilationUnit_none() {
@@ -2081,8 +2340,7 @@
     importDirective.uriContent = importUri;
     String exportUri = "/f2.dart";
     Source exportSource = new TestSource(exportUri);
-    ExportDirective exportDirective =
-        AstFactory.exportDirective2(exportUri);
+    ExportDirective exportDirective = AstFactory.exportDirective2(exportUri);
     exportDirective.source = exportSource;
     exportDirective.uriContent = exportUri;
     String partUri = "/f3.dart";
@@ -2128,8 +2386,7 @@
     importDirective.uriContent = importUri;
     String exportUri = "f2.dart";
     Source exportSource = new TestSource(exportUri);
-    ExportDirective exportDirective =
-        AstFactory.exportDirective2(exportUri);
+    ExportDirective exportDirective = AstFactory.exportDirective2(exportUri);
     exportDirective.source = exportSource;
     exportDirective.uriContent = exportUri;
     String partUri = "f3.dart";
@@ -2158,16 +2415,6 @@
     expect(resultPartDirective.source, same(partSource));
   }
 
-  void test_getStateInLibrary_invalid_element() {
-    DartEntry entry = new DartEntry();
-    try {
-      entry.getStateInLibrary(DartEntry.ELEMENT, new TestSource());
-      fail("Expected IllegalArgumentException for ELEMENT");
-    } on ArgumentError catch (exception) {
-      // Expected
-    }
-  }
-
   void test_getState_invalid_resolutionErrors() {
     DartEntry entry = new DartEntry();
     try {
@@ -2188,6 +2435,16 @@
     }
   }
 
+  void test_getStateInLibrary_invalid_element() {
+    DartEntry entry = new DartEntry();
+    try {
+      entry.getStateInLibrary(DartEntry.ELEMENT, new TestSource());
+      fail("Expected IllegalArgumentException for ELEMENT");
+    } on ArgumentError catch (exception) {
+      // Expected
+    }
+  }
+
   void test_getValue_containingLibraries() {
     Source testSource = new TestSource();
     DartEntry entry = new DartEntry();
@@ -2202,6 +2459,25 @@
     expect(value, hasLength(0));
   }
 
+  void test_getValue_invalid_resolutionErrors() {
+    DartEntry entry = new DartEntry();
+    try {
+      entry.getValue(DartEntry.RESOLUTION_ERRORS);
+      fail("Expected IllegalArgumentException for RESOLUTION_ERRORS");
+    } on ArgumentError catch (exception) {
+    }
+  }
+
+  void test_getValue_invalid_verificationErrors() {
+    DartEntry entry = new DartEntry();
+    try {
+      entry.getValue(DartEntry.VERIFICATION_ERRORS);
+      fail("Expected IllegalArgumentException for VERIFICATION_ERRORS");
+    } on ArgumentError catch (exception) {
+      // Expected
+    }
+  }
+
   void test_getValueInLibrary_invalid_element() {
     DartEntry entry = new DartEntry();
     try {
@@ -2237,25 +2513,6 @@
     }
   }
 
-  void test_getValue_invalid_resolutionErrors() {
-    DartEntry entry = new DartEntry();
-    try {
-      entry.getValue(DartEntry.RESOLUTION_ERRORS);
-      fail("Expected IllegalArgumentException for RESOLUTION_ERRORS");
-    } on ArgumentError catch (exception) {
-    }
-  }
-
-  void test_getValue_invalid_verificationErrors() {
-    DartEntry entry = new DartEntry();
-    try {
-      entry.getValue(DartEntry.VERIFICATION_ERRORS);
-      fail("Expected IllegalArgumentException for VERIFICATION_ERRORS");
-    } on ArgumentError catch (exception) {
-      // Expected
-    }
-  }
-
   void test_hasInvalidData_false() {
     DartEntry entry = new DartEntry();
     entry.recordScanError(new CaughtException(new AnalysisException(), null));
@@ -2301,27 +2558,49 @@
     entry.invalidateAllInformation();
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.INVALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSE_ERRORS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSED_UNIT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.PUBLIC_NAMESPACE), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.PUBLIC_NAMESPACE),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SCAN_ERRORS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.INVALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource), same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource),
+        same(CacheState.INVALID));
   }
 
   void test_invalidateAllResolutionInformation() {
@@ -2330,27 +2609,49 @@
     entry.invalidateAllResolutionInformation(false);
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSE_ERRORS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.PARSED_UNIT), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.PUBLIC_NAMESPACE), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.PUBLIC_NAMESPACE),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SCAN_ERRORS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource), same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource),
+        same(CacheState.INVALID));
   }
 
   void test_invalidateAllResolutionInformation_includingUris() {
@@ -2359,27 +2660,49 @@
     entry.invalidateAllResolutionInformation(true);
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.INVALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.INVALID));
     expect(entry.getState(DartEntry.PARSE_ERRORS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.PARSED_UNIT), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.PUBLIC_NAMESPACE), same(CacheState.INVALID));
+    expect(
+        entry.getState(DartEntry.PUBLIC_NAMESPACE),
+        same(CacheState.INVALID));
     expect(entry.getState(DartEntry.SCAN_ERRORS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource), same(CacheState.INVALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource), same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource),
+        same(CacheState.INVALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, librarySource),
+        same(CacheState.INVALID));
   }
 
   void test_isClient() {
@@ -2421,10 +2744,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2435,21 +2764,49 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary), same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
   }
 
   void test_recordContentError() {
@@ -2460,10 +2817,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.ERROR));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.ERROR));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2474,13 +2837,27 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.ERROR));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
     // The following lines are commented out because we don't currently have
     // any way of setting the state for data associated with a library we
@@ -2503,10 +2880,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.VALID));
@@ -2517,21 +2900,49 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary), same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
   }
 
   void test_recordParseError() {
@@ -2541,10 +2952,16 @@
     entry.recordParseError(new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.ERROR));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2555,13 +2972,27 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
     // The following lines are commented out because we don't currently have
     // any way of setting the state for data associated with a library we
@@ -2583,10 +3014,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2597,13 +3034,27 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
     // The following lines are commented out because we don't currently have
     // any way of setting the state for data associated with a library we
@@ -2626,10 +3077,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2640,21 +3097,49 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary), same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
   }
 
   void test_recordScanError() {
@@ -2664,10 +3149,16 @@
     entry.recordScanError(new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.ERROR));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.ERROR));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.ERROR));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.ERROR));
@@ -2678,13 +3169,27 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.ERROR));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.ERROR));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
     // The following lines are commented out because we don't currently have
     // any way of setting the state for data associated with a library we
@@ -2707,10 +3212,16 @@
         new CaughtException(new AnalysisException(), null));
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.VALID));
@@ -2721,21 +3232,49 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.ERROR));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+        same(CacheState.ERROR));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+        same(CacheState.ERROR));
 
-    expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.HINTS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary), same(CacheState.VALID));
-    expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary), same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.HINTS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary),
+        same(CacheState.VALID));
+    expect(
+        entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary),
+        same(CacheState.VALID));
   }
 
   void test_removeResolution_multiple_first() {
@@ -2811,7 +3350,8 @@
   void test_resolvableCompilationUnit_builtUnit() {
     Source librarySource = new TestSource('/lib.dart');
     CompilationUnit unit = AstFactory.compilationUnit();
-    CompilationUnitElement element = ElementFactory.compilationUnit('test.dart');
+    CompilationUnitElement element =
+        ElementFactory.compilationUnit('test.dart');
     unit.element = element;
     DartEntry entry = new DartEntry();
     entry.setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
@@ -2839,7 +3379,8 @@
   void test_resolvableCompilationUnit_resolved() {
     Source librarySource = new TestSource('/lib.dart');
     CompilationUnit unit = AstFactory.compilationUnit();
-    CompilationUnitElement element = ElementFactory.compilationUnit('test.dart');
+    CompilationUnitElement element =
+        ElementFactory.compilationUnit('test.dart');
     unit.element = element;
     DartEntry entry = new DartEntry();
     entry.setState(DartEntry.PARSED_UNIT, CacheState.FLUSHED);
@@ -2907,8 +3448,8 @@
       fail("Expected IllegalArgumentException for VERIFICATION_ERRORS");
     } on ArgumentError catch (exception) {
       // Expected
-     }
-   }
+    }
+  }
 
   void test_setState_isClient() {
     _setState(DartEntry.IS_CLIENT);
@@ -2922,14 +3463,14 @@
     _setState(SourceEntry.LINE_INFO);
   }
 
-  void test_setState_parseErrors() {
-    _setState(DartEntry.PARSE_ERRORS);
-  }
-
   void test_setState_parsedUnit() {
     _setState(DartEntry.PARSED_UNIT);
   }
 
+  void test_setState_parseErrors() {
+    _setState(DartEntry.PARSE_ERRORS);
+  }
+
   void test_setState_publicNamespace() {
     _setState(DartEntry.PUBLIC_NAMESPACE);
   }
@@ -2994,6 +3535,10 @@
     _setValue(SourceEntry.LINE_INFO, new LineInfo(<int>[0]));
   }
 
+  void test_setValue_parsedUnit() {
+    _setValue(DartEntry.PARSED_UNIT, AstFactory.compilationUnit());
+  }
+
   void test_setValue_parseErrors() {
     _setValue(
         DartEntry.PARSE_ERRORS,
@@ -3001,10 +3546,6 @@
             new AnalysisError.con1(null, ParserErrorCode.ABSTRACT_CLASS_MEMBER)]);
   }
 
-  void test_setValue_parsedUnit() {
-    _setValue(DartEntry.PARSED_UNIT, AstFactory.compilationUnit());
-  }
-
   void test_setValue_publicNamespace() {
     _setValue(
         DartEntry.PUBLIC_NAMESPACE,
@@ -3072,7 +3613,10 @@
       entry.setValueInLibrary(DartEntry.HINTS, firstLibrary, null);
       entry.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary, null);
       entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary, null);
-      entry.setValueInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary, null);
+      entry.setValueInLibrary(
+          DartEntry.VERIFICATION_ERRORS,
+          firstLibrary,
+          null);
     }
     if (secondLibrary != null) {
       entry.setValueInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary, null);
@@ -3081,17 +3625,26 @@
       entry.setValueInLibrary(DartEntry.HINTS, secondLibrary, null);
       entry.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary, null);
       entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary, null);
-      entry.setValueInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary, null);
+      entry.setValueInLibrary(
+          DartEntry.VERIFICATION_ERRORS,
+          secondLibrary,
+          null);
     }
     //
     // Validate that the state was set correctly.
     //
     expect(entry.getState(SourceEntry.CONTENT), same(CacheState.VALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.CONTAINING_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.CONTAINING_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.ELEMENT), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.EXPORTED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(DartEntry.IMPORTED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.EXPORTED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(DartEntry.IMPORTED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(DartEntry.INCLUDED_PARTS), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_CLIENT), same(CacheState.VALID));
     expect(entry.getState(DartEntry.IS_LAUNCHABLE), same(CacheState.VALID));
@@ -3102,22 +3655,50 @@
     expect(entry.getState(DartEntry.SOURCE_KIND), same(CacheState.VALID));
     expect(entry.getState(DartEntry.TOKEN_STREAM), same(CacheState.VALID));
     if (firstLibrary != null) {
-      expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.HINTS, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary), same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.BUILT_UNIT, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.HINTS, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, firstLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, firstLibrary),
+          same(CacheState.VALID));
     }
     if (secondLibrary != null) {
-      expect(entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.HINTS, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary), same(CacheState.VALID));
-      expect(entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary), same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.ANGULAR_ERRORS, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.BUILT_ELEMENT, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.BUILT_UNIT, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.HINTS, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.RESOLUTION_ERRORS, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.RESOLVED_UNIT, secondLibrary),
+          same(CacheState.VALID));
+      expect(
+          entry.getStateInLibrary(DartEntry.VERIFICATION_ERRORS, secondLibrary),
+          same(CacheState.VALID));
     }
     return entry;
   }
@@ -3132,9 +3713,13 @@
   void _setStateInLibrary(DataDescriptor descriptor) {
     Source source = new TestSource();
     DartEntry entry = new DartEntry();
-    expect(entry.getStateInLibrary(descriptor, source), isNot(same(CacheState.FLUSHED)));
+    expect(
+        entry.getStateInLibrary(descriptor, source),
+        isNot(same(CacheState.FLUSHED)));
     entry.setStateInLibrary(descriptor, source, CacheState.FLUSHED);
-    expect(entry.getStateInLibrary(descriptor, source), same(CacheState.FLUSHED));
+    expect(
+        entry.getStateInLibrary(descriptor, source),
+        same(CacheState.FLUSHED));
   }
 
   void _setValue(DataDescriptor descriptor, Object newValue) {
@@ -3194,9 +3779,7 @@
     ChangeSet changeSet = new ChangeSet();
     changeSet.addedSource(source);
     context.applyChanges(changeSet);
-    context.setContents(
-        source,
-        r'''
+    context.setContents(source, r'''
 library lib;
 class A {
   int f = new A();
@@ -3204,11 +3787,8 @@
     LibraryElement libraryElement = context.computeLibraryElement(source);
     CompilationUnit unit =
         context.getResolvedCompilationUnit(source, libraryElement);
-    GenerateDartErrorsTask task = new GenerateDartErrorsTask(
-        context,
-        source,
-        unit,
-        libraryElement);
+    GenerateDartErrorsTask task =
+        new GenerateDartErrorsTask(context, source, unit, libraryElement);
     task.perform(
         new GenerateDartErrorsTaskTestTV_perform(libraryElement, source));
   }
@@ -3227,20 +3807,15 @@
 //        "export '\${a}lib3.dart';",
 //        "part '/does/not/exist.dart';",
 //        "class A {}"]));
-    context.setContents(
-        source,
-        r'''
+    context.setContents(source, r'''
 library lib;
 part '/does/not/exist.dart';
 class A {}''');
     LibraryElement libraryElement = context.computeLibraryElement(source);
     CompilationUnit unit =
         context.getResolvedCompilationUnit(source, libraryElement);
-    GenerateDartErrorsTask task = new GenerateDartErrorsTask(
-        context,
-        source,
-        unit,
-        libraryElement);
+    GenerateDartErrorsTask task =
+        new GenerateDartErrorsTask(context, source, unit, libraryElement);
     task.perform(
         new GenerateDartErrorsTaskTestTV_perform_validateDirectives(
             libraryElement,
@@ -3328,18 +3903,12 @@
         new FileBasedSource.con1(FileUtilities2.createFile("/part.dart"));
     changeSet.addedSource(partSource);
     context.applyChanges(changeSet);
-    context.setContents(
-        librarySource,
-        r'''
+    context.setContents(librarySource, r'''
 library lib;
 import 'unused.dart';
 part 'part.dart';''');
-    context.setContents(
-        unusedSource,
-        "library unused;");
-    context.setContents(
-        partSource,
-        "part of lib;");
+    context.setContents(unusedSource, "library unused;");
+    context.setContents(partSource, "part of lib;");
     List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(2);
     units[0] = new TimestampedData<CompilationUnit>(
         context.getModificationStamp(librarySource),
@@ -3505,37 +4074,57 @@
   void test_invalidateAllResolutionInformation() {
     HtmlEntry entry = _entryWithValidState();
     entry.invalidateAllResolutionInformation(false);
-    expect(entry.getState(HtmlEntry.ANGULAR_APPLICATION), same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.ANGULAR_APPLICATION),
+        same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.ANGULAR_COMPONENT), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.ANGULAR_ENTRY), same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.ANGULAR_ERRORS), same(CacheState.INVALID));
-    expect(entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS), same(CacheState.INVALID));
-    expect(entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS), same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
+        same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.ELEMENT), same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.HINTS), same(CacheState.INVALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSE_ERRORS), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSED_UNIT), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.REFERENCED_LIBRARIES), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.RESOLUTION_ERRORS), same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.REFERENCED_LIBRARIES),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.RESOLUTION_ERRORS),
+        same(CacheState.INVALID));
   }
 
   void test_invalidateAllResolutionInformation_includingUris() {
     HtmlEntry entry = _entryWithValidState();
     entry.invalidateAllResolutionInformation(true);
-    expect(entry.getState(HtmlEntry.ANGULAR_APPLICATION), same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.ANGULAR_APPLICATION),
+        same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.ANGULAR_COMPONENT), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.ANGULAR_ENTRY), same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.ANGULAR_ERRORS), same(CacheState.INVALID));
-    expect(entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS), same(CacheState.INVALID));
-    expect(entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS), same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
+        same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.ELEMENT), same(CacheState.INVALID));
     expect(entry.getState(HtmlEntry.HINTS), same(CacheState.INVALID));
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSE_ERRORS), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSED_UNIT), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.REFERENCED_LIBRARIES), same(CacheState.INVALID));
-    expect(entry.getState(HtmlEntry.RESOLUTION_ERRORS), same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.REFERENCED_LIBRARIES),
+        same(CacheState.INVALID));
+    expect(
+        entry.getState(HtmlEntry.RESOLUTION_ERRORS),
+        same(CacheState.INVALID));
   }
 
   void test_setState_angularErrors() {
@@ -3554,14 +4143,14 @@
     state = SourceEntry.LINE_INFO;
   }
 
-  void test_setState_parseErrors() {
-    state = HtmlEntry.PARSE_ERRORS;
-  }
-
   void test_setState_parsedUnit() {
     state = HtmlEntry.PARSED_UNIT;
   }
 
+  void test_setState_parseErrors() {
+    state = HtmlEntry.PARSE_ERRORS;
+  }
+
   void test_setState_polymerBuildErrors() {
     state = HtmlEntry.POLYMER_BUILD_ERRORS;
   }
@@ -3608,6 +4197,10 @@
     _setValue(SourceEntry.LINE_INFO, new LineInfo(<int>[0]));
   }
 
+  void test_setValue_parsedUnit() {
+    _setValue(HtmlEntry.PARSED_UNIT, new ht.HtmlUnit(null, null, null));
+  }
+
   void test_setValue_parseErrors() {
     _setValue(
         HtmlEntry.PARSE_ERRORS,
@@ -3615,10 +4208,6 @@
             new AnalysisError.con1(null, HtmlWarningCode.INVALID_URI, ["-"])]);
   }
 
-  void test_setValue_parsedUnit() {
-    _setValue(HtmlEntry.PARSED_UNIT, new ht.HtmlUnit(null, null, null));
-  }
-
   void test_setValue_polymerBuildErrors() {
     _setValue(
         HtmlEntry.POLYMER_BUILD_ERRORS,
@@ -3664,9 +4253,15 @@
     expect(entry.getState(SourceEntry.LINE_INFO), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSE_ERRORS), same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.PARSED_UNIT), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS), same(CacheState.VALID));
-    expect(entry.getState(HtmlEntry.REFERENCED_LIBRARIES), same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_BUILD_ERRORS),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.POLYMER_RESOLUTION_ERRORS),
+        same(CacheState.VALID));
+    expect(
+        entry.getState(HtmlEntry.REFERENCED_LIBRARIES),
+        same(CacheState.VALID));
     expect(entry.getState(HtmlEntry.RESOLUTION_ERRORS), same(CacheState.VALID));
     return entry;
   }
@@ -4284,7 +4879,8 @@
 
 class InstrumentedAnalysisContextImplTest extends EngineTestCase {
   void test_addSourceInfo() {
-    TestAnalysisContext_test_addSourceInfo innerContext = new TestAnalysisContext_test_addSourceInfo();
+    TestAnalysisContext_test_addSourceInfo innerContext =
+        new TestAnalysisContext_test_addSourceInfo();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.addSourceInfo(null, null);
@@ -4292,7 +4888,8 @@
   }
 
   void test_applyChanges() {
-    TestAnalysisContext_test_applyChanges innerContext = new TestAnalysisContext_test_applyChanges();
+    TestAnalysisContext_test_applyChanges innerContext =
+        new TestAnalysisContext_test_applyChanges();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.applyChanges(null);
@@ -4300,7 +4897,8 @@
   }
 
   void test_computeDocumentationComment() {
-    TestAnalysisContext_test_computeDocumentationComment innerContext = new TestAnalysisContext_test_computeDocumentationComment();
+    TestAnalysisContext_test_computeDocumentationComment innerContext =
+        new TestAnalysisContext_test_computeDocumentationComment();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeDocumentationComment(null);
@@ -4308,7 +4906,8 @@
   }
 
   void test_computeErrors() {
-    TestAnalysisContext_test_computeErrors innerContext = new TestAnalysisContext_test_computeErrors();
+    TestAnalysisContext_test_computeErrors innerContext =
+        new TestAnalysisContext_test_computeErrors();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeErrors(null);
@@ -4316,7 +4915,8 @@
   }
 
   void test_computeExportedLibraries() {
-    TestAnalysisContext_test_computeExportedLibraries innerContext = new TestAnalysisContext_test_computeExportedLibraries();
+    TestAnalysisContext_test_computeExportedLibraries innerContext =
+        new TestAnalysisContext_test_computeExportedLibraries();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeExportedLibraries(null);
@@ -4324,7 +4924,8 @@
   }
 
   void test_computeHtmlElement() {
-    TestAnalysisContext_test_computeHtmlElement innerContext = new TestAnalysisContext_test_computeHtmlElement();
+    TestAnalysisContext_test_computeHtmlElement innerContext =
+        new TestAnalysisContext_test_computeHtmlElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeHtmlElement(null);
@@ -4332,7 +4933,8 @@
   }
 
   void test_computeImportedLibraries() {
-    TestAnalysisContext_test_computeImportedLibraries innerContext = new TestAnalysisContext_test_computeImportedLibraries();
+    TestAnalysisContext_test_computeImportedLibraries innerContext =
+        new TestAnalysisContext_test_computeImportedLibraries();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeImportedLibraries(null);
@@ -4340,7 +4942,8 @@
   }
 
   void test_computeKindOf() {
-    TestAnalysisContext_test_computeKindOf innerContext = new TestAnalysisContext_test_computeKindOf();
+    TestAnalysisContext_test_computeKindOf innerContext =
+        new TestAnalysisContext_test_computeKindOf();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeKindOf(null);
@@ -4348,7 +4951,8 @@
   }
 
   void test_computeLibraryElement() {
-    TestAnalysisContext_test_computeLibraryElement innerContext = new TestAnalysisContext_test_computeLibraryElement();
+    TestAnalysisContext_test_computeLibraryElement innerContext =
+        new TestAnalysisContext_test_computeLibraryElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeLibraryElement(null);
@@ -4356,7 +4960,8 @@
   }
 
   void test_computeLineInfo() {
-    TestAnalysisContext_test_computeLineInfo innerContext = new TestAnalysisContext_test_computeLineInfo();
+    TestAnalysisContext_test_computeLineInfo innerContext =
+        new TestAnalysisContext_test_computeLineInfo();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeLineInfo(null);
@@ -4364,7 +4969,8 @@
   }
 
   void test_computeResolvableCompilationUnit() {
-    TestAnalysisContext_test_computeResolvableCompilationUnit innerContext = new TestAnalysisContext_test_computeResolvableCompilationUnit();
+    TestAnalysisContext_test_computeResolvableCompilationUnit innerContext =
+        new TestAnalysisContext_test_computeResolvableCompilationUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.computeResolvableCompilationUnit(null);
@@ -4376,7 +4982,8 @@
   }
 
   void test_dispose() {
-    TestAnalysisContext_test_dispose innerContext = new TestAnalysisContext_test_dispose();
+    TestAnalysisContext_test_dispose innerContext =
+        new TestAnalysisContext_test_dispose();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.dispose();
@@ -4384,7 +4991,8 @@
   }
 
   void test_exists() {
-    TestAnalysisContext_test_exists innerContext = new TestAnalysisContext_test_exists();
+    TestAnalysisContext_test_exists innerContext =
+        new TestAnalysisContext_test_exists();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.exists(null);
@@ -4392,7 +5000,8 @@
   }
 
   void test_getAnalysisOptions() {
-    TestAnalysisContext_test_getAnalysisOptions innerContext = new TestAnalysisContext_test_getAnalysisOptions();
+    TestAnalysisContext_test_getAnalysisOptions innerContext =
+        new TestAnalysisContext_test_getAnalysisOptions();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.analysisOptions;
@@ -4400,7 +5009,8 @@
   }
 
   void test_getAngularApplicationWithHtml() {
-    TestAnalysisContext_test_getAngularApplicationWithHtml innerContext = new TestAnalysisContext_test_getAngularApplicationWithHtml();
+    TestAnalysisContext_test_getAngularApplicationWithHtml innerContext =
+        new TestAnalysisContext_test_getAngularApplicationWithHtml();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getAngularApplicationWithHtml(null);
@@ -4408,7 +5018,8 @@
   }
 
   void test_getCompilationUnitElement() {
-    TestAnalysisContext_test_getCompilationUnitElement innerContext = new TestAnalysisContext_test_getCompilationUnitElement();
+    TestAnalysisContext_test_getCompilationUnitElement innerContext =
+        new TestAnalysisContext_test_getCompilationUnitElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getCompilationUnitElement(null, null);
@@ -4416,7 +5027,8 @@
   }
 
   void test_getContents() {
-    TestAnalysisContext_test_getContents innerContext = new TestAnalysisContext_test_getContents();
+    TestAnalysisContext_test_getContents innerContext =
+        new TestAnalysisContext_test_getContents();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getContents(null);
@@ -4432,7 +5044,8 @@
 //  }
 
   void test_getElement() {
-    TestAnalysisContext_test_getElement innerContext = new TestAnalysisContext_test_getElement();
+    TestAnalysisContext_test_getElement innerContext =
+        new TestAnalysisContext_test_getElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getElement(null);
@@ -4440,7 +5053,8 @@
   }
 
   void test_getErrors() {
-    TestAnalysisContext_test_getErrors innerContext = new TestAnalysisContext_test_getErrors();
+    TestAnalysisContext_test_getErrors innerContext =
+        new TestAnalysisContext_test_getErrors();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getErrors(null);
@@ -4448,7 +5062,8 @@
   }
 
   void test_getHtmlElement() {
-    TestAnalysisContext_test_getHtmlElement innerContext = new TestAnalysisContext_test_getHtmlElement();
+    TestAnalysisContext_test_getHtmlElement innerContext =
+        new TestAnalysisContext_test_getHtmlElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getHtmlElement(null);
@@ -4456,7 +5071,8 @@
   }
 
   void test_getHtmlFilesReferencing() {
-    TestAnalysisContext_test_getHtmlFilesReferencing innerContext = new TestAnalysisContext_test_getHtmlFilesReferencing();
+    TestAnalysisContext_test_getHtmlFilesReferencing innerContext =
+        new TestAnalysisContext_test_getHtmlFilesReferencing();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getHtmlFilesReferencing(null);
@@ -4464,7 +5080,8 @@
   }
 
   void test_getHtmlSources() {
-    TestAnalysisContext_test_getHtmlSources innerContext = new TestAnalysisContext_test_getHtmlSources();
+    TestAnalysisContext_test_getHtmlSources innerContext =
+        new TestAnalysisContext_test_getHtmlSources();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.htmlSources;
@@ -4472,7 +5089,8 @@
   }
 
   void test_getKindOf() {
-    TestAnalysisContext_test_getKindOf innerContext = new TestAnalysisContext_test_getKindOf();
+    TestAnalysisContext_test_getKindOf innerContext =
+        new TestAnalysisContext_test_getKindOf();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getKindOf(null);
@@ -4480,7 +5098,8 @@
   }
 
   void test_getLaunchableClientLibrarySources() {
-    TestAnalysisContext_test_getLaunchableClientLibrarySources innerContext = new TestAnalysisContext_test_getLaunchableClientLibrarySources();
+    TestAnalysisContext_test_getLaunchableClientLibrarySources innerContext =
+        new TestAnalysisContext_test_getLaunchableClientLibrarySources();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.launchableClientLibrarySources;
@@ -4488,7 +5107,8 @@
   }
 
   void test_getLaunchableServerLibrarySources() {
-    TestAnalysisContext_test_getLaunchableServerLibrarySources innerContext = new TestAnalysisContext_test_getLaunchableServerLibrarySources();
+    TestAnalysisContext_test_getLaunchableServerLibrarySources innerContext =
+        new TestAnalysisContext_test_getLaunchableServerLibrarySources();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.launchableServerLibrarySources;
@@ -4496,7 +5116,8 @@
   }
 
   void test_getLibrariesContaining() {
-    TestAnalysisContext_test_getLibrariesContaining innerContext = new TestAnalysisContext_test_getLibrariesContaining();
+    TestAnalysisContext_test_getLibrariesContaining innerContext =
+        new TestAnalysisContext_test_getLibrariesContaining();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getLibrariesContaining(null);
@@ -4504,7 +5125,8 @@
   }
 
   void test_getLibrariesDependingOn() {
-    TestAnalysisContext_test_getLibrariesDependingOn innerContext = new TestAnalysisContext_test_getLibrariesDependingOn();
+    TestAnalysisContext_test_getLibrariesDependingOn innerContext =
+        new TestAnalysisContext_test_getLibrariesDependingOn();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getLibrariesDependingOn(null);
@@ -4512,7 +5134,8 @@
   }
 
   void test_getLibrariesReferencedFromHtml() {
-    TestAnalysisContext_test_getLibrariesReferencedFromHtml innerContext = new TestAnalysisContext_test_getLibrariesReferencedFromHtml();
+    TestAnalysisContext_test_getLibrariesReferencedFromHtml innerContext =
+        new TestAnalysisContext_test_getLibrariesReferencedFromHtml();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getLibrariesReferencedFromHtml(null);
@@ -4520,7 +5143,8 @@
   }
 
   void test_getLibraryElement() {
-    TestAnalysisContext_test_getLibraryElement innerContext = new TestAnalysisContext_test_getLibraryElement();
+    TestAnalysisContext_test_getLibraryElement innerContext =
+        new TestAnalysisContext_test_getLibraryElement();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getLibraryElement(null);
@@ -4528,7 +5152,8 @@
   }
 
   void test_getLibrarySources() {
-    TestAnalysisContext_test_getLibrarySources innerContext = new TestAnalysisContext_test_getLibrarySources();
+    TestAnalysisContext_test_getLibrarySources innerContext =
+        new TestAnalysisContext_test_getLibrarySources();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.librarySources;
@@ -4536,7 +5161,8 @@
   }
 
   void test_getLineInfo() {
-    TestAnalysisContext_test_getLineInfo innerContext = new TestAnalysisContext_test_getLineInfo();
+    TestAnalysisContext_test_getLineInfo innerContext =
+        new TestAnalysisContext_test_getLineInfo();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getLineInfo(null);
@@ -4544,7 +5170,8 @@
   }
 
   void test_getModificationStamp() {
-    TestAnalysisContext_test_getModificationStamp innerContext = new TestAnalysisContext_test_getModificationStamp();
+    TestAnalysisContext_test_getModificationStamp innerContext =
+        new TestAnalysisContext_test_getModificationStamp();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getModificationStamp(null);
@@ -4552,7 +5179,8 @@
   }
 
   void test_getPublicNamespace() {
-    TestAnalysisContext_test_getPublicNamespace innerContext = new TestAnalysisContext_test_getPublicNamespace();
+    TestAnalysisContext_test_getPublicNamespace innerContext =
+        new TestAnalysisContext_test_getPublicNamespace();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getPublicNamespace(null);
@@ -4560,7 +5188,8 @@
   }
 
   void test_getRefactoringUnsafeSources() {
-    TestAnalysisContext_test_getRefactoringUnsafeSources innerContext = new TestAnalysisContext_test_getRefactoringUnsafeSources();
+    TestAnalysisContext_test_getRefactoringUnsafeSources innerContext =
+        new TestAnalysisContext_test_getRefactoringUnsafeSources();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.refactoringUnsafeSources;
@@ -4568,7 +5197,8 @@
   }
 
   void test_getResolvedCompilationUnit_element() {
-    TestAnalysisContext_test_getResolvedCompilationUnit_element innerContext = new TestAnalysisContext_test_getResolvedCompilationUnit_element();
+    TestAnalysisContext_test_getResolvedCompilationUnit_element innerContext =
+        new TestAnalysisContext_test_getResolvedCompilationUnit_element();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getResolvedCompilationUnit(null, null);
@@ -4576,7 +5206,8 @@
   }
 
   void test_getResolvedCompilationUnit_source() {
-    TestAnalysisContext_test_getResolvedCompilationUnit_source innerContext = new TestAnalysisContext_test_getResolvedCompilationUnit_source();
+    TestAnalysisContext_test_getResolvedCompilationUnit_source innerContext =
+        new TestAnalysisContext_test_getResolvedCompilationUnit_source();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getResolvedCompilationUnit2(null, null);
@@ -4584,7 +5215,8 @@
   }
 
   void test_getResolvedHtmlUnit() {
-    TestAnalysisContext_test_getResolvedHtmlUnit innerContext = new TestAnalysisContext_test_getResolvedHtmlUnit();
+    TestAnalysisContext_test_getResolvedHtmlUnit innerContext =
+        new TestAnalysisContext_test_getResolvedHtmlUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.getResolvedHtmlUnit(null);
@@ -4592,7 +5224,8 @@
   }
 
   void test_getSourceFactory() {
-    TestAnalysisContext_test_getSourceFactory innerContext = new TestAnalysisContext_test_getSourceFactory();
+    TestAnalysisContext_test_getSourceFactory innerContext =
+        new TestAnalysisContext_test_getSourceFactory();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.sourceFactory;
@@ -4600,7 +5233,8 @@
   }
 
   void test_getStatistics() {
-    TestAnalysisContext_test_getStatistics innerContext = new TestAnalysisContext_test_getStatistics();
+    TestAnalysisContext_test_getStatistics innerContext =
+        new TestAnalysisContext_test_getStatistics();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.statistics;
@@ -4608,7 +5242,8 @@
   }
 
   void test_getTypeProvider() {
-    TestAnalysisContext_test_getTypeProvider innerContext = new TestAnalysisContext_test_getTypeProvider();
+    TestAnalysisContext_test_getTypeProvider innerContext =
+        new TestAnalysisContext_test_getTypeProvider();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.typeProvider;
@@ -4616,7 +5251,8 @@
   }
 
   void test_isClientLibrary() {
-    TestAnalysisContext_test_isClientLibrary innerContext = new TestAnalysisContext_test_isClientLibrary();
+    TestAnalysisContext_test_isClientLibrary innerContext =
+        new TestAnalysisContext_test_isClientLibrary();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.isClientLibrary(null);
@@ -4624,7 +5260,8 @@
   }
 
   void test_isDisposed() {
-    TestAnalysisContext_test_isDisposed innerContext = new TestAnalysisContext_test_isDisposed();
+    TestAnalysisContext_test_isDisposed innerContext =
+        new TestAnalysisContext_test_isDisposed();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.isDisposed;
@@ -4632,7 +5269,8 @@
   }
 
   void test_isServerLibrary() {
-    TestAnalysisContext_test_isServerLibrary innerContext = new TestAnalysisContext_test_isServerLibrary();
+    TestAnalysisContext_test_isServerLibrary innerContext =
+        new TestAnalysisContext_test_isServerLibrary();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.isServerLibrary(null);
@@ -4640,7 +5278,8 @@
   }
 
   void test_parseCompilationUnit() {
-    TestAnalysisContext_test_parseCompilationUnit innerContext = new TestAnalysisContext_test_parseCompilationUnit();
+    TestAnalysisContext_test_parseCompilationUnit innerContext =
+        new TestAnalysisContext_test_parseCompilationUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.parseCompilationUnit(null);
@@ -4648,7 +5287,8 @@
   }
 
   void test_parseHtmlUnit() {
-    TestAnalysisContext_test_parseHtmlUnit innerContext = new TestAnalysisContext_test_parseHtmlUnit();
+    TestAnalysisContext_test_parseHtmlUnit innerContext =
+        new TestAnalysisContext_test_parseHtmlUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.parseHtmlUnit(null);
@@ -4656,7 +5296,8 @@
   }
 
   void test_performAnalysisTask() {
-    TestAnalysisContext_test_performAnalysisTask innerContext = new TestAnalysisContext_test_performAnalysisTask();
+    TestAnalysisContext_test_performAnalysisTask innerContext =
+        new TestAnalysisContext_test_performAnalysisTask();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.performAnalysisTask();
@@ -4664,7 +5305,8 @@
   }
 
   void test_recordLibraryElements() {
-    TestAnalysisContext_test_recordLibraryElements innerContext = new TestAnalysisContext_test_recordLibraryElements();
+    TestAnalysisContext_test_recordLibraryElements innerContext =
+        new TestAnalysisContext_test_recordLibraryElements();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.recordLibraryElements(null);
@@ -4672,7 +5314,8 @@
   }
 
   void test_resolveCompilationUnit() {
-    TestAnalysisContext_test_resolveCompilationUnit innerContext = new TestAnalysisContext_test_resolveCompilationUnit();
+    TestAnalysisContext_test_resolveCompilationUnit innerContext =
+        new TestAnalysisContext_test_resolveCompilationUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.resolveCompilationUnit2(null, null);
@@ -4680,7 +5323,8 @@
   }
 
   void test_resolveCompilationUnit_element() {
-    TestAnalysisContext_test_resolveCompilationUnit_element innerContext = new TestAnalysisContext_test_resolveCompilationUnit_element();
+    TestAnalysisContext_test_resolveCompilationUnit_element innerContext =
+        new TestAnalysisContext_test_resolveCompilationUnit_element();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.resolveCompilationUnit(null, null);
@@ -4688,7 +5332,8 @@
   }
 
   void test_resolveHtmlUnit() {
-    TestAnalysisContext_test_resolveHtmlUnit innerContext = new TestAnalysisContext_test_resolveHtmlUnit();
+    TestAnalysisContext_test_resolveHtmlUnit innerContext =
+        new TestAnalysisContext_test_resolveHtmlUnit();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.resolveHtmlUnit(null);
@@ -4696,7 +5341,8 @@
   }
 
   void test_setAnalysisOptions() {
-    TestAnalysisContext_test_setAnalysisOptions innerContext = new TestAnalysisContext_test_setAnalysisOptions();
+    TestAnalysisContext_test_setAnalysisOptions innerContext =
+        new TestAnalysisContext_test_setAnalysisOptions();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.analysisOptions = null;
@@ -4704,7 +5350,8 @@
   }
 
   void test_setAnalysisPriorityOrder() {
-    TestAnalysisContext_test_setAnalysisPriorityOrder innerContext = new TestAnalysisContext_test_setAnalysisPriorityOrder();
+    TestAnalysisContext_test_setAnalysisPriorityOrder innerContext =
+        new TestAnalysisContext_test_setAnalysisPriorityOrder();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.analysisPriorityOrder = null;
@@ -4712,7 +5359,8 @@
   }
 
   void test_setChangedContents() {
-    TestAnalysisContext_test_setChangedContents innerContext = new TestAnalysisContext_test_setChangedContents();
+    TestAnalysisContext_test_setChangedContents innerContext =
+        new TestAnalysisContext_test_setChangedContents();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.setChangedContents(null, null, 0, 0, 0);
@@ -4720,7 +5368,8 @@
   }
 
   void test_setContents() {
-    TestAnalysisContext_test_setContents innerContext = new TestAnalysisContext_test_setContents();
+    TestAnalysisContext_test_setContents innerContext =
+        new TestAnalysisContext_test_setContents();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.setContents(null, null);
@@ -4728,7 +5377,8 @@
   }
 
   void test_setSourceFactory() {
-    TestAnalysisContext_test_setSourceFactory innerContext = new TestAnalysisContext_test_setSourceFactory();
+    TestAnalysisContext_test_setSourceFactory innerContext =
+        new TestAnalysisContext_test_setSourceFactory();
     InstrumentedAnalysisContextImpl context =
         new InstrumentedAnalysisContextImpl.con1(innerContext);
     context.sourceFactory = null;
@@ -4798,8 +5448,7 @@
   }
 
   void test_perform_part() {
-    String content =
-        r'''
+    String content = r'''
 part of lib;
 class B {}''';
     Source source = new TestSource('/test.dart', content);
@@ -4837,10 +5486,7 @@
    */
   ParseDartTask _createParseTask(InternalAnalysisContext context, Source source,
       String content) {
-    ScanDartTask scanTask = new ScanDartTask(
-        context,
-        source,
-        content);
+    ScanDartTask scanTask = new ScanDartTask(context, source, content);
     scanTask.perform(new ParseDartTaskTestTV_createParseTask());
     return new ParseDartTask(
         context,
@@ -4926,9 +5572,10 @@
     expect(task.compilationUnit, isNotNull);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     errorListener.addAll(task.errors);
-    errorListener.assertErrorsWithCodes([
-        CompileTimeErrorCode.URI_WITH_INTERPOLATION,
-        CompileTimeErrorCode.INVALID_URI]);
+    errorListener.assertErrorsWithCodes(
+        [
+            CompileTimeErrorCode.URI_WITH_INTERPOLATION,
+            CompileTimeErrorCode.INVALID_URI]);
     expect(task.source, same(source));
     expect(task.hasNonPartOfDirective, isTrue);
     expect(task.hasPartOfDirective, isFalse);
@@ -4950,10 +5597,7 @@
     InternalAnalysisContext context = new AnalysisContextImpl();
     context.setContents(source, contents);
     context.sourceFactory = new SourceFactory([new FileUriResolver()]);
-    ParseHtmlTask task = new ParseHtmlTask(
-        context,
-        source,
-        contents);
+    ParseHtmlTask task = new ParseHtmlTask(context, source, contents);
     Logger oldLogger = AnalysisEngine.instance.logger;
     try {
       AnalysisEngine.instance.logger = testLogger;
@@ -5086,6 +5730,19 @@
 }
 
 
+class ParseHtmlTaskTest_non_existing_source extends TestSource {
+  ParseHtmlTaskTest_non_existing_source(String arg0) : super(arg0);
+  @override
+  Uri resolveRelativeUri(Uri containedUri) {
+    try {
+      return parseUriWithException("file:/does/not/exist.dart");
+    } on URISyntaxException catch (exception) {
+      return null;
+    }
+  }
+}
+
+
 class ParseHtmlTaskTestTV_accept extends TestTaskVisitor<bool> {
   @override
   bool visitParseHtmlTask(ParseHtmlTask task) => true;
@@ -5110,19 +5767,6 @@
 }
 
 
-class ParseHtmlTaskTest_non_existing_source extends TestSource {
-  ParseHtmlTaskTest_non_existing_source(String arg0) : super(arg0);
-  @override
-  Uri resolveRelativeUri(Uri containedUri) {
-    try {
-      return parseUriWithException("file:/does/not/exist.dart");
-    } on URISyntaxException catch (exception) {
-      return null;
-    }
-  }
-}
-
-
 class PartitionManagerTest extends EngineTestCase {
   void test_clearCache() {
     PartitionManager manager = new PartitionManager();
@@ -5187,9 +5831,7 @@
     task.perform(new ResolveDartLibraryTaskTestTV_perform_exception());
   }
   void test_perform_library() {
-    Source source = new TestSource(
-        '/test.dart',
-        r'''
+    Source source = new TestSource('/test.dart', r'''
 library lib;
 class A {}''');
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
@@ -5289,9 +5931,7 @@
     classElement.constructors = <ConstructorElement>[constructorElement];
     unitElement.types = <ClassElement>[classElement];
     Source source = unitElement.source;
-    context.setContents(
-        source,
-        r'''
+    context.setContents(source, r'''
 library lib;
 class A {}''');
     ResolveDartUnitTask task =
@@ -5385,14 +6025,10 @@
 </html>''';
     Source source = new TestSource("/test.html", content);
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
-    ParseHtmlTask parseTask =
-        new ParseHtmlTask(context, source, content);
+    ParseHtmlTask parseTask = new ParseHtmlTask(context, source, content);
     parseTask.perform(new ResolveHtmlTaskTestTV_perform_valid_2());
-    ResolveHtmlTask task = new ResolveHtmlTask(
-        context,
-        source,
-        modificationStamp,
-        parseTask.htmlUnit);
+    ResolveHtmlTask task =
+        new ResolveHtmlTask(context, source, modificationStamp, parseTask.htmlUnit);
     task.perform(
         new ResolveHtmlTaskTestTV_perform_valid(modificationStamp, source));
   }
@@ -5470,8 +6106,7 @@
     Source source = new TestSource('test.dart', content);
     InternalAnalysisContext context = new AnalysisContextImpl();
     context.sourceFactory = new SourceFactory([new FileUriResolver()]);
-    ScanDartTask task =
-        new ScanDartTask(context, source, content);
+    ScanDartTask task = new ScanDartTask(context, source, content);
     task.perform(new ScanDartTaskTestTV_perform_valid(context, source));
   }
 }
@@ -5523,6 +6158,112 @@
 }
 
 
+class SourcesChangedEventTest {
+
+  void test_added() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.addedSource(source);
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, wereSourcesAdded: true);
+  }
+
+  void test_changedContent() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.changedContent(source, 'library A;');
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, changedSources: [source]);
+  }
+
+  void test_changedContent2() {
+    var source = new StringSource('', '/test.dart');
+    var event = new SourcesChangedEvent.changedContent(source, 'library A;');
+    assertEvent(event, changedSources: [source]);
+  }
+
+  void test_changedRange() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.changedRange(source, 'library A;', 0, 0, 13);
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, changedSources: [source]);
+  }
+
+  void test_changedRange2() {
+    var source = new StringSource('', '/test.dart');
+    var event = new SourcesChangedEvent.changedRange(
+        source, 'library A;', 0, 0, 13);
+    assertEvent(event, changedSources: [source]);
+  }
+
+  void test_changedSources() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.changedSource(source);
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, changedSources: [source]);
+  }
+
+  void test_deleted() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.deletedSource(source);
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, wereSourcesRemovedOrDeleted: true);
+  }
+
+  void test_empty() {
+    var changeSet = new ChangeSet();
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event);
+  }
+
+  void test_removed() {
+    var source = new StringSource('', '/test.dart');
+    var changeSet = new ChangeSet();
+    changeSet.removedSource(source);
+    var event = new SourcesChangedEvent(changeSet);
+    assertEvent(event, wereSourcesRemovedOrDeleted: true);
+  }
+
+  static void assertEvent(SourcesChangedEvent event, {bool wereSourcesAdded: false,
+    List<Source> changedSources: Source.EMPTY_ARRAY,
+    bool wereSourcesRemovedOrDeleted: false}) {
+    expect(event.wereSourcesAdded, wereSourcesAdded);
+    expect(event.changedSources, changedSources);
+    expect(event.wereSourcesRemovedOrDeleted, wereSourcesRemovedOrDeleted);
+  }
+}
+
+
+class SourcesChangedListener {
+  List<SourcesChangedEvent> actualEvents = [];
+
+  void assertEvent({bool wereSourcesAdded: false,
+      List<Source> changedSources: Source.EMPTY_ARRAY,
+      bool wereSourcesRemovedOrDeleted: false}) {
+    if (actualEvents.isEmpty) {
+      fail('Expected event but found none');
+    }
+    SourcesChangedEvent actual = actualEvents.removeAt(0);
+    SourcesChangedEventTest.assertEvent(
+        actual,
+        wereSourcesAdded: wereSourcesAdded,
+        changedSources: changedSources,
+        wereSourcesRemovedOrDeleted: wereSourcesRemovedOrDeleted);
+  }
+
+  void assertNoMoreEvents() {
+    expect(actualEvents, []);
+  }
+
+  void onData(SourcesChangedEvent event) {
+    actualEvents.add(event);
+  }
+}
+
+
 /**
  * Instances of the class `TestAnalysisContext` implement an analysis context in which every
  * method will cause a test to fail when invoked.
@@ -5572,6 +6313,11 @@
     return null;
   }
   @override
+  Stream<SourcesChangedEvent> get onSourcesChanged {
+    fail("Unexpected invocation of onSourcesChanged");
+    return null;
+  }
+  @override
   List<Source> get prioritySources {
     fail("Unexpected invocation of getPrioritySources");
     return null;
@@ -5829,8 +6575,7 @@
   }
   @override
   void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
-                                     DataDescriptor rowDesc,
-                                     CacheState state)) {
+      DataDescriptor rowDesc, CacheState state)) {
     fail("Unexpected invocation of visitCacheItems");
   }
 }
@@ -6709,15 +7454,6 @@
 }
 
 
-class _AnalysisContextImplTest_test_applyChanges_removeContainer implements
-    SourceContainer {
-  Source libB;
-  _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB);
-  @override
-  bool contains(Source source) => source == libB;
-}
-
-
 class _AnalysisContext_sourceChangeDuringResolution extends
     AnalysisContextForTests {
   @override
@@ -6730,6 +7466,15 @@
 }
 
 
+class _AnalysisContextImplTest_test_applyChanges_removeContainer implements
+    SourceContainer {
+  Source libB;
+  _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB);
+  @override
+  bool contains(Source source) => source == libB;
+}
+
+
 class _UniversalCachePartitionTest_test_setMaxCacheSize implements
     CacheRetentionPolicy {
   @override
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
new file mode 100644
index 0000000..6398504
--- /dev/null
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -0,0 +1,3725 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library engine.incremental_resolver_test;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/incremental_resolver.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/generated/testing/ast_factory.dart';
+import 'package:analyzer/src/generated/testing/element_factory.dart';
+import 'package:unittest/unittest.dart';
+
+import '../reflective_tests.dart';
+import 'parser_test.dart';
+import 'resolver_test.dart';
+import 'test_support.dart';
+
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(DeclarationMatcherTest);
+  runReflectiveTests(IncrementalResolverTest);
+  runReflectiveTests(PoorMansIncrementalResolutionTest);
+  runReflectiveTests(ResolutionContextBuilderTest);
+}
+
+
+class DeclarationMatcherTest extends ResolverTestCase {
+  void test_false_class_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+''', r'''
+class A {}
+class B {}
+class C {}
+''');
+  }
+
+  void test_false_class_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+class C {}
+''', r'''
+class A {}
+class B {}
+''');
+  }
+
+  void test_false_class_typeParameters_bounds_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B<T> {
+  T f;
+}
+''', r'''
+class A {}
+class B<T extends A> {
+  T f;
+}
+''');
+  }
+
+  void test_false_class_typeParameters_bounds_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B<T extends A> {
+  T f;
+}
+''', r'''
+class A {}
+class B<T> {
+  T f;
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  get a => 1;
+  get b => 2;
+}
+''', r'''
+class A {
+  get a => 1;
+  get b => 2;
+  get c => 3;
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  get a => 1;
+  get b => 2;
+  get c => 3;
+}
+''', r'''
+class A {
+  get a => 1;
+  get b => 2;
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_wasGetter() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  get a => 1;
+}
+''', r'''
+class A {
+  set a(x) {}
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_wasInstance() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  get a => 1;
+}
+''', r'''
+class A {
+  static get a => 1;
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_wasSetter() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  set a(x) {}
+}
+''', r'''
+class A {
+  get a => 1;
+}
+''');
+  }
+
+  void test_false_classMemberAccessor_wasStatic() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  static get a => 1;
+}
+''', r'''
+class A {
+  get a => 1;
+}
+''');
+  }
+
+  void test_false_classTypeAlias_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class M {}
+class A = Object with M;
+''', r'''
+class M {}
+class A = Object with M;
+class B = Object with M;
+''');
+  }
+
+  void test_false_classTypeAlias_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class M {}
+class A = Object with M;
+class B = Object with M;
+''', r'''
+class M {}
+class A = Object with M;
+''');
+  }
+
+  void test_false_classTypeAlias_typeParameters_bounds_add() {
+    _assertCompilationUnitMatches(false, r'''
+class M<T> {}
+class A {}
+class B<T> = Object with M<T>;
+''', r'''
+class M<T> {}
+class A {}
+class B<T extends A> = Object with M<T>;
+''');
+  }
+
+  void test_false_classTypeAlias_typeParameters_bounds_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class M<T> {}
+class A {}
+class B<T extends A> = Object with M<T>;
+''', r'''
+class M<T> {}
+class A {}
+class B<T> = Object with M<T>;
+''');
+  }
+
+  void test_false_constructor_parameters_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  A();
+}
+''', r'''
+class A {
+  A(int p);
+}
+''');
+  }
+
+  void test_false_constructor_parameters_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  A(int p);
+}
+''', r'''
+class A {
+  A();
+}
+''');
+  }
+
+  void test_false_constructor_parameters_type_edit() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  A(int p);
+}
+''', r'''
+class A {
+  A(String p);
+}
+''');
+  }
+
+  void test_false_constructor_unnamed_add_hadParameters() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+}
+''', r'''
+class A {
+  A(int p) {}
+}
+''');
+  }
+
+  void test_false_constructor_unnamed_remove_hadParameters() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  A(int p) {}
+}
+''', r'''
+class A {
+}
+''');
+  }
+
+  void test_false_defaultFieldFormalParameterElement_wasSimple() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  int field;
+  A(int field);
+}
+''', r'''
+class A {
+  int field;
+  A([this.field = 0]);
+}
+''');
+  }
+
+  void test_false_enum_constants_add() {
+    resetWithEnum();
+    _assertCompilationUnitMatches(false, r'''
+enum E {A, B}
+''', r'''
+enum E {A, B, C}
+''');
+  }
+
+  void test_false_enum_constants_remove() {
+    resetWithEnum();
+    _assertCompilationUnitMatches(false, r'''
+enum E {A, B, C}
+''', r'''
+enum E {A, B}
+''');
+  }
+
+  void test_false_export_hide_add() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async' hide Future;
+''', r'''
+export 'dart:async' hide Future, Stream;
+''');
+  }
+
+  void test_false_export_hide_remove() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async' hide Future, Stream;
+''', r'''
+export 'dart:async' hide Future;
+''');
+  }
+
+  void test_false_export_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async';
+''', r'''
+export 'dart:async';
+export 'dart:math';
+''');
+  }
+
+  void test_false_export_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async';
+export 'dart:math';
+''', r'''
+export 'dart:async';
+''');
+  }
+
+  void test_false_export_show_add() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async' show Future;
+''', r'''
+export 'dart:async' show Future, Stream;
+''');
+  }
+
+  void test_false_export_show_remove() {
+    _assertCompilationUnitMatches(false, r'''
+export 'dart:async' show Future, Stream;
+''', r'''
+export 'dart:async' show Future;
+''');
+  }
+
+  void test_false_extendsClause_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+''', r'''
+class A {}
+class B extends A {}
+''');
+  }
+
+  void test_false_extendsClause_different() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+class C extends A {}
+''', r'''
+class A {}
+class B {}
+class C extends B {}
+''');
+  }
+
+  void test_false_extendsClause_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B extends A{}
+''', r'''
+class A {}
+class B {}
+''');
+  }
+
+  void test_false_field_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  int A = 1;
+  int C = 3;
+}
+''', r'''
+class T {
+  int A = 1;
+  int B = 2;
+  int C = 3;
+}
+''');
+  }
+
+  void test_false_field_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  int A = 1;
+  int B = 2;
+  int C = 3;
+}
+''', r'''
+class T {
+  int A = 1;
+  int C = 3;
+}
+''');
+  }
+
+  void test_false_field_modifier_isConst() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  static final A = 1;
+}
+''', r'''
+class T {
+  static const A = 1;
+}
+''');
+  }
+
+  void test_false_field_modifier_isFinal() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  int A = 1;
+}
+''', r'''
+class T {
+  final int A = 1;
+}
+''');
+  }
+
+  void test_false_field_modifier_isStatic() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  int A = 1;
+}
+''', r'''
+class T {
+  static int A = 1;
+}
+''');
+  }
+
+  void test_false_field_modifier_wasConst() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  static const A = 1;
+}
+''', r'''
+class T {
+  static final A = 1;
+}
+''');
+  }
+
+  void test_false_field_modifier_wasFinal() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  final int A = 1;
+}
+''', r'''
+class T {
+  int A = 1;
+}
+''');
+  }
+
+  void test_false_field_modifier_wasStatic() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  static int A = 1;
+}
+''', r'''
+class T {
+  int A = 1;
+}
+''');
+  }
+
+  void test_false_field_type_differentArgs() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  List<int> A;
+}
+''', r'''
+class T {
+  List<String> A;
+}
+''');
+  }
+
+  void test_false_fieldFormalParameterElement_wasSimple() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  int field;
+  A(int field);
+}
+''', r'''
+class A {
+  int field;
+  A(this.field);
+}
+''');
+  }
+
+  void test_false_final_type_different() {
+    _assertCompilationUnitMatches(false, r'''
+class T {
+  int A;
+}
+''', r'''
+class T {
+  String A;
+}
+''');
+  }
+
+  void test_false_functionTypeAlias_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+typedef A(int pa);
+typedef B(String pb);
+''', r'''
+typedef A(int pa);
+typedef B(String pb);
+typedef C(pc);
+''');
+  }
+
+  void test_false_functionTypeAlias_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+typedef A(int pa);
+typedef B(String pb);
+typedef C(pc);
+''', r'''
+typedef A(int pa);
+typedef B(String pb);
+''');
+  }
+
+  void test_false_functionTypeAlias_parameters_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+typedef A(a);
+''', r'''
+typedef A(a, b);
+''');
+  }
+
+  void test_false_functionTypeAlias_parameters_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+typedef A(a, b);
+''', r'''
+typedef A(a);
+''');
+  }
+
+  void test_false_functionTypeAlias_parameters_type_edit() {
+    _assertCompilationUnitMatches(false, r'''
+typedef A(int p);
+''', r'''
+typedef A(String p);
+''');
+  }
+
+  void test_false_functionTypeAlias_returnType_edit() {
+    _assertCompilationUnitMatches(false, r'''
+typedef int A();
+''', r'''
+typedef String A();
+''');
+  }
+
+  void test_false_functionTypeAlias_typeParameters_bounds_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+typedef F<T>();
+''', r'''
+class A {}
+typedef F<T extends A>();
+''');
+  }
+
+  void test_false_functionTypeAlias_typeParameters_bounds_edit() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+typedef F<T extends A>();
+''', r'''
+class A {}
+typedef F<T extends B>();
+''');
+  }
+
+  void test_false_functionTypeAlias_typeParameters_bounds_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+typedef F<T extends A>();
+''', r'''
+class A {}
+typedef F<T>();
+''');
+  }
+
+  void test_false_functionTypeAlias_typeParameters_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+typedef F<A>();
+''', r'''
+typedef F<A, B>();
+''');
+  }
+
+  void test_false_functionTypeAlias_typeParameters_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+typedef F<A, B>();
+''', r'''
+typedef F<A>();
+''');
+  }
+
+  void test_false_FunctionTypedFormalParameter_parameters_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+main(int callback(int a)) {
+}
+''', r'''
+main(int callback(int a, String b)) {
+}
+''');
+  }
+
+  void test_false_FunctionTypedFormalParameter_parameters_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+main(int callback(int a, String b)) {
+}
+''', r'''
+main(int callback(int a)) {
+}
+''');
+  }
+
+  void test_false_FunctionTypedFormalParameter_parameterType() {
+    _assertCompilationUnitMatches(false, r'''
+main(int callback(int p)) {
+}
+''', r'''
+main(int callback(String p)) {
+}
+''');
+  }
+
+  void test_false_FunctionTypedFormalParameter_returnType() {
+    _assertCompilationUnitMatches(false, r'''
+main(int callback()) {
+}
+''', r'''
+main(String callback()) {
+}
+''');
+  }
+
+  void test_false_FunctionTypedFormalParameter_wasSimple() {
+    _assertCompilationUnitMatches(false, r'''
+main(int callback) {
+}
+''', r'''
+main(int callback(int a, String b)) {
+}
+''');
+  }
+
+  void test_false_implementsClause_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+''', r'''
+class A {}
+class B implements A {}
+''');
+  }
+
+  void test_false_implementsClause_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B implements A {}
+''', r'''
+class A {}
+class B {}
+''');
+  }
+
+  void test_false_implementsClause_reorder() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+class C implements A, B {}
+''', r'''
+class A {}
+class B {}
+class C implements B, A {}
+''');
+  }
+
+  void test_false_import_hide_add() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' hide Future;
+''', r'''
+import 'dart:async' hide Future, Stream;
+''');
+  }
+
+  void test_false_import_hide_remove() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' hide Future, Stream;
+''', r'''
+import 'dart:async' hide Future;
+''');
+  }
+
+  void test_false_import_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async';
+''', r'''
+import 'dart:async';
+import 'dart:math';
+''');
+  }
+
+  void test_false_import_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async';
+import 'dart:math';
+''', r'''
+import 'dart:async';
+''');
+  }
+
+  void test_false_import_prefix_add() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async';
+''', r'''
+import 'dart:async' as async;
+''');
+  }
+
+  void test_false_import_prefix_edit() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' as oldPrefix;
+''', r'''
+import 'dart:async' as newPrefix;
+''');
+  }
+
+  void test_false_import_prefix_remove() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' as async;
+''', r'''
+import 'dart:async';
+''');
+  }
+
+  void test_false_import_show_add() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' show Future;
+''', r'''
+import 'dart:async' show Future, Stream;
+''');
+  }
+
+  void test_false_import_show_remove() {
+    _assertCompilationUnitMatches(false, r'''
+import 'dart:async' show Future, Stream;
+''', r'''
+import 'dart:async' show Future;
+''');
+  }
+
+  void test_false_method_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  a() {}
+  b() {}
+}
+''', r'''
+class A {
+  a() {}
+  b() {}
+  c() {}
+}
+''');
+  }
+
+  void test_false_method_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  a() {}
+  b() {}
+  c() {}
+}
+''', r'''
+class A {
+  a() {}
+  b() {}
+}
+''');
+  }
+
+  void test_false_method_returnType_edit() {
+    _assertCompilationUnitMatches(false, r'''
+class A {
+  int m() {}
+}
+''', r'''
+class A {
+  String m() {}
+}
+''');
+  }
+
+  void test_false_part_list_add() {
+    addNamedSource('/unitA.dart', 'part of lib; class A {}');
+    addNamedSource('/unitB.dart', 'part of lib; class B {}');
+    _assertCompilationUnitMatches(false, r'''
+library lib;
+part 'unitA.dart';
+''', r'''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''');
+  }
+
+  void test_false_part_list_remove() {
+    addNamedSource('/unitA.dart', 'part of lib; class A {}');
+    addNamedSource('/unitB.dart', 'part of lib; class B {}');
+    _assertCompilationUnitMatches(false, r'''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''', r'''
+library lib;
+part 'unitA.dart';
+''');
+  }
+
+  void test_false_SimpleFormalParameter_named_differentName() {
+    _assertCompilationUnitMatches(false, r'''
+main({int oldName}) {
+}
+''', r'''
+main({int newName}) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_namedDefault_addValue() {
+    _assertCompilationUnitMatches(false, r'''
+main({int p}) {
+}
+''', r'''
+main({int p: 2}) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_namedDefault_differentValue() {
+    _assertCompilationUnitMatches(false, r'''
+main({int p: 1}) {
+}
+''', r'''
+main({int p: 2}) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_namedDefault_removeValue() {
+    _assertCompilationUnitMatches(false, r'''
+main({int p: 1}) {
+}
+''', r'''
+main({int p}) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_optionalDefault_addValue() {
+    _assertCompilationUnitMatches(false, r'''
+main([int p]) {
+}
+''', r'''
+main([int p = 2]) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_optionalDefault_differentValue() {
+    _assertCompilationUnitMatches(false, r'''
+main([int p = 1]) {
+}
+''', r'''
+main([int p = 2]) {
+}
+''');
+  }
+
+  void test_false_SimpleFormalParameter_optionalDefault_removeValue() {
+    _assertCompilationUnitMatches(false, r'''
+main([int p = 1]) {
+}
+''', r'''
+main([int p]) {
+}
+''');
+  }
+
+  void test_false_topLevelAccessor_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+get a => 1;
+get b => 2;
+''', r'''
+get a => 1;
+get b => 2;
+get c => 3;
+''');
+  }
+
+  void test_false_topLevelAccessor_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+get a => 1;
+get b => 2;
+get c => 3;
+''', r'''
+get a => 1;
+get b => 2;
+''');
+  }
+
+  void test_false_topLevelAccessor_wasGetter() {
+    _assertCompilationUnitMatches(false, r'''
+get a => 1;
+''', r'''
+set a(x) {}
+''');
+  }
+
+  void test_false_topLevelAccessor_wasSetter() {
+    _assertCompilationUnitMatches(false, r'''
+set a(x) {}
+''', r'''
+get a => 1;
+''');
+  }
+
+  void test_false_topLevelFunction_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+a() {}
+b() {}
+''', r'''
+a() {}
+b() {}
+c() {}
+''');
+  }
+
+  void test_false_topLevelFunction_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+a() {}
+b() {}
+c() {}
+''', r'''
+a() {}
+b() {}
+''');
+  }
+
+  void test_false_topLevelFunction_parameters_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+main(int a, int b) {
+}
+''', r'''
+main(int a, int b, int c) {
+}
+''');
+  }
+
+  void test_false_topLevelFunction_parameters_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+main(int a, int b, int c) {
+}
+''', r'''
+main(int a, int b) {
+}
+''');
+  }
+
+  void test_false_topLevelFunction_parameters_type_edit() {
+    _assertCompilationUnitMatches(false, r'''
+main(int a, int b, int c) {
+}
+''', r'''
+main(int a, String b, int c) {
+}
+''');
+  }
+
+  void test_false_topLevelFunction_returnType_edit() {
+    _assertCompilationUnitMatches(false, r'''
+int a() {}
+''', r'''
+String a() {}
+''');
+  }
+
+  void test_false_topLevelVariable_list_add() {
+    _assertCompilationUnitMatches(false, r'''
+const int A = 1;
+const int C = 3;
+''', r'''
+const int A = 1;
+const int B = 2;
+const int C = 3;
+''');
+  }
+
+  void test_false_topLevelVariable_list_remove() {
+    _assertCompilationUnitMatches(false, r'''
+const int A = 1;
+const int B = 2;
+const int C = 3;
+''', r'''
+const int A = 1;
+const int C = 3;
+''');
+  }
+
+  void test_false_topLevelVariable_modifier_isConst() {
+    _assertCompilationUnitMatches(false, r'''
+final int A = 1;
+''', r'''
+const int A = 1;
+''');
+  }
+
+  void test_false_topLevelVariable_modifier_isFinal() {
+    _assertCompilationUnitMatches(false, r'''
+int A = 1;
+''', r'''
+final int A = 1;
+''');
+  }
+
+  void test_false_topLevelVariable_modifier_wasConst() {
+    _assertCompilationUnitMatches(false, r'''
+const int A = 1;
+''', r'''
+final int A = 1;
+''');
+  }
+
+  void test_false_topLevelVariable_modifier_wasFinal() {
+    _assertCompilationUnitMatches(false, r'''
+final int A = 1;
+''', r'''
+int A = 1;
+''');
+  }
+
+  void test_false_topLevelVariable_synthetic_wasGetter() {
+    _assertCompilationUnitMatches(false, r'''
+int get A => 1;
+''', r'''
+final int A = 1;
+''');
+  }
+
+  void test_false_topLevelVariable_type_different() {
+    _assertCompilationUnitMatches(false, r'''
+int A;
+''', r'''
+String A;
+''');
+  }
+
+  void test_false_topLevelVariable_type_differentArgs() {
+    _assertCompilationUnitMatches(false, r'''
+List<int> A;
+''', r'''
+List<String> A;
+''');
+  }
+
+  void test_false_type_noTypeArguments_hadTypeArguments() {
+    _assertCompilationUnitMatches(false, r'''
+class A<T> {}
+A<int> main() {
+}
+''', r'''
+class A<T> {}
+A main() {
+}
+''');
+  }
+
+  void test_false_withClause_add() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+''', r'''
+class A {}
+class B extends Object with A {}
+''');
+  }
+
+  void test_false_withClause_remove() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B extends Object with A {}
+''', r'''
+class A {}
+class B {}
+''');
+  }
+
+  void test_false_withClause_reorder() {
+    _assertCompilationUnitMatches(false, r'''
+class A {}
+class B {}
+class C extends Object with A, B {}
+''', r'''
+class A {}
+class B {}
+class C extends Object with B, A {}
+''');
+  }
+
+  void test_true_class_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+class A {}
+class B {}
+class C {}
+''', r'''
+class C {}
+class A {}
+class B {}
+''');
+  }
+
+  void test_true_class_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {}
+class B {}
+class C {}
+''', r'''
+class A {}
+class B {}
+class C {}
+''');
+  }
+
+  void test_true_class_typeParameters_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A<T> {}
+''', r'''
+class A<T> {}
+''');
+  }
+
+  void test_true_classMemberAccessor_getterSetter() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  int _test;
+  get test => _test;
+  set test(v) {
+    _test = v;
+  }
+}
+''', r'''
+class A {
+  int _test;
+  get test => _test;
+  set test(v) {
+    _test = v;
+  }
+}
+''');
+  }
+
+  void test_true_classMemberAccessor_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  get a => 1;
+  get b => 2;
+  get c => 3;
+}
+''', r'''
+class A {
+  get c => 3;
+  get a => 1;
+  get b => 2;
+}
+''');
+  }
+
+  void test_true_classMemberAccessor_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  get a => 1;
+  get b => 2;
+  get c => 3;
+}
+''', r'''
+class A {
+  get a => 1;
+  get b => 2;
+  get c => 3;
+}
+''');
+  }
+
+  void test_true_classTypeAlias_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+class M {}
+class A = Object with M;
+class B = Object with M;
+class C = Object with M;
+''', r'''
+class M {}
+class C = Object with M;
+class A = Object with M;
+class B = Object with M;
+''');
+  }
+
+  void test_true_classTypeAlias_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+class M {}
+class A = Object with M;
+class B = Object with M;
+class C = Object with M;
+''', r'''
+class M {}
+class A = Object with M;
+class B = Object with M;
+class C = Object with M;
+''');
+  }
+
+  void test_true_classTypeAlias_typeParameters_same() {
+    _assertCompilationUnitMatches(true, r'''
+class M<T> {}
+class A<T> {}
+class B<T> = A<T> with M<T>;
+''', r'''
+class M<T> {}
+class A<T> {}
+class B<T> = A<T> with M<T>;
+''');
+  }
+
+  void test_true_constructor_named_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  A.name(int p);
+}
+''', r'''
+class A {
+  A.name(int p);
+}
+''');
+  }
+
+  void test_true_constructor_unnamed_add_noParameters() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+}
+''', r'''
+class A {
+  A() {}
+}
+''');
+  }
+
+  void test_true_constructor_unnamed_remove_noParameters() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  A() {}
+}
+''', r'''
+class A {
+}
+''');
+  }
+
+  void test_true_constructor_unnamed_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  A(int p);
+}
+''', r'''
+class A {
+  A(int p);
+}
+''');
+  }
+
+  void test_true_defaultFieldFormalParameterElement() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  int field;
+  A([this.field = 0]);
+}
+''', r'''
+class A {
+  int field;
+  A([this.field = 0]);
+}
+''');
+  }
+
+  void test_true_enum_constants_reorder() {
+    resetWithEnum();
+    _assertCompilationUnitMatches(true, r'''
+enum E {A, B, C}
+''', r'''
+enum E {C, A, B}
+''');
+  }
+
+  void test_true_enum_list_reorder() {
+    resetWithEnum();
+    _assertCompilationUnitMatches(true, r'''
+enum A {A1, A2, A3}
+enum B {B1, B2, B3}
+enum C {C1, C2, C3}
+''', r'''
+enum C {C1, C2, C3}
+enum A {A1, A2, A3}
+enum B {B1, B2, B3}
+''');
+  }
+
+  void test_true_enum_list_same() {
+    resetWithEnum();
+    _assertCompilationUnitMatches(true, r'''
+enum A {A1, A2, A3}
+enum B {B1, B2, B3}
+enum C {C1, C2, C3}
+''', r'''
+enum A {A1, A2, A3}
+enum B {B1, B2, B3}
+enum C {C1, C2, C3}
+''');
+  }
+
+  void test_true_executable_same_hasLabel() {
+    _assertCompilationUnitMatches(true, r'''
+main() {
+  label: return 42;
+}
+''', r'''
+main() {
+  label: return 42;
+}
+''');
+  }
+
+  void test_true_executable_same_hasLocalVariable() {
+    _assertCompilationUnitMatches(true, r'''
+main() {
+  int a = 42;
+}
+''', r'''
+main() {
+  int a = 42;
+}
+''');
+  }
+
+  void test_true_export_hide_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+export 'dart:async' hide Future, Stream;
+''', r'''
+export 'dart:async' hide Stream, Future;
+''');
+  }
+
+  void test_true_export_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+export 'dart:async';
+export 'dart:math';
+''', r'''
+export 'dart:math';
+export 'dart:async';
+''');
+  }
+
+  void test_true_export_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+export 'dart:async';
+export 'dart:math';
+''', r'''
+export 'dart:async';
+export 'dart:math';
+''');
+  }
+
+  void test_true_export_show_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+export 'dart:async' show Future, Stream;
+''', r'''
+export 'dart:async' show Stream, Future;
+''');
+  }
+
+  void test_true_extendsClause_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {}
+class B extends A {}
+''', r'''
+class A {}
+class B extends A {}
+''');
+  }
+
+  void test_true_field_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+class T {
+  int A = 1;
+  int B = 2;
+  int C = 3;
+}
+''', r'''
+class T {
+  int C = 3;
+  int A = 1;
+  int B = 2;
+}
+''');
+  }
+
+  void test_true_field_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+class T {
+  int A = 1;
+  int B = 2;
+  int C = 3;
+}
+''', r'''
+class T {
+  int A = 1;
+  int B = 2;
+  int C = 3;
+}
+''');
+  }
+
+  void test_true_fieldFormalParameter() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  int field;
+  A(this.field);
+}
+''', r'''
+class A {
+  int field;
+  A(this.field);
+}
+''');
+  }
+
+  void test_true_functionTypeAlias_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+typedef A(int pa);
+typedef B(String pb);
+typedef C(pc);
+''', r'''
+typedef C(pc);
+typedef A(int pa);
+typedef B(String pb);
+''');
+  }
+
+  void test_true_functionTypeAlias_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+typedef String A(int pa);
+typedef int B(String pb);
+typedef C(pc);
+''', r'''
+typedef String A(int pa);
+typedef int B(String pb);
+typedef C(pc);
+''');
+  }
+
+  void test_true_functionTypeAlias_typeParameters_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+typedef F<A, B, C>();
+''', r'''
+typedef F<A, B, C>();
+''');
+  }
+
+  void test_true_FunctionTypedFormalParameter() {
+    _assertCompilationUnitMatches(true, r'''
+main(int callback(int a, String b)) {
+}
+''', r'''
+main(int callback(int a, String b)) {
+}
+''');
+  }
+
+  void test_true_implementsClause_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {}
+class B implements A {}
+''', r'''
+class A {}
+class B implements A {}
+''');
+  }
+
+  void test_true_import_hide_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async' hide Future, Stream;
+''', r'''
+import 'dart:async' hide Stream, Future;
+''');
+  }
+
+  void test_true_import_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async';
+import 'dart:math';
+''', r'''
+import 'dart:math';
+import 'dart:async';
+''');
+  }
+
+  void test_true_import_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async';
+import 'dart:math';
+''', r'''
+import 'dart:async';
+import 'dart:math';
+''');
+  }
+
+  void test_true_import_prefix() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async' as async;
+''', r'''
+import 'dart:async' as async;
+''');
+  }
+
+  void test_true_import_show_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async' show Future, Stream;
+''', r'''
+import 'dart:async' show Stream, Future;
+''');
+  }
+
+  void test_true_method_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  a() {}
+  b() {}
+  c() {}
+}
+''', r'''
+class A {
+  c() {}
+  a() {}
+  b() {}
+}
+''');
+  }
+
+  void test_true_method_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  a() {}
+  b() {}
+  c() {}
+}
+''', r'''
+class A {
+  a() {}
+  b() {}
+  c() {}
+}
+''');
+  }
+
+  void test_true_method_operator_minus() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  operator -(other) {}
+}
+''', r'''
+class A {
+  operator -(other) {}
+}
+''');
+  }
+
+  void test_true_method_operator_minusUnary() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  operator -() {}
+}
+''', r'''
+class A {
+  operator -() {}
+}
+''');
+  }
+
+  void test_true_method_operator_plus() {
+    _assertCompilationUnitMatches(true, r'''
+class A {
+  operator +(other) {}
+}
+''', r'''
+class A {
+  operator +(other) {}
+}
+''');
+  }
+
+  void test_true_part_list_reorder() {
+    addNamedSource('/unitA.dart', 'part of lib; class A {}');
+    addNamedSource('/unitB.dart', 'part of lib; class B {}');
+    _assertCompilationUnitMatches(true, r'''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''', r'''
+library lib;
+part 'unitB.dart';
+part 'unitA.dart';
+''');
+  }
+
+  void test_true_part_list_same() {
+    addNamedSource('/unitA.dart', 'part of lib; class A {}');
+    addNamedSource('/unitB.dart', 'part of lib; class B {}');
+    _assertCompilationUnitMatches(true, r'''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''', r'''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''');
+  }
+
+  void test_true_SimpleFormalParameter_optional_differentName() {
+    _assertCompilationUnitMatches(true, r'''
+main([int oldName]) {
+}
+''', r'''
+main([int newName]) {
+}
+''');
+  }
+
+  void test_true_SimpleFormalParameter_optionalDefault_differentName() {
+    _assertCompilationUnitMatches(true, r'''
+main([int oldName = 1]) {
+}
+''', r'''
+main([int newName = 1]) {
+}
+''');
+  }
+
+  void test_true_SimpleFormalParameter_required_differentName() {
+    _assertCompilationUnitMatches(true, r'''
+main(int oldName) {
+}
+''', r'''
+main(int newName) {
+}
+''');
+  }
+
+  void test_true_topLevelAccessor_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+set a(x) {}
+set b(x) {}
+set c(x) {}
+''', r'''
+set c(x) {}
+set a(x) {}
+set b(x) {}
+''');
+  }
+
+  void test_true_topLevelAccessor_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+get a => 1;
+get b => 2;
+get c => 3;
+''', r'''
+get a => 1;
+get b => 2;
+get c => 3;
+''');
+  }
+
+  void test_true_topLevelFunction_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+a() {}
+b() {}
+c() {}
+''', r'''
+c() {}
+a() {}
+b() {}
+''');
+  }
+
+  void test_true_topLevelFunction_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+a() {}
+b() {}
+c() {}
+''', r'''
+a() {}
+b() {}
+c() {}
+''');
+  }
+
+  void test_true_topLevelVariable_list_reorder() {
+    _assertCompilationUnitMatches(true, r'''
+const int A = 1;
+const int B = 2;
+const int C = 3;
+''', r'''
+const int C = 3;
+const int A = 1;
+const int B = 2;
+''');
+  }
+
+  void test_true_topLevelVariable_list_same() {
+    _assertCompilationUnitMatches(true, r'''
+const int A = 1;
+const int B = 2;
+const int C = 3;
+''', r'''
+const int A = 1;
+const int B = 2;
+const int C = 3;
+''');
+  }
+
+  void test_true_topLevelVariable_type_sameArgs() {
+    _assertCompilationUnitMatches(true, r'''
+Map<int, String> A;
+''', r'''
+Map<int, String> A;
+''');
+  }
+
+  void test_true_type_dynamic() {
+    _assertCompilationUnitMatches(true, r'''
+dynamic a() {}
+''', r'''
+dynamic a() {}
+''');
+  }
+
+  void test_true_type_hasImportPrefix() {
+    _assertCompilationUnitMatches(true, r'''
+import 'dart:async' as async;
+async.Future F;
+''', r'''
+import 'dart:async' as async;
+async.Future F;
+''');
+  }
+
+  void test_true_type_noTypeArguments_implyAllDynamic() {
+    _assertCompilationUnitMatches(true, r'''
+class A<T> {}
+A main() {
+}
+''', r'''
+class A<T> {}
+A main() {
+}
+''');
+  }
+
+  void test_true_type_void() {
+    _assertCompilationUnitMatches(true, r'''
+void a() {}
+''', r'''
+void a() {}
+''');
+  }
+
+  void test_true_withClause_same() {
+    _assertCompilationUnitMatches(true, r'''
+class A {}
+class B extends Object with A {}
+''', r'''
+class A {}
+class B extends Object with A {}
+''');
+  }
+
+  void _assertCompilationUnitMatches(bool expectMatch, String oldContent,
+      String newContent) {
+    Source source = addSource(oldContent);
+    LibraryElement library = resolve(source);
+    CompilationUnit oldUnit = resolveCompilationUnit(source, library);
+    CompilationUnit newUnit = ParserTestCase.parseCompilationUnit(newContent);
+    DeclarationMatcher matcher = new DeclarationMatcher();
+    expect(matcher.matches(newUnit, oldUnit.element), expectMatch);
+  }
+}
+
+
+class IncrementalResolverTest extends ResolverTestCase {
+  Source source;
+  String code;
+  LibraryElement library;
+  CompilationUnit unit;
+
+  void test_classMemberAccessor_body() {
+    _resolveUnit(r'''
+class A {
+  int get test {
+    return 1 + 2;
+  }
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_constructor_body() {
+    _resolveUnit(r'''
+class A {
+  int f;
+  A(int a, int b) {
+    f = a + b;
+  }
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_constructor_fieldInitializer_add() {
+    _resolveUnit(r'''
+class A {
+  int f;
+  A(int a, int b);
+}''');
+    _resolve(_editString(');', ') : f = a + b;'), _isClassMember);
+  }
+
+  void test_constructor_fieldInitializer_edit() {
+    _resolveUnit(r'''
+class A {
+  int f;
+  A(int a, int b) : f = a + b {
+    int a = 42;
+  }
+}''');
+    _resolve(_editString('+', '*'), _isExpression);
+  }
+
+  void test_constructor_superConstructorInvocation() {
+    _resolveUnit(r'''
+class A {
+  A(int p);
+}
+class B extends A {
+  B(int a, int b) : super(a + b);
+}
+''');
+    _resolve(_editString('+', '*'), _isExpression);
+  }
+
+  void test_functionBody_body() {
+    _resolveUnit(r'''
+main(int a, int b) {
+  return a + b;
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_functionBody_expression() {
+    _resolveUnit(r'''
+main(int a, int b) => a + b;
+''');
+    _resolve(_editString('+', '*'), _isExpression);
+  }
+
+  void test_functionBody_statement() {
+    _resolveUnit(r'''
+main(int a, int b) {
+  return a + b;
+}''');
+    _resolve(_editString('+', '*'), _isStatement);
+  }
+
+  void test_method_body() {
+    _resolveUnit(r'''
+class A {
+  m(int a, int b) {
+    return a + b;
+  }
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_method_label_add() {
+    _resolveUnit(r'''
+class A {
+  int m(int a, int b) {
+    return a + b;
+  }
+}
+''');
+    _resolve(_editString('return', 'label: return'), _isBlock);
+  }
+
+  void test_method_localVariable_add() {
+    _resolveUnit(r'''
+class A {
+  int m(int a, int b) {
+    return a + b;
+  }
+}
+''');
+    _resolve(_editString('    return a + b;', r'''
+    int res = a + b;
+    return res;
+'''), _isBlock);
+  }
+
+  void test_method_parameter_rename() {
+    _resolveUnit(r'''
+class A {
+  int m(int a, int b, int c) {
+    return a + b + c;
+  }
+}
+''');
+    _resolve(_editString(r'''(int a, int b, int c) {
+    return a + b + c;''', r'''(int a, int second, int c) {
+    return a + second + c;'''), _isDeclaration);
+  }
+
+  void test_superInvocation() {
+    _resolveUnit(r'''
+class A {
+  foo(p) {}
+}
+class B extends A {
+  bar() {
+    super.foo(1 + 2);
+  }
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_topLevelAccessor_body() {
+    _resolveUnit(r'''
+int get test {
+  return 1 + 2;
+}''');
+    _resolve(_editString('+', '*'), _isFunctionBody);
+  }
+
+  void test_topLevelFunction_label_add() {
+    _resolveUnit(r'''
+int main(int a, int b) {
+  return a + b;
+}
+''');
+    _resolve(_editString('  return', 'label: return a + b;'), _isBlock);
+  }
+
+  void test_topLevelFunction_label_remove() {
+    _resolveUnit(r'''
+int main(int a, int b) {
+  label: return a + b;
+}
+''');
+    _resolve(_editString('label: ', ''), _isBlock);
+  }
+
+  void test_topLevelFunction_localVariable_add() {
+    _resolveUnit(r'''
+int main(int a, int b) {
+  return a + b;
+}
+''');
+    _resolve(_editString('  return a + b;', r'''
+  int res = a + b;
+  return res;
+'''), _isBlock);
+  }
+
+  void test_topLevelFunction_localVariable_remove() {
+    _resolveUnit(r'''
+int main(int a, int b) {
+  int res = a * b;
+  return a + b;
+}
+''');
+    _resolve(_editString('int res = a * b;', ''), _isBlock);
+  }
+
+  void test_topLevelFunction_parameter_rename() {
+    _resolveUnit(r'''
+int main(int a, int b) {
+  return a + b;
+}
+''');
+    _resolve(_editString(r'''(int a, int b) {
+  return a + b;''', r'''(int first, int b) {
+  return first + b;'''), _isDeclaration);
+  }
+
+  void test_topLevelVariable_initializer() {
+    _resolveUnit(r'''
+int C = 1 + 2;
+''');
+    _resolve(_editString('+', '*'), _isExpression);
+  }
+
+  void test_updateElementOffset() {
+    _resolveUnit(r'''
+class A {
+  int am(String ap) {
+    int av = 1;
+    return av;
+  }
+}
+main(int a, int b) {
+  return a + b;
+}
+class B {
+  int bm(String bp) {
+    int bv = 1;
+    return bv;
+  }
+}
+''');
+    _resolve(_editString('+', ' + '), _isStatement);
+  }
+
+  _Edit _editString(String search, String replacement, [int length]) {
+    int offset = code.indexOf(search);
+    expect(offset, isNot(-1));
+    if (length == null) {
+      length = search.length;
+    }
+    return new _Edit(offset, length, replacement);
+  }
+
+  /**
+   * Applies [edit] to [code], find the [AstNode] specified by [predicate]
+   * and incrementally resolves it.
+   *
+   * Then resolves the new code from scratch and validates that results of
+   * the incremental resolution and non-incremental resolutions are the same.
+   */
+  void _resolve(_Edit edit, Predicate<AstNode> predicate) {
+    int offset = edit.offset;
+    // parse "newCode"
+    String newCode =
+        code.substring(0, offset) +
+        edit.replacement +
+        code.substring(offset + edit.length);
+    CompilationUnit newUnit = _parseUnit(newCode);
+    // update tokens
+    {
+      int delta = edit.replacement.length - edit.length;
+      _shiftTokens(unit.beginToken, offset, delta);
+    }
+    // replace the node
+    AstNode oldNode = _findNodeAt(unit, offset, predicate);
+    AstNode newNode = _findNodeAt(newUnit, offset, predicate);
+    bool success = NodeReplacer.replace(oldNode, newNode);
+    expect(success, isTrue);
+    // do incremental resolution
+    IncrementalResolver resolver = new IncrementalResolver(
+        typeProvider,
+        library,
+        unit.element,
+        source,
+        edit.offset,
+        edit.length,
+        edit.replacement.length);
+    resolver.resolve(newNode);
+    // resolve "newCode" from scratch
+    CompilationUnit fullNewUnit;
+    {
+      source = addSource(newCode);
+      LibraryElement library = resolve(source);
+      fullNewUnit = resolveCompilationUnit(source, library);
+    }
+    _SameResolutionValidator.assertSameResolution(unit, fullNewUnit);
+  }
+
+  void _resolveUnit(String code) {
+    this.code = code;
+    source = addSource(code);
+    library = resolve(source);
+    unit = resolveCompilationUnit(source, library);
+  }
+
+  static AstNode _findNodeAt(CompilationUnit oldUnit, int offset,
+      Predicate<AstNode> predicate) {
+    NodeLocator locator = new NodeLocator.con1(offset);
+    AstNode node = locator.searchWithin(oldUnit);
+    return node.getAncestor(predicate);
+  }
+
+  static bool _isBlock(AstNode node) => node is Block;
+
+  static bool _isClassMember(AstNode node) => node is ClassMember;
+
+  static bool _isDeclaration(AstNode node) => node is Declaration;
+
+  static bool _isExpression(AstNode node) => node is Expression;
+
+  static bool _isFunctionBody(AstNode node) => node is FunctionBody;
+
+  static bool _isStatement(AstNode node) => node is Statement;
+
+  static CompilationUnit _parseUnit(String code) {
+    var errorListener = new BooleanErrorListener();
+    var reader = new CharSequenceReader(code);
+    var scanner = new Scanner(null, reader, errorListener);
+    var token = scanner.tokenize();
+    var parser = new Parser(null, errorListener);
+    return parser.parseCompilationUnit(token);
+  }
+
+  static void _shiftTokens(Token token, int afterOffset, int delta) {
+    while (token.type != TokenType.EOF) {
+      if (token.offset >= afterOffset) {
+        token.applyDelta(delta);
+      }
+      token = token.next;
+    }
+  }
+}
+
+
+/**
+ * The test for [poorMansIncrementalResolution] function and its integration
+ * into [AnalysisContext].
+ */
+class PoorMansIncrementalResolutionTest extends ResolverTestCase {
+  Source source;
+  String code;
+  LibraryElement oldLibrary;
+  CompilationUnit oldUnit;
+  CompilationUnitElement oldUnitElement;
+
+  void setUp() {
+    super.setUp();
+    _resetWithIncremental(true);
+  }
+
+  void test_false_topLevelFunction_name() {
+    _resolveUnit(r'''
+a() {}
+b() {}
+''');
+    _updateAndValidate(r'''
+a() {}
+bb() {}
+''', expectedSuccess: false);
+  }
+
+  void test_inBody_expression() {
+    _resolveUnit(r'''
+class A {
+  m() {
+    print(1);
+  }
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  m() {
+    print(2 + 3);
+  }
+}
+''');
+  }
+
+  void test_inBody_insertStatement() {
+    _resolveUnit(r'''
+main() {
+  print(1);
+}
+''');
+    _updateAndValidate(r'''
+main() {
+  print(0);
+  print(1);
+}
+''');
+  }
+
+  void test_inBody_tokenToNode() {
+    _resolveUnit(r'''
+main() {
+  var v = 42;
+  print(v);
+}
+''');
+    _updateAndValidate(r'''
+main() {
+  int v = 42;
+  print(v);
+}
+''');
+  }
+
+  void test_multiple_emptyLine() {
+    _resolveUnit(r'''
+class A {
+  m() {
+    return true;
+  }
+}''');
+    for (int i = 0; i < 6; i++) {
+      if (i.isEven) {
+        _updateAndValidate(r'''
+class A {
+  m() {
+    return true;
+
+  }
+}''', compareWithFull: false);
+      } else {
+        _updateAndValidate(r'''
+class A {
+  m() {
+    return true;
+  }
+}''', compareWithFull: false);
+      }
+    }
+  }
+
+  void test_multiple_expression() {
+    _resolveUnit(r'''
+main() {
+  print(1);
+}''');
+    for (int i = 0; i < 6; i++) {
+      if (i.isEven) {
+        _updateAndValidate(r'''
+main() {
+  print(12);
+}''', compareWithFull: false);
+      } else {
+        _updateAndValidate(r'''
+main() {
+  print(1);
+}''', compareWithFull: false);
+      }
+    }
+  }
+
+  void test_true_emptyLine_betweenClassMembers_insert() {
+    _resolveUnit(r'''
+class A {
+  a() {}
+  b() {}
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  a() {}
+
+  b() {}
+}
+''');
+  }
+
+  void test_true_emptyLine_betweenClassMembers_remove() {
+    _resolveUnit(r'''
+class A {
+  a() {}
+
+  b() {}
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  a() {}
+  b() {}
+}
+''');
+  }
+
+  void test_true_emptyLine_betweenCompilationUnitMembers_insert() {
+    _resolveUnit(r'''
+a() {}
+b() {}
+''');
+    _updateAndValidate(r'''
+a() {}
+
+b() {}
+''');
+  }
+
+  void test_true_emptyLine_betweenCompilationUnitMembers_remove() {
+    _resolveUnit(r'''
+a() {
+  print(1)
+}
+
+b() {
+  foo(42);
+}
+foo(String p) {};
+''');
+    _updateAndValidate(r'''
+a() {
+  print(1)
+}
+b() {
+  foo(42);
+}
+foo(String p) {};
+''');
+  }
+
+  void test_true_wholeConstructor() {
+    _resolveUnit(r'''
+class A {
+  A(int a) {
+    print(a);
+  }
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  A(int b) {
+    print(b);
+  }
+}
+''');
+  }
+
+  void test_true_wholeConstructor_addInitializer() {
+    _resolveUnit(r'''
+class A {
+  int field;
+  A();
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  int field;
+  A() : field = 5;
+}
+''');
+  }
+
+  void test_true_wholeFunction() {
+    _resolveUnit(r'''
+foo() {}
+main(int a) {
+  print(a);
+}
+''');
+    _updateAndValidate(r'''
+foo() {}
+main(int b) {
+  print(b);
+}
+''');
+  }
+
+  void test_true_wholeFunction_firstTokenInUnit() {
+    _resolveUnit(r'''
+main(int a) {
+  print(a);
+}
+''');
+    _updateAndValidate(r'''
+main(int b) {
+  print(b);
+}
+''');
+  }
+
+  void test_true_wholeMethod() {
+    _resolveUnit(r'''
+class A {
+  main(int a) {
+    print(a);
+  }
+}
+''');
+    _updateAndValidate(r'''
+class A {
+  main(int b) {
+    print(b);
+  }
+}
+''');
+  }
+
+  void test_updateErrors_addNew_hints() {
+    _resolveUnit(r'''
+main() {
+  int v = 0;
+  print(v);
+}
+''');
+    _updateAndValidate(r'''
+main() {
+  int v = 0;
+}
+''');
+  }
+
+  void test_updateErrors_addNew_parse() {
+    _resolveUnit(r'''
+main() {
+  print(42);
+}
+''');
+    _updateAndValidate(r'''
+main() {
+  print(42)
+}
+''');
+  }
+
+  void test_updateErrors_addNew_resolve() {
+    _resolveUnit(r'''
+main() {
+  foo();
+}
+foo() {}
+''');
+    _updateAndValidate(r'''
+main() {
+  bar();
+}
+foo() {}
+''');
+  }
+
+  void test_updateErrors_addNew_scan() {
+    _resolveUnit(r'''
+main() {
+  1;
+}
+''');
+    _updateAndValidate(r'''
+main() {
+  1e;
+}
+''');
+  }
+
+  void test_updateErrors_addNew_verify() {
+    _resolveUnit(r'''
+main() {
+  foo(0);
+}
+foo(int p) {}
+''');
+    _updateAndValidate(r'''
+main() {
+  foo('abc');
+}
+foo(int p) {}
+''');
+  }
+
+  void test_updateErrors_removeExisting() {
+    _resolveUnit(r'''
+f1() {
+  print(1)
+}
+f2() {
+  print(22)
+}
+f3() {
+  print(333)
+}
+''');
+    _updateAndValidate(r'''
+f1() {
+  print(1)
+}
+f2() {
+  print(22);
+}
+f3() {
+  print(333)
+}
+''');
+  }
+
+  void test_updateErrors_shiftExisting() {
+    _resolveUnit(r'''
+f1() {
+  print(1)
+}
+f2() {
+  print(2);
+}
+f3() {
+  print(333)
+}
+''');
+    _updateAndValidate(r'''
+f1() {
+  print(1)
+}
+f2() {
+  print(22);
+}
+f3() {
+  print(333)
+}
+''');
+  }
+
+  /**
+   * Reset the analysis context to have the 'incremental' option set to the
+   * given value.
+   */
+  void _resetWithIncremental(bool enable) {
+    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
+    analysisOptions.incremental = enable;
+    analysisContext2.analysisOptions = analysisOptions;
+  }
+
+  void _resolveUnit(String code) {
+    this.code = code;
+    source = addSource(code);
+    oldLibrary = resolve(source);
+    oldUnit = resolveCompilationUnit(source, oldLibrary);
+    oldUnitElement = oldUnit.element;
+  }
+
+  void _runTasks() {
+    AnalysisResult result = analysisContext.performAnalysisTask();
+    while (result.changeNotices != null) {
+      result = analysisContext.performAnalysisTask();
+    }
+  }
+
+  void _updateAndValidate(String newCode, {bool expectedSuccess: true,
+      bool compareWithFull: true}) {
+    // Run any pending tasks tasks.
+    _runTasks();
+    // Update the source - currently this may cause incremental resolution.
+    // Then request the updated resolved unit.
+    _resetWithIncremental(true);
+    analysisContext2.setContents(source, newCode);
+    CompilationUnit newUnit = resolveCompilationUnit(source, oldLibrary);
+    List<AnalysisError> newErrors = analysisContext.getErrors(source).errors;
+    // check for expected failure
+    if (!expectedSuccess) {
+      expect(newUnit.element, isNot(same(oldUnitElement)));
+      return;
+    }
+    // The existing CompilationUnitElement should be updated.
+    expect(newUnit.element, same(oldUnitElement));
+    // The only expected pending task should return the same resolved
+    // "newUnit", so all clients will get it using the usual way.
+    AnalysisResult analysisResult = analysisContext.performAnalysisTask();
+    ChangeNotice notice = analysisResult.changeNotices[0];
+    expect(notice.compilationUnit, same(newUnit));
+    // Resolve "newCode" from scratch.
+    if (compareWithFull) {
+      _resetWithIncremental(false);
+      source = addSource(newCode);
+      _runTasks();
+      LibraryElement library = resolve(source);
+      CompilationUnit fullNewUnit = resolveCompilationUnit(source, library);
+      // Validate that "incremental" and "full" units have the same resolution.
+      _SameResolutionValidator.assertSameResolution(newUnit, fullNewUnit);
+      _assertEqualTokens(newUnit, fullNewUnit);
+      List<AnalysisError> newFullErrors =
+          analysisContext.getErrors(source).errors;
+      _assertEqualErrors(newErrors, newFullErrors);
+      // TODO(scheglov) check line info
+    }
+  }
+
+  static void _assertEqualError(AnalysisError incrError,
+      AnalysisError fullError) {
+    expect(incrError.errorCode, same(fullError.errorCode));
+    expect(incrError.source, fullError.source);
+    expect(incrError.offset, fullError.offset);
+    expect(incrError.length, fullError.length);
+    expect(incrError.message, fullError.message);
+  }
+
+  static void _assertEqualErrors(List<AnalysisError> incrErrors,
+      List<AnalysisError> fullErrors) {
+    expect(incrErrors, hasLength(fullErrors.length));
+    if (incrErrors.isNotEmpty) {
+      incrErrors.sort((a, b) => a.offset - b.offset);
+    }
+    if (fullErrors.isNotEmpty) {
+      fullErrors.sort((a, b) => a.offset - b.offset);
+    }
+    int length = incrErrors.length;
+    for (int i = 0; i < length; i++) {
+      AnalysisError incrError = incrErrors[i];
+      AnalysisError fullError = fullErrors[i];
+      _assertEqualError(incrError, fullError);
+    }
+  }
+
+  static void _assertEqualToken(Token incrToken, Token fullToken) {
+    expect(incrToken.type, fullToken.type);
+    expect(incrToken.offset, fullToken.offset);
+    expect(incrToken.length, fullToken.length);
+    expect(incrToken.lexeme, fullToken.lexeme);
+  }
+
+  static void _assertEqualTokens(CompilationUnit incrUnit,
+      CompilationUnit fullUnit) {
+    Token incrToken = incrUnit.beginToken;
+    Token fullToken = fullUnit.beginToken;
+    while (incrToken.type != TokenType.EOF && fullToken.type != TokenType.EOF) {
+//      print('$incrToken @ ${incrToken.offset}');
+//      print('$fullToken @ ${fullToken.offset}');
+      _assertEqualToken(incrToken, fullToken);
+      incrToken = incrToken.next;
+      fullToken = fullToken.next;
+    }
+  }
+}
+
+
+class ResolutionContextBuilderTest extends EngineTestCase {
+  GatheringErrorListener listener = new GatheringErrorListener();
+
+  void test_scopeFor_ClassDeclaration() {
+    Scope scope = _scopeFor(_createResolvedClassDeclaration());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryScope,
+        LibraryScope,
+        scope);
+  }
+
+  void test_scopeFor_ClassTypeAlias() {
+    Scope scope = _scopeFor(_createResolvedClassTypeAlias());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryScope,
+        LibraryScope,
+        scope);
+  }
+
+  void test_scopeFor_CompilationUnit() {
+    Scope scope = _scopeFor(_createResolvedCompilationUnit());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryScope,
+        LibraryScope,
+        scope);
+  }
+
+  void test_scopeFor_ConstructorDeclaration() {
+    Scope scope = _scopeFor(_createResolvedConstructorDeclaration());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassScope,
+        ClassScope,
+        scope);
+  }
+
+  void test_scopeFor_ConstructorDeclaration_parameters() {
+    Scope scope = _scopeFor(_createResolvedConstructorDeclaration().parameters);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionScope,
+        FunctionScope,
+        scope);
+  }
+
+  void test_scopeFor_FunctionDeclaration() {
+    Scope scope = _scopeFor(_createResolvedFunctionDeclaration());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryScope,
+        LibraryScope,
+        scope);
+  }
+
+  void test_scopeFor_FunctionDeclaration_parameters() {
+    Scope scope =
+        _scopeFor(_createResolvedFunctionDeclaration().functionExpression.parameters);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionScope,
+        FunctionScope,
+        scope);
+  }
+
+  void test_scopeFor_FunctionTypeAlias() {
+    Scope scope = _scopeFor(_createResolvedFunctionTypeAlias());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryScope,
+        LibraryScope,
+        scope);
+  }
+
+  void test_scopeFor_FunctionTypeAlias_parameters() {
+    Scope scope = _scopeFor(_createResolvedFunctionTypeAlias().parameters);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionTypeScope,
+        FunctionTypeScope,
+        scope);
+  }
+
+  void test_scopeFor_MethodDeclaration() {
+    Scope scope = _scopeFor(_createResolvedMethodDeclaration());
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassScope,
+        ClassScope,
+        scope);
+  }
+
+  void test_scopeFor_MethodDeclaration_body() {
+    Scope scope = _scopeFor(_createResolvedMethodDeclaration().body);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionScope,
+        FunctionScope,
+        scope);
+  }
+
+  void test_scopeFor_notInCompilationUnit() {
+    try {
+      _scopeFor(AstFactory.identifier3("x"));
+      fail("Expected AnalysisException");
+    } on AnalysisException catch (exception) {
+      // Expected
+    }
+  }
+
+  void test_scopeFor_null() {
+    try {
+      _scopeFor(null);
+      fail("Expected AnalysisException");
+    } on AnalysisException catch (exception) {
+      // Expected
+    }
+  }
+
+  void test_scopeFor_unresolved() {
+    try {
+      _scopeFor(AstFactory.compilationUnit());
+      fail("Expected AnalysisException");
+    } on AnalysisException catch (exception) {
+      // Expected
+    }
+  }
+
+  ClassDeclaration _createResolvedClassDeclaration() {
+    CompilationUnit unit = _createResolvedCompilationUnit();
+    String className = "C";
+    ClassDeclaration classNode = AstFactory.classDeclaration(
+        null,
+        className,
+        AstFactory.typeParameterList(),
+        null,
+        null,
+        null);
+    unit.declarations.add(classNode);
+    ClassElement classElement = ElementFactory.classElement2(className);
+    classNode.name.staticElement = classElement;
+    (unit.element as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
+    return classNode;
+  }
+
+  ClassTypeAlias _createResolvedClassTypeAlias() {
+    CompilationUnit unit = _createResolvedCompilationUnit();
+    String className = "C";
+    ClassTypeAlias classNode = AstFactory.classTypeAlias(
+        className,
+        AstFactory.typeParameterList(),
+        null,
+        null,
+        null,
+        null);
+    unit.declarations.add(classNode);
+    ClassElement classElement = ElementFactory.classElement2(className);
+    classNode.name.staticElement = classElement;
+    (unit.element as CompilationUnitElementImpl).types =
+        <ClassElement>[classElement];
+    return classNode;
+  }
+
+  CompilationUnit _createResolvedCompilationUnit() {
+    CompilationUnit unit = AstFactory.compilationUnit();
+    LibraryElementImpl library =
+        ElementFactory.library(AnalysisContextFactory.contextWithCore(), "lib");
+    unit.element = library.definingCompilationUnit;
+    return unit;
+  }
+
+  ConstructorDeclaration _createResolvedConstructorDeclaration() {
+    ClassDeclaration classNode = _createResolvedClassDeclaration();
+    String constructorName = "f";
+    ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(
+        AstFactory.identifier3(constructorName),
+        null,
+        AstFactory.formalParameterList(),
+        null);
+    classNode.members.add(constructorNode);
+    ConstructorElement constructorElement =
+        ElementFactory.constructorElement2(classNode.element, null);
+    constructorNode.element = constructorElement;
+    (classNode.element as ClassElementImpl).constructors =
+        <ConstructorElement>[constructorElement];
+    return constructorNode;
+  }
+
+  FunctionDeclaration _createResolvedFunctionDeclaration() {
+    CompilationUnit unit = _createResolvedCompilationUnit();
+    String functionName = "f";
+    FunctionDeclaration functionNode = AstFactory.functionDeclaration(
+        null,
+        null,
+        functionName,
+        AstFactory.functionExpression());
+    unit.declarations.add(functionNode);
+    FunctionElement functionElement =
+        ElementFactory.functionElement(functionName);
+    functionNode.name.staticElement = functionElement;
+    (unit.element as CompilationUnitElementImpl).functions =
+        <FunctionElement>[functionElement];
+    return functionNode;
+  }
+
+  FunctionTypeAlias _createResolvedFunctionTypeAlias() {
+    CompilationUnit unit = _createResolvedCompilationUnit();
+    FunctionTypeAlias aliasNode = AstFactory.typeAlias(
+        AstFactory.typeName4("A"),
+        "F",
+        AstFactory.typeParameterList(),
+        AstFactory.formalParameterList());
+    unit.declarations.add(aliasNode);
+    SimpleIdentifier aliasName = aliasNode.name;
+    FunctionTypeAliasElement aliasElement =
+        new FunctionTypeAliasElementImpl.forNode(aliasName);
+    aliasName.staticElement = aliasElement;
+    (unit.element as CompilationUnitElementImpl).typeAliases =
+        <FunctionTypeAliasElement>[aliasElement];
+    return aliasNode;
+  }
+
+  MethodDeclaration _createResolvedMethodDeclaration() {
+    ClassDeclaration classNode = _createResolvedClassDeclaration();
+    String methodName = "f";
+    MethodDeclaration methodNode = AstFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3(methodName),
+        AstFactory.formalParameterList());
+    classNode.members.add(methodNode);
+    MethodElement methodElement =
+        ElementFactory.methodElement(methodName, null);
+    methodNode.name.staticElement = methodElement;
+    (classNode.element as ClassElementImpl).methods =
+        <MethodElement>[methodElement];
+    return methodNode;
+  }
+
+  Scope _scopeFor(AstNode node) {
+    return ResolutionContextBuilder.contextFor(node, listener).scope;
+  }
+}
+
+
+class _Edit {
+  final int offset;
+  final int length;
+  final String replacement;
+  _Edit(this.offset, this.length, this.replacement);
+}
+
+
+class _SameResolutionValidator implements AstVisitor {
+  AstNode other;
+
+  _SameResolutionValidator(this.other);
+
+  @override
+  visitAdjacentStrings(AdjacentStrings node) {
+  }
+
+  @override
+  visitAnnotation(Annotation node) {
+    Annotation other = this.other;
+    _visitNode(node.name, other.name);
+    _visitNode(node.constructorName, other.constructorName);
+    _visitNode(node.arguments, other.arguments);
+    _verifyElement(node.element, other.element);
+  }
+
+  @override
+  visitArgumentList(ArgumentList node) {
+    ArgumentList other = this.other;
+    _visitList(node.arguments, other.arguments);
+  }
+
+  @override
+  visitAsExpression(AsExpression node) {
+    AsExpression other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.expression, other.expression);
+    _visitNode(node.type, other.type);
+  }
+
+  @override
+  visitAssertStatement(AssertStatement node) {
+    AssertStatement other = this.other;
+    _visitNode(node.condition, other.condition);
+  }
+
+  @override
+  visitAssignmentExpression(AssignmentExpression node) {
+    AssignmentExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.leftHandSide, other.leftHandSide);
+    _visitNode(node.rightHandSide, other.rightHandSide);
+  }
+
+  @override
+  visitAwaitExpression(AwaitExpression node) {
+    AwaitExpression other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitBinaryExpression(BinaryExpression node) {
+    BinaryExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.leftOperand, other.leftOperand);
+    _visitNode(node.rightOperand, other.rightOperand);
+  }
+
+  @override
+  visitBlock(Block node) {
+    Block other = this.other;
+    _visitList(node.statements, other.statements);
+  }
+
+  @override
+  visitBlockFunctionBody(BlockFunctionBody node) {
+    BlockFunctionBody other = this.other;
+    _visitNode(node.block, other.block);
+  }
+
+  @override
+  visitBooleanLiteral(BooleanLiteral node) {
+    BooleanLiteral other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitBreakStatement(BreakStatement node) {
+    BreakStatement other = this.other;
+    _visitNode(node.label, other.label);
+  }
+
+  @override
+  visitCascadeExpression(CascadeExpression node) {
+    CascadeExpression other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.target, other.target);
+    _visitList(node.cascadeSections, other.cascadeSections);
+  }
+
+  @override
+  visitCatchClause(CatchClause node) {
+    CatchClause other = this.other;
+    _visitNode(node.exceptionType, other.exceptionType);
+    _visitNode(node.exceptionParameter, other.exceptionParameter);
+    _visitNode(node.stackTraceParameter, other.stackTraceParameter);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    ClassDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+    _visitNode(node.typeParameters, other.typeParameters);
+    _visitNode(node.extendsClause, other.extendsClause);
+    _visitNode(node.implementsClause, other.implementsClause);
+    _visitNode(node.withClause, other.withClause);
+    _visitList(node.members, other.members);
+  }
+
+  @override
+  visitClassTypeAlias(ClassTypeAlias node) {
+    ClassTypeAlias other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+    _visitNode(node.typeParameters, other.typeParameters);
+    _visitNode(node.superclass, other.superclass);
+    _visitNode(node.withClause, other.withClause);
+  }
+
+  @override
+  visitComment(Comment node) {
+    Comment other = this.other;
+    _visitList(node.references, other.references);
+  }
+
+  @override
+  visitCommentReference(CommentReference node) {
+    CommentReference other = this.other;
+    _visitNode(node.identifier, other.identifier);
+  }
+
+  @override
+  visitCompilationUnit(CompilationUnit node) {
+    CompilationUnit other = this.other;
+    _verifyElement(node.element, other.element);
+    _visitList(node.directives, other.directives);
+    _visitList(node.declarations, other.declarations);
+  }
+
+  @override
+  visitConditionalExpression(ConditionalExpression node) {
+    ConditionalExpression other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.condition, other.condition);
+    _visitNode(node.thenExpression, other.thenExpression);
+    _visitNode(node.elseExpression, other.elseExpression);
+  }
+
+  @override
+  visitConstructorDeclaration(ConstructorDeclaration node) {
+    ConstructorDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.returnType, other.returnType);
+    _visitNode(node.name, other.name);
+    _visitNode(node.parameters, other.parameters);
+    _visitNode(node.redirectedConstructor, other.redirectedConstructor);
+    _visitList(node.initializers, other.initializers);
+  }
+
+  @override
+  visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    ConstructorFieldInitializer other = this.other;
+    _visitNode(node.fieldName, other.fieldName);
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitConstructorName(ConstructorName node) {
+    ConstructorName other = this.other;
+    _verifyElement(node.staticElement, other.staticElement);
+    _visitNode(node.type, other.type);
+    _visitNode(node.name, other.name);
+  }
+
+  @override
+  visitContinueStatement(ContinueStatement node) {
+    ContinueStatement other = this.other;
+    _visitNode(node.label, other.label);
+  }
+
+  @override
+  visitDeclaredIdentifier(DeclaredIdentifier node) {
+    DeclaredIdentifier other = this.other;
+    _visitNode(node.type, other.type);
+    _visitNode(node.identifier, other.identifier);
+  }
+
+  @override
+  visitDefaultFormalParameter(DefaultFormalParameter node) {
+    DefaultFormalParameter other = this.other;
+    _visitNode(node.parameter, other.parameter);
+    _visitNode(node.defaultValue, other.defaultValue);
+  }
+
+  @override
+  visitDoStatement(DoStatement node) {
+    DoStatement other = this.other;
+    _visitNode(node.condition, other.condition);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitDoubleLiteral(DoubleLiteral node) {
+    DoubleLiteral other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitEmptyFunctionBody(EmptyFunctionBody node) {
+  }
+
+  @override
+  visitEmptyStatement(EmptyStatement node) {
+  }
+
+  @override
+  visitEnumConstantDeclaration(EnumConstantDeclaration node) {
+    EnumConstantDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+  }
+
+  @override
+  visitEnumDeclaration(EnumDeclaration node) {
+    EnumDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+    _visitList(node.constants, other.constants);
+  }
+
+  @override
+  visitExportDirective(ExportDirective node) {
+    ExportDirective other = this.other;
+    _visitDirective(node, other);
+  }
+
+  @override
+  visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    ExpressionFunctionBody other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitExpressionStatement(ExpressionStatement node) {
+    ExpressionStatement other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitExtendsClause(ExtendsClause node) {
+    ExtendsClause other = this.other;
+    _visitNode(node.superclass, other.superclass);
+  }
+
+  @override
+  visitFieldDeclaration(FieldDeclaration node) {
+    FieldDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.fields, other.fields);
+  }
+
+  @override
+  visitFieldFormalParameter(FieldFormalParameter node) {
+    FieldFormalParameter other = this.other;
+    _visitNormalFormalParameter(node, other);
+    _visitNode(node.type, other.type);
+    _visitNode(node.parameters, other.parameters);
+  }
+
+  @override
+  visitForEachStatement(ForEachStatement node) {
+    ForEachStatement other = this.other;
+    _visitNode(node.identifier, other.identifier);
+    _visitNode(node.loopVariable, other.loopVariable);
+    _visitNode(node.iterable, other.iterable);
+  }
+
+  @override
+  visitFormalParameterList(FormalParameterList node) {
+    FormalParameterList other = this.other;
+    _visitList(node.parameters, other.parameters);
+  }
+
+  @override
+  visitForStatement(ForStatement node) {
+    ForStatement other = this.other;
+    _visitNode(node.variables, other.variables);
+    _visitNode(node.initialization, other.initialization);
+    _visitNode(node.condition, other.condition);
+    _visitList(node.updaters, other.updaters);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitFunctionDeclaration(FunctionDeclaration node) {
+    FunctionDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.returnType, other.returnType);
+    _visitNode(node.name, other.name);
+    _visitNode(node.functionExpression, other.functionExpression);
+  }
+
+  @override
+  visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
+    FunctionDeclarationStatement other = this.other;
+    _visitNode(node.functionDeclaration, other.functionDeclaration);
+  }
+
+  @override
+  visitFunctionExpression(FunctionExpression node) {
+    FunctionExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.element, other.element);
+    _visitNode(node.parameters, other.parameters);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    FunctionExpressionInvocation other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.function, other.function);
+    _visitNode(node.argumentList, other.argumentList);
+  }
+
+  @override
+  visitFunctionTypeAlias(FunctionTypeAlias node) {
+    FunctionTypeAlias other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.returnType, other.returnType);
+    _visitNode(node.name, other.name);
+    _visitNode(node.typeParameters, other.typeParameters);
+    _visitNode(node.parameters, other.parameters);
+  }
+
+  @override
+  visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+    FunctionTypedFormalParameter other = this.other;
+    _visitNormalFormalParameter(node, other);
+    _visitNode(node.returnType, other.returnType);
+    _visitNode(node.parameters, other.parameters);
+  }
+
+  @override
+  visitHideCombinator(HideCombinator node) {
+    HideCombinator other = this.other;
+    _visitList(node.hiddenNames, other.hiddenNames);
+  }
+
+  @override
+  visitIfStatement(IfStatement node) {
+    IfStatement other = this.other;
+    _visitNode(node.condition, other.condition);
+    _visitNode(node.thenStatement, other.thenStatement);
+    _visitNode(node.elseStatement, other.elseStatement);
+  }
+
+  @override
+  visitImplementsClause(ImplementsClause node) {
+    ImplementsClause other = this.other;
+    _visitList(node.interfaces, other.interfaces);
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    ImportDirective other = this.other;
+    _visitDirective(node, other);
+    _visitNode(node.prefix, other.prefix);
+    _verifyElement(node.uriElement, other.uriElement);
+  }
+
+  @override
+  visitIndexExpression(IndexExpression node) {
+    IndexExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.target, other.target);
+    _visitNode(node.index, other.index);
+  }
+
+  @override
+  visitInstanceCreationExpression(InstanceCreationExpression node) {
+    InstanceCreationExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _visitNode(node.constructorName, other.constructorName);
+    _visitNode(node.argumentList, other.argumentList);
+  }
+
+  @override
+  visitIntegerLiteral(IntegerLiteral node) {
+    IntegerLiteral other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitInterpolationExpression(InterpolationExpression node) {
+    InterpolationExpression other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitInterpolationString(InterpolationString node) {
+  }
+
+  @override
+  visitIsExpression(IsExpression node) {
+    IsExpression other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.expression, other.expression);
+    _visitNode(node.type, other.type);
+  }
+
+  @override
+  visitLabel(Label node) {
+    Label other = this.other;
+    _visitNode(node.label, other.label);
+  }
+
+  @override
+  visitLabeledStatement(LabeledStatement node) {
+    LabeledStatement other = this.other;
+    _visitList(node.labels, other.labels);
+    _visitNode(node.statement, other.statement);
+  }
+
+  @override
+  visitLibraryDirective(LibraryDirective node) {
+    LibraryDirective other = this.other;
+    _visitDirective(node, other);
+    _visitNode(node.name, other.name);
+  }
+
+  @override
+  visitLibraryIdentifier(LibraryIdentifier node) {
+    LibraryIdentifier other = this.other;
+    _visitList(node.components, other.components);
+  }
+
+  @override
+  visitListLiteral(ListLiteral node) {
+    ListLiteral other = this.other;
+    _visitExpression(node, other);
+    _visitList(node.elements, other.elements);
+  }
+
+  @override
+  visitMapLiteral(MapLiteral node) {
+    MapLiteral other = this.other;
+    _visitExpression(node, other);
+    _visitList(node.entries, other.entries);
+  }
+
+  @override
+  visitMapLiteralEntry(MapLiteralEntry node) {
+    MapLiteralEntry other = this.other;
+    _visitNode(node.key, other.key);
+    _visitNode(node.value, other.value);
+  }
+
+  @override
+  visitMethodDeclaration(MethodDeclaration node) {
+    MethodDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+    _visitNode(node.parameters, other.parameters);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    MethodInvocation other = this.other;
+    _visitNode(node.target, other.target);
+    _visitNode(node.methodName, other.methodName);
+    _visitNode(node.argumentList, other.argumentList);
+  }
+
+  @override
+  visitNamedExpression(NamedExpression node) {
+    NamedExpression other = this.other;
+    _visitNode(node.name, other.name);
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitNativeClause(NativeClause node) {
+  }
+
+  @override
+  visitNativeFunctionBody(NativeFunctionBody node) {
+  }
+
+  @override
+  visitNullLiteral(NullLiteral node) {
+    NullLiteral other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitParenthesizedExpression(ParenthesizedExpression node) {
+    ParenthesizedExpression other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitPartDirective(PartDirective node) {
+    PartDirective other = this.other;
+    _visitDirective(node, other);
+  }
+
+  @override
+  visitPartOfDirective(PartOfDirective node) {
+    PartOfDirective other = this.other;
+    _visitDirective(node, other);
+    _visitNode(node.libraryName, other.libraryName);
+  }
+
+  @override
+  visitPostfixExpression(PostfixExpression node) {
+    PostfixExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.operand, other.operand);
+  }
+
+  @override
+  visitPrefixedIdentifier(PrefixedIdentifier node) {
+    PrefixedIdentifier other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.prefix, other.prefix);
+    _visitNode(node.identifier, other.identifier);
+  }
+
+  @override
+  visitPrefixExpression(PrefixExpression node) {
+    PrefixExpression other = this.other;
+    _visitExpression(node, other);
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitNode(node.operand, other.operand);
+  }
+
+  @override
+  visitPropertyAccess(PropertyAccess node) {
+    PropertyAccess other = this.other;
+    _visitExpression(node, other);
+    _visitNode(node.target, other.target);
+    _visitNode(node.propertyName, other.propertyName);
+  }
+
+  @override
+  visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+    RedirectingConstructorInvocation other = this.other;
+    _verifyElement(node.staticElement, other.staticElement);
+    _visitNode(node.constructorName, other.constructorName);
+    _visitNode(node.argumentList, other.argumentList);
+  }
+
+  @override
+  visitRethrowExpression(RethrowExpression node) {
+    RethrowExpression other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitReturnStatement(ReturnStatement node) {
+    ReturnStatement other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitScriptTag(ScriptTag node) {
+  }
+
+  @override
+  visitShowCombinator(ShowCombinator node) {
+    ShowCombinator other = this.other;
+    _visitList(node.shownNames, other.shownNames);
+  }
+
+  @override
+  visitSimpleFormalParameter(SimpleFormalParameter node) {
+    SimpleFormalParameter other = this.other;
+    _visitNormalFormalParameter(node, other);
+    _visitNode(node.type, other.type);
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    SimpleIdentifier other = this.other;
+    _verifyElement(node.staticElement, other.staticElement);
+    _verifyElement(node.propagatedElement, other.propagatedElement);
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitSimpleStringLiteral(SimpleStringLiteral node) {
+  }
+
+  @override
+  visitStringInterpolation(StringInterpolation node) {
+    StringInterpolation other = this.other;
+    _visitList(node.elements, other.elements);
+  }
+
+  @override
+  visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    SuperConstructorInvocation other = this.other;
+    _verifyElement(node.staticElement, other.staticElement);
+    _visitNode(node.constructorName, other.constructorName);
+    _visitNode(node.argumentList, other.argumentList);
+  }
+
+  @override
+  visitSuperExpression(SuperExpression node) {
+    SuperExpression other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitSwitchCase(SwitchCase node) {
+    SwitchCase other = this.other;
+    _visitList(node.labels, other.labels);
+    _visitNode(node.expression, other.expression);
+    _visitList(node.statements, other.statements);
+  }
+
+  @override
+  visitSwitchDefault(SwitchDefault node) {
+    SwitchDefault other = this.other;
+    _visitList(node.statements, other.statements);
+  }
+
+  @override
+  visitSwitchStatement(SwitchStatement node) {
+    SwitchStatement other = this.other;
+    _visitNode(node.expression, other.expression);
+    _visitList(node.members, other.members);
+  }
+
+  @override
+  visitSymbolLiteral(SymbolLiteral node) {
+  }
+
+  @override
+  visitThisExpression(ThisExpression node) {
+    ThisExpression other = this.other;
+    _visitExpression(node, other);
+  }
+
+  @override
+  visitThrowExpression(ThrowExpression node) {
+    ThrowExpression other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  @override
+  visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    TopLevelVariableDeclaration other = this.other;
+    _visitNode(node.variables, other.variables);
+  }
+
+  @override
+  visitTryStatement(TryStatement node) {
+    TryStatement other = this.other;
+    _visitNode(node.body, other.body);
+    _visitList(node.catchClauses, other.catchClauses);
+    _visitNode(node.finallyBlock, other.finallyBlock);
+  }
+
+  @override
+  visitTypeArgumentList(TypeArgumentList node) {
+    TypeArgumentList other = this.other;
+    _visitList(node.arguments, other.arguments);
+  }
+
+  @override
+  visitTypeName(TypeName node) {
+    TypeName other = this.other;
+    _verifyType(node.type, other.type);
+    _visitNode(node.name, node.name);
+    _visitNode(node.typeArguments, other.typeArguments);
+  }
+
+  @override
+  visitTypeParameter(TypeParameter node) {
+    TypeParameter other = this.other;
+    _visitNode(node.name, other.name);
+    _visitNode(node.bound, other.bound);
+  }
+
+  @override
+  visitTypeParameterList(TypeParameterList node) {
+    TypeParameterList other = this.other;
+    _visitList(node.typeParameters, other.typeParameters);
+  }
+
+  @override
+  visitVariableDeclaration(VariableDeclaration node) {
+    VariableDeclaration other = this.other;
+    _visitDeclaration(node, other);
+    _visitNode(node.name, other.name);
+    _visitNode(node.initializer, other.initializer);
+  }
+
+  @override
+  visitVariableDeclarationList(VariableDeclarationList node) {
+    VariableDeclarationList other = this.other;
+    _visitNode(node.type, other.type);
+    _visitList(node.variables, other.variables);
+  }
+
+  @override
+  visitVariableDeclarationStatement(VariableDeclarationStatement node) {
+    VariableDeclarationStatement other = this.other;
+    _visitNode(node.variables, other.variables);
+  }
+
+  @override
+  visitWhileStatement(WhileStatement node) {
+    WhileStatement other = this.other;
+    _visitNode(node.condition, other.condition);
+    _visitNode(node.body, other.body);
+  }
+
+  @override
+  visitWithClause(WithClause node) {
+    WithClause other = this.other;
+    _visitList(node.mixinTypes, other.mixinTypes);
+  }
+
+  @override
+  visitYieldStatement(YieldStatement node) {
+    YieldStatement other = this.other;
+    _visitNode(node.expression, other.expression);
+  }
+
+  void _verifyElement(Element a, Element b) {
+    if (a != b) {
+      fail('Expected: $b\n  Actual: $a');
+    }
+    if (a == null && b == null) {
+      return;
+    }
+    if (a.nameOffset != b.nameOffset) {
+      fail('Expected: ${b.nameOffset}\n  Actual: ${a.nameOffset}');
+    }
+  }
+
+  void _verifyType(DartType a, DartType b) {
+    expect(a, equals(b));
+  }
+
+  void _visitAnnotatedNode(AnnotatedNode node, AnnotatedNode other) {
+    _visitNode(node.documentationComment, other.documentationComment);
+    _visitList(node.metadata, other.metadata);
+  }
+
+  _visitDeclaration(Declaration node, Declaration other) {
+    _verifyElement(node.element, other.element);
+    _visitAnnotatedNode(node, other);
+  }
+
+  _visitDirective(Directive node, Directive other) {
+    _verifyElement(node.element, other.element);
+    _visitAnnotatedNode(node, other);
+  }
+
+  void _visitExpression(Expression a, Expression b) {
+    _verifyType(a.staticType, b.staticType);
+    _verifyType(a.propagatedType, b.propagatedType);
+    _verifyElement(a.staticParameterElement, b.staticParameterElement);
+    _verifyElement(a.propagatedParameterElement, b.propagatedParameterElement);
+  }
+
+  void _visitList(NodeList nodeList, NodeList otherList) {
+    int length = nodeList.length;
+    expect(otherList, hasLength(length));
+    for (int i = 0; i < length; i++) {
+      _visitNode(nodeList[i], otherList[i]);
+    }
+  }
+
+  void _visitNode(AstNode node, AstNode other) {
+    if (node == null) {
+      expect(other, isNull);
+    } else {
+      this.other = other;
+      node.accept(this);
+    }
+  }
+
+  void _visitNormalFormalParameter(NormalFormalParameter node,
+      NormalFormalParameter other) {
+    _verifyElement(node.element, other.element);
+    _visitNode(node.documentationComment, other.documentationComment);
+    _visitList(node.metadata, other.metadata);
+    _visitNode(node.identifier, other.identifier);
+  }
+
+  static void assertSameResolution(CompilationUnit actual,
+      CompilationUnit expected) {
+    _SameResolutionValidator validator = new _SameResolutionValidator(expected);
+    actual.accept(validator);
+  }
+}
diff --git a/pkg/analyzer/test/generated/incremental_scanner_test.dart b/pkg/analyzer/test/generated/incremental_scanner_test.dart
new file mode 100644
index 0000000..37cd800
--- /dev/null
+++ b/pkg/analyzer/test/generated/incremental_scanner_test.dart
@@ -0,0 +1,566 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library engine.incremental_scanner_test;
+
+import 'package:analyzer/src/generated/incremental_scanner.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:unittest/unittest.dart';
+
+import '../reflective_tests.dart';
+import 'test_support.dart';
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(IncrementalScannerTest);
+}
+
+class IncrementalScannerTest extends EngineTestCase {
+  /**
+   * The first token from the token stream resulting from parsing the original
+   * source, or `null` if [scan] has not been invoked.
+   */
+  Token _originalTokens;
+
+  /**
+   * The scanner used to perform incremental scanning, or `null` if [scan] has
+   * not been invoked.
+   */
+  IncrementalScanner _incrementalScanner;
+
+  /**
+   * The first token from the token stream resulting from performing an
+   * incremental scan, or `null` if [scan] has not been invoked.
+   */
+  Token _incrementalTokens;
+
+  void fail_insert_beginning() {
+    // This is currently reporting the changed range as being from 0 to 5, but
+    // that would force us to re-parse both classes, which is clearly
+    // sub-optimal.
+    //
+    // "class B {}"
+    // "class A {} class B {}"
+    _scan("", "", "class A {} ", "class B {}");
+    _assertTokens(-1, 4, ["class", "A", "{", "}", "class", "B", "{", "}"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void fail_insert_comment_afterIdentifier() {
+    // "a + b"
+    // "a /* TODO */ + b"
+    _scan("a", "", " /* TODO */", " + b");
+    _assertTokens(0, 1, ["a", "+", "b"]);
+    _assertComments(1, ["/* TODO */"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void fail_insert_comment_beforeIdentifier() {
+    // "a + b"
+    // "a + /* TODO */ b"
+    _scan("a + ", "", "/* TODO */ ", "b");
+    _assertTokens(1, 2, ["a", "+", "b"]);
+    _assertComments(2, ["/* TODO */"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void fail_insert_inComment() {
+    // "a /* TO */ b"
+    // "a /* TODO */ b"
+    _scan("a /* TO", "", "DO", " */ b");
+    _assertTokens(0, 1, ["a", "b"]);
+    _assertComments(1, ["/* TODO */"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_delete_identifier_beginning() {
+    // "abs + b;"
+    // "s + b;"
+    _scan("", "ab", "", "s + b;");
+    _assertTokens(-1, 1, ["s", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_delete_identifier_end() {
+    // "abs + b;"
+    // "a + b;"
+    _scan("a", "bs", "", " + b;");
+    _assertTokens(-1, 1, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_delete_identifier_middle() {
+    // "abs + b;"
+    // "as + b;"
+    _scan("a", "b", "", "s + b;");
+    _assertTokens(-1, 1, ["as", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_delete_mergeTokens() {
+    // "a + b + c;"
+    // "ac;"
+    _scan("a", " + b + ", "", "c;");
+    _assertTokens(-1, 1, ["ac", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_delete_whitespace() {
+    // "a + b + c;"
+    // "a+ b + c;"
+    _scan("a", " ", "", "+ b + c;");
+    _assertTokens(1, 2, ["a", "+", "b", "+", "c", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_insert_convertOneFunctionToTwo_noOverlap() {
+    // "f() {}"
+    // "f() => 0; g() {}"
+    _scan("f()", "", " => 0; g()", " {}");
+    _assertTokens(
+        2,
+        9,
+        ["f", "(", ")", "=>", "0", ";", "g", "(", ")", "{", "}"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_convertOneFunctionToTwo_overlap() {
+    // "f() {}"
+    // "f() {} g() {}"
+    _scan("f() {", "", "} g() {", "}");
+    _assertTokens(4, 10, ["f", "(", ")", "{", "}", "g", "(", ")", "{", "}"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_end() {
+    // "class A {}"
+    // "class A {} class B {}"
+    _scan("class A {}", "", " class B {}", "");
+    _assertTokens(3, 8, ["class", "A", "{", "}", "class", "B", "{", "}"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_identifierAndPeriod() {
+    // "a + b;"
+    // "a + x.b;"
+    _scan("a + ", "", "x.", "b;");
+    _assertTokens(1, 4, ["a", "+", "x", ".", "b", ";"]);
+  }
+
+  void test_insert_inIdentifier_left_firstToken() {
+    // "a + b;"
+    // "xa + b;"
+    _scan("", "", "x", "a + b;");
+    _assertTokens(-1, 1, ["xa", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_left_lastToken() {
+    // "a + b"
+    // "a + xb"
+    _scan("a + ", "", "x", "b");
+    _assertTokens(1, 3, ["a", "+", "xb"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_left_middleToken() {
+    // "a + b;"
+    // "a + xb;"
+    _scan("a + ", "", "x", "b;");
+    _assertTokens(1, 3, ["a", "+", "xb", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_middle() {
+    // "cat;"
+    // "cart;"
+    _scan("ca", "", "r", "t;");
+    _assertTokens(-1, 1, ["cart", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_right_firstToken() {
+    // "a + b;"
+    // "abs + b;"
+    _scan("a", "", "bs", " + b;");
+    _assertTokens(-1, 1, ["abs", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_right_lastToken() {
+    // "a + b"
+    // "a + bc"
+    _scan("a + b", "", "c", "");
+    _assertTokens(1, 3, ["a", "+", "bc"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_inIdentifier_right_middleToken() {
+    // "a + b;"
+    // "a + by;"
+    _scan("a + b", "", "y", ";");
+    _assertTokens(1, 3, ["a", "+", "by", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_newIdentifier_noSpaceBefore() {
+    // "a; c;"
+    // "a;b c;"
+    _scan("a;", "", "b", " c;");
+    _assertTokens(1, 3, ["a", ";", "b", "c", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_newIdentifier_spaceBefore() {
+    // "a; c;"
+    // "a; b c;"
+    _scan("a; ", "", "b ", "c;");
+    _assertTokens(1, 3, ["a", ";", "b", "c", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_periodAndIdentifier() {
+    // "a + b;"
+    // "a + b.x;"
+    _scan("a + b", "", ".x", ";");
+    _assertTokens(2, 5, ["a", "+", "b", ".", "x", ";"]);
+  }
+
+  void test_insert_period_afterIdentifier() {
+    // "a + b;"
+    // "a + b.;"
+    _scan("a + b", "", ".", ";");
+    _assertTokens(2, 4, ["a", "+", "b", ".", ";"]);
+  }
+
+  void test_insert_period_betweenIdentifiers_left() {
+    // "a b;"
+    // "a. b;"
+    _scan("a", "", ".", " b;");
+    _assertTokens(0, 2, ["a", ".", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_period_betweenIdentifiers_middle() {
+    // "a  b;"
+    // "a . b;"
+    _scan("a ", "", ".", " b;");
+    _assertTokens(0, 2, ["a", ".", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_period_betweenIdentifiers_right() {
+    // "a b;"
+    // "a .b;"
+    _scan("a ", "", ".", "b;");
+    _assertTokens(0, 2, ["a", ".", "b", ";"]);
+  }
+
+  void test_insert_period_insideExistingIdentifier() {
+    // "ab;"
+    // "a.b;"
+    _scan("a", "", ".", "b;");
+    _assertTokens(-1, 3, ["a", ".", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_splitIdentifier() {
+    // "cob;"
+    // "cow.b;"
+    _scan("co", "", "w.", "b;");
+    _assertTokens(-1, 3, ["cow", ".", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_tokens_within_whitespace() {
+    // "a      ;"
+    // "a   +b   ;"
+    _scan("a   ", "", "+b", "   ;");
+    _assertTokens(0, 3, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_insert_whitespace_beginning_beforeToken() {
+    // "a + b;"
+    // " a + b;"
+    _scan("", "", " ", "a + b;");
+    _assertTokens(0, 1, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_insert_whitespace_betweenTokens() {
+    // "a + b;"
+    // "a  + b;"
+    _scan("a ", "", " ", "+ b;");
+    _assertTokens(1, 2, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_insert_whitespace_end_afterToken() {
+    // "a + b;"
+    // "a + b; "
+    _scan("a + b;", "", " ", "");
+    _assertTokens(3, 4, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_insert_whitespace_end_afterWhitespace() {
+    // "a + b; "
+    // "a + b;  "
+    _scan("a + b; ", "", " ", "");
+    _assertTokens(3, 4, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_insert_whitespace_withMultipleComments() {
+    // "//comment1", "//comment2", "a + b;"
+    // "//comment1", "//comment2", "a  + b;"
+    _scan(r'''
+//comment1
+//comment2
+a''', "", " ", " + b;");
+    _assertTokens(1, 2, ["a", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
+  }
+
+  void test_replace_identifier_beginning() {
+    // "bell + b;"
+    // "fell + b;"
+    _scan("", "b", "f", "ell + b;");
+    _assertTokens(-1, 1, ["fell", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_replace_identifier_end() {
+    // "bell + b;"
+    // "belt + b;"
+    _scan("bel", "l", "t", " + b;");
+    _assertTokens(-1, 1, ["belt", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_replace_identifier_middle() {
+    // "first + b;"
+    // "frost + b;"
+    _scan("f", "ir", "ro", "st + b;");
+    _assertTokens(-1, 1, ["frost", "+", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_replace_multiple_partialFirstAndLast() {
+    // "aa + bb;"
+    // "ab * ab;"
+    _scan("a", "a + b", "b * a", "b;");
+    _assertTokens(-1, 3, ["ab", "*", "ab", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_replace_operator_oneForMany() {
+    // "a + b;"
+    // "a * c - b;"
+    _scan("a ", "+", "* c -", " b;");
+    _assertTokens(0, 4, ["a", "*", "c", "-", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  void test_replace_operator_oneForOne() {
+    // "a + b;"
+    // "a * b;"
+    _scan("a ", "+", "*", " b;");
+    _assertTokens(0, 2, ["a", "*", "b", ";"]);
+    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  }
+
+  /**
+   * Assert that the comments associated with the token at the given [index]
+   * have lexemes that match the given list of lexemes, both in number and in
+   * content.
+   */
+  void _assertComments(int index, List<String> lexemes) {
+    Token token = _incrementalTokens;
+    for (int i = 0; i < index; i++) {
+      token = token.next;
+    }
+    Token comment = token.precedingComments;
+    if (lexemes.isEmpty) {
+      expect(
+          comment,
+          isNull,
+          reason: "No comments expected but comments found");
+    }
+    int count = 0;
+    for (String lexeme in lexemes) {
+      if (comment == null) {
+        fail("Expected ${lexemes.length} comments but found $count");
+      }
+      expect(comment.lexeme, lexeme);
+      count++;
+      comment = comment.next;
+    }
+    if (comment != null) {
+      while (comment != null) {
+        count++;
+        comment = comment.next;
+      }
+      fail("Expected ${lexemes.length} comments but found $count");
+    }
+  }
+
+  /**
+   * Assert that the [expected] token is equal to the [actual] token.
+   */
+  void _assertEqualTokens(Token actual, Token expected) {
+    expect(actual.type, same(expected.type), reason: "Wrong type for token");
+    expect(actual.lexeme, expected.lexeme, reason: "Wrong lexeme for token");
+    expect(
+        actual.offset,
+        expected.offset,
+        reason: "Wrong offset for token ('${actual.lexeme}' != '${expected.lexeme}')");
+    expect(
+        actual.length,
+        expected.length,
+        reason: "Wrong length for token ('${actual.lexeme}' != '${expected.lexeme}')");
+  }
+
+  /**
+   * Assert that the result of the incremental scan matches the given list of
+   * [lexemes] and that the left and right tokens correspond to the tokens at
+   * the [leftIndex] and [rightIndex].
+   */
+  void _assertTokens(int leftIndex, int rightIndex, List<String> lexemes) {
+    int count = lexemes.length;
+    expect(
+        leftIndex >= -1 && leftIndex < count,
+        isTrue,
+        reason: "Invalid left index");
+    expect(
+        rightIndex >= 0 && rightIndex <= count,
+        isTrue,
+        reason: "Invalid right index");
+    Token leftToken = null;
+    Token rightToken = null;
+    Token token = _incrementalTokens;
+    if (leftIndex < 0) {
+      leftToken = token.previous;
+    }
+    for (int i = 0; i < count; i++) {
+      expect(token.lexeme, lexemes[i]);
+      if (i == leftIndex) {
+        leftToken = token;
+      }
+      if (i == rightIndex) {
+        rightToken = token;
+      }
+      token = token.next;
+    }
+    if (rightIndex >= count) {
+      rightToken = token;
+    }
+    expect(token.type, same(TokenType.EOF), reason: "Too many tokens");
+    if (leftIndex >= 0) {
+      expect(leftToken, isNotNull);
+    }
+    expect(
+        _incrementalScanner.leftToken,
+        same(leftToken),
+        reason: "Invalid left token");
+    if (rightIndex >= 0) {
+      expect(rightToken, isNotNull);
+    }
+    expect(
+        _incrementalScanner.rightToken,
+        same(rightToken),
+        reason: "Invalid right token");
+  }
+
+  /**
+   * Given a description of the original and modified contents, perform an
+   * incremental scan of the two pieces of text. Verify that the incremental
+   * scan produced the same tokens as those that would be produced by a full
+   * scan of the new contents.
+   *
+   * The original content is the concatenation of the [prefix], [removed] and
+   * [suffix] fragments. The modeified content is the concatenation of the
+   * [prefix], [added] and [suffix] fragments.
+   */
+  void _scan(String prefix, String removed, String added, String suffix) {
+    //
+    // Compute the information needed to perform the test.
+    //
+    String originalContents = "$prefix$removed$suffix";
+    String modifiedContents = "$prefix$added$suffix";
+    int replaceStart = prefix.length;
+    Source source = new TestSource();
+    //
+    // Scan the original contents.
+    //
+    GatheringErrorListener originalListener = new GatheringErrorListener();
+    Scanner originalScanner = new Scanner(
+        source,
+        new CharSequenceReader(originalContents),
+        originalListener);
+    _originalTokens = originalScanner.tokenize();
+    expect(_originalTokens, isNotNull);
+    //
+    // Scan the modified contents.
+    //
+    GatheringErrorListener modifiedListener = new GatheringErrorListener();
+    Scanner modifiedScanner = new Scanner(
+        source,
+        new CharSequenceReader(modifiedContents),
+        modifiedListener);
+    Token modifiedTokens = modifiedScanner.tokenize();
+    expect(modifiedTokens, isNotNull);
+    //
+    // Incrementally scan the modified contents.
+    //
+    GatheringErrorListener incrementalListener = new GatheringErrorListener();
+    _incrementalScanner = new IncrementalScanner(
+        source,
+        new CharSequenceReader(modifiedContents),
+        incrementalListener);
+    _incrementalTokens = _incrementalScanner.rescan(
+        _originalTokens,
+        replaceStart,
+        removed.length,
+        added.length);
+    //
+    // Validate that the results of the incremental scan are the same as the
+    // full scan of the modified source.
+    //
+    Token incrementalToken = _incrementalTokens;
+    expect(incrementalToken, isNotNull);
+    while (incrementalToken.type != TokenType.EOF &&
+        modifiedTokens.type != TokenType.EOF) {
+      _assertEqualTokens(incrementalToken, modifiedTokens);
+      Token incrementalComment = incrementalToken.precedingComments;
+      Token modifiedComment = modifiedTokens.precedingComments;
+      while (incrementalComment != null && modifiedComment != null) {
+        _assertEqualTokens(incrementalComment, modifiedComment);
+        incrementalComment = incrementalComment.next;
+        modifiedComment = modifiedComment.next;
+      }
+      expect(
+          incrementalComment,
+          isNull,
+          reason: "Too many comment tokens preceeding '${incrementalToken.lexeme}'");
+      expect(
+          modifiedComment,
+          isNull,
+          reason: "Not enough comment tokens preceeding '${incrementalToken.lexeme}'");
+      incrementalToken = incrementalToken.next;
+      modifiedTokens = modifiedTokens.next;
+    }
+    expect(
+        incrementalToken.type,
+        same(TokenType.EOF),
+        reason: "Too many tokens");
+    expect(
+        modifiedTokens.type,
+        same(TokenType.EOF),
+        reason: "Not enough tokens");
+    // TODO(brianwilkerson) Verify that the errors are correct?
+  }
+}
diff --git a/pkg/analyzer/test/generated/java_core_test.dart b/pkg/analyzer/test/generated/java_core_test.dart
index 651c14d..7efb77d 100644
--- a/pkg/analyzer/test/generated/java_core_test.dart
+++ b/pkg/analyzer/test/generated/java_core_test.dart
@@ -152,4 +152,4 @@
       expect(Character.isWhitespace('Z'.codeUnitAt(0)), isFalse);
     });
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/test/generated/java_io_test.dart b/pkg/analyzer/test/generated/java_io_test.dart
index c8b881f..fcce915 100644
--- a/pkg/analyzer/test/generated/java_io_test.dart
+++ b/pkg/analyzer/test/generated/java_io_test.dart
@@ -7,11 +7,12 @@
 
 library engine.java_io_test;
 
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:unittest/unittest.dart';
-import 'package:path/path.dart';
 import 'dart:io';
 
+import 'package:analyzer/src/generated/java_io.dart';
+import 'package:path/path.dart';
+import 'package:unittest/unittest.dart';
+
 main() {
   group('JavaFile', () {
     group('toURI', () {
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 978c457..3a4fc78 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -4,18 +4,24 @@
 
 library engine.non_error_resolver_test;
 
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
+import 'package:analyzer/src/generated/source_io.dart';
 import 'package:unittest/unittest.dart' as _ut;
+
+import '../reflective_tests.dart';
 import 'resolver_test.dart';
 import 'test_support.dart';
-import '../reflective_tests.dart';
 
 
+main() {
+  _ut.groupSep = ' | ';
+  runReflectiveTests(NonErrorResolverTest);
+}
+
 class NonErrorResolverTest extends ResolverTestCase {
   void fail_undefinedEnumConstant() {
     Source source = addSource(r'''
@@ -483,8 +489,12 @@
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
     {
-      SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
-      EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, ParameterElement, ref.staticElement);
+      SimpleIdentifier ref =
+          EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is ParameterElement,
+          ParameterElement,
+          ref.staticElement);
     }
   }
 
@@ -498,8 +508,12 @@
     assertNoErrors(source);
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
-    SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
-    EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, ParameterElement, ref.staticElement);
+    SimpleIdentifier ref =
+        EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ParameterElement,
+        ParameterElement,
+        ref.staticElement);
   }
 
   void test_commentReference_beforeFunction_expressionBody() {
@@ -511,8 +525,12 @@
     assertNoErrors(source);
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
-    SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
-    EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, ParameterElement, ref.staticElement);
+    SimpleIdentifier ref =
+        EngineTestCase.findNode(unit, code, "p]", (node) => node is SimpleIdentifier);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ParameterElement,
+        ParameterElement,
+        ref.staticElement);
   }
 
   void test_commentReference_beforeMethod() {
@@ -529,12 +547,20 @@
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
     {
-      SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "p1]", (node) => node is SimpleIdentifier);
-      EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, ParameterElement, ref.staticElement);
+      SimpleIdentifier ref =
+          EngineTestCase.findNode(unit, code, "p1]", (node) => node is SimpleIdentifier);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is ParameterElement,
+          ParameterElement,
+          ref.staticElement);
     }
     {
-      SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "p2]", (node) => node is SimpleIdentifier);
-      EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, ParameterElement, ref.staticElement);
+      SimpleIdentifier ref =
+          EngineTestCase.findNode(unit, code, "p2]", (node) => node is SimpleIdentifier);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is ParameterElement,
+          ParameterElement,
+          ref.staticElement);
     }
   }
 
@@ -549,8 +575,15 @@
     assertNoErrors(source);
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
-    SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "foo]", (node) => node is SimpleIdentifier);
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodElement, MethodElement, ref.staticElement);
+    SimpleIdentifier ref = EngineTestCase.findNode(
+        unit,
+        code,
+        "foo]",
+        (node) => node is SimpleIdentifier);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodElement,
+        MethodElement,
+        ref.staticElement);
   }
 
   void test_commentReference_setter() {
@@ -571,12 +604,26 @@
     verify([source]);
     CompilationUnit unit = analysisContext.parseCompilationUnit(source);
     {
-      SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "x] in A", (node) => node is SimpleIdentifier);
-      EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement, PropertyAccessorElement, ref.staticElement);
+      SimpleIdentifier ref = EngineTestCase.findNode(
+          unit,
+          code,
+          "x] in A",
+          (node) => node is SimpleIdentifier);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is PropertyAccessorElement,
+          PropertyAccessorElement,
+          ref.staticElement);
     }
     {
-      SimpleIdentifier ref = EngineTestCase.findNode(unit, code, "x] in B", (node) => node is SimpleIdentifier);
-      EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement, PropertyAccessorElement, ref.staticElement);
+      SimpleIdentifier ref = EngineTestCase.findNode(
+          unit,
+          code,
+          "x] in B",
+          (node) => node is SimpleIdentifier);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is PropertyAccessorElement,
+          PropertyAccessorElement,
+          ref.staticElement);
     }
   }
 
@@ -676,7 +723,9 @@
   const B(): super();
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    assertErrors(
+        source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
     verify([source]);
   }
 
@@ -728,18 +777,18 @@
   }
 
   void test_constDeferredClass_new() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
 class A {
   const A.b();
-}''',
-        r'''
+}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 main() {
   new a.A.b();
-}'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode>[]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[]);
   }
 
   void test_constEval_functionTypeLiteral() {
@@ -984,8 +1033,9 @@
   }
 
   void test_duplicateDefinition_emptyName() {
-    // Note: This code has two FunctionElements '() {}' with an empty name, this tests that the
-    // empty string is not put into the scope (more than once).
+    // Note: This code has two FunctionElements '() {}' with an empty name,
+    // this tests that the empty string is not put into the scope
+    // (more than once).
     Source source = addSource(r'''
 Map _globalMap = {
   'a' : () {},
@@ -1508,10 +1558,9 @@
 import 'lib.dart';''');
     addNamedSource("/lib.dart", "library lib;");
     resolve(source);
-    assertErrors(source, [
-        HintCode.UNUSED_IMPORT,
-        HintCode.UNUSED_IMPORT,
-        HintCode.DUPLICATE_IMPORT]);
+    assertErrors(
+        source,
+        [HintCode.UNUSED_IMPORT, HintCode.UNUSED_IMPORT, HintCode.DUPLICATE_IMPORT]);
     verify([source]);
   }
 
@@ -1588,6 +1637,22 @@
     verify([source]);
   }
 
+  void test_inconsistentMethodInheritance_accessors_typeParameters1() {
+    Source source = addSource(r'''
+abstract class A<E> {
+  E get x;
+}
+abstract class B<E> {
+  E get x;
+}
+class C<E> implements A<E>, B<E> {
+  E get x => null;
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_inconsistentMethodInheritance_accessors_typeParameters_diamond() {
     Source source = addSource(r'''
 abstract class F<E> extends B<E> {}
@@ -1607,22 +1672,6 @@
     verify([source]);
   }
 
-  void test_inconsistentMethodInheritance_accessors_typeParameters1() {
-    Source source = addSource(r'''
-abstract class A<E> {
-  E get x;
-}
-abstract class B<E> {
-  E get x;
-}
-class C<E> implements A<E>, B<E> {
-  E get x => null;
-}''');
-    resolve(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   void test_inconsistentMethodInheritance_methods_typeParameter2() {
     Source source = addSource(r'''
 class A<E> {
@@ -1936,8 +1985,10 @@
   void test_invalidAssignment_implicitlyImplementFunctionViaCall_1() {
     // 18341
     //
-    // This test and 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()'
-    // are closely related: here we see that 'I' checks as a subtype of 'IntToInt'.
+    // This test and
+    // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()'
+    // are closely related: here we see that 'I' checks as a subtype of
+    // 'IntToInt'.
     Source source = addSource(r'''
 class I {
   int call(int x) => 0;
@@ -1996,12 +2047,14 @@
     // 18341
     //
     // Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
-    // but uses type 'VoidToInt' instead of more precise type 'IntToInt' for 'f'.
+    // but uses type 'VoidToInt' instead of more precise type 'IntToInt' for
+    // 'f'.
     //
-    // Here 'C <: IntToInt <: VoidToInt', but the spec gives no transitivity rule
-    // for '<:'. However, many of the :/tools/test.py tests assume this transitivity
-    // for 'JsBuilder' objects, assigning them to '(String) -> dynamic'. The declared type of
-    // 'JsBuilder.call' is '(String, [dynamic]) -> Expression'.
+    // Here 'C <: IntToInt <: VoidToInt', but the spec gives no transitivity
+    // rule for '<:'. However, many of the :/tools/test.py tests assume this
+    // transitivity for 'JsBuilder' objects, assigning them to
+    // '(String) -> dynamic'. The declared type of 'JsBuilder.call' is
+    // '(String, [dynamic]) -> Expression'.
     Source source = addSource(r'''
 class I {
   int call([int x]) => 0;
@@ -2442,17 +2495,17 @@
   }
 
   void test_loadLibraryDefined() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-foo() => 22;''',
-        r'''
+foo() => 22;''', r'''
 import 'lib1.dart' deferred as other;
 main() {
   other.loadLibrary().then((_) => other.foo());
-}'''], <ErrorCode>[
-        ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED,
-        StaticTypeWarningCode.UNDEFINED_FUNCTION], <ErrorCode>[]);
+}'''],
+          <ErrorCode>[
+              ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED,
+              StaticTypeWarningCode.UNDEFINED_FUNCTION],
+          <ErrorCode>[]);
   }
 
   void test_mapKeyTypeNotAssignable() {
@@ -2544,9 +2597,7 @@
   }
 
   void test_missingEnumConstantInSwitch_all() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { A, B, C }
 
@@ -2563,9 +2614,7 @@
   }
 
   void test_missingEnumConstantInSwitch_default() {
-    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
-    analysisOptions.enableEnum = true;
-    resetWithOptions(analysisOptions);
+    resetWithEnum();
     Source source = addSource(r'''
 enum E { A, B, C }
 
@@ -2752,7 +2801,8 @@
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() {
     Source source = addSource(r'''
 class A {
   int get g => 0;
@@ -2766,7 +2816,8 @@
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() {
     Source source = addSource(r'''
 class A {
   m(p) {}
@@ -2780,7 +2831,8 @@
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() {
     Source source = addSource(r'''
 class A {
   set s(v) {}
@@ -2794,7 +2846,8 @@
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() {
     // 15979
     Source source = addSource(r'''
 abstract class M {}
@@ -2821,7 +2874,8 @@
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() {
     // 15979
     Source source = addSource(r'''
 class M {}
@@ -3622,8 +3676,8 @@
 class B implements A{}
 class A implements B{}''');
     resolve(source);
-    // Test is that a stack overflow isn't reached in resolution (previous line), no need to assert
-    // error set.
+    // Test is that a stack overflow isn't reached in resolution
+    // (previous line), no need to assert error set.
   }
 
   void test_recursiveConstructorRedirect() {
@@ -3774,7 +3828,8 @@
   }
 
   void test_returnOfInvalidType_async() {
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(analysisContext2.analysisOptions);
+    AnalysisOptionsImpl options =
+        new AnalysisOptionsImpl.con1(analysisContext2.analysisOptions);
     options.enableAsync = true;
     resetWithOptions(options);
     Source source = addSource(r'''
@@ -3847,8 +3902,9 @@
     // where T is a type parameter and Type is the type Type from
     // core, this particular test case comes from issue 18468.
     //
-    // A test cannot be added to TypeParameterTypeImplTest since the types returned out of the
-    // TestTypeProvider don't have a mock 'dart.core' enclosing library element.
+    // A test cannot be added to TypeParameterTypeImplTest since the types
+    // returned out of the TestTypeProvider don't have a mock 'dart.core'
+    // enclosing library element.
     // See TypeParameterTypeImpl.isMoreSpecificThan().
     Source source = addSource(r'''
 class Foo<T> {
@@ -3902,22 +3958,20 @@
   }
 
   void test_sharedDeferredPrefix() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-f1() {}''',
-        r'''
+f1() {}''', r'''
 library lib2;
-f2() {}''',
-        r'''
+f2() {}''', r'''
 library lib3;
-f3() {}''',
-        r'''
+f3() {}''', r'''
 library root;
 import 'lib1.dart' deferred as lib1;
 import 'lib2.dart' as lib;
 import 'lib3.dart' as lib;
-main() { lib1.f1(); lib.f2(); lib.f3(); }'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode>[]);
+main() { lib1.f1(); lib.f2(); lib.f3(); }'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[]);
   }
 
   void test_staticAccessToInstanceMember_annotation() {
@@ -4044,7 +4098,8 @@
   }
 
   void test_typeArgumentNotMatchingBounds_typeArgumentList_20() {
-    Source source = addSource("abstract class A<T extends A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A>>>>>>>>>>>>>>>>>>>>>{}");
+    Source source = addSource(
+        "abstract class A<T extends A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A>>>>>>>>>>>>>>>>>>>>>{}");
     resolve(source);
     assertNoErrors(source);
     verify([source]);
@@ -4060,7 +4115,8 @@
     verify([source]);
   }
 
-  void test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() {
+  void
+      test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() {
     Source source = addSource(r'''
 callMe(f()) { f(); }
 main(Object p) {
@@ -4097,7 +4153,8 @@
     verify([source]);
   }
 
-  void test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() {
+  void
+      test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() {
     Source source = addSource(r'''
 callMe(f()) { f(); }
 main(Object p) {
@@ -4640,21 +4697,6 @@
     assertNoErrors(source);
   }
 
-  void test_wrongNumberOfParametersForOperator_index() {
-    Source source = addSource(r'''
-class A {
-  operator []=(a, b) {}
-}''');
-    resolve(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  void test_wrongNumberOfParametersForOperator_minus() {
-    _check_wrongNumberOfParametersForOperator("-", "");
-    _check_wrongNumberOfParametersForOperator("-", "a");
-  }
-
   void test_wrongNumberOfParametersForOperator1() {
     _check_wrongNumberOfParametersForOperator1("<");
     _check_wrongNumberOfParametersForOperator1(">");
@@ -4673,6 +4715,21 @@
     _check_wrongNumberOfParametersForOperator1("[]");
   }
 
+  void test_wrongNumberOfParametersForOperator_index() {
+    Source source = addSource(r'''
+class A {
+  operator []=(a, b) {}
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_wrongNumberOfParametersForOperator_minus() {
+    _check_wrongNumberOfParametersForOperator("-", "");
+    _check_wrongNumberOfParametersForOperator("-", "a");
+  }
+
   void test_wrongNumberOfParametersForSetter() {
     Source source = addSource(r'''
 class A {
@@ -4727,7 +4784,8 @@
     verify([source]);
   }
 
-  void _check_wrongNumberOfParametersForOperator(String name, String parameters) {
+  void _check_wrongNumberOfParametersForOperator(String name,
+      String parameters) {
     Source source = addSource("""
 class A {
   operator $name($parameters) {}
@@ -4742,8 +4800,3 @@
     _check_wrongNumberOfParametersForOperator(name, "a");
   }
 }
-
-main() {
-  _ut.groupSep = ' | ';
-  runReflectiveTests(NonErrorResolverTest);
-}
\ No newline at end of file
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index fdf3a50..89a8213 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -2,31 +2,42 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.parser_test;
 
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/source.dart' show Source;
-import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:unittest/unittest.dart';
-import 'test_support.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/incremental_scanner.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/source.dart' show Source;
 import 'package:analyzer/src/generated/testing/ast_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import 'test_support.dart';
 
 
-class AnalysisErrorListener_SimpleParserTest_computeStringValue implements AnalysisErrorListener {
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(ComplexParserTest);
+  runReflectiveTests(ErrorParserTest);
+  runReflectiveTests(IncrementalParserTest);
+  runReflectiveTests(NonErrorParserTest);
+  runReflectiveTests(RecoveryParserTest);
+  runReflectiveTests(ResolutionCopierTest);
+  runReflectiveTests(SimpleParserTest);
+}
+
+class AnalysisErrorListener_SimpleParserTest_computeStringValue implements
+    AnalysisErrorListener {
   @override
   void onError(AnalysisError event) {
-    fail("Unexpected compilation error: ${event.message} (${event.offset}, ${event.length})");
+    fail(
+        "Unexpected compilation error: ${event.message} (${event.offset}, ${event.length})");
   }
 }
 
@@ -94,10 +105,12 @@
       int parentStart = parent.offset;
       int parentEnd = parentStart + parent.length;
       if (nodeStart < parentStart) {
-        _errors.add("Invalid source start ($nodeStart) for ${node.runtimeType} inside ${parent.runtimeType} ($parentStart)");
+        _errors.add(
+            "Invalid source start ($nodeStart) for ${node.runtimeType} inside ${parent.runtimeType} ($parentStart)");
       }
       if (nodeEnd > parentEnd) {
-        _errors.add("Invalid source end ($nodeEnd) for ${node.runtimeType} inside ${parent.runtimeType} ($parentStart)");
+        _errors.add(
+            "Invalid source end ($nodeEnd) for ${node.runtimeType} inside ${parent.runtimeType} ($parentStart)");
       }
     }
   }
@@ -113,42 +126,69 @@
 class ComplexParserTest extends ParserTestCase {
   void test_additiveExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x + y - z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_additiveExpression_noSpaces() {
     BinaryExpression expression = ParserTestCase.parseExpression("i+1");
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        expression.rightOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x * y + z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_left_withSuper() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super * y - z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super * y - z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x + y * z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_additiveExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super + y - z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super + y - z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_assignableExpression_arguments_normal_chain() {
-    PropertyAccess propertyAccess1 = ParserTestCase.parseExpression("a(b)(c).d(e).f");
+    PropertyAccess propertyAccess1 =
+        ParserTestCase.parseExpression("a(b)(c).d(e).f");
     expect(propertyAccess1.propertyName.name, "f");
     //
     // a(b)(c).d(e)
     //
-    MethodInvocation invocation2 = EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, propertyAccess1.target);
+    MethodInvocation invocation2 = EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
+        propertyAccess1.target);
     expect(invocation2.methodName.name, "d");
     ArgumentList argumentList2 = invocation2.argumentList;
     expect(argumentList2, isNotNull);
@@ -156,14 +196,20 @@
     //
     // a(b)(c)
     //
-    FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpressionInvocation, FunctionExpressionInvocation, invocation2.target);
+    FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionExpressionInvocation,
+        FunctionExpressionInvocation,
+        invocation2.target);
     ArgumentList argumentList3 = invocation3.argumentList;
     expect(argumentList3, isNotNull);
     expect(argumentList3.arguments, hasLength(1));
     //
     // a(b)
     //
-    MethodInvocation invocation4 = EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, invocation3.function);
+    MethodInvocation invocation4 = EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
+        invocation3.function);
     expect(invocation4.methodName.name, "a");
     ArgumentList argumentList4 = invocation4.argumentList;
     expect(argumentList4, isNotNull);
@@ -171,96 +217,169 @@
   }
 
   void test_assignmentExpression_compound() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x = y = 0");
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftHandSide);
-    EngineTestCase.assertInstanceOf((obj) => obj is AssignmentExpression, AssignmentExpression, expression.rightHandSide);
+    AssignmentExpression expression =
+        ParserTestCase.parseExpression("x = y = 0");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftHandSide);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AssignmentExpression,
+        AssignmentExpression,
+        expression.rightHandSide);
   }
 
   void test_assignmentExpression_indexExpression() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x[1] = 0");
-    EngineTestCase.assertInstanceOf((obj) => obj is IndexExpression, IndexExpression, expression.leftHandSide);
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
+    AssignmentExpression expression =
+        ParserTestCase.parseExpression("x[1] = 0");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IndexExpression,
+        IndexExpression,
+        expression.leftHandSide);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        expression.rightHandSide);
   }
 
   void test_assignmentExpression_prefixedIdentifier() {
     AssignmentExpression expression = ParserTestCase.parseExpression("x.y = 0");
-    EngineTestCase.assertInstanceOf((obj) => obj is PrefixedIdentifier, PrefixedIdentifier, expression.leftHandSide);
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixedIdentifier,
+        PrefixedIdentifier,
+        expression.leftHandSide);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        expression.rightHandSide);
   }
 
   void test_assignmentExpression_propertyAccess() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("super.y = 0");
-    EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccess, PropertyAccess, expression.leftHandSide);
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
+    AssignmentExpression expression =
+        ParserTestCase.parseExpression("super.y = 0");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PropertyAccess,
+        PropertyAccess,
+        expression.leftHandSide);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        expression.rightHandSide);
   }
 
   void test_bitwiseAndExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x & y & z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseAndExpression_precedence_equality_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x == y && z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseAndExpression_precedence_equality_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x && y == z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseAndExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super & y & z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super & y & z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x | y | z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_precedence_xor_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x ^ y | z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_precedence_xor_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x | y ^ z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseOrExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super | y | z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super | y | z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x ^ y ^ z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_precedence_and_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x & y ^ z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_precedence_and_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseXorExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super ^ y ^ z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_cascade_withAssignment() {
-    CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;");
+    CascadeExpression cascade =
+        ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;");
     Expression target = cascade.target;
     for (Expression section in cascade.cascadeSections) {
-      EngineTestCase.assertInstanceOf((obj) => obj is AssignmentExpression, AssignmentExpression, section);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is AssignmentExpression,
+          AssignmentExpression,
+          section);
       Expression lhs = (section as AssignmentExpression).leftHandSide;
-      EngineTestCase.assertInstanceOf((obj) => obj is IndexExpression, IndexExpression, lhs);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is IndexExpression,
+          IndexExpression,
+          lhs);
       IndexExpression index = lhs as IndexExpression;
       expect(index.isCascaded, isTrue);
       expect(index.realTarget, same(target));
@@ -268,8 +387,12 @@
   }
 
   void test_conditionalExpression_precedence_logicalOrExpression() {
-    ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y : z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.condition);
+    ConditionalExpression expression =
+        ParserTestCase.parseExpression("a | b ? y : z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.condition);
   }
 
   void test_constructor_initializer_withParenthesizedExpression() {
@@ -284,104 +407,171 @@
   }
 
   void test_equalityExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x == y != z", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "x == y != z",
+        [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_equalityExpression_precedence_relational_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x is y == z");
-    EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IsExpression,
+        IsExpression,
+        expression.leftOperand);
   }
 
   void test_equalityExpression_precedence_relational_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x == y is z");
-    EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IsExpression,
+        IsExpression,
+        expression.rightOperand);
   }
 
   void test_equalityExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super == y != z", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super == y != z",
+        [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalAndExpression() {
     BinaryExpression expression = ParserTestCase.parseExpression("x && y && z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x | y < z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x < y | z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_logicalOrExpression() {
     BinaryExpression expression = ParserTestCase.parseExpression("x || y || z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x && y || z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x || y && z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_multipleLabels_statement() {
-    LabeledStatement statement = ParserTestCase.parseStatement("a: b: c: return x;");
+    LabeledStatement statement =
+        ParserTestCase.parseStatement("a: b: c: return x;");
     expect(statement.labels, hasLength(3));
-    EngineTestCase.assertInstanceOf((obj) => obj is ReturnStatement, ReturnStatement, statement.statement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ReturnStatement,
+        ReturnStatement,
+        statement.statement);
   }
 
   void test_multiplicativeExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x * y / z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_multiplicativeExpression_precedence_unary_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("-x * y");
-    EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixExpression,
+        PrefixExpression,
+        expression.leftOperand);
   }
 
   void test_multiplicativeExpression_precedence_unary_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x * -y");
-    EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixExpression,
+        PrefixExpression,
+        expression.rightOperand);
   }
 
   void test_multiplicativeExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super * y / z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super * y / z");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_relationalExpression_precedence_shift_right() {
     IsExpression expression = ParserTestCase.parseExpression("x << y is z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.expression);
   }
 
   void test_shiftExpression_normal() {
     BinaryExpression expression = ParserTestCase.parseExpression("x >> 4 << 3");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_shiftExpression_precedence_additive_left() {
     BinaryExpression expression = ParserTestCase.parseExpression("x + y << z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_shiftExpression_precedence_additive_right() {
     BinaryExpression expression = ParserTestCase.parseExpression("x << y + z");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_shiftExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super >> 4 << 3");
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("super >> 4 << 3");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_topLevelVariable_withMetadata() {
@@ -395,136 +585,224 @@
  */
 class ErrorParserTest extends ParserTestCase {
   void fail_expectedListOrMapLiteral() {
-    // It isn't clear that this test can ever pass. The parser is currently create a synthetic list
-    // literal in this case, but isSynthetic() isn't overridden for ListLiteral. The problem is that
-    // the synthetic list literals that are being created are not always zero length (because they
-    // could have type parameters), which violates the contract of isSynthetic().
-    TypedLiteral literal = ParserTestCase.parse3("parseListOrMapLiteral", <Object> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
+    // It isn't clear that this test can ever pass. The parser is currently
+    // create a synthetic list literal in this case, but isSynthetic() isn't
+    // overridden for ListLiteral. The problem is that the synthetic list
+    // literals that are being created are not always zero length (because they
+    // could have type parameters), which violates the contract of
+    // isSynthetic().
+    TypedLiteral literal = ParserTestCase.parse3(
+        "parseListOrMapLiteral",
+        <Object>[null],
+        "1",
+        [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
     expect(literal.isSynthetic, isTrue);
   }
 
   void fail_illegalAssignmentToNonAssignable_superAssigned() {
     // TODO(brianwilkerson) When this test starts to pass, remove the test
     // test_illegalAssignmentToNonAssignable_superAssigned.
-    ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    ParserTestCase.parseExpression(
+        "super = x;",
+        [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void fail_invalidCommentReference__new_nonIdentifier() {
     // This test fails because the method parseCommentReference returns null.
-    ParserTestCase.parse3("parseCommentReference", <Object> ["new 42", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    ParserTestCase.parse3(
+        "parseCommentReference",
+        <Object>["new 42", 0],
+        "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__new_tooMuch() {
-    ParserTestCase.parse3("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    ParserTestCase.parse3(
+        "parseCommentReference",
+        <Object>["new a.b.c.d", 0],
+        "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__nonNew_nonIdentifier() {
     // This test fails because the method parseCommentReference returns null.
-    ParserTestCase.parse3("parseCommentReference", <Object> ["42", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    ParserTestCase.parse3(
+        "parseCommentReference",
+        <Object>["42", 0],
+        "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__nonNew_tooMuch() {
-    ParserTestCase.parse3("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    ParserTestCase.parse3(
+        "parseCommentReference",
+        <Object>["a.b.c.d", 0],
+        "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_missingClosingParenthesis() {
-    // It is possible that it is not possible to generate this error (that it's being reported in
-    // code that cannot actually be reached), but that hasn't been proven yet.
-    ParserTestCase.parse4("parseFormalParameterList", "(int a, int b ;", [ParserErrorCode.MISSING_CLOSING_PARENTHESIS]);
+    // It is possible that it is not possible to generate this error (that it's
+    // being reported in code that cannot actually be reached), but that hasn't
+    // been proven yet.
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(int a, int b ;",
+        [ParserErrorCode.MISSING_CLOSING_PARENTHESIS]);
   }
 
   void fail_missingFunctionParameters_local_nonVoid_block() {
-    // The parser does not recognize this as a function declaration, so it tries to parse it as an
-    // expression statement. It isn't clear what the best error message is in this case.
-    ParserTestCase.parseStatement("int f { return x;}", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    // The parser does not recognize this as a function declaration, so it tries
+    // to parse it as an expression statement. It isn't clear what the best
+    // error message is in this case.
+    ParserTestCase.parseStatement(
+        "int f { return x;}",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void fail_missingFunctionParameters_local_nonVoid_expression() {
-    // The parser does not recognize this as a function declaration, so it tries to parse it as an
-    // expression statement. It isn't clear what the best error message is in this case.
-    ParserTestCase.parseStatement("int f => x;", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    // The parser does not recognize this as a function declaration, so it tries
+    // to parse it as an expression statement. It isn't clear what the best
+    // error message is in this case.
+    ParserTestCase.parseStatement(
+        "int f => x;",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void fail_namedFunctionExpression() {
-    Expression expression = ParserTestCase.parse4("parsePrimaryExpression", "f() {}", [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression, FunctionExpression, expression);
+    Expression expression = ParserTestCase.parse4(
+        "parsePrimaryExpression",
+        "f() {}",
+        [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionExpression,
+        FunctionExpression,
+        expression);
   }
 
   void fail_unexpectedToken_invalidPostfixExpression() {
-    // Note: this might not be the right error to produce, but some error should be produced
+    // Note: this might not be the right error to produce, but some error should
+    // be produced
     ParserTestCase.parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]);
   }
 
   void fail_varAndType_local() {
-    // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but this would be a
-    // better error message.
+    // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but
+    // this would be a better error message.
     ParserTestCase.parseStatement("var int x;", [ParserErrorCode.VAR_AND_TYPE]);
   }
 
   void fail_varAndType_parameter() {
-    // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but this would be a
-    // better error message.
-    ParserTestCase.parse4("parseFormalParameterList", "(var int x)", [ParserErrorCode.VAR_AND_TYPE]);
+    // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but
+    // this would be a better error message.
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(var int x)",
+        [ParserErrorCode.VAR_AND_TYPE]);
   }
 
   void test_abstractClassMember_constructor() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "abstract C.c();",
+        [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
   }
 
   void test_abstractClassMember_field() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C f;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "abstract C f;",
+        [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
   }
 
   void test_abstractClassMember_getter() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "abstract get m;",
+        [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
   }
 
   void test_abstractClassMember_method() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract m();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "abstract m();",
+        [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
   }
 
   void test_abstractClassMember_setter() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract set m(v);", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "abstract set m(v);",
+        [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
   }
 
   void test_abstractEnum() {
-    ParserTestCase.parseCompilationUnit("abstract enum E {ONE}", [ParserErrorCode.ABSTRACT_ENUM]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract enum E {ONE}",
+        [ParserErrorCode.ABSTRACT_ENUM]);
   }
 
   void test_abstractTopLevelFunction_function() {
-    ParserTestCase.parseCompilationUnit("abstract f(v) {}", [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract f(v) {}",
+        [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
   }
 
   void test_abstractTopLevelFunction_getter() {
-    ParserTestCase.parseCompilationUnit("abstract get m {}", [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract get m {}",
+        [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
   }
 
   void test_abstractTopLevelFunction_setter() {
-    ParserTestCase.parseCompilationUnit("abstract set m(v) {}", [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract set m(v) {}",
+        [ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
   }
 
   void test_abstractTopLevelVariable() {
-    ParserTestCase.parseCompilationUnit("abstract C f;", [ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract C f;",
+        [ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE]);
   }
 
   void test_abstractTypeDef() {
-    ParserTestCase.parseCompilationUnit("abstract typedef F();", [ParserErrorCode.ABSTRACT_TYPEDEF]);
+    ParserTestCase.parseCompilationUnit(
+        "abstract typedef F();",
+        [ParserErrorCode.ABSTRACT_TYPEDEF]);
   }
 
   void test_assertDoesNotTakeAssignment() {
-    ParserTestCase.parse4("parseAssertStatement", "assert(b = true);", [ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]);
+    ParserTestCase.parse4(
+        "parseAssertStatement",
+        "assert(b = true);",
+        [ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]);
   }
 
   void test_assertDoesNotTakeCascades() {
-    ParserTestCase.parse4("parseAssertStatement", "assert(new A()..m());", [ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]);
+    ParserTestCase.parse4(
+        "parseAssertStatement",
+        "assert(new A()..m());",
+        [ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]);
   }
 
   void test_assertDoesNotTakeRethrow() {
-    ParserTestCase.parse4("parseAssertStatement", "assert(rethrow);", [ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW]);
+    ParserTestCase.parse4(
+        "parseAssertStatement",
+        "assert(rethrow);",
+        [ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW]);
   }
 
   void test_assertDoesNotTakeThrow() {
-    ParserTestCase.parse4("parseAssertStatement", "assert(throw x);", [ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW]);
+    ParserTestCase.parse4(
+        "parseAssertStatement",
+        "assert(throw x);",
+        [ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW]);
   }
 
   void test_breakOutsideOfLoop_breakInDoStatement() {
@@ -536,11 +814,16 @@
   }
 
   void test_breakOutsideOfLoop_breakInIfStatement() {
-    ParserTestCase.parse4("parseIfStatement", "if (x) {break;}", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
+    ParserTestCase.parse4(
+        "parseIfStatement",
+        "if (x) {break;}",
+        [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
   }
 
   void test_breakOutsideOfLoop_breakInSwitchStatement() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: break;}");
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (x) {case 1: break;}");
   }
 
   void test_breakOutsideOfLoop_breakInWhileStatement() {
@@ -548,7 +831,9 @@
   }
 
   void test_breakOutsideOfLoop_functionExpression_inALoop() {
-    ParserTestCase.parseStatement("for(; x;) {() {break;};}", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
+    ParserTestCase.parseStatement(
+        "for(; x;) {() {break;};}",
+        [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
   }
 
   void test_breakOutsideOfLoop_functionExpression_withALoop() {
@@ -556,51 +841,87 @@
   }
 
   void test_classTypeAlias_abstractAfterEq() {
-    // This syntax has been removed from the language in favor of "abstract class A = B with C;"
-    // (issue 18098).
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "class A = abstract B with C;", [
-        ParserErrorCode.EXPECTED_TOKEN,
-        ParserErrorCode.EXPECTED_TOKEN]);
+    // This syntax has been removed from the language in favor of
+    // "abstract class A = B with C;" (issue 18098).
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class A = abstract B with C;",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_constAndFinal() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const final int x;", [ParserErrorCode.CONST_AND_FINAL]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const final int x;",
+        [ParserErrorCode.CONST_AND_FINAL]);
   }
 
   void test_constAndVar() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const var x;", [ParserErrorCode.CONST_AND_VAR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const var x;",
+        [ParserErrorCode.CONST_AND_VAR]);
   }
 
   void test_constClass() {
-    ParserTestCase.parseCompilationUnit("const class C {}", [ParserErrorCode.CONST_CLASS]);
+    ParserTestCase.parseCompilationUnit(
+        "const class C {}",
+        [ParserErrorCode.CONST_CLASS]);
   }
 
   void test_constConstructorWithBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const C() {}", [ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const C() {}",
+        [ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
   }
 
   void test_constEnum() {
-    ParserTestCase.parseCompilationUnit("const enum E {ONE}", [ParserErrorCode.CONST_ENUM]);
+    ParserTestCase.parseCompilationUnit(
+        "const enum E {ONE}",
+        [ParserErrorCode.CONST_ENUM]);
   }
 
   void test_constFactory() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const factory C() {}", [ParserErrorCode.CONST_FACTORY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const factory C() {}",
+        [ParserErrorCode.CONST_FACTORY]);
   }
 
   void test_constMethod() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const int m() {}", [ParserErrorCode.CONST_METHOD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const int m() {}",
+        [ParserErrorCode.CONST_METHOD]);
   }
 
   void test_constructorWithReturnType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "C C() {}", [ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "C C() {}",
+        [ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
   }
 
   void test_constructorWithReturnType_var() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var C() {}", [ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "var C() {}",
+        [ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
   }
 
   void test_constTypedef() {
-    ParserTestCase.parseCompilationUnit("const typedef F();", [ParserErrorCode.CONST_TYPEDEF]);
+    ParserTestCase.parseCompilationUnit(
+        "const typedef F();",
+        [ParserErrorCode.CONST_TYPEDEF]);
   }
 
   void test_continueOutsideOfLoop_continueInDoStatement() {
@@ -612,11 +933,16 @@
   }
 
   void test_continueOutsideOfLoop_continueInIfStatement() {
-    ParserTestCase.parse4("parseIfStatement", "if (x) {continue;}", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+    ParserTestCase.parse4(
+        "parseIfStatement",
+        "if (x) {continue;}",
+        [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
   }
 
   void test_continueOutsideOfLoop_continueInSwitchStatement() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}");
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (x) {case 1: continue a;}");
   }
 
   void test_continueOutsideOfLoop_continueInWhileStatement() {
@@ -624,7 +950,9 @@
   }
 
   void test_continueOutsideOfLoop_functionExpression_inALoop() {
-    ParserTestCase.parseStatement("for(; x;) {() {continue;};}", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+    ParserTestCase.parseStatement(
+        "for(; x;) {() {continue;};}",
+        [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
   }
 
   void test_continueOutsideOfLoop_functionExpression_withALoop() {
@@ -632,144 +960,246 @@
   }
 
   void test_continueWithoutLabelInCase_error() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue;}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (x) {case 1: continue;}",
+        [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]);
   }
 
   void test_continueWithoutLabelInCase_noError() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}");
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (x) {case 1: continue a;}");
   }
 
   void test_continueWithoutLabelInCase_noError_switchInLoop() {
-    ParserTestCase.parse4("parseWhileStatement", "while (a) { switch (b) {default: continue;}}");
+    ParserTestCase.parse4(
+        "parseWhileStatement",
+        "while (a) { switch (b) {default: continue;}}");
   }
 
   void test_deprecatedClassTypeAlias() {
-    ParserTestCase.parseCompilationUnit("typedef C = S with M;", [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
+    ParserTestCase.parseCompilationUnit(
+        "typedef C = S with M;",
+        [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
   }
 
   void test_deprecatedClassTypeAlias_withGeneric() {
-    ParserTestCase.parseCompilationUnit("typedef C<T> = S<T> with M;", [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
+    ParserTestCase.parseCompilationUnit(
+        "typedef C<T> = S<T> with M;",
+        [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
   }
 
   void test_directiveAfterDeclaration_classBeforeDirective() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "class Foo{} library l;",
+        [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
     expect(unit, isNotNull);
   }
 
   void test_directiveAfterDeclaration_classBetweenDirectives() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "library l;\nclass Foo{}\npart 'a.dart';",
+        [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
     expect(unit, isNotNull);
   }
 
   void test_duplicatedModifier_const() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const const m;",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicatedModifier_external() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external external f();",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicatedModifier_factory() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory factory C() {}", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "factory factory C() {}",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicatedModifier_final() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "final final m;",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicatedModifier_static() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static static var m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static static var m;",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicatedModifier_var() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var var m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "var var m;",
+        [ParserErrorCode.DUPLICATED_MODIFIER]);
   }
 
   void test_duplicateLabelInSwitchStatement() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (e) {l1: case 0: break; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (e) {l1: case 0: break; l1: case 1: break;}",
+        [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
   }
 
   void test_emptyEnumBody() {
-    ParserTestCase.parse3("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E {}", [ParserErrorCode.EMPTY_ENUM_BODY]);
+    ParserTestCase.parse3(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E {}",
+        [ParserErrorCode.EMPTY_ENUM_BODY]);
   }
 
   void test_equalityCannotBeEqualityOperand_eq_eq() {
-    ParserTestCase.parseExpression("1 == 2 == 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    ParserTestCase.parseExpression(
+        "1 == 2 == 3",
+        [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
   }
 
   void test_equalityCannotBeEqualityOperand_eq_neq() {
-    ParserTestCase.parseExpression("1 == 2 != 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    ParserTestCase.parseExpression(
+        "1 == 2 != 3",
+        [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
   }
 
   void test_equalityCannotBeEqualityOperand_neq_eq() {
-    ParserTestCase.parseExpression("1 != 2 == 3", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    ParserTestCase.parseExpression(
+        "1 != 2 == 3",
+        [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
   }
 
   void test_expectedCaseOrDefault() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (e) {break;}", [ParserErrorCode.EXPECTED_CASE_OR_DEFAULT]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (e) {break;}",
+        [ParserErrorCode.EXPECTED_CASE_OR_DEFAULT]);
   }
 
   void test_expectedClassMember_inClass_afterType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "heart 2 heart", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "heart 2 heart",
+        [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
   }
 
   void test_expectedClassMember_inClass_beforeType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "4 score", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "4 score",
+        [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
   }
 
   void test_expectedExecutable_inClass_afterVoid() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void 2 void",
+        [ParserErrorCode.EXPECTED_EXECUTABLE]);
   }
 
   void test_expectedExecutable_topLevel_afterType() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "heart 2 heart", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "heart 2 heart",
+        [ParserErrorCode.EXPECTED_EXECUTABLE]);
   }
 
   void test_expectedExecutable_topLevel_afterVoid() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void 2 void",
+        [ParserErrorCode.EXPECTED_EXECUTABLE]);
   }
 
   void test_expectedExecutable_topLevel_beforeType() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "4 score",
+        [ParserErrorCode.EXPECTED_EXECUTABLE]);
   }
 
   void test_expectedExecutable_topLevel_eof() {
-    ParserTestCase.parse2("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "x", [new AnalysisError.con2(null, 0, 1, ParserErrorCode.EXPECTED_EXECUTABLE)]);
+    ParserTestCase.parse2(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "x",
+        [new AnalysisError.con2(null, 0, 1, ParserErrorCode.EXPECTED_EXECUTABLE)]);
   }
 
   void test_expectedInterpolationIdentifier() {
-    ParserTestCase.parse4("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\$x\$'",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_expectedInterpolationIdentifier_emptyString() {
-    // The scanner inserts an empty string token between the two $'s; we need to make sure that the
-    // MISSING_IDENTIFIER error that is generated has a nonzero width so that it will show up in
-    // the editor UI.
-    ParserTestCase.parse2("parseStringLiteral", <Object>[], "'\$\$foo'", [new AnalysisError.con2(null, 2, 1, ParserErrorCode.MISSING_IDENTIFIER)]);
+    // The scanner inserts an empty string token between the two $'s; we need to
+    // make sure that the MISSING_IDENTIFIER error that is generated has a
+    // nonzero width so that it will show up in the editor UI.
+    ParserTestCase.parse2(
+        "parseStringLiteral",
+        <Object>[],
+        "'\$\$foo'",
+        [new AnalysisError.con2(null, 2, 1, ParserErrorCode.MISSING_IDENTIFIER)]);
   }
 
   void test_expectedStringLiteral() {
-    StringLiteral expression = ParserTestCase.parse4("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
+    StringLiteral expression = ParserTestCase.parse4(
+        "parseStringLiteral",
+        "1",
+        [ParserErrorCode.EXPECTED_STRING_LITERAL]);
     expect(expression.isSynthetic, isTrue);
   }
 
   void test_expectedToken_commaMissingInArgumentList() {
-    ParserTestCase.parse4("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parse4(
+        "parseArgumentList",
+        "(x, y z)",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_expectedToken_parseStatement_afterVoid() {
-    ParserTestCase.parseStatement("void}", [
-        ParserErrorCode.EXPECTED_TOKEN,
-        ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parseStatement(
+        "void}",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_expectedToken_semicolonAfterClass() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ParserTestCase.parse3("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), null, token], "A = B with C", [ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parse3(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_expectedToken_semicolonMissingAfterExport() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("export '' class A {}", [ParserErrorCode.EXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "export '' class A {}",
+        [ParserErrorCode.EXPECTED_TOKEN]);
     ExportDirective directive = unit.directives[0] as ExportDirective;
     Token semicolon = directive.semicolon;
     expect(semicolon, isNotNull);
@@ -781,7 +1211,9 @@
   }
 
   void test_expectedToken_semicolonMissingAfterImport() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("import '' class A {}", [ParserErrorCode.EXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "import '' class A {}",
+        [ParserErrorCode.EXPECTED_TOKEN]);
     ImportDirective directive = unit.directives[0] as ImportDirective;
     Token semicolon = directive.semicolon;
     expect(semicolon, isNotNull);
@@ -789,291 +1221,486 @@
   }
 
   void test_expectedToken_whileMissingInDoStatement() {
-    ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parseStatement(
+        "do {} (x);",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_expectedTypeName_is() {
-    ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]);
+    ParserTestCase.parseExpression(
+        "x is",
+        [ParserErrorCode.EXPECTED_TYPE_NAME]);
   }
 
   void test_exportDirectiveAfterPartDirective() {
-    ParserTestCase.parseCompilationUnit("part 'a.dart'; export 'b.dart';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
+    ParserTestCase.parseCompilationUnit(
+        "part 'a.dart'; export 'b.dart';",
+        [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
   }
 
   void test_externalAfterConst() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const external C();", [ParserErrorCode.EXTERNAL_AFTER_CONST]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const external C();",
+        [ParserErrorCode.EXTERNAL_AFTER_CONST]);
   }
 
   void test_externalAfterFactory() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "factory external C();",
+        [ParserErrorCode.EXTERNAL_AFTER_FACTORY]);
   }
 
   void test_externalAfterStatic() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static external int m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static external int m();",
+        [ParserErrorCode.EXTERNAL_AFTER_STATIC]);
   }
 
   void test_externalClass() {
-    ParserTestCase.parseCompilationUnit("external class C {}", [ParserErrorCode.EXTERNAL_CLASS]);
+    ParserTestCase.parseCompilationUnit(
+        "external class C {}",
+        [ParserErrorCode.EXTERNAL_CLASS]);
   }
 
   void test_externalConstructorWithBody_factory() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external factory C() {}",
+        [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
   }
 
   void test_externalConstructorWithBody_named() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external C.c() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external C.c() {}",
+        [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
   }
 
   void test_externalEnum() {
-    ParserTestCase.parseCompilationUnit("external enum E {ONE}", [ParserErrorCode.EXTERNAL_ENUM]);
+    ParserTestCase.parseCompilationUnit(
+        "external enum E {ONE}",
+        [ParserErrorCode.EXTERNAL_ENUM]);
   }
 
   void test_externalField_const() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external const A f;",
+        [ParserErrorCode.EXTERNAL_FIELD]);
   }
 
   void test_externalField_final() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external final A f;",
+        [ParserErrorCode.EXTERNAL_FIELD]);
   }
 
   void test_externalField_static() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external static A f;",
+        [ParserErrorCode.EXTERNAL_FIELD]);
   }
 
   void test_externalField_typed() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external A f;", [ParserErrorCode.EXTERNAL_FIELD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external A f;",
+        [ParserErrorCode.EXTERNAL_FIELD]);
   }
 
   void test_externalField_untyped() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external var f;",
+        [ParserErrorCode.EXTERNAL_FIELD]);
   }
 
   void test_externalGetterWithBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external int get x {}",
+        [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]);
   }
 
   void test_externalMethodWithBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external m() {}",
+        [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]);
   }
 
   void test_externalOperatorWithBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external operator +(int value) {}",
+        [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
   }
 
   void test_externalSetterWithBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external set x(int value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "external set x(int value) {}",
+        [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]);
   }
 
   void test_externalTypedef() {
-    ParserTestCase.parseCompilationUnit("external typedef F();", [ParserErrorCode.EXTERNAL_TYPEDEF]);
+    ParserTestCase.parseCompilationUnit(
+        "external typedef F();",
+        [ParserErrorCode.EXTERNAL_TYPEDEF]);
   }
 
   void test_factoryTopLevelDeclaration_class() {
-    ParserTestCase.parseCompilationUnit("factory class C {}", [ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "factory class C {}",
+        [ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
   }
 
   void test_factoryTopLevelDeclaration_typedef() {
-    ParserTestCase.parseCompilationUnit("factory typedef F();", [ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "factory typedef F();",
+        [ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
   }
 
   void test_factoryWithInitializers() {
     ParserTestCase.parse3(
         "parseClassMember",
-        <Object> ["C"],
+        <Object>["C"],
         "factory C() : x = 3 {}",
         [ParserErrorCode.FACTORY_WITH_INITIALIZERS]);
   }
 
   void test_factoryWithoutBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory C();", [ParserErrorCode.FACTORY_WITHOUT_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "factory C();",
+        [ParserErrorCode.FACTORY_WITHOUT_BODY]);
   }
 
   void test_fieldInitializerOutsideConstructor() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void m(this.x);",
+        [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
   }
 
   void test_finalAndVar() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final var x;", [ParserErrorCode.FINAL_AND_VAR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "final var x;",
+        [ParserErrorCode.FINAL_AND_VAR]);
   }
 
   void test_finalClass() {
-    ParserTestCase.parseCompilationUnit("final class C {}", [ParserErrorCode.FINAL_CLASS]);
+    ParserTestCase.parseCompilationUnit(
+        "final class C {}",
+        [ParserErrorCode.FINAL_CLASS]);
   }
 
   void test_finalConstructor() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final C() {}", [ParserErrorCode.FINAL_CONSTRUCTOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "final C() {}",
+        [ParserErrorCode.FINAL_CONSTRUCTOR]);
   }
 
   void test_finalEnum() {
-    ParserTestCase.parseCompilationUnit("final enum E {ONE}", [ParserErrorCode.FINAL_ENUM]);
+    ParserTestCase.parseCompilationUnit(
+        "final enum E {ONE}",
+        [ParserErrorCode.FINAL_ENUM]);
   }
 
   void test_finalMethod() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final int m() {}", [ParserErrorCode.FINAL_METHOD]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "final int m() {}",
+        [ParserErrorCode.FINAL_METHOD]);
   }
 
   void test_finalTypedef() {
-    ParserTestCase.parseCompilationUnit("final typedef F();", [ParserErrorCode.FINAL_TYPEDEF]);
+    ParserTestCase.parseCompilationUnit(
+        "final typedef F();",
+        [ParserErrorCode.FINAL_TYPEDEF]);
   }
 
   void test_functionTypedParameter_const() {
-    ParserTestCase.parseCompilationUnit("void f(const x()) {}", [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
+    ParserTestCase.parseCompilationUnit(
+        "void f(const x()) {}",
+        [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
   }
 
   void test_functionTypedParameter_final() {
-    ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
+    ParserTestCase.parseCompilationUnit(
+        "void f(final x()) {}",
+        [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
   }
 
   void test_functionTypedParameter_var() {
-    ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
+    ParserTestCase.parseCompilationUnit(
+        "void f(var x()) {}",
+        [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
   }
 
   void test_getterInFunction_block_noReturnType() {
-    ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "get x { return _x; }",
+        [ParserErrorCode.GETTER_IN_FUNCTION]);
   }
 
   void test_getterInFunction_block_returnType() {
-    ParserTestCase.parseStatement("int get x { return _x; }", [ParserErrorCode.GETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "int get x { return _x; }",
+        [ParserErrorCode.GETTER_IN_FUNCTION]);
   }
 
   void test_getterInFunction_expression_noReturnType() {
-    ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "get x => _x;",
+        [ParserErrorCode.GETTER_IN_FUNCTION]);
   }
 
   void test_getterInFunction_expression_returnType() {
-    ParserTestCase.parseStatement("int get x => _x;", [ParserErrorCode.GETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "int get x => _x;",
+        [ParserErrorCode.GETTER_IN_FUNCTION]);
   }
 
   void test_getterWithParameters() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "int get x() {}",
+        [ParserErrorCode.GETTER_WITH_PARAMETERS]);
   }
 
   void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() {
-    ParserTestCase.parseExpression("0--", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    ParserTestCase.parseExpression(
+        "0--",
+        [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal() {
-    ParserTestCase.parseExpression("0++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    ParserTestCase.parseExpression(
+        "0++",
+        [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void test_illegalAssignmentToNonAssignable_postfix_plusPlus_parethesized() {
-    ParserTestCase.parseExpression("(x)++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    ParserTestCase.parseExpression(
+        "(x)++",
+        [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void test_illegalAssignmentToNonAssignable_primarySelectorPostfix() {
-    ParserTestCase.parseExpression("x(y)(z)++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    ParserTestCase.parseExpression(
+        "x(y)(z)++",
+        [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void test_illegalAssignmentToNonAssignable_superAssigned() {
-    // TODO(brianwilkerson) When the test fail_illegalAssignmentToNonAssignable_superAssigned starts
-    // to pass, remove this test (there should only be one error generated, but we're keeping this
-    // test until that time so that we can catch other forms of regressions).
-    ParserTestCase.parseExpression("super = x;", [
-        ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
-        ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
+    // TODO(brianwilkerson) When the test
+    // fail_illegalAssignmentToNonAssignable_superAssigned starts to pass,
+    // remove this test (there should only be one error generated, but we're
+    // keeping this test until that time so that we can catch other forms of
+    // regressions).
+    ParserTestCase.parseExpression(
+        "super = x;",
+        [
+            ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
+            ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
   }
 
   void test_implementsBeforeExtends() {
-    ParserTestCase.parseCompilationUnit("class A implements B extends C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]);
+    ParserTestCase.parseCompilationUnit(
+        "class A implements B extends C {}",
+        [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]);
   }
 
   void test_implementsBeforeWith() {
-    ParserTestCase.parseCompilationUnit("class A extends B implements C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]);
+    ParserTestCase.parseCompilationUnit(
+        "class A extends B implements C with D {}",
+        [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]);
   }
 
   void test_importDirectiveAfterPartDirective() {
-    ParserTestCase.parseCompilationUnit("part 'a.dart'; import 'b.dart';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
+    ParserTestCase.parseCompilationUnit(
+        "part 'a.dart'; import 'b.dart';",
+        [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
   }
 
   void test_initializedVariableInForEach() {
-    ParserTestCase.parse4("parseForStatement", "for (int a = 0 in foo) {}", [ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]);
+    ParserTestCase.parse4(
+        "parseForStatement",
+        "for (int a = 0 in foo) {}",
+        [ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]);
   }
 
   void test_invalidAwaitInFor() {
-    ParserTestCase.parse4("parseForStatement", "await for (; ;) {}", [ParserErrorCode.INVALID_AWAIT_IN_FOR]);
+    ParserTestCase.parse4(
+        "parseForStatement",
+        "await for (; ;) {}",
+        [ParserErrorCode.INVALID_AWAIT_IN_FOR]);
   }
 
   void test_invalidCodePoint() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\uD900'", [ParserErrorCode.INVALID_CODE_POINT]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\uD900'",
+        [ParserErrorCode.INVALID_CODE_POINT]);
   }
 
   void test_invalidHexEscape_invalidDigit() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INVALID_HEX_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\x0 a'",
+        [ParserErrorCode.INVALID_HEX_ESCAPE]);
   }
 
   void test_invalidHexEscape_tooFewDigits() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVALID_HEX_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\x0'",
+        [ParserErrorCode.INVALID_HEX_ESCAPE]);
   }
 
   void test_invalidInterpolationIdentifier_startWithDigit() {
-    ParserTestCase.parse4("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\$1'",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_invalidOperator() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void operator ===(x) {}", [ParserErrorCode.INVALID_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void operator ===(x) {}",
+        [ParserErrorCode.INVALID_OPERATOR]);
   }
 
   void test_invalidOperatorForSuper() {
-    ParserTestCase.parse4("parseUnaryExpression", "++super", [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]);
+    ParserTestCase.parse4(
+        "parseUnaryExpression",
+        "++super",
+        [ParserErrorCode.INVALID_OPERATOR_FOR_SUPER]);
   }
 
   void test_invalidStarAfterAsync() {
-    ParserTestCase.parse3("parseFunctionBody", <Object> [false, null, false], "async* => 0;", [ParserErrorCode.INVALID_STAR_AFTER_ASYNC]);
+    ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "async* => 0;",
+        [ParserErrorCode.INVALID_STAR_AFTER_ASYNC]);
   }
 
   void test_invalidSync() {
-    ParserTestCase.parse3("parseFunctionBody", <Object> [false, null, false], "sync* => 0;", [ParserErrorCode.INVALID_SYNC]);
+    ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "sync* => 0;",
+        [ParserErrorCode.INVALID_SYNC]);
   }
 
   void test_invalidUnicodeEscape_incomplete_noDigits() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u{'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
   }
 
   void test_invalidUnicodeEscape_incomplete_someDigits() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u{0A'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
   }
 
   void test_invalidUnicodeEscape_invalidDigit() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u0 a'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
   }
 
   void test_invalidUnicodeEscape_tooFewDigits_fixed() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u04'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
   }
 
   void test_invalidUnicodeEscape_tooFewDigits_variable() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u{}'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE]);
   }
 
   void test_invalidUnicodeEscape_tooManyDigits_variable() {
-    ParserTestCase.parse4("parseStringLiteral", "'\\u{12345678}'", [
-        ParserErrorCode.INVALID_UNICODE_ESCAPE,
-        ParserErrorCode.INVALID_CODE_POINT]);
+    ParserTestCase.parse4(
+        "parseStringLiteral",
+        "'\\u{12345678}'",
+        [ParserErrorCode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]);
   }
 
   void test_libraryDirectiveNotFirst() {
-    ParserTestCase.parseCompilationUnit("import 'x.dart'; library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
+    ParserTestCase.parseCompilationUnit(
+        "import 'x.dart'; library l;",
+        [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
   }
 
   void test_libraryDirectiveNotFirst_afterPart() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("part 'a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "part 'a.dart';\nlibrary l;",
+        [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
     expect(unit, isNotNull);
   }
 
   void test_localFunctionDeclarationModifier_abstract() {
-    ParserTestCase.parseStatement("abstract f() {}", [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
+    ParserTestCase.parseStatement(
+        "abstract f() {}",
+        [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
   }
 
   void test_localFunctionDeclarationModifier_external() {
-    ParserTestCase.parseStatement("external f() {}", [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
+    ParserTestCase.parseStatement(
+        "external f() {}",
+        [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
   }
 
   void test_localFunctionDeclarationModifier_factory() {
-    ParserTestCase.parseStatement("factory f() {}", [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
+    ParserTestCase.parseStatement(
+        "factory f() {}",
+        [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
   }
 
   void test_localFunctionDeclarationModifier_static() {
-    ParserTestCase.parseStatement("static f() {}", [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
+    ParserTestCase.parseStatement(
+        "static f() {}",
+        [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
   }
 
   void test_missingAssignableSelector_identifiersAssigned() {
@@ -1081,11 +1708,15 @@
   }
 
   void test_missingAssignableSelector_prefix_minusMinus_literal() {
-    ParserTestCase.parseExpression("--0", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
+    ParserTestCase.parseExpression(
+        "--0",
+        [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
   }
 
   void test_missingAssignableSelector_prefix_plusPlus_literal() {
-    ParserTestCase.parseExpression("++0", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
+    ParserTestCase.parseExpression(
+        "++0",
+        [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
   }
 
   void test_missingAssignableSelector_selector() {
@@ -1093,7 +1724,10 @@
   }
 
   void test_missingAssignableSelector_superPrimaryExpression() {
-    SuperExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
+    SuperExpression expression = ParserTestCase.parse4(
+        "parsePrimaryExpression",
+        "super",
+        [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
     expect(expression.keyword, isNotNull);
   }
 
@@ -1102,129 +1736,217 @@
   }
 
   void test_missingCatchOrFinally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}", [ParserErrorCode.MISSING_CATCH_OR_FINALLY]);
+    TryStatement statement = ParserTestCase.parse4(
+        "parseTryStatement",
+        "try {}",
+        [ParserErrorCode.MISSING_CATCH_OR_FINALLY]);
     expect(statement, isNotNull);
   }
 
   void test_missingClassBody() {
-    ParserTestCase.parseCompilationUnit("class A class B {}", [ParserErrorCode.MISSING_CLASS_BODY]);
+    ParserTestCase.parseCompilationUnit(
+        "class A class B {}",
+        [ParserErrorCode.MISSING_CLASS_BODY]);
   }
 
   void test_missingConstFinalVarOrType_static() {
-    ParserTestCase.parseCompilationUnit("class A { static f; }", [ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
+    ParserTestCase.parseCompilationUnit(
+        "class A { static f; }",
+        [ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
   }
 
   void test_missingConstFinalVarOrType_topLevel() {
-    ParserTestCase.parse3("parseFinalConstVarOrType", <Object> [false], "a;", [ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
+    ParserTestCase.parse3(
+        "parseFinalConstVarOrType",
+        <Object>[false],
+        "a;",
+        [ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
   }
 
   void test_missingEnumBody() {
-    ParserTestCase.parse3("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E;", [ParserErrorCode.MISSING_ENUM_BODY]);
+    ParserTestCase.parse3(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E;",
+        [ParserErrorCode.MISSING_ENUM_BODY]);
   }
 
   void test_missingExpressionInThrow_withCascade() {
-    ParserTestCase.parse4("parseThrowExpression", "throw;", [ParserErrorCode.MISSING_EXPRESSION_IN_THROW]);
+    ParserTestCase.parse4(
+        "parseThrowExpression",
+        "throw;",
+        [ParserErrorCode.MISSING_EXPRESSION_IN_THROW]);
   }
 
   void test_missingExpressionInThrow_withoutCascade() {
-    ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw;", [ParserErrorCode.MISSING_EXPRESSION_IN_THROW]);
+    ParserTestCase.parse4(
+        "parseThrowExpressionWithoutCascade",
+        "throw;",
+        [ParserErrorCode.MISSING_EXPRESSION_IN_THROW]);
   }
 
   void test_missingFunctionBody_emptyNotAllowed() {
-    ParserTestCase.parse3("parseFunctionBody", <Object> [false, ParserErrorCode.MISSING_FUNCTION_BODY, false], ";", [ParserErrorCode.MISSING_FUNCTION_BODY]);
+    ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, ParserErrorCode.MISSING_FUNCTION_BODY, false],
+        ";",
+        [ParserErrorCode.MISSING_FUNCTION_BODY]);
   }
 
   void test_missingFunctionBody_invalid() {
-    ParserTestCase.parse3("parseFunctionBody", <Object> [false, ParserErrorCode.MISSING_FUNCTION_BODY, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BODY]);
+    ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, ParserErrorCode.MISSING_FUNCTION_BODY, false],
+        "return 0;",
+        [ParserErrorCode.MISSING_FUNCTION_BODY]);
   }
 
   void test_missingFunctionParameters_local_void_block() {
-    ParserTestCase.parseStatement("void f { return x;}", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseStatement(
+        "void f { return x;}",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingFunctionParameters_local_void_expression() {
-    ParserTestCase.parseStatement("void f => x;", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseStatement(
+        "void f => x;",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingFunctionParameters_topLevel_nonVoid_block() {
-    ParserTestCase.parseCompilationUnit("int f { return x;}", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "int f { return x;}",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingFunctionParameters_topLevel_nonVoid_expression() {
-    ParserTestCase.parseCompilationUnit("int f => x;", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "int f => x;",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingFunctionParameters_topLevel_void_block() {
-    ParserTestCase.parseCompilationUnit("void f { return x;}", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "void f { return x;}",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingFunctionParameters_topLevel_void_expression() {
-    ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "void f => x;",
+        [ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
   }
 
   void test_missingIdentifier_afterOperator() {
-    ParserTestCase.parse4("parseMultiplicativeExpression", "1 *", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseMultiplicativeExpression",
+        "1 *",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_missingIdentifier_beforeClosingCurly() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int}", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "int}",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
-    ParserTestCase.parse4("parseFunctionDeclarationStatement", "A<T> () {}", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseFunctionDeclarationStatement",
+        "A<T> () {}",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_missingIdentifier_inEnum() {
-    ParserTestCase.parse3("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E {, TWO}", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse3(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E {, TWO}",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_missingIdentifier_inSymbol_afterPeriod() {
-    ParserTestCase.parse4("parseSymbolLiteral", "#a.", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseSymbolLiteral",
+        "#a.",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_missingIdentifier_inSymbol_first() {
-    ParserTestCase.parse4("parseSymbolLiteral", "#", [ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parse4(
+        "parseSymbolLiteral",
+        "#",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_missingIdentifier_number() {
-    SimpleIdentifier expression = ParserTestCase.parse4("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
+    SimpleIdentifier expression = ParserTestCase.parse4(
+        "parseSimpleIdentifier",
+        "1",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     expect(expression.isSynthetic, isTrue);
   }
 
   void test_missingKeywordOperator() {
-    ParserTestCase.parse3("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseOperator",
+        <Object>[emptyCommentAndMetadata(), null, null],
+        "+(x) {}",
+        [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
   }
 
   void test_missingKeywordOperator_parseClassMember() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "+() {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "+() {}",
+        [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
   }
 
   void test_missingKeywordOperator_parseClassMember_afterTypeName() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int +() {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "int +() {}",
+        [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
   }
 
   void test_missingKeywordOperator_parseClassMember_afterVoid() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void +() {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void +() {}",
+        [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
   }
 
   void test_missingNameInLibraryDirective() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "library;",
+        [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
     expect(unit, isNotNull);
   }
 
   void test_missingNameInPartOfDirective() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "part of;",
+        [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]);
     expect(unit, isNotNull);
   }
 
   void test_missingPrefixInDeferredImport() {
-    ParserTestCase.parseCompilationUnit("import 'foo.dart' deferred;", [ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT]);
+    ParserTestCase.parseCompilationUnit(
+        "import 'foo.dart' deferred;",
+        [ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT]);
   }
 
   void test_missingStartAfterSync() {
-    ParserTestCase.parse3("parseFunctionBody", <Object> [false, null, false], "sync {}", [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
+    ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "sync {}",
+        [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
   }
 
   void test_missingStatement() {
@@ -1236,345 +1958,576 @@
   }
 
   void test_missingTerminatorForParameterGroup_named() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, {b: 0)", [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, {b: 0)",
+        [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 
   void test_missingTerminatorForParameterGroup_optional() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, [b = 0)", [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, [b = 0)",
+        [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 
   void test_missingTypedefParameters_nonVoid() {
-    ParserTestCase.parseCompilationUnit("typedef int F;", [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "typedef int F;",
+        [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
   }
 
   void test_missingTypedefParameters_typeParameters() {
-    ParserTestCase.parseCompilationUnit("typedef F<E>;", [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "typedef F<E>;",
+        [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
   }
 
   void test_missingTypedefParameters_void() {
-    ParserTestCase.parseCompilationUnit("typedef void F;", [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "typedef void F;",
+        [ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
   }
 
   void test_missingVariableInForEach() {
-    ParserTestCase.parse4("parseForStatement", "for (a < b in foo) {}", [ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH]);
+    ParserTestCase.parse4(
+        "parseForStatement",
+        "for (a < b in foo) {}",
+        [ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH]);
   }
 
   void test_mixedParameterGroups_namedPositional() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, [c])", [ParserErrorCode.MIXED_PARAMETER_GROUPS]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, {b}, [c])",
+        [ParserErrorCode.MIXED_PARAMETER_GROUPS]);
   }
 
   void test_mixedParameterGroups_positionalNamed() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, [b], {c})", [ParserErrorCode.MIXED_PARAMETER_GROUPS]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, [b], {c})",
+        [ParserErrorCode.MIXED_PARAMETER_GROUPS]);
   }
 
   void test_mixin_application_lacks_with_clause() {
-    ParserTestCase.parseCompilationUnit("class Foo = Bar;", [ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parseCompilationUnit(
+        "class Foo = Bar;",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_multipleExtendsClauses() {
-    ParserTestCase.parseCompilationUnit("class A extends B extends C {}", [ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES]);
+    ParserTestCase.parseCompilationUnit(
+        "class A extends B extends C {}",
+        [ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES]);
   }
 
   void test_multipleImplementsClauses() {
-    ParserTestCase.parseCompilationUnit("class A implements B implements C {}", [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES]);
+    ParserTestCase.parseCompilationUnit(
+        "class A implements B implements C {}",
+        [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES]);
   }
 
   void test_multipleLibraryDirectives() {
-    ParserTestCase.parseCompilationUnit("library l; library m;", [ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]);
+    ParserTestCase.parseCompilationUnit(
+        "library l; library m;",
+        [ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]);
   }
 
   void test_multipleNamedParameterGroups() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, {c})", [ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, {b}, {c})",
+        [ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]);
   }
 
   void test_multiplePartOfDirectives() {
-    ParserTestCase.parseCompilationUnit("part of l; part of m;", [ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES]);
+    ParserTestCase.parseCompilationUnit(
+        "part of l; part of m;",
+        [ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES]);
   }
 
   void test_multiplePositionalParameterGroups() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, [b], [c])", [ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, [b], [c])",
+        [ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]);
   }
 
   void test_multipleVariablesInForEach() {
-    ParserTestCase.parse4("parseForStatement", "for (int a, b in foo) {}", [ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]);
+    ParserTestCase.parse4(
+        "parseForStatement",
+        "for (int a, b in foo) {}",
+        [ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]);
   }
 
   void test_multipleWithClauses() {
-    ParserTestCase.parseCompilationUnit("class A extends B with C with D {}", [ParserErrorCode.MULTIPLE_WITH_CLAUSES]);
+    ParserTestCase.parseCompilationUnit(
+        "class A extends B with C with D {}",
+        [ParserErrorCode.MULTIPLE_WITH_CLAUSES]);
   }
 
   void test_namedParameterOutsideGroup() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, b : 0)", [ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, b : 0)",
+        [ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP]);
   }
 
   void test_nonConstructorFactory_field() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "factory int x;",
+        [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
   }
 
   void test_nonConstructorFactory_method() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int m() {}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "factory int m() {}",
+        [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
   }
 
   void test_nonIdentifierLibraryName_library() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "library 'lib';",
+        [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
     expect(unit, isNotNull);
   }
 
   void test_nonIdentifierLibraryName_partOf() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "part of 'lib';",
+        [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
     expect(unit, isNotNull);
   }
 
   void test_nonPartOfDirectiveInPart_after() {
-    ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
+    ParserTestCase.parseCompilationUnit(
+        "part of l; part 'f.dart';",
+        [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
   }
 
   void test_nonPartOfDirectiveInPart_before() {
-    ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
+    ParserTestCase.parseCompilationUnit(
+        "part 'f.dart'; part of m;",
+        [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
   }
 
   void test_nonUserDefinableOperator() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "operator +=(int x) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "operator +=(int x) => x + 1;",
+        [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]);
   }
 
   void test_optionalAfterNormalParameters_named() {
-    ParserTestCase.parseCompilationUnit("f({a}, b) {}", [ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "f({a}, b) {}",
+        [ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS]);
   }
 
   void test_optionalAfterNormalParameters_positional() {
-    ParserTestCase.parseCompilationUnit("f([a], b) {}", [ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS]);
+    ParserTestCase.parseCompilationUnit(
+        "f([a], b) {}",
+        [ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS]);
   }
 
   void test_parseCascadeSection_missingIdentifier() {
-    MethodInvocation methodInvocation = ParserTestCase.parse4("parseCascadeSection", "..()", [ParserErrorCode.MISSING_IDENTIFIER]);
+    MethodInvocation methodInvocation = ParserTestCase.parse4(
+        "parseCascadeSection",
+        "..()",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     expect(methodInvocation.target, isNull);
     expect(methodInvocation.methodName.name, "");
     expect(methodInvocation.argumentList.arguments, hasLength(0));
   }
 
   void test_positionalAfterNamedArgument() {
-    ParserTestCase.parse4("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT]);
+    ParserTestCase.parse4(
+        "parseArgumentList",
+        "(x: 1, 2)",
+        [ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT]);
   }
 
   void test_positionalParameterOutsideGroup() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, b = 0)", [ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, b = 0)",
+        [ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
   }
 
   void test_redirectionInNonFactoryConstructor() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "C() = D;", [ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "C() = D;",
+        [ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR]);
   }
 
   void test_setterInFunction_block() {
-    ParserTestCase.parseStatement("set x(v) {_x = v;}", [ParserErrorCode.SETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "set x(v) {_x = v;}",
+        [ParserErrorCode.SETTER_IN_FUNCTION]);
   }
 
   void test_setterInFunction_expression() {
-    ParserTestCase.parseStatement("set x(v) => _x = v;", [ParserErrorCode.SETTER_IN_FUNCTION]);
+    ParserTestCase.parseStatement(
+        "set x(v) => _x = v;",
+        [ParserErrorCode.SETTER_IN_FUNCTION]);
   }
 
   void test_staticAfterConst() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "final static int f;",
+        [ParserErrorCode.STATIC_AFTER_FINAL]);
   }
 
   void test_staticAfterFinal() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "const static int f;",
+        [ParserErrorCode.STATIC_AFTER_CONST]);
   }
 
   void test_staticAfterVar() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var static f;", [ParserErrorCode.STATIC_AFTER_VAR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "var static f;",
+        [ParserErrorCode.STATIC_AFTER_VAR]);
   }
 
   void test_staticConstructor() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static C.m() {}",
+        [ParserErrorCode.STATIC_CONSTRUCTOR]);
   }
 
   void test_staticGetterWithoutBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static get m;", [ParserErrorCode.STATIC_GETTER_WITHOUT_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static get m;",
+        [ParserErrorCode.STATIC_GETTER_WITHOUT_BODY]);
   }
 
   void test_staticOperator_noReturnType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static operator +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static operator +(int x) => x + 1;",
+        [ParserErrorCode.STATIC_OPERATOR]);
   }
 
   void test_staticOperator_returnType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static int operator +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static int operator +(int x) => x + 1;",
+        [ParserErrorCode.STATIC_OPERATOR]);
   }
 
   void test_staticSetterWithoutBody() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static set m(x);", [ParserErrorCode.STATIC_SETTER_WITHOUT_BODY]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "static set m(x);",
+        [ParserErrorCode.STATIC_SETTER_WITHOUT_BODY]);
   }
 
   void test_staticTopLevelDeclaration_class() {
-    ParserTestCase.parseCompilationUnit("static class C {}", [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "static class C {}",
+        [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
   }
 
   void test_staticTopLevelDeclaration_function() {
-    ParserTestCase.parseCompilationUnit("static f() {}", [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "static f() {}",
+        [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
   }
 
   void test_staticTopLevelDeclaration_typedef() {
-    ParserTestCase.parseCompilationUnit("static typedef F();", [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "static typedef F();",
+        [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
   }
 
   void test_staticTopLevelDeclaration_variable() {
-    ParserTestCase.parseCompilationUnit("static var x;", [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
+    ParserTestCase.parseCompilationUnit(
+        "static var x;",
+        [ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
   }
 
   void test_switchHasCaseAfterDefaultCase() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0; case 1: return 1;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {default: return 0; case 1: return 1;}",
+        [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
   }
 
   void test_switchHasCaseAfterDefaultCase_repeated() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0; case 1: return 1; case 2: return 2;}", [
-        ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
-        ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {default: return 0; case 1: return 1; case 2: return 2;}",
+        [
+            ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
+            ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
   }
 
   void test_switchHasMultipleDefaultCases() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0; default: return 1;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {default: return 0; default: return 1;}",
+        [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
   }
 
   void test_switchHasMultipleDefaultCases_repeated() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0; default: return 1; default: return 2;}", [
-        ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
-        ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
+    ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {default: return 0; default: return 1; default: return 2;}",
+        [
+            ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
+            ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
   }
 
   void test_topLevelOperator_withoutType() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "operator +(bool x, bool y) => x | y;",
+        [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
 
   void test_topLevelOperator_withType() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "bool operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "bool operator +(bool x, bool y) => x | y;",
+        [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
 
   void test_topLevelOperator_withVoid() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL_OPERATOR]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void operator +(bool x, bool y) => x | y;",
+        [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
 
   void test_unexpectedTerminatorForParameterGroup_named() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, b})", [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, b})",
+        [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 
   void test_unexpectedTerminatorForParameterGroup_optional() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, b])", [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, b])",
+        [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 
   void test_unexpectedToken_semicolonBetweenClassMembers() {
-    ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]);
+    ParserTestCase.parse3(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class C { int x; ; int y;}",
+        [ParserErrorCode.UNEXPECTED_TOKEN]);
   }
 
   void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() {
-    ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEXPECTED_TOKEN]);
+    ParserTestCase.parseCompilationUnit(
+        "int x; ; int y;",
+        [ParserErrorCode.UNEXPECTED_TOKEN]);
   }
 
   void test_useOfUnaryPlusOperator() {
-    SimpleIdentifier expression = ParserTestCase.parse4("parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression);
+    SimpleIdentifier expression = ParserTestCase.parse4(
+        "parseUnaryExpression",
+        "+x",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression);
     expect(expression.isSynthetic, isTrue);
   }
 
   void test_varAndType_field() {
-    ParserTestCase.parseCompilationUnit("class C { var int x; }", [ParserErrorCode.VAR_AND_TYPE]);
+    ParserTestCase.parseCompilationUnit(
+        "class C { var int x; }",
+        [ParserErrorCode.VAR_AND_TYPE]);
   }
 
   void test_varAndType_topLevelVariable() {
-    ParserTestCase.parseCompilationUnit("var int x;", [ParserErrorCode.VAR_AND_TYPE]);
+    ParserTestCase.parseCompilationUnit(
+        "var int x;",
+        [ParserErrorCode.VAR_AND_TYPE]);
   }
 
   void test_varAsTypeName_as() {
-    ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME]);
+    ParserTestCase.parseExpression(
+        "x as var",
+        [ParserErrorCode.VAR_AS_TYPE_NAME]);
   }
 
   void test_varClass() {
-    ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_CLASS]);
+    ParserTestCase.parseCompilationUnit(
+        "var class C {}",
+        [ParserErrorCode.VAR_CLASS]);
   }
 
   void test_varEnum() {
-    ParserTestCase.parseCompilationUnit("var enum E {ONE}", [ParserErrorCode.VAR_ENUM]);
+    ParserTestCase.parseCompilationUnit(
+        "var enum E {ONE}",
+        [ParserErrorCode.VAR_ENUM]);
   }
 
   void test_varReturnType() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var m() {}", [ParserErrorCode.VAR_RETURN_TYPE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "var m() {}",
+        [ParserErrorCode.VAR_RETURN_TYPE]);
   }
 
   void test_varTypedef() {
-    ParserTestCase.parseCompilationUnit("var typedef F();", [ParserErrorCode.VAR_TYPEDEF]);
+    ParserTestCase.parseCompilationUnit(
+        "var typedef F();",
+        [ParserErrorCode.VAR_TYPEDEF]);
   }
 
   void test_voidParameter() {
-    ParserTestCase.parse4("parseNormalFormalParameter", "void a)", [ParserErrorCode.VOID_PARAMETER]);
+    ParserTestCase.parse4(
+        "parseNormalFormalParameter",
+        "void a)",
+        [ParserErrorCode.VOID_PARAMETER]);
   }
 
   void test_voidVariable_parseClassMember_initializer() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x = 0;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void x = 0;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_parseClassMember_noInitializer() {
-    ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "void x;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_parseCompilationUnit_initializer() {
-    ParserTestCase.parseCompilationUnit("void x = 0;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parseCompilationUnit(
+        "void x = 0;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_parseCompilationUnit_noInitializer() {
-    ParserTestCase.parseCompilationUnit("void x;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parseCompilationUnit(
+        "void x;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_parseCompilationUnitMember_initializer() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void a = 0;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void a = 0;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_parseCompilationUnitMember_noInitializer() {
-    ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void a;", [ParserErrorCode.VOID_VARIABLE]);
+    ParserTestCase.parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void a;",
+        [ParserErrorCode.VOID_VARIABLE]);
   }
 
   void test_voidVariable_statement_initializer() {
-    ParserTestCase.parseStatement("void x = 0;", [
-        ParserErrorCode.VOID_VARIABLE,
-        ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
+    ParserTestCase.parseStatement(
+        "void x = 0;",
+        [
+            ParserErrorCode.VOID_VARIABLE,
+            ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
   }
 
   void test_voidVariable_statement_noInitializer() {
-    ParserTestCase.parseStatement("void x;", [
-        ParserErrorCode.VOID_VARIABLE,
-        ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
+    ParserTestCase.parseStatement(
+        "void x;",
+        [
+            ParserErrorCode.VOID_VARIABLE,
+            ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
   }
 
   void test_withBeforeExtends() {
-    ParserTestCase.parseCompilationUnit("class A with B extends C {}", [ParserErrorCode.WITH_BEFORE_EXTENDS]);
+    ParserTestCase.parseCompilationUnit(
+        "class A with B extends C {}",
+        [ParserErrorCode.WITH_BEFORE_EXTENDS]);
   }
 
   void test_withWithoutExtends() {
-    ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
+    ParserTestCase.parse3(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A with B, C {}",
+        [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
   }
 
   void test_wrongSeparatorForNamedParameter() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, {b = 0})", [ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, {b = 0})",
+        [ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
   }
 
   void test_wrongSeparatorForPositionalParameter() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, [b : 0])", [ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, [b : 0])",
+        [ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]);
   }
 
   void test_wrongTerminatorForParameterGroup_named() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, {b, c])", [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, {b, c])",
+        [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 
   void test_wrongTerminatorForParameterGroup_optional() {
-    ParserTestCase.parse4("parseFormalParameterList", "(a, [b, c})", [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
+    ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "(a, [b, c})",
+        [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
   }
 }
 
 class IncrementalParserTest extends EngineTestCase {
-  void fail_replace_identifier_with_functionLiteral_in_initializer() {
-    // Function literals aren't allowed inside initializers; incremental parsing needs to gather
-    // the appropriate context.
+  void fail_replace_identifier_with_functionLiteral_in_initializer_interp() {
+    // TODO(paulberry, brianwilkerson): broken due to incremental scanning bugs
+
+    // Function literals are allowed inside interpolation expressions in
+    // initializers.
     //
-    // "class A { var a; A(b) : a = b ? b : 0 { } }"
-    // "class A { var a; A(b) : a = b ? () {} : 0 { } }"
-    _assertParse("class A { var a; A(b) : a = b ? ", "b", "() {}", " : 0 { } }");
+    // 'class A { var a; A(b) : a = "${b}";'
+    // 'class A { var a; A(b) : a = "${() {}}";'
+    _assertParse(r'class A { var a; A(b) : a = "${', 'b', '() {}', '}";');
   }
 
   void test_delete_everything() {
@@ -1643,6 +2596,18 @@
     _assertParse("class A {}", "", " class B {}", "");
   }
 
+  void test_insert_final_before_field_declaration() {
+    _assertParse('class C { ', '', 'final ', 'int x; }');
+  }
+
+  void test_insert_function_parameter() {
+    _assertParse('class C { void f(', '', 'arg', ') {} }');
+  }
+
+  void test_insert_identifier_inCombinator() {
+    _assertParse("import 'foo.dart' show x", "", ", y", ";");
+  }
+
   void test_insert_insideClassBody() {
     // "class C {C(); }"
     // "class C { C(); }"
@@ -1676,7 +2641,11 @@
   void test_insert_newIdentifier4() {
     // "/** An [A]. */ class A {} class B { m() { return 1; } }"
     // "/** An [A]. */ class A {} class B { m() { return 1 + 2; } }"
-    _assertParse("/** An [A]. */ class A {} class B { m() { return 1", "", " + 2", "; } }");
+    _assertParse(
+        "/** An [A]. */ class A {} class B { m() { return 1",
+        "",
+        " + 2",
+        "; } }");
   }
 
   void test_insert_period() {
@@ -1718,7 +2687,28 @@
   void test_insert_simpleToComplexExression() {
     // "/** An [A]. */ class A {} class B { m() => 1; }"
     // "/** An [A]. */ class A {} class B { m() => 1 + 2; }"
-    _assertParse("/** An [A]. */ class A {} class B { m() => 1", "", " + 2", "; }");
+    _assertParse(
+        "/** An [A]. */ class A {} class B { m() => 1",
+        "",
+        " + 2",
+        "; }");
+  }
+
+  void test_insert_statement_in_method_with_mismatched_braces() {
+    _assertParse('''
+class C {
+  void f() {
+''', '', 'g();', '''
+    if (b) {
+
+
+  }
+
+  void g() {
+    h((x) {});
+  }
+}
+''');
   }
 
   void test_insert_whitespace_end() {
@@ -1739,6 +2729,18 @@
     _assertParse("f() => a", "", " ", " + b;");
   }
 
+  void test_rename_class_withConstructor() {
+    // "class C { C() {} }"
+    // "class D { C() {} }"
+    _assertParse('class ', 'C', 'D', ' { C() {} }');
+  }
+
+  void test_replace_field_type_with_void() {
+    // Note: this produces an error, but we still need the parser to produce a
+    // consistent parse tree for it.
+    _assertParse('class C { ', 'int', 'void', ' x; }');
+  }
+
   void test_replace_identifier_beginning() {
     // "f() => bell + b;"
     // "f() => fell + b;"
@@ -1757,6 +2759,51 @@
     _assertParse("f() => f", "ir", "ro", "st + b;");
   }
 
+  void test_replace_identifier_with_functionLiteral_in_initializer() {
+    // Function literals aren't allowed inside initializers; incremental parsing
+    // needs to gather the appropriate context.
+    //
+    // "class A { var a; A(b) : a = b ? b : 0 { } }"
+    // "class A { var a; A(b) : a = b ? () {} : 0 { } }"
+    _assertParse(
+        "class A { var a; A(b) : a = b ? ",
+        "b",
+        "() {}",
+        " : 0 { } }");
+  }
+
+  void test_replace_identifier_with_functionLiteral_in_initializer_index() {
+    // Function literals are allowed inside index expressions in initializers.
+    //
+    // "class A { var a; A(b) : a = b[b];"
+    // "class A { var a; A(b) : a = b[() {}];"
+    _assertParse('class A { var a; A(b) : a = b[', 'b', '() {}', '];');
+  }
+
+  void test_replace_identifier_with_functionLiteral_in_initializer_list() {
+    // Function literals are allowed inside list literals in initializers.
+    //
+    // "class A { var a; A(b) : a = [b];"
+    // "class A { var a; A(b) : a = [() {}];"
+    _assertParse('class A { var a; A(b) : a = [', 'b', '() {}', '];');
+  }
+
+  void test_replace_identifier_with_functionLiteral_in_initializer_map() {
+    // Function literals are allowed inside map literals in initializers.
+    //
+    // "class A { var a; A(b) : a = {0: b};"
+    // "class A { var a; A(b) : a = {0: () {}};"
+    _assertParse('class A { var a; A(b) : a = {0: ', 'b', '() {}', '};');
+  }
+
+  void test_replace_identifier_with_functionLiteral_in_initializer_parens() {
+    // Function literals are allowed inside parentheses in initializers.
+    //
+    // "class A { var a; A(b) : a = (b);"
+    // "class A { var a; A(b) : a = (() {});"
+    _assertParse('class A { var a; A(b) : a = (', 'b', '() {}', ');');
+  }
+
   void test_replace_multiple_partialFirstAndLast() {
     // "f() => aa + bb;"
     // "f() => ab * ab;"
@@ -1775,6 +2822,12 @@
     _assertParse("f() => a ", "+", "*", " b;");
   }
 
+  void test_split_combinator() {
+    // "import 'foo.dart' show A;"
+    // "import 'foo.dart' show B hide A;"
+    _assertParse("import 'foo.dart' show ", "", "B hide ", "A;");
+  }
+
   /**
    * Given a description of the original and modified contents, perform an incremental scan of the
    * two pieces of text.
@@ -1784,7 +2837,8 @@
    * @param added the text that was added to the modified contents
    * @param suffix the unchanged text after the edit region
    */
-  void _assertParse(String prefix, String removed, String added, String suffix) {
+  void _assertParse(String prefix, String removed, String added,
+      String suffix) {
     //
     // Compute the information needed to perform the test.
     //
@@ -1796,35 +2850,58 @@
     // Parse the original contents.
     //
     GatheringErrorListener originalListener = new GatheringErrorListener();
-    Scanner originalScanner = new Scanner(source, new CharSequenceReader(originalContents), originalListener);
+    Scanner originalScanner = new Scanner(
+        source,
+        new CharSequenceReader(originalContents),
+        originalListener);
     Token originalTokens = originalScanner.tokenize();
     expect(originalTokens, isNotNull);
     Parser originalParser = new Parser(source, originalListener);
-    CompilationUnit originalUnit = originalParser.parseCompilationUnit(originalTokens);
+    CompilationUnit originalUnit =
+        originalParser.parseCompilationUnit(originalTokens);
     expect(originalUnit, isNotNull);
     //
     // Parse the modified contents.
     //
     GatheringErrorListener modifiedListener = new GatheringErrorListener();
-    Scanner modifiedScanner = new Scanner(source, new CharSequenceReader(modifiedContents), modifiedListener);
+    Scanner modifiedScanner = new Scanner(
+        source,
+        new CharSequenceReader(modifiedContents),
+        modifiedListener);
     Token modifiedTokens = modifiedScanner.tokenize();
     expect(modifiedTokens, isNotNull);
     Parser modifiedParser = new Parser(source, modifiedListener);
-    CompilationUnit modifiedUnit = modifiedParser.parseCompilationUnit(modifiedTokens);
+    CompilationUnit modifiedUnit =
+        modifiedParser.parseCompilationUnit(modifiedTokens);
     expect(modifiedUnit, isNotNull);
     //
     // Incrementally parse the modified contents.
     //
     GatheringErrorListener incrementalListener = new GatheringErrorListener();
-    IncrementalScanner incrementalScanner = new IncrementalScanner(source, new CharSequenceReader(modifiedContents), incrementalListener);
-    Token incrementalTokens = incrementalScanner.rescan(originalTokens, replaceStart, removed.length, added.length);
+    IncrementalScanner incrementalScanner = new IncrementalScanner(
+        source,
+        new CharSequenceReader(modifiedContents),
+        incrementalListener);
+    Token incrementalTokens = incrementalScanner.rescan(
+        originalTokens,
+        replaceStart,
+        removed.length,
+        added.length);
     expect(incrementalTokens, isNotNull);
-    IncrementalParser incrementalParser = new IncrementalParser(source, incrementalScanner.tokenMap, incrementalListener);
-    CompilationUnit incrementalUnit = incrementalParser.reparse(originalUnit, incrementalScanner.leftToken, incrementalScanner.rightToken, replaceStart, prefix.length + removed.length);
+    IncrementalParser incrementalParser = new IncrementalParser(
+        source,
+        incrementalScanner.tokenMap,
+        incrementalListener);
+    CompilationUnit incrementalUnit = incrementalParser.reparse(
+        originalUnit,
+        incrementalScanner.leftToken,
+        incrementalScanner.rightToken,
+        replaceStart,
+        prefix.length + removed.length);
     expect(incrementalUnit, isNotNull);
     //
-    // Validate that the results of the incremental parse are the same as the full parse of the
-    // modified source.
+    // Validate that the results of the incremental parse are the same as the
+    // full parse of the modified source.
     //
     expect(AstComparator.equalNodes(modifiedUnit, incrementalUnit), isTrue);
     // TODO(brianwilkerson) Verify that the errors are correct?
@@ -1833,15 +2910,18 @@
 
 class NonErrorParserTest extends ParserTestCase {
   void test_constFactory_external() {
-    ParserTestCase.parse("parseClassMember", <Object> ["C"], "external const factory C();");
+    ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "external const factory C();");
   }
 }
 
 class ParserTestCase extends EngineTestCase {
   /**
-   * An empty array of objects used as arguments to zero-argument methods.
+   * An empty list of objects used as arguments to zero-argument methods.
    */
-  static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0);
+  static const List<Object> _EMPTY_ARGUMENTS = const <Object>[];
 
   /**
    * A flag indicating whether parser is to parse function bodies.
@@ -1849,6 +2929,32 @@
   static bool parseFunctionBodies = true;
 
   /**
+   * Return a CommentAndMetadata object with the given values that can be used for testing.
+   *
+   * @param comment the comment to be wrapped in the object
+   * @param annotations the annotations to be wrapped in the object
+   * @return a CommentAndMetadata object that can be used for testing
+   */
+  CommentAndMetadata commentAndMetadata(Comment comment,
+      [List<Annotation> annotations]) {
+    return new CommentAndMetadata(comment, annotations);
+  }
+
+  /**
+   * Return an empty CommentAndMetadata object that can be used for testing.
+   *
+   * @return an empty CommentAndMetadata object that can be used for testing
+   */
+  CommentAndMetadata emptyCommentAndMetadata() =>
+      new CommentAndMetadata(null, null);
+
+  @override
+  void setUp() {
+    super.setUp();
+    parseFunctionBodies = true;
+  }
+
+  /**
    * Create a parser.
    *
    * @param listener the listener to be passed to the parser
@@ -1863,172 +2969,6 @@
   }
 
   /**
-   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
-   * type of parameters and will be invoked with the given arguments.
-   *
-   * The given source is scanned and the parser is initialized to start with the first token in the
-   * source before the parse method is invoked.
-   *
-   * @param methodName the name of the parse method that should be invoked to parse the source
-   * @param objects the values of the arguments to the method
-   * @param source the source to be parsed by the parse method
-   * @return the result of invoking the method
-   * @throws Exception if the method could not be invoked or throws an exception
-   * @throws AssertionFailedError if the result is `null` or if any errors are produced
-   */
-  static Object parse(String methodName, List<Object> objects, String source)
-      => parse2(methodName, objects, source);
-
-  /**
-   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
-   * type of parameters and will be invoked with the given arguments.
-   *
-   * The given source is scanned and the parser is initialized to start with the first token in the
-   * source before the parse method is invoked.
-   *
-   * @param methodName the name of the parse method that should be invoked to parse the source
-   * @param objects the values of the arguments to the method
-   * @param source the source to be parsed by the parse method
-   * @param errors the errors that should be generated
-   * @return the result of invoking the method
-   * @throws Exception if the method could not be invoked or throws an exception
-   * @throws AssertionFailedError if the result is `null` or the errors produced while
-   *           scanning and parsing the source do not match the expected errors
-   */
-  static Object parse2(String methodName, List<Object> objects, String source, [List<AnalysisError> errors = AnalysisError.NO_ERRORS]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Object result = invokeParserMethod(methodName, objects, source, listener);
-    listener.assertErrors(errors);
-    return result;
-  }
-
-  /**
-   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
-   * type of parameters and will be invoked with the given arguments.
-   *
-   * The given source is scanned and the parser is initialized to start with the first token in the
-   * source before the parse method is invoked.
-   *
-   * @param methodName the name of the parse method that should be invoked to parse the source
-   * @param objects the values of the arguments to the method
-   * @param source the source to be parsed by the parse method
-   * @param errorCodes the error codes of the errors that should be generated
-   * @return the result of invoking the method
-   * @throws Exception if the method could not be invoked or throws an exception
-   * @throws AssertionFailedError if the result is `null` or the errors produced while
-   *           scanning and parsing the source do not match the expected errors
-   */
-  static Object parse3(String methodName, List<Object> objects, String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Object result = invokeParserMethod(methodName, objects, source, listener);
-    listener.assertErrorsWithCodes(errorCodes);
-    return result;
-  }
-
-  /**
-   * Invoke a parse method in [Parser]. The method is assumed to have no arguments.
-   *
-   * The given source is scanned and the parser is initialized to start with the first token in the
-   * source before the parse method is invoked.
-   *
-   * @param methodName the name of the parse method that should be invoked to parse the source
-   * @param source the source to be parsed by the parse method
-   * @param errorCodes the error codes of the errors that should be generated
-   * @return the result of invoking the method
-   * @throws Exception if the method could not be invoked or throws an exception
-   * @throws AssertionFailedError if the result is `null` or the errors produced while
-   *           scanning and parsing the source do not match the expected errors
-   */
-  static Object parse4(String methodName, String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST])
-      => parse3(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
-
-  /**
-   * Parse the given source as a compilation unit.
-   *
-   * @param source the source to be parsed
-   * @param errorCodes the error codes of the errors that are expected to be found
-   * @return the compilation unit that was parsed
-   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
-   *           not match those that are expected, or if the result would have been `null`
-   */
-  static CompilationUnit parseCompilationUnit(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
-    listener.setLineInfo(new TestSource(), scanner.lineStarts);
-    Token token = scanner.tokenize();
-    Parser parser = createParser(listener);
-    CompilationUnit unit = parser.parseCompilationUnit(token);
-    expect(unit, isNotNull);
-    listener.assertErrorsWithCodes(errorCodes);
-    return unit;
-  }
-
-  /**
-   * Parse the given source as an expression.
-   *
-   * @param source the source to be parsed
-   * @param errorCodes the error codes of the errors that are expected to be found
-   * @return the expression that was parsed
-   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
-   *           not match those that are expected, or if the result would have been `null`
-   */
-  static Expression parseExpression(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
-    listener.setLineInfo(new TestSource(), scanner.lineStarts);
-    Token token = scanner.tokenize();
-    Parser parser = createParser(listener);
-    Expression expression = parser.parseExpression(token);
-    expect(expression, isNotNull);
-    listener.assertErrorsWithCodes(errorCodes);
-    return expression;
-  }
-
-  /**
-   * Parse the given source as a statement.
-   *
-   * @param source the source to be parsed
-   * @param errorCodes the error codes of the errors that are expected to be found
-   * @return the statement that was parsed
-   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
-   *           not match those that are expected, or if the result would have been `null`
-   */
-  static Statement parseStatement(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
-    listener.setLineInfo(new TestSource(), scanner.lineStarts);
-    Token token = scanner.tokenize();
-    Parser parser = createParser(listener);
-    Statement statement = parser.parseStatement(token);
-    expect(statement, isNotNull);
-    listener.assertErrorsWithCodes(errorCodes);
-    return statement;
-  }
-
-  /**
-   * Parse the given source as a sequence of statements.
-   *
-   * @param source the source to be parsed
-   * @param expectedCount the number of statements that are expected
-   * @param errorCodes the error codes of the errors that are expected to be found
-   * @return the statements that were parsed
-   * @throws Exception if the source could not be parsed, if the number of statements does not match
-   *           the expected count, if the compilation errors in the source do not match those that
-   *           are expected, or if the result would have been `null`
-   */
-  static List<Statement> parseStatements(String source, int expectedCount, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
-    listener.setLineInfo(new TestSource(), scanner.lineStarts);
-    Token token = scanner.tokenize();
-    Parser parser = createParser(listener);
-    List<Statement> statements = parser.parseStatements(token);
-    expect(statements, hasLength(expectedCount));
-    listener.assertErrorsWithCodes(errorCodes);
-    return statements;
-  }
-
-  /**
    * Invoke a method in [Parser]. The method is assumed to have the given number and type of
    * parameters and will be invoked with the given arguments.
    *
@@ -2044,11 +2984,13 @@
    * @throws AssertionFailedError if the result is `null` or the errors produced while
    *           scanning and parsing the source do not match the expected errors
    */
-  static Object invokeParserMethod(String methodName, List<Object> objects, String source, GatheringErrorListener listener) {
+  static Object invokeParserMethod(String methodName, List<Object> objects,
+      String source, GatheringErrorListener listener) {
     //
     // Scan the source.
     //
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
     Token tokenStream = scanner.tokenize();
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
     //
@@ -2058,7 +3000,8 @@
     parser.parseFunctionBodies = parseFunctionBodies;
     parser.parseDeferredLibraries = true;
     parser.parseAsync = true;
-    Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStream);
+    Object result =
+        invokeParserMethodImpl(parser, methodName, objects, tokenStream);
     //
     // Partially test the results.
     //
@@ -2082,30 +3025,185 @@
    * @throws AssertionFailedError if the result is `null` or the errors produced while
    *           scanning and parsing the source do not match the expected errors
    */
-  static Object invokeParserMethod2(String methodName, String source, GatheringErrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, source, listener);
+  static Object invokeParserMethod2(String methodName, String source,
+      GatheringErrorListener listener) =>
+      invokeParserMethod(methodName, _EMPTY_ARGUMENTS, source, listener);
 
   /**
-   * Return a CommentAndMetadata object with the given values that can be used for testing.
+   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+   * type of parameters and will be invoked with the given arguments.
    *
-   * @param comment the comment to be wrapped in the object
-   * @param annotations the annotations to be wrapped in the object
-   * @return a CommentAndMetadata object that can be used for testing
+   * The given source is scanned and the parser is initialized to start with the first token in the
+   * source before the parse method is invoked.
+   *
+   * @param methodName the name of the parse method that should be invoked to parse the source
+   * @param objects the values of the arguments to the method
+   * @param source the source to be parsed by the parse method
+   * @return the result of invoking the method
+   * @throws Exception if the method could not be invoked or throws an exception
+   * @throws AssertionFailedError if the result is `null` or if any errors are produced
    */
-  CommentAndMetadata commentAndMetadata(Comment comment, [List<Annotation> annotations]) {
-    return new CommentAndMetadata(comment, annotations);
+  static Object parse(String methodName, List<Object> objects, String source) =>
+      parse2(methodName, objects, source);
+
+  /**
+   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+   * type of parameters and will be invoked with the given arguments.
+   *
+   * The given source is scanned and the parser is initialized to start with the first token in the
+   * source before the parse method is invoked.
+   *
+   * @param methodName the name of the parse method that should be invoked to parse the source
+   * @param objects the values of the arguments to the method
+   * @param source the source to be parsed by the parse method
+   * @param errors the errors that should be generated
+   * @return the result of invoking the method
+   * @throws Exception if the method could not be invoked or throws an exception
+   * @throws AssertionFailedError if the result is `null` or the errors produced while
+   *           scanning and parsing the source do not match the expected errors
+   */
+  static Object parse2(String methodName, List<Object> objects, String source,
+      [List<AnalysisError> errors = AnalysisError.NO_ERRORS]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Object result = invokeParserMethod(methodName, objects, source, listener);
+    listener.assertErrors(errors);
+    return result;
   }
 
   /**
-   * Return an empty CommentAndMetadata object that can be used for testing.
+   * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+   * type of parameters and will be invoked with the given arguments.
    *
-   * @return an empty CommentAndMetadata object that can be used for testing
+   * The given source is scanned and the parser is initialized to start with the first token in the
+   * source before the parse method is invoked.
+   *
+   * @param methodName the name of the parse method that should be invoked to parse the source
+   * @param objects the values of the arguments to the method
+   * @param source the source to be parsed by the parse method
+   * @param errorCodes the error codes of the errors that should be generated
+   * @return the result of invoking the method
+   * @throws Exception if the method could not be invoked or throws an exception
+   * @throws AssertionFailedError if the result is `null` or the errors produced while
+   *           scanning and parsing the source do not match the expected errors
    */
-  CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, null);
+  static Object parse3(String methodName, List<Object> objects, String source,
+      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Object result = invokeParserMethod(methodName, objects, source, listener);
+    listener.assertErrorsWithCodes(errorCodes);
+    return result;
+  }
 
-  @override
-  void setUp() {
-    super.setUp();
-    parseFunctionBodies = true;
+  /**
+   * Invoke a parse method in [Parser]. The method is assumed to have no arguments.
+   *
+   * The given source is scanned and the parser is initialized to start with the first token in the
+   * source before the parse method is invoked.
+   *
+   * @param methodName the name of the parse method that should be invoked to parse the source
+   * @param source the source to be parsed by the parse method
+   * @param errorCodes the error codes of the errors that should be generated
+   * @return the result of invoking the method
+   * @throws Exception if the method could not be invoked or throws an exception
+   * @throws AssertionFailedError if the result is `null` or the errors produced while
+   *           scanning and parsing the source do not match the expected errors
+   */
+  static Object parse4(String methodName, String source,
+      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) =>
+      parse3(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
+
+  /**
+   * Parse the given source as a compilation unit.
+   *
+   * @param source the source to be parsed
+   * @param errorCodes the error codes of the errors that are expected to be found
+   * @return the compilation unit that was parsed
+   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
+   *           not match those that are expected, or if the result would have been `null`
+   */
+  static CompilationUnit parseCompilationUnit(String source,
+      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
+    listener.setLineInfo(new TestSource(), scanner.lineStarts);
+    Token token = scanner.tokenize();
+    Parser parser = createParser(listener);
+    CompilationUnit unit = parser.parseCompilationUnit(token);
+    expect(unit, isNotNull);
+    listener.assertErrorsWithCodes(errorCodes);
+    return unit;
+  }
+
+  /**
+   * Parse the given source as an expression.
+   *
+   * @param source the source to be parsed
+   * @param errorCodes the error codes of the errors that are expected to be found
+   * @return the expression that was parsed
+   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
+   *           not match those that are expected, or if the result would have been `null`
+   */
+  static Expression parseExpression(String source, [List<ErrorCode> errorCodes =
+      ErrorCode.EMPTY_LIST]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
+    listener.setLineInfo(new TestSource(), scanner.lineStarts);
+    Token token = scanner.tokenize();
+    Parser parser = createParser(listener);
+    Expression expression = parser.parseExpression(token);
+    expect(expression, isNotNull);
+    listener.assertErrorsWithCodes(errorCodes);
+    return expression;
+  }
+
+  /**
+   * Parse the given source as a statement.
+   *
+   * @param source the source to be parsed
+   * @param errorCodes the error codes of the errors that are expected to be found
+   * @return the statement that was parsed
+   * @throws Exception if the source could not be parsed, if the compilation errors in the source do
+   *           not match those that are expected, or if the result would have been `null`
+   */
+  static Statement parseStatement(String source, [List<ErrorCode> errorCodes =
+      ErrorCode.EMPTY_LIST]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
+    listener.setLineInfo(new TestSource(), scanner.lineStarts);
+    Token token = scanner.tokenize();
+    Parser parser = createParser(listener);
+    Statement statement = parser.parseStatement(token);
+    expect(statement, isNotNull);
+    listener.assertErrorsWithCodes(errorCodes);
+    return statement;
+  }
+
+  /**
+   * Parse the given source as a sequence of statements.
+   *
+   * @param source the source to be parsed
+   * @param expectedCount the number of statements that are expected
+   * @param errorCodes the error codes of the errors that are expected to be found
+   * @return the statements that were parsed
+   * @throws Exception if the source could not be parsed, if the number of statements does not match
+   *           the expected count, if the compilation errors in the source do not match those that
+   *           are expected, or if the result would have been `null`
+   */
+  static List<Statement> parseStatements(String source, int expectedCount,
+      [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
+    listener.setLineInfo(new TestSource(), scanner.lineStarts);
+    Token token = scanner.tokenize();
+    Parser parser = createParser(listener);
+    List<Statement> statements = parser.parseStatements(token);
+    expect(statements, hasLength(expectedCount));
+    listener.assertErrorsWithCodes(errorCodes);
+    return statements;
   }
 }
 
@@ -2127,240 +3225,393 @@
   }
 
   void test_additiveExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("+ y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_additiveExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("+", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "+",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_additiveExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x +", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x +", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_additiveExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super +", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super +",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_additiveExpression_precedence_multiplicative_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("* +", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "* +",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("+ *", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "+ *",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_additiveExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super + +", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super + +",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_assignmentExpression_missing_compound1() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
+    AssignmentExpression expression = ParserTestCase.parseExpression(
+        "= y = 0",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     Expression syntheticExpression = expression.leftHandSide;
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_assignmentExpression_missing_compound2() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
-    Expression syntheticExpression = (expression.rightHandSide as AssignmentExpression).leftHandSide;
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    AssignmentExpression expression = ParserTestCase.parseExpression(
+        "x = = 0",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    Expression syntheticExpression =
+        (expression.rightHandSide as AssignmentExpression).leftHandSide;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_assignmentExpression_missing_compound3() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x = y =", [ParserErrorCode.MISSING_IDENTIFIER]);
-    Expression syntheticExpression = (expression.rightHandSide as AssignmentExpression).rightHandSide;
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    AssignmentExpression expression = ParserTestCase.parseExpression(
+        "x = y =",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    Expression syntheticExpression =
+        (expression.rightHandSide as AssignmentExpression).rightHandSide;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_assignmentExpression_missing_LHS() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("= 0", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftHandSide);
+    AssignmentExpression expression =
+        ParserTestCase.parseExpression("= 0", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftHandSide);
     expect(expression.leftHandSide.isSynthetic, isTrue);
   }
 
   void test_assignmentExpression_missing_RHS() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x =", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftHandSide);
+    AssignmentExpression expression =
+        ParserTestCase.parseExpression("x =", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftHandSide);
     expect(expression.rightHandSide.isSynthetic, isTrue);
   }
 
   void test_bitwiseAndExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("& y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("& y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseAndExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "&",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseAndExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x &", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x &", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseAndExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super &", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super &",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseAndExpression_precedence_equality_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("== &&", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "== &&",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseAndExpression_precedence_equality_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&& ==", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "&& ==",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseAndExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super &  &", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super &  &",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("| y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("| y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseOrExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("|", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "|",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseOrExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x |", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x |", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseOrExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super |", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super |",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseOrExpression_precedence_xor_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("^ |", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "^ |",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_precedence_xor_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("| ^", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "| ^",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseOrExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super |  |", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super |  |",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("^ y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("^ y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseXorExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("^", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "^",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseXorExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ^", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x ^", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseXorExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ^", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super ^",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_bitwiseXorExpression_precedence_and_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("& ^", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "& ^",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_precedence_and_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("^ &", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "^ &",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_bitwiseXorExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ^  ^", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super ^  ^",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_classTypeAlias_withBody() {
@@ -2370,116 +3621,185 @@
   }
 
   void test_conditionalExpression_missingElse() {
-    ConditionalExpression expression = ParserTestCase.parse4("parseConditionalExpression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.elseExpression);
+    ConditionalExpression expression = ParserTestCase.parse4(
+        "parseConditionalExpression",
+        "x ? y :",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.elseExpression);
     expect(expression.elseExpression.isSynthetic, isTrue);
   }
 
   void test_conditionalExpression_missingThen() {
-    ConditionalExpression expression = ParserTestCase.parse4("parseConditionalExpression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.thenExpression);
+    ConditionalExpression expression = ParserTestCase.parse4(
+        "parseConditionalExpression",
+        "x ? : z",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.thenExpression);
     expect(expression.thenExpression.isSynthetic, isTrue);
   }
 
   void test_equalityExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("== y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("== y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_equalityExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("==", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "==",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_equalityExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ==", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x ==", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_equalityExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ==", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super ==",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_equalityExpression_precedence_relational_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("is ==", [
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "is ==",
+        [
+            ParserErrorCode.EXPECTED_TYPE_NAME,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IsExpression,
+        IsExpression,
+        expression.leftOperand);
   }
 
   void test_equalityExpression_precedence_relational_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("== is", [
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "== is",
+        [
+            ParserErrorCode.EXPECTED_TYPE_NAME,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IsExpression,
+        IsExpression,
+        expression.rightOperand);
   }
 
   void test_equalityExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ==  ==", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super ==  ==",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_expressionList_multiple_end() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", ", 2, 3, 4", [ParserErrorCode.MISSING_IDENTIFIER]);
+    List<Expression> result = ParserTestCase.parse4(
+        "parseExpressionList",
+        ", 2, 3, 4",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     expect(result, hasLength(4));
     Expression syntheticExpression = result[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_expressionList_multiple_middle() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2, , 4", [ParserErrorCode.MISSING_IDENTIFIER]);
+    List<Expression> result = ParserTestCase.parse4(
+        "parseExpressionList",
+        "1, 2, , 4",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     expect(result, hasLength(4));
     Expression syntheticExpression = result[2];
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_expressionList_multiple_start() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2, 3,", [ParserErrorCode.MISSING_IDENTIFIER]);
+    List<Expression> result = ParserTestCase.parse4(
+        "parseExpressionList",
+        "1, 2, 3,",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
     expect(result, hasLength(4));
     Expression syntheticExpression = result[3];
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, syntheticExpression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        syntheticExpression);
     expect(syntheticExpression.isSynthetic, isTrue);
   }
 
   void test_functionExpression_in_ConstructorFieldInitializer() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("class A { A() : a = (){}; var v; }", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.UNEXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "class A { A() : a = (){}; var v; }",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.UNEXPECTED_TOKEN]);
     // Make sure we recovered and parsed "var v" correctly
     ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
     NodeList<ClassMember> members = declaration.members;
     ClassMember fieldDecl = members[1];
-    EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDeclaration, fieldDecl);
-    NodeList<VariableDeclaration> vars = (fieldDecl as FieldDeclaration).fields.variables;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FieldDeclaration,
+        FieldDeclaration,
+        fieldDecl);
+    NodeList<VariableDeclaration> vars =
+        (fieldDecl as FieldDeclaration).fields.variables;
     expect(vars, hasLength(1));
     expect(vars[0].name.name, "v");
   }
 
   void test_functionExpression_named() {
-    ParserTestCase.parseExpression("m(f() => 0);", [
-        ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parseExpression(
+        "m(f() => 0);",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_incomplete_conditionalExpression() {
-    ParserTestCase.parseExpression("x ? 0", [
-        ParserErrorCode.EXPECTED_TOKEN,
-        ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parseExpression(
+        "x ? 0",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_incomplete_constructorInitializers_empty() {
@@ -2497,11 +3817,13 @@
         "C() : x(3) {}",
         [ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER]);
     expect(member, new isInstanceOf<ConstructorDeclaration>());
-    NodeList<ConstructorInitializer> initializers = (member as ConstructorDeclaration).initializers;
+    NodeList<ConstructorInitializer> initializers =
+        (member as ConstructorDeclaration).initializers;
     expect(initializers, hasLength(1));
     ConstructorInitializer initializer = initializers[0];
     expect(initializer, new isInstanceOf<ConstructorFieldInitializer>());
-    Expression expression = (initializer as ConstructorFieldInitializer).expression;
+    Expression expression =
+        (initializer as ConstructorFieldInitializer).expression;
     expect(expression, isNotNull);
     expect(expression, new isInstanceOf<ParenthesizedExpression>());
   }
@@ -2515,59 +3837,78 @@
   }
 
   void test_incomplete_topLevelFunction() {
-    ParserTestCase.parseCompilationUnit("foo();", [
-        ParserErrorCode.MISSING_FUNCTION_BODY]);
+    ParserTestCase.parseCompilationUnit(
+        "foo();",
+        [ParserErrorCode.MISSING_FUNCTION_BODY]);
   }
 
   void test_incomplete_topLevelVariable() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [ParserErrorCode.EXPECTED_EXECUTABLE]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "String",
+        [ParserErrorCode.EXPECTED_EXECUTABLE]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member);
-    NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclaration).variables.variables;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TopLevelVariableDeclaration,
+        TopLevelVariableDeclaration,
+        member);
+    NodeList<VariableDeclaration> variables =
+        (member as TopLevelVariableDeclaration).variables.variables;
     expect(variables, hasLength(1));
     SimpleIdentifier name = variables[0].name;
     expect(name.isSynthetic, isTrue);
   }
 
   void test_incomplete_topLevelVariable_const() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("const ", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "const ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member);
-    NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclaration).variables.variables;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TopLevelVariableDeclaration,
+        TopLevelVariableDeclaration,
+        member);
+    NodeList<VariableDeclaration> variables =
+        (member as TopLevelVariableDeclaration).variables.variables;
     expect(variables, hasLength(1));
     SimpleIdentifier name = variables[0].name;
     expect(name.isSynthetic, isTrue);
   }
 
   void test_incomplete_topLevelVariable_final() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("final ", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "final ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member);
-    NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclaration).variables.variables;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TopLevelVariableDeclaration,
+        TopLevelVariableDeclaration,
+        member);
+    NodeList<VariableDeclaration> variables =
+        (member as TopLevelVariableDeclaration).variables.variables;
     expect(variables, hasLength(1));
     SimpleIdentifier name = variables[0].name;
     expect(name.isSynthetic, isTrue);
   }
 
   void test_incomplete_topLevelVariable_var() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("var ", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "var ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member);
-    NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclaration).variables.variables;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TopLevelVariableDeclaration,
+        TopLevelVariableDeclaration,
+        member);
+    NodeList<VariableDeclaration> variables =
+        (member as TopLevelVariableDeclaration).variables.variables;
     expect(variables, hasLength(1));
     SimpleIdentifier name = variables[0].name;
     expect(name.isSynthetic, isTrue);
@@ -2577,18 +3918,23 @@
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class C {
   const
-}''', [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassDeclaration, ClassDeclaration, unitMember);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassDeclaration,
+        ClassDeclaration,
+        unitMember);
     NodeList<ClassMember> members = (unitMember as ClassDeclaration).members;
     expect(members, hasLength(1));
     ClassMember classMember = members[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDeclaration, classMember);
-    VariableDeclarationList fieldList = (classMember as FieldDeclaration).fields;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FieldDeclaration,
+        FieldDeclaration,
+        classMember);
+    VariableDeclarationList fieldList =
+        (classMember as FieldDeclaration).fields;
     expect((fieldList.keyword as KeywordToken).keyword, Keyword.CONST);
     NodeList<VariableDeclaration> fields = fieldList.variables;
     expect(fields, hasLength(1));
@@ -2600,18 +3946,23 @@
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class C {
   final
-}''', [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassDeclaration, ClassDeclaration, unitMember);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassDeclaration,
+        ClassDeclaration,
+        unitMember);
     NodeList<ClassMember> members = (unitMember as ClassDeclaration).members;
     expect(members, hasLength(1));
     ClassMember classMember = members[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDeclaration, classMember);
-    VariableDeclarationList fieldList = (classMember as FieldDeclaration).fields;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FieldDeclaration,
+        FieldDeclaration,
+        classMember);
+    VariableDeclarationList fieldList =
+        (classMember as FieldDeclaration).fields;
     expect((fieldList.keyword as KeywordToken).keyword, Keyword.FINAL);
     NodeList<VariableDeclaration> fields = fieldList.variables;
     expect(fields, hasLength(1));
@@ -2623,18 +3974,23 @@
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class C {
   var
-}''', [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EXPECTED_TOKEN]);
+}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassDeclaration, ClassDeclaration, unitMember);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ClassDeclaration,
+        ClassDeclaration,
+        unitMember);
     NodeList<ClassMember> members = (unitMember as ClassDeclaration).members;
     expect(members, hasLength(1));
     ClassMember classMember = members[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDeclaration, classMember);
-    VariableDeclarationList fieldList = (classMember as FieldDeclaration).fields;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FieldDeclaration,
+        FieldDeclaration,
+        classMember);
+    VariableDeclarationList fieldList =
+        (classMember as FieldDeclaration).fields;
     expect((fieldList.keyword as KeywordToken).keyword, Keyword.VAR);
     NodeList<VariableDeclaration> fields = fieldList.variables;
     expect(fields, hasLength(1));
@@ -2643,15 +3999,18 @@
   }
 
   void test_invalidFunctionBodyModifier() {
-    ParserTestCase.parseCompilationUnit("f() sync {}", [
-        ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
+    ParserTestCase.parseCompilationUnit(
+        "f() sync {}",
+        [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
   }
 
   void test_isExpression_noType() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}", [
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.MISSING_STATEMENT]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}",
+        [
+            ParserErrorCode.EXPECTED_TYPE_NAME,
+            ParserErrorCode.EXPECTED_TYPE_NAME,
+            ParserErrorCode.MISSING_STATEMENT]);
     ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
     MethodDeclaration method = declaration.members[0] as MethodDeclaration;
     BlockFunctionBody body = method.body as BlockFunctionBody;
@@ -2663,95 +4022,147 @@
     TypeName type = expression.type;
     expect(type, isNotNull);
     expect(type.name.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is EmptyStatement, EmptyStatement, ifStatement.thenStatement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is EmptyStatement,
+        EmptyStatement,
+        ifStatement.thenStatement);
   }
 
   void test_keywordInPlaceOfIdentifier() {
     // TODO(brianwilkerson) We could do better with this.
-    ParserTestCase.parseCompilationUnit("do() {}", [
-        ParserErrorCode.EXPECTED_EXECUTABLE,
-        ParserErrorCode.UNEXPECTED_TOKEN]);
+    ParserTestCase.parseCompilationUnit(
+        "do() {}",
+        [ParserErrorCode.EXPECTED_EXECUTABLE, ParserErrorCode.UNEXPECTED_TOKEN]);
   }
 
   void test_logicalAndExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&& y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("&& y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_logicalAndExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&&", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "&&",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_logicalAndExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x &&", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x &&", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("| &&", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "| &&",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&& |", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "&& |",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_logicalOrExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("|| y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("|| y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_logicalOrExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("||", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "||",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_logicalOrExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ||", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x ||", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("&& ||", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "&& ||",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "|| &&",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_missing_commaInArgumentList() {
-    ParserTestCase.parseExpression("f(x: 1 y: 2)", [
-        ParserErrorCode.EXPECTED_TOKEN]);
+    ParserTestCase.parseExpression(
+        "f(x: 1 y: 2)",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_missingGet() {
@@ -2761,17 +4172,28 @@
   void foo() {}
 }''', [ParserErrorCode.MISSING_GET]);
     expect(unit, isNotNull);
-    ClassDeclaration classDeclaration = unit.declarations[0] as ClassDeclaration;
+    ClassDeclaration classDeclaration =
+        unit.declarations[0] as ClassDeclaration;
     NodeList<ClassMember> members = classDeclaration.members;
     expect(members, hasLength(2));
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodDeclaration, MethodDeclaration, members[0]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodDeclaration,
+        MethodDeclaration,
+        members[0]);
     ClassMember member = members[1];
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodDeclaration, MethodDeclaration, member);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodDeclaration,
+        MethodDeclaration,
+        member);
     expect((member as MethodDeclaration).name.name, "foo");
   }
 
   void test_missingIdentifier_afterAnnotation() {
-    MethodDeclaration method = ParserTestCase.parse3("parseClassMember", <Object> ["C"], "@override }", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
+    MethodDeclaration method = ParserTestCase.parse3(
+        "parseClassMember",
+        <Object>["C"],
+        "@override }",
+        [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
     expect(method.documentationComment, isNull);
     NodeList<Annotation> metadata = method.metadata;
     expect(metadata, hasLength(1));
@@ -2779,194 +4201,302 @@
   }
 
   void test_multiplicativeExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("* y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_multiplicativeExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("*", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "*",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_multiplicativeExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x *", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x *", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_multiplicativeExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super *", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super *",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_multiplicativeExpression_precedence_unary_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("-x *", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("-x *", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixExpression,
+        PrefixExpression,
+        expression.leftOperand);
   }
 
   void test_multiplicativeExpression_precedence_unary_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("* -y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("* -y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixExpression,
+        PrefixExpression,
+        expression.rightOperand);
   }
 
   void test_multiplicativeExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ==  ==", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super ==  ==",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_prefixExpression_missing_operand_minus() {
-    PrefixExpression expression = ParserTestCase.parseExpression("-", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.operand);
+    PrefixExpression expression =
+        ParserTestCase.parseExpression("-", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.operand);
     expect(expression.operand.isSynthetic, isTrue);
     expect(expression.operator.type, TokenType.MINUS);
   }
 
   void test_primaryExpression_argumentDefinitionTest() {
-    Expression expression = ParserTestCase.parse4("parsePrimaryExpression", "?a", [ParserErrorCode.UNEXPECTED_TOKEN]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression);
+    Expression expression = ParserTestCase.parse4(
+        "parsePrimaryExpression",
+        "?a",
+        [ParserErrorCode.UNEXPECTED_TOKEN]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression);
   }
 
   void test_relationalExpression_missing_LHS() {
-    IsExpression expression = ParserTestCase.parseExpression("is y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.expression);
+    IsExpression expression =
+        ParserTestCase.parseExpression("is y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.expression);
     expect(expression.expression.isSynthetic, isTrue);
   }
 
   void test_relationalExpression_missing_LHS_RHS() {
-    IsExpression expression = ParserTestCase.parseExpression("is", [
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.expression);
+    IsExpression expression = ParserTestCase.parseExpression(
+        "is",
+        [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.expression);
     expect(expression.expression.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is TypeName, TypeName, expression.type);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TypeName,
+        TypeName,
+        expression.type);
     expect(expression.type.isSynthetic, isTrue);
   }
 
   void test_relationalExpression_missing_RHS() {
-    IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]);
-    EngineTestCase.assertInstanceOf((obj) => obj is TypeName, TypeName, expression.type);
+    IsExpression expression =
+        ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TypeName,
+        TypeName,
+        expression.type);
     expect(expression.type.isSynthetic, isTrue);
   }
 
   void test_relationalExpression_precedence_shift_right() {
-    IsExpression expression = ParserTestCase.parseExpression("<< is", [
-        ParserErrorCode.EXPECTED_TYPE_NAME,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.expression);
+    IsExpression expression = ParserTestCase.parseExpression(
+        "<< is",
+        [
+            ParserErrorCode.EXPECTED_TYPE_NAME,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.expression);
   }
 
   void test_shiftExpression_missing_LHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("<< y", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("<< y", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
   }
 
   void test_shiftExpression_missing_LHS_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("<<", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "<<",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.leftOperand);
     expect(expression.leftOperand.isSynthetic, isTrue);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_shiftExpression_missing_RHS() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x <<", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression =
+        ParserTestCase.parseExpression("x <<", [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_shiftExpression_missing_RHS_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super <<", [ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super <<",
+        [ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        expression.rightOperand);
     expect(expression.rightOperand.isSynthetic, isTrue);
   }
 
   void test_shiftExpression_precedence_unary_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "+ <<",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_shiftExpression_precedence_unary_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("<< +", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "<< +",
+        [
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER,
+            ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.rightOperand);
   }
 
   void test_shiftExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super << <<", [
-        ParserErrorCode.MISSING_IDENTIFIER,
-        ParserErrorCode.MISSING_IDENTIFIER]);
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
+    BinaryExpression expression = ParserTestCase.parseExpression(
+        "super << <<",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression.leftOperand);
   }
 
   void test_typedef_eof() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [
-        ParserErrorCode.EXPECTED_TOKEN,
-        ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "typedef n",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionTypeAlias, FunctionTypeAlias, member);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionTypeAlias,
+        FunctionTypeAlias,
+        member);
   }
 
   void test_unaryPlus() {
-    ParserTestCase.parseExpression("+2", [
-        ParserErrorCode.MISSING_IDENTIFIER]);
+    ParserTestCase.parseExpression("+2", [ParserErrorCode.MISSING_IDENTIFIER]);
   }
 }
 
 class ResolutionCopierTest extends EngineTestCase {
   void test_visitAnnotation() {
     String annotationName = "proxy";
-    Annotation fromNode = AstFactory.annotation(AstFactory.identifier3(annotationName));
+    Annotation fromNode =
+        AstFactory.annotation(AstFactory.identifier3(annotationName));
     Element element = ElementFactory.topLevelVariableElement2(annotationName);
     fromNode.element = element;
-    Annotation toNode = AstFactory.annotation(AstFactory.identifier3(annotationName));
+    Annotation toNode =
+        AstFactory.annotation(AstFactory.identifier3(annotationName));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitAsExpression() {
-    AsExpression fromNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A"));
+    AsExpression fromNode = AstFactory.asExpression(
+        AstFactory.identifier3("x"),
+        AstFactory.typeName4("A"));
     DartType propagatedType = ElementFactory.classElement2("A").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("B").type;
     fromNode.staticType = staticType;
-    AsExpression toNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A"));
+    AsExpression toNode = AstFactory.asExpression(
+        AstFactory.identifier3("x"),
+        AstFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitAssignmentExpression() {
-    AssignmentExpression fromNode = AstFactory.assignmentExpression(AstFactory.identifier3("a"), TokenType.PLUS_EQ, AstFactory.identifier3("b"));
+    AssignmentExpression fromNode = AstFactory.assignmentExpression(
+        AstFactory.identifier3("a"),
+        TokenType.PLUS_EQ,
+        AstFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
-    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType);
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("+", propagatedType);
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    AssignmentExpression toNode = AstFactory.assignmentExpression(AstFactory.identifier3("a"), TokenType.PLUS_EQ, AstFactory.identifier3("b"));
+    AssignmentExpression toNode = AstFactory.assignmentExpression(
+        AstFactory.identifier3("a"),
+        TokenType.PLUS_EQ,
+        AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -2975,16 +4505,23 @@
   }
 
   void test_visitBinaryExpression() {
-    BinaryExpression fromNode = AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS, AstFactory.identifier3("b"));
+    BinaryExpression fromNode = AstFactory.binaryExpression(
+        AstFactory.identifier3("a"),
+        TokenType.PLUS,
+        AstFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
-    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType);
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("+", propagatedType);
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    BinaryExpression toNode = AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS, AstFactory.identifier3("b"));
+    BinaryExpression toNode = AstFactory.binaryExpression(
+        AstFactory.identifier3("a"),
+        TokenType.PLUS,
+        AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3005,12 +4542,16 @@
   }
 
   void test_visitCascadeExpression() {
-    CascadeExpression fromNode = AstFactory.cascadeExpression(AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
+    CascadeExpression fromNode = AstFactory.cascadeExpression(
+        AstFactory.identifier3("a"),
+        [AstFactory.identifier3("b")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    CascadeExpression toNode = AstFactory.cascadeExpression(AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
+    CascadeExpression toNode = AstFactory.cascadeExpression(
+        AstFactory.identifier3("a"),
+        [AstFactory.identifier3("b")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3018,7 +4559,8 @@
 
   void test_visitCompilationUnit() {
     CompilationUnit fromNode = AstFactory.compilationUnit();
-    CompilationUnitElement element = new CompilationUnitElementImpl("test.dart");
+    CompilationUnitElement element =
+        new CompilationUnitElementImpl("test.dart");
     fromNode.element = element;
     CompilationUnit toNode = AstFactory.compilationUnit();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3026,12 +4568,18 @@
   }
 
   void test_visitConditionalExpression() {
-    ConditionalExpression fromNode = AstFactory.conditionalExpression(AstFactory.identifier3("c"), AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    ConditionalExpression fromNode = AstFactory.conditionalExpression(
+        AstFactory.identifier3("c"),
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ConditionalExpression toNode = AstFactory.conditionalExpression(AstFactory.identifier3("c"), AstFactory.identifier3("a"), AstFactory.identifier3("b"));
+    ConditionalExpression toNode = AstFactory.conditionalExpression(
+        AstFactory.identifier3("c"),
+        AstFactory.identifier3("a"),
+        AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3040,19 +4588,32 @@
   void test_visitConstructorDeclaration() {
     String className = "A";
     String constructorName = "c";
-    ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList(), null);
-    ConstructorElement element = ElementFactory.constructorElement2(ElementFactory.classElement2(className), constructorName);
+    ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(
+        AstFactory.identifier3(className),
+        constructorName,
+        AstFactory.formalParameterList(),
+        null);
+    ConstructorElement element = ElementFactory.constructorElement2(
+        ElementFactory.classElement2(className),
+        constructorName);
     fromNode.element = element;
-    ConstructorDeclaration toNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList(), null);
+    ConstructorDeclaration toNode = AstFactory.constructorDeclaration(
+        AstFactory.identifier3(className),
+        constructorName,
+        AstFactory.formalParameterList(),
+        null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitConstructorName() {
-    ConstructorName fromNode = AstFactory.constructorName(AstFactory.typeName4("A"), "c");
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("A"), "c");
+    ConstructorName fromNode =
+        AstFactory.constructorName(AstFactory.typeName4("A"), "c");
+    ConstructorElement staticElement =
+        ElementFactory.constructorElement2(ElementFactory.classElement2("A"), "c");
     fromNode.staticElement = staticElement;
-    ConstructorName toNode = AstFactory.constructorName(AstFactory.typeName4("A"), "c");
+    ConstructorName toNode =
+        AstFactory.constructorName(AstFactory.typeName4("A"), "c");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
@@ -3079,14 +4640,19 @@
   }
 
   void test_visitFunctionExpression() {
-    FunctionExpression fromNode = AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
-    MethodElement element = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    FunctionExpression fromNode = AstFactory.functionExpression2(
+        AstFactory.formalParameterList(),
+        AstFactory.emptyFunctionBody());
+    MethodElement element =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.element = element;
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    FunctionExpression toNode = AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    FunctionExpression toNode = AstFactory.functionExpression2(
+        AstFactory.formalParameterList(),
+        AstFactory.emptyFunctionBody());
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3094,16 +4660,20 @@
   }
 
   void test_visitFunctionExpressionInvocation() {
-    FunctionExpressionInvocation fromNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    FunctionExpressionInvocation fromNode =
+        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    MethodElement staticElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    FunctionExpressionInvocation toNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
+    FunctionExpressionInvocation toNode =
+        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3121,10 +4691,14 @@
   }
 
   void test_visitIndexExpression() {
-    IndexExpression fromNode = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
-    AuxiliaryElements auxiliaryElements = new AuxiliaryElements(staticElement, propagatedElement);
+    IndexExpression fromNode =
+        AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    MethodElement staticElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    AuxiliaryElements auxiliaryElements =
+        new AuxiliaryElements(staticElement, propagatedElement);
     fromNode.auxiliaryElements = auxiliaryElements;
     fromNode.propagatedElement = propagatedElement;
     DartType propagatedType = ElementFactory.classElement2("C").type;
@@ -3132,7 +4706,8 @@
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IndexExpression toNode = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
+    IndexExpression toNode =
+        AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.auxiliaryElements, same(auxiliaryElements));
     expect(toNode.propagatedElement, same(propagatedElement));
@@ -3142,14 +4717,17 @@
   }
 
   void test_visitInstanceCreationExpression() {
-    InstanceCreationExpression fromNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
+    InstanceCreationExpression fromNode =
+        AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
+    ConstructorElement staticElement =
+        ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    InstanceCreationExpression toNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
+    InstanceCreationExpression toNode =
+        AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticElement, same(staticElement));
@@ -3169,24 +4747,32 @@
   }
 
   void test_visitIsExpression() {
-    IsExpression fromNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
+    IsExpression fromNode = AstFactory.isExpression(
+        AstFactory.identifier3("x"),
+        false,
+        AstFactory.typeName4("A"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IsExpression toNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
+    IsExpression toNode = AstFactory.isExpression(
+        AstFactory.identifier3("x"),
+        false,
+        AstFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitLibraryIdentifier() {
-    LibraryIdentifier fromNode = AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
+    LibraryIdentifier fromNode =
+        AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    LibraryIdentifier toNode = AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
+    LibraryIdentifier toNode =
+        AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3229,12 +4815,14 @@
   }
 
   void test_visitNamedExpression() {
-    NamedExpression fromNode = AstFactory.namedExpression2("n", AstFactory.integer(0));
+    NamedExpression fromNode =
+        AstFactory.namedExpression2("n", AstFactory.integer(0));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    NamedExpression toNode = AstFactory.namedExpression2("n", AstFactory.integer(0));
+    NamedExpression toNode =
+        AstFactory.namedExpression2("n", AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3253,12 +4841,14 @@
   }
 
   void test_visitParenthesizedExpression() {
-    ParenthesizedExpression fromNode = AstFactory.parenthesizedExpression(AstFactory.integer(0));
+    ParenthesizedExpression fromNode =
+        AstFactory.parenthesizedExpression(AstFactory.integer(0));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ParenthesizedExpression toNode = AstFactory.parenthesizedExpression(AstFactory.integer(0));
+    ParenthesizedExpression toNode =
+        AstFactory.parenthesizedExpression(AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3266,7 +4856,8 @@
 
   void test_visitPartDirective() {
     PartDirective fromNode = AstFactory.partDirective2("part.dart");
-    LibraryElement element = new LibraryElementImpl.forNode(null, AstFactory.libraryIdentifier2(["lib"]));
+    LibraryElement element =
+        new LibraryElementImpl.forNode(null, AstFactory.libraryIdentifier2(["lib"]));
     fromNode.element = element;
     PartDirective toNode = AstFactory.partDirective2("part.dart");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3274,26 +4865,35 @@
   }
 
   void test_visitPartOfDirective() {
-    PartOfDirective fromNode = AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
-    LibraryElement element = new LibraryElementImpl.forNode(null, AstFactory.libraryIdentifier2(["lib"]));
+    PartOfDirective fromNode =
+        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
+    LibraryElement element =
+        new LibraryElementImpl.forNode(null, AstFactory.libraryIdentifier2(["lib"]));
     fromNode.element = element;
-    PartOfDirective toNode = AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
+    PartOfDirective toNode =
+        AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitPostfixExpression() {
     String variableName = "x";
-    PostfixExpression fromNode = AstFactory.postfixExpression(AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
-    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
+    PostfixExpression fromNode = AstFactory.postfixExpression(
+        AstFactory.identifier3(variableName),
+        TokenType.PLUS_PLUS);
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
+    MethodElement staticElement =
+        ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    PostfixExpression toNode = AstFactory.postfixExpression(AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
+    PostfixExpression toNode = AstFactory.postfixExpression(
+        AstFactory.identifier3(variableName),
+        TokenType.PLUS_PLUS);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3314,16 +4914,20 @@
   }
 
   void test_visitPrefixExpression() {
-    PrefixExpression fromNode = AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
-    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
+    PrefixExpression fromNode =
+        AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
-    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
+    MethodElement staticElement =
+        ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
-    PrefixExpression toNode = AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
+    PrefixExpression toNode =
+        AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3332,22 +4936,27 @@
   }
 
   void test_visitPropertyAccess() {
-    PropertyAccess fromNode = AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
+    PropertyAccess fromNode =
+        AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    PropertyAccess toNode = AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
+    PropertyAccess toNode =
+        AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitRedirectingConstructorInvocation() {
-    RedirectingConstructorInvocation fromNode = AstFactory.redirectingConstructorInvocation();
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
+    RedirectingConstructorInvocation fromNode =
+        AstFactory.redirectingConstructorInvocation();
+    ConstructorElement staticElement =
+        ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
-    RedirectingConstructorInvocation toNode = AstFactory.redirectingConstructorInvocation();
+    RedirectingConstructorInvocation toNode =
+        AstFactory.redirectingConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
@@ -3366,9 +4975,12 @@
 
   void test_visitSimpleIdentifier() {
     SimpleIdentifier fromNode = AstFactory.identifier3("x");
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
-    AuxiliaryElements auxiliaryElements = new AuxiliaryElements(staticElement, propagatedElement);
+    MethodElement propagatedElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    MethodElement staticElement =
+        ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    AuxiliaryElements auxiliaryElements =
+        new AuxiliaryElements(staticElement, propagatedElement);
     fromNode.auxiliaryElements = auxiliaryElements;
     fromNode.propagatedElement = propagatedElement;
     DartType propagatedType = ElementFactory.classElement2("C").type;
@@ -3398,20 +5010,24 @@
   }
 
   void test_visitStringInterpolation() {
-    StringInterpolation fromNode = AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
+    StringInterpolation fromNode =
+        AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
     DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    StringInterpolation toNode = AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
+    StringInterpolation toNode =
+        AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitSuperConstructorInvocation() {
-    SuperConstructorInvocation fromNode = AstFactory.superConstructorInvocation();
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
+    SuperConstructorInvocation fromNode =
+        AstFactory.superConstructorInvocation();
+    ConstructorElement staticElement =
+        ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
     SuperConstructorInvocation toNode = AstFactory.superConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3485,10 +5101,14 @@
  */
 class SimpleParserTest extends ParserTestCase {
   void fail_parseCommentReference_this() {
-    // This fails because we are returning null from the method and asserting that the return value
-    // is not null.
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["this", 5], "");
-    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, reference.identifier);
+    // This fails because we are returning null from the method and asserting
+    // that the return value is not null.
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["this", 5], "");
+    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
     expect(identifier.offset, 5);
@@ -3575,7 +5195,10 @@
   }
 
   void test_constFactory() {
-    ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C() = A;");
+    ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "const factory C() = A;");
   }
 
   void test_createSyntheticIdentifier() {
@@ -3592,27 +5215,34 @@
     ParserTestCase.parseCompilationUnit("var x = () {};");
   }
 
-  void test_function_literal_allowed_in_ArgumentList_in_ConstructorFieldInitializer() {
+  void
+      test_function_literal_allowed_in_ArgumentList_in_ConstructorFieldInitializer() {
     ParserTestCase.parseCompilationUnit("class C { C() : a = f(() {}); }");
   }
 
-  void test_function_literal_allowed_in_IndexExpression_in_ConstructorFieldInitializer() {
+  void
+      test_function_literal_allowed_in_IndexExpression_in_ConstructorFieldInitializer() {
     ParserTestCase.parseCompilationUnit("class C { C() : a = x[() {}]; }");
   }
 
-  void test_function_literal_allowed_in_ListLiteral_in_ConstructorFieldInitializer() {
+  void
+      test_function_literal_allowed_in_ListLiteral_in_ConstructorFieldInitializer() {
     ParserTestCase.parseCompilationUnit("class C { C() : a = [() {}]; }");
   }
 
-  void test_function_literal_allowed_in_MapLiteral_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = {'key': () {}}; }");
+  void
+      test_function_literal_allowed_in_MapLiteral_in_ConstructorFieldInitializer() {
+    ParserTestCase.parseCompilationUnit(
+        "class C { C() : a = {'key': () {}}; }");
   }
 
-  void test_function_literal_allowed_in_ParenthesizedExpression_in_ConstructorFieldInitializer() {
+  void
+      test_function_literal_allowed_in_ParenthesizedExpression_in_ConstructorFieldInitializer() {
     ParserTestCase.parseCompilationUnit("class C { C() : a = (() {}); }");
   }
 
-  void test_function_literal_allowed_in_StringInterpolation_in_ConstructorFieldInitializer() {
+  void
+      test_function_literal_allowed_in_StringInterpolation_in_ConstructorFieldInitializer() {
     ParserTestCase.parseCompilationUnit("class C { C() : a = \"\${(){}}\"; }");
   }
 
@@ -3698,7 +5328,9 @@
   }
 
   void test_isInitializedVariableDeclaration_conditional() {
-    expect(_isInitializedVariableDeclaration("a == null ? init() : update();"), isFalse);
+    expect(
+        _isInitializedVariableDeclaration("a == null ? init() : update();"),
+        isFalse);
   }
 
   void test_isInitializedVariableDeclaration_const_noType_initialized() {
@@ -3778,7 +5410,8 @@
   }
 
   void test_parseAdditiveExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "x + y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseAdditiveExpression", "x + y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS);
@@ -3786,8 +5419,12 @@
   }
 
   void test_parseAdditiveExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "super + y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseAdditiveExpression", "super + y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS);
     expect(expression.rightOperand, isNotNull);
@@ -3821,7 +5458,8 @@
   }
 
   void test_parseAnnotation_n2_a() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)");
+    Annotation annotation =
+        ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNull);
@@ -3839,7 +5477,8 @@
   }
 
   void test_parseAnnotation_n3_a() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y)");
+    Annotation annotation =
+        ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y)");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNotNull);
@@ -3858,36 +5497,42 @@
 
   void test_parseArgument_unnamed() {
     String lexeme = "x";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseArgument", lexeme);
+    SimpleIdentifier identifier =
+        ParserTestCase.parse4("parseArgument", lexeme);
     expect(identifier.name, lexeme);
   }
 
   void test_parseArgumentList_empty() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "()");
+    ArgumentList argumentList =
+        ParserTestCase.parse4("parseArgumentList", "()");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(0));
   }
 
   void test_parseArgumentList_mixed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(w, x, y: y, z: z)");
+    ArgumentList argumentList =
+        ParserTestCase.parse4("parseArgumentList", "(w, x, y: y, z: z)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(4));
   }
 
   void test_parseArgumentList_noNamed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x, y, z)");
+    ArgumentList argumentList =
+        ParserTestCase.parse4("parseArgumentList", "(x, y, z)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(3));
   }
 
   void test_parseArgumentList_onlyNamed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x: x, y: y)");
+    ArgumentList argumentList =
+        ParserTestCase.parse4("parseArgumentList", "(x: x, y: y)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(2));
   }
 
   void test_parseAssertStatement() {
-    AssertStatement statement = ParserTestCase.parse4("parseAssertStatement", "assert (x);");
+    AssertStatement statement =
+        ParserTestCase.parse4("parseAssertStatement", "assert (x);");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -3896,8 +5541,10 @@
   }
 
   void test_parseAssignableExpression_expression_args_dot() {
-    PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "(x)(y).z");
-    FunctionExpressionInvocation invocation = propertyAccess.target as FunctionExpressionInvocation;
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "(x)(y).z");
+    FunctionExpressionInvocation invocation =
+        propertyAccess.target as FunctionExpressionInvocation;
     expect(invocation.function, isNotNull);
     ArgumentList argumentList = invocation.argumentList;
     expect(argumentList, isNotNull);
@@ -3907,14 +5554,16 @@
   }
 
   void test_parseAssignableExpression_expression_dot() {
-    PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "(x).y");
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "(x).y");
     expect(propertyAccess.target, isNotNull);
     expect(propertyAccess.operator, isNotNull);
     expect(propertyAccess.propertyName, isNotNull);
   }
 
   void test_parseAssignableExpression_expression_index() {
-    IndexExpression expression = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "(x)[y]");
+    IndexExpression expression =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "(x)[y]");
     expect(expression.target, isNotNull);
     expect(expression.leftBracket, isNotNull);
     expect(expression.index, isNotNull);
@@ -3922,12 +5571,14 @@
   }
 
   void test_parseAssignableExpression_identifier() {
-    SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "x");
+    SimpleIdentifier identifier =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "x");
     expect(identifier, isNotNull);
   }
 
   void test_parseAssignableExpression_identifier_args_dot() {
-    PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "x(y).z");
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "x(y).z");
     MethodInvocation invocation = propertyAccess.target as MethodInvocation;
     expect(invocation.methodName.name, "x");
     ArgumentList argumentList = invocation.argumentList;
@@ -3938,14 +5589,16 @@
   }
 
   void test_parseAssignableExpression_identifier_dot() {
-    PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "x.y");
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "x.y");
     expect(propertyAccess.target, isNotNull);
     expect(propertyAccess.operator, isNotNull);
     expect(propertyAccess.propertyName, isNotNull);
   }
 
   void test_parseAssignableExpression_identifier_index() {
-    IndexExpression expression = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "x[y]");
+    IndexExpression expression =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "x[y]");
     expect(expression.target, isNotNull);
     expect(expression.leftBracket, isNotNull);
     expect(expression.index, isNotNull);
@@ -3953,78 +5606,130 @@
   }
 
   void test_parseAssignableExpression_super_dot() {
-    PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "super.y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, propertyAccess.target);
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "super.y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        propertyAccess.target);
     expect(propertyAccess.operator, isNotNull);
     expect(propertyAccess.propertyName, isNotNull);
   }
 
   void test_parseAssignableExpression_super_index() {
-    IndexExpression expression = ParserTestCase.parse("parseAssignableExpression", <Object> [false], "super[y]");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.target);
+    IndexExpression expression =
+        ParserTestCase.parse("parseAssignableExpression", <Object>[false], "super[y]");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.target);
     expect(expression.leftBracket, isNotNull);
     expect(expression.index, isNotNull);
     expect(expression.rightBracket, isNotNull);
   }
 
   void test_parseAssignableSelector_dot() {
-    PropertyAccess selector = ParserTestCase.parse("parseAssignableSelector", <Object> [null, true], ".x");
+    PropertyAccess selector =
+        ParserTestCase.parse("parseAssignableSelector", <Object>[null, true], ".x");
     expect(selector.operator, isNotNull);
     expect(selector.propertyName, isNotNull);
   }
 
   void test_parseAssignableSelector_index() {
-    IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <Object> [null, true], "[x]");
+    IndexExpression selector =
+        ParserTestCase.parse("parseAssignableSelector", <Object>[null, true], "[x]");
     expect(selector.leftBracket, isNotNull);
     expect(selector.index, isNotNull);
     expect(selector.rightBracket, isNotNull);
   }
 
   void test_parseAssignableSelector_none() {
-    SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier(null), true], ";");
+    SimpleIdentifier selector = ParserTestCase.parse(
+        "parseAssignableSelector",
+        <Object>[new SimpleIdentifier(null), true],
+        ";");
     expect(selector, isNotNull);
   }
 
   void test_parseAwaitExpression() {
-    AwaitExpression expression = ParserTestCase.parse4("parseAwaitExpression", "await x;");
+    AwaitExpression expression =
+        ParserTestCase.parse4("parseAwaitExpression", "await x;");
     expect(expression.awaitKeyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
 
   void test_parseAwaitExpression_asStatement_inAsync() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "m() async { await x; }");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "m() async { await x; }");
     FunctionBody body = method.body;
-    EngineTestCase.assertInstanceOf((obj) => obj is BlockFunctionBody, BlockFunctionBody, body);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BlockFunctionBody,
+        BlockFunctionBody,
+        body);
     Statement statement = (body as BlockFunctionBody).block.statements[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ExpressionStatement, ExpressionStatement, statement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ExpressionStatement,
+        ExpressionStatement,
+        statement);
     Expression expression = (statement as ExpressionStatement).expression;
-    EngineTestCase.assertInstanceOf((obj) => obj is AwaitExpression, AwaitExpression, expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AwaitExpression,
+        AwaitExpression,
+        expression);
     expect((expression as AwaitExpression).awaitKeyword, isNotNull);
     expect((expression as AwaitExpression).expression, isNotNull);
   }
 
   void test_parseAwaitExpression_asStatement_inSync() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "m() { await x; }");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "m() { await x; }");
     FunctionBody body = method.body;
-    EngineTestCase.assertInstanceOf((obj) => obj is BlockFunctionBody, BlockFunctionBody, body);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BlockFunctionBody,
+        BlockFunctionBody,
+        body);
     Statement statement = (body as BlockFunctionBody).block.statements[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is VariableDeclarationStatement, VariableDeclarationStatement, statement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is VariableDeclarationStatement,
+        VariableDeclarationStatement,
+        statement);
   }
 
   void test_parseAwaitExpression_inSync() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "m() { return await x + await y; }");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "m() { return await x + await y; }");
     FunctionBody body = method.body;
-    EngineTestCase.assertInstanceOf((obj) => obj is BlockFunctionBody, BlockFunctionBody, body);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BlockFunctionBody,
+        BlockFunctionBody,
+        body);
     Statement statement = (body as BlockFunctionBody).block.statements[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ReturnStatement, ReturnStatement, statement);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ReturnStatement,
+        ReturnStatement,
+        statement);
     Expression expression = (statement as ReturnStatement).expression;
-    EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression);
-    EngineTestCase.assertInstanceOf((obj) => obj is AwaitExpression, AwaitExpression, (expression as BinaryExpression).leftOperand);
-    EngineTestCase.assertInstanceOf((obj) => obj is AwaitExpression, AwaitExpression, (expression as BinaryExpression).rightOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BinaryExpression,
+        BinaryExpression,
+        expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AwaitExpression,
+        AwaitExpression,
+        (expression as BinaryExpression).leftOperand);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is AwaitExpression,
+        AwaitExpression,
+        (expression as BinaryExpression).rightOperand);
   }
 
   void test_parseBitwiseAndExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "x & y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseAndExpression", "x & y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND);
@@ -4032,15 +5737,20 @@
   }
 
   void test_parseBitwiseAndExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "super & y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseAndExpression", "super & y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND);
     expect(expression.rightOperand, isNotNull);
   }
 
   void test_parseBitwiseOrExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "x | y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseOrExpression", "x | y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR);
@@ -4048,15 +5758,20 @@
   }
 
   void test_parseBitwiseOrExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "super | y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseOrExpression", "super | y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR);
     expect(expression.rightOperand, isNotNull);
   }
 
   void test_parseBitwiseXorExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "x ^ y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseXorExpression", "x ^ y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.CARET);
@@ -4064,8 +5779,12 @@
   }
 
   void test_parseBitwiseXorExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "super ^ y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseBitwiseXorExpression", "super ^ y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.CARET);
     expect(expression.rightOperand, isNotNull);
@@ -4086,21 +5805,26 @@
   }
 
   void test_parseBreakStatement_label() {
-    BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "break foo;");
+    BreakStatement statement =
+        ParserTestCase.parse4("parseBreakStatement", "break foo;");
     expect(statement.keyword, isNotNull);
     expect(statement.label, isNotNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseBreakStatement_noLabel() {
-    BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "break;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
+    BreakStatement statement = ParserTestCase.parse4(
+        "parseBreakStatement",
+        "break;",
+        [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
     expect(statement.keyword, isNotNull);
     expect(statement.label, isNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseCascadeSection_i() {
-    IndexExpression section = ParserTestCase.parse4("parseCascadeSection", "..[i]");
+    IndexExpression section =
+        ParserTestCase.parse4("parseCascadeSection", "..[i]");
     expect(section.target, isNull);
     expect(section.leftBracket, isNotNull);
     expect(section.index, isNotNull);
@@ -4108,14 +5832,22 @@
   }
 
   void test_parseCascadeSection_ia() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..[i](b)");
-    EngineTestCase.assertInstanceOf((obj) => obj is IndexExpression, IndexExpression, section.function);
+    FunctionExpressionInvocation section =
+        ParserTestCase.parse4("parseCascadeSection", "..[i](b)");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IndexExpression,
+        IndexExpression,
+        section.function);
     expect(section.argumentList, isNotNull);
   }
 
   void test_parseCascadeSection_ii() {
-    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c(d)");
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.target);
+    MethodInvocation section =
+        ParserTestCase.parse4("parseCascadeSection", "..a(b).c(d)");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
+        section.target);
     expect(section.period, isNotNull);
     expect(section.methodName, isNotNull);
     expect(section.argumentList, isNotNull);
@@ -4123,14 +5855,16 @@
   }
 
   void test_parseCascadeSection_p() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a");
+    PropertyAccess section =
+        ParserTestCase.parse4("parseCascadeSection", "..a");
     expect(section.target, isNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
   }
 
   void test_parseCascadeSection_p_assign() {
-    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3");
+    AssignmentExpression section =
+        ParserTestCase.parse4("parseCascadeSection", "..a = 3");
     expect(section.leftHandSide, isNotNull);
     expect(section.operator, isNotNull);
     Expression rhs = section.rightHandSide;
@@ -4138,22 +5872,28 @@
   }
 
   void test_parseCascadeSection_p_assign_withCascade() {
-    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3..m()");
+    AssignmentExpression section =
+        ParserTestCase.parse4("parseCascadeSection", "..a = 3..m()");
     expect(section.leftHandSide, isNotNull);
     expect(section.operator, isNotNull);
     Expression rhs = section.rightHandSide;
-    EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, rhs);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is IntegerLiteral,
+        IntegerLiteral,
+        rhs);
   }
 
   void test_parseCascadeSection_p_builtIn() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..as");
+    PropertyAccess section =
+        ParserTestCase.parse4("parseCascadeSection", "..as");
     expect(section.target, isNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
   }
 
   void test_parseCascadeSection_pa() {
-    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)");
+    MethodInvocation section =
+        ParserTestCase.parse4("parseCascadeSection", "..a(b)");
     expect(section.target, isNull);
     expect(section.period, isNotNull);
     expect(section.methodName, isNotNull);
@@ -4162,30 +5902,42 @@
   }
 
   void test_parseCascadeSection_paa() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c)");
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.function);
+    FunctionExpressionInvocation section =
+        ParserTestCase.parse4("parseCascadeSection", "..a(b)(c)");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
+        section.function);
     expect(section.argumentList, isNotNull);
     expect(section.argumentList.arguments, hasLength(1));
   }
 
   void test_parseCascadeSection_paapaa() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c).d(e)(f)");
-    EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.function);
+    FunctionExpressionInvocation section =
+        ParserTestCase.parse4("parseCascadeSection", "..a(b)(c).d(e)(f)");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
+        section.function);
     expect(section.argumentList, isNotNull);
     expect(section.argumentList.arguments, hasLength(1));
   }
 
   void test_parseCascadeSection_pap() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c");
+    PropertyAccess section =
+        ParserTestCase.parse4("parseCascadeSection", "..a(b).c");
     expect(section.target, isNotNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
   }
 
   void test_parseClassDeclaration_abstract() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [
-        emptyCommentAndMetadata(),
-        TokenFactory.tokenFromKeyword(Keyword.ABSTRACT)], "class A {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[
+            emptyCommentAndMetadata(),
+            TokenFactory.tokenFromKeyword(Keyword.ABSTRACT)],
+        "class A {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNotNull);
     expect(declaration.extendsClause, isNull);
@@ -4199,7 +5951,10 @@
   }
 
   void test_parseClassDeclaration_empty() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -4213,7 +5968,10 @@
   }
 
   void test_parseClassDeclaration_extends() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNotNull);
@@ -4227,7 +5985,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndImplements() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B implements C {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B implements C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNotNull);
@@ -4241,7 +6002,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndWith() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B with C {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B with C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.classKeyword, isNotNull);
@@ -4256,7 +6020,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndWithAndImplements() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B with C implements D {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B with C implements D {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.classKeyword, isNotNull);
@@ -4271,7 +6038,10 @@
   }
 
   void test_parseClassDeclaration_implements() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A implements C {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A implements C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -4285,7 +6055,10 @@
   }
 
   void test_parseClassDeclaration_native() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A native 'nativeValue' {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A native 'nativeValue' {}");
     NativeClause nativeClause = declaration.nativeClause;
     expect(nativeClause, isNotNull);
     expect(nativeClause.keyword, isNotNull);
@@ -4295,7 +6068,10 @@
   }
 
   void test_parseClassDeclaration_nonEmpty() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A {var f;}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A {var f;}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -4309,7 +6085,10 @@
   }
 
   void test_parseClassDeclaration_typeAlias_implementsC() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A = Object with B implements C;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A = Object with B implements C;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.typeParameters, isNull);
@@ -4321,7 +6100,10 @@
   }
 
   void test_parseClassDeclaration_typeAlias_withB() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A = Object with B;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A = Object with B;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.typeParameters, isNull);
@@ -4333,7 +6115,10 @@
   }
 
   void test_parseClassDeclaration_typeParameters() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A<B> {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A<B> {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -4348,8 +6133,12 @@
   }
 
   void test_parseClassMember_constructor_withInitializers() {
-    // TODO(brianwilkerson) Test other kinds of class members: fields, getters and setters.
-    ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember", <Object> ["C"], "C(_, _\$, this.__) : _a = _ + _\$ {}");
+    // TODO(brianwilkerson) Test other kinds of class members: fields, getters
+    // and setters.
+    ConstructorDeclaration constructor = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "C(_, _\$, this.__) : _a = _ + _\$ {}");
     expect(constructor.body, isNotNull);
     expect(constructor.separator, isNotNull);
     expect(constructor.externalKeyword, isNull);
@@ -4363,7 +6152,8 @@
   }
 
   void test_parseClassMember_field_instance_prefixedType() {
-    FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> ["C"], "p.A f;");
+    FieldDeclaration field =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "p.A f;");
     expect(field.documentationComment, isNull);
     expect(field.metadata, hasLength(0));
     expect(field.staticKeyword, isNull);
@@ -4376,7 +6166,8 @@
   }
 
   void test_parseClassMember_field_namedGet() {
-    FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> ["C"], "var get;");
+    FieldDeclaration field =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "var get;");
     expect(field.documentationComment, isNull);
     expect(field.metadata, hasLength(0));
     expect(field.staticKeyword, isNull);
@@ -4389,7 +6180,8 @@
   }
 
   void test_parseClassMember_field_namedOperator() {
-    FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> ["C"], "var operator;");
+    FieldDeclaration field =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "var operator;");
     expect(field.documentationComment, isNull);
     expect(field.metadata, hasLength(0));
     expect(field.staticKeyword, isNull);
@@ -4402,7 +6194,8 @@
   }
 
   void test_parseClassMember_field_namedOperator_withAssignment() {
-    FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> ["C"], "var operator = (5);");
+    FieldDeclaration field =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "var operator = (5);");
     expect(field.documentationComment, isNull);
     expect(field.metadata, hasLength(0));
     expect(field.staticKeyword, isNull);
@@ -4416,7 +6209,8 @@
   }
 
   void test_parseClassMember_field_namedSet() {
-    FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> ["C"], "var set;");
+    FieldDeclaration field =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "var set;");
     expect(field.documentationComment, isNull);
     expect(field.metadata, hasLength(0));
     expect(field.staticKeyword, isNull);
@@ -4429,7 +6223,8 @@
   }
 
   void test_parseClassMember_getter_void() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void get g {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "void get g {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4441,7 +6236,8 @@
   }
 
   void test_parseClassMember_method_external() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "external m();");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "external m();");
     expect(method.body, isNotNull);
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNotNull);
@@ -4454,7 +6250,10 @@
   }
 
   void test_parseClassMember_method_external_withTypeAndArgs() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "external int m(int a);");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "external int m(int a);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNotNull);
@@ -4467,7 +6266,8 @@
   }
 
   void test_parseClassMember_method_get_noType() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "get() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "get() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4480,7 +6280,8 @@
   }
 
   void test_parseClassMember_method_get_type() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int get() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "int get() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4493,7 +6294,8 @@
   }
 
   void test_parseClassMember_method_get_void() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void get() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "void get() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4506,7 +6308,8 @@
   }
 
   void test_parseClassMember_method_operator_noType() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "operator() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "operator() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4519,7 +6322,8 @@
   }
 
   void test_parseClassMember_method_operator_type() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "int operator() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4532,7 +6336,8 @@
   }
 
   void test_parseClassMember_method_operator_void() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void operator() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "void operator() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4545,7 +6350,8 @@
   }
 
   void test_parseClassMember_method_returnType_parameterized() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "p.A m() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "p.A m() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4558,7 +6364,8 @@
   }
 
   void test_parseClassMember_method_set_noType() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "set() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "set() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4571,7 +6378,8 @@
   }
 
   void test_parseClassMember_method_set_type() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int set() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "int set() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4584,7 +6392,8 @@
   }
 
   void test_parseClassMember_method_set_void() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void set() {}");
+    MethodDeclaration method =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "void set() {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4597,7 +6406,10 @@
   }
 
   void test_parseClassMember_operator_index() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator [](int i) {}");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "int operator [](int i) {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4610,7 +6422,10 @@
   }
 
   void test_parseClassMember_operator_indexAssign() {
-    MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator []=(int i) {}");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "int operator []=(int i) {}");
     expect(method.documentationComment, isNull);
     expect(method.externalKeyword, isNull);
     expect(method.modifierKeyword, isNull);
@@ -4623,7 +6438,10 @@
   }
 
   void test_parseClassMember_redirectingFactory_const() {
-    ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C() = B;");
+    ConstructorDeclaration constructor = ParserTestCase.parse(
+        "parseClassMember",
+        <Object>["C"],
+        "const factory C() = B;");
     expect(constructor.externalKeyword, isNull);
     expect(constructor.constKeyword, isNotNull);
     expect(constructor.factoryKeyword, isNotNull);
@@ -4638,7 +6456,8 @@
   }
 
   void test_parseClassMember_redirectingFactory_nonConst() {
-    ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember", <Object> ["C"], "factory C() = B;");
+    ConstructorDeclaration constructor =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "factory C() = B;");
     expect(constructor.externalKeyword, isNull);
     expect(constructor.constKeyword, isNull);
     expect(constructor.factoryKeyword, isNotNull);
@@ -4655,7 +6474,10 @@
   void test_parseClassTypeAlias_abstract() {
     Token classToken = TokenFactory.tokenFromKeyword(Keyword.CLASS);
     Token abstractToken = TokenFactory.tokenFromKeyword(Keyword.ABSTRACT);
-    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), abstractToken, classToken], "A = B with C;");
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), abstractToken, classToken],
+        "A = B with C;");
     expect(classTypeAlias.keyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -4668,7 +6490,10 @@
 
   void test_parseClassTypeAlias_implements() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), null, token], "A = B with C implements D;");
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C implements D;");
     expect(classTypeAlias.keyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -4681,7 +6506,10 @@
 
   void test_parseClassTypeAlias_with() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), null, token], "A = B with C;");
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C;");
     expect(classTypeAlias.keyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -4694,7 +6522,10 @@
 
   void test_parseClassTypeAlias_with_implements() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), null, token], "A = B with C implements D;");
+    ClassTypeAlias classTypeAlias = ParserTestCase.parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C implements D;");
     expect(classTypeAlias.keyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -4705,8 +6536,25 @@
     expect(classTypeAlias.semicolon, isNotNull);
   }
 
+  void test_parseCombinator_hide() {
+    HideCombinator combinator =
+        ParserTestCase.parse4('parseCombinator', 'hide a;');
+    expect(combinator, new isInstanceOf<HideCombinator>());
+    expect(combinator.keyword, isNotNull);
+    expect(combinator.hiddenNames, hasLength(1));
+  }
+
+  void test_parseCombinator_show() {
+    ShowCombinator combinator =
+        ParserTestCase.parse4('parseCombinator', 'show a;');
+    expect(combinator, new isInstanceOf<ShowCombinator>());
+    expect(combinator.keyword, isNotNull);
+    expect(combinator.shownNames, hasLength(1));
+  }
+
   void test_parseCombinators_h() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a;");
+    List<Combinator> combinators =
+        ParserTestCase.parse4("parseCombinators", "hide a;");
     expect(combinators, hasLength(1));
     HideCombinator combinator = combinators[0] as HideCombinator;
     expect(combinator, isNotNull);
@@ -4715,7 +6563,8 @@
   }
 
   void test_parseCombinators_hs() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b;");
+    List<Combinator> combinators =
+        ParserTestCase.parse4("parseCombinators", "hide a show b;");
     expect(combinators, hasLength(2));
     HideCombinator hideCombinator = combinators[0] as HideCombinator;
     expect(hideCombinator, isNotNull);
@@ -4728,12 +6577,14 @@
   }
 
   void test_parseCombinators_hshs() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b hide c show d;");
+    List<Combinator> combinators =
+        ParserTestCase.parse4("parseCombinators", "hide a show b hide c show d;");
     expect(combinators, hasLength(4));
   }
 
   void test_parseCombinators_s() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "show a;");
+    List<Combinator> combinators =
+        ParserTestCase.parse4("parseCombinators", "show a;");
     expect(combinators, hasLength(1));
     ShowCombinator combinator = combinators[0] as ShowCombinator;
     expect(combinator, isNotNull);
@@ -4742,61 +6593,73 @@
   }
 
   void test_parseCommentAndMetadata_c() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(0));
   }
 
   void test_parseCommentAndMetadata_cmc() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(1));
   }
 
   void test_parseCommentAndMetadata_cmcm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ @B void");
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4(
+        "parseCommentAndMetadata",
+        "/** 1 */ @A /** 2 */ @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_cmm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A @B void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_m() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "@A void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(1));
   }
 
   void test_parseCommentAndMetadata_mcm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_mcmc() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B /** 2 */ void");
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4(
+        "parseCommentAndMetadata",
+        "@A /** 1 */ @B /** 2 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_mm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A @B(x) void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "@A @B(x) void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_none() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "void");
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", "void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(0));
   }
 
   void test_parseCommentAndMetadata_singleLine() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", r'''
+    CommentAndMetadata commentAndMetadata =
+        ParserTestCase.parse4("parseCommentAndMetadata", r'''
 /// 1
 /// 2
 void''');
@@ -4805,8 +6668,12 @@
   }
 
   void test_parseCommentReference_new_prefixed() {
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["new a.b", 7], "");
-    PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf((obj) => obj is PrefixedIdentifier, PrefixedIdentifier, reference.identifier);
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["new a.b", 7], "");
+    PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixedIdentifier,
+        PrefixedIdentifier,
+        reference.identifier);
     SimpleIdentifier prefix = prefixedIdentifier.prefix;
     expect(prefix.token, isNotNull);
     expect(prefix.name, "a");
@@ -4819,16 +6686,24 @@
   }
 
   void test_parseCommentReference_new_simple() {
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["new a", 5], "");
-    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, reference.identifier);
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["new a", 5], "");
+    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
     expect(identifier.offset, 9);
   }
 
   void test_parseCommentReference_prefixed() {
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["a.b", 7], "");
-    PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf((obj) => obj is PrefixedIdentifier, PrefixedIdentifier, reference.identifier);
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["a.b", 7], "");
+    PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is PrefixedIdentifier,
+        PrefixedIdentifier,
+        reference.identifier);
     SimpleIdentifier prefix = prefixedIdentifier.prefix;
     expect(prefix.token, isNotNull);
     expect(prefix.name, "a");
@@ -4841,16 +6716,24 @@
   }
 
   void test_parseCommentReference_simple() {
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["a", 5], "");
-    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, reference.identifier);
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["a", 5], "");
+    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
     expect(identifier.offset, 5);
   }
 
   void test_parseCommentReference_synthetic() {
-    CommentReference reference = ParserTestCase.parse("parseCommentReference", <Object> ["", 5], "");
-    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, reference.identifier);
+    CommentReference reference =
+        ParserTestCase.parse("parseCommentReference", <Object>["", 5], "");
+    SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
+        reference.identifier);
     expect(identifier, isNotNull);
     expect(identifier.isSynthetic, isTrue);
     expect(identifier.token, isNotNull);
@@ -4859,8 +6742,10 @@
   }
 
   void test_parseCommentReferences_multiLine() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(2));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4873,8 +6758,10 @@
   }
 
   void test_parseCommentReferences_notClosed_noIdentifier() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [ some text", 5)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [ some text", 5)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4884,8 +6771,10 @@
   }
 
   void test_parseCommentReferences_notClosed_withIdentifier() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [namePrefix some text", 5)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [namePrefix some text", 5)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4895,10 +6784,11 @@
   }
 
   void test_parseCommentReferences_singleLine() {
-    List<Token> tokens = <Token> [
+    List<Token> tokens = <Token>[
         new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// xxx [a] yyy [b] zzz", 3),
         new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// x [c]", 28)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(3));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4915,8 +6805,13 @@
   }
 
   void test_parseCommentReferences_skipCodeBlock_bracketed() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [:xxx [a] yyy:] [b] zzz */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(
+            TokenType.MULTI_LINE_COMMENT,
+            "/** [:xxx [a] yyy:] [b] zzz */",
+            3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4925,8 +6820,13 @@
   }
 
   void test_parseCommentReferences_skipCodeBlock_spaces() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/**\n *     a[i]\n * xxx [i] zzz\n */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(
+            TokenType.MULTI_LINE_COMMENT,
+            "/**\n *     a[i]\n * xxx [i] zzz\n */",
+            3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4935,8 +6835,13 @@
   }
 
   void test_parseCommentReferences_skipLinkDefinition() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a]: http://www.google.com (Google) [b] zzz */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(
+            TokenType.MULTI_LINE_COMMENT,
+            "/** [a]: http://www.google.com (Google) [b] zzz */",
+            3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4945,8 +6850,13 @@
   }
 
   void test_parseCommentReferences_skipLinked() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a](http://www.google.com) [b] zzz */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(
+            TokenType.MULTI_LINE_COMMENT,
+            "/** [a](http://www.google.com) [b] zzz */",
+            3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4955,8 +6865,10 @@
   }
 
   void test_parseCommentReferences_skipReferenceLink() {
-    List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)];
-    List<CommentReference> references = ParserTestCase.parse("parseCommentReferences", <Object> [tokens], "");
+    List<Token> tokens = <Token>[
+        new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)];
+    List<CommentReference> references =
+        ParserTestCase.parse("parseCommentReferences", <Object>[tokens], "");
     expect(references, hasLength(1));
     CommentReference reference = references[0];
     expect(reference, isNotNull);
@@ -4965,7 +6877,9 @@
   }
 
   void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "abstract<dynamic> _abstract = new abstract.A();");
+    CompilationUnit unit = ParserTestCase.parse4(
+        "parseCompilationUnit",
+        "abstract<dynamic> _abstract = new abstract.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
@@ -4990,14 +6904,16 @@
   }
 
   void test_parseCompilationUnit_directives_multiple() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;\npart 'a.dart';");
+    CompilationUnit unit =
+        ParserTestCase.parse4("parseCompilationUnit", "library l;\npart 'a.dart';");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(2));
     expect(unit.declarations, hasLength(0));
   }
 
   void test_parseCompilationUnit_directives_single() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;");
+    CompilationUnit unit =
+        ParserTestCase.parse4("parseCompilationUnit", "library l;");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(1));
     expect(unit.declarations, hasLength(0));
@@ -5011,28 +6927,35 @@
   }
 
   void test_parseCompilationUnit_exportAsPrefix() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export.A _export = new export.A();");
+    CompilationUnit unit = ParserTestCase.parse4(
+        "parseCompilationUnit",
+        "export.A _export = new export.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_exportAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export<dynamic> _export = new export.A();");
+    CompilationUnit unit = ParserTestCase.parse4(
+        "parseCompilationUnit",
+        "export<dynamic> _export = new export.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_operatorAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "operator<dynamic> _operator = new operator.A();");
+    CompilationUnit unit = ParserTestCase.parse4(
+        "parseCompilationUnit",
+        "operator<dynamic> _operator = new operator.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_script() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bin/dart");
+    CompilationUnit unit =
+        ParserTestCase.parse4("parseCompilationUnit", "#! /bin/dart");
     expect(unit.scriptTag, isNotNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(0));
@@ -5040,141 +6963,202 @@
 
   void test_parseCompilationUnit_skipFunctionBody_withInterpolation() {
     ParserTestCase.parseFunctionBodies = false;
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }");
+    CompilationUnit unit =
+        ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }");
     expect(unit.scriptTag, isNull);
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_topLevelDeclaration() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}");
+    CompilationUnit unit =
+        ParserTestCase.parse4("parseCompilationUnit", "class A {}");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_typedefAsPrefix() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "typedef.A _typedef = new typedef.A();");
+    CompilationUnit unit = ParserTestCase.parse4(
+        "parseCompilationUnit",
+        "typedef.A _typedef = new typedef.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnitMember_abstractAsPrefix() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = new abstract.A();");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "abstract.A _abstract = new abstract.A();");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseCompilationUnitMember_class() {
-    ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "class A {}");
+    ClassDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class A {}");
     expect(declaration.name.name, "A");
     expect(declaration.members, hasLength(0));
   }
 
   void test_parseCompilationUnitMember_classTypeAlias() {
-    ClassTypeAlias alias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "abstract class A = B with C;");
+    ClassTypeAlias alias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "abstract class A = B with C;");
     expect(alias.name.name, "A");
     expect(alias.abstractKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_constVariable() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "const int x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseCompilationUnitMember_finalVariable() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "final x = 0;");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "final x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseCompilationUnitMember_function_external_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external f();");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external f();");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNull);
   }
 
   void test_parseCompilationUnitMember_function_external_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external int f();");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external int f();");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNull);
   }
 
   void test_parseCompilationUnitMember_function_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "f() {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "f() {}");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNull);
   }
 
   void test_parseCompilationUnitMember_function_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "int f() {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "int f() {}");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNull);
   }
 
   void test_parseCompilationUnitMember_function_void() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void f() {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void f() {}");
     expect(declaration.returnType, isNotNull);
   }
 
   void test_parseCompilationUnitMember_getter_external_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external get p;");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external get p;");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_getter_external_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external int get p;");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external int get p;");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_getter_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "get p => 0;");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "get p => 0;");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_getter_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "int get p => 0;");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "int get p => 0;");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_setter_external_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external set p(v);");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external set p(v);");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_setter_external_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "external void set p(int v);");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "external void set p(int v);");
     expect(declaration.externalKeyword, isNotNull);
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_setter_noType() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "set p(v) {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "set p(v) {}");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
   }
 
   void test_parseCompilationUnitMember_setter_type() {
-    FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "void set p(int v) {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "void set p(int v) {}");
     expect(declaration.functionExpression, isNotNull);
     expect(declaration.propertyKeyword, isNotNull);
     expect(declaration.returnType, isNotNull);
   }
 
   void test_parseCompilationUnitMember_typeAlias_abstract() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "abstract class C = S with M;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "abstract class C = S with M;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name.name, "C");
     expect(typeAlias.typeParameters, isNull);
@@ -5187,7 +7171,10 @@
   }
 
   void test_parseCompilationUnitMember_typeAlias_generic() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "class C<E> = S<E> with M<E> implements I<E>;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class C<E> = S<E> with M<E> implements I<E>;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name.name, "C");
     expect(typeAlias.typeParameters.typeParameters, hasLength(1));
@@ -5200,7 +7187,10 @@
   }
 
   void test_parseCompilationUnitMember_typeAlias_implements() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "class C = S with M implements I;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class C = S with M implements I;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name.name, "C");
     expect(typeAlias.typeParameters, isNull);
@@ -5213,7 +7203,10 @@
   }
 
   void test_parseCompilationUnitMember_typeAlias_noImplements() {
-    ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "class C = S with M;");
+    ClassTypeAlias typeAlias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class C = S with M;");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name.name, "C");
     expect(typeAlias.typeParameters, isNull);
@@ -5226,31 +7219,44 @@
   }
 
   void test_parseCompilationUnitMember_typedef() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "typedef F();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef F();");
     expect(typeAlias.name.name, "F");
     expect(typeAlias.parameters.parameters, hasLength(0));
   }
 
   void test_parseCompilationUnitMember_variable() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "var x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseCompilationUnitMember_variableGet() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "String get = null;");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "String get = null;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseCompilationUnitMember_variableSet() {
-    TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "String set = null;");
+    TopLevelVariableDeclaration declaration = ParserTestCase.parse(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "String set = null;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
   }
 
   void test_parseConditionalExpression() {
-    ConditionalExpression expression = ParserTestCase.parse4("parseConditionalExpression", "x ? y : z");
+    ConditionalExpression expression =
+        ParserTestCase.parse4("parseConditionalExpression", "x ? y : z");
     expect(expression.condition, isNotNull);
     expect(expression.question, isNotNull);
     expect(expression.thenExpression, isNotNull);
@@ -5259,7 +7265,8 @@
   }
 
   void test_parseConstExpression_instanceCreation() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parseConstExpression", "const A()");
+    InstanceCreationExpression expression =
+        ParserTestCase.parse4("parseConstExpression", "const A()");
     expect(expression.keyword, isNotNull);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -5270,7 +7277,8 @@
   }
 
   void test_parseConstExpression_listLiteral_typed() {
-    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A> []");
+    ListLiteral literal =
+        ParserTestCase.parse4("parseConstExpression", "const <A> []");
     expect(literal.constKeyword, isNotNull);
     expect(literal.typeArguments, isNotNull);
     expect(literal.leftBracket, isNotNull);
@@ -5279,7 +7287,8 @@
   }
 
   void test_parseConstExpression_listLiteral_untyped() {
-    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const []");
+    ListLiteral literal =
+        ParserTestCase.parse4("parseConstExpression", "const []");
     expect(literal.constKeyword, isNotNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -5288,7 +7297,8 @@
   }
 
   void test_parseConstExpression_mapLiteral_typed() {
-    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A, B> {}");
+    MapLiteral literal =
+        ParserTestCase.parse4("parseConstExpression", "const <A, B> {}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(0));
     expect(literal.rightBracket, isNotNull);
@@ -5296,7 +7306,8 @@
   }
 
   void test_parseConstExpression_mapLiteral_untyped() {
-    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const {}");
+    MapLiteral literal =
+        ParserTestCase.parse4("parseConstExpression", "const {}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(0));
     expect(literal.rightBracket, isNotNull);
@@ -5305,27 +7316,42 @@
 
   void test_parseConstructor() {
     // TODO(brianwilkerson) Implement tests for this method.
-    //    parse("parseConstructor", new Class[] {Parser.CommentAndMetadata.class,
-    //        Token.class, Token.class, SimpleIdentifier.class, Token.class,
-    //        SimpleIdentifier.class, FormalParameterList.class}, new Object[] {emptyCommentAndMetadata(),
-    //        null, null, null, null, null, null}, "");
+//    parse("parseConstructor", new Class[] {Parser.CommentAndMetadata.class,
+//        Token.class, Token.class, SimpleIdentifier.class, Token.class,
+//        SimpleIdentifier.class, FormalParameterList.class}, new Object[] {emptyCommentAndMetadata(),
+//        null, null, null, null, null, null}, "");
   }
 
   void test_parseConstructor_with_pseudo_function_literal() {
-    // "(b) {}" should not be misinterpreted as a function literal even though it looks like one.
-    ClassMember classMember = ParserTestCase.parse("parseClassMember", <Object> ["C"], "C() : a = (b) {}");
-    EngineTestCase.assertInstanceOf((obj) => obj is ConstructorDeclaration, ConstructorDeclaration, classMember);
+    // "(b) {}" should not be misinterpreted as a function literal even though
+    // it looks like one.
+    ClassMember classMember =
+        ParserTestCase.parse("parseClassMember", <Object>["C"], "C() : a = (b) {}");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ConstructorDeclaration,
+        ConstructorDeclaration,
+        classMember);
     ConstructorDeclaration constructor = classMember as ConstructorDeclaration;
     NodeList<ConstructorInitializer> initializers = constructor.initializers;
     expect(initializers, hasLength(1));
     ConstructorInitializer initializer = initializers[0];
-    EngineTestCase.assertInstanceOf((obj) => obj is ConstructorFieldInitializer, ConstructorFieldInitializer, initializer);
-    EngineTestCase.assertInstanceOf((obj) => obj is ParenthesizedExpression, ParenthesizedExpression, (initializer as ConstructorFieldInitializer).expression);
-    EngineTestCase.assertInstanceOf((obj) => obj is BlockFunctionBody, BlockFunctionBody, constructor.body);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ConstructorFieldInitializer,
+        ConstructorFieldInitializer,
+        initializer);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ParenthesizedExpression,
+        ParenthesizedExpression,
+        (initializer as ConstructorFieldInitializer).expression);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is BlockFunctionBody,
+        BlockFunctionBody,
+        constructor.body);
   }
 
   void test_parseConstructorFieldInitializer_qualified() {
-    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "this.a = b");
+    ConstructorFieldInitializer invocation =
+        ParserTestCase.parse4("parseConstructorFieldInitializer", "this.a = b");
     expect(invocation.equals, isNotNull);
     expect(invocation.expression, isNotNull);
     expect(invocation.fieldName, isNotNull);
@@ -5334,7 +7360,8 @@
   }
 
   void test_parseConstructorFieldInitializer_unqualified() {
-    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "a = b");
+    ConstructorFieldInitializer invocation =
+        ParserTestCase.parse4("parseConstructorFieldInitializer", "a = b");
     expect(invocation.equals, isNotNull);
     expect(invocation.expression, isNotNull);
     expect(invocation.fieldName, isNotNull);
@@ -5343,14 +7370,16 @@
   }
 
   void test_parseConstructorName_named_noPrefix() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A.n;");
+    ConstructorName name =
+        ParserTestCase.parse4("parseConstructorName", "A.n;");
     expect(name.type, isNotNull);
     expect(name.period, isNull);
     expect(name.name, isNull);
   }
 
   void test_parseConstructorName_named_prefixed() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A.n;");
+    ConstructorName name =
+        ParserTestCase.parse4("parseConstructorName", "p.A.n;");
     expect(name.type, isNotNull);
     expect(name.period, isNotNull);
     expect(name.name, isNotNull);
@@ -5364,28 +7393,38 @@
   }
 
   void test_parseConstructorName_unnamed_prefixed() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A;");
+    ConstructorName name =
+        ParserTestCase.parse4("parseConstructorName", "p.A;");
     expect(name.type, isNotNull);
     expect(name.period, isNull);
     expect(name.name, isNull);
   }
 
   void test_parseContinueStatement_label() {
-    ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement", "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+    ContinueStatement statement = ParserTestCase.parse4(
+        "parseContinueStatement",
+        "continue foo;",
+        [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
     expect(statement.keyword, isNotNull);
     expect(statement.label, isNotNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseContinueStatement_noLabel() {
-    ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement", "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
+    ContinueStatement statement = ParserTestCase.parse4(
+        "parseContinueStatement",
+        "continue;",
+        [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
     expect(statement.keyword, isNotNull);
     expect(statement.label, isNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseDirective_export() {
-    ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart';");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(0));
@@ -5393,7 +7432,10 @@
   }
 
   void test_parseDirective_import() {
-    ImportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart';");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart';");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.asToken, isNull);
@@ -5403,21 +7445,30 @@
   }
 
   void test_parseDirective_library() {
-    LibraryDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "library l;");
+    LibraryDirective directive = ParserTestCase.parse(
+        "parseDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "library l;");
     expect(directive.libraryToken, isNotNull);
     expect(directive.name, isNotNull);
     expect(directive.semicolon, isNotNull);
   }
 
   void test_parseDirective_part() {
-    PartDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part 'lib/lib.dart';");
+    PartDirective directive = ParserTestCase.parse(
+        "parseDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "part 'lib/lib.dart';");
     expect(directive.partToken, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.semicolon, isNotNull);
   }
 
   void test_parseDirective_partOf() {
-    PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;");
+    PartOfDirective directive = ParserTestCase.parse(
+        "parseDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "part of l;");
     expect(directive.partToken, isNotNull);
     expect(directive.ofToken, isNotNull);
     expect(directive.libraryName, isNotNull);
@@ -5425,7 +7476,8 @@
   }
 
   void test_parseDirectives_complete() {
-    CompilationUnit unit = _parseDirectives("#! /bin/dart\nlibrary l;\nclass A {}");
+    CompilationUnit unit =
+        _parseDirectives("#! /bin/dart\nlibrary l;\nclass A {}");
     expect(unit.scriptTag, isNotNull);
     expect(unit.directives, hasLength(1));
   }
@@ -5437,7 +7489,8 @@
   }
 
   void test_parseDirectives_mixed() {
-    CompilationUnit unit = _parseDirectives("library l; class A {} part 'foo.dart';");
+    CompilationUnit unit =
+        _parseDirectives("library l; class A {} part 'foo.dart';");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(1));
   }
@@ -5467,14 +7520,16 @@
   }
 
   void test_parseDocumentationComment_block() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** */ class");
+    Comment comment =
+        ParserTestCase.parse4("parseDocumentationComment", "/** */ class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
   }
 
   void test_parseDocumentationComment_block_withReference() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** [a] */ class");
+    Comment comment =
+        ParserTestCase.parse4("parseDocumentationComment", "/** [a] */ class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
@@ -5486,14 +7541,16 @@
   }
 
   void test_parseDocumentationComment_endOfLine() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/// \n/// \n class");
+    Comment comment =
+        ParserTestCase.parse4("parseDocumentationComment", "/// \n/// \n class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
   }
 
   void test_parseDoStatement() {
-    DoStatement statement = ParserTestCase.parse4("parseDoStatement", "do {} while (x);");
+    DoStatement statement =
+        ParserTestCase.parse4("parseDoStatement", "do {} while (x);");
     expect(statement.doKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.whileKeyword, isNotNull);
@@ -5504,12 +7561,16 @@
   }
 
   void test_parseEmptyStatement() {
-    EmptyStatement statement = ParserTestCase.parse4("parseEmptyStatement", ";");
+    EmptyStatement statement =
+        ParserTestCase.parse4("parseEmptyStatement", ";");
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseEnumDeclaration_one() {
-    EnumDeclaration declaration = ParserTestCase.parse("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E {ONE}");
+    EnumDeclaration declaration = ParserTestCase.parse(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E {ONE}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.keyword, isNotNull);
     expect(declaration.leftBracket, isNotNull);
@@ -5519,7 +7580,10 @@
   }
 
   void test_parseEnumDeclaration_trailingComma() {
-    EnumDeclaration declaration = ParserTestCase.parse("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E {ONE,}");
+    EnumDeclaration declaration = ParserTestCase.parse(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E {ONE,}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.keyword, isNotNull);
     expect(declaration.leftBracket, isNotNull);
@@ -5529,7 +7593,10 @@
   }
 
   void test_parseEnumDeclaration_two() {
-    EnumDeclaration declaration = ParserTestCase.parse("parseEnumDeclaration", <Object> [emptyCommentAndMetadata()], "enum E {ONE, TWO}");
+    EnumDeclaration declaration = ParserTestCase.parse(
+        "parseEnumDeclaration",
+        <Object>[emptyCommentAndMetadata()],
+        "enum E {ONE, TWO}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.keyword, isNotNull);
     expect(declaration.leftBracket, isNotNull);
@@ -5539,7 +7606,8 @@
   }
 
   void test_parseEqualityExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "x == y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseEqualityExpression", "x == y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5547,15 +7615,22 @@
   }
 
   void test_parseEqualityExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "super == y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseEqualityExpression", "super == y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
     expect(expression.rightOperand, isNotNull);
   }
 
   void test_parseExportDirective_hide() {
-    ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseExportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart' hide A, B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(1));
@@ -5563,7 +7638,10 @@
   }
 
   void test_parseExportDirective_hide_show() {
-    ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A show B;");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseExportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart' hide A show B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(2));
@@ -5571,7 +7649,10 @@
   }
 
   void test_parseExportDirective_noCombinator() {
-    ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseExportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart';");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(0));
@@ -5579,7 +7660,10 @@
   }
 
   void test_parseExportDirective_show() {
-    ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show A, B;");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseExportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart' show A, B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(1));
@@ -5587,7 +7671,10 @@
   }
 
   void test_parseExportDirective_show_hide() {
-    ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;");
+    ExportDirective directive = ParserTestCase.parse(
+        "parseExportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "export 'lib/lib.dart' show B hide A;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.combinators, hasLength(2));
@@ -5596,7 +7683,8 @@
 
   void test_parseExpression_assign() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    AssignmentExpression expression = ParserTestCase.parse4("parseExpression", "x = y");
+    AssignmentExpression expression =
+        ParserTestCase.parse4("parseExpression", "x = y");
     expect(expression.leftHandSide, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ);
@@ -5604,7 +7692,8 @@
   }
 
   void test_parseExpression_comparison() {
-    BinaryExpression expression = ParserTestCase.parse4("parseExpression", "--a.b == c");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseExpression", "--a.b == c");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5612,7 +7701,8 @@
   }
 
   void test_parseExpression_function_async() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() async {}");
+    FunctionExpression expression =
+        ParserTestCase.parseExpression("() async {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isTrue);
     expect(expression.body.isGenerator, isFalse);
@@ -5620,7 +7710,8 @@
   }
 
   void test_parseExpression_function_asyncStar() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() async* {}");
+    FunctionExpression expression =
+        ParserTestCase.parseExpression("() async* {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isTrue);
     expect(expression.body.isGenerator, isTrue);
@@ -5636,7 +7727,8 @@
   }
 
   void test_parseExpression_function_syncStar() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() sync* {}");
+    FunctionExpression expression =
+        ParserTestCase.parseExpression("() sync* {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isFalse);
     expect(expression.body.isGenerator, isTrue);
@@ -5644,8 +7736,12 @@
   }
 
   void test_parseExpression_invokeFunctionExpression() {
-    FunctionExpressionInvocation invocation = ParserTestCase.parse4("parseExpression", "(a) {return a + a;} (3)");
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression, FunctionExpression, invocation.function);
+    FunctionExpressionInvocation invocation =
+        ParserTestCase.parse4("parseExpression", "(a) {return a + a;} (3)");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionExpression,
+        FunctionExpression,
+        invocation.function);
     FunctionExpression expression = invocation.function as FunctionExpression;
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
@@ -5655,14 +7751,16 @@
   }
 
   void test_parseExpression_superMethodInvocation() {
-    MethodInvocation invocation = ParserTestCase.parse4("parseExpression", "super.m()");
+    MethodInvocation invocation =
+        ParserTestCase.parse4("parseExpression", "super.m()");
     expect(invocation.target, isNotNull);
     expect(invocation.methodName, isNotNull);
     expect(invocation.argumentList, isNotNull);
   }
 
   void test_parseExpressionList_multiple() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2, 3");
+    List<Expression> result =
+        ParserTestCase.parse4("parseExpressionList", "1, 2, 3");
     expect(result, hasLength(3));
   }
 
@@ -5673,7 +7771,8 @@
 
   void test_parseExpressionWithoutCascade_assign() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    AssignmentExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "x = y");
+    AssignmentExpression expression =
+        ParserTestCase.parse4("parseExpressionWithoutCascade", "x = y");
     expect(expression.leftHandSide, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ);
@@ -5681,7 +7780,8 @@
   }
 
   void test_parseExpressionWithoutCascade_comparison() {
-    BinaryExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "--a.b == c");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseExpressionWithoutCascade", "--a.b == c");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5689,21 +7789,27 @@
   }
 
   void test_parseExpressionWithoutCascade_superMethodInvocation() {
-    MethodInvocation invocation = ParserTestCase.parse4("parseExpressionWithoutCascade", "super.m()");
+    MethodInvocation invocation =
+        ParserTestCase.parse4("parseExpressionWithoutCascade", "super.m()");
     expect(invocation.target, isNotNull);
     expect(invocation.methodName, isNotNull);
     expect(invocation.argumentList, isNotNull);
   }
 
   void test_parseExtendsClause() {
-    ExtendsClause clause = ParserTestCase.parse4("parseExtendsClause", "extends B");
+    ExtendsClause clause =
+        ParserTestCase.parse4("parseExtendsClause", "extends B");
     expect(clause.keyword, isNotNull);
     expect(clause.superclass, isNotNull);
-    EngineTestCase.assertInstanceOf((obj) => obj is TypeName, TypeName, clause.superclass);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is TypeName,
+        TypeName,
+        clause.superclass);
   }
 
   void test_parseFinalConstVarOrType_const_noType() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "const");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "const");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5712,7 +7818,8 @@
   }
 
   void test_parseFinalConstVarOrType_const_type() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "const A a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "const A a");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5721,7 +7828,8 @@
   }
 
   void test_parseFinalConstVarOrType_final_noType() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "final");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "final");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5730,7 +7838,10 @@
   }
 
   void test_parseFinalConstVarOrType_final_prefixedType() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "final p.A a");
+    FinalConstVarOrType result = ParserTestCase.parse(
+        "parseFinalConstVarOrType",
+        <Object>[false],
+        "final p.A a");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5739,7 +7850,8 @@
   }
 
   void test_parseFinalConstVarOrType_final_type() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "final A a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "final A a");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5748,37 +7860,43 @@
   }
 
   void test_parseFinalConstVarOrType_type_parameterized() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "A<B> a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "A<B> a");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_type_prefixed() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "p.A a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "p.A a");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_type_prefixed_noIdentifier() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "p.A,");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "p.A,");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_type_prefixedAndParameterized() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "p.A<B> a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "p.A<B> a");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_type_simple() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "A a");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "A a");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_var() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "var");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "var");
     Token keyword = result.keyword;
     expect(keyword, isNotNull);
     expect(keyword.type, TokenType.KEYWORD);
@@ -5787,21 +7905,27 @@
   }
 
   void test_parseFinalConstVarOrType_void() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "void f()");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "void f()");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFinalConstVarOrType_void_noIdentifier() {
-    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "void,");
+    FinalConstVarOrType result =
+        ParserTestCase.parse("parseFinalConstVarOrType", <Object>[false], "void,");
     expect(result.keyword, isNull);
     expect(result.type, isNotNull);
   }
 
   void test_parseFormalParameter_final_withType_named() {
     ParameterKind kind = ParameterKind.NAMED;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "final A a : null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter = ParserTestCase.parse(
+        "parseFormalParameter",
+        <Object>[kind],
+        "final A a : null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNotNull);
     expect(simpleParameter.type, isNotNull);
@@ -5813,7 +7937,8 @@
 
   void test_parseFormalParameter_final_withType_normal() {
     ParameterKind kind = ParameterKind.REQUIRED;
-    SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "final A a");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "final A a");
     expect(parameter.identifier, isNotNull);
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
@@ -5822,8 +7947,12 @@
 
   void test_parseFormalParameter_final_withType_positional() {
     ParameterKind kind = ParameterKind.POSITIONAL;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "final A a = null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter = ParserTestCase.parse(
+        "parseFormalParameter",
+        <Object>[kind],
+        "final A a = null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNotNull);
     expect(simpleParameter.type, isNotNull);
@@ -5835,8 +7964,10 @@
 
   void test_parseFormalParameter_nonFinal_withType_named() {
     ParameterKind kind = ParameterKind.NAMED;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "A a : null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "A a : null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNull);
     expect(simpleParameter.type, isNotNull);
@@ -5848,7 +7979,8 @@
 
   void test_parseFormalParameter_nonFinal_withType_normal() {
     ParameterKind kind = ParameterKind.REQUIRED;
-    SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "A a");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "A a");
     expect(parameter.identifier, isNotNull);
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNotNull);
@@ -5857,8 +7989,10 @@
 
   void test_parseFormalParameter_nonFinal_withType_positional() {
     ParameterKind kind = ParameterKind.POSITIONAL;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "A a = null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "A a = null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNull);
     expect(simpleParameter.type, isNotNull);
@@ -5870,7 +8004,8 @@
 
   void test_parseFormalParameter_var() {
     ParameterKind kind = ParameterKind.REQUIRED;
-    SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "var a");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "var a");
     expect(parameter.identifier, isNotNull);
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
@@ -5879,8 +8014,10 @@
 
   void test_parseFormalParameter_var_named() {
     ParameterKind kind = ParameterKind.NAMED;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "var a : null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "var a : null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNotNull);
     expect(simpleParameter.type, isNull);
@@ -5892,8 +8029,10 @@
 
   void test_parseFormalParameter_var_positional() {
     ParameterKind kind = ParameterKind.POSITIONAL;
-    DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "var a = null");
-    SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalParameter;
+    DefaultFormalParameter parameter =
+        ParserTestCase.parse("parseFormalParameter", <Object>[kind], "var a = null");
+    SimpleFormalParameter simpleParameter =
+        parameter.parameter as SimpleFormalParameter;
     expect(simpleParameter.identifier, isNotNull);
     expect(simpleParameter.keyword, isNotNull);
     expect(simpleParameter.type, isNull);
@@ -5904,7 +8043,8 @@
   }
 
   void test_parseFormalParameterList_empty() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "()");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "()");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(0));
@@ -5913,7 +8053,8 @@
   }
 
   void test_parseFormalParameterList_named_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a : 1, B b, C c : 3})");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "({A a : 1, B b, C c : 3})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5922,7 +8063,8 @@
   }
 
   void test_parseFormalParameterList_named_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a})");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "({A a})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5931,7 +8073,8 @@
   }
 
   void test_parseFormalParameterList_normal_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, B b, C c)");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "(A a, B b, C c)");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5940,7 +8083,8 @@
   }
 
   void test_parseFormalParameterList_normal_named() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, {B b})");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "(A a, {B b})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(2));
@@ -5949,7 +8093,8 @@
   }
 
   void test_parseFormalParameterList_normal_positional() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, [B b])");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "(A a, [B b])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(2));
@@ -5958,7 +8103,8 @@
   }
 
   void test_parseFormalParameterList_normal_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a)");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "(A a)");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5967,7 +8113,9 @@
   }
 
   void test_parseFormalParameterList_positional_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null, B b, C c = null])");
+    FormalParameterList parameterList = ParserTestCase.parse4(
+        "parseFormalParameterList",
+        "([A a = null, B b, C c = null])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5976,7 +8124,8 @@
   }
 
   void test_parseFormalParameterList_positional_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null])");
+    FormalParameterList parameterList =
+        ParserTestCase.parse4("parseFormalParameterList", "([A a = null])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5985,7 +8134,8 @@
   }
 
   void test_parseForStatement_each_await() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "await for (element in list) {}");
+    ForEachStatement statement =
+        ParserTestCase.parse4("parseForStatement", "await for (element in list) {}");
     expect(statement.awaitKeyword, isNotNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5998,7 +8148,8 @@
   }
 
   void test_parseForStatement_each_identifier() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (element in list) {}");
+    ForEachStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -6011,7 +8162,8 @@
   }
 
   void test_parseForStatement_each_noType_metadata() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var element in list) {}");
+    ForEachStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (@A var element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -6025,7 +8177,8 @@
   }
 
   void test_parseForStatement_each_type() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (A element in list) {}");
+    ForEachStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (A element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -6038,7 +8191,8 @@
   }
 
   void test_parseForStatement_each_var() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (var element in list) {}");
+    ForEachStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (var element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -6051,7 +8205,8 @@
   }
 
   void test_parseForStatement_loop_c() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count;) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (; i < count;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -6065,7 +8220,8 @@
   }
 
   void test_parseForStatement_loop_cu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count; i++) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -6079,7 +8235,8 @@
   }
 
   void test_parseForStatement_loop_ecu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (i--; i < count; i++) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (i--; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -6093,7 +8250,8 @@
   }
 
   void test_parseForStatement_loop_i() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;;) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (var i = 0;;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6110,7 +8268,8 @@
   }
 
   void test_parseForStatement_loop_i_withMetadata() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var i = 0;;) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (@A var i = 0;;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6127,7 +8286,8 @@
   }
 
   void test_parseForStatement_loop_ic() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count;) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6143,7 +8303,9 @@
   }
 
   void test_parseForStatement_loop_icu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count; i++) {}");
+    ForStatement statement = ParserTestCase.parse4(
+        "parseForStatement",
+        "for (var i = 0; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6159,7 +8321,9 @@
   }
 
   void test_parseForStatement_loop_iicuu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (int i = 0, j = count; i < j; i++, j--) {}");
+    ForStatement statement = ParserTestCase.parse4(
+        "parseForStatement",
+        "for (int i = 0, j = count; i < j; i++, j--) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6175,7 +8339,8 @@
   }
 
   void test_parseForStatement_loop_iu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;; i++) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (var i = 0;; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6191,7 +8356,8 @@
   }
 
   void test_parseForStatement_loop_u() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;; i++) {}");
+    ForStatement statement =
+        ParserTestCase.parse4("parseForStatement", "for (;; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -6205,7 +8371,8 @@
   }
 
   void test_parseFunctionBody_block() {
-    BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "{}");
+    BlockFunctionBody functionBody =
+        ParserTestCase.parse("parseFunctionBody", <Object>[false, null, false], "{}");
     expect(functionBody.keyword, isNull);
     expect(functionBody.star, isNull);
     expect(functionBody.block, isNotNull);
@@ -6215,7 +8382,10 @@
   }
 
   void test_parseFunctionBody_block_async() {
-    BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "async {}");
+    BlockFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "async {}");
     expect(functionBody.keyword, isNotNull);
     expect(functionBody.keyword.lexeme, Parser.ASYNC);
     expect(functionBody.star, isNull);
@@ -6226,7 +8396,10 @@
   }
 
   void test_parseFunctionBody_block_asyncGenerator() {
-    BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "async* {}");
+    BlockFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "async* {}");
     expect(functionBody.keyword, isNotNull);
     expect(functionBody.keyword.lexeme, Parser.ASYNC);
     expect(functionBody.star, isNotNull);
@@ -6237,7 +8410,10 @@
   }
 
   void test_parseFunctionBody_block_syncGenerator() {
-    BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "sync* {}");
+    BlockFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "sync* {}");
     expect(functionBody.keyword, isNotNull);
     expect(functionBody.keyword.lexeme, Parser.SYNC);
     expect(functionBody.star, isNotNull);
@@ -6248,12 +8424,16 @@
   }
 
   void test_parseFunctionBody_empty() {
-    EmptyFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [true, null, false], ";");
+    EmptyFunctionBody functionBody =
+        ParserTestCase.parse("parseFunctionBody", <Object>[true, null, false], ";");
     expect(functionBody.semicolon, isNotNull);
   }
 
   void test_parseFunctionBody_expression() {
-    ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "=> y;");
+    ExpressionFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "=> y;");
     expect(functionBody.keyword, isNull);
     expect(functionBody.functionDefinition, isNotNull);
     expect(functionBody.expression, isNotNull);
@@ -6264,7 +8444,10 @@
   }
 
   void test_parseFunctionBody_expression_async() {
-    ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "async => y;");
+    ExpressionFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "async => y;");
     expect(functionBody.keyword, isNotNull);
     expect(functionBody.keyword.lexeme, Parser.ASYNC);
     expect(functionBody.functionDefinition, isNotNull);
@@ -6276,7 +8459,10 @@
   }
 
   void test_parseFunctionBody_nativeFunctionBody() {
-    NativeFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "native 'str';");
+    NativeFunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "native 'str';");
     expect(functionBody.nativeToken, isNotNull);
     expect(functionBody.stringLiteral, isNotNull);
     expect(functionBody.semicolon, isNotNull);
@@ -6284,32 +8470,58 @@
 
   void test_parseFunctionBody_skip_block() {
     ParserTestCase.parseFunctionBodies = false;
-    FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "{}");
-    EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunctionBody, functionBody);
+    FunctionBody functionBody =
+        ParserTestCase.parse("parseFunctionBody", <Object>[false, null, false], "{}");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is EmptyFunctionBody,
+        EmptyFunctionBody,
+        functionBody);
   }
 
   void test_parseFunctionBody_skip_block_invalid() {
     ParserTestCase.parseFunctionBodies = false;
-    FunctionBody functionBody = ParserTestCase.parse3("parseFunctionBody", <Object> [false, null, false], "{", [ParserErrorCode.EXPECTED_TOKEN]);
-    EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunctionBody, functionBody);
+    FunctionBody functionBody = ParserTestCase.parse3(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "{",
+        [ParserErrorCode.EXPECTED_TOKEN]);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is EmptyFunctionBody,
+        EmptyFunctionBody,
+        functionBody);
   }
 
   void test_parseFunctionBody_skip_blocks() {
     ParserTestCase.parseFunctionBodies = false;
-    FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "{ {} }");
-    EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunctionBody, functionBody);
+    FunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "{ {} }");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is EmptyFunctionBody,
+        EmptyFunctionBody,
+        functionBody);
   }
 
   void test_parseFunctionBody_skip_expression() {
     ParserTestCase.parseFunctionBodies = false;
-    FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "=> y;");
-    EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunctionBody, functionBody);
+    FunctionBody functionBody = ParserTestCase.parse(
+        "parseFunctionBody",
+        <Object>[false, null, false],
+        "=> y;");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is EmptyFunctionBody,
+        EmptyFunctionBody,
+        functionBody);
   }
 
   void test_parseFunctionDeclaration_function() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "f() {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseFunctionDeclaration",
+        <Object>[commentAndMetadata(comment), null, returnType],
+        "f() {}");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6323,7 +8535,10 @@
   void test_parseFunctionDeclaration_getter() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "get p => 0;");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseFunctionDeclaration",
+        <Object>[commentAndMetadata(comment), null, returnType],
+        "get p => 0;");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6337,7 +8552,10 @@
   void test_parseFunctionDeclaration_setter() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "set p(v) {}");
+    FunctionDeclaration declaration = ParserTestCase.parse(
+        "parseFunctionDeclaration",
+        <Object>[commentAndMetadata(comment), null, returnType],
+        "set p(v) {}");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6349,12 +8567,15 @@
   }
 
   void test_parseFunctionDeclarationStatement() {
-    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseFunctionDeclarationStatement", "void f(int p) => p * 2;");
+    FunctionDeclarationStatement statement = ParserTestCase.parse4(
+        "parseFunctionDeclarationStatement",
+        "void f(int p) => p * 2;");
     expect(statement.functionDeclaration, isNotNull);
   }
 
   void test_parseFunctionExpression_body_inExpression() {
-    FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpression", "(int i) => i++");
+    FunctionExpression expression =
+        ParserTestCase.parse4("parseFunctionExpression", "(int i) => i++");
     expect(expression.body, isNotNull);
     expect(expression.parameters, isNotNull);
     expect((expression.body as ExpressionFunctionBody).semicolon, isNull);
@@ -6363,7 +8584,10 @@
   void test_parseGetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [commentAndMetadata(comment), null, null, returnType], "get a;");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseGetter",
+        <Object>[commentAndMetadata(comment), null, null, returnType],
+        "get a;");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -6379,11 +8603,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [
-        commentAndMetadata(comment),
-        null,
-        staticKeyword,
-        returnType], "get a => 42;");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseGetter",
+        <Object>[commentAndMetadata(comment), null, staticKeyword, returnType],
+        "get a => 42;");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -6396,17 +8619,20 @@
   }
 
   void test_parseIdentifierList_multiple() {
-    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a, b, c");
+    List<SimpleIdentifier> list =
+        ParserTestCase.parse4("parseIdentifierList", "a, b, c");
     expect(list, hasLength(3));
   }
 
   void test_parseIdentifierList_single() {
-    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a");
+    List<SimpleIdentifier> list =
+        ParserTestCase.parse4("parseIdentifierList", "a");
     expect(list, hasLength(1));
   }
 
   void test_parseIfStatement_else_block() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {} else {}");
+    IfStatement statement =
+        ParserTestCase.parse4("parseIfStatement", "if (x) {} else {}");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6417,7 +8643,8 @@
   }
 
   void test_parseIfStatement_else_statement() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x); else f(y);");
+    IfStatement statement =
+        ParserTestCase.parse4("parseIfStatement", "if (x) f(x); else f(y);");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6428,7 +8655,8 @@
   }
 
   void test_parseIfStatement_noElse_block() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {}");
+    IfStatement statement =
+        ParserTestCase.parse4("parseIfStatement", "if (x) {}");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6439,7 +8667,8 @@
   }
 
   void test_parseIfStatement_noElse_statement() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x);");
+    IfStatement statement =
+        ParserTestCase.parse4("parseIfStatement", "if (x) f(x);");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6450,19 +8679,24 @@
   }
 
   void test_parseImplementsClause_multiple() {
-    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A, B, C");
+    ImplementsClause clause =
+        ParserTestCase.parse4("parseImplementsClause", "implements A, B, C");
     expect(clause.interfaces, hasLength(3));
     expect(clause.keyword, isNotNull);
   }
 
   void test_parseImplementsClause_single() {
-    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A");
+    ImplementsClause clause =
+        ParserTestCase.parse4("parseImplementsClause", "implements A");
     expect(clause.interfaces, hasLength(1));
     expect(clause.keyword, isNotNull);
   }
 
   void test_parseImportDirective_deferred() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' deferred as a;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' deferred as a;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNotNull);
@@ -6473,7 +8707,10 @@
   }
 
   void test_parseImportDirective_hide() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' hide A, B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6484,7 +8721,10 @@
   }
 
   void test_parseImportDirective_noCombinator() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart';");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart';");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6495,7 +8735,10 @@
   }
 
   void test_parseImportDirective_prefix() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' as a;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6506,7 +8749,10 @@
   }
 
   void test_parseImportDirective_prefix_hide_show() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a hide A show B;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' as a hide A show B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6517,7 +8763,10 @@
   }
 
   void test_parseImportDirective_prefix_show_hide() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a show B hide A;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' as a show B hide A;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6528,7 +8777,10 @@
   }
 
   void test_parseImportDirective_show() {
-    ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart' show A, B;");
+    ImportDirective directive = ParserTestCase.parse(
+        "parseImportDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "import 'lib/lib.dart' show A, B;");
     expect(directive.keyword, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.deferredToken, isNull);
@@ -6542,11 +8794,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName type = new TypeName(new SimpleIdentifier(null), null);
-    FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [
-        commentAndMetadata(comment),
-        staticKeyword,
-        null,
-        type], "a = 1, b, c = 3;");
+    FieldDeclaration declaration = ParserTestCase.parse(
+        "parseInitializedIdentifierList",
+        <Object>[commentAndMetadata(comment), staticKeyword, null, type],
+        "a = 1, b, c = 3;");
     expect(declaration.documentationComment, comment);
     VariableDeclarationList fields = declaration.fields;
     expect(fields, isNotNull);
@@ -6561,11 +8812,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     Token varKeyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
-    FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [
-        commentAndMetadata(comment),
-        staticKeyword,
-        varKeyword,
-        null], "a = 1, b, c = 3;");
+    FieldDeclaration declaration = ParserTestCase.parse(
+        "parseInitializedIdentifierList",
+        <Object>[commentAndMetadata(comment), staticKeyword, varKeyword, null],
+        "a = 1, b, c = 3;");
     expect(declaration.documentationComment, comment);
     VariableDeclarationList fields = declaration.fields;
     expect(fields, isNotNull);
@@ -6578,7 +8828,10 @@
 
   void test_parseInstanceCreationExpression_qualifiedType() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token], "A.B()");
+    InstanceCreationExpression expression = ParserTestCase.parse(
+        "parseInstanceCreationExpression",
+        <Object>[token],
+        "A.B()");
     expect(expression.keyword, token);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6590,7 +8843,10 @@
 
   void test_parseInstanceCreationExpression_qualifiedType_named() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token], "A.B.c()");
+    InstanceCreationExpression expression = ParserTestCase.parse(
+        "parseInstanceCreationExpression",
+        <Object>[token],
+        "A.B.c()");
     expect(expression.keyword, token);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6602,7 +8858,10 @@
 
   void test_parseInstanceCreationExpression_type() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token], "A()");
+    InstanceCreationExpression expression = ParserTestCase.parse(
+        "parseInstanceCreationExpression",
+        <Object>[token],
+        "A()");
     expect(expression.keyword, token);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6614,7 +8873,10 @@
 
   void test_parseInstanceCreationExpression_type_named() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.NEW);
-    InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceCreationExpression", <Object> [token], "A<B>.c()");
+    InstanceCreationExpression expression = ParserTestCase.parse(
+        "parseInstanceCreationExpression",
+        <Object>[token],
+        "A<B>.c()");
     expect(expression.keyword, token);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6625,7 +8887,10 @@
   }
 
   void test_parseLibraryDirective() {
-    LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <Object> [emptyCommentAndMetadata()], "library l;");
+    LibraryDirective directive = ParserTestCase.parse(
+        "parseLibraryDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "library l;");
     expect(directive.libraryToken, isNotNull);
     expect(directive.name, isNotNull);
     expect(directive.semicolon, isNotNull);
@@ -6633,20 +8898,23 @@
 
   void test_parseLibraryIdentifier_multiple() {
     String name = "a.b.c";
-    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name);
+    LibraryIdentifier identifier =
+        ParserTestCase.parse4("parseLibraryIdentifier", name);
     expect(identifier.name, name);
   }
 
   void test_parseLibraryIdentifier_single() {
     String name = "a";
-    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name);
+    LibraryIdentifier identifier =
+        ParserTestCase.parse4("parseLibraryIdentifier", name);
     expect(identifier.name, name);
   }
 
   void test_parseListLiteral_empty_oneToken() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CONST);
     TypeArgumentList typeArguments = null;
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token, typeArguments], "[]");
+    ListLiteral literal =
+        ParserTestCase.parse("parseListLiteral", <Object>[token, typeArguments], "[]");
     expect(literal.constKeyword, token);
     expect(literal.typeArguments, typeArguments);
     expect(literal.leftBracket, isNotNull);
@@ -6657,7 +8925,10 @@
   void test_parseListLiteral_empty_twoTokens() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CONST);
     TypeArgumentList typeArguments = null;
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [token, typeArguments], "[ ]");
+    ListLiteral literal = ParserTestCase.parse(
+        "parseListLiteral",
+        <Object>[token, typeArguments],
+        "[ ]");
     expect(literal.constKeyword, token);
     expect(literal.typeArguments, typeArguments);
     expect(literal.leftBracket, isNotNull);
@@ -6666,7 +8937,8 @@
   }
 
   void test_parseListLiteral_multiple() {
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [null, null], "[1, 2, 3]");
+    ListLiteral literal =
+        ParserTestCase.parse("parseListLiteral", <Object>[null, null], "[1, 2, 3]");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -6675,7 +8947,8 @@
   }
 
   void test_parseListLiteral_single() {
-    ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [null, null], "[1]");
+    ListLiteral literal =
+        ParserTestCase.parse("parseListLiteral", <Object>[null, null], "[1]");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -6684,7 +8957,8 @@
   }
 
   void test_parseListOrMapLiteral_list_noType() {
-    ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "[1]");
+    ListLiteral literal =
+        ParserTestCase.parse("parseListOrMapLiteral", <Object>[null], "[1]");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -6693,7 +8967,8 @@
   }
 
   void test_parseListOrMapLiteral_list_type() {
-    ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<int> [1]");
+    ListLiteral literal =
+        ParserTestCase.parse("parseListOrMapLiteral", <Object>[null], "<int> [1]");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNotNull);
     expect(literal.leftBracket, isNotNull);
@@ -6702,7 +8977,8 @@
   }
 
   void test_parseListOrMapLiteral_map_noType() {
-    MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "{'1' : 1}");
+    MapLiteral literal =
+        ParserTestCase.parse("parseListOrMapLiteral", <Object>[null], "{'1' : 1}");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -6711,7 +8987,10 @@
   }
 
   void test_parseListOrMapLiteral_map_type() {
-    MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<String, int> {'1' : 1}");
+    MapLiteral literal = ParserTestCase.parse(
+        "parseListOrMapLiteral",
+        <Object>[null],
+        "<String, int> {'1' : 1}");
     expect(literal.constKeyword, isNull);
     expect(literal.typeArguments, isNotNull);
     expect(literal.leftBracket, isNotNull);
@@ -6720,7 +8999,8 @@
   }
 
   void test_parseLogicalAndExpression() {
-    BinaryExpression expression = ParserTestCase.parse4("parseLogicalAndExpression", "x && y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseLogicalAndExpression", "x && y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND_AMPERSAND);
@@ -6728,7 +9008,8 @@
   }
 
   void test_parseLogicalOrExpression() {
-    BinaryExpression expression = ParserTestCase.parse4("parseLogicalOrExpression", "x || y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseLogicalOrExpression", "x || y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR_BAR);
@@ -6737,10 +9018,10 @@
 
   void test_parseMapLiteral_empty() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CONST);
-    TypeArgumentList typeArguments = AstFactory.typeArgumentList([
-        AstFactory.typeName4("String"),
-        AstFactory.typeName4("int")]);
-    MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token, typeArguments], "{}");
+    TypeArgumentList typeArguments = AstFactory.typeArgumentList(
+        [AstFactory.typeName4("String"), AstFactory.typeName4("int")]);
+    MapLiteral literal =
+        ParserTestCase.parse("parseMapLiteral", <Object>[token, typeArguments], "{}");
     expect(literal.constKeyword, token);
     expect(literal.typeArguments, typeArguments);
     expect(literal.leftBracket, isNotNull);
@@ -6749,35 +9030,42 @@
   }
 
   void test_parseMapLiteral_multiple() {
-    MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'a' : b, 'x' : y}");
+    MapLiteral literal = ParserTestCase.parse(
+        "parseMapLiteral",
+        <Object>[null, null],
+        "{'a' : b, 'x' : y}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(2));
     expect(literal.rightBracket, isNotNull);
   }
 
   void test_parseMapLiteral_single() {
-    MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}");
+    MapLiteral literal =
+        ParserTestCase.parse("parseMapLiteral", <Object>[null, null], "{'x' : y}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(1));
     expect(literal.rightBracket, isNotNull);
   }
 
   void test_parseMapLiteralEntry_complex() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "2 + 2 : y");
+    MapLiteralEntry entry =
+        ParserTestCase.parse4("parseMapLiteralEntry", "2 + 2 : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
   }
 
   void test_parseMapLiteralEntry_int() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "0 : y");
+    MapLiteralEntry entry =
+        ParserTestCase.parse4("parseMapLiteralEntry", "0 : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
   }
 
   void test_parseMapLiteralEntry_string() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "'x' : y");
+    MapLiteralEntry entry =
+        ParserTestCase.parse4("parseMapLiteralEntry", "'x' : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
@@ -6819,7 +9107,8 @@
   }
 
   void test_parseMultiplicativeExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "x * y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseMultiplicativeExpression", "x * y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.STAR);
@@ -6827,15 +9116,20 @@
   }
 
   void test_parseMultiplicativeExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "super * y");
-    EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseMultiplicativeExpression", "super * y");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is SuperExpression,
+        SuperExpression,
+        expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.STAR);
     expect(expression.rightOperand, isNotNull);
   }
 
   void test_parseNewExpression() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parseNewExpression", "new A()");
+    InstanceCreationExpression expression =
+        ParserTestCase.parse4("parseNewExpression", "new A()");
     expect(expression.keyword, isNotNull);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6846,43 +9140,51 @@
   }
 
   void test_parseNonLabeledStatement_const_list_empty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [];");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const [];");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_list_nonEmpty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [1, 2];");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const [1, 2];");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_map_empty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {};");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const {};");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_map_nonEmpty() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {'a' : 1};");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const {'a' : 1};");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_object() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A();");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const A();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_object_named_typeParameters() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A<B>.c();");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "const A<B>.c();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_constructorInvocation() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "new C().m();");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "new C().m();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_false() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "false;");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "false;");
     expect(statement.expression, isNotNull);
   }
 
@@ -6899,15 +9201,24 @@
   }
 
   void test_parseNonLabeledStatement_functionInvocation() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "f();");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "f();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_invokeFunctionExpression() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "(a) {return a + a;} (3);");
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpressionInvocation, FunctionExpressionInvocation, statement.expression);
-    FunctionExpressionInvocation invocation = statement.expression as FunctionExpressionInvocation;
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression, FunctionExpression, invocation.function);
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "(a) {return a + a;} (3);");
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionExpressionInvocation,
+        FunctionExpressionInvocation,
+        statement.expression);
+    FunctionExpressionInvocation invocation =
+        statement.expression as FunctionExpressionInvocation;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionExpression,
+        FunctionExpression,
+        invocation.function);
     FunctionExpression expression = invocation.function as FunctionExpression;
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
@@ -6917,27 +9228,32 @@
   }
 
   void test_parseNonLabeledStatement_null() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "null;");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "null;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "library.getName();");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "library.getName();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_true() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "true;");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "true;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_typeCast() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "double.NAN as num;");
+    ExpressionStatement statement =
+        ParserTestCase.parse4("parseNonLabeledStatement", "double.NAN as num;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNormalFormalParameter_field_const_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "const this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6945,7 +9261,8 @@
   }
 
   void test_parseNormalFormalParameter_field_const_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "const A this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6953,7 +9270,8 @@
   }
 
   void test_parseNormalFormalParameter_field_final_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "final this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6961,7 +9279,8 @@
   }
 
   void test_parseNormalFormalParameter_field_final_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "final A this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6969,7 +9288,8 @@
   }
 
   void test_parseNormalFormalParameter_field_function_nested() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a(B b))");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "this.a(B b))");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6979,7 +9299,8 @@
   }
 
   void test_parseNormalFormalParameter_field_function_noNested() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a())");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "this.a())");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6989,7 +9310,8 @@
   }
 
   void test_parseNormalFormalParameter_field_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "this.a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6997,7 +9319,8 @@
   }
 
   void test_parseNormalFormalParameter_field_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "A this.a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -7005,7 +9328,8 @@
   }
 
   void test_parseNormalFormalParameter_field_var() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "var this.a)");
+    FieldFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "var this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -7013,63 +9337,72 @@
   }
 
   void test_parseNormalFormalParameter_function_noType() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a())");
+    FunctionTypedFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "a())");
     expect(parameter.returnType, isNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_function_type() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a())");
+    FunctionTypedFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "A a())");
     expect(parameter.returnType, isNotNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_function_void() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "void a())");
+    FunctionTypedFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "void a())");
     expect(parameter.returnType, isNotNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_const_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "const a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_const_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "const A a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_final_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "final a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_final_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "final A a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a)");
+    SimpleFormalParameter parameter =
+        ParserTestCase.parse4("parseNormalFormalParameter", "A a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -7078,7 +9411,10 @@
   void test_parseOperator() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [commentAndMetadata(comment), null, returnType], "operator +(A a);");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseOperator",
+        <Object>[commentAndMetadata(comment), null, returnType],
+        "operator +(A a);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -7095,14 +9431,20 @@
   }
 
   void test_parsePartDirective_part() {
-    PartDirective directive = ParserTestCase.parse("parsePartDirective", <Object> [emptyCommentAndMetadata()], "part 'lib/lib.dart';");
+    PartDirective directive = ParserTestCase.parse(
+        "parsePartDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "part 'lib/lib.dart';");
     expect(directive.partToken, isNotNull);
     expect(directive.uri, isNotNull);
     expect(directive.semicolon, isNotNull);
   }
 
   void test_parsePartDirective_partOf() {
-    PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Object> [emptyCommentAndMetadata()], "part of l;");
+    PartOfDirective directive = ParserTestCase.parse(
+        "parsePartDirective",
+        <Object>[emptyCommentAndMetadata()],
+        "part of l;");
     expect(directive.partToken, isNotNull);
     expect(directive.ofToken, isNotNull);
     expect(directive.libraryName, isNotNull);
@@ -7110,104 +9452,120 @@
   }
 
   void test_parsePostfixExpression_decrement() {
-    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i--");
+    PostfixExpression expression =
+        ParserTestCase.parse4("parsePostfixExpression", "i--");
     expect(expression.operand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
   }
 
   void test_parsePostfixExpression_increment() {
-    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i++");
+    PostfixExpression expression =
+        ParserTestCase.parse4("parsePostfixExpression", "i++");
     expect(expression.operand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
   }
 
   void test_parsePostfixExpression_none_indexExpression() {
-    IndexExpression expression = ParserTestCase.parse4("parsePostfixExpression", "a[0]");
+    IndexExpression expression =
+        ParserTestCase.parse4("parsePostfixExpression", "a[0]");
     expect(expression.target, isNotNull);
     expect(expression.index, isNotNull);
   }
 
   void test_parsePostfixExpression_none_methodInvocation() {
-    MethodInvocation expression = ParserTestCase.parse4("parsePostfixExpression", "a.m()");
+    MethodInvocation expression =
+        ParserTestCase.parse4("parsePostfixExpression", "a.m()");
     expect(expression.target, isNotNull);
     expect(expression.methodName, isNotNull);
     expect(expression.argumentList, isNotNull);
   }
 
   void test_parsePostfixExpression_none_propertyAccess() {
-    PrefixedIdentifier expression = ParserTestCase.parse4("parsePostfixExpression", "a.b");
+    PrefixedIdentifier expression =
+        ParserTestCase.parse4("parsePostfixExpression", "a.b");
     expect(expression.prefix, isNotNull);
     expect(expression.identifier, isNotNull);
   }
 
   void test_parsePrefixedIdentifier_noPrefix() {
     String lexeme = "bar";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
+    SimpleIdentifier identifier =
+        ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
 
   void test_parsePrefixedIdentifier_prefix() {
     String lexeme = "foo.bar";
-    PrefixedIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
+    PrefixedIdentifier identifier =
+        ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
     expect(identifier.prefix.name, "foo");
     expect(identifier.period, isNotNull);
     expect(identifier.identifier.name, "bar");
   }
 
   void test_parsePrimaryExpression_const() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "const A()");
+    InstanceCreationExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "const A()");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_double() {
     String doubleLiteral = "3.2e4";
-    DoubleLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", doubleLiteral);
+    DoubleLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", doubleLiteral);
     expect(literal.literal, isNotNull);
     expect(literal.value, double.parse(doubleLiteral));
   }
 
   void test_parsePrimaryExpression_false() {
-    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "false");
+    BooleanLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "false");
     expect(literal.literal, isNotNull);
     expect(literal.value, isFalse);
   }
 
   void test_parsePrimaryExpression_function_arguments() {
-    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(int i) => i + 1");
+    FunctionExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "(int i) => i + 1");
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
   }
 
   void test_parsePrimaryExpression_function_noArguments() {
-    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "() => 42");
+    FunctionExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "() => 42");
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
   }
 
   void test_parsePrimaryExpression_hex() {
     String hexLiteral = "3F";
-    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "0x$hexLiteral");
+    IntegerLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "0x$hexLiteral");
     expect(literal.literal, isNotNull);
     expect(literal.value, int.parse(hexLiteral, radix: 16));
   }
 
   void test_parsePrimaryExpression_identifier() {
-    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrimaryExpression", "a");
+    SimpleIdentifier identifier =
+        ParserTestCase.parse4("parsePrimaryExpression", "a");
     expect(identifier, isNotNull);
   }
 
   void test_parsePrimaryExpression_int() {
     String intLiteral = "472";
-    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", intLiteral);
+    IntegerLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", intLiteral);
     expect(literal.literal, isNotNull);
     expect(literal.value, int.parse(intLiteral));
   }
 
   void test_parsePrimaryExpression_listLiteral() {
-    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[ ]");
+    ListLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "[ ]");
     expect(literal, isNotNull);
   }
 
@@ -7217,7 +9575,8 @@
   }
 
   void test_parsePrimaryExpression_listLiteral_typed() {
-    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>[ ]");
+    ListLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "<A>[ ]");
     expect(literal.typeArguments, isNotNull);
     expect(literal.typeArguments.arguments, hasLength(1));
   }
@@ -7228,49 +9587,57 @@
   }
 
   void test_parsePrimaryExpression_mapLiteral_typed() {
-    MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A, B>{}");
+    MapLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "<A, B>{}");
     expect(literal.typeArguments, isNotNull);
     expect(literal.typeArguments.arguments, hasLength(2));
   }
 
   void test_parsePrimaryExpression_new() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "new A()");
+    InstanceCreationExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "new A()");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_null() {
-    NullLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "null");
+    NullLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "null");
     expect(literal.literal, isNotNull);
   }
 
   void test_parsePrimaryExpression_parenthesized() {
-    ParenthesizedExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(x)");
+    ParenthesizedExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "(x)");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_string() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "\"string\"");
+    SimpleStringLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "\"string\"");
     expect(literal.isMultiline, isFalse);
     expect(literal.isRaw, isFalse);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_string_multiline() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "'''string'''");
+    SimpleStringLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "'''string'''");
     expect(literal.isMultiline, isTrue);
     expect(literal.isRaw, isFalse);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_string_raw() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "r'string'");
+    SimpleStringLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "r'string'");
     expect(literal.isMultiline, isFalse);
     expect(literal.isRaw, isTrue);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_super() {
-    PropertyAccess propertyAccess = ParserTestCase.parse4("parsePrimaryExpression", "super.x");
+    PropertyAccess propertyAccess =
+        ParserTestCase.parse4("parsePrimaryExpression", "super.x");
     expect(propertyAccess.target is SuperExpression, isTrue);
     expect(propertyAccess.operator, isNotNull);
     expect(propertyAccess.operator.type, TokenType.PERIOD);
@@ -7278,12 +9645,14 @@
   }
 
   void test_parsePrimaryExpression_this() {
-    ThisExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "this");
+    ThisExpression expression =
+        ParserTestCase.parse4("parsePrimaryExpression", "this");
     expect(expression.keyword, isNotNull);
   }
 
   void test_parsePrimaryExpression_true() {
-    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "true");
+    BooleanLiteral literal =
+        ParserTestCase.parse4("parsePrimaryExpression", "true");
     expect(literal.literal, isNotNull);
     expect(literal.value, isTrue);
   }
@@ -7293,7 +9662,8 @@
   }
 
   void test_parseRedirectingConstructorInvocation_named() {
-    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this.a()");
+    RedirectingConstructorInvocation invocation =
+        ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this.a()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNotNull);
     expect(invocation.keyword, isNotNull);
@@ -7301,7 +9671,8 @@
   }
 
   void test_parseRedirectingConstructorInvocation_unnamed() {
-    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this()");
+    RedirectingConstructorInvocation invocation =
+        ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNull);
     expect(invocation.keyword, isNotNull);
@@ -7309,14 +9680,16 @@
   }
 
   void test_parseRelationalExpression_as() {
-    AsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x as Y");
+    AsExpression expression =
+        ParserTestCase.parse4("parseRelationalExpression", "x as Y");
     expect(expression.expression, isNotNull);
     expect(expression.asOperator, isNotNull);
     expect(expression.type, isNotNull);
   }
 
   void test_parseRelationalExpression_is() {
-    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is y");
+    IsExpression expression =
+        ParserTestCase.parse4("parseRelationalExpression", "x is y");
     expect(expression.expression, isNotNull);
     expect(expression.isOperator, isNotNull);
     expect(expression.notOperator, isNull);
@@ -7324,7 +9697,8 @@
   }
 
   void test_parseRelationalExpression_isNot() {
-    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is! y");
+    IsExpression expression =
+        ParserTestCase.parse4("parseRelationalExpression", "x is! y");
     expect(expression.expression, isNotNull);
     expect(expression.isOperator, isNotNull);
     expect(expression.notOperator, isNotNull);
@@ -7332,7 +9706,8 @@
   }
 
   void test_parseRelationalExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x < y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseRelationalExpression", "x < y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT);
@@ -7340,7 +9715,8 @@
   }
 
   void test_parseRelationalExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "super < y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseRelationalExpression", "super < y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT);
@@ -7348,19 +9724,22 @@
   }
 
   void test_parseRethrowExpression() {
-    RethrowExpression expression = ParserTestCase.parse4("parseRethrowExpression", "rethrow;");
+    RethrowExpression expression =
+        ParserTestCase.parse4("parseRethrowExpression", "rethrow;");
     expect(expression.keyword, isNotNull);
   }
 
   void test_parseReturnStatement_noValue() {
-    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return;");
+    ReturnStatement statement =
+        ParserTestCase.parse4("parseReturnStatement", "return;");
     expect(statement.keyword, isNotNull);
     expect(statement.expression, isNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseReturnStatement_value() {
-    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return x;");
+    ReturnStatement statement =
+        ParserTestCase.parse4("parseReturnStatement", "return x;");
     expect(statement.keyword, isNotNull);
     expect(statement.expression, isNotNull);
     expect(statement.semicolon, isNotNull);
@@ -7381,7 +9760,10 @@
   void test_parseSetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [commentAndMetadata(comment), null, null, returnType], "set a(var x);");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseSetter",
+        <Object>[commentAndMetadata(comment), null, null, returnType],
+        "set a(var x);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -7397,11 +9779,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [
-        commentAndMetadata(comment),
-        null,
-        staticKeyword,
-        returnType], "set a(var x) {}");
+    MethodDeclaration method = ParserTestCase.parse(
+        "parseSetter",
+        <Object>[commentAndMetadata(comment), null, staticKeyword, returnType],
+        "set a(var x) {}");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -7414,7 +9795,8 @@
   }
 
   void test_parseShiftExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "x << y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseShiftExpression", "x << y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT_LT);
@@ -7422,39 +9804,44 @@
   }
 
   void test_parseShiftExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "super << y");
+    BinaryExpression expression =
+        ParserTestCase.parse4("parseShiftExpression", "super << y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT_LT);
     expect(expression.rightOperand, isNotNull);
   }
 
+  void test_parseSimpleIdentifier1_normalIdentifier() {
+    // TODO(brianwilkerson) Implement tests for this method.
+  }
+
   void test_parseSimpleIdentifier_builtInIdentifier() {
     String lexeme = "as";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
+    SimpleIdentifier identifier =
+        ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
 
   void test_parseSimpleIdentifier_normalIdentifier() {
     String lexeme = "foo";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
+    SimpleIdentifier identifier =
+        ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
 
-  void test_parseSimpleIdentifier1_normalIdentifier() {
-    // TODO(brianwilkerson) Implement tests for this method.
-  }
-
   void test_parseStatement_functionDeclaration() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseStatement", "int f(a, b) {};");
+    FunctionDeclarationStatement statement =
+        ParserTestCase.parse4("parseStatement", "int f(a, b) {};");
     expect(statement.functionDeclaration, isNotNull);
   }
 
   void test_parseStatement_mulipleLabels() {
-    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: m: return x;");
+    LabeledStatement statement =
+        ParserTestCase.parse4("parseStatement", "l: m: return x;");
     expect(statement.labels, hasLength(2));
     expect(statement.statement, isNotNull);
   }
@@ -7464,13 +9851,15 @@
   }
 
   void test_parseStatement_singleLabel() {
-    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: return x;");
+    LabeledStatement statement =
+        ParserTestCase.parse4("parseStatement", "l: return x;");
     expect(statement.labels, hasLength(1));
     expect(statement.statement, isNotNull);
   }
 
   void test_parseStatements_multiple() {
-    List<Statement> statements = ParserTestCase.parseStatements("return; return;", 2);
+    List<Statement> statements =
+        ParserTestCase.parseStatements("return; return;", 2);
     expect(statements, hasLength(2));
   }
 
@@ -7480,7 +9869,8 @@
   }
 
   void test_parseStringLiteral_adjacent() {
-    AdjacentStrings literal = ParserTestCase.parse4("parseStringLiteral", "'a' 'b'");
+    AdjacentStrings literal =
+        ParserTestCase.parse4("parseStringLiteral", "'a' 'b'");
     NodeList<StringLiteral> strings = literal.strings;
     expect(strings, hasLength(2));
     StringLiteral firstString = strings[0];
@@ -7490,7 +9880,8 @@
   }
 
   void test_parseStringLiteral_interpolated() {
-    StringInterpolation literal = ParserTestCase.parse4("parseStringLiteral", "'a \${b} c \$this d'");
+    StringInterpolation literal =
+        ParserTestCase.parse4("parseStringLiteral", "'a \${b} c \$this d'");
     NodeList<InterpolationElement> elements = literal.elements;
     expect(elements, hasLength(5));
     expect(elements[0] is InterpolationString, isTrue);
@@ -7501,13 +9892,15 @@
   }
 
   void test_parseStringLiteral_single() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parseStringLiteral", "'a'");
+    SimpleStringLiteral literal =
+        ParserTestCase.parse4("parseStringLiteral", "'a'");
     expect(literal.literal, isNotNull);
     expect(literal.value, "a");
   }
 
   void test_parseSuperConstructorInvocation_named() {
-    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super.a()");
+    SuperConstructorInvocation invocation =
+        ParserTestCase.parse4("parseSuperConstructorInvocation", "super.a()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNotNull);
     expect(invocation.keyword, isNotNull);
@@ -7515,7 +9908,8 @@
   }
 
   void test_parseSuperConstructorInvocation_unnamed() {
-    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super()");
+    SuperConstructorInvocation invocation =
+        ParserTestCase.parse4("parseSuperConstructorInvocation", "super()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNull);
     expect(invocation.keyword, isNotNull);
@@ -7523,7 +9917,9 @@
   }
 
   void test_parseSwitchStatement_case() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 1: return 'I';}");
+    SwitchStatement statement = ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {case 1: return 'I';}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7534,7 +9930,8 @@
   }
 
   void test_parseSwitchStatement_empty() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {}");
+    SwitchStatement statement =
+        ParserTestCase.parse4("parseSwitchStatement", "switch (a) {}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7545,7 +9942,9 @@
   }
 
   void test_parseSwitchStatement_labeledCase() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {l1: l2: l3: case(1):}");
+    SwitchStatement statement = ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {l1: l2: l3: case(1):}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7557,7 +9956,9 @@
   }
 
   void test_parseSwitchStatement_labeledStatementInCase() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 0: f(); l1: g(); break;}");
+    SwitchStatement statement = ParserTestCase.parse4(
+        "parseSwitchStatement",
+        "switch (a) {case 0: f(); l1: g(); break;}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7569,7 +9970,8 @@
   }
 
   void test_parseSymbolLiteral_builtInIdentifier() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#dynamic.static.abstract");
+    SymbolLiteral literal =
+        ParserTestCase.parse4("parseSymbolLiteral", "#dynamic.static.abstract");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(3));
@@ -7579,7 +9981,8 @@
   }
 
   void test_parseSymbolLiteral_multiple() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a.b.c");
+    SymbolLiteral literal =
+        ParserTestCase.parse4("parseSymbolLiteral", "#a.b.c");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(3));
@@ -7605,7 +10008,8 @@
   }
 
   void test_parseSymbolLiteral_void() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#void");
+    SymbolLiteral literal =
+        ParserTestCase.parse4("parseSymbolLiteral", "#void");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(1));
@@ -7613,19 +10017,22 @@
   }
 
   void test_parseThrowExpression() {
-    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpression", "throw x;");
+    ThrowExpression expression =
+        ParserTestCase.parse4("parseThrowExpression", "throw x;");
     expect(expression.keyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
 
   void test_parseThrowExpressionWithoutCascade() {
-    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw x;");
+    ThrowExpression expression =
+        ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw x;");
     expect(expression.keyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
 
   void test_parseTryStatement_catch() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e) {}");
+    TryStatement statement =
+        ParserTestCase.parse4("parseTryStatement", "try {} catch (e) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7643,7 +10050,9 @@
   }
 
   void test_parseTryStatement_catch_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e, s) {} finally {}");
+    TryStatement statement = ParserTestCase.parse4(
+        "parseTryStatement",
+        "try {} catch (e, s) {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7661,7 +10070,8 @@
   }
 
   void test_parseTryStatement_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} finally {}");
+    TryStatement statement =
+        ParserTestCase.parse4("parseTryStatement", "try {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.catchClauses, hasLength(0));
@@ -7670,7 +10080,9 @@
   }
 
   void test_parseTryStatement_multiple() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}");
+    TryStatement statement = ParserTestCase.parse4(
+        "parseTryStatement",
+        "try {} on NPE catch (e) {} on Error {} catch (e) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.catchClauses, hasLength(3));
@@ -7679,7 +10091,8 @@
   }
 
   void test_parseTryStatement_on() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error {}");
+    TryStatement statement =
+        ParserTestCase.parse4("parseTryStatement", "try {} on Error {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7697,7 +10110,8 @@
   }
 
   void test_parseTryStatement_on_catch() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {}");
+    TryStatement statement =
+        ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7715,7 +10129,9 @@
   }
 
   void test_parseTryStatement_on_catch_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {} finally {}");
+    TryStatement statement = ParserTestCase.parse4(
+        "parseTryStatement",
+        "try {} on Error catch (e, s) {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7733,7 +10149,10 @@
   }
 
   void test_parseTypeAlias_function_noParameters() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef bool F();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef bool F();");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7743,7 +10162,10 @@
   }
 
   void test_parseTypeAlias_function_noReturnType() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef F();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef F();");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7753,7 +10175,10 @@
   }
 
   void test_parseTypeAlias_function_parameterizedReturnType() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef A<B> F();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef A<B> F();");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7763,7 +10188,10 @@
   }
 
   void test_parseTypeAlias_function_parameters() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef bool F(Object value);");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef bool F(Object value);");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7773,7 +10201,10 @@
   }
 
   void test_parseTypeAlias_function_typeParameters() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef bool F<E>();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef bool F<E>();");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7783,7 +10214,10 @@
   }
 
   void test_parseTypeAlias_function_voidReturnType() {
-    FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [emptyCommentAndMetadata()], "typedef void F();");
+    FunctionTypeAlias typeAlias = ParserTestCase.parse(
+        "parseTypeAlias",
+        <Object>[emptyCommentAndMetadata()],
+        "typedef void F();");
     expect(typeAlias.keyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.parameters, isNotNull);
@@ -7793,14 +10227,16 @@
   }
 
   void test_parseTypeArgumentList_multiple() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int, int, int>");
+    TypeArgumentList argumentList =
+        ParserTestCase.parse4("parseTypeArgumentList", "<int, int, int>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(3));
     expect(argumentList.rightBracket, isNotNull);
   }
 
   void test_parseTypeArgumentList_nested() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<A<B>>");
+    TypeArgumentList argumentList =
+        ParserTestCase.parse4("parseTypeArgumentList", "<A<B>>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(1));
     TypeName argument = argumentList.arguments[0];
@@ -7812,7 +10248,8 @@
   }
 
   void test_parseTypeArgumentList_single() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int>");
+    TypeArgumentList argumentList =
+        ParserTestCase.parse4("parseTypeArgumentList", "<int>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(1));
     expect(argumentList.rightBracket, isNotNull);
@@ -7831,7 +10268,8 @@
   }
 
   void test_parseTypeParameter_bounded() {
-    TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A extends B");
+    TypeParameter parameter =
+        ParserTestCase.parse4("parseTypeParameter", "A extends B");
     expect(parameter.bound, isNotNull);
     expect(parameter.keyword, isNotNull);
     expect(parameter.name, isNotNull);
@@ -7845,42 +10283,48 @@
   }
 
   void test_parseTypeParameterList_multiple() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A, B extends C, D>");
+    TypeParameterList parameterList =
+        ParserTestCase.parse4("parseTypeParameterList", "<A, B extends C, D>");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(3));
   }
 
   void test_parseTypeParameterList_parameterizedWithTrailingEquals() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A extends B<E>>=");
+    TypeParameterList parameterList =
+        ParserTestCase.parse4("parseTypeParameterList", "<A extends B<E>>=");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseTypeParameterList_single() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>");
+    TypeParameterList parameterList =
+        ParserTestCase.parse4("parseTypeParameterList", "<A>");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseTypeParameterList_withTrailingEquals() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>=");
+    TypeParameterList parameterList =
+        ParserTestCase.parse4("parseTypeParameterList", "<A>=");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseUnaryExpression_decrement_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "--x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_decrement_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "--super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     Expression innerExpression = expression.operand;
@@ -7893,7 +10337,8 @@
   }
 
   void test_parseUnaryExpression_decrement_super_propertyAccess() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super.x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "--super.x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
     expect(expression.operand, isNotNull);
@@ -7903,14 +10348,16 @@
   }
 
   void test_parseUnaryExpression_increment_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "++x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_increment_super_index() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super[0]");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "++super[0]");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
@@ -7920,7 +10367,8 @@
   }
 
   void test_parseUnaryExpression_increment_super_propertyAccess() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super.x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "++super.x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
@@ -7930,112 +10378,144 @@
   }
 
   void test_parseUnaryExpression_minus_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "-x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_minus_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-super");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "-super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_not_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "!x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BANG);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_not_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!super");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "!super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BANG);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_tilda_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~x");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "~x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.TILDE);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_tilda_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~super");
+    PrefixExpression expression =
+        ParserTestCase.parse4("parseUnaryExpression", "~super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.TILDE);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseVariableDeclaration_equals() {
-    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a = b");
+    VariableDeclaration declaration =
+        ParserTestCase.parse4("parseVariableDeclaration", "a = b");
     expect(declaration.name, isNotNull);
     expect(declaration.equals, isNotNull);
     expect(declaration.initializer, isNotNull);
   }
 
   void test_parseVariableDeclaration_noEquals() {
-    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a");
+    VariableDeclaration declaration =
+        ParserTestCase.parse4("parseVariableDeclaration", "a");
     expect(declaration.name, isNotNull);
     expect(declaration.equals, isNull);
     expect(declaration.initializer, isNull);
   }
 
   void test_parseVariableDeclarationListAfterMetadata_const_noType() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "const a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "const a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_const_type() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "const A a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "const A a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_final_noType() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "final a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "final a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_final_type() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "final A a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "final A a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_type_multiple() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "A a, b, c");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "A a, b, c");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(3));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_type_single() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "A a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "A a");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_var_multiple() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "var a, b, c");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "var a, b, c");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(3));
   }
 
   void test_parseVariableDeclarationListAfterMetadata_var_single() {
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterMetadata", <Object> [emptyCommentAndMetadata()], "var a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "var a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
@@ -8043,7 +10523,10 @@
 
   void test_parseVariableDeclarationListAfterType_type() {
     TypeName type = new TypeName(new SimpleIdentifier(null), null);
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterType", <Object> [emptyCommentAndMetadata(), null, type], "a");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterType",
+        <Object>[emptyCommentAndMetadata(), null, type],
+        "a");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, type);
     expect(declarationList.variables, hasLength(1));
@@ -8051,14 +10534,20 @@
 
   void test_parseVariableDeclarationListAfterType_var() {
     Token keyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
-    VariableDeclarationList declarationList = ParserTestCase.parse("parseVariableDeclarationListAfterType", <Object> [emptyCommentAndMetadata(), keyword, null], "a, b, c");
+    VariableDeclarationList declarationList = ParserTestCase.parse(
+        "parseVariableDeclarationListAfterType",
+        <Object>[emptyCommentAndMetadata(), keyword, null],
+        "a, b, c");
     expect(declarationList.keyword, keyword);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(3));
   }
 
   void test_parseVariableDeclarationStatementAfterMetadata_multiple() {
-    VariableDeclarationStatement statement = ParserTestCase.parse("parseVariableDeclarationStatementAfterMetadata", <Object> [emptyCommentAndMetadata()], "var x, y, z;");
+    VariableDeclarationStatement statement = ParserTestCase.parse(
+        "parseVariableDeclarationStatementAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "var x, y, z;");
     expect(statement.semicolon, isNotNull);
     VariableDeclarationList variableList = statement.variables;
     expect(variableList, isNotNull);
@@ -8066,7 +10555,10 @@
   }
 
   void test_parseVariableDeclarationStatementAfterMetadata_single() {
-    VariableDeclarationStatement statement = ParserTestCase.parse("parseVariableDeclarationStatementAfterMetadata", <Object> [emptyCommentAndMetadata()], "var x;");
+    VariableDeclarationStatement statement = ParserTestCase.parse(
+        "parseVariableDeclarationStatementAfterMetadata",
+        <Object>[emptyCommentAndMetadata()],
+        "var x;");
     expect(statement.semicolon, isNotNull);
     VariableDeclarationList variableList = statement.variables;
     expect(variableList, isNotNull);
@@ -8074,7 +10566,8 @@
   }
 
   void test_parseWhileStatement() {
-    WhileStatement statement = ParserTestCase.parse4("parseWhileStatement", "while (x) {}");
+    WhileStatement statement =
+        ParserTestCase.parse4("parseWhileStatement", "while (x) {}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -8083,7 +10576,8 @@
   }
 
   void test_parseWithClause_multiple() {
-    WithClause clause = ParserTestCase.parse4("parseWithClause", "with A, B, C");
+    WithClause clause =
+        ParserTestCase.parse4("parseWithClause", "with A, B, C");
     expect(clause.withKeyword, isNotNull);
     expect(clause.mixinTypes, hasLength(3));
   }
@@ -8095,7 +10589,8 @@
   }
 
   void test_parseYieldStatement_each() {
-    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield* x;");
+    YieldStatement statement =
+        ParserTestCase.parse4("parseYieldStatement", "yield* x;");
     expect(statement.yieldKeyword, isNotNull);
     expect(statement.star, isNotNull);
     expect(statement.expression, isNotNull);
@@ -8103,7 +10598,8 @@
   }
 
   void test_parseYieldStatement_normal() {
-    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield x;");
+    YieldStatement statement =
+        ParserTestCase.parse4("parseYieldStatement", "yield x;");
     expect(statement.yieldKeyword, isNotNull);
     expect(statement.star, isNull);
     expect(statement.expression, isNotNull);
@@ -8228,9 +10724,14 @@
    * @throws Exception if the method could not be invoked or throws an exception
    */
   String _computeStringValue(String lexeme, bool first, bool last) {
-    AnalysisErrorListener listener = new AnalysisErrorListener_SimpleParserTest_computeStringValue();
+    AnalysisErrorListener listener =
+        new AnalysisErrorListener_SimpleParserTest_computeStringValue();
     Parser parser = new Parser(null, listener);
-    return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme, first, last], null) as String;
+    return invokeParserMethodImpl(
+        parser,
+        "computeStringValue",
+        <Object>[lexeme, first, last],
+        null) as String;
   }
 
   /**
@@ -8243,7 +10744,10 @@
    */
   SimpleIdentifier _createSyntheticIdentifier() {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return ParserTestCase.invokeParserMethod2("createSyntheticIdentifier", "", listener);
+    return ParserTestCase.invokeParserMethod2(
+        "createSyntheticIdentifier",
+        "",
+        listener);
   }
 
   /**
@@ -8256,7 +10760,10 @@
    */
   SimpleStringLiteral _createSyntheticStringLiteral() {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return ParserTestCase.invokeParserMethod2("createSyntheticStringLiteral", "", listener);
+    return ParserTestCase.invokeParserMethod2(
+        "createSyntheticStringLiteral",
+        "",
+        listener);
   }
 
   /**
@@ -8269,7 +10776,10 @@
    */
   bool _isFunctionDeclaration(String source) {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return ParserTestCase.invokeParserMethod2("isFunctionDeclaration", source, listener) as bool;
+    return ParserTestCase.invokeParserMethod2(
+        "isFunctionDeclaration",
+        source,
+        listener) as bool;
   }
 
   /**
@@ -8285,13 +10795,18 @@
     //
     // Scan the source.
     //
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
     Token tokenStream = scanner.tokenize();
     //
     // Parse the source.
     //
     Parser parser = new Parser(null, listener);
-    return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [tokenStream], tokenStream) as bool;
+    return invokeParserMethodImpl(
+        parser,
+        "isFunctionExpression",
+        <Object>[tokenStream],
+        tokenStream) as bool;
   }
 
   /**
@@ -8304,7 +10819,10 @@
    */
   bool _isInitializedVariableDeclaration(String source) {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return ParserTestCase.invokeParserMethod2("isInitializedVariableDeclaration", source, listener) as bool;
+    return ParserTestCase.invokeParserMethod2(
+        "isInitializedVariableDeclaration",
+        source,
+        listener) as bool;
   }
 
   /**
@@ -8317,7 +10835,10 @@
    */
   bool _isSwitchMember(String source) {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return ParserTestCase.invokeParserMethod2("isSwitchMember", source, listener) as bool;
+    return ParserTestCase.invokeParserMethod2(
+        "isSwitchMember",
+        source,
+        listener) as bool;
   }
 
   /**
@@ -8329,9 +10850,11 @@
    * @throws Exception if the source could not be parsed, if the compilation errors in the source do
    *           not match those that are expected, or if the result would have been `null`
    */
-  CompilationUnit _parseDirectives(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
+  CompilationUnit _parseDirectives(String source, [List<ErrorCode> errorCodes =
+      ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
     Token token = scanner.tokenize();
     Parser parser = new Parser(null, listener);
@@ -8357,23 +10880,17 @@
     //
     // Scan the source.
     //
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
     Token tokenStream = scanner.tokenize();
     //
     // Parse the source.
     //
     Parser parser = new Parser(null, listener);
-    return invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], tokenStream) as Token;
+    return invokeParserMethodImpl(
+        parser,
+        methodName,
+        <Object>[tokenStream],
+        tokenStream) as Token;
   }
 }
-
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(ComplexParserTest);
-  runReflectiveTests(ErrorParserTest);
-  runReflectiveTests(IncrementalParserTest);
-  runReflectiveTests(NonErrorParserTest);
-  runReflectiveTests(RecoveryParserTest);
-  runReflectiveTests(ResolutionCopierTest);
-  runReflectiveTests(SimpleParserTest);
-}
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 0e5d325..586a823 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -5,30 +5,61 @@
 library engine.resolver_test;
 
 import 'dart:collection';
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/element_resolver.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/java_engine_io.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/element_resolver.dart';
 import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/static_type_analyzer.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
-import 'package:unittest/unittest.dart';
-import 'test_support.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/generated/static_type_analyzer.dart';
 import 'package:analyzer/src/generated/testing/ast_factory.dart';
 import 'package:analyzer/src/generated/testing/element_factory.dart';
-import 'package:analyzer/src/generated/java_io.dart';
-import '../reflective_tests.dart';
-import 'parser_test.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:unittest/unittest.dart';
 
+import '../reflective_tests.dart';
+import 'test_support.dart';
+
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(AnalysisDeltaTest);
+  runReflectiveTests(ChangeSetTest);
+  runReflectiveTests(EnclosedScopeTest);
+  runReflectiveTests(LibraryImportScopeTest);
+  runReflectiveTests(LibraryScopeTest);
+  runReflectiveTests(ScopeTest);
+  runReflectiveTests(ElementResolverTest);
+  runReflectiveTests(InheritanceManagerTest);
+  runReflectiveTests(LibraryElementBuilderTest);
+  runReflectiveTests(LibraryResolver2Test);
+  runReflectiveTests(LibraryResolverTest);
+  runReflectiveTests(LibraryTest);
+  runReflectiveTests(StaticTypeAnalyzerTest);
+  runReflectiveTests(StaticTypeAnalyzer2Test);
+  runReflectiveTests(SubtypeManagerTest);
+  runReflectiveTests(TypeOverrideManagerTest);
+  runReflectiveTests(TypeProviderImplTest);
+  runReflectiveTests(TypeResolverVisitorTest);
+  runReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
+  runReflectiveTests(ErrorResolverTest);
+  runReflectiveTests(HintCodeTest);
+  runReflectiveTests(MemberMapTest);
+  runReflectiveTests(NonHintCodeTest);
+  runReflectiveTests(SimpleResolverTest);
+  runReflectiveTests(StrictModeTest);
+  runReflectiveTests(TypePropagationTest);
+}
 
 /**
  * The class `AnalysisContextFactory` defines utility methods used to create analysis contexts
@@ -42,11 +73,6 @@
   static String _DART_JS_HELPER = "dart:_js_helper";
 
   /**
-   * The fake SDK used by all of the contexts created by this factory.
-   */
-  static DirectoryBasedDartSdk _FAKE_SDK;
-
-  /**
    * Create an analysis context that has a fake core library already resolved.
    *
    * @return the analysis context that was created
@@ -63,7 +89,8 @@
    * @param options the options to be applied to the context
    * @return the analysis context that was created
    */
-  static AnalysisContextImpl contextWithCoreAndOptions(AnalysisOptions options) {
+  static AnalysisContextImpl
+      contextWithCoreAndOptions(AnalysisOptions options) {
     AnalysisContextForTests context = new AnalysisContextForTests();
     context._internalSetAnalysisOptions(options);
     return initContextWithCore(context);
@@ -76,20 +103,23 @@
    * @return the analysis context that was created
    */
   static AnalysisContextImpl initContextWithCore(AnalysisContextImpl context) {
-    DirectoryBasedDartSdk sdk = new DirectoryBasedDartSdk_AnalysisContextFactory_initContextWithCore(new JavaFile("/fake/sdk"));
-    SourceFactory sourceFactory = new SourceFactory([new DartUriResolver(sdk), new FileUriResolver()]);
+    DirectoryBasedDartSdk sdk =
+        new _AnalysisContextFactory_initContextWithCore(new JavaFile("/fake/sdk"));
+    SourceFactory sourceFactory =
+        new SourceFactory([new DartUriResolver(sdk), new FileUriResolver()]);
     context.sourceFactory = sourceFactory;
     AnalysisContext coreContext = sdk.context;
     //
     // dart:core
     //
     TestTypeProvider provider = new TestTypeProvider();
-    CompilationUnitElementImpl coreUnit = new CompilationUnitElementImpl("core.dart");
+    CompilationUnitElementImpl coreUnit =
+        new CompilationUnitElementImpl("core.dart");
     Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
     coreContext.setContents(coreSource, "");
     coreUnit.source = coreSource;
     ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy");
-    coreUnit.types = <ClassElement> [
+    coreUnit.types = <ClassElement>[
         provider.boolType.element,
         provider.deprecatedType.element,
         provider.doubleType.element,
@@ -105,76 +135,133 @@
         provider.stringType.element,
         provider.symbolType.element,
         provider.typeType.element];
-    coreUnit.functions = <FunctionElement> [ElementFactory.functionElement3("identical", provider.boolType.element, <ClassElement> [provider.objectType.element, provider.objectType.element], null)];
-    TopLevelVariableElement proxyTopLevelVariableElt = ElementFactory.topLevelVariableElement3("proxy", true, false, proxyClassElement.type);
-    TopLevelVariableElement deprecatedTopLevelVariableElt = ElementFactory.topLevelVariableElement3("deprecated", true, false, provider.deprecatedType);
-    coreUnit.accessors = <PropertyAccessorElement> [
+    coreUnit.functions = <FunctionElement>[
+        ElementFactory.functionElement3(
+            "identical",
+            provider.boolType.element,
+            <ClassElement>[provider.objectType.element, provider.objectType.element],
+            null),
+        ElementFactory.functionElement3(
+            "print",
+            VoidTypeImpl.instance.element,
+            <ClassElement>[provider.objectType.element],
+            null)];
+    TopLevelVariableElement proxyTopLevelVariableElt =
+        ElementFactory.topLevelVariableElement3(
+            "proxy",
+            true,
+            false,
+            proxyClassElement.type);
+    TopLevelVariableElement deprecatedTopLevelVariableElt =
+        ElementFactory.topLevelVariableElement3(
+            "deprecated",
+            true,
+            false,
+            provider.deprecatedType);
+    coreUnit.accessors = <PropertyAccessorElement>[
         proxyTopLevelVariableElt.getter,
         proxyTopLevelVariableElt.setter,
         deprecatedTopLevelVariableElt.getter,
         deprecatedTopLevelVariableElt.setter];
-    coreUnit.topLevelVariables = <TopLevelVariableElement> [proxyTopLevelVariableElt, deprecatedTopLevelVariableElt];
-    LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(coreContext, AstFactory.libraryIdentifier2(["dart", "core"]));
+    coreUnit.topLevelVariables = <TopLevelVariableElement>[
+        proxyTopLevelVariableElt,
+        deprecatedTopLevelVariableElt];
+    LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
+        coreContext,
+        AstFactory.libraryIdentifier2(["dart", "core"]));
     coreLibrary.definingCompilationUnit = coreUnit;
     //
     // dart:async
     //
-    CompilationUnitElementImpl asyncUnit = new CompilationUnitElementImpl("async.dart");
+    CompilationUnitElementImpl asyncUnit =
+        new CompilationUnitElementImpl("async.dart");
     Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC);
     coreContext.setContents(asyncSource, "");
     asyncUnit.source = asyncSource;
     // Future
-    ClassElementImpl futureElement = ElementFactory.classElement2("Future", ["T"]);
+    ClassElementImpl futureElement =
+        ElementFactory.classElement2("Future", ["T"]);
     InterfaceType futureType = futureElement.type;
     //   factory Future.value([value])
-    ConstructorElementImpl futureConstructor = ElementFactory.constructorElement2(futureElement, "value");
-    futureConstructor.parameters = <ParameterElement> [ElementFactory.positionalParameter2("value", provider.dynamicType)];
+    ConstructorElementImpl futureConstructor =
+        ElementFactory.constructorElement2(futureElement, "value");
+    futureConstructor.parameters = <ParameterElement>[
+        ElementFactory.positionalParameter2("value", provider.dynamicType)];
     futureConstructor.factory = true;
-    (futureConstructor.type as FunctionTypeImpl).typeArguments = futureElement.type.typeArguments;
-    futureElement.constructors = <ConstructorElement> [futureConstructor];
+    (futureConstructor.type as FunctionTypeImpl).typeArguments =
+        futureElement.type.typeArguments;
+    futureElement.constructors = <ConstructorElement>[futureConstructor];
     //   Future then(onValue(T value), { Function onError });
-    List<ParameterElement> parameters = <ParameterElement> [ElementFactory.requiredParameter2("value", futureElement.typeParameters[0].type)];
-    FunctionTypeAliasElementImpl aliasElement = new FunctionTypeAliasElementImpl.forNode(null);
+    List<ParameterElement> parameters = <ParameterElement>[
+        ElementFactory.requiredParameter2(
+            "value",
+            futureElement.typeParameters[0].type)];
+    FunctionTypeAliasElementImpl aliasElement =
+        new FunctionTypeAliasElementImpl.forNode(null);
     aliasElement.synthetic = true;
     aliasElement.shareParameters(parameters);
     aliasElement.returnType = provider.dynamicType;
     FunctionTypeImpl aliasType = new FunctionTypeImpl.con2(aliasElement);
     aliasElement.shareTypeParameters(futureElement.typeParameters);
     aliasType.typeArguments = futureElement.type.typeArguments;
-    MethodElement thenMethod = ElementFactory.methodElementWithParameters("then", futureElement.type.typeArguments, futureType, [
-        ElementFactory.requiredParameter2("onValue", aliasType),
-        ElementFactory.namedParameter2("onError", provider.functionType)]);
-    futureElement.methods = <MethodElement> [thenMethod];
+    MethodElement thenMethod = ElementFactory.methodElementWithParameters(
+        "then",
+        futureElement.type.typeArguments,
+        futureType,
+        [
+            ElementFactory.requiredParameter2("onValue", aliasType),
+            ElementFactory.namedParameter2("onError", provider.functionType)]);
+    futureElement.methods = <MethodElement>[thenMethod];
     // Completer
-    ClassElementImpl completerElement = ElementFactory.classElement2("Completer", ["T"]);
-    ConstructorElementImpl completerConstructor = ElementFactory.constructorElement2(completerElement, null);
-    (completerConstructor.type as FunctionTypeImpl).typeArguments = completerElement.type.typeArguments;
-    completerElement.constructors = <ConstructorElement> [completerConstructor];
-    asyncUnit.types = <ClassElement> [
+    ClassElementImpl completerElement =
+        ElementFactory.classElement2("Completer", ["T"]);
+    ConstructorElementImpl completerConstructor =
+        ElementFactory.constructorElement2(completerElement, null);
+    (completerConstructor.type as FunctionTypeImpl).typeArguments =
+        completerElement.type.typeArguments;
+    completerElement.constructors = <ConstructorElement>[completerConstructor];
+    asyncUnit.types = <ClassElement>[
         completerElement,
         futureElement,
         ElementFactory.classElement2("Stream", ["T"])];
-    LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(coreContext, AstFactory.libraryIdentifier2(["dart", "async"]));
+    LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
+        coreContext,
+        AstFactory.libraryIdentifier2(["dart", "async"]));
     asyncLibrary.definingCompilationUnit = asyncUnit;
     //
     // dart:html
     //
-    CompilationUnitElementImpl htmlUnit = new CompilationUnitElementImpl("html_dartium.dart");
+    CompilationUnitElementImpl htmlUnit =
+        new CompilationUnitElementImpl("html_dartium.dart");
     Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
     coreContext.setContents(htmlSource, "");
     htmlUnit.source = htmlSource;
     ClassElementImpl elementElement = ElementFactory.classElement2("Element");
     InterfaceType elementType = elementElement.type;
-    ClassElementImpl canvasElement = ElementFactory.classElement("CanvasElement", elementType);
-    ClassElementImpl contextElement = ElementFactory.classElement2("CanvasRenderingContext");
+    ClassElementImpl canvasElement =
+        ElementFactory.classElement("CanvasElement", elementType);
+    ClassElementImpl contextElement =
+        ElementFactory.classElement2("CanvasRenderingContext");
     InterfaceType contextElementType = contextElement.type;
-    ClassElementImpl context2dElement = ElementFactory.classElement("CanvasRenderingContext2D", contextElementType);
-    canvasElement.methods = <MethodElement> [ElementFactory.methodElement("getContext", contextElementType, [provider.stringType])];
-    canvasElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("context2D", false, context2dElement.type)];
-    ClassElementImpl documentElement = ElementFactory.classElement("Document", elementType);
-    ClassElementImpl htmlDocumentElement = ElementFactory.classElement("HtmlDocument", documentElement.type);
-    htmlDocumentElement.methods = <MethodElement> [ElementFactory.methodElement("query", elementType, <DartType> [provider.stringType])];
-    htmlUnit.types = <ClassElement> [
+    ClassElementImpl context2dElement =
+        ElementFactory.classElement("CanvasRenderingContext2D", contextElementType);
+    canvasElement.methods = <MethodElement>[
+        ElementFactory.methodElement(
+            "getContext",
+            contextElementType,
+            [provider.stringType])];
+    canvasElement.accessors = <PropertyAccessorElement>[
+        ElementFactory.getterElement("context2D", false, context2dElement.type)];
+    ClassElementImpl documentElement =
+        ElementFactory.classElement("Document", elementType);
+    ClassElementImpl htmlDocumentElement =
+        ElementFactory.classElement("HtmlDocument", documentElement.type);
+    htmlDocumentElement.methods = <MethodElement>[
+        ElementFactory.methodElement(
+            "query",
+            elementType,
+            <DartType>[provider.stringType])];
+    htmlUnit.types = <ClassElement>[
         ElementFactory.classElement("AnchorElement", elementType),
         ElementFactory.classElement("BodyElement", elementType),
         ElementFactory.classElement("ButtonElement", elementType),
@@ -187,38 +274,77 @@
         htmlDocumentElement,
         ElementFactory.classElement("InputElement", elementType),
         ElementFactory.classElement("SelectElement", elementType)];
-    htmlUnit.functions = <FunctionElement> [ElementFactory.functionElement3("query", elementElement, <ClassElement> [provider.stringType.element], ClassElementImpl.EMPTY_ARRAY)];
-    TopLevelVariableElementImpl document = ElementFactory.topLevelVariableElement3("document", false, true, htmlDocumentElement.type);
-    htmlUnit.topLevelVariables = <TopLevelVariableElement> [document];
-    htmlUnit.accessors = <PropertyAccessorElement> [document.getter];
-    LibraryElementImpl htmlLibrary = new LibraryElementImpl.forNode(coreContext, AstFactory.libraryIdentifier2(["dart", "dom", "html"]));
+    htmlUnit.functions = <FunctionElement>[
+        ElementFactory.functionElement3(
+            "query",
+            elementElement,
+            <ClassElement>[provider.stringType.element],
+            ClassElementImpl.EMPTY_ARRAY)];
+    TopLevelVariableElementImpl document =
+        ElementFactory.topLevelVariableElement3(
+            "document",
+            false,
+            true,
+            htmlDocumentElement.type);
+    htmlUnit.topLevelVariables = <TopLevelVariableElement>[document];
+    htmlUnit.accessors = <PropertyAccessorElement>[document.getter];
+    LibraryElementImpl htmlLibrary = new LibraryElementImpl.forNode(
+        coreContext,
+        AstFactory.libraryIdentifier2(["dart", "dom", "html"]));
     htmlLibrary.definingCompilationUnit = htmlUnit;
     //
     // dart:math
     //
-    CompilationUnitElementImpl mathUnit = new CompilationUnitElementImpl("math.dart");
+    CompilationUnitElementImpl mathUnit =
+        new CompilationUnitElementImpl("math.dart");
     Source mathSource = sourceFactory.forUri(_DART_MATH);
     coreContext.setContents(mathSource, "");
     mathUnit.source = mathSource;
-    FunctionElement cosElement = ElementFactory.functionElement3("cos", provider.doubleType.element, <ClassElement>[provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
-    TopLevelVariableElement ln10Element = ElementFactory.topLevelVariableElement3("LN10", true, false, provider.doubleType);
-    TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3("PI", true, false, provider.doubleType);
+    FunctionElement cosElement = ElementFactory.functionElement3(
+        "cos",
+        provider.doubleType.element,
+        <ClassElement>[provider.numType.element],
+        ClassElementImpl.EMPTY_ARRAY);
+    TopLevelVariableElement ln10Element =
+        ElementFactory.topLevelVariableElement3(
+            "LN10",
+            true,
+            false,
+            provider.doubleType);
+    TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3(
+        "PI",
+        true,
+        false,
+        provider.doubleType);
     ClassElementImpl randomElement = ElementFactory.classElement2("Random");
     randomElement.abstract = true;
-    ConstructorElementImpl randomConstructor = ElementFactory.constructorElement2(randomElement, null);
+    ConstructorElementImpl randomConstructor =
+        ElementFactory.constructorElement2(randomElement, null);
     randomConstructor.factory = true;
     ParameterElementImpl seedParam = new ParameterElementImpl("seed", 0);
     seedParam.parameterKind = ParameterKind.POSITIONAL;
     seedParam.type = provider.intType;
-    randomConstructor.parameters = <ParameterElement> [seedParam];
-    randomElement.constructors = <ConstructorElement> [randomConstructor];
-    FunctionElement sinElement = ElementFactory.functionElement3("sin", provider.doubleType.element, <ClassElement> [provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
-    FunctionElement sqrtElement = ElementFactory.functionElement3("sqrt", provider.doubleType.element, <ClassElement> [provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
-    mathUnit.accessors = <PropertyAccessorElement> [ln10Element.getter, piElement.getter];
-    mathUnit.functions = <FunctionElement> [cosElement, sinElement, sqrtElement];
-    mathUnit.topLevelVariables = <TopLevelVariableElement> [ln10Element, piElement];
-    mathUnit.types = <ClassElement> [randomElement];
-    LibraryElementImpl mathLibrary = new LibraryElementImpl.forNode(coreContext, AstFactory.libraryIdentifier2(["dart", "math"]));
+    randomConstructor.parameters = <ParameterElement>[seedParam];
+    randomElement.constructors = <ConstructorElement>[randomConstructor];
+    FunctionElement sinElement = ElementFactory.functionElement3(
+        "sin",
+        provider.doubleType.element,
+        <ClassElement>[provider.numType.element],
+        ClassElementImpl.EMPTY_ARRAY);
+    FunctionElement sqrtElement = ElementFactory.functionElement3(
+        "sqrt",
+        provider.doubleType.element,
+        <ClassElement>[provider.numType.element],
+        ClassElementImpl.EMPTY_ARRAY);
+    mathUnit.accessors =
+        <PropertyAccessorElement>[ln10Element.getter, piElement.getter];
+    mathUnit.functions = <FunctionElement>[cosElement, sinElement, sqrtElement];
+    mathUnit.topLevelVariables =
+        <TopLevelVariableElement>[ln10Element, piElement];
+    mathUnit.types = <ClassElement>[randomElement];
+    LibraryElementImpl mathLibrary = new LibraryElementImpl.forNode(
+        coreContext,
+        AstFactory.libraryIdentifier2(["dart", "math"]));
     mathLibrary.definingCompilationUnit = mathUnit;
     //
     // Set empty sources for the rest of the libraries.
@@ -230,7 +356,8 @@
     //
     // Record the elements.
     //
-    HashMap<Source, LibraryElement> elementMap = new HashMap<Source, LibraryElement>();
+    HashMap<Source, LibraryElement> elementMap =
+        new HashMap<Source, LibraryElement>();
     elementMap[coreSource] = coreLibrary;
     elementMap[asyncSource] = asyncLibrary;
     elementMap[htmlSource] = htmlLibrary;
@@ -246,7 +373,27 @@
  */
 class AnalysisContextForTests extends AnalysisContextImpl {
   @override
-  bool exists(Source source) => super.exists(source) || sourceFactory.dartSdk.context.exists(source);
+  void set analysisOptions(AnalysisOptions options) {
+    AnalysisOptions currentOptions = analysisOptions;
+    bool needsRecompute =
+        currentOptions.analyzeFunctionBodies != options.analyzeFunctionBodies ||
+        currentOptions.generateSdkErrors != options.generateSdkErrors ||
+        currentOptions.enableAsync != options.enableAsync ||
+        currentOptions.enableDeferredLoading != options.enableDeferredLoading ||
+        currentOptions.enableEnum != options.enableEnum ||
+        currentOptions.dart2jsHint != options.dart2jsHint ||
+        (currentOptions.hint && !options.hint) ||
+        currentOptions.preserveComments != options.preserveComments;
+    if (needsRecompute) {
+      fail(
+          "Cannot set options that cause the sources to be reanalyzed in a test context");
+    }
+    super.analysisOptions = options;
+  }
+
+  @override
+  bool exists(Source source) =>
+      super.exists(source) || sourceFactory.dartSdk.context.exists(source);
 
   @override
   TimestampedData<String> getContents(Source source) {
@@ -264,16 +411,6 @@
     return super.getModificationStamp(source);
   }
 
-  @override
-  void set analysisOptions(AnalysisOptions options) {
-    AnalysisOptions currentOptions = analysisOptions;
-    bool needsRecompute = currentOptions.analyzeFunctionBodies != options.analyzeFunctionBodies || currentOptions.generateSdkErrors != options.generateSdkErrors || currentOptions.enableAsync != options.enableAsync || currentOptions.enableDeferredLoading != options.enableDeferredLoading || currentOptions.enableEnum != options.enableEnum || currentOptions.dart2jsHint != options.dart2jsHint || (currentOptions.hint && !options.hint) || currentOptions.preserveComments != options.preserveComments;
-    if (needsRecompute) {
-      fail("Cannot set options that cause the sources to be reanalyzed in a test context");
-    }
-    super.analysisOptions = options;
-  }
-
   /**
    * Set the analysis options, even if they would force re-analysis. This method should only be
    * invoked before the fake SDK is initialized.
@@ -296,7 +433,8 @@
    */
   AnalysisContextHelper() {
     context = AnalysisContextFactory.contextWithCore();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(context.analysisOptions);
+    AnalysisOptionsImpl options =
+        new AnalysisOptionsImpl.con1(context.analysisOptions);
     options.cacheSize = 256;
     context.analysisOptions = options;
   }
@@ -312,7 +450,8 @@
     return source;
   }
 
-  CompilationUnitElement getDefiningUnitElement(Source source) => context.getCompilationUnitElement(source, source);
+  CompilationUnitElement getDefiningUnitElement(Source source) =>
+      context.getCompilationUnitElement(source, source);
 
   CompilationUnit resolveDefiningUnit(Source source) {
     LibraryElement libraryElement = context.computeLibraryElement(source);
@@ -412,7 +551,8 @@
     changeSet.changedRange(new TestSource(), "", 0, 0, 0);
     changeSet.deletedSource(new TestSource());
     changeSet.removedSource(new TestSource());
-    changeSet.removedContainer(new SourceContainer_ChangeSetTest_test_toString());
+    changeSet.removedContainer(
+        new SourceContainer_ChangeSetTest_test_toString());
     expect(changeSet.toString(), isNotNull);
   }
 }
@@ -449,8 +589,7 @@
 }
 var v = const A(null);''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 
@@ -563,20 +702,6 @@
     verify([source]);
   }
 
-  void test_fieldFormalParameterAssignableToField_typeSubstitution() {
-    // foo has the runtime type dynamic -> dynamic, so it should be assignable
-    // to A.f.
-    Source source = addSource(r'''
-class A<T> {
-  final T x;
-  const A(this.x);
-}
-var v = const A<int>(3);''');
-    resolve(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   void test_fieldFormalParameterAssignableToField_typedef() {
     // foo has the runtime type dynamic -> dynamic, so it should be assignable
     // to A.f.
@@ -593,6 +718,20 @@
     verify([source]);
   }
 
+  void test_fieldFormalParameterAssignableToField_typeSubstitution() {
+    // foo has the runtime type dynamic -> dynamic, so it should be assignable
+    // to A.f.
+    Source source = addSource(r'''
+class A<T> {
+  final T x;
+  const A(this.x);
+}
+var v = const A<int>(3);''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_fieldFormalParameterNotAssignableToField() {
     Source source = addSource(r'''
 class A {
@@ -601,37 +740,11 @@
 }
 var v = const A('foo');''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
-    verify([source]);
-  }
-
-  void test_fieldFormalParameterNotAssignableToField_fieldType() {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A(String this.x);
-}
-var v = const A('foo');''');
-    resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE]);
-    verify([source]);
-  }
-
-  void test_fieldFormalParameterNotAssignableToField_fieldType_unresolved() {
-    Source source = addSource(r'''
-class A {
-  final Unresolved x;
-  const A(String this.x);
-}
-var v = const A('foo');''');
-    resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -652,8 +765,41 @@
 }
 var v = const C(const A());''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    verify([source]);
+  }
+
+  void test_fieldFormalParameterNotAssignableToField_fieldType() {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A(String this.x);
+}
+var v = const A('foo');''');
+    resolve(source);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE]);
+    verify([source]);
+  }
+
+  void test_fieldFormalParameterNotAssignableToField_fieldType_unresolved() {
+    Source source = addSource(r'''
+class A {
+  final Unresolved x;
+  const A(String this.x);
+}
+var v = const A('foo');''');
+    resolve(source);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 
@@ -672,8 +818,9 @@
 }
 var v = const C(const A());''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -685,8 +832,9 @@
 }
 var x = const A(const <num>[1, 2, 3]);''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -699,8 +847,9 @@
 }
 var x = const A(const <num, int>{1: 2});''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -713,8 +862,9 @@
 }
 var x = const A(const <int, num>{1: 2});''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -726,9 +876,11 @@
 }
 var v = const A();''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
 
@@ -744,9 +896,11 @@
 int foo(String x) => 1;
 var v = const A(foo);''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -757,9 +911,11 @@
   const A() : x = '';
 }''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-        StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
+            StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -771,8 +927,9 @@
 }
 var v = const A('foo');''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -784,9 +941,11 @@
 }
 var v = const A('foo');''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+            StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 
@@ -812,48 +971,40 @@
 }
 var v = const A(null);''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 
   void test_listElementTypeNotAssignable() {
     Source source = addSource("var v = const <String> [42];");
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-        StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
+            StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
   void test_mapKeyTypeNotAssignable() {
     Source source = addSource("var v = const <String, int > {1 : 2};");
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
-        StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
+            StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
   void test_mapValueTypeNotAssignable() {
     Source source = addSource("var v = const <String, String> {'a' : 2};");
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-        StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE]);
-    verify([source]);
-  }
-
-  void test_redirectingConstructor_paramTypeMismatch() {
-    Source source = addSource(r'''
-class A {
-  const A.a1(x) : this.a2(x);
-  const A.a2(String x);
-}
-var v = const A.a1(0);''');
-    resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
+            StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -869,20 +1020,6 @@
     verify([source]);
   }
 
-  void test_parameterAssignable_undefined_null() {
-    // Null always passes runtime type checks, even when the type is
-    // unresolved.
-    Source source = addSource(r'''
-class A {
-  const A(Unresolved x);
-}
-var v = const A(null);''');
-    resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
   void test_parameterAssignable_typeSubstitution() {
     Source source = addSource(r'''
 class A<T> {
@@ -894,6 +1031,19 @@
     verify([source]);
   }
 
+  void test_parameterAssignable_undefined_null() {
+    // Null always passes runtime type checks, even when the type is
+    // unresolved.
+    Source source = addSource(r'''
+class A {
+  const A(Unresolved x);
+}
+var v = const A(null);''');
+    resolve(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
   void test_parameterNotAssignable() {
     Source source = addSource(r'''
 class A {
@@ -901,22 +1051,11 @@
 }
 var v = const A('foo');''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
-    verify([source]);
-  }
-
-  void test_parameterNotAssignable_undefined() {
-    Source source = addSource(r'''
-class A {
-  const A(Unresolved x);
-}
-var v = const A('foo');''');
-    resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -927,9 +1066,40 @@
 }
 var v = const A<int>('foo');''');
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    verify([source]);
+  }
+
+  void test_parameterNotAssignable_undefined() {
+    Source source = addSource(r'''
+class A {
+  const A(Unresolved x);
+}
+var v = const A('foo');''');
+    resolve(source);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+            StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  void test_redirectingConstructor_paramTypeMismatch() {
+    Source source = addSource(r'''
+class A {
+  const A.a1(x) : this.a2(x);
+  const A.a2(String x);
+}
+var v = const A.a1(0);''');
+    resolve(source);
+    assertErrors(
+        source,
+        [CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -945,176 +1115,33 @@
     // unresolved.
     Source source = addSource("const Unresolved x = null;");
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 
   void test_topLevelVarNotAssignable() {
     Source source = addSource("const int x = 'foo';");
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-        StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
+            StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
 
   void test_topLevelVarNotAssignable_undefined() {
     Source source = addSource("const Unresolved x = 'foo';");
     resolve(source);
-    assertErrors(source, [
-        CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-        StaticWarningCode.UNDEFINED_CLASS]);
+    assertErrors(
+        source,
+        [
+            CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
+            StaticWarningCode.UNDEFINED_CLASS]);
     verify([source]);
   }
 }
 
-class DeclarationMatcherTest extends ResolverTestCase {
-  void test_compilationUnitMatches_false_topLevelVariable() {
-    _assertCompilationUnitMatches(false, r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''', r'''
-const int ZERO = 0;
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''');
-  }
-
-  void test_compilationUnitMatches_true_different() {
-    _assertCompilationUnitMatches(true, r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''', r'''
-class C {
-  int m(int p) {
-    return (p * p) + (p * p);
-  }
-}''');
-  }
-
-  void test_compilationUnitMatches_true_same() {
-    String content = r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''';
-    _assertCompilationUnitMatches(true, content, content);
-  }
-
-  void test_methodDeclarationMatches_false_localVariable() {
-    _assertMethodMatches(false, r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''', r'''
-class C {
-  int m(int p) {
-    int product = p * p;
-    return product + product;
-  }
-}''');
-  }
-
-  void test_methodDeclarationMatches_false_parameter() {
-    _assertMethodMatches(false, r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''', r'''
-class C {
-  int m(int p, int q) {
-    return (p * q) + (q * p);
-  }
-}''');
-  }
-
-  void test_methodDeclarationMatches_true_different() {
-    _assertMethodMatches(true, r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''', r'''
-class C {
-  int m(int p) {
-    return (p * p) + (p * p);
-  }
-}''');
-  }
-
-  void test_methodDeclarationMatches_true_same() {
-    String content = r'''
-class C {
-  int m(int p) {
-    return p + p;
-  }
-}''';
-    _assertMethodMatches(true, content, content);
-  }
-
-  void _assertCompilationUnitMatches(bool expectMatch, String oldContent, String newContent) {
-    Source source = addSource(oldContent);
-    LibraryElement library = resolve(source);
-    CompilationUnit oldUnit = resolveCompilationUnit(source, library);
-    CompilationUnit newUnit = ParserTestCase.parseCompilationUnit(newContent);
-    DeclarationMatcher matcher = new DeclarationMatcher();
-    expect(matcher.matches(newUnit, oldUnit.element), expectMatch);
-  }
-
-  void _assertMethodMatches(bool expectMatch, String oldContent, String newContent) {
-    Source source = addSource(oldContent);
-    LibraryElement library = resolve(source);
-    CompilationUnit oldUnit = resolveCompilationUnit(source, library);
-    MethodElement element = _getFirstMethod(oldUnit).element as MethodElement;
-    AnalysisContext context = analysisContext;
-    context.setContents(source, newContent);
-    CompilationUnit newUnit = context.parseCompilationUnit(source);
-    MethodDeclaration newMethod = _getFirstMethod(newUnit);
-    DeclarationMatcher matcher = new DeclarationMatcher();
-    expect(matcher.matches(newMethod, element), expectMatch);
-  }
-
-  MethodDeclaration _getFirstMethod(CompilationUnit unit) {
-    ClassDeclaration classNode = unit.declarations[0] as ClassDeclaration;
-    return classNode.members[0] as MethodDeclaration;
-  }
-}
-
-class DirectoryBasedDartSdk_AnalysisContextFactory_initContextWithCore extends DirectoryBasedDartSdk {
-  DirectoryBasedDartSdk_AnalysisContextFactory_initContextWithCore(JavaFile arg0) : super(arg0);
-
-  @override
-  LibraryMap initialLibraryMap(bool useDart2jsPaths) {
-    LibraryMap map = new LibraryMap();
-    _addLibrary(map, DartSdk.DART_ASYNC, false, "async.dart");
-    _addLibrary(map, DartSdk.DART_CORE, false, "core.dart");
-    _addLibrary(map, DartSdk.DART_HTML, false, "html_dartium.dart");
-    _addLibrary(map, AnalysisContextFactory._DART_MATH, false, "math.dart");
-    _addLibrary(map, AnalysisContextFactory._DART_INTERCEPTORS, true, "_interceptors.dart");
-    _addLibrary(map, AnalysisContextFactory._DART_JS_HELPER, true, "_js_helper.dart");
-    return map;
-  }
-
-  void _addLibrary(LibraryMap map, String uri, bool isInternal, String path) {
-    SdkLibraryImpl library = new SdkLibraryImpl(uri);
-    if (isInternal) {
-      library.category = "Internal";
-    }
-    library.path = path;
-    map.setLibrary(uri, library);
-  }
-}
-
 class ElementResolverTest extends EngineTestCase {
   /**
    * The error listener to which errors will be reported.
@@ -1143,8 +1170,10 @@
 
   void fail_visitExportDirective_combinators() {
     fail("Not yet tested");
-    // Need to set up the exported library so that the identifier can be resolved
-    ExportDirective directive = AstFactory.exportDirective2(null, [AstFactory.hideCombinator2(["A"])]);
+    // Need to set up the exported library so that the identifier can be
+    // resolved.
+    ExportDirective directive =
+        AstFactory.exportDirective2(null, [AstFactory.hideCombinator2(["A"])]);
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
@@ -1156,20 +1185,25 @@
 
   void fail_visitImportDirective_combinators_noPrefix() {
     fail("Not yet tested");
-    // Need to set up the imported library so that the identifier can be resolved
-    ImportDirective directive = AstFactory.importDirective3(null, null, [AstFactory.showCombinator2(["A"])]);
+    // Need to set up the imported library so that the identifier can be
+    // resolved.
+    ImportDirective directive =
+        AstFactory.importDirective3(null, null, [AstFactory.showCombinator2(["A"])]);
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
   void fail_visitImportDirective_combinators_prefix() {
     fail("Not yet tested");
-    // Need to set up the imported library so that the identifiers can be resolved
+    // Need to set up the imported library so that the identifiers can be
+    // resolved.
     String prefixName = "p";
-    _definingLibrary.imports = <ImportElement> [ElementFactory.importFor(null, ElementFactory.prefix(prefixName))];
-    ImportDirective directive = AstFactory.importDirective3(null, prefixName, [
-        AstFactory.showCombinator2(["A"]),
-        AstFactory.hideCombinator2(["B"])]);
+    _definingLibrary.imports = <ImportElement>[
+        ElementFactory.importFor(null, ElementFactory.prefix(prefixName))];
+    ImportDirective directive = AstFactory.importDirective3(
+        null,
+        prefixName,
+        [AstFactory.showCombinator2(["A"]), AstFactory.hideCombinator2(["B"])]);
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
@@ -1192,18 +1226,19 @@
     // abstract class A { int operator[](int index); }
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    MethodElement operator = ElementFactory.methodElement("[]", intType, [intType]);
-    classA.methods = <MethodElement> [operator];
+    MethodElement operator =
+        ElementFactory.methodElement("[]", intType, [intType]);
+    classA.methods = <MethodElement>[operator];
     //
     // class B implements A {}
     //
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
+    classB.interfaces = <InterfaceType>[classA.type];
     //
     // class C extends Object with B {}
     //
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.mixins = <InterfaceType> [classB.type];
+    classC.mixins = <InterfaceType>[classB.type];
     //
     // class D extends C {}
     //
@@ -1214,7 +1249,8 @@
     //
     SimpleIdentifier array = AstFactory.identifier3("a");
     array.staticType = classD.type;
-    IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
+    IndexExpression expression =
+        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
     expect(_resolveIndexExpression(expression), same(operator));
     _listener.assertNoErrors();
   }
@@ -1223,41 +1259,92 @@
     InterfaceType intType = _typeProvider.intType;
     SimpleIdentifier leftHandSide = AstFactory.identifier3("a");
     leftHandSide.staticType = intType;
-    AssignmentExpression assignment = AstFactory.assignmentExpression(leftHandSide, TokenType.PLUS_EQ, AstFactory.integer(1));
+    AssignmentExpression assignment = AstFactory.assignmentExpression(
+        leftHandSide,
+        TokenType.PLUS_EQ,
+        AstFactory.integer(1));
     _resolveNode(assignment);
-    expect(assignment.staticElement, same(getMethod(_typeProvider.numType, "+")));
+    expect(
+        assignment.staticElement,
+        same(getMethod(_typeProvider.numType, "+")));
     _listener.assertNoErrors();
   }
 
   void test_visitAssignmentExpression_simple() {
-    AssignmentExpression expression = AstFactory.assignmentExpression(AstFactory.identifier3("x"), TokenType.EQ, AstFactory.integer(0));
+    AssignmentExpression expression = AstFactory.assignmentExpression(
+        AstFactory.identifier3("x"),
+        TokenType.EQ,
+        AstFactory.integer(0));
     _resolveNode(expression);
     expect(expression.staticElement, isNull);
     _listener.assertNoErrors();
   }
 
-  void test_visitBinaryExpression() {
+  void test_visitBinaryExpression_bangEq() {
+    // String i;
+    // var j;
+    // i == j
+    InterfaceType stringType = _typeProvider.stringType;
+    SimpleIdentifier left = AstFactory.identifier3("i");
+    left.staticType = stringType;
+    BinaryExpression expression = AstFactory.binaryExpression(
+        left,
+        TokenType.BANG_EQ,
+        AstFactory.identifier3("j"));
+    _resolveNode(expression);
+    var stringElement = stringType.element;
+    expect(expression.staticElement, isNotNull);
+    expect(
+        expression.staticElement,
+        stringElement.lookUpMethod(TokenType.EQ_EQ.lexeme, stringElement.library));
+    expect(expression.propagatedElement, isNull);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_eq() {
+    // String i;
+    // var j;
+    // i == j
+    InterfaceType stringType = _typeProvider.stringType;
+    SimpleIdentifier left = AstFactory.identifier3("i");
+    left.staticType = stringType;
+    BinaryExpression expression = AstFactory.binaryExpression(
+        left,
+        TokenType.EQ_EQ,
+        AstFactory.identifier3("j"));
+    _resolveNode(expression);
+    var stringElement = stringType.element;
+    expect(
+        expression.staticElement,
+        stringElement.lookUpMethod(TokenType.EQ_EQ.lexeme, stringElement.library));
+    expect(expression.propagatedElement, isNull);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_plus() {
     // num i;
     // var j;
     // i + j
     InterfaceType numType = _typeProvider.numType;
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.staticType = numType;
-    BinaryExpression expression = AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
+    BinaryExpression expression =
+        AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     expect(expression.propagatedElement, isNull);
     _listener.assertNoErrors();
   }
 
-  void test_visitBinaryExpression_propagatedElement() {
+  void test_visitBinaryExpression_plus_propagatedElement() {
     // var i = 1;
     // var j;
     // i + j
     InterfaceType numType = _typeProvider.numType;
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.propagatedType = numType;
-    BinaryExpression expression = AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
+    BinaryExpression expression =
+        AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
     _resolveNode(expression);
     expect(expression.staticElement, isNull);
     expect(expression.propagatedElement, getMethod(numType, "+"));
@@ -1265,25 +1352,37 @@
   }
 
   void test_visitBreakStatement_withLabel() {
+    // loop: while (true) {
+    //   break loop;
+    // }
     String label = "loop";
-    LabelElementImpl labelElement = new LabelElementImpl(AstFactory.identifier3(label), false, false);
-    BreakStatement statement = AstFactory.breakStatement2(label);
-    expect(_resolveBreak(statement, labelElement), same(labelElement));
+    LabelElementImpl labelElement =
+        new LabelElementImpl(AstFactory.identifier3(label), false, false);
+    BreakStatement breakStatement = AstFactory.breakStatement2(label);
+    Expression condition = AstFactory.booleanLiteral(true);
+    WhileStatement whileStatement =
+        AstFactory.whileStatement(condition, breakStatement);
+    expect(
+        _resolveBreak(breakStatement, labelElement, whileStatement),
+        same(labelElement));
+    expect(breakStatement.target, same(whileStatement));
     _listener.assertNoErrors();
   }
 
   void test_visitBreakStatement_withoutLabel() {
     BreakStatement statement = AstFactory.breakStatement();
-    _resolveStatement(statement, null);
+    _resolveStatement(statement, null, null);
     _listener.assertNoErrors();
   }
 
   void test_visitConstructorName_named() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = "a";
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
-    classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    ConstructorElement constructor =
+        ElementFactory.constructorElement2(classA, constructorName);
+    classA.constructors = <ConstructorElement>[constructor];
+    ConstructorName name =
+        AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -1292,31 +1391,44 @@
   void test_visitConstructorName_unnamed() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
-    classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    ConstructorElement constructor =
+        ElementFactory.constructorElement2(classA, constructorName);
+    classA.constructors = <ConstructorElement>[constructor];
+    ConstructorName name =
+        AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
   }
 
   void test_visitContinueStatement_withLabel() {
+    // loop: while (true) {
+    //   continue loop;
+    // }
     String label = "loop";
-    LabelElementImpl labelElement = new LabelElementImpl(AstFactory.identifier3(label), false, false);
-    ContinueStatement statement = AstFactory.continueStatement(label);
-    expect(_resolveContinue(statement, labelElement), same(labelElement));
+    LabelElementImpl labelElement =
+        new LabelElementImpl(AstFactory.identifier3(label), false, false);
+    ContinueStatement continueStatement = AstFactory.continueStatement(label);
+    Expression condition = AstFactory.booleanLiteral(true);
+    WhileStatement whileStatement =
+        AstFactory.whileStatement(condition, continueStatement);
+    expect(
+        _resolveContinue(continueStatement, labelElement, whileStatement),
+        same(labelElement));
+    expect(continueStatement.target, same(whileStatement));
     _listener.assertNoErrors();
   }
 
   void test_visitContinueStatement_withoutLabel() {
     ContinueStatement statement = AstFactory.continueStatement();
-    _resolveStatement(statement, null);
+    _resolveStatement(statement, null, null);
     _listener.assertNoErrors();
   }
 
   void test_visitExportDirective_noCombinators() {
     ExportDirective directive = AstFactory.exportDirective2(null);
-    directive.element = ElementFactory.exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
+    directive.element = ElementFactory.exportFor(
+        ElementFactory.library(_definingLibrary.context, "lib"));
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
@@ -1324,11 +1436,14 @@
   void test_visitFieldFormalParameter() {
     String fieldName = "f";
     InterfaceType intType = _typeProvider.intType;
-    FieldElementImpl fieldElement = ElementFactory.fieldElement(fieldName, false, false, false, intType);
+    FieldElementImpl fieldElement =
+        ElementFactory.fieldElement(fieldName, false, false, false, intType);
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.fields = <FieldElement> [fieldElement];
-    FieldFormalParameter parameter = AstFactory.fieldFormalParameter2(fieldName);
-    FieldFormalParameterElementImpl parameterElement = ElementFactory.fieldFormalParameter(parameter.identifier);
+    classA.fields = <FieldElement>[fieldElement];
+    FieldFormalParameter parameter =
+        AstFactory.fieldFormalParameter2(fieldName);
+    FieldFormalParameterElementImpl parameterElement =
+        ElementFactory.fieldFormalParameter(parameter.identifier);
     parameterElement.field = fieldElement;
     parameterElement.type = intType;
     parameter.identifier.staticElement = parameterElement;
@@ -1338,15 +1453,19 @@
 
   void test_visitImportDirective_noCombinators_noPrefix() {
     ImportDirective directive = AstFactory.importDirective3(null, null);
-    directive.element = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), null);
+    directive.element = ElementFactory.importFor(
+        ElementFactory.library(_definingLibrary.context, "lib"),
+        null);
     _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
   void test_visitImportDirective_noCombinators_prefix() {
     String prefixName = "p";
-    ImportElement importElement = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), ElementFactory.prefix(prefixName));
-    _definingLibrary.imports = <ImportElement> [importElement];
+    ImportElement importElement = ElementFactory.importFor(
+        ElementFactory.library(_definingLibrary.context, "lib"),
+        ElementFactory.prefix(prefixName));
+    _definingLibrary.imports = <ImportElement>[importElement];
     ImportDirective directive = AstFactory.importDirective3(null, prefixName);
     directive.element = importElement;
     _resolveNode(directive);
@@ -1355,14 +1474,21 @@
 
   void test_visitImportDirective_withCombinators() {
     ShowCombinator combinator = AstFactory.showCombinator2(["A", "B", "C"]);
-    ImportDirective directive = AstFactory.importDirective3(null, null, [combinator]);
-    LibraryElementImpl library = ElementFactory.library(_definingLibrary.context, "lib");
-    TopLevelVariableElementImpl varA = ElementFactory.topLevelVariableElement2("A");
-    TopLevelVariableElementImpl varB = ElementFactory.topLevelVariableElement2("B");
-    TopLevelVariableElementImpl varC = ElementFactory.topLevelVariableElement2("C");
-    CompilationUnitElementImpl unit = library.definingCompilationUnit as CompilationUnitElementImpl;
-    unit.accessors = <PropertyAccessorElement> [varA.getter, varA.setter, varB.getter, varC.setter];
-    unit.topLevelVariables = <TopLevelVariableElement> [varA, varB, varC];
+    ImportDirective directive =
+        AstFactory.importDirective3(null, null, [combinator]);
+    LibraryElementImpl library =
+        ElementFactory.library(_definingLibrary.context, "lib");
+    TopLevelVariableElementImpl varA =
+        ElementFactory.topLevelVariableElement2("A");
+    TopLevelVariableElementImpl varB =
+        ElementFactory.topLevelVariableElement2("B");
+    TopLevelVariableElementImpl varC =
+        ElementFactory.topLevelVariableElement2("C");
+    CompilationUnitElementImpl unit =
+        library.definingCompilationUnit as CompilationUnitElementImpl;
+    unit.accessors =
+        <PropertyAccessorElement>[varA.getter, varA.setter, varB.getter, varC.setter];
+    unit.topLevelVariables = <TopLevelVariableElement>[varA, varB, varC];
     directive.element = ElementFactory.importFor(library, null);
     _resolveNode(directive);
     expect(combinator.shownNames[0].staticElement, same(varA));
@@ -1374,11 +1500,13 @@
   void test_visitIndexExpression_get() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType intType = _typeProvider.intType;
-    MethodElement getter = ElementFactory.methodElement("[]", intType, [intType]);
-    classA.methods = <MethodElement> [getter];
+    MethodElement getter =
+        ElementFactory.methodElement("[]", intType, [intType]);
+    classA.methods = <MethodElement>[getter];
     SimpleIdentifier array = AstFactory.identifier3("a");
     array.staticType = classA.type;
-    IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
+    IndexExpression expression =
+        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
     expect(_resolveIndexExpression(expression), same(getter));
     _listener.assertNoErrors();
   }
@@ -1386,12 +1514,17 @@
   void test_visitIndexExpression_set() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType intType = _typeProvider.intType;
-    MethodElement setter = ElementFactory.methodElement("[]=", intType, [intType]);
-    classA.methods = <MethodElement> [setter];
+    MethodElement setter =
+        ElementFactory.methodElement("[]=", intType, [intType]);
+    classA.methods = <MethodElement>[setter];
     SimpleIdentifier array = AstFactory.identifier3("a");
     array.staticType = classA.type;
-    IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
-    AstFactory.assignmentExpression(expression, TokenType.EQ, AstFactory.integer(0));
+    IndexExpression expression =
+        AstFactory.indexExpression(array, AstFactory.identifier3("i"));
+    AstFactory.assignmentExpression(
+        expression,
+        TokenType.EQ,
+        AstFactory.integer(0));
     expect(_resolveIndexExpression(expression), same(setter));
     _listener.assertNoErrors();
   }
@@ -1399,11 +1532,14 @@
   void test_visitInstanceCreationExpression_named() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = "a";
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
-    classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    ConstructorElement constructor =
+        ElementFactory.constructorElement2(classA, constructorName);
+    classA.constructors = <ConstructorElement>[constructor];
+    ConstructorName name =
+        AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name);
+    InstanceCreationExpression creation =
+        AstFactory.instanceCreationExpression(Keyword.NEW, name);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -1412,11 +1548,14 @@
   void test_visitInstanceCreationExpression_unnamed() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
-    classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    ConstructorElement constructor =
+        ElementFactory.constructorElement2(classA, constructorName);
+    classA.constructors = <ConstructorElement>[constructor];
+    ConstructorName name =
+        AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name);
+    InstanceCreationExpression creation =
+        AstFactory.instanceCreationExpression(Keyword.NEW, name);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
@@ -1425,17 +1564,25 @@
   void test_visitInstanceCreationExpression_unnamed_namedParameter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classA, constructorName);
+    ConstructorElementImpl constructor =
+        ElementFactory.constructorElement2(classA, constructorName);
     String parameterName = "a";
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
-    constructor.parameters = <ParameterElement> [parameter];
-    classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    constructor.parameters = <ParameterElement>[parameter];
+    classA.constructors = <ConstructorElement>[constructor];
+    ConstructorName name =
+        AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name, [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
+    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(
+        Keyword.NEW,
+        name,
+        [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
     _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
-    expect((creation.argumentList.arguments[0] as NamedExpression).name.label.staticElement, same(parameter));
+    expect(
+        (creation.argumentList.arguments[0] as
+            NamedExpression).name.label.staticElement,
+        same(parameter));
     _listener.assertNoErrors();
   }
 
@@ -1446,7 +1593,9 @@
     String methodName = "abs";
     MethodInvocation invocation = AstFactory.methodInvocation(left, methodName);
     _resolveNode(invocation);
-    expect(invocation.methodName.staticElement, same(getMethod(numType, methodName)));
+    expect(
+        invocation.methodName.staticElement,
+        same(getMethod(numType, methodName)));
     _listener.assertNoErrors();
   }
 
@@ -1456,14 +1605,20 @@
     String parameterName = "p";
     MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
-    method.parameters = <ParameterElement> [parameter];
-    classA.methods = <MethodElement> [method];
+    method.parameters = <ParameterElement>[parameter];
+    classA.methods = <MethodElement>[method];
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.staticType = classA.type;
-    MethodInvocation invocation = AstFactory.methodInvocation(left, methodName, [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
+    MethodInvocation invocation = AstFactory.methodInvocation(
+        left,
+        methodName,
+        [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
     _resolveNode(invocation);
     expect(invocation.methodName.staticElement, same(method));
-    expect((invocation.argumentList.arguments[0] as NamedExpression).name.label.staticElement, same(parameter));
+    expect(
+        (invocation.argumentList.arguments[0] as
+            NamedExpression).name.label.staticElement,
+        same(parameter));
     _listener.assertNoErrors();
   }
 
@@ -1471,7 +1626,8 @@
     InterfaceType numType = _typeProvider.numType;
     SimpleIdentifier operand = AstFactory.identifier3("i");
     operand.staticType = numType;
-    PostfixExpression expression = AstFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
+    PostfixExpression expression =
+        AstFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
@@ -1484,7 +1640,8 @@
     variable.type = dynamicType;
     target.staticElement = variable;
     target.staticType = dynamicType;
-    PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3("b"));
+    PrefixedIdentifier identifier =
+        AstFactory.identifier(target, AstFactory.identifier3("b"));
     _resolveNode(identifier);
     expect(identifier.staticElement, isNull);
     expect(identifier.identifier.staticElement, isNull);
@@ -1494,14 +1651,16 @@
   void test_visitPrefixedIdentifier_nonDynamic() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getter];
     SimpleIdentifier target = AstFactory.identifier3("a");
     VariableElementImpl variable = ElementFactory.localVariableElement(target);
     variable.type = classA.type;
     target.staticElement = variable;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(getterName));
+    PrefixedIdentifier identifier =
+        AstFactory.identifier(target, AstFactory.identifier3(getterName));
     _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
     expect(identifier.identifier.staticElement, same(getter));
@@ -1512,14 +1671,17 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "b";
-    PropertyAccessorElement getter = ElementFactory.getterElement(propName, false, _typeProvider.intType);
-    PropertyAccessorElement setter = ElementFactory.setterElement(propName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getter, setter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(propName, false, _typeProvider.intType);
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(propName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getter, setter];
     // prepare "A.m"
     SimpleIdentifier target = AstFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
+    PrefixedIdentifier identifier =
+        AstFactory.identifier(target, AstFactory.identifier3(propName));
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
@@ -1531,17 +1693,23 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "m";
-    PropertyAccessorElement setter = ElementFactory.setterElement(propName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setter];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(propName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setter];
     // set methods
-    MethodElement method = ElementFactory.methodElement("m", _typeProvider.intType);
-    classA.methods = <MethodElement> [method];
+    MethodElement method =
+        ElementFactory.methodElement("m", _typeProvider.intType);
+    classA.methods = <MethodElement>[method];
     // prepare "A.m"
     SimpleIdentifier target = AstFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
-    AstFactory.assignmentExpression(identifier, TokenType.EQ, AstFactory.nullLiteral());
+    PrefixedIdentifier identifier =
+        AstFactory.identifier(target, AstFactory.identifier3(propName));
+    AstFactory.assignmentExpression(
+        identifier,
+        TokenType.EQ,
+        AstFactory.nullLiteral());
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(method));
@@ -1553,15 +1721,21 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "b";
-    PropertyAccessorElement getter = ElementFactory.getterElement(propName, false, _typeProvider.intType);
-    PropertyAccessorElement setter = ElementFactory.setterElement(propName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getter, setter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(propName, false, _typeProvider.intType);
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(propName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getter, setter];
     // prepare "A.b = null"
     SimpleIdentifier target = AstFactory.identifier3("A");
     target.staticElement = classA;
     target.staticType = classA.type;
-    PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
-    AstFactory.assignmentExpression(identifier, TokenType.EQ, AstFactory.nullLiteral());
+    PrefixedIdentifier identifier =
+        AstFactory.identifier(target, AstFactory.identifier3(propName));
+    AstFactory.assignmentExpression(
+        identifier,
+        TokenType.EQ,
+        AstFactory.nullLiteral());
     // resolve
     _resolveNode(identifier);
     expect(identifier.staticElement, same(setter));
@@ -1573,7 +1747,8 @@
     InterfaceType numType = _typeProvider.numType;
     SimpleIdentifier operand = AstFactory.identifier3("i");
     operand.staticType = numType;
-    PrefixExpression expression = AstFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
+    PrefixExpression expression =
+        AstFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
     _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
@@ -1582,8 +1757,9 @@
   void test_visitPropertyAccess_getter_identifier() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getter];
     SimpleIdentifier target = AstFactory.identifier3("a");
     target.staticType = classA.type;
     PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
@@ -1603,12 +1779,20 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
-    PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getter];
     SuperExpression target = AstFactory.superExpression();
     target.staticType = ElementFactory.classElement("B", classA.type).type;
     PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
-    AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.expressionFunctionBody(access));
+    AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.expressionFunctionBody(access));
     _resolveNode(access);
     expect(access.propertyName.staticElement, same(getter));
     _listener.assertNoErrors();
@@ -1617,12 +1801,16 @@
   void test_visitPropertyAccess_setter_this() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "b";
-    PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setter];
+    PropertyAccessorElement setter =
+        ElementFactory.setterElement(setterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setter];
     ThisExpression target = AstFactory.thisExpression();
     target.staticType = classA.type;
     PropertyAccess access = AstFactory.propertyAccess2(target, setterName);
-    AstFactory.assignmentExpression(access, TokenType.EQ, AstFactory.integer(0));
+    AstFactory.assignmentExpression(
+        access,
+        TokenType.EQ,
+        AstFactory.integer(0));
     _resolveNode(access);
     expect(access.propertyName.staticElement, same(setter));
     _listener.assertNoErrors();
@@ -1656,26 +1844,34 @@
     InterfaceType intType = _typeProvider.intType;
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String fieldName = "a";
-    FieldElement field = ElementFactory.fieldElement(fieldName, false, false, false, intType);
-    classA.fields = <FieldElement> [field];
-    classA.accessors = <PropertyAccessorElement> [field.getter, field.setter];
+    FieldElement field =
+        ElementFactory.fieldElement(fieldName, false, false, false, intType);
+    classA.fields = <FieldElement>[field];
+    classA.accessors = <PropertyAccessorElement>[field.getter, field.setter];
     SimpleIdentifier node = AstFactory.identifier3(fieldName);
     AstFactory.assignmentExpression(node, TokenType.EQ, AstFactory.integer(0));
     _resolveInClass(node, classA);
     Element element = node.staticElement;
-    EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement, PropertyAccessorElement, element);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PropertyAccessorElement,
+        PropertyAccessorElement,
+        element);
     expect((element as PropertyAccessorElement).isSetter, isTrue);
     _listener.assertNoErrors();
   }
 
   void test_visitSuperConstructorInvocation() {
     ClassElementImpl superclass = ElementFactory.classElement2("A");
-    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null);
-    superclass.constructors = <ConstructorElement> [superConstructor];
-    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type);
-    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null);
-    subclass.constructors = <ConstructorElement> [subConstructor];
-    SuperConstructorInvocation invocation = AstFactory.superConstructorInvocation();
+    ConstructorElementImpl superConstructor =
+        ElementFactory.constructorElement2(superclass, null);
+    superclass.constructors = <ConstructorElement>[superConstructor];
+    ClassElementImpl subclass =
+        ElementFactory.classElement("B", superclass.type);
+    ConstructorElementImpl subConstructor =
+        ElementFactory.constructorElement2(subclass, null);
+    subclass.constructors = <ConstructorElement>[subConstructor];
+    SuperConstructorInvocation invocation =
+        AstFactory.superConstructorInvocation();
     _resolveInClass(invocation, subclass);
     expect(invocation.staticElement, superConstructor);
     _listener.assertNoErrors();
@@ -1683,18 +1879,26 @@
 
   void test_visitSuperConstructorInvocation_namedParameter() {
     ClassElementImpl superclass = ElementFactory.classElement2("A");
-    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null);
+    ConstructorElementImpl superConstructor =
+        ElementFactory.constructorElement2(superclass, null);
     String parameterName = "p";
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
-    superConstructor.parameters = <ParameterElement> [parameter];
-    superclass.constructors = <ConstructorElement> [superConstructor];
-    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type);
-    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null);
-    subclass.constructors = <ConstructorElement> [subConstructor];
-    SuperConstructorInvocation invocation = AstFactory.superConstructorInvocation([AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
+    superConstructor.parameters = <ParameterElement>[parameter];
+    superclass.constructors = <ConstructorElement>[superConstructor];
+    ClassElementImpl subclass =
+        ElementFactory.classElement("B", superclass.type);
+    ConstructorElementImpl subConstructor =
+        ElementFactory.constructorElement2(subclass, null);
+    subclass.constructors = <ConstructorElement>[subConstructor];
+    SuperConstructorInvocation invocation =
+        AstFactory.superConstructorInvocation(
+            [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
     _resolveInClass(invocation, subclass);
     expect(invocation.staticElement, superConstructor);
-    expect((invocation.argumentList.arguments[0] as NamedExpression).name.label.staticElement, same(parameter));
+    expect(
+        (invocation.argumentList.arguments[0] as
+            NamedExpression).name.label.staticElement,
+        same(parameter));
     _listener.assertNoErrors();
   }
 
@@ -1705,10 +1909,13 @@
    */
   ElementResolver _createResolver() {
     AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
+    SourceFactory sourceFactory =
+        new SourceFactory([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
     context.sourceFactory = sourceFactory;
-    FileBasedSource source = new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
-    CompilationUnitElementImpl definingCompilationUnit = new CompilationUnitElementImpl("test.dart");
+    FileBasedSource source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    CompilationUnitElementImpl definingCompilationUnit =
+        new CompilationUnitElementImpl("test.dart");
     definingCompilationUnit.source = source;
     _definingLibrary = ElementFactory.library(context, "test");
     _definingLibrary.definingCompilationUnit = definingCompilationUnit;
@@ -1718,33 +1925,37 @@
     try {
       return _visitor.elementResolver_J2DAccessor as ElementResolver;
     } catch (exception) {
-      throw new IllegalArgumentException("Could not create resolver", exception);
+      throw new IllegalArgumentException(
+          "Could not create resolver",
+          exception);
     }
   }
 
   /**
-   * Return the element associated with the label of the given statement after the resolver has
-   * resolved the statement.
-   *
-   * @param statement the statement to be resolved
-   * @param labelElement the label element to be defined in the statement's label scope
-   * @return the element to which the statement's label was resolved
+   * Return the element associated with the label of [statement] after the
+   * resolver has resolved it.  [labelElement] is the label element to be
+   * defined in the statement's label scope, and [labelTarget] is the statement
+   * the label resolves to.
    */
-  Element _resolveBreak(BreakStatement statement, LabelElementImpl labelElement) {
-    _resolveStatement(statement, labelElement);
+  Element _resolveBreak(BreakStatement statement, LabelElementImpl labelElement,
+      Statement labelTarget) {
+    _resolveStatement(statement, labelElement, labelTarget);
     return statement.label.staticElement;
   }
 
   /**
-   * Return the element associated with the label of the given statement after the resolver has
-   * resolved the statement.
+   * Return the element associated with the label [statement] after the
+   * resolver has resolved it.  [labelElement] is the label element to be
+   * defined in the statement's label scope, and [labelTarget] is the AST node
+   * the label resolves to.
    *
    * @param statement the statement to be resolved
    * @param labelElement the label element to be defined in the statement's label scope
    * @return the element to which the statement's label was resolved
    */
-  Element _resolveContinue(ContinueStatement statement, LabelElementImpl labelElement) {
-    _resolveStatement(statement, labelElement);
+  Element _resolveContinue(ContinueStatement statement,
+      LabelElementImpl labelElement, AstNode labelTarget) {
+    _resolveStatement(statement, labelElement, labelTarget);
     return statement.label.staticElement;
   }
 
@@ -1774,12 +1985,14 @@
     try {
       Scope outerScope = _visitor.nameScope_J2DAccessor as Scope;
       try {
-        _visitor.enclosingClass_J2DAccessor = enclosingClass;
-        EnclosedScope innerScope = new ClassScope(new TypeParameterScope(outerScope, enclosingClass), enclosingClass);
+        _visitor.enclosingClass = enclosingClass;
+        EnclosedScope innerScope = new ClassScope(
+            new TypeParameterScope(outerScope, enclosingClass),
+            enclosingClass);
         _visitor.nameScope_J2DAccessor = innerScope;
         node.accept(_resolver);
       } finally {
-        _visitor.enclosingClass_J2DAccessor = null;
+        _visitor.enclosingClass = null;
         _visitor.nameScope_J2DAccessor = outerScope;
       }
     } catch (exception) {
@@ -1796,7 +2009,8 @@
    *          being resolved
    * @return the element to which the expression was resolved
    */
-  Element _resolveIndexExpression(IndexExpression node, [List<Element> definedElements]) {
+  Element _resolveIndexExpression(IndexExpression node,
+      [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     return node.staticElement;
   }
@@ -1838,15 +2052,17 @@
    * @param labelElement the label element to be defined in the statement's label scope
    * @return the element to which the statement's label was resolved
    */
-  void _resolveStatement(Statement statement, LabelElementImpl labelElement) {
+  void _resolveStatement(Statement statement, LabelElementImpl labelElement,
+      AstNode labelTarget) {
     try {
       LabelScope outerScope = _visitor.labelScope_J2DAccessor as LabelScope;
       try {
         LabelScope innerScope;
         if (labelElement == null) {
-          innerScope = new LabelScope.con1(outerScope, false, false);
+          innerScope = outerScope;
         } else {
-          innerScope = new LabelScope.con2(outerScope, labelElement.name, labelElement);
+          innerScope =
+              new LabelScope(outerScope, labelElement.name, labelTarget, labelElement);
         }
         _visitor.labelScope_J2DAccessor = innerScope;
         statement.accept(_resolver);
@@ -1862,10 +2078,13 @@
 class EnclosedScopeTest extends ResolverTestCase {
   void test_define_duplicate() {
     GatheringErrorListener listener = new GatheringErrorListener();
-    Scope rootScope = new Scope_EnclosedScopeTest_test_define_duplicate(listener);
+    Scope rootScope =
+        new Scope_EnclosedScopeTest_test_define_duplicate(listener);
     EnclosedScope scope = new EnclosedScope(rootScope);
-    VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element1 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element2 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
     scope.define(element1);
     scope.define(element2);
     listener.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
@@ -1876,8 +2095,10 @@
     Scope rootScope = new Scope_EnclosedScopeTest_test_define_normal(listener);
     EnclosedScope outerScope = new EnclosedScope(rootScope);
     EnclosedScope innerScope = new EnclosedScope(outerScope);
-    VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v2"));
+    VariableElement element1 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element2 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v2"));
     outerScope.define(element1);
     innerScope.define(element2);
     listener.assertNoErrors();
@@ -2035,7 +2256,9 @@
   void test_argumentTypeNotAssignable_message() {
     // The implementation of HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE assumes that
     // StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE has the same message.
-    expect(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.message, HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.message);
+    expect(
+        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.message,
+        HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.message);
   }
 
   void test_argumentTypeNotAssignable_type() {
@@ -2477,10 +2700,10 @@
     verify([source]);
   }
 
-  void test_deprecatedAnnotationUse_deprecated() {
+  void test_deprecatedAnnotationUse_Deprecated() {
     Source source = addSource(r'''
 class A {
-  @deprecated
+  @Deprecated('0.9')
   m() {}
   n() {m();}
 }''');
@@ -2489,10 +2712,10 @@
     verify([source]);
   }
 
-  void test_deprecatedAnnotationUse_Deprecated() {
+  void test_deprecatedAnnotationUse_deprecated() {
     Source source = addSource(r'''
 class A {
-  @Deprecated('0.9')
+  @deprecated
   m() {}
   n() {m();}
 }''');
@@ -2727,7 +2950,9 @@
 library lib1;
 class A {}''');
     resolve(source);
-    assertErrors(source, [HintCode.DUPLICATE_IMPORT, HintCode.DUPLICATE_IMPORT]);
+    assertErrors(
+        source,
+        [HintCode.DUPLICATE_IMPORT, HintCode.DUPLICATE_IMPORT]);
     verify([source]);
   }
 
@@ -2747,15 +2972,15 @@
   }
 
   void test_importDeferredLibraryWithLoadFunction() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
 loadLibrary() {}
-f() {}''',
-        r'''
+f() {}''', r'''
 library root;
 import 'lib1.dart' deferred as lib1;
-main() { lib1.f(); }'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION]);
+main() { lib1.f(); }'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION]);
   }
 
   void test_invalidAssignment_instanceVariable() {
@@ -2789,7 +3014,9 @@
   void test_invalidAssignment_message() {
     // The implementation of HintCode.INVALID_ASSIGNMENT assumes that
     // StaticTypeWarningCode.INVALID_ASSIGNMENT has the same message.
-    expect(StaticTypeWarningCode.INVALID_ASSIGNMENT.message, HintCode.INVALID_ASSIGNMENT.message);
+    expect(
+        StaticTypeWarningCode.INVALID_ASSIGNMENT.message,
+        HintCode.INVALID_ASSIGNMENT.message);
   }
 
   void test_invalidAssignment_staticVariable() {
@@ -2936,9 +3163,12 @@
   }
 
   void test_undefinedGetter_message() {
-    // The implementation of HintCode.UNDEFINED_SETTER assumes that UNDEFINED_SETTER in
-    // StaticTypeWarningCode and StaticWarningCode are the same, this verifies that assumption.
-    expect(StaticWarningCode.UNDEFINED_GETTER.message, StaticTypeWarningCode.UNDEFINED_GETTER.message);
+    // The implementation of HintCode.UNDEFINED_SETTER assumes that
+    // UNDEFINED_SETTER in StaticTypeWarningCode and StaticWarningCode are the
+    // same, this verifies that assumption.
+    expect(
+        StaticWarningCode.UNDEFINED_GETTER.message,
+        StaticTypeWarningCode.UNDEFINED_GETTER.message);
   }
 
   void test_undefinedMethod() {
@@ -3072,9 +3302,12 @@
   }
 
   void test_undefinedSetter_message() {
-    // The implementation of HintCode.UNDEFINED_SETTER assumes that UNDEFINED_SETTER in
-    // StaticTypeWarningCode and StaticWarningCode are the same, this verifies that assumption.
-    expect(StaticWarningCode.UNDEFINED_SETTER.message, StaticTypeWarningCode.UNDEFINED_SETTER.message);
+    // The implementation of HintCode.UNDEFINED_SETTER assumes that
+    // UNDEFINED_SETTER in StaticTypeWarningCode and StaticWarningCode are the
+    // same, this verifies that assumption.
+    expect(
+        StaticWarningCode.UNDEFINED_SETTER.message,
+        StaticTypeWarningCode.UNDEFINED_SETTER.message);
   }
 
   void test_unnecessaryCast_type_supertype() {
@@ -3151,69 +3384,18 @@
     verify([source]);
   }
 
-  void test_unusedImport() {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';''');
-    Source source2 = addNamedSource("/lib1.dart", "library lib1;");
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_IMPORT]);
-    assertNoErrors(source2);
-    verify([source, source2]);
-  }
-
-  void test_unusedImport_as() {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-import 'lib1.dart' as one;
-one.A a;''');
-    Source source2 = addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_IMPORT]);
-    assertNoErrors(source2);
-    verify([source, source2]);
-  }
-
-  void test_unusedImport_hide() {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-import 'lib1.dart' hide A;
-A a;''');
-    Source source2 = addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_IMPORT]);
-    assertNoErrors(source2);
-    verify([source, source2]);
-  }
-
-  void test_unusedImport_show() {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart' show A;
-import 'lib1.dart' show B;
-A a;''');
-    Source source2 = addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}
-class B {}''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_IMPORT]);
-    assertNoErrors(source2);
-    verify([source, source2]);
-  }
-
-  void test_unusedElement_class_noReference() {
+  void test_unusedElement_class_inClassMember() {
     enableUnusedElement = true;
     Source source = addSource(r'''
-class _A {}
-main() {
-}''');
+class _A {
+  static staticMethod() {
+    new _A();
+  }
+  instanceMethod() {
+    new _A();
+  }
+}
+''');
     resolve(source);
     assertErrors(source, [HintCode.UNUSED_ELEMENT]);
     verify([source]);
@@ -3232,23 +3414,6 @@
     verify([source]);
   }
 
-  void test_unusedElement_class_inClassMember() {
-    enableUnusedElement = true;
-    Source source = addSource(r'''
-class _A {
-  static staticMethod() {
-    new _A();
-  }
-  instanceMethod() {
-    new _A();
-  }
-}
-''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
-    verify([source]);
-  }
-
   void test_unusedElement_class_isExpression() {
     enableUnusedElement = true;
     Source source = addSource(r'''
@@ -3263,21 +3428,6 @@
     verify([source]);
   }
 
-  void test_unusedElement_class_variableDeclaration() {
-    enableUnusedElement = true;
-    Source source = addSource(r'''
-class _A {}
-main() {
-  _A v;
-  print(v);
-}
-print(x) {}
-''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
-    verify([source]);
-  }
-
   void test_unusedElement_class_isUsed_extends() {
     enableUnusedElement = true;
     Source source = addSource(r'''
@@ -3340,7 +3490,767 @@
     verify([source]);
   }
 
-  void test_unusedLocalVariable() {
+  void test_unusedElement_class_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main() {
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_variableDeclaration() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main() {
+  _A v;
+  print(v);
+}
+print(x) {}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionLocal_isUsed_closure() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+main() {
+  print(() {});
+}
+print(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionLocal_isUsed_invocation() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+main() {
+  f() {}
+  f();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionLocal_isUsed_reference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+main() {
+  f() {}
+  print(f);
+}
+print(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionLocal_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+main() {
+  f() {}
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionLocal_notUsed_referenceFromItself() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+main() {
+  _f(int p) {
+    _f(p - 1);
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionTop_isUsed_invocation() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+_f() {}
+main() {
+  _f();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionTop_isUsed_reference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+_f() {}
+main() {
+  print(_f);
+}
+print(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionTop_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+_f() {}
+main() {
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_functionTop_notUsed_referenceFromItself() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+_f(int p) {
+  _f(p - 1);
+}
+main() {
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_getter_isUsed_invocation_implicitThis() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  get _g => null;
+  useGetter() {
+    var v = _g;
+  }
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_getter_isUsed_invocation_PrefixedIdentifier() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  get _g => null;
+}
+main(A a) {
+  var v = a._g;
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_getter_isUsed_invocation_PropertyAccess() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  get _g => null;
+}
+main() {
+  var v = new A()._g;
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_getter_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  get _g => null;
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_getter_notUsed_referenceFromItself() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  get _g {
+    return _g;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_hasReference_implicitThis() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+  useMethod() {
+    print(_m);
+  }
+}
+print(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_hasReference_implicitThis_subclass() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+  useMethod() {
+    print(_m);
+  }
+}
+class B extends A {
+  _m() {}
+}
+print(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_hasReference_PrefixedIdentifier() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+}
+main(A a) {
+  a._m;
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_hasReference_PropertyAccess() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+}
+main() {
+  new A()._m;
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_implicitThis() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+  useMethod() {
+    _m();
+  }
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_implicitThis_subclass() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+  useMethod() {
+    _m();
+  }
+}
+class B extends A {
+  _m() {}
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_MemberElement() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A<T> {
+  _m(T t) {}
+}
+main(A<int> a) {
+  a._m(0);
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_propagated() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+}
+main() {
+  var a = new A();
+  a._m();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_static() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+}
+main() {
+  A a = new A();
+  a._m();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_invocation_subclass() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  _m() {}
+}
+class B extends A {
+  _m() {}
+}
+main(A a) {
+  a._m();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_notPrivate() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+main() {
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_isUsed_staticInvocation() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  static _m() {}
+}
+main() {
+  A._m();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  static _m() {}
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_method_notUsed_referenceFromItself() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  static _m(int p) {
+    _m(p - 1);
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_setter_isUsed_invocation_implicitThis() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  set _s(x) {}
+  useSetter() {
+    _s = 42;
+  }
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_setter_isUsed_invocation_PrefixedIdentifier() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  set _s(x) {}
+}
+main(A a) {
+  a._s = 42;
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_setter_isUsed_invocation_PropertyAccess() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  set _s(x) {}
+}
+main() {
+  new A()._s = 42;
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_setter_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  set _s(x) {}
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_setter_notUsed_referenceFromItself() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  set _s(int x) {
+    if (x > 5) {
+      _s = x - 1;
+    }
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_argument() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f = 0;
+  main() {
+    print(++_f);
+  }
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_implicitThis() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+  main() {
+    print(_f);
+  }
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_implicitThis_expressionFunctionBody() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+  m() => _f;
+}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_implicitThis_subclass() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+  main() {
+    print(_f);
+  }
+}
+class B extends A {
+  int _f;
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_qualified_propagatedElement() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+}
+main() {
+  var a = new A();
+  print(a._f);
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_qualified_staticElement() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+}
+main() {
+  A a = new A();
+  print(a._f);
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_isUsed_reference_qualified_unresolved() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+}
+main(a) {
+  print(a._f);
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedField_notUsed_compoundAssign() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+  main() {
+    _f += 2;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_FIELD]);
+    verify([source]);
+  }
+
+  void test_unusedField_notUsed_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_FIELD]);
+    verify([source]);
+  }
+
+  void test_unusedField_notUsed_postfixExpr() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f = 0;
+  main() {
+    _f++;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_FIELD]);
+    verify([source]);
+  }
+
+  void test_unusedField_notUsed_prefixExpr() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f = 0;
+  main() {
+    ++_f;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_FIELD]);
+    verify([source]);
+  }
+
+  void test_unusedField_notUsed_simpleAssignment() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class A {
+  int _f;
+  m() {
+    _f = 1;
+  }
+}
+main(A a) {
+  a._f = 2;
+}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_FIELD]);
+    verify([source]);
+  }
+
+  void test_unusedImport() {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';''');
+    Source source2 = addNamedSource("/lib1.dart", "library lib1;");
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_IMPORT]);
+    assertNoErrors(source2);
+    verify([source, source2]);
+  }
+
+  void test_unusedImport_as() {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+import 'lib1.dart' as one;
+one.A a;''');
+    Source source2 = addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_IMPORT]);
+    assertNoErrors(source2);
+    verify([source, source2]);
+  }
+
+  void test_unusedImport_hide() {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+import 'lib1.dart' hide A;
+A a;''');
+    Source source2 = addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_IMPORT]);
+    assertNoErrors(source2);
+    verify([source, source2]);
+  }
+
+  void test_unusedImport_show() {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart' show A;
+import 'lib1.dart' show B;
+A a;''');
+    Source source2 = addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}
+class B {}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_IMPORT]);
+    assertNoErrors(source2);
+    verify([source, source2]);
+  }
+
+  void test_unusedLocalVariable_inCatch_exception() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception) {
+  }
+}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inCatch_stackTrace() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception, stackTrace) {
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inCatch_stackTrace_used() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception, stackTrace) {
+    print('exception at $stackTrace');
+  }
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inFunction() {
     enableUnusedLocalVariable = true;
     Source source = addSource(r'''
 main() {
@@ -3352,6 +4262,33 @@
     verify([source]);
   }
 
+  void test_unusedLocalVariable_inMethod() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+class A {
+  foo() {
+    var v = 1;
+    v = 2;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isInvoked() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+typedef Foo();
+main() {
+  Foo foo;
+  foo();
+}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
   void test_unusedLocalVariable_isRead_notUsed_compoundAssign() {
     enableUnusedLocalVariable = true;
     Source source = addSource(r'''
@@ -3417,60 +4354,6 @@
     verify([source]);
   }
 
-  void test_unusedLocalVariable_isInvoked() {
-    enableUnusedLocalVariable = true;
-    Source source = addSource(r'''
-typedef Foo();
-main() {
-  Foo foo;
-  foo();
-}''');
-    resolve(source);
-    assertErrors(source);
-    verify([source]);
-  }
-
-  void test_unusedLocalVariable_inCatch_exception() {
-    enableUnusedLocalVariable = true;
-    Source source = addSource(r'''
-main() {
-  try {
-  } catch (exception) {
-  }
-}''');
-    resolve(source);
-    assertErrors(source);
-    verify([source]);
-  }
-
-  void test_unusedLocalVariable_inCatch_stackTrace() {
-    enableUnusedLocalVariable = true;
-    Source source = addSource(r'''
-main() {
-  try {
-  } catch (exception, stackTrace) {
-  }
-}''');
-    resolve(source);
-    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
-    verify([source]);
-  }
-
-  void test_unusedLocalVariable_inCatch_stackTrace_used() {
-    enableUnusedLocalVariable = true;
-    Source source = addSource(r'''
-main() {
-  try {
-  } catch (exception, stackTrace) {
-    print('exception at $stackTrace');
-  }
-}
-print(x) {}''');
-    resolve(source);
-    assertErrors(source);
-    verify([source]);
-  }
-
   void test_useOfVoidResult_assignmentExpression_function() {
     Source source = addSource(r'''
 void f() {}
@@ -3547,44 +4430,13 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]);
+    assertErrors(
+        source,
+        [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]);
     verify([source]);
   }
 }
 
-class IncrementalResolverTest extends ResolverTestCase {
-  void test_resolve() {
-    MethodDeclaration method = _resolveMethod(r'''
-class C {
-  int m(int a) {
-    return a + a;
-  }
-}''');
-    BlockFunctionBody body = method.body as BlockFunctionBody;
-    ReturnStatement statement = body.block.statements[0] as ReturnStatement;
-    BinaryExpression expression = statement.expression as BinaryExpression;
-    SimpleIdentifier left = expression.leftOperand as SimpleIdentifier;
-    Element leftElement = left.staticElement;
-    SimpleIdentifier right = expression.rightOperand as SimpleIdentifier;
-    Element rightElement = right.staticElement;
-    expect(leftElement, isNotNull);
-    expect(rightElement, same(leftElement));
-  }
-
-  MethodDeclaration _resolveMethod(String content) {
-    Source source = addSource(content);
-    LibraryElement library = resolve(source);
-    CompilationUnit unit = resolveCompilationUnit(source, library);
-    ClassDeclaration classNode = unit.declarations[0] as ClassDeclaration;
-    MethodDeclaration method = classNode.members[0] as MethodDeclaration;
-    method.body.accept(new ResolutionEraser());
-    GatheringErrorListener errorListener = new GatheringErrorListener();
-    IncrementalResolver resolver = new IncrementalResolver(library, source, typeProvider, errorListener);
-    resolver.resolve(method.body);
-    return method;
-  }
-}
-
 class InheritanceManagerTest extends EngineTestCase {
   /**
    * The type provider used to access the types.
@@ -3611,7 +4463,8 @@
     _typeProvider = new TestTypeProvider();
     _inheritanceManager = _createInheritanceManager();
     InterfaceType objectType = _typeProvider.objectType;
-    _numOfMembersInObject = objectType.methods.length + objectType.accessors.length;
+    _numOfMembersInObject =
+        objectType.methods.length + objectType.accessors.length;
   }
 
   void test_getMapOfMembersInheritedFromClasses_accessor_extends() {
@@ -3619,11 +4472,14 @@
     // class B extends A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(getterName), same(getterG));
@@ -3636,12 +4492,15 @@
     // class B implements A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    classB.interfaces = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject);
     expect(mapB.get(getterName), isNull);
@@ -3654,12 +4513,15 @@
     // class B extends Object with A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    classB.mixins = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(getterName), same(getterG));
@@ -3670,7 +4532,8 @@
   void test_getMapOfMembersInheritedFromClasses_implicitExtends() {
     // class A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     _assertNoErrors(classA);
   }
@@ -3680,12 +4543,15 @@
     // class B extends A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.supertype = classA.type;
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(methodName), same(methodM));
@@ -3698,12 +4564,15 @@
     // class B implements A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    classB.interfaces = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject);
     expect(mapB.get(methodName), isNull);
@@ -3716,12 +4585,15 @@
     // class B extends Object with A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
+    classB.mixins = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(methodName), same(methodM));
@@ -3734,11 +4606,14 @@
     // class B extends A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(getterName), same(getterG));
@@ -3751,12 +4626,15 @@
     // class B implements A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classB.interfaces = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(getterName), same(getterG));
@@ -3769,12 +4647,15 @@
     // class B extends Object with A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classB.mixins = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(getterName), same(getterG));
@@ -3785,121 +4666,158 @@
   void test_getMapOfMembersInheritedFromInterfaces_implicitExtends() {
     // class A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_getter_method() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_getter_method() {
     // class I1 { int m(); }
     // class I2 { int get m; }
     // class A implements I2, I1 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement getter = ElementFactory.getterElement(methodName, false, _typeProvider.intType);
-    classI2.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(methodName, false, _typeProvider.intType);
+    classI2.accessors = <PropertyAccessorElement>[getter];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI2.type, classI1.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI2.type, classI1.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapA.get(methodName), isNull);
-    _assertErrors(classA, [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
+    _assertErrors(
+        classA,
+        [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_int_str() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_int_str() {
     // class I1 { int m(); }
     // class I2 { String m(); }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElement methodM2 = ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
-    classI2.methods = <MethodElement> [methodM2];
+    MethodElement methodM2 =
+        ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapA.get(methodName), isNull);
-    _assertErrors(classA, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    _assertErrors(
+        classA,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_method_getter() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_method_getter() {
     // class I1 { int m(); }
     // class I2 { int get m; }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement getter = ElementFactory.getterElement(methodName, false, _typeProvider.intType);
-    classI2.accessors = <PropertyAccessorElement> [getter];
+    PropertyAccessorElement getter =
+        ElementFactory.getterElement(methodName, false, _typeProvider.intType);
+    classI2.accessors = <PropertyAccessorElement>[getter];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapA.get(methodName), isNull);
-    _assertErrors(classA, [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
+    _assertErrors(
+        classA,
+        [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_numOfRequiredParams() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_numOfRequiredParams() {
     // class I1 { dynamic m(int, [int]); }
     // class I2 { dynamic m(int, int, int); }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+    MethodElementImpl methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
-    ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+    ParameterElementImpl parameter2 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
-    methodM1.parameters = <ParameterElement> [parameter1, parameter2];
-    classI1.methods = <MethodElement> [methodM1];
+    methodM1.parameters = <ParameterElement>[parameter1, parameter2];
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+    MethodElementImpl methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter3 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.REQUIRED;
-    ParameterElementImpl parameter4 = new ParameterElementImpl.forNode(AstFactory.identifier3("a4"));
+    ParameterElementImpl parameter4 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a4"));
     parameter4.type = _typeProvider.intType;
     parameter4.parameterKind = ParameterKind.REQUIRED;
-    ParameterElementImpl parameter5 = new ParameterElementImpl.forNode(AstFactory.identifier3("a5"));
+    ParameterElementImpl parameter5 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a5"));
     parameter5.type = _typeProvider.intType;
     parameter5.parameterKind = ParameterKind.REQUIRED;
-    methodM2.parameters = <ParameterElement> [parameter3, parameter4, parameter5];
-    classI2.methods = <MethodElement> [methodM2];
+    methodM2.parameters =
+        <ParameterElement>[parameter3, parameter4, parameter5];
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapA.get(methodName), isNull);
-    _assertErrors(classA, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    _assertErrors(
+        classA,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_str_int() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_str_int() {
     // class I1 { int m(); }
     // class I2 { String m(); }
     // class A implements I2, I1 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElement methodM2 = ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
-    classI2.methods = <MethodElement> [methodM2];
+    MethodElement methodM2 =
+        ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI2.type, classI1.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI2.type, classI1.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapA.get(methodName), isNull);
-    _assertErrors(classA, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    _assertErrors(
+        classA,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
   }
 
   void test_getMapOfMembersInheritedFromInterfaces_method_extends() {
@@ -3907,11 +4825,14 @@
     // class B extends A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(methodName), same(methodM));
@@ -3924,12 +4845,15 @@
     // class B implements A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classB.interfaces = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(methodName), same(methodM));
@@ -3942,12 +4866,15 @@
     // class B extends Object with A {}
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classB.mixins = <InterfaceType>[classA.type];
+    MemberMap mapB =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     expect(mapB.size, _numOfMembersInObject + 1);
     expect(mapB.get(methodName), same(methodM));
@@ -3961,91 +4888,114 @@
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName1 = "m1";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName1, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     String methodName2 = "m2";
-    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType);
-    classI2.methods = <MethodElement> [methodM2];
+    MethodElement methodM2 =
+        ElementFactory.methodElement(methodName2, _typeProvider.intType);
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 2);
     expect(mapA.get(methodName1), same(methodM1));
     expect(mapA.get(methodName2), same(methodM2));
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_getters() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_getters() {
     // class I1 { int get g; }
     // class I2 { num get g; }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "g";
-    PropertyAccessorElement getter1 = ElementFactory.getterElement(accessorName, false, _typeProvider.intType);
-    classI1.accessors = <PropertyAccessorElement> [getter1];
+    PropertyAccessorElement getter1 =
+        ElementFactory.getterElement(accessorName, false, _typeProvider.intType);
+    classI1.accessors = <PropertyAccessorElement>[getter1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement getter2 = ElementFactory.getterElement(accessorName, false, _typeProvider.numType);
-    classI2.accessors = <PropertyAccessorElement> [getter2];
+    PropertyAccessorElement getter2 =
+        ElementFactory.getterElement(accessorName, false, _typeProvider.numType);
+    classI2.accessors = <PropertyAccessorElement>[getter2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
-    PropertyAccessorElement syntheticAccessor = ElementFactory.getterElement(accessorName, false, _typeProvider.dynamicType);
+    PropertyAccessorElement syntheticAccessor =
+        ElementFactory.getterElement(accessorName, false, _typeProvider.dynamicType);
     expect(mapA.get(accessorName).type, syntheticAccessor.type);
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_methods() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_methods() {
     // class I1 { dynamic m(int); }
     // class I2 { dynamic m(num); }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+    MethodElementImpl methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
-    methodM1.parameters = <ParameterElement> [parameter1];
-    classI1.methods = <MethodElement> [methodM1];
+    methodM1.parameters = <ParameterElement>[parameter1];
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+    MethodElementImpl methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter2 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter2.type = _typeProvider.numType;
     parameter2.parameterKind = ParameterKind.REQUIRED;
-    methodM2.parameters = <ParameterElement> [parameter2];
-    classI2.methods = <MethodElement> [methodM2];
+    methodM2.parameters = <ParameterElement>[parameter2];
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
-    MethodElement syntheticMethod = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, [_typeProvider.dynamicType]);
+    MethodElement syntheticMethod = ElementFactory.methodElement(
+        methodName,
+        _typeProvider.dynamicType,
+        [_typeProvider.dynamicType]);
     expect(mapA.get(methodName).type, syntheticMethod.type);
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_setters() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_setters() {
     // class I1 { set s(int); }
     // class I2 { set s(num); }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "s";
-    PropertyAccessorElement setter1 = ElementFactory.setterElement(accessorName, false, _typeProvider.intType);
-    classI1.accessors = <PropertyAccessorElement> [setter1];
+    PropertyAccessorElement setter1 =
+        ElementFactory.setterElement(accessorName, false, _typeProvider.intType);
+    classI1.accessors = <PropertyAccessorElement>[setter1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement setter2 = ElementFactory.setterElement(accessorName, false, _typeProvider.numType);
-    classI2.accessors = <PropertyAccessorElement> [setter2];
+    PropertyAccessorElement setter2 =
+        ElementFactory.setterElement(accessorName, false, _typeProvider.numType);
+    classI2.accessors = <PropertyAccessorElement>[setter2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
-    PropertyAccessorElementImpl syntheticAccessor = ElementFactory.setterElement(accessorName, false, _typeProvider.dynamicType);
+    PropertyAccessorElementImpl syntheticAccessor =
+        ElementFactory.setterElement(accessorName, false, _typeProvider.dynamicType);
     syntheticAccessor.returnType = _typeProvider.dynamicType;
     expect(mapA.get("$accessorName=").type, syntheticAccessor.type);
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_getters() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_getters() {
     // class A {}
     // class B extends A {}
     // class C extends B {}
@@ -4058,24 +5008,31 @@
     ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "g";
-    PropertyAccessorElement getter1 = ElementFactory.getterElement(accessorName, false, classA.type);
-    classI1.accessors = <PropertyAccessorElement> [getter1];
+    PropertyAccessorElement getter1 =
+        ElementFactory.getterElement(accessorName, false, classA.type);
+    classI1.accessors = <PropertyAccessorElement>[getter1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement getter2 = ElementFactory.getterElement(accessorName, false, classB.type);
-    classI2.accessors = <PropertyAccessorElement> [getter2];
+    PropertyAccessorElement getter2 =
+        ElementFactory.getterElement(accessorName, false, classB.type);
+    classI2.accessors = <PropertyAccessorElement>[getter2];
     ClassElementImpl classI3 = ElementFactory.classElement2("I3");
-    PropertyAccessorElement getter3 = ElementFactory.getterElement(accessorName, false, classC.type);
-    classI3.accessors = <PropertyAccessorElement> [getter3];
+    PropertyAccessorElement getter3 =
+        ElementFactory.getterElement(accessorName, false, classC.type);
+    classI3.accessors = <PropertyAccessorElement>[getter3];
     ClassElementImpl classD = ElementFactory.classElement2("D");
-    classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
-    MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
+    classD.interfaces =
+        <InterfaceType>[classI1.type, classI2.type, classI3.type];
+    MemberMap mapD =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
-    PropertyAccessorElement syntheticAccessor = ElementFactory.getterElement(accessorName, false, _typeProvider.dynamicType);
+    PropertyAccessorElement syntheticAccessor =
+        ElementFactory.getterElement(accessorName, false, _typeProvider.dynamicType);
     expect(mapD.get(accessorName).type, syntheticAccessor.type);
     _assertNoErrors(classD);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_methods() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_methods() {
     // class A {}
     // class B extends A {}
     // class C extends B {}
@@ -4088,36 +5045,48 @@
     ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+    MethodElementImpl methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter1.type = classA.type;
     parameter1.parameterKind = ParameterKind.REQUIRED;
-    methodM1.parameters = <ParameterElement> [parameter1];
-    classI1.methods = <MethodElement> [methodM1];
+    methodM1.parameters = <ParameterElement>[parameter1];
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+    MethodElementImpl methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter2 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter2.type = classB.type;
     parameter2.parameterKind = ParameterKind.REQUIRED;
-    methodM2.parameters = <ParameterElement> [parameter2];
-    classI2.methods = <MethodElement> [methodM2];
+    methodM2.parameters = <ParameterElement>[parameter2];
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classI3 = ElementFactory.classElement2("I3");
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
-    ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
+    MethodElementImpl methodM3 =
+        ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
+    ParameterElementImpl parameter3 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter3.type = classC.type;
     parameter3.parameterKind = ParameterKind.REQUIRED;
-    methodM3.parameters = <ParameterElement> [parameter3];
-    classI3.methods = <MethodElement> [methodM3];
+    methodM3.parameters = <ParameterElement>[parameter3];
+    classI3.methods = <MethodElement>[methodM3];
     ClassElementImpl classD = ElementFactory.classElement2("D");
-    classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
-    MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
+    classD.interfaces =
+        <InterfaceType>[classI1.type, classI2.type, classI3.type];
+    MemberMap mapD =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
-    MethodElement syntheticMethod = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, [_typeProvider.dynamicType]);
+    MethodElement syntheticMethod = ElementFactory.methodElement(
+        methodName,
+        _typeProvider.dynamicType,
+        [_typeProvider.dynamicType]);
     expect(mapD.get(methodName).type, syntheticMethod.type);
     _assertNoErrors(classD);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_setters() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_setters() {
     // class A {}
     // class B extends A {}
     // class C extends B {}
@@ -4130,82 +5099,103 @@
     ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "s";
-    PropertyAccessorElement setter1 = ElementFactory.setterElement(accessorName, false, classA.type);
-    classI1.accessors = <PropertyAccessorElement> [setter1];
+    PropertyAccessorElement setter1 =
+        ElementFactory.setterElement(accessorName, false, classA.type);
+    classI1.accessors = <PropertyAccessorElement>[setter1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    PropertyAccessorElement setter2 = ElementFactory.setterElement(accessorName, false, classB.type);
-    classI2.accessors = <PropertyAccessorElement> [setter2];
+    PropertyAccessorElement setter2 =
+        ElementFactory.setterElement(accessorName, false, classB.type);
+    classI2.accessors = <PropertyAccessorElement>[setter2];
     ClassElementImpl classI3 = ElementFactory.classElement2("I3");
-    PropertyAccessorElement setter3 = ElementFactory.setterElement(accessorName, false, classC.type);
-    classI3.accessors = <PropertyAccessorElement> [setter3];
+    PropertyAccessorElement setter3 =
+        ElementFactory.setterElement(accessorName, false, classC.type);
+    classI3.accessors = <PropertyAccessorElement>[setter3];
     ClassElementImpl classD = ElementFactory.classElement2("D");
-    classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
-    MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
+    classD.interfaces =
+        <InterfaceType>[classI1.type, classI2.type, classI3.type];
+    MemberMap mapD =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
-    PropertyAccessorElementImpl syntheticAccessor = ElementFactory.setterElement(accessorName, false, _typeProvider.dynamicType);
+    PropertyAccessorElementImpl syntheticAccessor =
+        ElementFactory.setterElement(accessorName, false, _typeProvider.dynamicType);
     syntheticAccessor.returnType = _typeProvider.dynamicType;
     expect(mapD.get("$accessorName=").type, syntheticAccessor.type);
     _assertNoErrors(classD);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_2_methods() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_2_methods() {
     // class I1 { int m(); }
     // class I2 { int m([int]); }
     // class A implements I1, I2 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+    MethodElementImpl methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
-    methodM2.parameters = <ParameterElement> [parameter1];
-    classI2.methods = <MethodElement> [methodM2];
+    methodM2.parameters = <ParameterElement>[parameter1];
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
     expect(mapA.get(methodName), same(methodM2));
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() {
     // class I1 { int m(); }
     // class I2 { int m([int]); }
     // class I3 { int m([int, int]); }
     // class A implements I1, I2, I3 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElementImpl methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+    MethodElementImpl methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
-    methodM1.parameters = <ParameterElement> [parameter1];
-    classI2.methods = <MethodElement> [methodM2];
+    methodM1.parameters = <ParameterElement>[parameter1];
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classI3 = ElementFactory.classElement2("I3");
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+    MethodElementImpl methodM3 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    ParameterElementImpl parameter2 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
-    ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+    ParameterElementImpl parameter3 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.POSITIONAL;
-    methodM3.parameters = <ParameterElement> [parameter2, parameter3];
-    classI3.methods = <MethodElement> [methodM3];
+    methodM3.parameters = <ParameterElement>[parameter2, parameter3];
+    classI3.methods = <MethodElement>[methodM3];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces =
+        <InterfaceType>[classI1.type, classI2.type, classI3.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
     expect(mapA.get(methodName), same(methodM3));
     _assertNoErrors(classA);
   }
 
-  void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_4_methods() {
+  void
+      test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_4_methods() {
     // class I1 { int m(); }
     // class I2 { int m(); }
     // class I3 { int m([int]); }
@@ -4213,31 +5203,40 @@
     // class A implements I1, I2, I3, I4 {}
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
-    MethodElement methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classI2.methods = <MethodElement> [methodM2];
+    MethodElement methodM2 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classI2.methods = <MethodElement>[methodM2];
     ClassElementImpl classI3 = ElementFactory.classElement2("I3");
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
+    MethodElementImpl methodM3 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    ParameterElementImpl parameter1 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
-    methodM3.parameters = <ParameterElement> [parameter1];
-    classI3.methods = <MethodElement> [methodM3];
+    methodM3.parameters = <ParameterElement>[parameter1];
+    classI3.methods = <MethodElement>[methodM3];
     ClassElementImpl classI4 = ElementFactory.classElement2("I4");
-    MethodElementImpl methodM4 = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
+    MethodElementImpl methodM4 =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    ParameterElementImpl parameter2 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
-    ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
+    ParameterElementImpl parameter3 =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.POSITIONAL;
-    methodM4.parameters = <ParameterElement> [parameter2, parameter3];
-    classI4.methods = <MethodElement> [methodM4];
+    methodM4.parameters = <ParameterElement>[parameter2, parameter3];
+    classI4.methods = <MethodElement>[methodM4];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type, classI4.type];
-    MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
+    classA.interfaces =
+        <InterfaceType>[classI1.type, classI2.type, classI3.type, classI4.type];
+    MemberMap mapA =
+        _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
     expect(mapA.get(methodName), same(methodM4));
     _assertNoErrors(classA);
@@ -4246,11 +5245,14 @@
   void test_lookupInheritance_interface_getter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
+    classB.interfaces = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, getterName),
+        same(getterG));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4258,11 +5260,14 @@
   void test_lookupInheritance_interface_method() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
+    classB.interfaces = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, methodName),
+        same(methodM));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4270,11 +5275,14 @@
   void test_lookupInheritance_interface_setter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
+    classB.interfaces = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, "$setterName="),
+        same(setterS));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4282,11 +5290,12 @@
   void test_lookupInheritance_interface_staticMember() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
+    classB.interfaces = <InterfaceType>[classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
     _assertNoErrors(classB);
@@ -4294,7 +5303,7 @@
 
   void test_lookupInheritance_interfaces_infiniteLoop() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classA.type];
+    classA.interfaces = <InterfaceType>[classA.type];
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
     _assertNoErrors(classA);
   }
@@ -4302,8 +5311,8 @@
   void test_lookupInheritance_interfaces_infiniteLoop2() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classA.interfaces = <InterfaceType> [classB.type];
-    classB.interfaces = <InterfaceType> [classA.type];
+    classA.interfaces = <InterfaceType>[classB.type];
+    classB.interfaces = <InterfaceType>[classA.type];
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
     _assertNoErrors(classA);
     _assertNoErrors(classB);
@@ -4312,17 +5321,23 @@
   void test_lookupInheritance_interfaces_union2() {
     ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName1 = "m1";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType);
-    classI1.methods = <MethodElement> [methodM1];
+    MethodElement methodM1 =
+        ElementFactory.methodElement(methodName1, _typeProvider.intType);
+    classI1.methods = <MethodElement>[methodM1];
     ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     String methodName2 = "m2";
-    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType);
-    classI2.methods = <MethodElement> [methodM2];
-    classI2.interfaces = <InterfaceType> [classI1.type];
+    MethodElement methodM2 =
+        ElementFactory.methodElement(methodName2, _typeProvider.intType);
+    classI2.methods = <MethodElement>[methodM2];
+    classI2.interfaces = <InterfaceType>[classI1.type];
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    classA.interfaces = <InterfaceType> [classI2.type];
-    expect(_inheritanceManager.lookupInheritance(classA, methodName1), same(methodM1));
-    expect(_inheritanceManager.lookupInheritance(classA, methodName2), same(methodM2));
+    classA.interfaces = <InterfaceType>[classI2.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classA, methodName1),
+        same(methodM1));
+    expect(
+        _inheritanceManager.lookupInheritance(classA, methodName2),
+        same(methodM2));
     _assertNoErrors(classI1);
     _assertNoErrors(classI2);
     _assertNoErrors(classA);
@@ -4331,11 +5346,14 @@
   void test_lookupInheritance_mixin_getter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
+    classB.mixins = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, getterName),
+        same(getterG));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4343,11 +5361,14 @@
   void test_lookupInheritance_mixin_method() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
+    classB.mixins = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, methodName),
+        same(methodM));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4355,11 +5376,14 @@
   void test_lookupInheritance_mixin_setter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
-    expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
+    classB.mixins = <InterfaceType>[classA.type];
+    expect(
+        _inheritanceManager.lookupInheritance(classB, "$setterName="),
+        same(setterS));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4367,11 +5391,12 @@
   void test_lookupInheritance_mixin_staticMember() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.mixins = <InterfaceType> [classA.type];
+    classB.mixins = <InterfaceType>[classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
     _assertNoErrors(classB);
@@ -4386,10 +5411,13 @@
   void test_lookupInheritance_superclass_getter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
+    expect(
+        _inheritanceManager.lookupInheritance(classB, getterName),
+        same(getterG));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4414,10 +5442,13 @@
   void test_lookupInheritance_superclass_method() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
+    expect(
+        _inheritanceManager.lookupInheritance(classB, methodName),
+        same(methodM));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4425,10 +5456,13 @@
   void test_lookupInheritance_superclass_setter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
+    expect(
+        _inheritanceManager.lookupInheritance(classB, "$setterName="),
+        same(setterS));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
@@ -4436,9 +5470,10 @@
   void test_lookupInheritance_superclass_staticMember() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
@@ -4448,8 +5483,9 @@
   void test_lookupMember_getter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     expect(_inheritanceManager.lookupMember(classA, getterName), same(getterG));
     _assertNoErrors(classA);
   }
@@ -4457,8 +5493,9 @@
   void test_lookupMember_getter_static() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
-    PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, true, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [getterG];
+    PropertyAccessorElement getterG =
+        ElementFactory.getterElement(getterName, true, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[getterG];
     expect(_inheritanceManager.lookupMember(classA, getterName), isNull);
     _assertNoErrors(classA);
   }
@@ -4466,8 +5503,9 @@
   void test_lookupMember_method() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
     expect(_inheritanceManager.lookupMember(classA, methodName), same(methodM));
     _assertNoErrors(classA);
   }
@@ -4475,9 +5513,10 @@
   void test_lookupMember_method_static() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
+    MethodElement methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
-    classA.methods = <MethodElement> [methodM];
+    classA.methods = <MethodElement>[methodM];
     expect(_inheritanceManager.lookupMember(classA, methodName), isNull);
     _assertNoErrors(classA);
   }
@@ -4491,17 +5530,21 @@
   void test_lookupMember_setter() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setterS];
-    expect(_inheritanceManager.lookupMember(classA, "$setterName="), same(setterS));
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, false, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setterS];
+    expect(
+        _inheritanceManager.lookupMember(classA, "$setterName="),
+        same(setterS));
     _assertNoErrors(classA);
   }
 
   void test_lookupMember_setter_static() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
-    PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, true, _typeProvider.intType);
-    classA.accessors = <PropertyAccessorElement> [setterS];
+    PropertyAccessorElement setterS =
+        ElementFactory.setterElement(setterName, true, _typeProvider.intType);
+    classA.accessors = <PropertyAccessorElement>[setterS];
     expect(_inheritanceManager.lookupMember(classA, setterName), isNull);
     _assertNoErrors(classA);
   }
@@ -4509,21 +5552,27 @@
   void test_lookupOverrides_noParentClasses() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodM];
-    expect(_inheritanceManager.lookupOverrides(classA, methodName), hasLength(0));
+    MethodElementImpl methodM =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodM];
+    expect(
+        _inheritanceManager.lookupOverrides(classA, methodName),
+        hasLength(0));
     _assertNoErrors(classA);
   }
 
   void test_lookupOverrides_overrideBaseClass() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodMinA];
+    MethodElementImpl methodMinA =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodMinA];
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classB.methods = <MethodElement> [methodMinB];
-    List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classB, methodName);
+    MethodElementImpl methodMinB =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classB.methods = <MethodElement>[methodMinB];
+    List<ExecutableElement> overrides =
+        _inheritanceManager.lookupOverrides(classB, methodName);
     expect(overrides, unorderedEquals([methodMinA]));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
@@ -4532,13 +5581,16 @@
   void test_lookupOverrides_overrideInterface() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodMinA];
+    MethodElementImpl methodMinA =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodMinA];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    classB.interfaces = <InterfaceType> [classA.type];
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classB.methods = <MethodElement> [methodMinB];
-    List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classB, methodName);
+    classB.interfaces = <InterfaceType>[classA.type];
+    MethodElementImpl methodMinB =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classB.methods = <MethodElement>[methodMinB];
+    List<ExecutableElement> overrides =
+        _inheritanceManager.lookupOverrides(classB, methodName);
     expect(overrides, unorderedEquals([methodMinA]));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
@@ -4547,25 +5599,31 @@
   void test_lookupOverrides_overrideTwoInterfaces() {
     ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
-    classA.methods = <MethodElement> [methodMinA];
+    MethodElementImpl methodMinA =
+        ElementFactory.methodElement(methodName, _typeProvider.intType);
+    classA.methods = <MethodElement>[methodMinA];
     ClassElementImpl classB = ElementFactory.classElement2("B");
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.doubleType);
-    classB.methods = <MethodElement> [methodMinB];
+    MethodElementImpl methodMinB =
+        ElementFactory.methodElement(methodName, _typeProvider.doubleType);
+    classB.methods = <MethodElement>[methodMinB];
     ClassElementImpl classC = ElementFactory.classElement2("C");
-    classC.interfaces = <InterfaceType> [classA.type, classB.type];
-    MethodElementImpl methodMinC = ElementFactory.methodElement(methodName, _typeProvider.numType);
-    classC.methods = <MethodElement> [methodMinC];
-    List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classC, methodName);
+    classC.interfaces = <InterfaceType>[classA.type, classB.type];
+    MethodElementImpl methodMinC =
+        ElementFactory.methodElement(methodName, _typeProvider.numType);
+    classC.methods = <MethodElement>[methodMinC];
+    List<ExecutableElement> overrides =
+        _inheritanceManager.lookupOverrides(classC, methodName);
     expect(overrides, unorderedEquals([methodMinA, methodMinB]));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
     _assertNoErrors(classC);
   }
 
-  void _assertErrors(ClassElement classElt, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+  void _assertErrors(ClassElement classElt, [List<ErrorCode> expectedErrorCodes
+      = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
-    HashSet<AnalysisError> actualErrors = _inheritanceManager.getErrors(classElt);
+    HashSet<AnalysisError> actualErrors =
+        _inheritanceManager.getErrors(classElt);
     if (actualErrors != null) {
       for (AnalysisError error in actualErrors) {
         errorListener.onError(error);
@@ -4585,8 +5643,10 @@
    */
   InheritanceManager _createInheritanceManager() {
     AnalysisContextImpl context = AnalysisContextFactory.contextWithCore();
-    FileBasedSource source = new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
-    CompilationUnitElementImpl definingCompilationUnit = new CompilationUnitElementImpl("test.dart");
+    FileBasedSource source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    CompilationUnitElementImpl definingCompilationUnit =
+        new CompilationUnitElementImpl("test.dart");
     definingCompilationUnit.source = source;
     _definingLibrary = ElementFactory.library(context, "test");
     _definingLibrary.definingCompilationUnit = definingCompilationUnit;
@@ -4600,15 +5660,34 @@
    */
   AnalysisContextImpl _context;
 
+  /**
+   * Add a source file to the content provider. The file path should be absolute.
+   *
+   * @param filePath the path of the file being added
+   * @param contents the contents to be returned by the content provider for the specified file
+   * @return the source object representing the added file
+   */
+  Source addSource(String filePath, String contents) {
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile(filePath));
+    _context.setContents(source, contents);
+    return source;
+  }
+
   @override
   void setUp() {
-    SourceFactory sourceFactory = new SourceFactory([
-        new DartUriResolver(DirectoryBasedDartSdk.defaultSdk),
-        new FileUriResolver()]);
+    SourceFactory sourceFactory = new SourceFactory(
+        [new DartUriResolver(DirectoryBasedDartSdk.defaultSdk), new FileUriResolver()]);
     _context = new AnalysisContextImpl();
     _context.sourceFactory = sourceFactory;
   }
 
+  @override
+  void tearDown() {
+    _context = null;
+    super.tearDown();
+  }
+
   void test_accessorsAcrossFiles() {
     Source librarySource = addSource("/lib.dart", r'''
 library lib;
@@ -4656,7 +5735,9 @@
   void test_missingLibraryDirectiveWithPart() {
     addSource("/a.dart", "part of lib;");
     Source librarySource = addSource("/lib.dart", "part 'a.dart';");
-    LibraryElement element = _buildLibrary(librarySource, [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]);
+    LibraryElement element = _buildLibrary(
+        librarySource,
+        [ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART]);
     expect(element, isNotNull);
   }
 
@@ -4666,7 +5747,8 @@
 library lib;
 
 part 'a.dart';''');
-    LibraryElement element = _buildLibrary(librarySource, [CompileTimeErrorCode.PART_OF_NON_PART]);
+    LibraryElement element =
+        _buildLibrary(librarySource, [CompileTimeErrorCode.PART_OF_NON_PART]);
     expect(element, isNotNull);
   }
 
@@ -4708,25 +5790,6 @@
   }
 
   /**
-   * Add a source file to the content provider. The file path should be absolute.
-   *
-   * @param filePath the path of the file being added
-   * @param contents the contents to be returned by the content provider for the specified file
-   * @return the source object representing the added file
-   */
-  Source addSource(String filePath, String contents) {
-    Source source = new FileBasedSource.con1(FileUtilities2.createFile(filePath));
-    _context.setContents(source, contents);
-    return source;
-  }
-
-  @override
-  void tearDown() {
-    _context = null;
-    super.tearDown();
-  }
-
-  /**
    * Ensure that there are elements representing all of the types in the given array of type names.
    *
    * @param unit the compilation unit containing the types
@@ -4760,9 +5823,11 @@
    * @return the element model that was built for the library
    * @throws Exception if the element model could not be built
    */
-  LibraryElement _buildLibrary(Source librarySource, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+  LibraryElement _buildLibrary(Source librarySource,
+      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     LibraryResolver resolver = new LibraryResolver(_context);
-    LibraryElementBuilder builder = new LibraryElementBuilder(resolver.analysisContext, resolver.errorListener);
+    LibraryElementBuilder builder =
+        new LibraryElementBuilder(resolver.analysisContext, resolver.errorListener);
     Library library = resolver.createLibrary(librarySource);
     LibraryElement element = builder.buildLibrary(library);
     GatheringErrorListener listener = new GatheringErrorListener();
@@ -4784,24 +5849,38 @@
     ClassElement typeB2 = ElementFactory.classElement2(typeNameB);
     ClassElement typeC = ElementFactory.classElement2(typeNameC);
     LibraryElement importedLibrary1 = createTestLibrary(context, "imported1");
-    (importedLibrary1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeA, typeB1];
-    ImportElementImpl import1 = ElementFactory.importFor(importedLibrary1, null);
+    (importedLibrary1.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[typeA, typeB1];
+    ImportElementImpl import1 =
+        ElementFactory.importFor(importedLibrary1, null);
     LibraryElement importedLibrary2 = createTestLibrary(context, "imported2");
-    (importedLibrary2.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeB2, typeC];
-    ImportElementImpl import2 = ElementFactory.importFor(importedLibrary2, null);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
-    importingLibrary.imports = <ImportElement> [import1, import2];
+    (importedLibrary2.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[typeB2, typeC];
+    ImportElementImpl import2 =
+        ElementFactory.importFor(importedLibrary2, null);
+    LibraryElementImpl importingLibrary =
+        createTestLibrary(context, "importing");
+    importingLibrary.imports = <ImportElement>[import1, import2];
     {
       GatheringErrorListener errorListener = new GatheringErrorListener();
       Scope scope = new LibraryImportScope(importingLibrary, errorListener);
-      expect(scope.lookup(AstFactory.identifier3(typeNameA), importingLibrary), typeA);
+      expect(
+          scope.lookup(AstFactory.identifier3(typeNameA), importingLibrary),
+          typeA);
       errorListener.assertNoErrors();
-      expect(scope.lookup(AstFactory.identifier3(typeNameC), importingLibrary), typeC);
+      expect(
+          scope.lookup(AstFactory.identifier3(typeNameC), importingLibrary),
+          typeC);
       errorListener.assertNoErrors();
-      Element element = scope.lookup(AstFactory.identifier3(typeNameB), importingLibrary);
+      Element element =
+          scope.lookup(AstFactory.identifier3(typeNameB), importingLibrary);
       errorListener.assertErrorsWithCodes([StaticWarningCode.AMBIGUOUS_IMPORT]);
-      EngineTestCase.assertInstanceOf((obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, element);
-      List<Element> conflictingElements = (element as MultiplyDefinedElement).conflictingElements;
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is MultiplyDefinedElement,
+          MultiplyDefinedElement,
+          element);
+      List<Element> conflictingElements =
+          (element as MultiplyDefinedElement).conflictingElements;
       expect(conflictingElements, hasLength(2));
       if (identical(conflictingElements[0], typeB1)) {
         expect(conflictingElements[1], same(typeB2));
@@ -4815,10 +5894,19 @@
       GatheringErrorListener errorListener = new GatheringErrorListener();
       Scope scope = new LibraryImportScope(importingLibrary, errorListener);
       Identifier identifier = AstFactory.identifier3(typeNameB);
-      AstFactory.methodDeclaration(null, AstFactory.typeName3(identifier), null, null, AstFactory.identifier3("foo"), null);
+      AstFactory.methodDeclaration(
+          null,
+          AstFactory.typeName3(identifier),
+          null,
+          null,
+          AstFactory.identifier3("foo"),
+          null);
       Element element = scope.lookup(identifier, importingLibrary);
       errorListener.assertErrorsWithCodes([StaticWarningCode.AMBIGUOUS_IMPORT]);
-      EngineTestCase.assertInstanceOf((obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, element);
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is MultiplyDefinedElement,
+          MultiplyDefinedElement,
+          element);
     }
   }
 
@@ -4832,22 +5920,28 @@
     AnalysisContext context = new AnalysisContextImpl();
     context.sourceFactory = new SourceFactory([]);
     String importedTypeName = "A";
-    ClassElement importedType = new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
+    ClassElement importedType =
+        new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary(context, "imported");
-    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [importedType];
-    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing");
+    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[importedType];
+    LibraryElementImpl definingLibrary =
+        createTestLibrary(context, "importing");
     ImportElementImpl importElement = new ImportElementImpl(0);
     importElement.importedLibrary = importedLibrary;
-    definingLibrary.imports = <ImportElement> [importElement];
+    definingLibrary.imports = <ImportElement>[importElement];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(definingLibrary, errorListener);
-    expect(scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary), importedType);
+    expect(
+        scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary),
+        importedType);
   }
 
   void test_getErrorListener() {
     LibraryElement definingLibrary = createDefaultTestLibrary();
     GatheringErrorListener errorListener = new GatheringErrorListener();
-    LibraryImportScope scope = new LibraryImportScope(definingLibrary, errorListener);
+    LibraryImportScope scope =
+        new LibraryImportScope(definingLibrary, errorListener);
     expect(scope.errorListener, errorListener);
   }
 
@@ -4856,15 +5950,23 @@
     String typeName = "List";
     ClassElement type = ElementFactory.classElement2(typeName);
     LibraryElement importedLibrary = createTestLibrary(context, "lib");
-    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [type];
-    ImportElementImpl importCore = ElementFactory.importFor(context.getLibraryElement(context.sourceFactory.forUri("dart:core")), null);
-    ImportElementImpl importLib = ElementFactory.importFor(importedLibrary, null);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
-    importingLibrary.imports = <ImportElement> [importCore, importLib];
+    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[type];
+    ImportElementImpl importCore = ElementFactory.importFor(
+        context.getLibraryElement(context.sourceFactory.forUri("dart:core")),
+        null);
+    ImportElementImpl importLib =
+        ElementFactory.importFor(importedLibrary, null);
+    LibraryElementImpl importingLibrary =
+        createTestLibrary(context, "importing");
+    importingLibrary.imports = <ImportElement>[importCore, importLib];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
-    expect(scope.lookup(AstFactory.identifier3(typeName), importingLibrary), type);
-    errorListener.assertErrorsWithCodes([StaticWarningCode.CONFLICTING_DART_IMPORT]);
+    expect(
+        scope.lookup(AstFactory.identifier3(typeName), importingLibrary),
+        type);
+    errorListener.assertErrorsWithCodes(
+        [StaticWarningCode.CONFLICTING_DART_IMPORT]);
   }
 
   void test_nonConflictingImports_sameElement() {
@@ -4875,16 +5977,22 @@
     ClassElement typeA = ElementFactory.classElement2(typeNameA);
     ClassElement typeB = ElementFactory.classElement2(typeNameB);
     LibraryElement importedLibrary = createTestLibrary(context, "imported");
-    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeA, typeB];
+    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[typeA, typeB];
     ImportElementImpl import1 = ElementFactory.importFor(importedLibrary, null);
     ImportElementImpl import2 = ElementFactory.importFor(importedLibrary, null);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
-    importingLibrary.imports = <ImportElement> [import1, import2];
+    LibraryElementImpl importingLibrary =
+        createTestLibrary(context, "importing");
+    importingLibrary.imports = <ImportElement>[import1, import2];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
-    expect(scope.lookup(AstFactory.identifier3(typeNameA), importingLibrary), typeA);
+    expect(
+        scope.lookup(AstFactory.identifier3(typeNameA), importingLibrary),
+        typeA);
     errorListener.assertNoErrors();
-    expect(scope.lookup(AstFactory.identifier3(typeNameB), importingLibrary), typeB);
+    expect(
+        scope.lookup(AstFactory.identifier3(typeNameB), importingLibrary),
+        typeB);
     errorListener.assertNoErrors();
   }
 
@@ -4895,20 +6003,30 @@
     String prefixName = "p";
     ClassElement prefixedType = ElementFactory.classElement2(typeName);
     ClassElement nonPrefixedType = ElementFactory.classElement2(typeName);
-    LibraryElement prefixedLibrary = createTestLibrary(context, "import.prefixed");
-    (prefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [prefixedType];
-    ImportElementImpl prefixedImport = ElementFactory.importFor(prefixedLibrary, ElementFactory.prefix(prefixName));
-    LibraryElement nonPrefixedLibrary = createTestLibrary(context, "import.nonPrefixed");
-    (nonPrefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [nonPrefixedType];
-    ImportElementImpl nonPrefixedImport = ElementFactory.importFor(nonPrefixedLibrary, null);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
-    importingLibrary.imports = <ImportElement> [prefixedImport, nonPrefixedImport];
+    LibraryElement prefixedLibrary =
+        createTestLibrary(context, "import.prefixed");
+    (prefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[prefixedType];
+    ImportElementImpl prefixedImport =
+        ElementFactory.importFor(prefixedLibrary, ElementFactory.prefix(prefixName));
+    LibraryElement nonPrefixedLibrary =
+        createTestLibrary(context, "import.nonPrefixed");
+    (nonPrefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[nonPrefixedType];
+    ImportElementImpl nonPrefixedImport =
+        ElementFactory.importFor(nonPrefixedLibrary, null);
+    LibraryElementImpl importingLibrary =
+        createTestLibrary(context, "importing");
+    importingLibrary.imports =
+        <ImportElement>[prefixedImport, nonPrefixedImport];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
-    Element prefixedElement = scope.lookup(AstFactory.identifier5(prefixName, typeName), importingLibrary);
+    Element prefixedElement =
+        scope.lookup(AstFactory.identifier5(prefixName, typeName), importingLibrary);
     errorListener.assertNoErrors();
     expect(prefixedElement, same(prefixedType));
-    Element nonPrefixedElement = scope.lookup(AstFactory.identifier3(typeName), importingLibrary);
+    Element nonPrefixedElement =
+        scope.lookup(AstFactory.identifier3(typeName), importingLibrary);
     errorListener.assertNoErrors();
     expect(nonPrefixedElement, same(nonPrefixedType));
   }
@@ -4923,7 +6041,8 @@
   void setUp() {
     super.setUp();
     _resolver = new LibraryResolver2(analysisContext2);
-    _coreLibrarySource = analysisContext2.sourceFactory.forUri(DartSdk.DART_CORE);
+    _coreLibrarySource =
+        analysisContext2.sourceFactory.forUri(DartSdk.DART_CORE);
   }
 
   void test_imports_relative() {
@@ -4937,11 +6056,12 @@
 class B {}''');
     List<ResolvableLibrary> cycle = new List<ResolvableLibrary>();
     ResolvableLibrary coreLib = _createResolvableLibrary(_coreLibrarySource);
-    coreLib.libraryElement = analysisContext2.computeLibraryElement(_coreLibrarySource) as LibraryElementImpl;
+    coreLib.libraryElement = analysisContext2.computeLibraryElement(
+        _coreLibrarySource) as LibraryElementImpl;
     ResolvableLibrary libA = _createResolvableLibrary(sourceA);
     ResolvableLibrary libB = _createResolvableLibrary(sourceB);
-    libA.importedLibraries = <ResolvableLibrary> [coreLib, libB];
-    libB.importedLibraries = <ResolvableLibrary> [coreLib, libA];
+    libA.importedLibraries = <ResolvableLibrary>[coreLib, libB];
+    libB.importedLibraries = <ResolvableLibrary>[coreLib, libA];
     cycle.add(libA);
     cycle.add(libB);
     LibraryElement library = _resolver.resolveLibrary(sourceA, cycle);
@@ -4952,9 +6072,8 @@
   ResolvableLibrary _createResolvableLibrary(Source source) {
     CompilationUnit unit = analysisContext2.parseCompilationUnit(source);
     ResolvableLibrary resolvableLibrary = new ResolvableLibrary(source);
-    resolvableLibrary.resolvableCompilationUnits = <ResolvableCompilationUnit>[
-        new ResolvableCompilationUnit(source, unit)
-    ];
+    resolvableLibrary.resolvableCompilationUnits =
+        <ResolvableCompilationUnit>[new ResolvableCompilationUnit(source, unit)];
     return resolvableLibrary;
   }
 }
@@ -5010,16 +6129,21 @@
     AnalysisContext context = new AnalysisContextImpl();
     context.sourceFactory = new SourceFactory([]);
     String importedTypeName = "A";
-    ClassElement importedType = new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
+    ClassElement importedType =
+        new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
     LibraryElement importedLibrary = createTestLibrary(context, "imported");
-    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [importedType];
-    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing");
+    (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types =
+        <ClassElement>[importedType];
+    LibraryElementImpl definingLibrary =
+        createTestLibrary(context, "importing");
     ImportElementImpl importElement = new ImportElementImpl(0);
     importElement.importedLibrary = importedLibrary;
-    definingLibrary.imports = <ImportElement> [importElement];
+    definingLibrary.imports = <ImportElement>[importElement];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryScope(definingLibrary, errorListener);
-    expect(scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary), importedType);
+    expect(
+        scope.lookup(AstFactory.identifier3(importedTypeName), definingLibrary),
+        importedType);
   }
 
   void test_getErrorListener() {
@@ -5060,6 +6184,15 @@
     _library = _createLibrary("/lib.dart");
   }
 
+  @override
+  void tearDown() {
+    _errorListener = null;
+    _sourceFactory = null;
+    _analysisContext = null;
+    _library = null;
+    super.tearDown();
+  }
+
   void test_getExplicitlyImportsCore() {
     expect(_library.explicitlyImportsCore, isFalse);
     _errorListener.assertNoErrors();
@@ -5076,15 +6209,18 @@
   }
 
   void test_getImportsAndExports() {
-    _library.importedLibraries = <Library> [_createLibrary("/imported.dart")];
-    _library.exportedLibraries = <Library> [_createLibrary("/exported.dart")];
+    _library.importedLibraries = <Library>[_createLibrary("/imported.dart")];
+    _library.exportedLibraries = <Library>[_createLibrary("/exported.dart")];
     expect(_library.importsAndExports, hasLength(2));
     _errorListener.assertNoErrors();
   }
 
   void test_getLibraryScope() {
-    LibraryElementImpl element = new LibraryElementImpl.forNode(_analysisContext, AstFactory.libraryIdentifier2(["lib"]));
-    element.definingCompilationUnit = new CompilationUnitElementImpl("lib.dart");
+    LibraryElementImpl element = new LibraryElementImpl.forNode(
+        _analysisContext,
+        AstFactory.libraryIdentifier2(["lib"]));
+    element.definingCompilationUnit =
+        new CompilationUnitElementImpl("lib.dart");
     _library.libraryElement = element;
     expect(_library.libraryScope, isNotNull);
     _errorListener.assertNoErrors();
@@ -5102,7 +6238,7 @@
 
   void test_setExportedLibraries() {
     Library exportLibrary = _createLibrary("/exported.dart");
-    _library.exportedLibraries = <Library> [exportLibrary];
+    _library.exportedLibraries = <Library>[exportLibrary];
     List<Library> exports = _library.exports;
     expect(exports, hasLength(1));
     expect(exports[0], same(exportLibrary));
@@ -5111,7 +6247,7 @@
 
   void test_setImportedLibraries() {
     Library importLibrary = _createLibrary("/imported.dart");
-    _library.importedLibraries = <Library> [importLibrary];
+    _library.importedLibraries = <Library>[importLibrary];
     List<Library> imports = _library.imports;
     expect(imports, hasLength(1));
     expect(imports[0], same(importLibrary));
@@ -5119,21 +6255,19 @@
   }
 
   void test_setLibraryElement() {
-    LibraryElementImpl element = new LibraryElementImpl.forNode(_analysisContext, AstFactory.libraryIdentifier2(["lib"]));
+    LibraryElementImpl element = new LibraryElementImpl.forNode(
+        _analysisContext,
+        AstFactory.libraryIdentifier2(["lib"]));
     _library.libraryElement = element;
     expect(_library.libraryElement, same(element));
   }
 
-  @override
-  void tearDown() {
-    _errorListener = null;
-    _sourceFactory = null;
-    _analysisContext = null;
-    _library = null;
-    super.tearDown();
-  }
-
-  Library _createLibrary(String definingCompilationUnitPath) => new Library(_analysisContext, _errorListener, new FileBasedSource.con1(FileUtilities2.createFile(definingCompilationUnitPath)));
+  Library _createLibrary(String definingCompilationUnitPath) =>
+      new Library(
+          _analysisContext,
+          _errorListener,
+          new FileBasedSource.con1(
+              FileUtilities2.createFile(definingCompilationUnitPath)));
 }
 
 class MemberMapTest {
@@ -5399,14 +6533,14 @@
   }
 
   void test_importDeferredLibraryWithLoadFunction() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-f() {}''',
-        r'''
+f() {}''', r'''
 library root;
 import 'lib1.dart' deferred as lib1;
-main() { lib1.f(); }'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], ErrorCode.EMPTY_LIST);
+main() { lib1.f(); }'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          ErrorCode.EMPTY_LIST);
   }
 
   void test_issue20904BuggyTypePromotionAtIfJoin_1() {
@@ -5986,6 +7120,27 @@
     verify([source]);
   }
 
+  void test_unusedImport_export2() {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+Three three;''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+export 'lib2.dart';
+class One {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+export 'lib3.dart';
+class Two {}''');
+    addNamedSource("/lib3.dart", r'''
+library lib3;
+class Three {}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_unusedImport_export_infiniteLoop() {
     Source source = addSource(r'''
 library L;
@@ -6008,27 +7163,6 @@
     verify([source]);
   }
 
-  void test_unusedImport_export2() {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-Three three;''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-export 'lib2.dart';
-class One {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-export 'lib3.dart';
-class Two {}''');
-    addNamedSource("/lib3.dart", r'''
-library lib3;
-class Three {}''');
-    resolve(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   void test_unusedImport_metadata() {
     Source source = addSource(r'''
 library L;
@@ -6101,30 +7235,38 @@
   void test_import_packageWithDotDot() {
     Source source = addSource("import 'package:somepackage/../other.dart';");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.URI_DOES_NOT_EXIST,
-        HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+            HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT]);
   }
 
   void test_import_packageWithLeadingDotDot() {
     Source source = addSource("import 'package:../other.dart';");
     resolve(source);
-    assertErrors(source, [
-        CompileTimeErrorCode.URI_DOES_NOT_EXIST,
-        HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT]);
+    assertErrors(
+        source,
+        [
+            CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+            HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT]);
   }
 
   void test_import_referenceIntoLibDirectory() {
     cacheSource("/myproj/pubspec.yaml", "");
     cacheSource("/myproj/lib/other.dart", "");
-    Source source = addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+    Source source =
+        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
     resolve(source);
-    assertErrors(source, [HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]);
+    assertErrors(
+        source,
+        [HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]);
   }
 
   void test_import_referenceIntoLibDirectory_no_pubspec() {
     cacheSource("/myproj/lib/other.dart", "");
-    Source source = addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+    Source source =
+        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
     resolve(source);
     assertNoErrors(source);
   }
@@ -6132,14 +7274,18 @@
   void test_import_referenceOutOfLibDirectory() {
     cacheSource("/myproj/pubspec.yaml", "");
     cacheSource("/myproj/web/other.dart", "");
-    Source source = addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
     resolve(source);
-    assertErrors(source, [HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]);
+    assertErrors(
+        source,
+        [HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]);
   }
 
   void test_import_referenceOutOfLibDirectory_no_pubspec() {
     cacheSource("/myproj/web/other.dart", "");
-    Source source = addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
     resolve(source);
     assertNoErrors(source);
   }
@@ -6147,7 +7293,8 @@
   void test_import_valid_inside_lib1() {
     cacheSource("/myproj/pubspec.yaml", "");
     cacheSource("/myproj/lib/other.dart", "");
-    Source source = addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
     resolve(source);
     assertNoErrors(source);
   }
@@ -6155,7 +7302,8 @@
   void test_import_valid_inside_lib2() {
     cacheSource("/myproj/pubspec.yaml", "");
     cacheSource("/myproj/lib/bar/other.dart", "");
-    Source source = addNamedSource("/myproj/lib/foo/test.dart", "import '../bar/other.dart';");
+    Source source =
+        addNamedSource("/myproj/lib/foo/test.dart", "import '../bar/other.dart';");
     resolve(source);
     assertNoErrors(source);
   }
@@ -6163,40 +7311,13 @@
   void test_import_valid_outside_lib() {
     cacheSource("/myproj/pubspec.yaml", "");
     cacheSource("/myproj/web/other.dart", "");
-    Source source = addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
+    Source source =
+        addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
     resolve(source);
     assertNoErrors(source);
   }
 }
 
-class RecursiveAstVisitor_SimpleResolverTest_test_localVariable_types_invoked extends RecursiveAstVisitor<Object> {
-  final SimpleResolverTest SimpleResolverTest_this;
-
-  List<bool> found;
-
-  List<CaughtException> thrownException;
-
-  RecursiveAstVisitor_SimpleResolverTest_test_localVariable_types_invoked(this.SimpleResolverTest_this, this.found, this.thrownException) : super();
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    if (node.name == "myVar" && node.parent is MethodInvocation) {
-      try {
-        found[0] = true;
-        // check static type
-        DartType staticType = node.staticType;
-        expect(staticType, same(SimpleResolverTest_this.typeProvider.dynamicType));
-        // check propagated type
-        FunctionType propagatedType = node.propagatedType as FunctionType;
-        expect(propagatedType.returnType, SimpleResolverTest_this.typeProvider.stringType);
-      } on AnalysisException catch (e, stackTrace) {
-        thrownException[0] = new CaughtException(e, stackTrace);
-      }
-    }
-    return null;
-  }
-}
-
 /**
  * Instances of the class `ResolutionVerifier` verify that all of the nodes in an AST
  * structure that should have been resolved were resolved.
@@ -6281,7 +7402,10 @@
     if (operandType == null || operandType.isDynamic) {
       return null;
     }
-    return _checkResolved(node, node.staticElement, (node) => node is MethodElement);
+    return _checkResolved(
+        node,
+        node.staticElement,
+        (node) => node is MethodElement);
   }
 
   @override
@@ -6290,11 +7414,15 @@
   @override
   Object visitCompilationUnit(CompilationUnit node) {
     node.visitChildren(this);
-    return _checkResolved(node, node.element, (node) => node is CompilationUnitElement);
+    return _checkResolved(
+        node,
+        node.element,
+        (node) => node is CompilationUnitElement);
   }
 
   @override
-  Object visitExportDirective(ExportDirective node) => _checkResolved(node, node.element, (node) => node is ExportElement);
+  Object visitExportDirective(ExportDirective node) =>
+      _checkResolved(node, node.element, (node) => node is ExportElement);
 
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
@@ -6308,21 +7436,25 @@
   @override
   Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
     node.visitChildren(this);
-    // TODO(brianwilkerson) If we start resolving function expressions, then conditionally check to
-    // see whether the node was resolved correctly.
+    // TODO(brianwilkerson) If we start resolving function expressions, then
+    // conditionally check to see whether the node was resolved correctly.
     return null;
     //checkResolved(node, node.getElement(), FunctionElement.class);
   }
 
   @override
   Object visitImportDirective(ImportDirective node) {
-    // Not sure how to test the combinators given that it isn't an error if the names are not defined.
+    // Not sure how to test the combinators given that it isn't an error if the
+    // names are not defined.
     _checkResolved(node, node.element, (node) => node is ImportElement);
     SimpleIdentifier prefix = node.prefix;
     if (prefix == null) {
       return null;
     }
-    return _checkResolved(prefix, prefix.staticElement, (node) => node is PrefixElement);
+    return _checkResolved(
+        prefix,
+        prefix.staticElement,
+        (node) => node is PrefixElement);
   }
 
   @override
@@ -6332,20 +7464,27 @@
     if (targetType == null || targetType.isDynamic) {
       return null;
     }
-    return _checkResolved(node, node.staticElement, (node) => node is MethodElement);
+    return _checkResolved(
+        node,
+        node.staticElement,
+        (node) => node is MethodElement);
   }
 
   @override
-  Object visitLibraryDirective(LibraryDirective node) => _checkResolved(node, node.element, (node) => node is LibraryElement);
+  Object visitLibraryDirective(LibraryDirective node) =>
+      _checkResolved(node, node.element, (node) => node is LibraryElement);
 
   @override
-  Object visitNamedExpression(NamedExpression node) => node.expression.accept(this);
+  Object visitNamedExpression(NamedExpression node) =>
+      node.expression.accept(this);
 
   @override
-  Object visitPartDirective(PartDirective node) => _checkResolved(node, node.element, (node) => node is CompilationUnitElement);
+  Object visitPartDirective(PartDirective node) =>
+      _checkResolved(node, node.element, (node) => node is CompilationUnitElement);
 
   @override
-  Object visitPartOfDirective(PartOfDirective node) => _checkResolved(node, node.element, (node) => node is LibraryElement);
+  Object visitPartOfDirective(PartOfDirective node) =>
+      _checkResolved(node, node.element, (node) => node is LibraryElement);
 
   @override
   Object visitPostfixExpression(PostfixExpression node) {
@@ -6357,7 +7496,10 @@
     if (operandType == null || operandType.isDynamic) {
       return null;
     }
-    return _checkResolved(node, node.staticElement, (node) => node is MethodElement);
+    return _checkResolved(
+        node,
+        node.staticElement,
+        (node) => node is MethodElement);
   }
 
   @override
@@ -6381,7 +7523,10 @@
     if (operandType == null || operandType.isDynamic) {
       return null;
     }
-    return _checkResolved(node, node.staticElement, (node) => node is MethodElement);
+    return _checkResolved(
+        node,
+        node.staticElement,
+        (node) => node is MethodElement);
   }
 
   @override
@@ -6414,7 +7559,8 @@
     return _checkResolved(node, node.staticElement, null);
   }
 
-  Object _checkResolved(AstNode node, Element element, Predicate<Element> predicate) {
+  Object _checkResolved(AstNode node, Element element,
+      Predicate<Element> predicate) {
     if (element == null) {
       if (_knownExceptions == null || !_knownExceptions.contains(node)) {
         _unresolvedNodes.add(node);
@@ -6428,8 +7574,8 @@
   }
 
   String _getFileName(AstNode node) {
-    // TODO (jwren) there are two copies of this method, one here and one in StaticTypeVerifier,
-    // they should be resolved into a single method
+    // TODO (jwren) there are two copies of this method, one here and one in
+    // StaticTypeVerifier, they should be resolved into a single method
     if (node != null) {
       AstNode root = node.root;
       if (root is CompilationUnit) {
@@ -6440,7 +7586,8 @@
           return "<unknown file- CompilationUnit.getElement() returned null>";
         }
       } else {
-        return "<unknown file- CompilationUnit.getRoot() is not a CompilationUnit>";
+        return
+            "<unknown file- CompilationUnit.getRoot() is not a CompilationUnit>";
       }
     }
     return "<unknown file- ASTNode is null>";
@@ -6466,7 +7613,8 @@
   AnalysisContextImpl analysisContext2;
 
   /**
-   * Specifies if [assertErrors] should check for [HintCode.UNUSED_ELEMENT].
+   * Specifies if [assertErrors] should check for [HintCode.UNUSED_ELEMENT] and
+   * [HintCode.UNUSED_FIELD].
    */
   bool enableUnusedElement = false;
 
@@ -6475,10 +7623,15 @@
    */
   bool enableUnusedLocalVariable = false;
 
-  @override
-  void setUp() {
-    reset();
-  }
+  AnalysisContext get analysisContext => analysisContext2;
+
+  /**
+   * Return a type provider that can be used to test the results of resolution.
+   *
+   * @return a type provider
+   * @throws AnalysisException if dart:core cannot be resolved
+   */
+  TypeProvider get typeProvider => analysisContext2.typeProvider;
 
   /**
    * Add a source file to the content provider. The file path should be absolute.
@@ -6514,15 +7667,17 @@
    * @throws AssertionFailedError if a different number of errors have been reported than were
    *           expected
    */
-  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes =
+      ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     for (AnalysisError error in analysisContext2.computeErrors(source)) {
-      if (error.errorCode == HintCode.UNUSED_ELEMENT &&
-          !enableUnusedElement) {
+      ErrorCode errorCode = error.errorCode;
+      if (!enableUnusedElement &&
+          (errorCode == HintCode.UNUSED_ELEMENT || errorCode == HintCode.UNUSED_FIELD)) {
         continue;
       }
-      if (error.errorCode == HintCode.UNUSED_LOCAL_VARIABLE &&
-          !enableUnusedLocalVariable) {
+      if (!enableUnusedLocalVariable &&
+          errorCode == HintCode.UNUSED_LOCAL_VARIABLE) {
         continue;
       }
       errorListener.onError(error);
@@ -6550,7 +7705,8 @@
    * @return the source object representing the cached file
    */
   Source cacheSource(String filePath, String contents) {
-    Source source = new FileBasedSource.con1(FileUtilities2.createFile(filePath));
+    Source source =
+        new FileBasedSource.con1(FileUtilities2.createFile(filePath));
     analysisContext2.setContents(source, contents);
     return source;
   }
@@ -6561,7 +7717,8 @@
    *
    * @return the library element that was created
    */
-  LibraryElementImpl createDefaultTestLibrary() => createTestLibrary(new AnalysisContextImpl(), "test");
+  LibraryElementImpl createDefaultTestLibrary() =>
+      createTestLibrary(new AnalysisContextImpl(), "test");
 
   /**
    * Create a library element that represents a library with the given name containing a single
@@ -6570,7 +7727,8 @@
    * @param libraryName the name of the library to be created
    * @return the library element that was created
    */
-  LibraryElementImpl createTestLibrary(AnalysisContext context, String libraryName, [List<String> typeNames]) {
+  LibraryElementImpl createTestLibrary(AnalysisContext context,
+      String libraryName, [List<String> typeNames]) {
     List<CompilationUnitElement> sourcedCompilationUnits;
     if (typeNames == null) {
       sourcedCompilationUnits = CompilationUnitElementImpl.EMPTY_ARRAY;
@@ -6579,18 +7737,23 @@
       sourcedCompilationUnits = new List<CompilationUnitElement>(count);
       for (int i = 0; i < count; i++) {
         String typeName = typeNames[i];
-        ClassElementImpl type = new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
+        ClassElementImpl type =
+            new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
         String fileName = "$typeName.dart";
-        CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
+        CompilationUnitElementImpl compilationUnit =
+            new CompilationUnitElementImpl(fileName);
         compilationUnit.source = _createNamedSource(fileName);
-        compilationUnit.types = <ClassElement> [type];
+        compilationUnit.types = <ClassElement>[type];
         sourcedCompilationUnits[i] = compilationUnit;
       }
     }
     String fileName = "$libraryName.dart";
-    CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
+    CompilationUnitElementImpl compilationUnit =
+        new CompilationUnitElementImpl(fileName);
     compilationUnit.source = _createNamedSource(fileName);
-    LibraryElementImpl library = new LibraryElementImpl.forNode(context, AstFactory.libraryIdentifier2([libraryName]));
+    LibraryElementImpl library = new LibraryElementImpl.forNode(
+        context,
+        AstFactory.libraryIdentifier2([libraryName]));
     library.definingCompilationUnit = compilationUnit;
     library.parts = sourcedCompilationUnits;
     return library;
@@ -6606,9 +7769,12 @@
     AnalysisEngine.instance.strictUnionTypes = strictUnionTypes;
   }
 
-  Expression findTopLevelConstantExpression(CompilationUnit compilationUnit, String name) => findTopLevelDeclaration(compilationUnit, name).initializer;
+  Expression findTopLevelConstantExpression(CompilationUnit compilationUnit,
+      String name) =>
+      findTopLevelDeclaration(compilationUnit, name).initializer;
 
-  VariableDeclaration findTopLevelDeclaration(CompilationUnit compilationUnit, String name) {
+  VariableDeclaration findTopLevelDeclaration(CompilationUnit compilationUnit,
+      String name) {
     for (CompilationUnitMember member in compilationUnit.declarations) {
       if (member is TopLevelVariableDeclaration) {
         for (VariableDeclaration variable in member.variables.variables) {
@@ -6622,16 +7788,6 @@
     // Not found
   }
 
-  AnalysisContext get analysisContext => analysisContext2;
-
-  /**
-   * Return a type provider that can be used to test the results of resolution.
-   *
-   * @return a type provider
-   * @throws AnalysisException if dart:core cannot be resolved
-   */
-  TypeProvider get typeProvider => analysisContext2.typeProvider;
-
   /**
    * In the rare cases we want to group several tests into single "test_" method, so need a way to
    * reset test instance to reuse it.
@@ -6650,7 +7806,17 @@
   void resetWithAsync() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
     options.enableAsync = true;
-    analysisContext2 = AnalysisContextFactory.contextWithCoreAndOptions(options);
+    analysisContext2 =
+        AnalysisContextFactory.contextWithCoreAndOptions(options);
+  }
+
+  /**
+   * Reset the analysis context to have the 'enableEnum' option set to true.
+   */
+  void resetWithEnum() {
+    AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
+    analysisOptions.enableEnum = true;
+    resetWithOptions(analysisOptions);
   }
 
   /**
@@ -6659,7 +7825,8 @@
    * @param options the analysis options to be applied to the context
    */
   void resetWithOptions(AnalysisOptions options) {
-    analysisContext2 = AnalysisContextFactory.contextWithCoreAndOptions(options);
+    analysisContext2 =
+        AnalysisContextFactory.contextWithCoreAndOptions(options);
   }
 
   /**
@@ -6671,7 +7838,8 @@
    * @return the element representing the resolved library
    * @throws AnalysisException if the analysis could not be performed
    */
-  LibraryElement resolve(Source librarySource) => analysisContext2.computeLibraryElement(librarySource);
+  LibraryElement resolve(Source librarySource) =>
+      analysisContext2.computeLibraryElement(librarySource);
 
   /**
    * Return the resolved compilation unit corresponding to the given source in the given library.
@@ -6681,9 +7849,12 @@
    * @return the resolved compilation unit
    * @throws Exception if the compilation unit could not be resolved
    */
-  CompilationUnit resolveCompilationUnit(Source source, LibraryElement library) => analysisContext2.resolveCompilationUnit(source, library);
+  CompilationUnit resolveCompilationUnit(Source source,
+      LibraryElement library) =>
+      analysisContext2.resolveCompilationUnit(source, library);
 
-  CompilationUnit resolveSource(String sourceText) => resolveSource2("/test.dart", sourceText);
+  CompilationUnit resolveSource(String sourceText) =>
+      resolveSource2("/test.dart", sourceText);
 
   CompilationUnit resolveSource2(String fileName, String sourceText) {
     Source source = addNamedSource(fileName, sourceText);
@@ -6693,7 +7864,8 @@
 
   Source resolveSources(List<String> sourceTexts) {
     for (int i = 0; i < sourceTexts.length; i++) {
-      CompilationUnit unit = resolveSource2("/lib${i + 1}.dart", sourceTexts[i]);
+      CompilationUnit unit =
+          resolveSource2("/lib${i + 1}.dart", sourceTexts[i]);
       // reference the source if this is the last source
       if (i + 1 == sourceTexts.length) {
         return unit.element.source;
@@ -6702,7 +7874,9 @@
     return null;
   }
 
-  void resolveWithAndWithoutExperimental(List<String> strSources, List<ErrorCode> codesWithoutExperimental, List<ErrorCode> codesWithExperimental) {
+  void resolveWithAndWithoutExperimental(List<String> strSources,
+      List<ErrorCode> codesWithoutExperimental,
+      List<ErrorCode> codesWithExperimental) {
     // Setup analysis context as non-experimental
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
     options.enableDeferredLoading = false;
@@ -6720,6 +7894,11 @@
   }
 
   @override
+  void setUp() {
+    reset();
+  }
+
+  @override
   void tearDown() {
     analysisContext2 = null;
     super.tearDown();
@@ -6749,189 +7928,49 @@
    * @return the source that was created
    */
   FileBasedSource _createNamedSource(String fileName) {
-    FileBasedSource source = new FileBasedSource.con1(FileUtilities2.createFile(fileName));
+    FileBasedSource source =
+        new FileBasedSource.con1(FileUtilities2.createFile(fileName));
     analysisContext2.setContents(source, "");
     return source;
   }
 }
 
-class ScopeBuilderTest extends EngineTestCase {
-  void test_scopeFor_ClassDeclaration() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedClassDeclaration(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is LibraryScope, LibraryScope, scope);
-  }
+class Scope_EnclosedScopeTest_test_define_duplicate extends Scope {
+  GatheringErrorListener listener;
 
-  void test_scopeFor_ClassTypeAlias() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedClassTypeAlias(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is LibraryScope, LibraryScope, scope);
-  }
+  Scope_EnclosedScopeTest_test_define_duplicate(this.listener) : super();
 
-  void test_scopeFor_CompilationUnit() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedCompilationUnit(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is LibraryScope, LibraryScope, scope);
-  }
+  @override
+  AnalysisErrorListener get errorListener => listener;
 
-  void test_scopeFor_ConstructorDeclaration() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedConstructorDeclaration(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassScope, ClassScope, scope);
-  }
+  @override
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary) =>
+      null;
+}
 
-  void test_scopeFor_ConstructorDeclaration_parameters() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedConstructorDeclaration().parameters, listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionScope, FunctionScope, scope);
-  }
+class Scope_EnclosedScopeTest_test_define_normal extends Scope {
+  GatheringErrorListener listener;
 
-  void test_scopeFor_FunctionDeclaration() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedFunctionDeclaration(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is LibraryScope, LibraryScope, scope);
-  }
+  Scope_EnclosedScopeTest_test_define_normal(this.listener) : super();
 
-  void test_scopeFor_FunctionDeclaration_parameters() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedFunctionDeclaration().functionExpression.parameters, listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionScope, FunctionScope, scope);
-  }
+  @override
+  AnalysisErrorListener get errorListener => listener;
 
-  void test_scopeFor_FunctionTypeAlias() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedFunctionTypeAlias(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is LibraryScope, LibraryScope, scope);
-  }
-
-  void test_scopeFor_FunctionTypeAlias_parameters() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedFunctionTypeAlias().parameters, listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionTypeScope, FunctionTypeScope, scope);
-  }
-
-  void test_scopeFor_MethodDeclaration() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedMethodDeclaration(), listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is ClassScope, ClassScope, scope);
-  }
-
-  void test_scopeFor_MethodDeclaration_body() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    Scope scope = ScopeBuilder.scopeFor(_createResolvedMethodDeclaration().body, listener);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionScope, FunctionScope, scope);
-  }
-
-  void test_scopeFor_notInCompilationUnit() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    try {
-      ScopeBuilder.scopeFor(AstFactory.identifier3("x"), listener);
-      fail("Expected AnalysisException");
-    } on AnalysisException catch (exception) {
-      // Expected
-    }
-  }
-
-  void test_scopeFor_null() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    try {
-      ScopeBuilder.scopeFor(null, listener);
-      fail("Expected AnalysisException");
-    } on AnalysisException catch (exception) {
-      // Expected
-    }
-  }
-
-  void test_scopeFor_unresolved() {
-    GatheringErrorListener listener = new GatheringErrorListener();
-    try {
-      ScopeBuilder.scopeFor(AstFactory.compilationUnit(), listener);
-      fail("Expected AnalysisException");
-    } on AnalysisException catch (exception) {
-      // Expected
-    }
-  }
-
-  ClassDeclaration _createResolvedClassDeclaration() {
-    CompilationUnit unit = _createResolvedCompilationUnit();
-    String className = "C";
-    ClassDeclaration classNode = AstFactory.classDeclaration(null, className, AstFactory.typeParameterList(), null, null, null);
-    unit.declarations.add(classNode);
-    ClassElement classElement = ElementFactory.classElement2(className);
-    classNode.name.staticElement = classElement;
-    (unit.element as CompilationUnitElementImpl).types = <ClassElement> [classElement];
-    return classNode;
-  }
-
-  ClassTypeAlias _createResolvedClassTypeAlias() {
-    CompilationUnit unit = _createResolvedCompilationUnit();
-    String className = "C";
-    ClassTypeAlias classNode = AstFactory.classTypeAlias(className, AstFactory.typeParameterList(), null, null, null, null);
-    unit.declarations.add(classNode);
-    ClassElement classElement = ElementFactory.classElement2(className);
-    classNode.name.staticElement = classElement;
-    (unit.element as CompilationUnitElementImpl).types = <ClassElement> [classElement];
-    return classNode;
-  }
-
-  CompilationUnit _createResolvedCompilationUnit() {
-    CompilationUnit unit = AstFactory.compilationUnit();
-    LibraryElementImpl library = ElementFactory.library(AnalysisContextFactory.contextWithCore(), "lib");
-    unit.element = library.definingCompilationUnit;
-    return unit;
-  }
-
-  ConstructorDeclaration _createResolvedConstructorDeclaration() {
-    ClassDeclaration classNode = _createResolvedClassDeclaration();
-    String constructorName = "f";
-    ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(AstFactory.identifier3(constructorName), null, AstFactory.formalParameterList(), null);
-    classNode.members.add(constructorNode);
-    ConstructorElement constructorElement = ElementFactory.constructorElement2(classNode.element, null);
-    constructorNode.element = constructorElement;
-    (classNode.element as ClassElementImpl).constructors = <ConstructorElement> [constructorElement];
-    return constructorNode;
-  }
-
-  FunctionDeclaration _createResolvedFunctionDeclaration() {
-    CompilationUnit unit = _createResolvedCompilationUnit();
-    String functionName = "f";
-    FunctionDeclaration functionNode = AstFactory.functionDeclaration(null, null, functionName, AstFactory.functionExpression());
-    unit.declarations.add(functionNode);
-    FunctionElement functionElement = ElementFactory.functionElement(functionName);
-    functionNode.name.staticElement = functionElement;
-    (unit.element as CompilationUnitElementImpl).functions = <FunctionElement> [functionElement];
-    return functionNode;
-  }
-
-  FunctionTypeAlias _createResolvedFunctionTypeAlias() {
-    CompilationUnit unit = _createResolvedCompilationUnit();
-    FunctionTypeAlias aliasNode = AstFactory.typeAlias(AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(), AstFactory.formalParameterList());
-    unit.declarations.add(aliasNode);
-    SimpleIdentifier aliasName = aliasNode.name;
-    FunctionTypeAliasElement aliasElement = new FunctionTypeAliasElementImpl.forNode(aliasName);
-    aliasName.staticElement = aliasElement;
-    (unit.element as CompilationUnitElementImpl).typeAliases = <FunctionTypeAliasElement> [aliasElement];
-    return aliasNode;
-  }
-
-  MethodDeclaration _createResolvedMethodDeclaration() {
-    ClassDeclaration classNode = _createResolvedClassDeclaration();
-    String methodName = "f";
-    MethodDeclaration methodNode = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3(methodName), AstFactory.formalParameterList());
-    classNode.members.add(methodNode);
-    MethodElement methodElement = ElementFactory.methodElement(methodName, null);
-    methodNode.name.staticElement = methodElement;
-    (classNode.element as ClassElementImpl).methods = <MethodElement> [methodElement];
-    return methodNode;
-  }
+  @override
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary) =>
+      null;
 }
 
 class ScopeTest extends ResolverTestCase {
   void test_define_duplicate() {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ScopeTest_TestScope scope = new ScopeTest_TestScope(errorListener);
-    VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element1 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element2 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
     scope.define(element1);
     scope.define(element2);
     errorListener.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
@@ -6940,8 +7979,10 @@
   void test_define_normal() {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ScopeTest_TestScope scope = new ScopeTest_TestScope(errorListener);
-    VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
-    VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v2"));
+    VariableElement element1 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+    VariableElement element2 =
+        ElementFactory.localVariableElement(AstFactory.identifier3("v2"));
     scope.define(element1);
     scope.define(element2);
     errorListener.assertNoErrors();
@@ -6974,31 +8015,9 @@
   ScopeTest_TestScope(this.errorListener);
 
   @override
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => localLookup(name, referencingLibrary);
-}
-
-class Scope_EnclosedScopeTest_test_define_duplicate extends Scope {
-  GatheringErrorListener listener;
-
-  Scope_EnclosedScopeTest_test_define_duplicate(this.listener) : super();
-
-  @override
-  AnalysisErrorListener get errorListener => listener;
-
-  @override
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => null;
-}
-
-class Scope_EnclosedScopeTest_test_define_normal extends Scope {
-  GatheringErrorListener listener;
-
-  Scope_EnclosedScopeTest_test_define_normal(this.listener) : super();
-
-  @override
-  AnalysisErrorListener get errorListener => listener;
-
-  @override
-  Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => null;
+  Element internalLookup(Identifier identifier, String name,
+      LibraryElement referencingLibrary) =>
+      localLookup(name, referencingLibrary);
 }
 
 class SimpleResolverTest extends ResolverTestCase {
@@ -7133,7 +8152,8 @@
       FunctionElement mainElement = unit.functions[0];
       FunctionBody mainBody = mainElement.node.functionExpression.body;
       Statement statement = (mainBody as BlockFunctionBody).block.statements[1];
-      ExpressionStatement expressionStatement = statement as ExpressionStatement;
+      ExpressionStatement expressionStatement =
+          statement as ExpressionStatement;
       assignment = expressionStatement.expression as AssignmentExpression;
     }
     // get parameter
@@ -7168,7 +8188,8 @@
       FunctionElement mainElement = unit.functions[0];
       FunctionBody mainBody = mainElement.node.functionExpression.body;
       Statement statement = (mainBody as BlockFunctionBody).block.statements[1];
-      ExpressionStatement expressionStatement = statement as ExpressionStatement;
+      ExpressionStatement expressionStatement =
+          statement as ExpressionStatement;
       assignment = expressionStatement.expression as AssignmentExpression;
     }
     // get parameter
@@ -7200,7 +8221,8 @@
       FunctionElement mainElement = unit.functions[0];
       FunctionBody mainBody = mainElement.node.functionExpression.body;
       Statement statement = (mainBody as BlockFunctionBody).block.statements[1];
-      ExpressionStatement expressionStatement = statement as ExpressionStatement;
+      ExpressionStatement expressionStatement =
+          statement as ExpressionStatement;
       assignment = expressionStatement.expression as AssignmentExpression;
     }
     // get parameter
@@ -7234,7 +8256,8 @@
       FunctionElement mainElement = unit.functions[0];
       FunctionBody mainBody = mainElement.node.functionExpression.body;
       Statement statement = (mainBody as BlockFunctionBody).block.statements[1];
-      ExpressionStatement expressionStatement = statement as ExpressionStatement;
+      ExpressionStatement expressionStatement =
+          statement as ExpressionStatement;
       assignment = expressionStatement.expression as AssignmentExpression;
     }
     // get parameter
@@ -7248,6 +8271,136 @@
     expect(setter.parameters[0], same(parameter));
   }
 
+  void test_breakTarget_labeled() {
+    // Verify that the target of the label is correctly found and is recorded
+    // as the unlabeled portion of the statement.
+    String text = r'''
+void f() {
+  loop1: while (true) {
+    loop2: for (int i = 0; i < 10; i++) {
+      break loop1;
+      break loop2;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    WhileStatement whileStatement = EngineTestCase.findNode(
+        unit,
+        text,
+        'while (true)',
+        (n) => n is WhileStatement);
+    ForStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForStatement);
+    BreakStatement break1 =
+        EngineTestCase.findNode(unit, text, 'break loop1', (n) => n is BreakStatement);
+    BreakStatement break2 =
+        EngineTestCase.findNode(unit, text, 'break loop2', (n) => n is BreakStatement);
+    expect(break1.target, same(whileStatement));
+    expect(break2.target, same(forStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakFromDo() {
+    String text = r'''
+void f() {
+  do {
+    break;
+  } while (true);
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    DoStatement doStatement =
+        EngineTestCase.findNode(unit, text, 'do', (n) => n is DoStatement);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, same(doStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakFromFor() {
+    String text = r'''
+void f() {
+  for (int i = 0; i < 10; i++) {
+    break;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    ForStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForStatement);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, same(forStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakFromForEach() {
+    String text = r'''
+void f() {
+  for (x in []) {
+    break;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    ForEachStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForEachStatement);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, same(forStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakFromSwitch() {
+    String text = r'''
+void f() {
+  while (true) {
+    switch (0) {
+      case 0:
+        break;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    SwitchStatement switchStatement =
+        EngineTestCase.findNode(unit, text, 'switch', (n) => n is SwitchStatement);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, same(switchStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakFromWhile() {
+    String text = r'''
+void f() {
+  while (true) {
+    break;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    WhileStatement whileStatement =
+        EngineTestCase.findNode(unit, text, 'while', (n) => n is WhileStatement);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, same(whileStatement));
+  }
+
+  void test_breakTarget_unlabeledBreakToOuterFunction() {
+    // Verify that unlabeled break statements can't resolve to loops in an
+    // outer function.
+    String text = r'''
+void f() {
+  while (true) {
+    void g() {
+      break;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    BreakStatement breakStatement =
+        EngineTestCase.findNode(unit, text, 'break', (n) => n is BreakStatement);
+    expect(breakStatement.target, isNull);
+  }
+
   void test_class_definesCall() {
     Source source = addSource(r'''
 class A {
@@ -7307,6 +8460,142 @@
     verify([source]);
   }
 
+  void test_continueTarget_labeled() {
+    // Verify that the target of the label is correctly found and is recorded
+    // as the unlabeled portion of the statement.
+    String text = r'''
+void f() {
+  loop1: while (true) {
+    loop2: for (int i = 0; i < 10; i++) {
+      continue loop1;
+      continue loop2;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    WhileStatement whileStatement = EngineTestCase.findNode(
+        unit,
+        text,
+        'while (true)',
+        (n) => n is WhileStatement);
+    ForStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForStatement);
+    ContinueStatement continue1 = EngineTestCase.findNode(
+        unit,
+        text,
+        'continue loop1',
+        (n) => n is ContinueStatement);
+    ContinueStatement continue2 = EngineTestCase.findNode(
+        unit,
+        text,
+        'continue loop2',
+        (n) => n is ContinueStatement);
+    expect(continue1.target, same(whileStatement));
+    expect(continue2.target, same(forStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueFromDo() {
+    String text = r'''
+void f() {
+  do {
+    continue;
+  } while (true);
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    DoStatement doStatement =
+        EngineTestCase.findNode(unit, text, 'do', (n) => n is DoStatement);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, same(doStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueFromFor() {
+    String text = r'''
+void f() {
+  for (int i = 0; i < 10; i++) {
+    continue;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    ForStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForStatement);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, same(forStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueFromForEach() {
+    String text = r'''
+void f() {
+  for (x in []) {
+    continue;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    ForEachStatement forStatement =
+        EngineTestCase.findNode(unit, text, 'for', (n) => n is ForEachStatement);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, same(forStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueFromWhile() {
+    String text = r'''
+void f() {
+  while (true) {
+    continue;
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    WhileStatement whileStatement =
+        EngineTestCase.findNode(unit, text, 'while', (n) => n is WhileStatement);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, same(whileStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueSkipsSwitch() {
+    String text = r'''
+void f() {
+  while (true) {
+    switch (0) {
+      case 0:
+        continue;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    WhileStatement whileStatement =
+        EngineTestCase.findNode(unit, text, 'while', (n) => n is WhileStatement);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, same(whileStatement));
+  }
+
+  void test_continueTarget_unlabeledContinueToOuterFunction() {
+    // Verify that unlabeled continue statements can't resolve to loops in an
+    // outer function.
+    String text = r'''
+void f() {
+  while (true) {
+    void g() {
+      continue;
+    }
+  }
+}
+''';
+    CompilationUnit unit = resolveSource(text);
+    ContinueStatement continueStatement =
+        EngineTestCase.findNode(unit, text, 'continue', (n) => n is ContinueStatement);
+    expect(continueStatement.target, isNull);
+  }
+
   void test_empty() {
     Source source = addSource("");
     resolve(source);
@@ -7426,7 +8715,9 @@
   a.f = a.f.toString();
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
     verify([source]);
   }
 
@@ -7649,13 +8940,20 @@
 }''');
     LibraryElement library = resolve(source);
     expect(library, isNotNull);
-    CompilationUnit unit = analysisContext.getResolvedCompilationUnit(source, library);
+    CompilationUnit unit =
+        analysisContext.getResolvedCompilationUnit(source, library);
     expect(unit, isNotNull);
     List<bool> found = [false];
     List<CaughtException> thrownException = new List<CaughtException>(1);
-    unit.accept(new RecursiveAstVisitor_SimpleResolverTest_test_localVariable_types_invoked(this, found, thrownException));
+    unit.accept(
+        new _SimpleResolverTest_localVariable_types_invoked(
+            this,
+            found,
+            thrownException));
     if (thrownException[0] != null) {
-      throw new AnalysisException("Exception", new CaughtException(thrownException[0], null));
+      throw new AnalysisException(
+          "Exception",
+          new CaughtException(thrownException[0], null));
     }
     expect(found[0], isTrue);
   }
@@ -7677,10 +8975,16 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(2));
-    Element expectedElement = (declarations[0] as TopLevelVariableDeclaration).variables.variables[0].name.staticElement;
-    EngineTestCase.assertInstanceOf((obj) => obj is PropertyInducingElement, PropertyInducingElement, expectedElement);
+    Element expectedElement =
+        (declarations[0] as
+            TopLevelVariableDeclaration).variables.variables[0].name.staticElement;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PropertyInducingElement,
+        PropertyInducingElement,
+        expectedElement);
     expectedElement = (expectedElement as PropertyInducingElement).getter;
-    Element actualElement = (declarations[1] as ClassDeclaration).metadata[0].name.staticElement;
+    Element actualElement =
+        (declarations[1] as ClassDeclaration).metadata[0].name.staticElement;
     expect(actualElement, same(expectedElement));
   }
 
@@ -7864,10 +9168,16 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(2));
-    Element expectedElement = (declarations[0] as TopLevelVariableDeclaration).variables.variables[0].name.staticElement;
-    EngineTestCase.assertInstanceOf((obj) => obj is PropertyInducingElement, PropertyInducingElement, expectedElement);
+    Element expectedElement =
+        (declarations[0] as
+            TopLevelVariableDeclaration).variables.variables[0].name.staticElement;
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is PropertyInducingElement,
+        PropertyInducingElement,
+        expectedElement);
     expectedElement = (expectedElement as PropertyInducingElement).getter;
-    Element actualElement = (declarations[1] as FunctionTypeAlias).metadata[0].name.staticElement;
+    Element actualElement =
+        (declarations[1] as FunctionTypeAlias).metadata[0].name.staticElement;
     expect(actualElement, same(expectedElement));
   }
 
@@ -8006,8 +9316,10 @@
     List<ParameterElement> parameters = classElement.methods[1].parameters;
     CompilationUnit unit = resolveCompilationUnit(source, library);
     expect(unit, isNotNull);
-    ClassDeclaration classDeclaration = unit.declarations[0] as ClassDeclaration;
-    MethodDeclaration methodDeclaration = classDeclaration.members[0] as MethodDeclaration;
+    ClassDeclaration classDeclaration =
+        unit.declarations[0] as ClassDeclaration;
+    MethodDeclaration methodDeclaration =
+        classDeclaration.members[0] as MethodDeclaration;
     Block block = (methodDeclaration.body as BlockFunctionBody).block;
     ExpressionStatement statement = block.statements[0] as ExpressionStatement;
     MethodInvocation invocation = statement.expression as MethodInvocation;
@@ -8032,992 +9344,6 @@
   bool contains(Source source) => false;
 }
 
-class StaticTypeAnalyzerTest extends EngineTestCase {
-  /**
-   * The error listener to which errors will be reported.
-   */
-  GatheringErrorListener _listener;
-
-  /**
-   * The resolver visitor used to create the analyzer.
-   */
-  ResolverVisitor _visitor;
-
-  /**
-   * The analyzer being used to analyze the test cases.
-   */
-  StaticTypeAnalyzer _analyzer;
-
-  /**
-   * The type provider used to access the types.
-   */
-  TestTypeProvider _typeProvider;
-
-  void fail_visitFunctionExpressionInvocation() {
-    fail("Not yet tested");
-    _listener.assertNoErrors();
-  }
-
-  void fail_visitMethodInvocation() {
-    fail("Not yet tested");
-    _listener.assertNoErrors();
-  }
-
-  void fail_visitSimpleIdentifier() {
-    fail("Not yet tested");
-    _listener.assertNoErrors();
-  }
-
-  @override
-  void setUp() {
-    _listener = new GatheringErrorListener();
-    _typeProvider = new TestTypeProvider();
-    _analyzer = _createAnalyzer();
-  }
-
-  void test_visitAdjacentStrings() {
-    // "a" "b"
-    Expression node = AstFactory.adjacentStrings([_resolvedString("a"), _resolvedString("b")]);
-    expect(_analyze(node), same(_typeProvider.stringType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitAsExpression() {
-    // class A { ... this as B ... }
-    // class B extends A {}
-    ClassElement superclass = ElementFactory.classElement2("A");
-    InterfaceType superclassType = superclass.type;
-    ClassElement subclass = ElementFactory.classElement("B", superclassType);
-    Expression node = AstFactory.asExpression(AstFactory.thisExpression(), AstFactory.typeName(subclass));
-    expect(_analyze3(node, superclassType), same(subclass.type));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitAssignmentExpression_compound() {
-    // i += 1
-    InterfaceType numType = _typeProvider.numType;
-    SimpleIdentifier identifier = _resolvedVariable(_typeProvider.intType, "i");
-    AssignmentExpression node = AstFactory.assignmentExpression(identifier, TokenType.PLUS_EQ, _resolvedInteger(1));
-    MethodElement plusMethod = getMethod(numType, "+");
-    node.staticElement = plusMethod;
-    expect(_analyze(node), same(numType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitAssignmentExpression_simple() {
-    // i = 0
-    InterfaceType intType = _typeProvider.intType;
-    Expression node = AstFactory.assignmentExpression(_resolvedVariable(intType, "i"), TokenType.EQ, _resolvedInteger(0));
-    expect(_analyze(node), same(intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_equals() {
-    // 2 == 3
-    Expression node = AstFactory.binaryExpression(_resolvedInteger(2), TokenType.EQ_EQ, _resolvedInteger(3));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_logicalAnd() {
-    // false && true
-    Expression node = AstFactory.binaryExpression(AstFactory.booleanLiteral(false), TokenType.AMPERSAND_AMPERSAND, AstFactory.booleanLiteral(true));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_logicalOr() {
-    // false || true
-    Expression node = AstFactory.binaryExpression(AstFactory.booleanLiteral(false), TokenType.BAR_BAR, AstFactory.booleanLiteral(true));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_notEquals() {
-    // 2 != 3
-    Expression node = AstFactory.binaryExpression(_resolvedInteger(2), TokenType.BANG_EQ, _resolvedInteger(3));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_plusID() {
-    // 1 + 2.0
-    BinaryExpression node = AstFactory.binaryExpression(_resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
-    node.staticElement = getMethod(_typeProvider.numType, "+");
-    expect(_analyze(node), same(_typeProvider.doubleType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_plusII() {
-    // 1 + 2
-    BinaryExpression node = AstFactory.binaryExpression(_resolvedInteger(1), TokenType.PLUS, _resolvedInteger(2));
-    node.staticElement = getMethod(_typeProvider.numType, "+");
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_slash() {
-    // 2 / 2
-    BinaryExpression node = AstFactory.binaryExpression(_resolvedInteger(2), TokenType.SLASH, _resolvedInteger(2));
-    node.staticElement = getMethod(_typeProvider.numType, "/");
-    expect(_analyze(node), same(_typeProvider.doubleType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_star_notSpecial() {
-    // class A {
-    //   A operator *(double value);
-    // }
-    // (a as A) * 2.0
-    ClassElementImpl classA = ElementFactory.classElement2("A");
-    InterfaceType typeA = classA.type;
-    MethodElement operator = ElementFactory.methodElement("*", typeA, [_typeProvider.doubleType]);
-    classA.methods = <MethodElement> [operator];
-    BinaryExpression node = AstFactory.binaryExpression(AstFactory.asExpression(AstFactory.identifier3("a"), AstFactory.typeName(classA)), TokenType.PLUS, _resolvedDouble(2.0));
-    node.staticElement = operator;
-    expect(_analyze(node), same(typeA));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBinaryExpression_starID() {
-    // 1 * 2.0
-    BinaryExpression node = AstFactory.binaryExpression(_resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
-    node.staticElement = getMethod(_typeProvider.numType, "*");
-    expect(_analyze(node), same(_typeProvider.doubleType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBooleanLiteral_false() {
-    // false
-    Expression node = AstFactory.booleanLiteral(false);
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitBooleanLiteral_true() {
-    // true
-    Expression node = AstFactory.booleanLiteral(true);
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitCascadeExpression() {
-    // a..length
-    Expression node = AstFactory.cascadeExpression(_resolvedString("a"), [AstFactory.propertyAccess2(null, "length")]);
-    expect(_analyze(node), same(_typeProvider.stringType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitConditionalExpression_differentTypes() {
-    // true ? 1.0 : 0
-    Expression node = AstFactory.conditionalExpression(AstFactory.booleanLiteral(true), _resolvedDouble(1.0), _resolvedInteger(0));
-    expect(_analyze(node), same(_typeProvider.numType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitConditionalExpression_sameTypes() {
-    // true ? 1 : 0
-    Expression node = AstFactory.conditionalExpression(AstFactory.booleanLiteral(true), _resolvedInteger(1), _resolvedInteger(0));
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitDoubleLiteral() {
-    // 4.33
-    Expression node = AstFactory.doubleLiteral(4.33);
-    expect(_analyze(node), same(_typeProvider.doubleType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_named_block() {
-    // ({p1 : 0, p2 : 0}) {}
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
-    _analyze5(p1);
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
-    expectedNamedTypes["p1"] = dynamicType;
-    expectedNamedTypes["p2"] = dynamicType;
-    _assertFunctionType(dynamicType, null, null, expectedNamedTypes, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_named_expression() {
-    // ({p : 0}) -> 0;
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
-    _setType(p, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p]), AstFactory.expressionFunctionBody(_resolvedInteger(0)));
-    _analyze5(p);
-    DartType resultType = _analyze(node);
-    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
-    expectedNamedTypes["p"] = dynamicType;
-    _assertFunctionType(_typeProvider.intType, null, null, expectedNamedTypes, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normal_block() {
-    // (p1, p2) {}
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.simpleFormalParameter3("p2");
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
-    _analyze5(p1);
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(dynamicType, <DartType> [dynamicType, dynamicType], null, null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normal_expression() {
-    // (p1, p2) -> 0
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.simpleFormalParameter3("p");
-    _setType(p, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p]), AstFactory.expressionFunctionBody(_resolvedInteger(0)));
-    _analyze5(p);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(_typeProvider.intType, <DartType> [dynamicType], null, null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normalAndNamed_block() {
-    // (p1, {p2 : 0}) {}
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
-    expectedNamedTypes["p2"] = dynamicType;
-    _assertFunctionType(dynamicType, <DartType> [dynamicType], null, expectedNamedTypes, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normalAndNamed_expression() {
-    // (p1, {p2 : 0}) -> 0
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.expressionFunctionBody(_resolvedInteger(0)));
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
-    expectedNamedTypes["p2"] = dynamicType;
-    _assertFunctionType(_typeProvider.intType, <DartType> [dynamicType], null, expectedNamedTypes, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normalAndPositional_block() {
-    // (p1, [p2 = 0]) {}
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
-    _analyze5(p1);
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(dynamicType, <DartType> [dynamicType], <DartType> [dynamicType], null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_normalAndPositional_expression() {
-    // (p1, [p2 = 0]) -> 0
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.expressionFunctionBody(_resolvedInteger(0)));
-    _analyze5(p1);
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(_typeProvider.intType, <DartType> [dynamicType], <DartType> [dynamicType], null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_positional_block() {
-    // ([p1 = 0, p2 = 0]) {}
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p1 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p1"), _resolvedInteger(0));
-    _setType(p1, dynamicType);
-    FormalParameter p2 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
-    _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
-    _analyze5(p1);
-    _analyze5(p2);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(dynamicType, null, <DartType> [dynamicType, dynamicType], null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitFunctionExpression_positional_expression() {
-    // ([p1 = 0, p2 = 0]) -> 0
-    DartType dynamicType = _typeProvider.dynamicType;
-    FormalParameter p = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p"), _resolvedInteger(0));
-    _setType(p, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p]), AstFactory.expressionFunctionBody(_resolvedInteger(0)));
-    _analyze5(p);
-    DartType resultType = _analyze(node);
-    _assertFunctionType(_typeProvider.intType, null, <DartType> [dynamicType], null, resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIndexExpression_getter() {
-    // List a;
-    // a[2]
-    InterfaceType listType = _typeProvider.listType;
-    SimpleIdentifier identifier = _resolvedVariable(listType, "a");
-    IndexExpression node = AstFactory.indexExpression(identifier, _resolvedInteger(2));
-    MethodElement indexMethod = listType.element.methods[0];
-    node.staticElement = indexMethod;
-    expect(_analyze(node), same(listType.typeArguments[0]));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIndexExpression_setter() {
-    // List a;
-    // a[2] = 0
-    InterfaceType listType = _typeProvider.listType;
-    SimpleIdentifier identifier = _resolvedVariable(listType, "a");
-    IndexExpression node = AstFactory.indexExpression(identifier, _resolvedInteger(2));
-    MethodElement indexMethod = listType.element.methods[1];
-    node.staticElement = indexMethod;
-    AstFactory.assignmentExpression(node, TokenType.EQ, AstFactory.integer(0));
-    expect(_analyze(node), same(listType.typeArguments[0]));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIndexExpression_typeParameters() {
-    // List<int> list = ...
-    // list[0]
-    InterfaceType intType = _typeProvider.intType;
-    InterfaceType listType = _typeProvider.listType;
-    // (int) -> E
-    MethodElement methodElement = getMethod(listType, "[]");
-    // "list" has type List<int>
-    SimpleIdentifier identifier = AstFactory.identifier3("list");
-    InterfaceType listOfIntType = listType.substitute4(<DartType> [intType]);
-    identifier.staticType = listOfIntType;
-    // list[0] has MethodElement element (int) -> E
-    IndexExpression indexExpression = AstFactory.indexExpression(identifier, AstFactory.integer(0));
-    MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
-    indexExpression.staticElement = indexMethod;
-    // analyze and assert result of the index expression
-    expect(_analyze(indexExpression), same(intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIndexExpression_typeParameters_inSetterContext() {
-    // List<int> list = ...
-    // list[0] = 0;
-    InterfaceType intType = _typeProvider.intType;
-    InterfaceType listType = _typeProvider.listType;
-    // (int, E) -> void
-    MethodElement methodElement = getMethod(listType, "[]=");
-    // "list" has type List<int>
-    SimpleIdentifier identifier = AstFactory.identifier3("list");
-    InterfaceType listOfIntType = listType.substitute4(<DartType> [intType]);
-    identifier.staticType = listOfIntType;
-    // list[0] has MethodElement element (int) -> E
-    IndexExpression indexExpression = AstFactory.indexExpression(identifier, AstFactory.integer(0));
-    MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
-    indexExpression.staticElement = indexMethod;
-    // list[0] should be in a setter context
-    AstFactory.assignmentExpression(indexExpression, TokenType.EQ, AstFactory.integer(0));
-    // analyze and assert result of the index expression
-    expect(_analyze(indexExpression), same(intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitInstanceCreationExpression_named() {
-    // new C.m()
-    ClassElementImpl classElement = ElementFactory.classElement2("C");
-    String constructorName = "m";
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, constructorName);
-    constructor.returnType = classElement.type;
-    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
-    constructor.type = constructorType;
-    classElement.constructors = <ConstructorElement> [constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement), [AstFactory.identifier3(constructorName)]);
-    node.staticElement = constructor;
-    expect(_analyze(node), same(classElement.type));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitInstanceCreationExpression_typeParameters() {
-    // new C<I>()
-    ClassElementImpl elementC = ElementFactory.classElement2("C", ["E"]);
-    ClassElementImpl elementI = ElementFactory.classElement2("I");
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(elementC, null);
-    elementC.constructors = <ConstructorElement> [constructor];
-    constructor.returnType = elementC.type;
-    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
-    constructor.type = constructorType;
-    TypeName typeName = AstFactory.typeName(elementC, [AstFactory.typeName(elementI)]);
-    typeName.type = elementC.type.substitute4(<DartType> [elementI.type]);
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, typeName);
-    node.staticElement = constructor;
-    InterfaceType interfaceType = _analyze(node) as InterfaceType;
-    List<DartType> typeArgs = interfaceType.typeArguments;
-    expect(typeArgs.length, 1);
-    expect(typeArgs[0], elementI.type);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitInstanceCreationExpression_unnamed() {
-    // new C()
-    ClassElementImpl classElement = ElementFactory.classElement2("C");
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, null);
-    constructor.returnType = classElement.type;
-    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
-    constructor.type = constructorType;
-    classElement.constructors = <ConstructorElement> [constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement));
-    node.staticElement = constructor;
-    expect(_analyze(node), same(classElement.type));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIntegerLiteral() {
-    // 42
-    Expression node = _resolvedInteger(42);
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIsExpression_negated() {
-    // a is! String
-    Expression node = AstFactory.isExpression(_resolvedString("a"), true, AstFactory.typeName4("String"));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitIsExpression_notNegated() {
-    // a is String
-    Expression node = AstFactory.isExpression(_resolvedString("a"), false, AstFactory.typeName4("String"));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitListLiteral_empty() {
-    // []
-    Expression node = AstFactory.listLiteral();
-    DartType resultType = _analyze(node);
-    _assertType2(_typeProvider.listType.substitute4(<DartType> [_typeProvider.dynamicType]), resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitListLiteral_nonEmpty() {
-    // [0]
-    Expression node = AstFactory.listLiteral([_resolvedInteger(0)]);
-    DartType resultType = _analyze(node);
-    _assertType2(_typeProvider.listType.substitute4(<DartType> [_typeProvider.dynamicType]), resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitMapLiteral_empty() {
-    // {}
-    Expression node = AstFactory.mapLiteral2();
-    DartType resultType = _analyze(node);
-    _assertType2(_typeProvider.mapType.substitute4(<DartType> [_typeProvider.dynamicType, _typeProvider.dynamicType]), resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitMapLiteral_nonEmpty() {
-    // {"k" : 0}
-    Expression node = AstFactory.mapLiteral2([AstFactory.mapLiteralEntry("k", _resolvedInteger(0))]);
-    DartType resultType = _analyze(node);
-    _assertType2(_typeProvider.mapType.substitute4(<DartType> [_typeProvider.dynamicType, _typeProvider.dynamicType]), resultType);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitMethodInvocation_then() {
-    // then()
-    Expression node = AstFactory.methodInvocation(null, "then");
-    _analyze(node);
-    _listener.assertNoErrors();
-  }
-
-  void test_visitNamedExpression() {
-    // n: a
-    Expression node = AstFactory.namedExpression2("n", _resolvedString("a"));
-    expect(_analyze(node), same(_typeProvider.stringType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitNullLiteral() {
-    // null
-    Expression node = AstFactory.nullLiteral();
-    expect(_analyze(node), same(_typeProvider.bottomType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitParenthesizedExpression() {
-    // (0)
-    Expression node = AstFactory.parenthesizedExpression(_resolvedInteger(0));
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPostfixExpression_minusMinus() {
-    // 0--
-    PostfixExpression node = AstFactory.postfixExpression(_resolvedInteger(0), TokenType.MINUS_MINUS);
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPostfixExpression_plusPlus() {
-    // 0++
-    PostfixExpression node = AstFactory.postfixExpression(_resolvedInteger(0), TokenType.PLUS_PLUS);
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixedIdentifier_getter() {
-    DartType boolType = _typeProvider.boolType;
-    PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType);
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
-    node.identifier.staticElement = getter;
-    expect(_analyze(node), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixedIdentifier_setter() {
-    DartType boolType = _typeProvider.boolType;
-    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType);
-    PropertyAccessorElement setter = field.setter;
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
-    node.identifier.staticElement = setter;
-    expect(_analyze(node), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixedIdentifier_variable() {
-    VariableElementImpl variable = ElementFactory.localVariableElement2("b");
-    variable.type = _typeProvider.boolType;
-    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
-    node.identifier.staticElement = variable;
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_bang() {
-    // !0
-    PrefixExpression node = AstFactory.prefixExpression(TokenType.BANG, _resolvedInteger(0));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_minus() {
-    // -0
-    PrefixExpression node = AstFactory.prefixExpression(TokenType.MINUS, _resolvedInteger(0));
-    MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
-    node.staticElement = minusMethod;
-    expect(_analyze(node), same(_typeProvider.numType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_minusMinus() {
-    // --0
-    PrefixExpression node = AstFactory.prefixExpression(TokenType.MINUS_MINUS, _resolvedInteger(0));
-    MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
-    node.staticElement = minusMethod;
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_not() {
-    // !true
-    Expression node = AstFactory.prefixExpression(TokenType.BANG, AstFactory.booleanLiteral(true));
-    expect(_analyze(node), same(_typeProvider.boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_plusPlus() {
-    // ++0
-    PrefixExpression node = AstFactory.prefixExpression(TokenType.PLUS_PLUS, _resolvedInteger(0));
-    MethodElement plusMethod = getMethod(_typeProvider.numType, "+");
-    node.staticElement = plusMethod;
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPrefixExpression_tilde() {
-    // ~0
-    PrefixExpression node = AstFactory.prefixExpression(TokenType.TILDE, _resolvedInteger(0));
-    MethodElement tildeMethod = getMethod(_typeProvider.intType, "~");
-    node.staticElement = tildeMethod;
-    expect(_analyze(node), same(_typeProvider.intType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPropertyAccess_propagated_getter() {
-    DartType boolType = _typeProvider.boolType;
-    PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType);
-    PropertyAccess node = AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
-    node.propertyName.propagatedElement = getter;
-    expect(_analyze2(node, false), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPropertyAccess_propagated_setter() {
-    DartType boolType = _typeProvider.boolType;
-    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType);
-    PropertyAccessorElement setter = field.setter;
-    PropertyAccess node = AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
-    node.propertyName.propagatedElement = setter;
-    expect(_analyze2(node, false), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPropertyAccess_static_getter() {
-    DartType boolType = _typeProvider.boolType;
-    PropertyAccessorElementImpl getter = ElementFactory.getterElement("b", false, boolType);
-    PropertyAccess node = AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
-    node.propertyName.staticElement = getter;
-    expect(_analyze(node), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitPropertyAccess_static_setter() {
-    DartType boolType = _typeProvider.boolType;
-    FieldElementImpl field = ElementFactory.fieldElement("b", false, false, false, boolType);
-    PropertyAccessorElement setter = field.setter;
-    PropertyAccess node = AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
-    node.propertyName.staticElement = setter;
-    expect(_analyze(node), same(boolType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitSimpleIdentifier_dynamic() {
-    // "dynamic"
-    SimpleIdentifier identifier = AstFactory.identifier3('dynamic');
-    DynamicElementImpl element = DynamicElementImpl.instance;
-    identifier.staticElement = element;
-    identifier.staticType = _typeProvider.typeType;
-    expect(_analyze(identifier), same(_typeProvider.typeType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitSimpleStringLiteral() {
-    // "a"
-    Expression node = _resolvedString("a");
-    expect(_analyze(node), same(_typeProvider.stringType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitStringInterpolation() {
-    // "a${'b'}c"
-    Expression node = AstFactory.string([
-        AstFactory.interpolationString("a", "a"),
-        AstFactory.interpolationExpression(_resolvedString("b")),
-        AstFactory.interpolationString("c", "c")]);
-    expect(_analyze(node), same(_typeProvider.stringType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitSuperExpression() {
-    // super
-    InterfaceType superType = ElementFactory.classElement2("A").type;
-    InterfaceType thisType = ElementFactory.classElement("B", superType).type;
-    Expression node = AstFactory.superExpression();
-    expect(_analyze3(node, thisType), same(thisType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitSymbolLiteral() {
-    expect(_analyze(AstFactory.symbolLiteral(["a"])), same(_typeProvider.symbolType));
-  }
-
-  void test_visitThisExpression() {
-    // this
-    InterfaceType thisType = ElementFactory.classElement("B", ElementFactory.classElement2("A").type).type;
-    Expression node = AstFactory.thisExpression();
-    expect(_analyze3(node, thisType), same(thisType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitThrowExpression_withoutValue() {
-    // throw
-    Expression node = AstFactory.throwExpression();
-    expect(_analyze(node), same(_typeProvider.bottomType));
-    _listener.assertNoErrors();
-  }
-
-  void test_visitThrowExpression_withValue() {
-    // throw 0
-    Expression node = AstFactory.throwExpression2(_resolvedInteger(0));
-    expect(_analyze(node), same(_typeProvider.bottomType));
-    _listener.assertNoErrors();
-  }
-
-  /**
-   * Return the type associated with the given expression after the static type analyzer has
-   * computed a type for it.
-   *
-   * @param node the expression with which the type is associated
-   * @return the type associated with the expression
-   */
-  DartType _analyze(Expression node) => _analyze4(node, null, true);
-
-  /**
-   * Return the type associated with the given expression after the static or propagated type
-   * analyzer has computed a type for it.
-   *
-   * @param node the expression with which the type is associated
-   * @param useStaticType `true` if the static type is being requested, and `false` if
-   *          the propagated type is being requested
-   * @return the type associated with the expression
-   */
-  DartType _analyze2(Expression node, bool useStaticType) => _analyze4(node, null, useStaticType);
-
-  /**
-   * Return the type associated with the given expression after the static type analyzer has
-   * computed a type for it.
-   *
-   * @param node the expression with which the type is associated
-   * @param thisType the type of 'this'
-   * @return the type associated with the expression
-   */
-  DartType _analyze3(Expression node, InterfaceType thisType) => _analyze4(node, thisType, true);
-
-  /**
-   * Return the type associated with the given expression after the static type analyzer has
-   * computed a type for it.
-   *
-   * @param node the expression with which the type is associated
-   * @param thisType the type of 'this'
-   * @param useStaticType `true` if the static type is being requested, and `false` if
-   *          the propagated type is being requested
-   * @return the type associated with the expression
-   */
-  DartType _analyze4(Expression node, InterfaceType thisType, bool useStaticType) {
-    try {
-      _analyzer.thisType_J2DAccessor = thisType;
-    } catch (exception) {
-      throw new IllegalArgumentException("Could not set type of 'this'", exception);
-    }
-    node.accept(_analyzer);
-    if (useStaticType) {
-      return node.staticType;
-    } else {
-      return node.propagatedType;
-    }
-  }
-
-  /**
-   * Return the type associated with the given parameter after the static type analyzer has computed
-   * a type for it.
-   *
-   * @param node the parameter with which the type is associated
-   * @return the type associated with the parameter
-   */
-  DartType _analyze5(FormalParameter node) {
-    node.accept(_analyzer);
-    return (node.identifier.staticElement as ParameterElement).type;
-  }
-
-  /**
-   * Assert that the actual type is a function type with the expected characteristics.
-   *
-   * @param expectedReturnType the expected return type of the function
-   * @param expectedNormalTypes the expected types of the normal parameters
-   * @param expectedOptionalTypes the expected types of the optional parameters
-   * @param expectedNamedTypes the expected types of the named parameters
-   * @param actualType the type being tested
-   */
-  void _assertFunctionType(DartType expectedReturnType, List<DartType> expectedNormalTypes, List<DartType> expectedOptionalTypes, Map<String, DartType> expectedNamedTypes, DartType actualType) {
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionType, FunctionType, actualType);
-    FunctionType functionType = actualType as FunctionType;
-    List<DartType> normalTypes = functionType.normalParameterTypes;
-    if (expectedNormalTypes == null) {
-      expect(normalTypes, hasLength(0));
-    } else {
-      int expectedCount = expectedNormalTypes.length;
-      expect(normalTypes, hasLength(expectedCount));
-      for (int i = 0; i < expectedCount; i++) {
-        expect(normalTypes[i], same(expectedNormalTypes[i]));
-      }
-    }
-    List<DartType> optionalTypes = functionType.optionalParameterTypes;
-    if (expectedOptionalTypes == null) {
-      expect(optionalTypes, hasLength(0));
-    } else {
-      int expectedCount = expectedOptionalTypes.length;
-      expect(optionalTypes, hasLength(expectedCount));
-      for (int i = 0; i < expectedCount; i++) {
-        expect(optionalTypes[i], same(expectedOptionalTypes[i]));
-      }
-    }
-    Map<String, DartType> namedTypes = functionType.namedParameterTypes;
-    if (expectedNamedTypes == null) {
-      expect(namedTypes, hasLength(0));
-    } else {
-      expect(namedTypes, hasLength(expectedNamedTypes.length));
-      expectedNamedTypes.forEach((String name, DartType type) {
-        expect(namedTypes[name], same(type));
-      });
-    }
-    expect(functionType.returnType, same(expectedReturnType));
-  }
-
-  void _assertType(InterfaceTypeImpl expectedType, InterfaceTypeImpl actualType) {
-    expect(actualType.displayName, expectedType.displayName);
-    expect(actualType.element, expectedType.element);
-    List<DartType> expectedArguments = expectedType.typeArguments;
-    int length = expectedArguments.length;
-    List<DartType> actualArguments = actualType.typeArguments;
-    expect(actualArguments, hasLength(length));
-    for (int i = 0; i < length; i++) {
-      _assertType2(expectedArguments[i], actualArguments[i]);
-    }
-  }
-
-  void _assertType2(DartType expectedType, DartType actualType) {
-    if (expectedType is InterfaceTypeImpl) {
-      EngineTestCase.assertInstanceOf((obj) => obj is InterfaceTypeImpl, InterfaceTypeImpl, actualType);
-      _assertType(expectedType, actualType as InterfaceTypeImpl);
-    }
-    // TODO(brianwilkerson) Compare other kinds of types then make this a shared utility method
-  }
-
-  /**
-   * Create the analyzer used by the tests.
-   *
-   * @return the analyzer to be used by the tests
-   */
-  StaticTypeAnalyzer _createAnalyzer() {
-    AnalysisContextImpl context = new AnalysisContextImpl();
-    SourceFactory sourceFactory = new SourceFactory([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
-    context.sourceFactory = sourceFactory;
-    FileBasedSource source = new FileBasedSource.con1(FileUtilities2.createFile("/lib.dart"));
-    CompilationUnitElementImpl definingCompilationUnit = new CompilationUnitElementImpl("lib.dart");
-    definingCompilationUnit.source = source;
-    LibraryElementImpl definingLibrary = new LibraryElementImpl.forNode(context, null);
-    definingLibrary.definingCompilationUnit = definingCompilationUnit;
-    Library library = new Library(context, _listener, source);
-    library.libraryElement = definingLibrary;
-    _visitor = new ResolverVisitor.con1(library, source, _typeProvider);
-    _visitor.overrideManager.enterScope();
-    try {
-      return _visitor.typeAnalyzer_J2DAccessor as StaticTypeAnalyzer;
-    } catch (exception) {
-      throw new IllegalArgumentException("Could not create analyzer", exception);
-    }
-  }
-
-  /**
-   * Return an integer literal that has been resolved to the correct type.
-   *
-   * @param value the value of the literal
-   * @return an integer literal that has been resolved to the correct type
-   */
-  DoubleLiteral _resolvedDouble(double value) {
-    DoubleLiteral literal = AstFactory.doubleLiteral(value);
-    literal.staticType = _typeProvider.doubleType;
-    return literal;
-  }
-
-  /**
-   * Create a function expression that has an element associated with it, where the element has an
-   * incomplete type associated with it (just like the one
-   * [ElementBuilder.visitFunctionExpression] would have built if we had
-   * run it).
-   *
-   * @param parameters the parameters to the function
-   * @param body the body of the function
-   * @return a resolved function expression
-   */
-  FunctionExpression _resolvedFunctionExpression(FormalParameterList parameters, FunctionBody body) {
-    List<ParameterElement> parameterElements = new List<ParameterElement>();
-    for (FormalParameter parameter in parameters.parameters) {
-      ParameterElementImpl element = new ParameterElementImpl.forNode(parameter.identifier);
-      element.parameterKind = parameter.kind;
-      element.type = _typeProvider.dynamicType;
-      parameter.identifier.staticElement = element;
-      parameterElements.add(element);
-    }
-    FunctionExpression node = AstFactory.functionExpression2(parameters, body);
-    FunctionElementImpl element = new FunctionElementImpl.forNode(null);
-    element.parameters = parameterElements;
-    element.type = new FunctionTypeImpl.con1(element);
-    node.element = element;
-    return node;
-  }
-
-  /**
-   * Return an integer literal that has been resolved to the correct type.
-   *
-   * @param value the value of the literal
-   * @return an integer literal that has been resolved to the correct type
-   */
-  IntegerLiteral _resolvedInteger(int value) {
-    IntegerLiteral literal = AstFactory.integer(value);
-    literal.staticType = _typeProvider.intType;
-    return literal;
-  }
-
-  /**
-   * Return a string literal that has been resolved to the correct type.
-   *
-   * @param value the value of the literal
-   * @return a string literal that has been resolved to the correct type
-   */
-  SimpleStringLiteral _resolvedString(String value) {
-    SimpleStringLiteral string = AstFactory.string2(value);
-    string.staticType = _typeProvider.stringType;
-    return string;
-  }
-
-  /**
-   * Return a simple identifier that has been resolved to a variable element with the given type.
-   *
-   * @param type the type of the variable being represented
-   * @param variableName the name of the variable
-   * @return a simple identifier that has been resolved to a variable element with the given type
-   */
-  SimpleIdentifier _resolvedVariable(InterfaceType type, String variableName) {
-    SimpleIdentifier identifier = AstFactory.identifier3(variableName);
-    VariableElementImpl element = ElementFactory.localVariableElement(identifier);
-    element.type = type;
-    identifier.staticElement = element;
-    identifier.staticType = type;
-    return identifier;
-  }
-
-  /**
-   * Set the type of the given parameter to the given type.
-   *
-   * @param parameter the parameter whose type is to be set
-   * @param type the new type of the given parameter
-   */
-  void _setType(FormalParameter parameter, DartType type) {
-    SimpleIdentifier identifier = parameter.identifier;
-    Element element = identifier.staticElement;
-    if (element is! ParameterElement) {
-      element = new ParameterElementImpl.forNode(identifier);
-      identifier.staticElement = element;
-    }
-    (element as ParameterElementImpl).type = type;
-  }
-}
-
-
 /**
  * Like [StaticTypeAnalyzerTest], but as end-to-end tests.
  */
@@ -9093,6 +9419,1209 @@
   }
 }
 
+class StaticTypeAnalyzerTest extends EngineTestCase {
+  /**
+   * The error listener to which errors will be reported.
+   */
+  GatheringErrorListener _listener;
+
+  /**
+   * The resolver visitor used to create the analyzer.
+   */
+  ResolverVisitor _visitor;
+
+  /**
+   * The analyzer being used to analyze the test cases.
+   */
+  StaticTypeAnalyzer _analyzer;
+
+  /**
+   * The type provider used to access the types.
+   */
+  TestTypeProvider _typeProvider;
+
+  void fail_visitFunctionExpressionInvocation() {
+    fail("Not yet tested");
+    _listener.assertNoErrors();
+  }
+
+  void fail_visitMethodInvocation() {
+    fail("Not yet tested");
+    _listener.assertNoErrors();
+  }
+
+  void fail_visitSimpleIdentifier() {
+    fail("Not yet tested");
+    _listener.assertNoErrors();
+  }
+
+  @override
+  void setUp() {
+    _listener = new GatheringErrorListener();
+    _typeProvider = new TestTypeProvider();
+    _analyzer = _createAnalyzer();
+  }
+
+  void test_visitAdjacentStrings() {
+    // "a" "b"
+    Expression node =
+        AstFactory.adjacentStrings([_resolvedString("a"), _resolvedString("b")]);
+    expect(_analyze(node), same(_typeProvider.stringType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitAsExpression() {
+    // class A { ... this as B ... }
+    // class B extends A {}
+    ClassElement superclass = ElementFactory.classElement2("A");
+    InterfaceType superclassType = superclass.type;
+    ClassElement subclass = ElementFactory.classElement("B", superclassType);
+    Expression node = AstFactory.asExpression(
+        AstFactory.thisExpression(),
+        AstFactory.typeName(subclass));
+    expect(_analyze3(node, superclassType), same(subclass.type));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitAssignmentExpression_compound() {
+    // i += 1
+    InterfaceType numType = _typeProvider.numType;
+    SimpleIdentifier identifier = _resolvedVariable(_typeProvider.intType, "i");
+    AssignmentExpression node = AstFactory.assignmentExpression(
+        identifier,
+        TokenType.PLUS_EQ,
+        _resolvedInteger(1));
+    MethodElement plusMethod = getMethod(numType, "+");
+    node.staticElement = plusMethod;
+    expect(_analyze(node), same(numType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitAssignmentExpression_simple() {
+    // i = 0
+    InterfaceType intType = _typeProvider.intType;
+    Expression node = AstFactory.assignmentExpression(
+        _resolvedVariable(intType, "i"),
+        TokenType.EQ,
+        _resolvedInteger(0));
+    expect(_analyze(node), same(intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_equals() {
+    // 2 == 3
+    Expression node = AstFactory.binaryExpression(
+        _resolvedInteger(2),
+        TokenType.EQ_EQ,
+        _resolvedInteger(3));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_logicalAnd() {
+    // false && true
+    Expression node = AstFactory.binaryExpression(
+        AstFactory.booleanLiteral(false),
+        TokenType.AMPERSAND_AMPERSAND,
+        AstFactory.booleanLiteral(true));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_logicalOr() {
+    // false || true
+    Expression node = AstFactory.binaryExpression(
+        AstFactory.booleanLiteral(false),
+        TokenType.BAR_BAR,
+        AstFactory.booleanLiteral(true));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_notEquals() {
+    // 2 != 3
+    Expression node = AstFactory.binaryExpression(
+        _resolvedInteger(2),
+        TokenType.BANG_EQ,
+        _resolvedInteger(3));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_plusID() {
+    // 1 + 2.0
+    BinaryExpression node = AstFactory.binaryExpression(
+        _resolvedInteger(1),
+        TokenType.PLUS,
+        _resolvedDouble(2.0));
+    node.staticElement = getMethod(_typeProvider.numType, "+");
+    expect(_analyze(node), same(_typeProvider.doubleType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_plusII() {
+    // 1 + 2
+    BinaryExpression node = AstFactory.binaryExpression(
+        _resolvedInteger(1),
+        TokenType.PLUS,
+        _resolvedInteger(2));
+    node.staticElement = getMethod(_typeProvider.numType, "+");
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_slash() {
+    // 2 / 2
+    BinaryExpression node = AstFactory.binaryExpression(
+        _resolvedInteger(2),
+        TokenType.SLASH,
+        _resolvedInteger(2));
+    node.staticElement = getMethod(_typeProvider.numType, "/");
+    expect(_analyze(node), same(_typeProvider.doubleType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_star_notSpecial() {
+    // class A {
+    //   A operator *(double value);
+    // }
+    // (a as A) * 2.0
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    InterfaceType typeA = classA.type;
+    MethodElement operator =
+        ElementFactory.methodElement("*", typeA, [_typeProvider.doubleType]);
+    classA.methods = <MethodElement>[operator];
+    BinaryExpression node = AstFactory.binaryExpression(
+        AstFactory.asExpression(
+            AstFactory.identifier3("a"),
+            AstFactory.typeName(classA)),
+        TokenType.PLUS,
+        _resolvedDouble(2.0));
+    node.staticElement = operator;
+    expect(_analyze(node), same(typeA));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBinaryExpression_starID() {
+    // 1 * 2.0
+    BinaryExpression node = AstFactory.binaryExpression(
+        _resolvedInteger(1),
+        TokenType.PLUS,
+        _resolvedDouble(2.0));
+    node.staticElement = getMethod(_typeProvider.numType, "*");
+    expect(_analyze(node), same(_typeProvider.doubleType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBooleanLiteral_false() {
+    // false
+    Expression node = AstFactory.booleanLiteral(false);
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitBooleanLiteral_true() {
+    // true
+    Expression node = AstFactory.booleanLiteral(true);
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitCascadeExpression() {
+    // a..length
+    Expression node = AstFactory.cascadeExpression(
+        _resolvedString("a"),
+        [AstFactory.propertyAccess2(null, "length")]);
+    expect(_analyze(node), same(_typeProvider.stringType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitConditionalExpression_differentTypes() {
+    // true ? 1.0 : 0
+    Expression node = AstFactory.conditionalExpression(
+        AstFactory.booleanLiteral(true),
+        _resolvedDouble(1.0),
+        _resolvedInteger(0));
+    expect(_analyze(node), same(_typeProvider.numType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitConditionalExpression_sameTypes() {
+    // true ? 1 : 0
+    Expression node = AstFactory.conditionalExpression(
+        AstFactory.booleanLiteral(true),
+        _resolvedInteger(1),
+        _resolvedInteger(0));
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitDoubleLiteral() {
+    // 4.33
+    Expression node = AstFactory.doubleLiteral(4.33);
+    expect(_analyze(node), same(_typeProvider.doubleType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_named_block() {
+    // ({p1 : 0, p2 : 0}) {}
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.namedFormalParameter(
+        AstFactory.simpleFormalParameter3("p1"),
+        _resolvedInteger(0));
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.namedFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.blockFunctionBody2());
+    _analyze5(p1);
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
+    expectedNamedTypes["p1"] = dynamicType;
+    expectedNamedTypes["p2"] = dynamicType;
+    _assertFunctionType(
+        dynamicType,
+        null,
+        null,
+        expectedNamedTypes,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_named_expression() {
+    // ({p : 0}) -> 0;
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p = AstFactory.namedFormalParameter(
+        AstFactory.simpleFormalParameter3("p"),
+        _resolvedInteger(0));
+    _setType(p, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p]),
+        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+    _analyze5(p);
+    DartType resultType = _analyze(node);
+    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
+    expectedNamedTypes["p"] = dynamicType;
+    _assertFunctionType(
+        _typeProvider.intType,
+        null,
+        null,
+        expectedNamedTypes,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normal_block() {
+    // (p1, p2) {}
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.simpleFormalParameter3("p2");
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.blockFunctionBody2());
+    _analyze5(p1);
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        dynamicType,
+        <DartType>[dynamicType, dynamicType],
+        null,
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normal_expression() {
+    // (p1, p2) -> 0
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p = AstFactory.simpleFormalParameter3("p");
+    _setType(p, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p]),
+        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+    _analyze5(p);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        _typeProvider.intType,
+        <DartType>[dynamicType],
+        null,
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normalAndNamed_block() {
+    // (p1, {p2 : 0}) {}
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.namedFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.blockFunctionBody2());
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
+    expectedNamedTypes["p2"] = dynamicType;
+    _assertFunctionType(
+        dynamicType,
+        <DartType>[dynamicType],
+        null,
+        expectedNamedTypes,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normalAndNamed_expression() {
+    // (p1, {p2 : 0}) -> 0
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.namedFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
+    expectedNamedTypes["p2"] = dynamicType;
+    _assertFunctionType(
+        _typeProvider.intType,
+        <DartType>[dynamicType],
+        null,
+        expectedNamedTypes,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normalAndPositional_block() {
+    // (p1, [p2 = 0]) {}
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.blockFunctionBody2());
+    _analyze5(p1);
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        dynamicType,
+        <DartType>[dynamicType],
+        <DartType>[dynamicType],
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_normalAndPositional_expression() {
+    // (p1, [p2 = 0]) -> 0
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.simpleFormalParameter3("p1");
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+    _analyze5(p1);
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        _typeProvider.intType,
+        <DartType>[dynamicType],
+        <DartType>[dynamicType],
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_positional_block() {
+    // ([p1 = 0, p2 = 0]) {}
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p1 = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p1"),
+        _resolvedInteger(0));
+    _setType(p1, dynamicType);
+    FormalParameter p2 = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p2"),
+        _resolvedInteger(0));
+    _setType(p2, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p1, p2]),
+        AstFactory.blockFunctionBody2());
+    _analyze5(p1);
+    _analyze5(p2);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        dynamicType,
+        null,
+        <DartType>[dynamicType, dynamicType],
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitFunctionExpression_positional_expression() {
+    // ([p1 = 0, p2 = 0]) -> 0
+    DartType dynamicType = _typeProvider.dynamicType;
+    FormalParameter p = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p"),
+        _resolvedInteger(0));
+    _setType(p, dynamicType);
+    FunctionExpression node = _resolvedFunctionExpression(
+        AstFactory.formalParameterList([p]),
+        AstFactory.expressionFunctionBody(_resolvedInteger(0)));
+    _analyze5(p);
+    DartType resultType = _analyze(node);
+    _assertFunctionType(
+        _typeProvider.intType,
+        null,
+        <DartType>[dynamicType],
+        null,
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIndexExpression_getter() {
+    // List a;
+    // a[2]
+    InterfaceType listType = _typeProvider.listType;
+    SimpleIdentifier identifier = _resolvedVariable(listType, "a");
+    IndexExpression node =
+        AstFactory.indexExpression(identifier, _resolvedInteger(2));
+    MethodElement indexMethod = listType.element.methods[0];
+    node.staticElement = indexMethod;
+    expect(_analyze(node), same(listType.typeArguments[0]));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIndexExpression_setter() {
+    // List a;
+    // a[2] = 0
+    InterfaceType listType = _typeProvider.listType;
+    SimpleIdentifier identifier = _resolvedVariable(listType, "a");
+    IndexExpression node =
+        AstFactory.indexExpression(identifier, _resolvedInteger(2));
+    MethodElement indexMethod = listType.element.methods[1];
+    node.staticElement = indexMethod;
+    AstFactory.assignmentExpression(node, TokenType.EQ, AstFactory.integer(0));
+    expect(_analyze(node), same(listType.typeArguments[0]));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIndexExpression_typeParameters() {
+    // List<int> list = ...
+    // list[0]
+    InterfaceType intType = _typeProvider.intType;
+    InterfaceType listType = _typeProvider.listType;
+    // (int) -> E
+    MethodElement methodElement = getMethod(listType, "[]");
+    // "list" has type List<int>
+    SimpleIdentifier identifier = AstFactory.identifier3("list");
+    InterfaceType listOfIntType = listType.substitute4(<DartType>[intType]);
+    identifier.staticType = listOfIntType;
+    // list[0] has MethodElement element (int) -> E
+    IndexExpression indexExpression =
+        AstFactory.indexExpression(identifier, AstFactory.integer(0));
+    MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
+    indexExpression.staticElement = indexMethod;
+    // analyze and assert result of the index expression
+    expect(_analyze(indexExpression), same(intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIndexExpression_typeParameters_inSetterContext() {
+    // List<int> list = ...
+    // list[0] = 0;
+    InterfaceType intType = _typeProvider.intType;
+    InterfaceType listType = _typeProvider.listType;
+    // (int, E) -> void
+    MethodElement methodElement = getMethod(listType, "[]=");
+    // "list" has type List<int>
+    SimpleIdentifier identifier = AstFactory.identifier3("list");
+    InterfaceType listOfIntType = listType.substitute4(<DartType>[intType]);
+    identifier.staticType = listOfIntType;
+    // list[0] has MethodElement element (int) -> E
+    IndexExpression indexExpression =
+        AstFactory.indexExpression(identifier, AstFactory.integer(0));
+    MethodElement indexMethod = MethodMember.from(methodElement, listOfIntType);
+    indexExpression.staticElement = indexMethod;
+    // list[0] should be in a setter context
+    AstFactory.assignmentExpression(
+        indexExpression,
+        TokenType.EQ,
+        AstFactory.integer(0));
+    // analyze and assert result of the index expression
+    expect(_analyze(indexExpression), same(intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitInstanceCreationExpression_named() {
+    // new C.m()
+    ClassElementImpl classElement = ElementFactory.classElement2("C");
+    String constructorName = "m";
+    ConstructorElementImpl constructor =
+        ElementFactory.constructorElement2(classElement, constructorName);
+    constructor.returnType = classElement.type;
+    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+    constructor.type = constructorType;
+    classElement.constructors = <ConstructorElement>[constructor];
+    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(
+        null,
+        AstFactory.typeName(classElement),
+        [AstFactory.identifier3(constructorName)]);
+    node.staticElement = constructor;
+    expect(_analyze(node), same(classElement.type));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitInstanceCreationExpression_typeParameters() {
+    // new C<I>()
+    ClassElementImpl elementC = ElementFactory.classElement2("C", ["E"]);
+    ClassElementImpl elementI = ElementFactory.classElement2("I");
+    ConstructorElementImpl constructor =
+        ElementFactory.constructorElement2(elementC, null);
+    elementC.constructors = <ConstructorElement>[constructor];
+    constructor.returnType = elementC.type;
+    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+    constructor.type = constructorType;
+    TypeName typeName =
+        AstFactory.typeName(elementC, [AstFactory.typeName(elementI)]);
+    typeName.type = elementC.type.substitute4(<DartType>[elementI.type]);
+    InstanceCreationExpression node =
+        AstFactory.instanceCreationExpression2(null, typeName);
+    node.staticElement = constructor;
+    InterfaceType interfaceType = _analyze(node) as InterfaceType;
+    List<DartType> typeArgs = interfaceType.typeArguments;
+    expect(typeArgs.length, 1);
+    expect(typeArgs[0], elementI.type);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitInstanceCreationExpression_unnamed() {
+    // new C()
+    ClassElementImpl classElement = ElementFactory.classElement2("C");
+    ConstructorElementImpl constructor =
+        ElementFactory.constructorElement2(classElement, null);
+    constructor.returnType = classElement.type;
+    FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+    constructor.type = constructorType;
+    classElement.constructors = <ConstructorElement>[constructor];
+    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(
+        null,
+        AstFactory.typeName(classElement));
+    node.staticElement = constructor;
+    expect(_analyze(node), same(classElement.type));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIntegerLiteral() {
+    // 42
+    Expression node = _resolvedInteger(42);
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIsExpression_negated() {
+    // a is! String
+    Expression node = AstFactory.isExpression(
+        _resolvedString("a"),
+        true,
+        AstFactory.typeName4("String"));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitIsExpression_notNegated() {
+    // a is String
+    Expression node = AstFactory.isExpression(
+        _resolvedString("a"),
+        false,
+        AstFactory.typeName4("String"));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitListLiteral_empty() {
+    // []
+    Expression node = AstFactory.listLiteral();
+    DartType resultType = _analyze(node);
+    _assertType2(
+        _typeProvider.listType.substitute4(<DartType>[_typeProvider.dynamicType]),
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitListLiteral_nonEmpty() {
+    // [0]
+    Expression node = AstFactory.listLiteral([_resolvedInteger(0)]);
+    DartType resultType = _analyze(node);
+    _assertType2(
+        _typeProvider.listType.substitute4(<DartType>[_typeProvider.dynamicType]),
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitMapLiteral_empty() {
+    // {}
+    Expression node = AstFactory.mapLiteral2();
+    DartType resultType = _analyze(node);
+    _assertType2(
+        _typeProvider.mapType.substitute4(
+            <DartType>[_typeProvider.dynamicType, _typeProvider.dynamicType]),
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitMapLiteral_nonEmpty() {
+    // {"k" : 0}
+    Expression node =
+        AstFactory.mapLiteral2([AstFactory.mapLiteralEntry("k", _resolvedInteger(0))]);
+    DartType resultType = _analyze(node);
+    _assertType2(
+        _typeProvider.mapType.substitute4(
+            <DartType>[_typeProvider.dynamicType, _typeProvider.dynamicType]),
+        resultType);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitMethodInvocation_then() {
+    // then()
+    Expression node = AstFactory.methodInvocation(null, "then");
+    _analyze(node);
+    _listener.assertNoErrors();
+  }
+
+  void test_visitNamedExpression() {
+    // n: a
+    Expression node = AstFactory.namedExpression2("n", _resolvedString("a"));
+    expect(_analyze(node), same(_typeProvider.stringType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitNullLiteral() {
+    // null
+    Expression node = AstFactory.nullLiteral();
+    expect(_analyze(node), same(_typeProvider.bottomType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitParenthesizedExpression() {
+    // (0)
+    Expression node = AstFactory.parenthesizedExpression(_resolvedInteger(0));
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPostfixExpression_minusMinus() {
+    // 0--
+    PostfixExpression node =
+        AstFactory.postfixExpression(_resolvedInteger(0), TokenType.MINUS_MINUS);
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPostfixExpression_plusPlus() {
+    // 0++
+    PostfixExpression node =
+        AstFactory.postfixExpression(_resolvedInteger(0), TokenType.PLUS_PLUS);
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixedIdentifier_getter() {
+    DartType boolType = _typeProvider.boolType;
+    PropertyAccessorElementImpl getter =
+        ElementFactory.getterElement("b", false, boolType);
+    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    node.identifier.staticElement = getter;
+    expect(_analyze(node), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixedIdentifier_setter() {
+    DartType boolType = _typeProvider.boolType;
+    FieldElementImpl field =
+        ElementFactory.fieldElement("b", false, false, false, boolType);
+    PropertyAccessorElement setter = field.setter;
+    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    node.identifier.staticElement = setter;
+    expect(_analyze(node), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixedIdentifier_variable() {
+    VariableElementImpl variable = ElementFactory.localVariableElement2("b");
+    variable.type = _typeProvider.boolType;
+    PrefixedIdentifier node = AstFactory.identifier5("a", "b");
+    node.identifier.staticElement = variable;
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_bang() {
+    // !0
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.BANG, _resolvedInteger(0));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_minus() {
+    // -0
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.MINUS, _resolvedInteger(0));
+    MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
+    node.staticElement = minusMethod;
+    expect(_analyze(node), same(_typeProvider.numType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_minusMinus() {
+    // --0
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.MINUS_MINUS, _resolvedInteger(0));
+    MethodElement minusMethod = getMethod(_typeProvider.numType, "-");
+    node.staticElement = minusMethod;
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_not() {
+    // !true
+    Expression node =
+        AstFactory.prefixExpression(TokenType.BANG, AstFactory.booleanLiteral(true));
+    expect(_analyze(node), same(_typeProvider.boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_plusPlus() {
+    // ++0
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.PLUS_PLUS, _resolvedInteger(0));
+    MethodElement plusMethod = getMethod(_typeProvider.numType, "+");
+    node.staticElement = plusMethod;
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPrefixExpression_tilde() {
+    // ~0
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.TILDE, _resolvedInteger(0));
+    MethodElement tildeMethod = getMethod(_typeProvider.intType, "~");
+    node.staticElement = tildeMethod;
+    expect(_analyze(node), same(_typeProvider.intType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPropertyAccess_propagated_getter() {
+    DartType boolType = _typeProvider.boolType;
+    PropertyAccessorElementImpl getter =
+        ElementFactory.getterElement("b", false, boolType);
+    PropertyAccess node =
+        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+    node.propertyName.propagatedElement = getter;
+    expect(_analyze2(node, false), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPropertyAccess_propagated_setter() {
+    DartType boolType = _typeProvider.boolType;
+    FieldElementImpl field =
+        ElementFactory.fieldElement("b", false, false, false, boolType);
+    PropertyAccessorElement setter = field.setter;
+    PropertyAccess node =
+        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+    node.propertyName.propagatedElement = setter;
+    expect(_analyze2(node, false), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPropertyAccess_static_getter() {
+    DartType boolType = _typeProvider.boolType;
+    PropertyAccessorElementImpl getter =
+        ElementFactory.getterElement("b", false, boolType);
+    PropertyAccess node =
+        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+    node.propertyName.staticElement = getter;
+    expect(_analyze(node), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitPropertyAccess_static_setter() {
+    DartType boolType = _typeProvider.boolType;
+    FieldElementImpl field =
+        ElementFactory.fieldElement("b", false, false, false, boolType);
+    PropertyAccessorElement setter = field.setter;
+    PropertyAccess node =
+        AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b");
+    node.propertyName.staticElement = setter;
+    expect(_analyze(node), same(boolType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitSimpleIdentifier_dynamic() {
+    // "dynamic"
+    SimpleIdentifier identifier = AstFactory.identifier3('dynamic');
+    DynamicElementImpl element = DynamicElementImpl.instance;
+    identifier.staticElement = element;
+    identifier.staticType = _typeProvider.typeType;
+    expect(_analyze(identifier), same(_typeProvider.typeType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitSimpleStringLiteral() {
+    // "a"
+    Expression node = _resolvedString("a");
+    expect(_analyze(node), same(_typeProvider.stringType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitStringInterpolation() {
+    // "a${'b'}c"
+    Expression node = AstFactory.string(
+        [
+            AstFactory.interpolationString("a", "a"),
+            AstFactory.interpolationExpression(_resolvedString("b")),
+            AstFactory.interpolationString("c", "c")]);
+    expect(_analyze(node), same(_typeProvider.stringType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitSuperExpression() {
+    // super
+    InterfaceType superType = ElementFactory.classElement2("A").type;
+    InterfaceType thisType = ElementFactory.classElement("B", superType).type;
+    Expression node = AstFactory.superExpression();
+    expect(_analyze3(node, thisType), same(thisType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitSymbolLiteral() {
+    expect(
+        _analyze(AstFactory.symbolLiteral(["a"])),
+        same(_typeProvider.symbolType));
+  }
+
+  void test_visitThisExpression() {
+    // this
+    InterfaceType thisType =
+        ElementFactory.classElement("B", ElementFactory.classElement2("A").type).type;
+    Expression node = AstFactory.thisExpression();
+    expect(_analyze3(node, thisType), same(thisType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitThrowExpression_withoutValue() {
+    // throw
+    Expression node = AstFactory.throwExpression();
+    expect(_analyze(node), same(_typeProvider.bottomType));
+    _listener.assertNoErrors();
+  }
+
+  void test_visitThrowExpression_withValue() {
+    // throw 0
+    Expression node = AstFactory.throwExpression2(_resolvedInteger(0));
+    expect(_analyze(node), same(_typeProvider.bottomType));
+    _listener.assertNoErrors();
+  }
+
+  /**
+   * Return the type associated with the given expression after the static type analyzer has
+   * computed a type for it.
+   *
+   * @param node the expression with which the type is associated
+   * @return the type associated with the expression
+   */
+  DartType _analyze(Expression node) => _analyze4(node, null, true);
+
+  /**
+   * Return the type associated with the given expression after the static or propagated type
+   * analyzer has computed a type for it.
+   *
+   * @param node the expression with which the type is associated
+   * @param useStaticType `true` if the static type is being requested, and `false` if
+   *          the propagated type is being requested
+   * @return the type associated with the expression
+   */
+  DartType _analyze2(Expression node, bool useStaticType) =>
+      _analyze4(node, null, useStaticType);
+
+  /**
+   * Return the type associated with the given expression after the static type analyzer has
+   * computed a type for it.
+   *
+   * @param node the expression with which the type is associated
+   * @param thisType the type of 'this'
+   * @return the type associated with the expression
+   */
+  DartType _analyze3(Expression node, InterfaceType thisType) =>
+      _analyze4(node, thisType, true);
+
+  /**
+   * Return the type associated with the given expression after the static type analyzer has
+   * computed a type for it.
+   *
+   * @param node the expression with which the type is associated
+   * @param thisType the type of 'this'
+   * @param useStaticType `true` if the static type is being requested, and `false` if
+   *          the propagated type is being requested
+   * @return the type associated with the expression
+   */
+  DartType _analyze4(Expression node, InterfaceType thisType,
+      bool useStaticType) {
+    try {
+      _analyzer.thisType = thisType;
+    } catch (exception) {
+      throw new IllegalArgumentException(
+          "Could not set type of 'this'",
+          exception);
+    }
+    node.accept(_analyzer);
+    if (useStaticType) {
+      return node.staticType;
+    } else {
+      return node.propagatedType;
+    }
+  }
+
+  /**
+   * Return the type associated with the given parameter after the static type analyzer has computed
+   * a type for it.
+   *
+   * @param node the parameter with which the type is associated
+   * @return the type associated with the parameter
+   */
+  DartType _analyze5(FormalParameter node) {
+    node.accept(_analyzer);
+    return (node.identifier.staticElement as ParameterElement).type;
+  }
+
+  /**
+   * Assert that the actual type is a function type with the expected characteristics.
+   *
+   * @param expectedReturnType the expected return type of the function
+   * @param expectedNormalTypes the expected types of the normal parameters
+   * @param expectedOptionalTypes the expected types of the optional parameters
+   * @param expectedNamedTypes the expected types of the named parameters
+   * @param actualType the type being tested
+   */
+  void _assertFunctionType(DartType expectedReturnType,
+      List<DartType> expectedNormalTypes, List<DartType> expectedOptionalTypes,
+      Map<String, DartType> expectedNamedTypes, DartType actualType) {
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionType,
+        FunctionType,
+        actualType);
+    FunctionType functionType = actualType as FunctionType;
+    List<DartType> normalTypes = functionType.normalParameterTypes;
+    if (expectedNormalTypes == null) {
+      expect(normalTypes, hasLength(0));
+    } else {
+      int expectedCount = expectedNormalTypes.length;
+      expect(normalTypes, hasLength(expectedCount));
+      for (int i = 0; i < expectedCount; i++) {
+        expect(normalTypes[i], same(expectedNormalTypes[i]));
+      }
+    }
+    List<DartType> optionalTypes = functionType.optionalParameterTypes;
+    if (expectedOptionalTypes == null) {
+      expect(optionalTypes, hasLength(0));
+    } else {
+      int expectedCount = expectedOptionalTypes.length;
+      expect(optionalTypes, hasLength(expectedCount));
+      for (int i = 0; i < expectedCount; i++) {
+        expect(optionalTypes[i], same(expectedOptionalTypes[i]));
+      }
+    }
+    Map<String, DartType> namedTypes = functionType.namedParameterTypes;
+    if (expectedNamedTypes == null) {
+      expect(namedTypes, hasLength(0));
+    } else {
+      expect(namedTypes, hasLength(expectedNamedTypes.length));
+      expectedNamedTypes.forEach((String name, DartType type) {
+        expect(namedTypes[name], same(type));
+      });
+    }
+    expect(functionType.returnType, same(expectedReturnType));
+  }
+
+  void _assertType(InterfaceTypeImpl expectedType,
+      InterfaceTypeImpl actualType) {
+    expect(actualType.displayName, expectedType.displayName);
+    expect(actualType.element, expectedType.element);
+    List<DartType> expectedArguments = expectedType.typeArguments;
+    int length = expectedArguments.length;
+    List<DartType> actualArguments = actualType.typeArguments;
+    expect(actualArguments, hasLength(length));
+    for (int i = 0; i < length; i++) {
+      _assertType2(expectedArguments[i], actualArguments[i]);
+    }
+  }
+
+  void _assertType2(DartType expectedType, DartType actualType) {
+    if (expectedType is InterfaceTypeImpl) {
+      EngineTestCase.assertInstanceOf(
+          (obj) => obj is InterfaceTypeImpl,
+          InterfaceTypeImpl,
+          actualType);
+      _assertType(expectedType, actualType as InterfaceTypeImpl);
+    }
+    // TODO(brianwilkerson) Compare other kinds of types then make this a shared
+    // utility method.
+  }
+
+  /**
+   * Create the analyzer used by the tests.
+   *
+   * @return the analyzer to be used by the tests
+   */
+  StaticTypeAnalyzer _createAnalyzer() {
+    AnalysisContextImpl context = new AnalysisContextImpl();
+    SourceFactory sourceFactory =
+        new SourceFactory([new DartUriResolver(DirectoryBasedDartSdk.defaultSdk)]);
+    context.sourceFactory = sourceFactory;
+    FileBasedSource source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/lib.dart"));
+    CompilationUnitElementImpl definingCompilationUnit =
+        new CompilationUnitElementImpl("lib.dart");
+    definingCompilationUnit.source = source;
+    LibraryElementImpl definingLibrary =
+        new LibraryElementImpl.forNode(context, null);
+    definingLibrary.definingCompilationUnit = definingCompilationUnit;
+    Library library = new Library(context, _listener, source);
+    library.libraryElement = definingLibrary;
+    _visitor = new ResolverVisitor.con1(library, source, _typeProvider);
+    _visitor.overrideManager.enterScope();
+    try {
+      return _visitor.typeAnalyzer_J2DAccessor as StaticTypeAnalyzer;
+    } catch (exception) {
+      throw new IllegalArgumentException(
+          "Could not create analyzer",
+          exception);
+    }
+  }
+
+  /**
+   * Return an integer literal that has been resolved to the correct type.
+   *
+   * @param value the value of the literal
+   * @return an integer literal that has been resolved to the correct type
+   */
+  DoubleLiteral _resolvedDouble(double value) {
+    DoubleLiteral literal = AstFactory.doubleLiteral(value);
+    literal.staticType = _typeProvider.doubleType;
+    return literal;
+  }
+
+  /**
+   * Create a function expression that has an element associated with it, where the element has an
+   * incomplete type associated with it (just like the one
+   * [ElementBuilder.visitFunctionExpression] would have built if we had
+   * run it).
+   *
+   * @param parameters the parameters to the function
+   * @param body the body of the function
+   * @return a resolved function expression
+   */
+  FunctionExpression _resolvedFunctionExpression(FormalParameterList parameters,
+      FunctionBody body) {
+    List<ParameterElement> parameterElements = new List<ParameterElement>();
+    for (FormalParameter parameter in parameters.parameters) {
+      ParameterElementImpl element =
+          new ParameterElementImpl.forNode(parameter.identifier);
+      element.parameterKind = parameter.kind;
+      element.type = _typeProvider.dynamicType;
+      parameter.identifier.staticElement = element;
+      parameterElements.add(element);
+    }
+    FunctionExpression node = AstFactory.functionExpression2(parameters, body);
+    FunctionElementImpl element = new FunctionElementImpl.forNode(null);
+    element.parameters = parameterElements;
+    element.type = new FunctionTypeImpl.con1(element);
+    node.element = element;
+    return node;
+  }
+
+  /**
+   * Return an integer literal that has been resolved to the correct type.
+   *
+   * @param value the value of the literal
+   * @return an integer literal that has been resolved to the correct type
+   */
+  IntegerLiteral _resolvedInteger(int value) {
+    IntegerLiteral literal = AstFactory.integer(value);
+    literal.staticType = _typeProvider.intType;
+    return literal;
+  }
+
+  /**
+   * Return a string literal that has been resolved to the correct type.
+   *
+   * @param value the value of the literal
+   * @return a string literal that has been resolved to the correct type
+   */
+  SimpleStringLiteral _resolvedString(String value) {
+    SimpleStringLiteral string = AstFactory.string2(value);
+    string.staticType = _typeProvider.stringType;
+    return string;
+  }
+
+  /**
+   * Return a simple identifier that has been resolved to a variable element with the given type.
+   *
+   * @param type the type of the variable being represented
+   * @param variableName the name of the variable
+   * @return a simple identifier that has been resolved to a variable element with the given type
+   */
+  SimpleIdentifier _resolvedVariable(InterfaceType type, String variableName) {
+    SimpleIdentifier identifier = AstFactory.identifier3(variableName);
+    VariableElementImpl element =
+        ElementFactory.localVariableElement(identifier);
+    element.type = type;
+    identifier.staticElement = element;
+    identifier.staticType = type;
+    return identifier;
+  }
+
+  /**
+   * Set the type of the given parameter to the given type.
+   *
+   * @param parameter the parameter whose type is to be set
+   * @param type the new type of the given parameter
+   */
+  void _setType(FormalParameter parameter, DartType type) {
+    SimpleIdentifier identifier = parameter.identifier;
+    Element element = identifier.staticElement;
+    if (element is! ParameterElement) {
+      element = new ParameterElementImpl.forNode(identifier);
+      identifier.staticElement = element;
+    }
+    (element as ParameterElementImpl).type = type;
+  }
+}
+
+
 /**
  * Instances of the class `StaticTypeVerifier` verify that all of the nodes in an AST
  * structure that should have a static type associated with them do have a static type.
@@ -9169,7 +10698,8 @@
           buffer.writeln(")");
         }
       }
-      int invalidlyPropagatedExpressionCount = _invalidlyPropagatedExpressions.length;
+      int invalidlyPropagatedExpressionCount =
+          _invalidlyPropagatedExpressions.length;
       if (invalidlyPropagatedExpressionCount > 0) {
         buffer.writeln("Incorrectly propagated ");
         buffer.write(invalidlyPropagatedExpressionCount);
@@ -9237,8 +10767,8 @@
 
   @override
   Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    // In cases where we have a prefixed identifier where the prefix is dynamic, we don't want to
-    // assert that the node will have a type.
+    // In cases where we have a prefixed identifier where the prefix is dynamic,
+    // we don't want to assert that the node will have a type.
     if (node.staticType == null && node.prefix.staticType.isDynamic) {
       return null;
     }
@@ -9247,18 +10777,21 @@
 
   @override
   Object visitSimpleIdentifier(SimpleIdentifier node) {
-    // In cases where identifiers are being used for something other than an expressions,
-    // then they can be ignored.
+    // In cases where identifiers are being used for something other than an
+    // expressions, then they can be ignored.
     AstNode parent = node.parent;
     if (parent is MethodInvocation && identical(node, parent.methodName)) {
       return null;
-    } else if (parent is RedirectingConstructorInvocation && identical(node, parent.constructorName)) {
+    } else if (parent is RedirectingConstructorInvocation &&
+        identical(node, parent.constructorName)) {
       return null;
-    } else if (parent is SuperConstructorInvocation && identical(node, parent.constructorName)) {
+    } else if (parent is SuperConstructorInvocation &&
+        identical(node, parent.constructorName)) {
       return null;
     } else if (parent is ConstructorName && identical(node, parent.name)) {
       return null;
-    } else if (parent is ConstructorFieldInitializer && identical(node, parent.fieldName)) {
+    } else if (parent is ConstructorFieldInitializer &&
+        identical(node, parent.fieldName)) {
       return null;
     } else if (node.staticElement is PrefixElement) {
       // Prefixes don't have a type.
@@ -9269,8 +10802,8 @@
 
   @override
   Object visitTypeName(TypeName node) {
-    // Note: do not visit children from this node, the child SimpleIdentifier in TypeName
-    // (i.e. "String") does not have a static type defined.
+    // Note: do not visit children from this node, the child SimpleIdentifier in
+    // TypeName (i.e. "String") does not have a static type defined.
     if (node.type == null) {
       _unresolvedTypes.add(node);
     } else {
@@ -9280,8 +10813,8 @@
   }
 
   String _getFileName(AstNode node) {
-    // TODO (jwren) there are two copies of this method, one here and one in ResolutionVerifier,
-    // they should be resolved into a single method
+    // TODO (jwren) there are two copies of this method, one here and one in
+    // ResolutionVerifier, they should be resolved into a single method
     if (node != null) {
       AstNode root = node.root;
       if (root is CompilationUnit) {
@@ -9292,7 +10825,8 @@
           return "<unknown file- CompilationUnit.getElement() returned null>";
         }
       } else {
-        return "<unknown file- CompilationUnit.getRoot() is not a CompilationUnit>";
+        return
+            "<unknown file- CompilationUnit.getRoot() is not a CompilationUnit>";
       }
     }
     return "<unknown file- ASTNode is null>";
@@ -9465,6 +10999,20 @@
    */
   CompilationUnitElementImpl _definingCompilationUnit;
 
+  @override
+  void setUp() {
+    super.setUp();
+    AnalysisContextImpl context = AnalysisContextFactory.contextWithCore();
+    FileBasedSource source =
+        new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
+    _definingCompilationUnit = new CompilationUnitElementImpl("test.dart");
+    _definingCompilationUnit.source = source;
+    LibraryElementImpl definingLibrary =
+        ElementFactory.library(context, "test");
+    definingLibrary.definingCompilationUnit = _definingCompilationUnit;
+    _subtypeManager = new SubtypeManager();
+  }
+
   void test_computeAllSubtypes_infiniteLoop() {
     //
     // class A extends B
@@ -9473,8 +11021,9 @@
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
-    _definingCompilationUnit.types = <ClassElement> [classA, classB];
-    HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
+    _definingCompilationUnit.types = <ClassElement>[classA, classB];
+    HashSet<ClassElement> subtypesOfA =
+        _subtypeManager.computeAllSubtypes(classA);
     List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA);
     expect(subtypesOfA, hasLength(2));
     expect(arraySubtypesOfA, unorderedEquals([classA, classB]));
@@ -9493,10 +11042,13 @@
     ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     ClassElementImpl classD = ElementFactory.classElement("D", classB.type);
     ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
-    _definingCompilationUnit.types = <ClassElement> [classA, classB, classC, classD, classE];
-    HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
+    _definingCompilationUnit.types =
+        <ClassElement>[classA, classB, classC, classD, classE];
+    HashSet<ClassElement> subtypesOfA =
+        _subtypeManager.computeAllSubtypes(classA);
     List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA);
-    HashSet<ClassElement> subtypesOfB = _subtypeManager.computeAllSubtypes(classB);
+    HashSet<ClassElement> subtypesOfB =
+        _subtypeManager.computeAllSubtypes(classB);
     List<ClassElement> arraySubtypesOfB = new List.from(subtypesOfB);
     expect(subtypesOfA, hasLength(4));
     expect(arraySubtypesOfA, unorderedEquals([classB, classC, classD, classE]));
@@ -9509,8 +11061,9 @@
     // class A
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
-    _definingCompilationUnit.types = <ClassElement> [classA];
-    HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
+    _definingCompilationUnit.types = <ClassElement>[classA];
+    HashSet<ClassElement> subtypesOfA =
+        _subtypeManager.computeAllSubtypes(classA);
     expect(subtypesOfA, hasLength(0));
   }
 
@@ -9521,24 +11074,13 @@
     //
     ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
-    _definingCompilationUnit.types = <ClassElement> [classA, classB];
-    HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
+    _definingCompilationUnit.types = <ClassElement>[classA, classB];
+    HashSet<ClassElement> subtypesOfA =
+        _subtypeManager.computeAllSubtypes(classA);
     List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA);
     expect(subtypesOfA, hasLength(1));
     expect(arraySubtypesOfA, unorderedEquals([classB]));
   }
-
-  @override
-  void setUp() {
-    super.setUp();
-    AnalysisContextImpl context = AnalysisContextFactory.contextWithCore();
-    FileBasedSource source = new FileBasedSource.con1(FileUtilities2.createFile("/test.dart"));
-    _definingCompilationUnit = new CompilationUnitElementImpl("test.dart");
-    _definingCompilationUnit.source = source;
-    LibraryElementImpl definingLibrary = ElementFactory.library(context, "test");
-    definingLibrary.definingCompilationUnit = _definingCompilationUnit;
-    _subtypeManager = new SubtypeManager();
-  }
 }
 
 /**
@@ -9646,12 +11188,13 @@
     if (_boolType == null) {
       ClassElementImpl boolElement = ElementFactory.classElement2("bool");
       _boolType = boolElement.type;
-      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(boolElement, "fromEnvironment", true);
-      fromEnvironment.parameters = <ParameterElement> [
+      ConstructorElementImpl fromEnvironment =
+          ElementFactory.constructorElement(boolElement, "fromEnvironment", true);
+      fromEnvironment.parameters = <ParameterElement>[
           ElementFactory.requiredParameter2("name", stringType),
           ElementFactory.namedParameter2("defaultValue", _boolType)];
       fromEnvironment.factory = true;
-      boolElement.constructors = <ConstructorElement> [fromEnvironment];
+      boolElement.constructors = <ConstructorElement>[fromEnvironment];
     }
     return _boolType;
   }
@@ -9667,8 +11210,10 @@
   @override
   InterfaceType get deprecatedType {
     if (_deprecatedType == null) {
-      ClassElementImpl deprecatedElement = ElementFactory.classElement2("Deprecated");
-      deprecatedElement.constructors = <ConstructorElement> [ElementFactory.constructorElement(deprecatedElement, null, true, [stringType])];
+      ClassElementImpl deprecatedElement =
+          ElementFactory.classElement2("Deprecated");
+      deprecatedElement.constructors = <ConstructorElement>[
+          ElementFactory.constructorElement(deprecatedElement, null, true, [stringType])];
       _deprecatedType = deprecatedElement.type;
     }
     return _deprecatedType;
@@ -9708,11 +11253,15 @@
 
   InterfaceType get iterableType {
     if (_iterableType == null) {
-      ClassElementImpl iterableElement = ElementFactory.classElement2("Iterable", ["E"]);
+      ClassElementImpl iterableElement =
+          ElementFactory.classElement2("Iterable", ["E"]);
       _iterableType = iterableElement.type;
       DartType eType = iterableElement.typeParameters[0].type;
-      iterableElement.accessors = <PropertyAccessorElement> [
-          ElementFactory.getterElement("iterator", false, iteratorType.substitute4(<DartType> [eType])),
+      iterableElement.accessors = <PropertyAccessorElement>[
+          ElementFactory.getterElement(
+              "iterator",
+              false,
+              iteratorType.substitute4(<DartType>[eType])),
           ElementFactory.getterElement("last", false, eType)];
       _propagateTypeArguments(iterableElement);
     }
@@ -9721,10 +11270,12 @@
 
   InterfaceType get iteratorType {
     if (_iteratorType == null) {
-      ClassElementImpl iteratorElement = ElementFactory.classElement2("Iterator", ["E"]);
+      ClassElementImpl iteratorElement =
+          ElementFactory.classElement2("Iterator", ["E"]);
       _iteratorType = iteratorElement.type;
       DartType eType = iteratorElement.typeParameters[0].type;
-      iteratorElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("current", false, eType)];
+      iteratorElement.accessors = <PropertyAccessorElement>[
+          ElementFactory.getterElement("current", false, eType)];
       _propagateTypeArguments(iteratorElement);
     }
     return _iteratorType;
@@ -9733,14 +11284,18 @@
   @override
   InterfaceType get listType {
     if (_listType == null) {
-      ClassElementImpl listElement = ElementFactory.classElement2("List", ["E"]);
-      listElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(listElement, null)];
+      ClassElementImpl listElement =
+          ElementFactory.classElement2("List", ["E"]);
+      listElement.constructors =
+          <ConstructorElement>[ElementFactory.constructorElement2(listElement, null)];
       _listType = listElement.type;
       DartType eType = listElement.typeParameters[0].type;
-      InterfaceType iterableType = this.iterableType.substitute4(<DartType> [eType]);
-      listElement.interfaces = <InterfaceType> [iterableType];
-      listElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("length", false, intType)];
-      listElement.methods = <MethodElement> [
+      InterfaceType iterableType =
+          this.iterableType.substitute4(<DartType>[eType]);
+      listElement.interfaces = <InterfaceType>[iterableType];
+      listElement.accessors = <PropertyAccessorElement>[
+          ElementFactory.getterElement("length", false, intType)];
+      listElement.methods = <MethodElement>[
           ElementFactory.methodElement("[]", eType, [intType]),
           ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [intType, eType]),
           ElementFactory.methodElement("add", VoidTypeImpl.instance, [eType])];
@@ -9752,12 +11307,14 @@
   @override
   InterfaceType get mapType {
     if (_mapType == null) {
-      ClassElementImpl mapElement = ElementFactory.classElement2("Map", ["K", "V"]);
+      ClassElementImpl mapElement =
+          ElementFactory.classElement2("Map", ["K", "V"]);
       _mapType = mapElement.type;
       DartType kType = mapElement.typeParameters[0].type;
       DartType vType = mapElement.typeParameters[1].type;
-      mapElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("length", false, intType)];
-      mapElement.methods = <MethodElement> [
+      mapElement.accessors = <PropertyAccessorElement>[
+          ElementFactory.getterElement("length", false, intType)];
+      mapElement.methods = <MethodElement>[
           ElementFactory.methodElement("[]", vType, [objectType]),
           ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [kType, vType])];
       _propagateTypeArguments(mapElement);
@@ -9786,12 +11343,13 @@
     if (_objectType == null) {
       ClassElementImpl objectElement = ElementFactory.object;
       _objectType = objectElement.type;
-      objectElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(objectElement, null)];
-      objectElement.methods = <MethodElement> [
+      objectElement.constructors =
+          <ConstructorElement>[ElementFactory.constructorElement2(objectElement, null)];
+      objectElement.methods = <MethodElement>[
           ElementFactory.methodElement("toString", stringType),
           ElementFactory.methodElement("==", boolType, [_objectType]),
           ElementFactory.methodElement("noSuchMethod", dynamicType, [dynamicType])];
-      objectElement.accessors = <PropertyAccessorElement> [
+      objectElement.accessors = <PropertyAccessorElement>[
           ElementFactory.getterElement("hashCode", false, intType),
           ElementFactory.getterElement("runtimeType", false, typeType)];
     }
@@ -9811,20 +11369,24 @@
     if (_stringType == null) {
       _stringType = ElementFactory.classElement2("String").type;
       ClassElementImpl stringElement = _stringType.element as ClassElementImpl;
-      stringElement.accessors = <PropertyAccessorElement> [
+      stringElement.accessors = <PropertyAccessorElement>[
           ElementFactory.getterElement("isEmpty", false, boolType),
           ElementFactory.getterElement("length", false, intType),
-          ElementFactory.getterElement("codeUnits", false, listType.substitute4(<DartType> [intType]))];
-      stringElement.methods = <MethodElement> [
+          ElementFactory.getterElement(
+              "codeUnits",
+              false,
+              listType.substitute4(<DartType>[intType]))];
+      stringElement.methods = <MethodElement>[
           ElementFactory.methodElement("+", _stringType, [_stringType]),
           ElementFactory.methodElement("toLowerCase", _stringType),
           ElementFactory.methodElement("toUpperCase", _stringType)];
-      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(stringElement, "fromEnvironment", true);
-      fromEnvironment.parameters = <ParameterElement> [
+      ConstructorElementImpl fromEnvironment =
+          ElementFactory.constructorElement(stringElement, "fromEnvironment", true);
+      fromEnvironment.parameters = <ParameterElement>[
           ElementFactory.requiredParameter2("name", stringType),
           ElementFactory.namedParameter2("defaultValue", _stringType)];
       fromEnvironment.factory = true;
-      stringElement.constructors = <ConstructorElement> [fromEnvironment];
+      stringElement.constructors = <ConstructorElement>[fromEnvironment];
     }
     return _stringType;
   }
@@ -9833,9 +11395,10 @@
   InterfaceType get symbolType {
     if (_symbolType == null) {
       ClassElementImpl symbolClass = ElementFactory.classElement2("Symbol");
-      ConstructorElementImpl constructor = ElementFactory.constructorElement(symbolClass, null, true, [stringType]);
+      ConstructorElementImpl constructor =
+          ElementFactory.constructorElement(symbolClass, null, true, [stringType]);
       constructor.factory = true;
-      symbolClass.constructors = <ConstructorElement> [constructor];
+      symbolClass.constructors = <ConstructorElement>[constructor];
       _symbolType = symbolClass.type;
     }
     return _symbolType;
@@ -9869,7 +11432,8 @@
     _numType = numElement.type;
     ClassElementImpl intElement = ElementFactory.classElement("int", _numType);
     _intType = intElement.type;
-    ClassElementImpl doubleElement = ElementFactory.classElement("double", _numType);
+    ClassElementImpl doubleElement =
+        ElementFactory.classElement("double", _numType);
     _doubleType = doubleElement.type;
     //
     // Force the referenced types to be cached.
@@ -9880,7 +11444,7 @@
     //
     // Add the methods.
     //
-    numElement.methods = <MethodElement> [
+    numElement.methods = <MethodElement>[
         ElementFactory.methodElement("+", _numType, [_numType]),
         ElementFactory.methodElement("-", _numType, [_numType]),
         ElementFactory.methodElement("*", _numType, [_numType]),
@@ -9908,7 +11472,7 @@
         ElementFactory.methodElement("toStringAsExponential", _stringType, [_intType]),
         ElementFactory.methodElement("toStringAsPrecision", _stringType, [_intType]),
         ElementFactory.methodElement("toRadixString", _stringType, [_intType])];
-    intElement.methods = <MethodElement> [
+    intElement.methods = <MethodElement>[
         ElementFactory.methodElement("&", _intType, [_intType]),
         ElementFactory.methodElement("|", _intType, [_intType]),
         ElementFactory.methodElement("^", _intType, [_intType]),
@@ -9922,26 +11486,33 @@
         ElementFactory.methodElement("ceil", _intType),
         ElementFactory.methodElement("truncate", _intType),
         ElementFactory.methodElement("toString", _stringType)];
-    ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(intElement, "fromEnvironment", true);
-    fromEnvironment.parameters = <ParameterElement> [
+    ConstructorElementImpl fromEnvironment =
+        ElementFactory.constructorElement(intElement, "fromEnvironment", true);
+    fromEnvironment.parameters = <ParameterElement>[
         ElementFactory.requiredParameter2("name", stringType),
         ElementFactory.namedParameter2("defaultValue", _intType)];
     fromEnvironment.factory = true;
-    intElement.constructors = <ConstructorElement> [fromEnvironment];
-    List<FieldElement> fields = <FieldElement> [
+    intElement.constructors = <ConstructorElement>[fromEnvironment];
+    List<FieldElement> fields = <FieldElement>[
         ElementFactory.fieldElement("NAN", true, false, true, _doubleType),
         ElementFactory.fieldElement("INFINITY", true, false, true, _doubleType),
-        ElementFactory.fieldElement("NEGATIVE_INFINITY", true, false, true, _doubleType),
+        ElementFactory.fieldElement(
+            "NEGATIVE_INFINITY",
+            true,
+            false,
+            true,
+            _doubleType),
         ElementFactory.fieldElement("MIN_POSITIVE", true, false, true, _doubleType),
         ElementFactory.fieldElement("MAX_FINITE", true, false, true, _doubleType)];
     doubleElement.fields = fields;
     int fieldCount = fields.length;
-    List<PropertyAccessorElement> accessors = new List<PropertyAccessorElement>(fieldCount);
+    List<PropertyAccessorElement> accessors =
+        new List<PropertyAccessorElement>(fieldCount);
     for (int i = 0; i < fieldCount; i++) {
       accessors[i] = fields[i].getter;
     }
     doubleElement.accessors = accessors;
-    doubleElement.methods = <MethodElement> [
+    doubleElement.methods = <MethodElement>[
         ElementFactory.methodElement("remainder", _doubleType, [_numType]),
         ElementFactory.methodElement("+", _doubleType, [_numType]),
         ElementFactory.methodElement("-", _doubleType, [_numType]),
@@ -9965,7 +11536,8 @@
    * @param classElement the element representing the class with type parameters
    */
   void _propagateTypeArguments(ClassElementImpl classElement) {
-    List<DartType> typeArguments = TypeParameterTypeImpl.getTypes(classElement.typeParameters);
+    List<DartType> typeArguments =
+        TypeParameterTypeImpl.getTypes(classElement.typeParameters);
     for (PropertyAccessorElement accessor in classElement.accessors) {
       FunctionTypeImpl functionType = accessor.type as FunctionTypeImpl;
       functionType.typeArguments = typeArguments;
@@ -10020,7 +11592,8 @@
 
   void test_getType_enclosedOverride() {
     TypeOverrideManager manager = new TypeOverrideManager();
-    LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
+    LocalVariableElementImpl element =
+        ElementFactory.localVariableElement2("v");
     InterfaceType type = ElementFactory.classElement2("C").type;
     manager.enterScope();
     manager.setType(element, type);
@@ -10030,7 +11603,8 @@
 
   void test_getType_immediateOverride() {
     TypeOverrideManager manager = new TypeOverrideManager();
-    LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
+    LocalVariableElementImpl element =
+        ElementFactory.localVariableElement2("v");
     InterfaceType type = ElementFactory.classElement2("C").type;
     manager.enterScope();
     manager.setType(element, type);
@@ -10049,7 +11623,6 @@
   }
 }
 
-
 class TypePropagationTest extends ResolverTestCase {
   void fail_mergePropagatedTypesAtJoinPoint_1() {
     // https://code.google.com/p/dart/issues/detail?id=19929
@@ -10117,7 +11690,8 @@
   void fail_mergePropagatedTypesAtJoinPoint_7() {
     // https://code.google.com/p/dart/issues/detail?id=19929
     //
-    // In general [continue]s are unsafe for the purposes of [isAbruptTerminationStatement].
+    // In general [continue]s are unsafe for the purposes of
+    // [isAbruptTerminationStatement].
     //
     // This is like example 6, but less tricky: the code in the branch that
     // [continue]s is in effect after the [if].
@@ -10145,7 +11719,8 @@
   void fail_mergePropagatedTypesAtJoinPoint_8() {
     // https://code.google.com/p/dart/issues/detail?id=19929
     //
-    // In nested loops [breaks]s are unsafe for the purposes of [isAbruptTerminationStatement].
+    // In nested loops [breaks]s are unsafe for the purposes of
+    // [isAbruptTerminationStatement].
     //
     // This is a combination of 6 and 7: we use an unlabeled [break]
     // like a continue for the outer loop / like a labeled [break] to
@@ -10179,7 +11754,10 @@
 main() {
   var v = (() {return 42;})();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_as() {
@@ -10201,9 +11779,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10222,7 +11802,8 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
@@ -10240,7 +11821,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[2] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeProvider.intType));
@@ -10258,7 +11840,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[2] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeProvider.doubleType));
@@ -10280,17 +11863,29 @@
       unit = resolveCompilationUnit(source, library);
     }
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "v; // declare", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "v; // declare",
+          (node) => node is SimpleIdentifier);
       expect(identifier.staticType, same(typeProvider.intType));
       expect(identifier.propagatedType, same(null));
     }
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "v = null;", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "v = null;",
+          (node) => node is SimpleIdentifier);
       expect(identifier.staticType, same(typeProvider.intType));
       expect(identifier.propagatedType, same(null));
     }
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "v; // return", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "v; // return",
+          (node) => node is SimpleIdentifier);
       expect(identifier.staticType, same(typeProvider.intType));
       expect(identifier.propagatedType, same(null));
     }
@@ -10307,7 +11902,11 @@
     assertNoErrors(source);
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
-    SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "context", (node) => node is SimpleIdentifier);
+    SimpleIdentifier identifier = EngineTestCase.findNode(
+        unit,
+        code,
+        "context",
+        (node) => node is SimpleIdentifier);
     expect(identifier.propagatedType.name, "CanvasRenderingContext2D");
   }
 
@@ -10321,7 +11920,10 @@
 f(A a) {
   return a.v; // marker
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_finalPropertyInducingVariable_classMember_instance_inherited() {
@@ -10336,10 +11938,14 @@
     return v; // marker
   }
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
-  void test_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
+  void
+      test_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
     addNamedSource("/lib.dart", r'''
 class A {
   final v = 0;
@@ -10351,7 +11957,10 @@
     return p.v; // marker
   }
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_finalPropertyInducingVariable_classMember_static() {
@@ -10364,7 +11973,10 @@
 f() {
   return A.V; // marker
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_finalPropertyInducingVariable_topLevelVaraible_prefixed() {
@@ -10374,7 +11986,10 @@
 f() {
   var v2 = p.V; // marker prefixed
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_finalPropertyInducingVariable_topLevelVaraible_simple() {
@@ -10384,7 +11999,10 @@
 f() {
   return V; // marker simple
 }''';
-    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_forEach() {
@@ -10403,12 +12021,17 @@
     InterfaceType stringType = typeProvider.stringType;
     // in the declaration
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "e in", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "e in",
+          (node) => node is SimpleIdentifier);
       expect(identifier.propagatedType, same(stringType));
     }
     // in the loop body
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "e;", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier =
+          EngineTestCase.findNode(unit, code, "e;", (node) => node is SimpleIdentifier);
       expect(identifier.propagatedType, same(stringType));
     }
   }
@@ -10431,16 +12054,26 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // k
     DartType intType = typeProvider.intType;
-    FormalParameter kParameter = EngineTestCase.findNode(unit, code, "k, ", (node) => node is SimpleFormalParameter);
+    FormalParameter kParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "k, ",
+        (node) => node is SimpleFormalParameter);
     expect(kParameter.identifier.propagatedType, same(intType));
-    SimpleIdentifier kIdentifier = EngineTestCase.findNode(unit, code, "k;", (node) => node is SimpleIdentifier);
+    SimpleIdentifier kIdentifier =
+        EngineTestCase.findNode(unit, code, "k;", (node) => node is SimpleIdentifier);
     expect(kIdentifier.propagatedType, same(intType));
     expect(kIdentifier.staticType, same(typeProvider.dynamicType));
     // v
     DartType stringType = typeProvider.stringType;
-    FormalParameter vParameter = EngineTestCase.findNode(unit, code, "v)", (node) => node is SimpleFormalParameter);
+    FormalParameter vParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "v)",
+        (node) => node is SimpleFormalParameter);
     expect(vParameter.identifier.propagatedType, same(stringType));
-    SimpleIdentifier vIdentifier = EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
+    SimpleIdentifier vIdentifier =
+        EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
     expect(vIdentifier.propagatedType, same(stringType));
     expect(vIdentifier.staticType, same(typeProvider.dynamicType));
   }
@@ -10461,15 +12094,24 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // k
     DartType intType = typeProvider.intType;
-    FormalParameter kParameter = EngineTestCase.findNode(unit, code, "k, ", (node) => node is SimpleFormalParameter);
+    FormalParameter kParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "k, ",
+        (node) => node is SimpleFormalParameter);
     expect(kParameter.identifier.propagatedType, same(intType));
     // v
     DartType stringType = typeProvider.stringType;
-    FormalParameter vParameter = EngineTestCase.findNode(unit, code, "v)", (node) => node is SimpleFormalParameter);
+    FormalParameter vParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "v)",
+        (node) => node is SimpleFormalParameter);
     expect(vParameter.identifier.propagatedType, same(stringType));
   }
 
-  void test_functionExpression_asInvocationArgument_functionExpressionInvocation() {
+  void
+      test_functionExpression_asInvocationArgument_functionExpressionInvocation() {
     String code = r'''
 main() {
   (f(String value)) {} ((v) {
@@ -10484,10 +12126,12 @@
     // v
     DartType dynamicType = typeProvider.dynamicType;
     DartType stringType = typeProvider.stringType;
-    FormalParameter vParameter = EngineTestCase.findNode(unit, code, "v)", (node) => node is FormalParameter);
+    FormalParameter vParameter =
+        EngineTestCase.findNode(unit, code, "v)", (node) => node is FormalParameter);
     expect(vParameter.identifier.propagatedType, same(stringType));
     expect(vParameter.identifier.staticType, same(dynamicType));
-    SimpleIdentifier vIdentifier = EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
+    SimpleIdentifier vIdentifier =
+        EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
     expect(vIdentifier.propagatedType, same(stringType));
     expect(vIdentifier.staticType, same(dynamicType));
   }
@@ -10509,10 +12153,15 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // v
     DartType intType = typeProvider.intType;
-    FormalParameter vParameter = EngineTestCase.findNode(unit, code, "v)", (node) => node is SimpleFormalParameter);
+    FormalParameter vParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "v)",
+        (node) => node is SimpleFormalParameter);
     expect(vParameter.identifier.propagatedType, same(null));
     expect(vParameter.identifier.staticType, same(intType));
-    SimpleIdentifier vIdentifier = EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
+    SimpleIdentifier vIdentifier =
+        EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
     expect(vIdentifier.staticType, same(intType));
     expect(vIdentifier.propagatedType, same(null));
   }
@@ -10532,8 +12181,14 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // () => 0
-    FunctionExpression functionExpression = EngineTestCase.findNode(unit, code, "() => 0)", (node) => node is FunctionExpression);
-    expect((functionExpression.staticType as FunctionType).parameters.length, same(0));
+    FunctionExpression functionExpression = EngineTestCase.findNode(
+        unit,
+        code,
+        "() => 0)",
+        (node) => node is FunctionExpression);
+    expect(
+        (functionExpression.staticType as FunctionType).parameters.length,
+        same(0));
     expect(functionExpression.propagatedType, same(null));
   }
 
@@ -10554,10 +12209,15 @@
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // v
     DartType stringType = typeProvider.stringType;
-    FormalParameter vParameter = EngineTestCase.findNode(unit, code, "v)", (node) => node is SimpleFormalParameter);
+    FormalParameter vParameter = EngineTestCase.findNode(
+        unit,
+        code,
+        "v)",
+        (node) => node is SimpleFormalParameter);
     expect(vParameter.identifier.propagatedType, same(stringType));
     expect(vParameter.identifier.staticType, same(typeProvider.objectType));
-    SimpleIdentifier vIdentifier = EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
+    SimpleIdentifier vIdentifier =
+        EngineTestCase.findNode(unit, code, "v;", (node) => node is SimpleIdentifier);
     expect(vIdentifier.propagatedType, same(stringType));
   }
 
@@ -10578,13 +12238,25 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     // p1
-    FormalParameter p1 = EngineTestCase.findNode(unit, code, "p1) {", (node) => node is SimpleFormalParameter);
+    FormalParameter p1 = EngineTestCase.findNode(
+        unit,
+        code,
+        "p1) {",
+        (node) => node is SimpleFormalParameter);
     expect(p1.identifier.propagatedType, same(typeProvider.intType));
     // p2
-    FormalParameter p2 = EngineTestCase.findNode(unit, code, "p2) {", (node) => node is SimpleFormalParameter);
+    FormalParameter p2 = EngineTestCase.findNode(
+        unit,
+        code,
+        "p2) {",
+        (node) => node is SimpleFormalParameter);
     expect(p2.identifier.propagatedType, same(typeProvider.doubleType));
     // p3
-    FormalParameter p3 = EngineTestCase.findNode(unit, code, "p3) {", (node) => node is SimpleFormalParameter);
+    FormalParameter p3 = EngineTestCase.findNode(
+        unit,
+        code,
+        "p3) {",
+        (node) => node is SimpleFormalParameter);
     expect(p3.identifier.propagatedType, same(typeProvider.stringType));
   }
 
@@ -10599,11 +12271,13 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     NodeList<Statement> statements = body.block.statements;
     // Type of 'v' in declaration.
     {
-      VariableDeclarationStatement statement = statements[0] as VariableDeclarationStatement;
+      VariableDeclarationStatement statement =
+          statements[0] as VariableDeclarationStatement;
       SimpleIdentifier variableName = statement.variables.variables[0].name;
       expect(variableName.staticType, same(typeProvider.dynamicType));
       expect(variableName.propagatedType, same(typeProvider.intType));
@@ -10625,8 +12299,10 @@
     LibraryElement library = resolve(source);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
-    ExpressionStatement statement = body.block.statements[1] as ExpressionStatement;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
+    ExpressionStatement statement =
+        body.block.statements[1] as ExpressionStatement;
     PrefixedIdentifier invocation = statement.expression as PrefixedIdentifier;
     SimpleIdentifier variableName = invocation.prefix;
     expect(variableName.propagatedType, same(typeProvider.stringType));
@@ -10647,12 +12323,20 @@
       unit = resolveCompilationUnit(source, library);
     }
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "v = null;", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "v = null;",
+          (node) => node is SimpleIdentifier);
       expect(identifier.staticType, same(typeProvider.intType));
       expect(identifier.propagatedType, same(null));
     }
     {
-      SimpleIdentifier identifier = EngineTestCase.findNode(unit, code, "v; // marker", (node) => node is SimpleIdentifier);
+      SimpleIdentifier identifier = EngineTestCase.findNode(
+          unit,
+          code,
+          "v; // marker",
+          (node) => node is SimpleIdentifier);
       expect(identifier.staticType, same(typeProvider.intType));
       expect(identifier.propagatedType, same(null));
     }
@@ -10671,10 +12355,13 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[0] as ReturnStatement;
-    ConditionalExpression conditional = statement.expression as ConditionalExpression;
-    SimpleIdentifier variableName = conditional.thenExpression as SimpleIdentifier;
+    ConditionalExpression conditional =
+        statement.expression as ConditionalExpression;
+    SimpleIdentifier variableName =
+        conditional.thenExpression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
 
@@ -10695,9 +12382,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10716,12 +12405,14 @@
     assertNoErrors(source);
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
-    //    ClassDeclaration classA = (ClassDeclaration) unit.getDeclarations().get(0);
-    //    InterfaceType typeA = classA.getElement().getType();
+//    ClassDeclaration classA = (ClassDeclaration) unit.getDeclarations().get(0);
+//    InterfaceType typeA = classA.getElement().getType();
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(null));
   }
@@ -10743,9 +12434,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10764,7 +12457,8 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
@@ -10788,7 +12482,8 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
@@ -10810,9 +12505,11 @@
     assertNoErrors(source);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[2] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.thenStatement as Block).statements[0] as ReturnStatement;
     MethodInvocation invocation = statement.expression as MethodInvocation;
     expect(invocation.methodName.propagatedElement, isNotNull);
   }
@@ -10833,9 +12530,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     WhileStatement whileStatement = body.block.statements[0] as WhileStatement;
-    ReturnStatement statement = (whileStatement.body as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (whileStatement.body as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10853,10 +12552,13 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[0] as ReturnStatement;
-    ConditionalExpression conditional = statement.expression as ConditionalExpression;
-    SimpleIdentifier variableName = conditional.elseExpression as SimpleIdentifier;
+    ConditionalExpression conditional =
+        statement.expression as ConditionalExpression;
+    SimpleIdentifier variableName =
+        conditional.elseExpression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
 
@@ -10877,9 +12579,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.elseStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.elseStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10900,9 +12604,11 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     IfStatement ifStatement = body.block.statements[0] as IfStatement;
-    ReturnStatement statement = (ifStatement.elseStatement as Block).statements[0] as ReturnStatement;
+    ReturnStatement statement =
+        (ifStatement.elseStatement as Block).statements[0] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
   }
@@ -10921,7 +12627,8 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
@@ -10943,7 +12650,8 @@
     ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
     InterfaceType typeA = classA.element.type;
     FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
     expect(variableName.propagatedType, same(typeA));
@@ -10975,8 +12683,10 @@
     // more precise type would cause no hint. For example, for code like the
     // following, when the propagated type of [x] is [A] -- as happens for the
     // fix these tests aim to warn against -- there is no warning for
-    // calling a method defined on [B] but not [A] (there aren't any, but pretend),
-    // but there is for calling a method not defined on either.
+
+
+    // calling a method defined on [B] but not [A] (there aren't any, but
+    // pretend), but there is for calling a method not defined on either.
     // By not overriding the propagated type via an is-check that loses
     // precision, we get more precise completion under an is-check. However,
     // I can only imagine strange code would make use of this feature.
@@ -11028,7 +12738,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     IndexExpression indexExpression = statement.expression as IndexExpression;
     expect(indexExpression.propagatedType, isNull);
@@ -11045,7 +12756,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     IndexExpression indexExpression = statement.expression as IndexExpression;
     expect(indexExpression.propagatedType, isNull);
@@ -11068,7 +12780,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier identifier = statement.expression as SimpleIdentifier;
     InterfaceType propagatedType = identifier.propagatedType as InterfaceType;
@@ -11090,7 +12803,8 @@
     verify([source]);
     CompilationUnit unit = resolveCompilationUnit(source, library);
     FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
-    BlockFunctionBody body = function.functionExpression.body as BlockFunctionBody;
+    BlockFunctionBody body =
+        function.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[1] as ReturnStatement;
     SimpleIdentifier identifier = statement.expression as SimpleIdentifier;
     InterfaceType propagatedType = identifier.propagatedType as InterfaceType;
@@ -11119,7 +12833,8 @@
   void test_mergePropagatedTypesAtJoinPoint_6() {
     // https://code.google.com/p/dart/issues/detail?id=19929
     //
-    // Labeled [break]s are unsafe for the purposes of [isAbruptTerminationStatement].
+    // Labeled [break]s are unsafe for the purposes of
+    // [isAbruptTerminationStatement].
     //
     // This is tricky: the [break] jumps back above the [if], making
     // it into a loop of sorts. The [if] type-propagation code assumes
@@ -11190,7 +12905,10 @@
 main() {
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.stringType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.stringType);
   }
 
   void test_propagatedReturnType_function_lessSpecificStaticReturnType() {
@@ -11199,7 +12917,10 @@
 main() {
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_propagatedReturnType_function_moreSpecificStaticReturnType() {
@@ -11208,10 +12929,14 @@
 main() {
   var v = f(3);
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
-  void test_propagatedReturnType_function_noReturnTypeName_blockBody_multipleReturns() {
+  void
+      test_propagatedReturnType_function_noReturnTypeName_blockBody_multipleReturns() {
     String code = r'''
 f() {
   if (true) return 0;
@@ -11220,10 +12945,14 @@
 main() {
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.numType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.numType);
   }
 
-  void test_propagatedReturnType_function_noReturnTypeName_blockBody_oneReturn() {
+  void
+      test_propagatedReturnType_function_noReturnTypeName_blockBody_oneReturn() {
     String code = r'''
 f() {
   var z = 42;
@@ -11232,7 +12961,10 @@
 main() {
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_propagatedReturnType_function_noReturnTypeName_expressionBody() {
@@ -11241,7 +12973,10 @@
 main() {
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_propagatedReturnType_localFunction() {
@@ -11250,7 +12985,10 @@
   f() => 42;
   var v = f();
 }''';
-    _assertPropagatedReturnType(code, typeProvider.dynamicType, typeProvider.intType);
+    _assertPropagatedReturnType(
+        code,
+        typeProvider.dynamicType,
+        typeProvider.intType);
   }
 
   void test_query() {
@@ -11280,7 +13018,8 @@
     FunctionDeclaration main = unit.declarations[0] as FunctionDeclaration;
     BlockFunctionBody body = main.functionExpression.body as BlockFunctionBody;
     ReturnStatement statement = body.block.statements[11] as ReturnStatement;
-    NodeList<Expression> elements = (statement.expression as ListLiteral).elements;
+    NodeList<Expression> elements =
+        (statement.expression as ListLiteral).elements;
     expect(elements[0].propagatedType.name, "AnchorElement");
     expect(elements[1].propagatedType.name, "AnchorElement");
     expect(elements[2].propagatedType.name, "BodyElement");
@@ -11298,7 +13037,8 @@
    * @param code the code that assigns the value to the variable "v", no matter how. We check that
    *          "v" has expected static and propagated type.
    */
-  void _assertPropagatedReturnType(String code, DartType expectedStaticType, DartType expectedPropagatedType) {
+  void _assertPropagatedReturnType(String code, DartType expectedStaticType,
+      DartType expectedPropagatedType) {
     SimpleIdentifier identifier = _findMarkedIdentifier(code, "v = ");
     expect(identifier.staticType, same(expectedStaticType));
     expect(identifier.propagatedType, same(expectedPropagatedType));
@@ -11312,7 +13052,8 @@
    * @param expectedPropagatedType if non-null, check actual static type is equal to this.
    * @throws Exception
    */
-  void _assertTypeOfMarkedExpression(String code, DartType expectedStaticType, DartType expectedPropagatedType) {
+  void _assertTypeOfMarkedExpression(String code, DartType expectedStaticType,
+      DartType expectedPropagatedType) {
     SimpleIdentifier identifier = _findMarkedIdentifier(code, "; // marker");
     if (expectedStaticType != null) {
       expect(identifier.staticType, expectedStaticType);
@@ -11338,24 +13079,32 @@
       assertNoErrors(source);
       verify([source]);
       CompilationUnit unit = resolveCompilationUnit(source, library);
-      // Could generalize this further by making [SimpleIdentifier.class] a parameter.
-      return EngineTestCase.findNode(unit, code, marker, (node) => node is SimpleIdentifier);
+      // Could generalize this further by making [SimpleIdentifier.class] a
+      // parameter.
+      return EngineTestCase.findNode(
+          unit,
+          code,
+          marker,
+          (node) => node is SimpleIdentifier);
     } catch (exception) {
-      // Is there a better exception to throw here? The point is that an assertion failure
-      // here should be a failure, in both "test_*" and "fail_*" tests.
-      // However, an assertion failure is success for the purpose of "fail_*" tests, so
-      // without catching them here "fail_*" tests can succeed by failing for the wrong reason.
+      // Is there a better exception to throw here? The point is that an
+      // assertion failure here should be a failure, in both "test_*" and
+      // "fail_*" tests. However, an assertion failure is success for the
+      // purpose of "fail_*" tests, so without catching them here "fail_*" tests
+      // can succeed by failing for the wrong reason.
       throw new JavaException("Unexexpected assertion failure: $exception");
     }
   }
 }
 
+
 class TypeProviderImplTest extends EngineTestCase {
   void test_creation() {
     //
-    // Create a mock library element with the types expected to be in dart:core. We cannot use
-    // either ElementFactory or TestTypeProvider (which uses ElementFactory) because we side-effect
-    // the elements in ways that would break other tests.
+    // Create a mock library element with the types expected to be in dart:core.
+    // We cannot use either ElementFactory or TestTypeProvider (which uses
+    // ElementFactory) because we side-effect the elements in ways that would
+    // break other tests.
     //
     InterfaceType objectType = _classElement("Object", null).type;
     InterfaceType boolType = _classElement("bool", objectType).type;
@@ -11369,8 +13118,9 @@
     InterfaceType stringType = _classElement("String", objectType).type;
     InterfaceType symbolType = _classElement("Symbol", objectType).type;
     InterfaceType typeType = _classElement("Type", objectType).type;
-    CompilationUnitElementImpl coreUnit = new CompilationUnitElementImpl("core.dart");
-    coreUnit.types = <ClassElement> [
+    CompilationUnitElementImpl coreUnit =
+        new CompilationUnitElementImpl("core.dart");
+    coreUnit.types = <ClassElement>[
         boolType.element,
         doubleType.element,
         functionType.element,
@@ -11382,7 +13132,9 @@
         stringType.element,
         symbolType.element,
         typeType.element];
-    LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(new AnalysisContextImpl(), AstFactory.libraryIdentifier2(["dart.core"]));
+    LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
+        new AnalysisContextImpl(),
+        AstFactory.libraryIdentifier2(["dart.core"]));
     coreLibrary.definingCompilationUnit = coreUnit;
     //
     // Create a type provider and ensure that it can return the expected types.
@@ -11403,18 +13155,23 @@
     expect(provider.typeType, same(typeType));
   }
 
-  ClassElement _classElement(String typeName, InterfaceType superclassType, [List<String> parameterNames]) {
-    ClassElementImpl element = new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
+  ClassElement _classElement(String typeName, InterfaceType superclassType,
+      [List<String> parameterNames]) {
+    ClassElementImpl element =
+        new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
     element.type = type;
     if (parameterNames != null) {
       int count = parameterNames.length;
       if (count > 0) {
-        List<TypeParameterElementImpl> typeParameters = new List<TypeParameterElementImpl>(count);
-        List<TypeParameterTypeImpl> typeArguments = new List<TypeParameterTypeImpl>(count);
+        List<TypeParameterElementImpl> typeParameters =
+            new List<TypeParameterElementImpl>(count);
+        List<TypeParameterTypeImpl> typeArguments =
+            new List<TypeParameterTypeImpl>(count);
         for (int i = 0; i < count; i++) {
-          TypeParameterElementImpl typeParameter = new TypeParameterElementImpl.forNode(AstFactory.identifier3(parameterNames[i]));
+          TypeParameterElementImpl typeParameter =
+              new TypeParameterElementImpl.forNode(AstFactory.identifier3(parameterNames[i]));
           typeParameters[i] = typeParameter;
           typeArguments[i] = new TypeParameterTypeImpl(typeParameter);
           typeParameter.type = typeArguments[i];
@@ -11495,21 +13252,28 @@
     SourceFactory factory = new SourceFactory([new FileUriResolver()]);
     AnalysisContextImpl context = new AnalysisContextImpl();
     context.sourceFactory = factory;
-    Source librarySource = new FileBasedSource.con1(FileUtilities2.createFile("/lib.dart"));
+    Source librarySource =
+        new FileBasedSource.con1(FileUtilities2.createFile("/lib.dart"));
     _library = new Library(context, _listener, librarySource);
-    LibraryElementImpl element = new LibraryElementImpl.forNode(context, AstFactory.libraryIdentifier2(["lib"]));
-    element.definingCompilationUnit = new CompilationUnitElementImpl("lib.dart");
+    LibraryElementImpl element = new LibraryElementImpl.forNode(
+        context,
+        AstFactory.libraryIdentifier2(["lib"]));
+    element.definingCompilationUnit =
+        new CompilationUnitElementImpl("lib.dart");
     _library.libraryElement = element;
     _typeProvider = new TestTypeProvider();
-    _visitor = new TypeResolverVisitor.con1(_library, librarySource, _typeProvider);
-    _implicitConstructorBuilder = new ImplicitConstructorBuilder.con1(_library, librarySource, _typeProvider);
+    _visitor =
+        new TypeResolverVisitor.con1(_library, librarySource, _typeProvider);
+    _implicitConstructorBuilder =
+        new ImplicitConstructorBuilder.con1(_library, librarySource, _typeProvider);
   }
 
   void test_visitCatchClause_exception() {
     // catch (e)
     CatchClause clause = AstFactory.catchClause("e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
-    exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
+    exceptionParameter.staticElement =
+        new LocalVariableElementImpl.forNode(exceptionParameter);
     _resolveCatchClause(clause, _typeProvider.dynamicType, null);
     _listener.assertNoErrors();
   }
@@ -11518,10 +13282,15 @@
     // catch (e, s)
     CatchClause clause = AstFactory.catchClause2("e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
-    exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
+    exceptionParameter.staticElement =
+        new LocalVariableElementImpl.forNode(exceptionParameter);
     SimpleIdentifier stackTraceParameter = clause.stackTraceParameter;
-    stackTraceParameter.staticElement = new LocalVariableElementImpl.forNode(stackTraceParameter);
-    _resolveCatchClause(clause, _typeProvider.dynamicType, _typeProvider.stackTraceType);
+    stackTraceParameter.staticElement =
+        new LocalVariableElementImpl.forNode(stackTraceParameter);
+    _resolveCatchClause(
+        clause,
+        _typeProvider.dynamicType,
+        _typeProvider.stackTraceType);
     _listener.assertNoErrors();
   }
 
@@ -11531,8 +13300,13 @@
     TypeName exceptionType = AstFactory.typeName(exceptionElement);
     CatchClause clause = AstFactory.catchClause4(exceptionType, "e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
-    exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
-    _resolveCatchClause(clause, exceptionElement.type, null, [exceptionElement]);
+    exceptionParameter.staticElement =
+        new LocalVariableElementImpl.forNode(exceptionParameter);
+    _resolveCatchClause(
+        clause,
+        exceptionElement.type,
+        null,
+        [exceptionElement]);
     _listener.assertNoErrors();
   }
 
@@ -11543,10 +13317,16 @@
     (exceptionType.name as SimpleIdentifier).staticElement = exceptionElement;
     CatchClause clause = AstFactory.catchClause5(exceptionType, "e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
-    exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
+    exceptionParameter.staticElement =
+        new LocalVariableElementImpl.forNode(exceptionParameter);
     SimpleIdentifier stackTraceParameter = clause.stackTraceParameter;
-    stackTraceParameter.staticElement = new LocalVariableElementImpl.forNode(stackTraceParameter);
-    _resolveCatchClause(clause, exceptionElement.type, _typeProvider.stackTraceType, [exceptionElement]);
+    stackTraceParameter.staticElement =
+        new LocalVariableElementImpl.forNode(stackTraceParameter);
+    _resolveCatchClause(
+        clause,
+        exceptionElement.type,
+        _typeProvider.stackTraceType,
+        [exceptionElement]);
     _listener.assertNoErrors();
   }
 
@@ -11559,10 +13339,19 @@
     ClassElement elementB = ElementFactory.classElement2("B");
     ClassElement elementC = ElementFactory.classElement2("C");
     ClassElement elementD = ElementFactory.classElement2("D");
-    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementB));
-    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC)]);
-    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD)]);
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "A", null, extendsClause, withClause, implementsClause);
+    ExtendsClause extendsClause =
+        AstFactory.extendsClause(AstFactory.typeName(elementB));
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(elementC)]);
+    ImplementsClause implementsClause =
+        AstFactory.implementsClause([AstFactory.typeName(elementD)]);
+    ClassDeclaration declaration = AstFactory.classDeclaration(
+        null,
+        "A",
+        null,
+        extendsClause,
+        withClause,
+        implementsClause);
     declaration.name.staticElement = elementA;
     _resolveNode(declaration, [elementA, elementB, elementC, elementD]);
     expect(elementA.supertype, same(elementB.type));
@@ -11582,9 +13371,12 @@
     // }
     ClassElementImpl elementA = ElementFactory.classElement2("A");
     ClassElementImpl elementB = ElementFactory.classElement2("B");
-    elementB.methods = <MethodElement> [ElementFactory.methodElement("A", VoidTypeImpl.instance)];
-    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementA));
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "B", null, extendsClause, null, null);
+    elementB.methods =
+        <MethodElement>[ElementFactory.methodElement("A", VoidTypeImpl.instance)];
+    ExtendsClause extendsClause =
+        AstFactory.extendsClause(AstFactory.typeName(elementA));
+    ClassDeclaration declaration =
+        AstFactory.classDeclaration(null, "B", null, extendsClause, null, null);
     declaration.name.staticElement = elementB;
     _resolveNode(declaration, [elementA, elementB]);
     expect(elementB.supertype, same(elementA.type));
@@ -11597,9 +13389,17 @@
     ClassElement elementB = ElementFactory.classElement2("B");
     ClassElement elementC = ElementFactory.classElement2("C");
     ClassElement elementD = ElementFactory.classElement2("D");
-    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC)]);
-    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD)]);
-    ClassTypeAlias alias = AstFactory.classTypeAlias("A", null, null, AstFactory.typeName(elementB), withClause, implementsClause);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(elementC)]);
+    ImplementsClause implementsClause =
+        AstFactory.implementsClause([AstFactory.typeName(elementD)]);
+    ClassTypeAlias alias = AstFactory.classTypeAlias(
+        "A",
+        null,
+        null,
+        AstFactory.typeName(elementB),
+        withClause,
+        implementsClause);
     alias.name.staticElement = elementA;
     _resolveNode(alias, [elementA, elementB, elementC, elementD]);
     expect(elementA.supertype, same(elementB.type));
@@ -11638,8 +13438,13 @@
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classElement2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
-        AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstFactory.classTypeAlias(
+        'C',
+        null,
+        null,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classT, classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -11669,8 +13474,13 @@
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classElement2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
-        AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstFactory.classTypeAlias(
+        'C',
+        null,
+        null,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classT, classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -11683,7 +13493,8 @@
     expect(constructor.localVariables, hasLength(0));
     expect(constructor.parameters, hasLength(1));
     expect(constructor.parameters[0].type, equals(classT.type));
-    expect(constructor.parameters[0].name,
+    expect(
+        constructor.parameters[0].name,
         equals(constructorB.parameters[0].name));
   }
 
@@ -11700,8 +13511,13 @@
     WithClause withClause =
         AstFactory.withClause([AstFactory.typeName(classM, [])]);
     ClassElement classC = ElementFactory.classElement2('C', []);
-    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
-        AstFactory.typeName(classB, []), withClause, null);
+    ClassTypeAlias alias = AstFactory.classTypeAlias(
+        'C',
+        null,
+        null,
+        AstFactory.typeName(classB, []),
+        withClause,
+        null);
     alias.name.staticElement = classC;
     _resolveNode(alias, [classB, classM, classC]);
     expect(classC.constructors, hasLength(1));
@@ -11719,13 +13535,23 @@
     InterfaceType intType = _typeProvider.intType;
     TypeName intTypeName = AstFactory.typeName4("int");
     String innerParameterName = "a";
-    SimpleFormalParameter parameter = AstFactory.simpleFormalParameter3(innerParameterName);
-    parameter.identifier.staticElement = ElementFactory.requiredParameter(innerParameterName);
+    SimpleFormalParameter parameter =
+        AstFactory.simpleFormalParameter3(innerParameterName);
+    parameter.identifier.staticElement =
+        ElementFactory.requiredParameter(innerParameterName);
     String outerParameterName = "p";
-    FormalParameter node = AstFactory.fieldFormalParameter(null, intTypeName, outerParameterName, AstFactory.formalParameterList([parameter]));
-    node.identifier.staticElement = ElementFactory.requiredParameter(outerParameterName);
+    FormalParameter node = AstFactory.fieldFormalParameter(
+        null,
+        intTypeName,
+        outerParameterName,
+        AstFactory.formalParameterList([parameter]));
+    node.identifier.staticElement =
+        ElementFactory.requiredParameter(outerParameterName);
     DartType parameterType = _resolveFormalParameter(node, [intType.element]);
-    EngineTestCase.assertInstanceOf((obj) => obj is FunctionType, FunctionType, parameterType);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is FunctionType,
+        FunctionType,
+        parameterType);
     FunctionType functionType = parameterType as FunctionType;
     expect(functionType.returnType, same(intType));
     expect(functionType.parameters, hasLength(1));
@@ -11734,8 +13560,10 @@
 
   void test_visitFieldFormalParameter_noType() {
     String parameterName = "p";
-    FormalParameter node = AstFactory.fieldFormalParameter(Keyword.VAR, null, parameterName);
-    node.identifier.staticElement = ElementFactory.requiredParameter(parameterName);
+    FormalParameter node =
+        AstFactory.fieldFormalParameter(Keyword.VAR, null, parameterName);
+    node.identifier.staticElement =
+        ElementFactory.requiredParameter(parameterName);
     expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
     _listener.assertNoErrors();
   }
@@ -11744,8 +13572,10 @@
     InterfaceType intType = _typeProvider.intType;
     TypeName intTypeName = AstFactory.typeName4("int");
     String parameterName = "p";
-    FormalParameter node = AstFactory.fieldFormalParameter(null, intTypeName, parameterName);
-    node.identifier.staticElement = ElementFactory.requiredParameter(parameterName);
+    FormalParameter node =
+        AstFactory.fieldFormalParameter(null, intTypeName, parameterName);
+    node.identifier.staticElement =
+        ElementFactory.requiredParameter(parameterName);
     expect(_resolveFormalParameter(node, [intType.element]), same(intType));
     _listener.assertNoErrors();
   }
@@ -11753,7 +13583,8 @@
   void test_visitSimpleFormalParameter_noType() {
     // p
     FormalParameter node = AstFactory.simpleFormalParameter3("p");
-    node.identifier.staticElement = new ParameterElementImpl.forNode(AstFactory.identifier3("p"));
+    node.identifier.staticElement =
+        new ParameterElementImpl.forNode(AstFactory.identifier3("p"));
     expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
     _listener.assertNoErrors();
   }
@@ -11762,7 +13593,8 @@
     // int p
     InterfaceType intType = _typeProvider.intType;
     ClassElement intElement = intType.element;
-    FormalParameter node = AstFactory.simpleFormalParameter4(AstFactory.typeName(intElement), "p");
+    FormalParameter node =
+        AstFactory.simpleFormalParameter4(AstFactory.typeName(intElement), "p");
     SimpleIdentifier identifier = node.identifier;
     ParameterElementImpl element = new ParameterElementImpl.forNode(identifier);
     identifier.staticElement = element;
@@ -11782,7 +13614,8 @@
   void test_visitTypeName_parameters_arguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
     ClassElement classB = ElementFactory.classElement2("B");
-    TypeName typeName = AstFactory.typeName(classA, [AstFactory.typeName(classB)]);
+    TypeName typeName =
+        AstFactory.typeName(classA, [AstFactory.typeName(classB)]);
     typeName.type = null;
     _resolveNode(typeName, [classA, classB]);
     InterfaceType resultType = typeName.type as InterfaceType;
@@ -11825,7 +13658,8 @@
    * @param definedElements the elements that are to be defined in the scope in which the element is
    *          being resolved
    */
-  void _resolveCatchClause(CatchClause node, DartType exceptionType, InterfaceType stackTraceType, [List<Element> definedElements]) {
+  void _resolveCatchClause(CatchClause node, DartType exceptionType,
+      InterfaceType stackTraceType, [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
@@ -11846,7 +13680,8 @@
    *          being resolved
    * @return the type associated with the parameter
    */
-  DartType _resolveFormalParameter(FormalParameter node, [List<Element> definedElements]) {
+  DartType _resolveFormalParameter(FormalParameter node,
+      [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     return (node.identifier.staticElement as ParameterElement).type;
   }
@@ -11871,35 +13706,69 @@
   }
 }
 
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(AnalysisDeltaTest);
-  runReflectiveTests(ChangeSetTest);
-  runReflectiveTests(EnclosedScopeTest);
-  runReflectiveTests(LibraryImportScopeTest);
-  runReflectiveTests(LibraryScopeTest);
-  runReflectiveTests(ScopeBuilderTest);
-  runReflectiveTests(ScopeTest);
-  runReflectiveTests(DeclarationMatcherTest);
-  runReflectiveTests(ElementResolverTest);
-  runReflectiveTests(IncrementalResolverTest);
-  runReflectiveTests(InheritanceManagerTest);
-  runReflectiveTests(LibraryElementBuilderTest);
-  runReflectiveTests(LibraryResolver2Test);
-  runReflectiveTests(LibraryResolverTest);
-  runReflectiveTests(LibraryTest);
-  runReflectiveTests(StaticTypeAnalyzerTest);
-  runReflectiveTests(StaticTypeAnalyzer2Test);
-  runReflectiveTests(SubtypeManagerTest);
-  runReflectiveTests(TypeOverrideManagerTest);
-  runReflectiveTests(TypeProviderImplTest);
-  runReflectiveTests(TypeResolverVisitorTest);
-  runReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
-  runReflectiveTests(ErrorResolverTest);
-  runReflectiveTests(HintCodeTest);
-  runReflectiveTests(MemberMapTest);
-  runReflectiveTests(NonHintCodeTest);
-  runReflectiveTests(SimpleResolverTest);
-  runReflectiveTests(StrictModeTest);
-  runReflectiveTests(TypePropagationTest);
+class _AnalysisContextFactory_initContextWithCore extends DirectoryBasedDartSdk
+    {
+
+  _AnalysisContextFactory_initContextWithCore(JavaFile arg0)
+      : super(arg0);
+
+  @override
+  LibraryMap initialLibraryMap(bool useDart2jsPaths) {
+    LibraryMap map = new LibraryMap();
+    _addLibrary(map, DartSdk.DART_ASYNC, false, "async.dart");
+    _addLibrary(map, DartSdk.DART_CORE, false, "core.dart");
+    _addLibrary(map, DartSdk.DART_HTML, false, "html_dartium.dart");
+    _addLibrary(map, AnalysisContextFactory._DART_MATH, false, "math.dart");
+    _addLibrary(
+        map,
+        AnalysisContextFactory._DART_INTERCEPTORS,
+        true,
+        "_interceptors.dart");
+    _addLibrary(
+        map,
+        AnalysisContextFactory._DART_JS_HELPER,
+        true,
+        "_js_helper.dart");
+    return map;
+  }
+
+  void _addLibrary(LibraryMap map, String uri, bool isInternal, String path) {
+    SdkLibraryImpl library = new SdkLibraryImpl(uri);
+    if (isInternal) {
+      library.category = "Internal";
+    }
+    library.path = path;
+    map.setLibrary(uri, library);
+  }
+}
+
+class _SimpleResolverTest_localVariable_types_invoked extends
+    RecursiveAstVisitor<Object> {
+  final SimpleResolverTest test;
+
+  List<bool> found;
+
+  List<CaughtException> thrownException;
+
+  _SimpleResolverTest_localVariable_types_invoked(this.test, this.found,
+      this.thrownException)
+      : super();
+
+  @override
+  Object visitSimpleIdentifier(SimpleIdentifier node) {
+    if (node.name == "myVar" && node.parent is MethodInvocation) {
+      try {
+        found[0] = true;
+        // check static type
+        DartType staticType = node.staticType;
+        expect(staticType, same(test.typeProvider.dynamicType));
+        // check propagated type
+        FunctionType propagatedType = node.propagatedType as FunctionType;
+        expect(propagatedType.returnType, test.typeProvider.stringType);
+      } on AnalysisException catch (e, stackTrace) {
+        thrownException[0] = new CaughtException(e, stackTrace);
+      }
+    }
+    return null;
+  }
 }
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index de61b98..6ae9341 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -2,19 +2,23 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.scanner_test;
 
-import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap;
+import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
-import 'test_support.dart';
-import '../reflective_tests.dart';
 
+import '../reflective_tests.dart';
+import 'test_support.dart';
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(CharSequenceReaderTest);
+  runReflectiveTests(KeywordStateTest);
+  runReflectiveTests(ScannerTest);
+  runReflectiveTests(TokenTypeTest);
+}
 
 class CharSequenceReaderTest {
   void test_advance() {
@@ -63,472 +67,59 @@
   }
 }
 
-class IncrementalScannerTest extends EngineTestCase {
-  /**
-   * The first token from the token stream resulting from parsing the original
-   * source, or `null` if [scan] has not been invoked.
-   */
-  Token _originalTokens;
-
-  /**
-   * The scanner used to perform incremental scanning, or `null` if [scan] has
-   * not been invoked.
-   */
-  IncrementalScanner _incrementalScanner;
-
-  /**
-   * The first token from the token stream resulting from performing an
-   * incremental scan, or `null` if [scan] has not been invoked.
-   */
-  Token _incrementalTokens;
-
-  void fail_insert_beginning() {
-    // This is currently reporting the changed range as being from 0 to 5, but
-    // that would force us to re-parse both classes, which is clearly sub-optimal.
-    //
-    // "class B {}"
-    // "class A {} class B {}"
-    _scan("", "", "class A {} ", "class B {}");
-    _assertTokens(-1, 4, ["class", "A", "{", "}", "class", "B", "{", "}"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+class CharacterRangeReaderTest extends EngineTestCase {
+  void test_advance() {
+    CharSequenceReader baseReader = new CharSequenceReader("xyzzy");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 1, 4);
+    expect(reader.advance(), 0x79);
+    expect(reader.advance(), 0x80);
+    expect(reader.advance(), 0x80);
+    expect(reader.advance(), -1);
+    expect(reader.advance(), -1);
   }
 
-  void test_delete_identifier_beginning() {
-    // "abs + b;"
-    // "s + b;")
-    _scan("", "ab", "", "s + b;");
-    _assertTokens(-1, 1, ["s", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  void test_creation() {
+    CharSequenceReader baseReader = new CharSequenceReader("xyzzy");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 1, 4);
+    expect(reader, isNotNull);
   }
 
-  void test_delete_identifier_end() {
-    // "abs + b;"
-    // "a + b;")
-    _scan("a", "bs", "", " + b;");
-    _assertTokens(-1, 1, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  void test_getOffset() {
+    CharSequenceReader baseReader = new CharSequenceReader("xyzzy");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 1, 2);
+    expect(reader.offset, 1);
+    reader.advance();
+    expect(reader.offset, 2);
+    reader.advance();
+    expect(reader.offset, 2);
   }
 
-  void test_delete_identifier_middle() {
-    // "abs + b;"
-    // "as + b;")
-    _scan("a", "b", "", "s + b;");
-    _assertTokens(-1, 1, ["as", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  void test_getString() {
+    CharSequenceReader baseReader = new CharSequenceReader("__xyzzy__");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 2, 7);
+    reader.offset = 5;
+    expect(reader.getString(3, 0), "yzz");
+    expect(reader.getString(4, 1), "zzy");
   }
 
-  void test_delete_mergeTokens() {
-    // "a + b + c;"
-    // "ac;")
-    _scan("a", " + b + ", "", "c;");
-    _assertTokens(-1, 1, ["ac", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
+  void test_peek() {
+    CharSequenceReader baseReader = new CharSequenceReader("xyzzy");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 1, 3);
+    expect(reader.peek(), 0x79);
+    expect(reader.peek(), 0x79);
+    reader.advance();
+    expect(reader.peek(), 0x80);
+    expect(reader.peek(), 0x80);
+    reader.advance();
+    expect(reader.peek(), -1);
+    expect(reader.peek(), -1);
   }
 
-  void test_delete_whitespace() {
-    // "a + b + c;"
-    // "a+ b + c;")
-    _scan("a", " ", "", "+ b + c;");
-    _assertTokens(1, 2, ["a", "+", "b", "+", "c", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_insert_afterIdentifier_firstToken() {
-    // "a + b;"
-    // "abs + b;"
-    _scan("a", "", "bs", " + b;");
-    _assertTokens(-1, 1, ["abs", "+", "b", ";"]);
-    _assertReplaced(1, "+");
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_afterIdentifier_lastToken() {
-    // "a + b"
-    // "a + bc")
-    _scan("a + b", "", "c", "");
-    _assertTokens(1, 3, ["a", "+", "bc"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_afterIdentifier_middleToken() {
-    // "a + b;"
-    // "a + by;"
-    _scan("a + b", "", "y", ";");
-    _assertTokens(1, 3, ["a", "+", "by", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_beforeIdentifier() {
-    // "a + b;"
-    // "a + xb;")
-    _scan("a + ", "", "x", "b;");
-    _assertTokens(1, 3, ["a", "+", "xb", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_beforeIdentifier_firstToken() {
-    // "a + b;"
-    // "xa + b;"
-    _scan("", "", "x", "a + b;");
-    _assertTokens(-1, 1, ["xa", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_convertOneFunctionToTwo() {
-    // "f() {}"
-    // "f() => 0; g() {}"
-    _scan("f()", "", " => 0; g()", " {}");
-    _assertTokens(2, 9, ["f", "(", ")", "=>", "0", ";", "g", "(", ")", "{", "}"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_convertOneFunctionToTwo_overlap() {
-    // "f() {}"
-    // "f() {} g() {}"
-    _scan("f() {", "", "} g() {", "}");
-    _assertTokens(4, 10, ["f", "(", ")", "{", "}", "g", "(", ")", "{", "}"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_end() {
-    // "class A {}"
-    // "class A {} class B {}"
-    _scan("class A {}", "", " class B {}", "");
-    _assertTokens(3, 8, ["class", "A", "{", "}", "class", "B", "{", "}"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_insideIdentifier() {
-    // "cob;"
-    // "cow.b;"
-    _scan("co", "", "w.", "b;");
-    _assertTokens(-1, 3, ["cow", ".", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_newIdentifier_noSpaceBefore() {
-    // "a; c;"
-    // "a;b c;"
-    _scan("a;", "", "b", " c;");
-    _assertTokens(1, 3, ["a", ";", "b", "c", ";"]);
-    _assertReplaced(1, ";");
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_newIdentifier_spaceBefore() {
-    // "a; c;"
-    // "a; b c;"
-    _scan("a; ", "", "b ", "c;");
-    _assertTokens(1, 3, ["a", ";", "b", "c", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_period() {
-    // "a + b;"
-    // "a + b.;"
-    _scan("a + b", "", ".", ";");
-    _assertTokens(2, 4, ["a", "+", "b", ".", ";"]);
-  }
-
-  void test_insert_period_betweenIdentifiers_left() {
-    // "a b;"
-    // "a. b;"
-    _scan("a", "", ".", " b;");
-    _assertTokens(0, 2, ["a", ".", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_period_betweenIdentifiers_middle() {
-    // "a  b;"
-    // "a . b;"
-    _scan("a ", "", ".", " b;");
-    _assertTokens(0, 2, ["a", ".", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_period_betweenIdentifiers_right() {
-    // "a b;"
-    // "a .b;"
-    _scan("a ", "", ".", "b;");
-    _assertTokens(0, 2, ["a", ".", "b", ";"]);
-  }
-
-  void test_insert_period_insideExistingIdentifier() {
-    // "ab;"
-    // "a.b;"
-    _scan("a", "", ".", "b;");
-    _assertTokens(-1, 3, ["a", ".", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_insert_periodAndIdentifier() {
-    // "a + b;"
-    // "a + b.x;"
-    _scan("a + b", "", ".x", ";");
-    _assertTokens(2, 5, ["a", "+", "b", ".", "x", ";"]);
-  }
-
-  void test_insert_whitespace_beginning_beforeToken() {
-    // "a + b;"
-    // " a + b;"
-    _scan("", "", " ", "a + b;");
-    _assertTokens(0, 1, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_insert_whitespace_betweenTokens() {
-    // "a + b;"
-    // "a  + b;"
-    _scan("a ", "", " ", "+ b;");
-    _assertTokens(1, 2, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_insert_whitespace_end_afterToken() {
-    // "a + b;"
-    // "a + b; "
-    _scan("a + b;", "", " ", "");
-    _assertTokens(3, 4, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_insert_whitespace_end_afterWhitespace() {
-    // "a + b; "
-    // "a + b;  "
-    _scan("a + b; ", "", " ", "");
-    _assertTokens(3, 4, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_insert_whitespace_withMultipleComments() {
-    // "//comment", "//comment2", "a + b;"
-    // "//comment", "//comment2", "a  + b;"
-    _scan(r'''
-//comment
-//comment2
-a''', "", " ", " + b;");
-    _assertTokens(1, 2, ["a", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  void test_replace_identifier_beginning() {
-    // "bell + b;"
-    // "fell + b;")
-    _scan("", "b", "f", "ell + b;");
-    _assertTokens(-1, 1, ["fell", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_replace_identifier_end() {
-    // "bell + b;"
-    // "belt + b;")
-    _scan("bel", "l", "t", " + b;");
-    _assertTokens(-1, 1, ["belt", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_replace_identifier_middle() {
-    // "first + b;"
-    // "frost + b;")
-    _scan("f", "ir", "ro", "st + b;");
-    _assertTokens(-1, 1, ["frost", "+", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_replace_multiple_partialFirstAndLast() {
-    // "aa + bb;"
-    // "ab * ab;")
-    _scan("a", "a + b", "b * a", "b;");
-    _assertTokens(-1, 3, ["ab", "*", "ab", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_replace_operator_oneForMany() {
-    // "a + b;"
-    // "a * c - b;")
-    _scan("a ", "+", "* c -", " b;");
-    _assertTokens(0, 4, ["a", "*", "c", "-", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_replace_operator_oneForOne() {
-    // "a + b;"
-    // "a * b;")
-    _scan("a ", "+", "*", " b;");
-    _assertTokens(0, 2, ["a", "*", "b", ";"]);
-    expect(_incrementalScanner.hasNonWhitespaceChange, isTrue);
-  }
-
-  void test_tokenMap() {
-    // "main() {a + b;}"
-    // "main() { a + b;}"
-    _scan("main() {", "", " ", "a + b;}");
-    TokenMap tokenMap = _incrementalScanner.tokenMap;
-    Token oldToken = _originalTokens;
-    while (oldToken.type != TokenType.EOF) {
-      Token newToken = tokenMap.get(oldToken);
-      expect(newToken, isNot(same(oldToken)));
-      expect(newToken.type, same(oldToken.type));
-      expect(newToken.lexeme, oldToken.lexeme);
-      oldToken = oldToken.next;
-    }
-    expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
-  }
-
-  /**
-   * Assert that the token at the given [offset] was replaced with a new token
-   * having the given [lexeme].
-   */
-  void _assertReplaced(int offset, String lexeme) {
-    Token oldToken = _originalTokens;
-    for (int i = 0; i < offset; i++) {
-      oldToken = oldToken.next;
-    }
-    expect(oldToken.lexeme, lexeme);
-    Token newToken = _incrementalScanner.tokenMap.get(oldToken);
-    expect(newToken, isNotNull);
-    expect(newToken.lexeme, lexeme);
-    expect(newToken, isNot(same(oldToken)));
-  }
-
-  /**
-   * Assert that the result of the incremental scan matches the given list of
-   * [lexemes] and that the left and right tokens correspond to the tokens at
-   * the [leftIndex] and [rightIndex].
-   */
-  void _assertTokens(int leftIndex, int rightIndex, List<String> lexemes) {
-    int count = lexemes.length;
-    expect(
-        leftIndex >= -1 && leftIndex < count,
-        isTrue,
-        reason: "Invalid left index");
-    expect(
-        rightIndex >= 0 && rightIndex <= count,
-        isTrue,
-        reason: "Invalid right index");
-    Token leftToken = null;
-    Token rightToken = null;
-    Token token = _incrementalTokens;
-    if (leftIndex < 0) {
-      leftToken = token.previous;
-    }
-    for (int i = 0; i < count; i++) {
-      expect(token.lexeme, lexemes[i]);
-      if (i == leftIndex) {
-        leftToken = token;
-      }
-      if (i == rightIndex) {
-        rightToken = token;
-      }
-      token = token.next;
-    }
-    if (rightIndex >= count) {
-      rightToken = token;
-    }
-    expect(token.type, same(TokenType.EOF), reason: "Too many tokens");
-    if (leftIndex >= 0) {
-      expect(leftToken, isNotNull);
-    }
-    expect(
-        _incrementalScanner.leftToken,
-        same(leftToken),
-        reason: "Invalid left token");
-    if (rightIndex >= 0) {
-      expect(rightToken, isNotNull);
-    }
-    expect(
-        _incrementalScanner.rightToken,
-        same(rightToken),
-        reason: "Invalid right token");
-  }
-
-  /**
-   * Given a description of the original and modified contents, perform an
-   * incremental scan of the two pieces of text. Verify that the incremental
-   * scan produced the same tokens as those that would be produced by a full
-   * scan of the new contents.
-   *
-   * The original content is the concatenation of the [prefix], [removed] and
-   * [suffix] fragments. The modeified content is the concatenation of the
-   * [prefix], [added] and [suffix] fragments.
-   */
-  void _scan(String prefix, String removed, String added, String suffix) {
-    //
-    // Compute the information needed to perform the test.
-    //
-    String originalContents = "$prefix$removed$suffix";
-    String modifiedContents = "$prefix$added$suffix";
-    int replaceStart = prefix.length;
-    Source source = new TestSource();
-    //
-    // Scan the original contents.
-    //
-    GatheringErrorListener originalListener = new GatheringErrorListener();
-    Scanner originalScanner = new Scanner(
-        source,
-        new CharSequenceReader(originalContents),
-        originalListener);
-    _originalTokens = originalScanner.tokenize();
-    expect(_originalTokens, isNotNull);
-    //
-    // Scan the modified contents.
-    //
-    GatheringErrorListener modifiedListener = new GatheringErrorListener();
-    Scanner modifiedScanner = new Scanner(
-        source,
-        new CharSequenceReader(modifiedContents),
-        modifiedListener);
-    Token modifiedTokens = modifiedScanner.tokenize();
-    expect(modifiedTokens, isNotNull);
-    //
-    // Incrementally scan the modified contents.
-    //
-    GatheringErrorListener incrementalListener = new GatheringErrorListener();
-    _incrementalScanner = new IncrementalScanner(
-        source,
-        new CharSequenceReader(modifiedContents),
-        incrementalListener);
-    _incrementalTokens = _incrementalScanner.rescan(
-        _originalTokens,
-        replaceStart,
-        removed.length,
-        added.length);
-    //
-    // Validate that the results of the incremental scan are the same as the
-    // full scan of the modified source.
-    //
-    Token incrementalToken = _incrementalTokens;
-    expect(incrementalToken, isNotNull);
-    while (incrementalToken.type != TokenType.EOF
-        && modifiedTokens.type != TokenType.EOF) {
-      expect(
-          incrementalToken.type,
-          same(modifiedTokens.type),
-          reason: "Wrong type for token");
-      expect(
-          incrementalToken.offset,
-              modifiedTokens.offset,
-              reason: "Wrong offset for token");
-      expect(
-          incrementalToken.length,
-              modifiedTokens.length,
-              reason: "Wrong length for token");
-      expect(
-          incrementalToken.lexeme,
-              modifiedTokens.lexeme,
-              reason: "Wrong lexeme for token");
-      incrementalToken = incrementalToken.next;
-      modifiedTokens = modifiedTokens.next;
-    }
-    expect(
-        incrementalToken.type,
-        same(TokenType.EOF),
-        reason: "Too many tokens");
-    expect(
-        modifiedTokens.type,
-        same(TokenType.EOF),
-        reason: "Not enough tokens");
-    // TODO(brianwilkerson) Verify that the errors are correct?
+  void test_setOffset() {
+    CharSequenceReader baseReader = new CharSequenceReader("xyzzy");
+    CharacterRangeReader reader = new CharacterRangeReader(baseReader, 1, 4);
+    reader.offset = 2;
+    expect(reader.offset, 2);
   }
 }
 
@@ -578,10 +169,14 @@
 class ScannerTest {
   void fail_incomplete_string_interpolation() {
     // https://code.google.com/p/dart/issues/detail?id=18073
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, "\"foo \${bar", [
-        new StringToken(TokenType.STRING, "\"foo ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5),
-        new StringToken(TokenType.IDENTIFIER, "bar", 7)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        9,
+        "\"foo \${bar",
+        [
+            new StringToken(TokenType.STRING, "\"foo ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5),
+            new StringToken(TokenType.IDENTIFIER, "bar", 7)]);
   }
 
   void test_ampersand() {
@@ -657,7 +252,10 @@
   }
 
   void test_comment_disabled_multi() {
-    Scanner scanner = new Scanner(null, new CharSequenceReader("/* comment */ "), AnalysisErrorListener.NULL_LISTENER);
+    Scanner scanner = new Scanner(
+        null,
+        new CharSequenceReader("/* comment */ "),
+        AnalysisErrorListener.NULL_LISTENER);
     scanner.preserveComments = false;
     Token token = scanner.tokenize();
     expect(token, isNotNull);
@@ -673,45 +271,47 @@
   }
 
   void test_comment_nested() {
-    _assertComment(TokenType.MULTI_LINE_COMMENT, "/* comment /* within a */ comment */");
+    _assertComment(
+        TokenType.MULTI_LINE_COMMENT,
+        "/* comment /* within a */ comment */");
   }
 
   void test_comment_single() {
     _assertComment(TokenType.SINGLE_LINE_COMMENT, "// comment");
   }
 
-  void test_double_both_e() {
-    _assertToken(TokenType.DOUBLE, "0.123e4");
-  }
-
   void test_double_both_E() {
     _assertToken(TokenType.DOUBLE, "0.123E4");
   }
 
+  void test_double_both_e() {
+    _assertToken(TokenType.DOUBLE, "0.123e4");
+  }
+
   void test_double_fraction() {
     _assertToken(TokenType.DOUBLE, ".123");
   }
 
-  void test_double_fraction_e() {
-    _assertToken(TokenType.DOUBLE, ".123e4");
-  }
-
   void test_double_fraction_E() {
     _assertToken(TokenType.DOUBLE, ".123E4");
   }
 
+  void test_double_fraction_e() {
+    _assertToken(TokenType.DOUBLE, ".123e4");
+  }
+
   void test_double_missingDigitInExponent() {
     _assertError(ScannerErrorCode.MISSING_DIGIT, 1, "1e");
   }
 
-  void test_double_whole_e() {
-    _assertToken(TokenType.DOUBLE, "12e4");
-  }
-
   void test_double_whole_E() {
     _assertToken(TokenType.DOUBLE, "12E4");
   }
 
+  void test_double_whole_e() {
+    _assertToken(TokenType.DOUBLE, "12e4");
+  }
+
   void test_eq() {
     _assertToken(TokenType.EQ, "=");
   }
@@ -978,33 +578,42 @@
 
   void test_lineInfo_multilineComment() {
     String source = "/*\r *\r */";
-    _assertLineInfo(source, [
-        new ScannerTest_ExpectedLocation(0, 1, 1),
-        new ScannerTest_ExpectedLocation(4, 2, 2),
-        new ScannerTest_ExpectedLocation(source.length - 1, 3, 3)]);
+    _assertLineInfo(
+        source,
+        [
+            new ScannerTest_ExpectedLocation(0, 1, 1),
+            new ScannerTest_ExpectedLocation(4, 2, 2),
+            new ScannerTest_ExpectedLocation(source.length - 1, 3, 3)]);
   }
 
   void test_lineInfo_multilineString() {
     String source = "'''a\r\nbc\r\nd'''";
-    _assertLineInfo(source, [
-        new ScannerTest_ExpectedLocation(0, 1, 1),
-        new ScannerTest_ExpectedLocation(7, 2, 2),
-        new ScannerTest_ExpectedLocation(source.length - 1, 3, 4)]);
+    _assertLineInfo(
+        source,
+        [
+            new ScannerTest_ExpectedLocation(0, 1, 1),
+            new ScannerTest_ExpectedLocation(7, 2, 2),
+            new ScannerTest_ExpectedLocation(source.length - 1, 3, 4)]);
   }
 
   void test_lineInfo_simpleClass() {
-    String source = "class Test {\r\n    String s = '...';\r\n    int get x => s.MISSING_GETTER;\r\n}";
-    _assertLineInfo(source, [
-        new ScannerTest_ExpectedLocation(0, 1, 1),
-        new ScannerTest_ExpectedLocation(source.indexOf("MISSING_GETTER"), 3, 20),
-        new ScannerTest_ExpectedLocation(source.length - 1, 4, 1)]);
+    String source =
+        "class Test {\r\n    String s = '...';\r\n    int get x => s.MISSING_GETTER;\r\n}";
+    _assertLineInfo(
+        source,
+        [
+            new ScannerTest_ExpectedLocation(0, 1, 1),
+            new ScannerTest_ExpectedLocation(source.indexOf("MISSING_GETTER"), 3, 20),
+            new ScannerTest_ExpectedLocation(source.length - 1, 4, 1)]);
   }
 
   void test_lineInfo_slashN() {
     String source = "class Test {\n}";
-    _assertLineInfo(source, [
-        new ScannerTest_ExpectedLocation(0, 1, 1),
-        new ScannerTest_ExpectedLocation(source.indexOf("}"), 2, 1)]);
+    _assertLineInfo(
+        source,
+        [
+            new ScannerTest_ExpectedLocation(0, 1, 1),
+            new ScannerTest_ExpectedLocation(source.indexOf("}"), 2, 1)]);
   }
 
   void test_lt() {
@@ -1035,6 +644,10 @@
     _assertToken(TokenType.MINUS_MINUS, "--");
   }
 
+  void test_openSquareBracket() {
+    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
+  }
+
   void test_open_curly_bracket() {
     _assertToken(TokenType.OPEN_CURLY_BRACKET, "{");
   }
@@ -1047,10 +660,6 @@
     _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
   }
 
-  void test_openSquareBracket() {
-    _assertToken(TokenType.OPEN_SQUARE_BRACKET, "[");
-  }
-
   void test_percent() {
     _assertToken(TokenType.PERCENT, "%");
   }
@@ -1063,6 +672,28 @@
     _assertToken(TokenType.PERIOD, ".");
   }
 
+  void test_periodAfterNumberNotIncluded_identifier() {
+    _assertTokens(
+        "42.isEven()",
+        [
+            new StringToken(TokenType.INT, "42", 0),
+            new Token(TokenType.PERIOD, 2),
+            new StringToken(TokenType.IDENTIFIER, "isEven", 3),
+            new Token(TokenType.OPEN_PAREN, 9),
+            new Token(TokenType.CLOSE_PAREN, 10)]);
+  }
+
+  void test_periodAfterNumberNotIncluded_period() {
+    _assertTokens(
+        "42..isEven()",
+        [
+            new StringToken(TokenType.INT, "42", 0),
+            new Token(TokenType.PERIOD_PERIOD, 2),
+            new StringToken(TokenType.IDENTIFIER, "isEven", 4),
+            new Token(TokenType.OPEN_PAREN, 10),
+            new Token(TokenType.CLOSE_PAREN, 11)]);
+  }
+
   void test_period_period() {
     _assertToken(TokenType.PERIOD_PERIOD, "..");
   }
@@ -1071,24 +702,6 @@
     _assertToken(TokenType.PERIOD_PERIOD_PERIOD, "...");
   }
 
-  void test_periodAfterNumberNotIncluded_identifier() {
-    _assertTokens("42.isEven()", [
-        new StringToken(TokenType.INT, "42", 0),
-        new Token(TokenType.PERIOD, 2),
-        new StringToken(TokenType.IDENTIFIER, "isEven", 3),
-        new Token(TokenType.OPEN_PAREN, 9),
-        new Token(TokenType.CLOSE_PAREN, 10)]);
-  }
-
-  void test_periodAfterNumberNotIncluded_period() {
-    _assertTokens("42..isEven()", [
-        new StringToken(TokenType.INT, "42", 0),
-        new Token(TokenType.PERIOD_PERIOD, 2),
-        new StringToken(TokenType.IDENTIFIER, "isEven", 4),
-        new Token(TokenType.OPEN_PAREN, 10),
-        new Token(TokenType.CLOSE_PAREN, 11)]);
-  }
-
   void test_plus() {
     _assertToken(TokenType.PLUS, "+");
   }
@@ -1109,14 +722,14 @@
     _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart -debug");
   }
 
-  void test_scriptTag_withoutSpace() {
-    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart");
-  }
-
   void test_scriptTag_withSpace() {
     _assertToken(TokenType.SCRIPT_TAG, "#! /bin/dart");
   }
 
+  void test_scriptTag_withoutSpace() {
+    _assertToken(TokenType.SCRIPT_TAG, "#!/bin/dart");
+  }
+
   void test_semicolon() {
     _assertToken(TokenType.SEMICOLON, ";");
   }
@@ -1124,7 +737,8 @@
   void test_setSourceStart() {
     int offsetDelta = 42;
     GatheringErrorListener listener = new GatheringErrorListener();
-    Scanner scanner = new Scanner(null, new SubSequenceReader("a", offsetDelta), listener);
+    Scanner scanner =
+        new Scanner(null, new SubSequenceReader("a", offsetDelta), listener);
     scanner.setSourceStart(3, 9);
     scanner.tokenize();
     List<int> lineStarts = scanner.lineStarts;
@@ -1172,20 +786,24 @@
   }
 
   void test_string_multi_interpolation_block() {
-    _assertTokens("\"Hello \${name}!\"", [
-        new StringToken(TokenType.STRING, "\"Hello ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
-        new StringToken(TokenType.IDENTIFIER, "name", 9),
-        new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
-        new StringToken(TokenType.STRING, "!\"", 14)]);
+    _assertTokens(
+        "\"Hello \${name}!\"",
+        [
+            new StringToken(TokenType.STRING, "\"Hello ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
+            new StringToken(TokenType.IDENTIFIER, "name", 9),
+            new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
+            new StringToken(TokenType.STRING, "!\"", 14)]);
   }
 
   void test_string_multi_interpolation_identifier() {
-    _assertTokens("\"Hello \$name!\"", [
-        new StringToken(TokenType.STRING, "\"Hello ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
-        new StringToken(TokenType.IDENTIFIER, "name", 8),
-        new StringToken(TokenType.STRING, "!\"", 12)]);
+    _assertTokens(
+        "\"Hello \$name!\"",
+        [
+            new StringToken(TokenType.STRING, "\"Hello ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
+            new StringToken(TokenType.IDENTIFIER, "name", 8),
+            new StringToken(TokenType.STRING, "!\"", 12)]);
   }
 
   void test_string_multi_single() {
@@ -1197,23 +815,35 @@
   }
 
   void test_string_multi_unterminated() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, "'''string", [new StringToken(TokenType.STRING, "'''string", 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        8,
+        "'''string",
+        [new StringToken(TokenType.STRING, "'''string", 0)]);
   }
 
   void test_string_multi_unterminated_interpolation_block() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, "'''\${name", [
-        new StringToken(TokenType.STRING, "'''", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
-        new StringToken(TokenType.IDENTIFIER, "name", 5),
-        new StringToken(TokenType.STRING, "", 9)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        8,
+        "'''\${name",
+        [
+            new StringToken(TokenType.STRING, "'''", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
+            new StringToken(TokenType.IDENTIFIER, "name", 5),
+            new StringToken(TokenType.STRING, "", 9)]);
   }
 
   void test_string_multi_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, "'''\$name", [
-        new StringToken(TokenType.STRING, "'''", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-        new StringToken(TokenType.IDENTIFIER, "name", 4),
-        new StringToken(TokenType.STRING, "", 8)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        7,
+        "'''\$name",
+        [
+            new StringToken(TokenType.STRING, "'''", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+            new StringToken(TokenType.IDENTIFIER, "name", 4),
+            new StringToken(TokenType.STRING, "", 8)]);
   }
 
   void test_string_raw_multi_double() {
@@ -1226,7 +856,11 @@
 
   void test_string_raw_multi_unterminated() {
     String source = "r'''string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, source, [new StringToken(TokenType.STRING, source, 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        9,
+        source,
+        [new StringToken(TokenType.STRING, source, 0)]);
   }
 
   void test_string_raw_simple_double() {
@@ -1239,12 +873,20 @@
 
   void test_string_raw_simple_unterminated_eof() {
     String source = "r'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, source, [new StringToken(TokenType.STRING, source, 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        7,
+        source,
+        [new StringToken(TokenType.STRING, source, 0)]);
   }
 
   void test_string_raw_simple_unterminated_eol() {
     String source = "r'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, "$source\n", [new StringToken(TokenType.STRING, source, 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        8,
+        "$source\n",
+        [new StringToken(TokenType.STRING, source, 0)]);
   }
 
   void test_string_simple_double() {
@@ -1256,75 +898,89 @@
   }
 
   void test_string_simple_interpolation_adjacentIdentifiers() {
-    _assertTokens("'\$a\$b'", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-        new StringToken(TokenType.IDENTIFIER, "a", 2),
-        new StringToken(TokenType.STRING, "", 3),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-        new StringToken(TokenType.IDENTIFIER, "b", 4),
-        new StringToken(TokenType.STRING, "'", 5)]);
+    _assertTokens(
+        "'\$a\$b'",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+            new StringToken(TokenType.IDENTIFIER, "a", 2),
+            new StringToken(TokenType.STRING, "", 3),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+            new StringToken(TokenType.IDENTIFIER, "b", 4),
+            new StringToken(TokenType.STRING, "'", 5)]);
   }
 
   void test_string_simple_interpolation_block() {
-    _assertTokens("'Hello \${name}!'", [
-        new StringToken(TokenType.STRING, "'Hello ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
-        new StringToken(TokenType.IDENTIFIER, "name", 9),
-        new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
-        new StringToken(TokenType.STRING, "!'", 14)]);
+    _assertTokens(
+        "'Hello \${name}!'",
+        [
+            new StringToken(TokenType.STRING, "'Hello ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7),
+            new StringToken(TokenType.IDENTIFIER, "name", 9),
+            new Token(TokenType.CLOSE_CURLY_BRACKET, 13),
+            new StringToken(TokenType.STRING, "!'", 14)]);
   }
 
   void test_string_simple_interpolation_blockWithNestedMap() {
-    _assertTokens("'a \${f({'b' : 'c'})} d'", [
-        new StringToken(TokenType.STRING, "'a ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
-        new StringToken(TokenType.IDENTIFIER, "f", 5),
-        new Token(TokenType.OPEN_PAREN, 6),
-        new Token(TokenType.OPEN_CURLY_BRACKET, 7),
-        new StringToken(TokenType.STRING, "'b'", 8),
-        new Token(TokenType.COLON, 12),
-        new StringToken(TokenType.STRING, "'c'", 14),
-        new Token(TokenType.CLOSE_CURLY_BRACKET, 17),
-        new Token(TokenType.CLOSE_PAREN, 18),
-        new Token(TokenType.CLOSE_CURLY_BRACKET, 19),
-        new StringToken(TokenType.STRING, " d'", 20)]);
+    _assertTokens(
+        "'a \${f({'b' : 'c'})} d'",
+        [
+            new StringToken(TokenType.STRING, "'a ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3),
+            new StringToken(TokenType.IDENTIFIER, "f", 5),
+            new Token(TokenType.OPEN_PAREN, 6),
+            new Token(TokenType.OPEN_CURLY_BRACKET, 7),
+            new StringToken(TokenType.STRING, "'b'", 8),
+            new Token(TokenType.COLON, 12),
+            new StringToken(TokenType.STRING, "'c'", 14),
+            new Token(TokenType.CLOSE_CURLY_BRACKET, 17),
+            new Token(TokenType.CLOSE_PAREN, 18),
+            new Token(TokenType.CLOSE_CURLY_BRACKET, 19),
+            new StringToken(TokenType.STRING, " d'", 20)]);
   }
 
   void test_string_simple_interpolation_firstAndLast() {
-    _assertTokens("'\$greeting \$name'", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-        new StringToken(TokenType.IDENTIFIER, "greeting", 2),
-        new StringToken(TokenType.STRING, " ", 10),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11),
-        new StringToken(TokenType.IDENTIFIER, "name", 12),
-        new StringToken(TokenType.STRING, "'", 16)]);
+    _assertTokens(
+        "'\$greeting \$name'",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+            new StringToken(TokenType.IDENTIFIER, "greeting", 2),
+            new StringToken(TokenType.STRING, " ", 10),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11),
+            new StringToken(TokenType.IDENTIFIER, "name", 12),
+            new StringToken(TokenType.STRING, "'", 16)]);
   }
 
   void test_string_simple_interpolation_identifier() {
-    _assertTokens("'Hello \$name!'", [
-        new StringToken(TokenType.STRING, "'Hello ", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
-        new StringToken(TokenType.IDENTIFIER, "name", 8),
-        new StringToken(TokenType.STRING, "!'", 12)]);
+    _assertTokens(
+        "'Hello \$name!'",
+        [
+            new StringToken(TokenType.STRING, "'Hello ", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7),
+            new StringToken(TokenType.IDENTIFIER, "name", 8),
+            new StringToken(TokenType.STRING, "!'", 12)]);
   }
 
   void test_string_simple_interpolation_missingIdentifier() {
-    _assertTokens("'\$x\$'", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-        new StringToken(TokenType.IDENTIFIER, "x", 2),
-        new StringToken(TokenType.STRING, "", 3),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
-        new StringToken(TokenType.STRING, "'", 4)]);
+    _assertTokens(
+        "'\$x\$'",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+            new StringToken(TokenType.IDENTIFIER, "x", 2),
+            new StringToken(TokenType.STRING, "", 3),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3),
+            new StringToken(TokenType.STRING, "'", 4)]);
   }
 
   void test_string_simple_interpolation_nonIdentifier() {
-    _assertTokens("'\$1'", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-        new StringToken(TokenType.STRING, "1'", 2)]);
+    _assertTokens(
+        "'\$1'",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+            new StringToken(TokenType.STRING, "1'", 2)]);
   }
 
   void test_string_simple_single() {
@@ -1333,28 +989,44 @@
 
   void test_string_simple_unterminated_eof() {
     String source = "'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, source, [new StringToken(TokenType.STRING, source, 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        6,
+        source,
+        [new StringToken(TokenType.STRING, source, 0)]);
   }
 
   void test_string_simple_unterminated_eol() {
     String source = "'string";
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, "$source\r", [new StringToken(TokenType.STRING, source, 0)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        7,
+        "$source\r",
+        [new StringToken(TokenType.STRING, source, 0)]);
   }
 
   void test_string_simple_unterminated_interpolation_block() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, "'\${name", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1),
-        new StringToken(TokenType.IDENTIFIER, "name", 3),
-        new StringToken(TokenType.STRING, "", 7)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        6,
+        "'\${name",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1),
+            new StringToken(TokenType.IDENTIFIER, "name", 3),
+            new StringToken(TokenType.STRING, "", 7)]);
   }
 
   void test_string_simple_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5, "'\$name", [
-        new StringToken(TokenType.STRING, "'", 0),
-        new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
-        new StringToken(TokenType.IDENTIFIER, "name", 2),
-        new StringToken(TokenType.STRING, "", 6)]);
+    _assertErrorAndTokens(
+        ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
+        5,
+        "'\$name",
+        [
+            new StringToken(TokenType.STRING, "'", 0),
+            new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1),
+            new StringToken(TokenType.IDENTIFIER, "name", 2),
+            new StringToken(TokenType.STRING, "", 6)]);
   }
 
   void test_tilde() {
@@ -1402,39 +1074,54 @@
   }
 
   /**
-   * Assert that scanning the given source produces an error with the given code.
+   * Assert that scanning the given [source] produces an error with the given
+   * code.
    *
-   * @param expectedError the error that should be produced
-   * @param expectedOffset the string offset that should be associated with the error
-   * @param source the source to be scanned to produce the error
+   * [expectedError] the error that should be produced
+   * [expectedOffset] the string offset that should be associated with the error
+   * [source] the source to be scanned to produce the error
    */
-  void _assertError(ScannerErrorCode expectedError, int expectedOffset, String source) {
+  void _assertError(ScannerErrorCode expectedError, int expectedOffset,
+      String source) {
     GatheringErrorListener listener = new GatheringErrorListener();
     _scanWithListener(source, listener);
-    listener.assertErrors([new AnalysisError.con2(null, expectedOffset, 1, expectedError, [source.codeUnitAt(expectedOffset)])]);
+    listener.assertErrors(
+        [
+            new AnalysisError.con2(
+                null,
+                expectedOffset,
+                1,
+                expectedError,
+                [source.codeUnitAt(expectedOffset)])]);
   }
 
   /**
-   * Assert that scanning the given source produces an error with the given code, and also produces
-   * the given tokens.
+   * Assert that scanning the given [source] produces an error with the given
+   * code, and also produces the given tokens.
    *
-   * @param expectedError the error that should be produced
-   * @param expectedOffset the string offset that should be associated with the error
-   * @param source the source to be scanned to produce the error
-   * @param expectedTokens the tokens that are expected to be in the source
+   * [expectedError] the error that should be produced
+   * [expectedOffset] the string offset that should be associated with the error
+   * [source] the source to be scanned to produce the error
+   * [expectedTokens] the tokens that are expected to be in the source
    */
-  void _assertErrorAndTokens(ScannerErrorCode expectedError, int expectedOffset, String source, List<Token> expectedTokens) {
+  void _assertErrorAndTokens(ScannerErrorCode expectedError, int expectedOffset,
+      String source, List<Token> expectedTokens) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Token token = _scanWithListener(source, listener);
-    listener.assertErrors([new AnalysisError.con2(null, expectedOffset, 1, expectedError, [source.codeUnitAt(expectedOffset)])]);
+    listener.assertErrors(
+        [
+            new AnalysisError.con2(
+                null,
+                expectedOffset,
+                1,
+                expectedError,
+                [source.codeUnitAt(expectedOffset)])]);
     _checkTokens(token, expectedTokens);
   }
 
   /**
-   * Assert that when scanned the given source contains a single keyword token with the same lexeme
-   * as the original source.
-   *
-   * @param source the source to be scanned
+   * Assert that when scanned the given [source] contains a single keyword token
+   * with the same lexeme as the original source.
    */
   void _assertKeywordToken(String source) {
     Token token = _scan(source);
@@ -1458,7 +1145,8 @@
     expect(token.next.type, TokenType.EOF);
   }
 
-  void _assertLineInfo(String source, List<ScannerTest_ExpectedLocation> expectedLocations) {
+  void _assertLineInfo(String source,
+      List<ScannerTest_ExpectedLocation> expectedLocations) {
     GatheringErrorListener listener = new GatheringErrorListener();
     _scanWithListener(source, listener);
     listener.assertNoErrors();
@@ -1472,10 +1160,8 @@
   }
 
   /**
-   * Assert that the token scanned from the given source has the expected type.
-   *
-   * @param expectedType the expected type of the token
-   * @param source the source to be scanned to produce the actual token
+   * Assert that the token scanned from the given [source] has the
+   * [expectedType].
    */
   Token _assertToken(TokenType expectedType, String source) {
     Token originalToken = _scan(source);
@@ -1485,7 +1171,8 @@
     expect(originalToken.length, source.length);
     expect(originalToken.lexeme, source);
     if (expectedType == TokenType.SCRIPT_TAG) {
-      // Adding space before the script tag is not allowed, and adding text at the end changes nothing.
+      // Adding space before the script tag is not allowed, and adding text at
+      // the end changes nothing.
       return originalToken;
     } else if (expectedType == TokenType.SINGLE_LINE_COMMENT) {
       // Adding space to an end-of-line comment changes the comment.
@@ -1496,7 +1183,8 @@
       expect(tokenWithSpaces.length, source.length);
       expect(tokenWithSpaces.lexeme, source);
       return originalToken;
-    } else if (expectedType == TokenType.INT || expectedType == TokenType.DOUBLE) {
+    } else if (expectedType == TokenType.INT ||
+        expectedType == TokenType.DOUBLE) {
       Token tokenWithLowerD = _scan("${source}d");
       expect(tokenWithLowerD, isNotNull);
       expect(tokenWithLowerD.type, expectedType);
@@ -1521,11 +1209,8 @@
   }
 
   /**
-   * Assert that when scanned the given source contains a sequence of tokens identical to the given
-   * tokens.
-   *
-   * @param source the source to be scanned
-   * @param expectedTokens the tokens that are expected to be in the source
+   * Assert that when scanned the given [source] contains a sequence of tokens
+   * identical to the given list of [expectedTokens].
    */
   void _assertTokens(String source, List<Token> expectedTokens) {
     Token token = _scan(source);
@@ -1538,9 +1223,18 @@
     for (int i = 0; i < expectedTokens.length; i++) {
       Token expectedToken = expectedTokens[i];
       expect(token.type, expectedToken.type, reason: "Wrong type for token $i");
-      expect(token.offset, expectedToken.offset, reason: "Wrong offset for token $i");
-      expect(token.length, expectedToken.length, reason: "Wrong length for token $i");
-      expect(token.lexeme, expectedToken.lexeme, reason: "Wrong lexeme for token $i");
+      expect(
+          token.offset,
+          expectedToken.offset,
+          reason: "Wrong offset for token $i");
+      expect(
+          token.length,
+          expectedToken.length,
+          reason: "Wrong length for token $i");
+      expect(
+          token.lexeme,
+          expectedToken.lexeme,
+          reason: "Wrong lexeme for token $i");
       token = token.next;
       expect(token, isNotNull);
     }
@@ -1555,7 +1249,8 @@
   }
 
   Token _scanWithListener(String source, GatheringErrorListener listener) {
-    Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
+    Scanner scanner =
+        new Scanner(null, new CharSequenceReader(source), listener);
     Token result = scanner.tokenize();
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
     return result;
@@ -1563,8 +1258,8 @@
 }
 
 /**
- * Instances of the class `ExpectedLocation` encode information about the expected location
- * of a given offset in source code.
+ * An `ExpectedLocation` encodes information about the expected location of a
+ * given offset in source code.
  */
 class ScannerTest_ExpectedLocation {
   final int _offset;
@@ -1573,18 +1268,18 @@
 
   final int _columnNumber;
 
-  ScannerTest_ExpectedLocation(this._offset, this._lineNumber, this._columnNumber);
+  ScannerTest_ExpectedLocation(this._offset, this._lineNumber,
+      this._columnNumber);
 }
 
 /**
- * Instances of the class `TokenStreamValidator` are used to validate the correct construction
- * of a stream of tokens.
+ * A `TokenStreamValidator` is used to validate the correct construction of a
+ * stream of tokens.
  */
 class TokenStreamValidator {
   /**
-   * Validate that the stream of tokens that starts with the given token is correct.
-   *
-   * @param token the first token in the stream of tokens to be validated
+   * Validate that the stream of tokens that starts with the given [token] is
+   * correct.
    */
   void validate(Token token) {
     StringBuffer buffer = new StringBuffer();
@@ -1604,7 +1299,10 @@
     while (currentToken != null && currentToken.type != TokenType.EOF) {
       _validateStream(buffer, currentToken.precedingComments);
       TokenType type = currentToken.type;
-      if (type == TokenType.OPEN_CURLY_BRACKET || type == TokenType.OPEN_PAREN || type == TokenType.OPEN_SQUARE_BRACKET || type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
+      if (type == TokenType.OPEN_CURLY_BRACKET ||
+          type == TokenType.OPEN_PAREN ||
+          type == TokenType.OPEN_SQUARE_BRACKET ||
+          type == TokenType.STRING_INTERPOLATION_EXPRESSION) {
         if (currentToken is! BeginToken) {
           buffer.write("\r\nExpected BeginToken, found ");
           buffer.write(currentToken.runtimeType.toString());
@@ -1706,12 +1404,3 @@
     expect(TokenType.TILDE_SLASH.isUserDefinableOperator, isTrue);
   }
 }
-
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(CharSequenceReaderTest);
-  runReflectiveTests(IncrementalScannerTest);
-  runReflectiveTests(KeywordStateTest);
-  runReflectiveTests(ScannerTest);
-  runReflectiveTests(TokenTypeTest);
-}
\ No newline at end of file
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 02c588b..815a8f4 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -4,12 +4,18 @@
 
 library engine.static_type_warning_code_test;
 
-import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/source_io.dart';
 import 'package:unittest/unittest.dart';
-import 'resolver_test.dart';
-import '../reflective_tests.dart';
 
+import '../reflective_tests.dart';
+import 'resolver_test.dart';
+
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(StaticTypeWarningCodeTest);
+}
 
 class StaticTypeWarningCodeTest extends ResolverTestCase {
   void fail_inaccessibleSetter() {
@@ -53,7 +59,9 @@
   <int, int> [];
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -63,7 +71,9 @@
   <int> {};
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -73,7 +83,9 @@
   <int, int, int> {};
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -88,7 +100,9 @@
 class C implements A, B {
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
     verify([source]);
   }
 
@@ -102,7 +116,9 @@
 }
 abstract class C implements A, B {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
     verify([source]);
   }
 
@@ -116,7 +132,9 @@
 }
 abstract class C implements A, B {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
     verify([source]);
   }
 
@@ -129,7 +147,9 @@
   a.m();
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -142,7 +162,9 @@
   a.m;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -155,7 +177,9 @@
   a.f;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -168,7 +192,9 @@
   a.f;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -181,7 +207,9 @@
   a.f = 42;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -382,7 +410,9 @@
   3(5);
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION]);
     verify([source]);
   }
 
@@ -632,7 +662,9 @@
 class G<E extends A> {}
 class D = G<B> with C;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -643,7 +675,9 @@
 class G<E extends A> {}
 class C extends G<B>{}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -653,7 +687,9 @@
 class X<T extends Type> {}
 class Y<U> extends X<U> {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -667,7 +703,9 @@
   C(G<B> this.f) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -678,7 +716,9 @@
 class G<E extends A> {}
 G<B> f() { return null; }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -689,7 +729,9 @@
 class G<E extends A> {}
 typedef G<B> f();''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -700,7 +742,9 @@
 class G<E extends A> {}
 f(G<B> h()) {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -711,7 +755,9 @@
 class G<E extends A> {}
 class C implements G<B>{}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -722,7 +768,9 @@
 class G<E extends A> {}
 var b = 1 is G<B>;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -735,7 +783,9 @@
   G<B> m() { return null; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -746,7 +796,9 @@
 class G<E extends A> {}
 f() { return new G<B>(); }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -758,7 +810,9 @@
 class G<E extends B> {}
 f() { return new G<A>(); }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -769,7 +823,9 @@
 class G<E extends A> {}
 f(G<B> g) {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -782,9 +838,11 @@
   factory X.name(int x, int y) = X<B>;
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-        StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [
+            StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+            StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -796,7 +854,9 @@
 class D<E extends A> {}
 C<D<B>> Var;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -808,7 +868,9 @@
 class G<E extends A> {}
 class D<F extends G<B>> {}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -819,7 +881,9 @@
 class G<E extends A> {}
 G<B> g;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -830,7 +894,9 @@
 class G<E extends A> {}
 class C extends Object with G<B>{}''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
     verify([source]);
   }
 
@@ -839,11 +905,14 @@
 class A<T extends T> {
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]);
     verify([source]);
   }
 
-  void test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() {
+  void
+      test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() {
     Source source = addSource(r'''
 callMe(f()) { f(); }
 main(Object p) {
@@ -872,7 +941,8 @@
     assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
   }
 
-  void test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() {
+  void
+      test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() {
     Source source = addSource(r'''
 callMe(f()) { f(); }
 main(Object p) {
@@ -883,7 +953,8 @@
     assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
   }
 
-  void test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() {
+  void
+      test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() {
     Source source = addSource(r'''
 callMe(f()) { f(); }
 main(Object p) {
@@ -1160,7 +1231,9 @@
   a.element.anyGetterExistsInDynamic;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1173,7 +1246,9 @@
   a.element.anyGetterExistsInDynamic;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1348,6 +1423,18 @@
     assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
   }
 
+  void test_undefinedSuperGetter() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  get g {
+    return super.g;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_GETTER]);
+  }
+
   void test_undefinedSuperMethod() {
     Source source = addSource(r'''
 class A {}
@@ -1358,6 +1445,66 @@
     assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_METHOD]);
   }
 
+  void test_undefinedSuperOperator_binaryExpression() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator +(value) {
+    return super + value;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+  }
+
+  void test_undefinedSuperOperator_indexBoth() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator [](index) {
+    return super[index]++;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+  }
+
+  void test_undefinedSuperOperator_indexGetter() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator [](index) {
+    return super[index + 1];
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+  }
+
+  void test_undefinedSuperOperator_indexSetter() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator []=(index, value) {
+    return super[index] = 0;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR]);
+  }
+
+  void test_undefinedSuperSetter() {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  f() {
+    super.m = 0;
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_SETTER]);
+  }
+
   void test_unqualifiedReferenceToNonLocalStaticMember_getter() {
     Source source = addSource(r'''
 class A {
@@ -1369,7 +1516,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -1384,7 +1533,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -1399,7 +1550,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
     verify([source]);
   }
 
@@ -1409,7 +1562,9 @@
 class M {}
 class B<F extends num> = A<F> with M;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1418,7 +1573,9 @@
 class A<E, F> {}
 A<A> a = null;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1427,7 +1584,9 @@
 class A<E> {}
 A<A, A> a = null;''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1439,7 +1598,9 @@
   return p is C<A>;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 
@@ -1451,12 +1612,9 @@
   return p is C<A, A>;
 }''');
     resolve(source);
-    assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+    assertErrors(
+        source,
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
     verify([source]);
   }
 }
-
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(StaticTypeWarningCodeTest);
-}
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 127654a..769cebb 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -4,13 +4,19 @@
 
 library engine.static_warning_code_test;
 
-import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
+import 'package:analyzer/src/generated/source_io.dart';
 import 'package:unittest/unittest.dart';
-import 'resolver_test.dart';
-import '../reflective_tests.dart';
 
+import '../reflective_tests.dart';
+import 'resolver_test.dart';
+
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(StaticWarningCodeTest);
+}
 
 class StaticWarningCodeTest extends ResolverTestCase {
   void fail_undefinedGetter() {
@@ -27,9 +33,11 @@
 class A {
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.UNDEFINED_IDENTIFIER,
-        StaticWarningCode.UNDEFINED_IDENTIFIER]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.UNDEFINED_IDENTIFIER,
+            StaticWarningCode.UNDEFINED_IDENTIFIER]);
   }
 
   void fail_undefinedSetter() {
@@ -70,9 +78,9 @@
 library lib2;
 class N {}''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        CompileTimeErrorCode.EXTENDS_NON_CLASS]);
+    assertErrors(
+        source,
+        [StaticWarningCode.AMBIGUOUS_IMPORT, CompileTimeErrorCode.EXTENDS_NON_CLASS]);
   }
 
   void test_ambiguousImport_implements() {
@@ -87,9 +95,11 @@
 library lib2;
 class N {}''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
   }
 
   void test_ambiguousImport_inPart() {
@@ -108,9 +118,9 @@
 part of lib;
 class A extends N {}''');
     resolve(source);
-    assertErrors(partSource, [
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        CompileTimeErrorCode.EXTENDS_NON_CLASS]);
+    assertErrors(
+        partSource,
+        [StaticWarningCode.AMBIGUOUS_IMPORT, CompileTimeErrorCode.EXTENDS_NON_CLASS]);
   }
 
   void test_ambiguousImport_instanceCreation() {
@@ -179,14 +189,16 @@
 library lib2;
 class N {}''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT,
-        StaticWarningCode.AMBIGUOUS_IMPORT]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT,
+            StaticWarningCode.AMBIGUOUS_IMPORT]);
   }
 
   void test_ambiguousImport_typeArgument_annotation() {
@@ -284,9 +296,9 @@
 class _A {}
 g(h(_A a)) {}''');
     resolve(source);
-    // The name _A is private to the library it's defined in, so this is a type mismatch.
-    // Furthermore, the error message should mention both _A and the filenames
-    // so the user can figure out what's going on.
+    // The name _A is private to the library it's defined in, so this is a type
+    // mismatch. Furthermore, the error message should mention both _A and the
+    // filenames so the user can figure out what's going on.
     List<AnalysisError> errors = analysisContext2.computeErrors(source);
     expect(errors, hasLength(1));
     AnalysisError error = errors[0];
@@ -364,9 +376,11 @@
   const A(42);
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+            CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
     verify([source]);
   }
 
@@ -844,7 +858,9 @@
   m();
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]);
     verify([source]);
   }
 
@@ -861,7 +877,8 @@
     assertErrors(source, [StaticWarningCode.CONFLICTING_DART_IMPORT]);
   }
 
-  void test_conflictingInstanceGetterAndSuperclassMember_declField_direct_setter() {
+  void
+      test_conflictingInstanceGetterAndSuperclassMember_declField_direct_setter() {
     Source source = addSource(r'''
 class A {
   static set v(x) {}
@@ -870,11 +887,14 @@
   var v;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
-  void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_getter() {
+  void
+      test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_getter() {
     Source source = addSource(r'''
 class A {
   static get v => 0;
@@ -883,11 +903,14 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
-  void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_method() {
+  void
+      test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_method() {
     Source source = addSource(r'''
 class A {
   static v() {}
@@ -896,11 +919,14 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
-  void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_setter() {
+  void
+      test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_setter() {
     Source source = addSource(r'''
 class A {
   static set v(x) {}
@@ -909,7 +935,9 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
@@ -923,7 +951,9 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
@@ -936,7 +966,9 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
@@ -949,7 +981,22 @@
   get v => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER]);
+    verify([source]);
+  }
+
+  void test_conflictingInstanceMethodSetter2() {
+    Source source = addSource(r'''
+class A {
+  foo() {}
+  set foo(a) {}
+}''');
+    resolve(source);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2]);
     verify([source]);
   }
 
@@ -960,7 +1007,9 @@
   foo() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
     verify([source]);
   }
 
@@ -973,7 +1022,9 @@
   foo() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
     verify([source]);
   }
 
@@ -986,18 +1037,9 @@
   foo() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
-    verify([source]);
-  }
-
-  void test_conflictingInstanceMethodSetter2() {
-    Source source = addSource(r'''
-class A {
-  foo() {}
-  set foo(a) {}
-}''');
-    resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER]);
     verify([source]);
   }
 
@@ -1010,7 +1052,9 @@
   set v(x) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER]);
     verify([source]);
   }
 
@@ -1023,7 +1067,9 @@
   static get x => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
     verify([source]);
   }
 
@@ -1036,7 +1082,9 @@
   static get x => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
     verify([source]);
   }
 
@@ -1047,7 +1095,9 @@
   set x(int p) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER]);
     verify([source]);
   }
 
@@ -1058,7 +1108,9 @@
   static set x(int p) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER]);
     verify([source]);
   }
 
@@ -1069,7 +1121,9 @@
   static set x(int p) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER]);
+    assertErrors(
+        source,
+        [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER]);
     verify([source]);
   }
 
@@ -1105,7 +1159,8 @@
   }
 
   void test_equalKeysInMap_withUnequalTypeParams() {
-    // No error should be produced because A<int> and A<num> are different types.
+    // No error should be produced because A<int> and A<num> are different
+    // types.
     Source source = addSource(r'''
 class A<T> {
   const A();
@@ -1168,7 +1223,9 @@
   A() : x = 1 {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
+    assertErrors(
+        source,
+        [StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
     verify([source]);
   }
 
@@ -1190,7 +1247,9 @@
   A(String this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE]);
     verify([source]);
   }
 
@@ -1210,7 +1269,9 @@
   A() : x = 0 {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
+    assertErrors(
+        source,
+        [StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION]);
     verify([source]);
   }
 
@@ -1221,7 +1282,9 @@
   A(this.x) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR]);
+    assertErrors(
+        source,
+        [StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR]);
     verify([source]);
   }
 
@@ -1312,10 +1375,12 @@
     addNamedSource("/lib1.dart", "library lib;");
     addNamedSource("/lib2.dart", "library lib;");
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
-        HintCode.UNUSED_IMPORT,
-        HintCode.UNUSED_IMPORT]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
+            HintCode.UNUSED_IMPORT,
+            HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
@@ -1327,24 +1392,26 @@
     addNamedSource("/lib1.dart", "");
     addNamedSource("/lib2.dart", "");
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
-        HintCode.UNUSED_IMPORT,
-        HintCode.UNUSED_IMPORT]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
+            HintCode.UNUSED_IMPORT,
+            HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
   void test_importOfNonLibrary() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 part of lib;
-class A {}''',
-        r'''
+class A {}''', r'''
 library lib;
 import 'lib1.dart' deferred as p;
-var a = new p.A();'''], <ErrorCode> [
-        CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
-        ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
+var a = new p.A();'''],
+          <ErrorCode>[
+              CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
+              ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
   }
 
   void test_inconsistentMethodInheritanceGetterAndMethod() {
@@ -1358,7 +1425,9 @@
 class C implements A, B {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
     verify([source]);
   }
 
@@ -1371,7 +1440,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1386,7 +1457,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1399,7 +1472,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1414,7 +1489,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1431,8 +1508,9 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1445,7 +1523,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1460,7 +1540,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1473,7 +1555,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1488,7 +1572,9 @@
   void n() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
     verify([source]);
   }
 
@@ -1501,7 +1587,9 @@
   String get g { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1514,9 +1602,11 @@
   int f;
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
-        StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [
+            StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
+            StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1534,7 +1624,9 @@
   String get getter => null;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1550,7 +1642,9 @@
   double get g => null;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1563,7 +1657,9 @@
   m({String a}) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1576,7 +1672,9 @@
   m(String a) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1589,7 +1687,9 @@
   m(String a) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1605,7 +1705,9 @@
   m(double d) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1622,7 +1724,9 @@
   m(String n) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1639,7 +1743,9 @@
   m(double d) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1652,7 +1758,9 @@
   m([String a]) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1669,7 +1777,9 @@
   m([String n]) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -1682,7 +1792,9 @@
   String m() { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1697,7 +1809,9 @@
   String m() { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1710,7 +1824,9 @@
   String m() { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1723,7 +1839,9 @@
   String m() { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1738,7 +1856,9 @@
   String m() { return 'a'; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1755,7 +1875,9 @@
   String m() => '';
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1768,7 +1890,9 @@
   void m() {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
     verify([source]);
   }
 
@@ -1785,8 +1909,9 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
     verify([source]);
   }
 
@@ -1803,8 +1928,9 @@
 }
 ''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
     verify([source]);
   }
 
@@ -1887,7 +2013,9 @@
   m({int p : 1}) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
     verify([source]);
   }
 
@@ -1900,7 +2028,9 @@
   m([int p = 1]) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
     verify([source]);
   }
 
@@ -1991,7 +2121,9 @@
   void set s(String v) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -2008,7 +2140,9 @@
   set setter14(String _) => null;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -2026,7 +2160,9 @@
   set setter14(String _) => null;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -2042,7 +2178,9 @@
   set s(double d) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]);
     verify([source]);
   }
 
@@ -2074,7 +2212,9 @@
   set g(String v) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
     verify([source]);
   }
 
@@ -2087,7 +2227,9 @@
   set g(String v) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE]);
     verify([source]);
   }
 
@@ -2100,7 +2242,9 @@
   String get g { return ''; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE]);
     verify([source]);
   }
 
@@ -2109,7 +2253,9 @@
 int get g { return 0; }
 set g(String v) {}''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
     verify([source]);
   }
 
@@ -2126,9 +2272,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.MIXED_RETURN_TYPES,
-        StaticWarningCode.MIXED_RETURN_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MIXED_RETURN_TYPES, StaticWarningCode.MIXED_RETURN_TYPES]);
     verify([source]);
   }
 
@@ -2143,9 +2289,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.MIXED_RETURN_TYPES,
-        StaticWarningCode.MIXED_RETURN_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MIXED_RETURN_TYPES, StaticWarningCode.MIXED_RETURN_TYPES]);
     verify([source]);
   }
 
@@ -2158,9 +2304,9 @@
   return 0;
 }''');
     resolve(source);
-    assertErrors(source, [
-        StaticWarningCode.MIXED_RETURN_TYPES,
-        StaticWarningCode.MIXED_RETURN_TYPES]);
+    assertErrors(
+        source,
+        [StaticWarningCode.MIXED_RETURN_TYPES, StaticWarningCode.MIXED_RETURN_TYPES]);
     verify([source]);
   }
 
@@ -2255,7 +2401,9 @@
   new A();
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
     verify([source]);
   }
 
@@ -2271,7 +2419,9 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS]);
     verify([source]);
   }
 
@@ -2286,11 +2436,14 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() {
     // 15979
     Source source = addSource(r'''
 abstract class M {}
@@ -2300,7 +2453,9 @@
 }
 class B = A with M implements I;''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2313,11 +2468,14 @@
 abstract class A {}
 class B = A with M;''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() {
     // 15979
     Source source = addSource(r'''
 class M {}
@@ -2326,11 +2484,14 @@
 }
 class B = A with M;''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_ensureCorrectFunctionSubtypeIsUsedInImplementation() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_ensureCorrectFunctionSubtypeIsUsedInImplementation() {
     // 15028
     Source source = addSource(r'''
 class C {
@@ -2341,7 +2502,9 @@
 }
 class E extends C implements D {}''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2353,7 +2516,9 @@
 class C implements I {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2365,7 +2530,9 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2377,7 +2544,9 @@
 class C implements I {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2389,11 +2558,14 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_method_optionalParamCount() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_method_optionalParamCount() {
     // 7640
     Source source = addSource(r'''
 abstract class A {
@@ -2405,7 +2577,9 @@
 class C implements A, B {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2416,7 +2590,9 @@
 abstract class B implements A { get g1 => 1; }
 class C extends Object with B {}''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
   }
 
   void test_nonAbstractClassInheritsAbstractMemberOne_mixinInherits_method() {
@@ -2426,7 +2602,9 @@
 abstract class B implements A { m1() => 1; }
 class C extends Object with B {}''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
   }
 
   void test_nonAbstractClassInheritsAbstractMemberOne_mixinInherits_setter() {
@@ -2436,10 +2614,13 @@
 abstract class B implements A { set s1(v) {} }
 class C extends Object with B {}''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_setter_and_implicitSetter() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_setter_and_implicitSetter() {
     // test from language/override_inheritance_abstract_test_14.dart
     Source source = addSource(r'''
 abstract class A {
@@ -2452,7 +2633,9 @@
   get field => 0;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2464,7 +2647,9 @@
 class C implements I {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2476,7 +2661,9 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2492,11 +2679,14 @@
 class C extends B {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingGetter() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingGetter() {
     // 16133
     Source source = addSource(r'''
 class I {
@@ -2506,11 +2696,14 @@
   set v(_) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingSetter() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingSetter() {
     // 16133
     Source source = addSource(r'''
 class I {
@@ -2520,7 +2713,9 @@
   get v => 1;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
     verify([source]);
   }
 
@@ -2534,7 +2729,9 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE]);
     verify([source]);
   }
 
@@ -2547,11 +2744,14 @@
 class C extends A {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
     verify([source]);
   }
 
-  void test_nonAbstractClassInheritsAbstractMemberTwo_variable_fromInterface_missingBoth() {
+  void
+      test_nonAbstractClassInheritsAbstractMemberTwo_variable_fromInterface_missingBoth() {
     // 16133
     Source source = addSource(r'''
 class I {
@@ -2560,7 +2760,9 @@
 class C implements I {
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
+    assertErrors(
+        source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
     verify([source]);
   }
 
@@ -2768,8 +2970,8 @@
   }
 
   void test_returnWithoutValue_mixedReturnTypes_function() {
-    // Tests that only the RETURN_WITHOUT_VALUE warning is created, and no MIXED_RETURN_TYPES are
-    // created.
+    // Tests that only the RETURN_WITHOUT_VALUE warning is created, and no
+    // MIXED_RETURN_TYPES are created.
     Source source = addSource(r'''
 int f(int x) {
   if (x < 0) {
@@ -2860,152 +3062,153 @@
   }
 
   void test_typeAnnotationDeferredClass_asExpression() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f(var v) {
   v as a.A;
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_catchClause() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f(var v) {
   try {
   } on a.A {
   }
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_fieldFormalParameter() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class C {
   var v;
   C(a.A this.v);
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_functionDeclaration_returnType() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-a.A f() { return null; }'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+a.A f() { return null; }'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
-  void test_typeAnnotationDeferredClass_functionTypedFormalParameter_returnType() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+  void
+      test_typeAnnotationDeferredClass_functionTypedFormalParameter_returnType() {
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-f(a.A g()) {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+f(a.A g()) {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_isExpression() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 f(var v) {
   bool b = v is a.A;
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_methodDeclaration_returnType() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class C {
   a.A m() { return null; }
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_simpleFormalParameter() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-f(a.A v) {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+f(a.A v) {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_typeArgumentList() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class C<E> {}
-C<a.A> c;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+C<a.A> c;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_typeArgumentList2() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
 class C<E, F> {}
-C<a.A, a.A> c;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [
-        StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
-        StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+C<a.A, a.A> c;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[
+              StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
+              StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_typeParameter_bound() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-class C<E extends a.A> {}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+class C<E extends a.A> {}'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeAnnotationDeferredClass_variableDeclarationList() {
-    resolveWithAndWithoutExperimental(<String> [
-        r'''
+    resolveWithAndWithoutExperimental(<String>[r'''
 library lib1;
-class A {}''',
-        r'''
+class A {}''', r'''
 library root;
 import 'lib1.dart' deferred as a;
-a.A v;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+a.A v;'''],
+          <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED],
+          <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
   }
 
   void test_typeParameterReferencedByStatic_field() {
@@ -3014,7 +3217,9 @@
   static K k;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3024,7 +3229,9 @@
   static K get k => null;
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3036,7 +3243,9 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3046,7 +3255,9 @@
   static m(K k) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3056,7 +3267,9 @@
   static K m() { return null; }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3066,7 +3279,9 @@
   static set s(K k) {}
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
+    assertErrors(
+        source,
+        [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
     verify([source]);
   }
 
@@ -3093,7 +3308,18 @@
   }
 }''');
     resolve(source);
-    assertErrors(source, [StaticWarningCode.TYPE_TEST_NON_TYPE]);
+    assertErrors(source, [StaticWarningCode.TYPE_TEST_WITH_NON_TYPE]);
+    verify([source]);
+  }
+
+  void test_typeTestWithUndefinedName() {
+    Source source = addSource(r'''
+f(var p) {
+  if (p is A) {
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME]);
     verify([source]);
   }
 
@@ -3308,8 +3534,3 @@
     assertErrors(source, [StaticWarningCode.VOID_RETURN_FOR_GETTER]);
   }
 }
-
-main() {
-  groupSep = ' | ';
-  runReflectiveTests(StaticWarningCodeTest);
-}
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index a5690b6..5c33174 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -11,6 +11,8 @@
 import 'compile_time_error_code_test.dart' as compile_time_error_code_test;
 import 'element_test.dart' as element_test;
 import 'engine_test.dart' as engine_test;
+import 'incremental_resolver_test.dart' as incremental_resolver_test;
+import 'incremental_scanner_test.dart' as incremental_scanner_test;
 import 'java_core_test.dart' as java_core_test;
 import 'java_io_test.dart' as java_io_test;
 import 'non_error_resolver_test.dart' as non_error_resolver_test;
@@ -30,6 +32,8 @@
     compile_time_error_code_test.main();
     element_test.main();
     engine_test.main();
+    incremental_resolver_test.main();
+    incremental_scanner_test.main();
     java_core_test.main();
     java_io_test.main();
     non_error_resolver_test.main();
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 3a48b47..3344dfc 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -23,10 +23,6 @@
  * The class `EngineTestCase` defines utility methods for making assertions.
  */
 class EngineTestCase {
-  void setUp() {}
-
-  void tearDown() {}
-
   /**
    * Assert that the given collection has the same number of elements as the number of specified
    * names, and that for each specified name, a corresponding element can be found in the given
@@ -99,6 +95,10 @@
     return null;
   }
 
+  void setUp() {}
+
+  void tearDown() {}
+
   /**
    * Assert that the given object is an instance of the expected class.
    *
@@ -110,7 +110,8 @@
   static Object assertInstanceOf(Predicate<Object> predicate,
       Type expectedClass, Object object) {
     if (!predicate(object)) {
-      fail("Expected instance of $expectedClass, found ${object == null ? "null" : object.runtimeType}");
+      fail(
+          "Expected instance of $expectedClass, found ${object == null ? "null" : object.runtimeType}");
     }
     return object;
   }
@@ -140,17 +141,6 @@
   static List<AnalysisError> _NO_ERRORS = new List<AnalysisError>(0);
 
   /**
-   * The source being parsed.
-   */
-  final String _rawSource;
-
-  /**
-   * The source being parsed after inserting a marker at the beginning and end of the range of the
-   * most recent error.
-   */
-  String _markedSource;
-
-  /**
    * A list containing the errors that were collected.
    */
   List<AnalysisError> _errors = new List<AnalysisError>();
@@ -163,14 +153,7 @@
   /**
    * Initialize a newly created error listener to collect errors.
    */
-  GatheringErrorListener() : this.con1(null);
-
-  /**
-   * Initialize a newly created error listener to collect errors.
-   */
-  GatheringErrorListener.con1(this._rawSource) {
-    this._markedSource = _rawSource;
-  }
+  GatheringErrorListener();
 
   /**
    * Return the errors that were collected.
@@ -239,13 +222,17 @@
    * @throws AssertionFailedError if a different number of errors have been gathered than were
    *           expected
    */
-  void assertErrorsWithCodes([List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
+  void assertErrorsWithCodes([List<ErrorCode> expectedErrorCodes =
+      ErrorCode.EMPTY_LIST]) {
     StringBuffer buffer = new StringBuffer();
     //
     // Verify that the expected error codes have a non-empty message.
     //
     for (ErrorCode errorCode in expectedErrorCodes) {
-      expect(errorCode.message.isEmpty, isFalse, reason: "Empty error code message");
+      expect(
+          errorCode.message.isEmpty,
+          isFalse,
+          reason: "Empty error code message");
     }
     //
     // Compute the expected number of each type of error.
@@ -358,7 +345,8 @@
     }
     if (expectedErrorCount != actualErrorCount ||
         expectedWarningCount != actualWarningCount) {
-      fail("Expected $expectedErrorCount errors and $expectedWarningCount warnings, found $actualErrorCount errors and $actualWarningCount warnings");
+      fail(
+          "Expected $expectedErrorCount errors and $expectedWarningCount warnings, found $actualErrorCount errors and $actualWarningCount warnings");
     }
   }
 
@@ -397,12 +385,6 @@
 
   @override
   void onError(AnalysisError error) {
-    if (_rawSource != null) {
-      int left = error.offset;
-      int right = left + error.length - 1;
-      _markedSource =
-          "${_rawSource.substring(0, left)}^${_rawSource.substring(left, right)}^${_rawSource.substring(right)}";
-    }
     _errors.add(error);
   }
 
@@ -605,10 +587,6 @@
     }
     return new TimestampedData<String>(0, _contents);
   }
-  void setContents(String value) {
-    modificationStamp = new DateTime.now().millisecondsSinceEpoch;
-    _contents = value;
-  }
   String get encoding {
     throw new UnsupportedOperationException();
   }
@@ -644,4 +622,8 @@
   Uri resolveRelativeUri(Uri uri) {
     return new Uri(scheme: 'file', path: _name).resolveUri(uri);
   }
+  void setContents(String value) {
+    modificationStamp = new DateTime.now().millisecondsSinceEpoch;
+    _contents = value;
+  }
 }
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 1f509d5..2435eee 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -37,6 +37,30 @@
   runReflectiveTests(StringUtilitiesTest);
 }
 
+class AstCloneComparator extends AstComparator {
+  final bool expectTokensCopied;
+
+  AstCloneComparator(this.expectTokensCopied);
+
+  @override
+  bool isEqualNodes(AstNode first, AstNode second) {
+    if (first != null && identical(first, second)) {
+      fail('Failed to copy node: $first (${first.offset})');
+      return false;
+    }
+    return super.isEqualNodes(first, second);
+  }
+
+  @override
+  bool isEqualTokens(Token first, Token second) {
+    if (expectTokensCopied && first != null && identical(first, second)) {
+      fail('Failed to copy token: ${first.lexeme} (${first.offset})');
+      return false;
+    }
+    return super.isEqualTokens(first, second);
+  }
+}
+
 class AstClonerTest extends EngineTestCase {
   void test_visitAdjacentStrings() {
     _assertClone(
@@ -92,10 +116,6 @@
             AstFactory.identifier3("b")));
   }
 
-  void test_visitBlockFunctionBody() {
-    _assertClone(AstFactory.blockFunctionBody2());
-  }
-
   void test_visitBlock_empty() {
     _assertClone(AstFactory.block());
   }
@@ -105,6 +125,10 @@
         AstFactory.block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
   }
 
+  void test_visitBlockFunctionBody() {
+    _assertClone(AstFactory.blockFunctionBody2());
+  }
+
   void test_visitBooleanLiteral_false() {
     _assertClone(AstFactory.booleanLiteral(false));
   }
@@ -161,8 +185,7 @@
   }
 
   void test_visitCatchClause_on_catch() {
-    _assertClone(
-        AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
+    _assertClone(AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
   }
 
   void test_visitClassDeclaration_abstract() {
@@ -470,9 +493,10 @@
     _assertClone(
         AstFactory.compilationUnit4(
             [AstFactory.libraryDirective2("l")],
-            [AstFactory.topLevelVariableDeclaration2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("a")])]));
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_empty() {
@@ -505,9 +529,10 @@
         AstFactory.compilationUnit8(
             "!#/bin/dartvm",
             [AstFactory.libraryDirective2("l")],
-            [AstFactory.topLevelVariableDeclaration2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("a")])]));
+            [
+                AstFactory.topLevelVariableDeclaration2(
+                    Keyword.VAR,
+                    [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitConditionalExpression() {
@@ -559,11 +584,12 @@
             AstFactory.identifier3("C"),
             null,
             AstFactory.formalParameterList(),
-            [AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
-            AstFactory.constructorFieldInitializer(
-                false,
-                "c",
-                AstFactory.identifier3("d"))],
+            [
+                AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
+                AstFactory.constructorFieldInitializer(
+                    false,
+                    "c",
+                    AstFactory.identifier3("d"))],
             AstFactory.blockFunctionBody2()));
   }
 
@@ -574,9 +600,10 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([
-                AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-                AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
+            AstFactory.formalParameterList(
+                [
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+                    AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
             null,
             AstFactory.blockFunctionBody2()));
   }
@@ -601,10 +628,11 @@
             AstFactory.identifier3("C"),
             null,
             AstFactory.formalParameterList(),
-            [AstFactory.constructorFieldInitializer(
-                false,
-                "a",
-                AstFactory.identifier3("b"))],
+            [
+                AstFactory.constructorFieldInitializer(
+                    false,
+                    "a",
+                    AstFactory.identifier3("b"))],
             AstFactory.blockFunctionBody2()));
   }
 
@@ -622,11 +650,6 @@
     _assertClone(declaration);
   }
 
-  void test_visitConstructorFieldInitializer_withThis() {
-    _assertClone(
-        AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3("b")));
-  }
-
   void test_visitConstructorFieldInitializer_withoutThis() {
     _assertClone(
         AstFactory.constructorFieldInitializer(
@@ -635,14 +658,18 @@
             AstFactory.identifier3("b")));
   }
 
+  void test_visitConstructorFieldInitializer_withThis() {
+    _assertClone(
+        AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3("b")));
+  }
+
   void test_visitConstructorName_named_prefix() {
     _assertClone(
         AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
   }
 
   void test_visitConstructorName_unnamed_noPrefix() {
-    _assertClone(
-        AstFactory.constructorName(AstFactory.typeName4("C"), null));
+    _assertClone(AstFactory.constructorName(AstFactory.typeName4("C"), null));
   }
 
   void test_visitConstructorName_unnamed_prefix() {
@@ -784,10 +811,7 @@
 
   void test_visitFieldFormalParameter_keywordAndType() {
     _assertClone(
-        AstFactory.fieldFormalParameter(
-            Keyword.FINAL,
-            AstFactory.typeName4("A"),
-            "a"));
+        AstFactory.fieldFormalParameter(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
@@ -829,113 +853,6 @@
             AstFactory.block()));
   }
 
-  void test_visitForStatement_c() {
-    _assertClone(
-        AstFactory.forStatement(
-            null,
-            AstFactory.identifier3("c"),
-            null,
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_cu() {
-    _assertClone(
-        AstFactory.forStatement(
-            null,
-            AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_e() {
-    _assertClone(
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"),
-            null,
-            null,
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_ec() {
-    _assertClone(
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"),
-            AstFactory.identifier3("c"),
-            null,
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_ecu() {
-    _assertClone(
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"),
-            AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_eu() {
-    _assertClone(
-        AstFactory.forStatement(
-            AstFactory.identifier3("e"),
-            null,
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_i() {
-    _assertClone(
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("i")]),
-            null,
-            null,
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_ic() {
-    _assertClone(
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("i")]),
-            AstFactory.identifier3("c"),
-            null,
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_icu() {
-    _assertClone(
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("i")]),
-            AstFactory.identifier3("c"),
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_iu() {
-    _assertClone(
-        AstFactory.forStatement2(
-            AstFactory.variableDeclarationList2(
-                Keyword.VAR,
-                [AstFactory.variableDeclaration("i")]),
-            null,
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
-  void test_visitForStatement_u() {
-    _assertClone(
-        AstFactory.forStatement(
-            null,
-            null,
-            [AstFactory.identifier3("u")],
-            AstFactory.block()));
-  }
-
   void test_visitFormalParameterList_empty() {
     _assertClone(AstFactory.formalParameterList());
   }
@@ -1091,13 +1008,111 @@
                     AstFactory.integer(4))]));
   }
 
-  void test_visitFunctionDeclarationStatement() {
+  void test_visitForStatement_c() {
     _assertClone(
-        AstFactory.functionDeclarationStatement(
+        AstFactory.forStatement(
+            null,
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_cu() {
+    _assertClone(
+        AstFactory.forStatement(
+            null,
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_e() {
+    _assertClone(
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
             null,
             null,
-            "f",
-            AstFactory.functionExpression()));
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_ec() {
+    _assertClone(
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_ecu() {
+    _assertClone(
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_eu() {
+    _assertClone(
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_i() {
+    _assertClone(
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            null,
+            null,
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_ic() {
+    _assertClone(
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_icu() {
+    _assertClone(
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_iu() {
+    _assertClone(
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("i")]),
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
+  }
+
+  void test_visitForStatement_u() {
+    _assertClone(
+        AstFactory.forStatement(
+            null,
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitFunctionDeclaration_getter() {
@@ -1138,6 +1153,15 @@
     _assertClone(declaration);
   }
 
+  void test_visitFunctionDeclarationStatement() {
+    _assertClone(
+        AstFactory.functionDeclarationStatement(
+            null,
+            null,
+            "f",
+            AstFactory.functionExpression()));
+  }
+
   void test_visitFunctionExpression() {
     _assertClone(AstFactory.functionExpression());
   }
@@ -1182,9 +1206,7 @@
 
   void test_visitFunctionTypedFormalParameter_type() {
     _assertClone(
-        AstFactory.functionTypedFormalParameter(
-            AstFactory.typeName4("T"),
-            "f"));
+        AstFactory.functionTypedFormalParameter(AstFactory.typeName4("T"), "f"));
   }
 
   void test_visitIfStatement_withElse() {
@@ -1305,9 +1327,7 @@
 
   void test_visitInstanceCreationExpression_unnamed() {
     _assertClone(
-        AstFactory.instanceCreationExpression2(
-            Keyword.NEW,
-            AstFactory.typeName4("C")));
+        AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
@@ -1402,10 +1422,6 @@
                 AstFactory.identifier3("c")]));
   }
 
-  void test_visitMapLiteralEntry() {
-    _assertClone(AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
-  }
-
   void test_visitMapLiteral_const() {
     _assertClone(AstFactory.mapLiteral(Keyword.CONST, null));
   }
@@ -1423,6 +1439,10 @@
                 AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))]));
   }
 
+  void test_visitMapLiteralEntry() {
+    _assertClone(AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
+  }
+
   void test_visitMethodDeclaration_external() {
     _assertClone(
         AstFactory.methodDeclaration(
@@ -1601,8 +1621,7 @@
   }
 
   void test_visitMethodInvocation_target() {
-    _assertClone(
-        AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
+    _assertClone(AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
   }
 
   void test_visitNamedExpression() {
@@ -1669,15 +1688,15 @@
         AstFactory.postfixExpression(AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
   }
 
+  void test_visitPrefixedIdentifier() {
+    _assertClone(AstFactory.identifier5("a", "b"));
+  }
+
   void test_visitPrefixExpression() {
     _assertClone(
         AstFactory.prefixExpression(TokenType.MINUS, AstFactory.identifier3("a")));
   }
 
-  void test_visitPrefixedIdentifier() {
-    _assertClone(AstFactory.identifier5("a", "b"));
-  }
-
   void test_visitPropertyAccess() {
     _assertClone(AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b"));
   }
@@ -1799,9 +1818,7 @@
 
   void test_visitSwitchDefault_singleLabel() {
     _assertClone(
-        AstFactory.switchDefault(
-            [AstFactory.label2("l1")],
-            [AstFactory.block()]));
+        AstFactory.switchDefault([AstFactory.label2("l1")], [AstFactory.block()]));
   }
 
   void test_visitSwitchStatement() {
@@ -1850,14 +1867,6 @@
             [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
   }
 
-  void test_visitTryStatement_catchFinally() {
-    _assertClone(
-        AstFactory.tryStatement3(
-            AstFactory.block(),
-            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
-            AstFactory.block()));
-  }
-
   void test_visitTryStatement_catches() {
     _assertClone(
         AstFactory.tryStatement2(
@@ -1867,6 +1876,14 @@
                 AstFactory.catchClause3(AstFactory.typeName4("F"))]));
   }
 
+  void test_visitTryStatement_catchFinally() {
+    _assertClone(
+        AstFactory.tryStatement3(
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
+            AstFactory.block()));
+  }
+
   void test_visitTryStatement_finally() {
     _assertClone(
         AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
@@ -1904,14 +1921,6 @@
     _assertClone(AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
   }
 
-  void test_visitTypeParameterList_multiple() {
-    _assertClone(AstFactory.typeParameterList(["E", "F"]));
-  }
-
-  void test_visitTypeParameterList_single() {
-    _assertClone(AstFactory.typeParameterList(["E"]));
-  }
-
   void test_visitTypeParameter_withExtends() {
     _assertClone(AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
   }
@@ -1927,6 +1936,30 @@
     _assertClone(AstFactory.typeParameter("E"));
   }
 
+  void test_visitTypeParameterList_multiple() {
+    _assertClone(AstFactory.typeParameterList(["E", "F"]));
+  }
+
+  void test_visitTypeParameterList_single() {
+    _assertClone(AstFactory.typeParameterList(["E"]));
+  }
+
+  void test_visitVariableDeclaration_initialized() {
+    _assertClone(
+        AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
+  }
+
+  void test_visitVariableDeclaration_uninitialized() {
+    _assertClone(AstFactory.variableDeclaration("a"));
+  }
+
+  void test_visitVariableDeclaration_withMetadata() {
+    VariableDeclaration declaration = AstFactory.variableDeclaration("a");
+    declaration.metadata =
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
+    _assertClone(declaration);
+  }
+
   void test_visitVariableDeclarationList_const_type() {
     _assertClone(
         AstFactory.variableDeclarationList(
@@ -1975,22 +2008,6 @@
             [AstFactory.variableDeclaration("c")]));
   }
 
-  void test_visitVariableDeclaration_initialized() {
-    _assertClone(
-        AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
-  }
-
-  void test_visitVariableDeclaration_uninitialized() {
-    _assertClone(AstFactory.variableDeclaration("a"));
-  }
-
-  void test_visitVariableDeclaration_withMetadata() {
-    VariableDeclaration declaration = AstFactory.variableDeclaration("a");
-    declaration.metadata =
-        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
-    _assertClone(declaration);
-  }
-
   void test_visitWhileStatement() {
     _assertClone(
         AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block()));
@@ -2035,30 +2052,6 @@
   }
 }
 
-class AstCloneComparator extends AstComparator {
-  final bool expectTokensCopied;
-
-  AstCloneComparator(this.expectTokensCopied);
-
-  @override
-  bool isEqualNodes(AstNode first, AstNode second) {
-    if (first != null && identical(first, second)) {
-      fail('Failed to copy node: $first (${first.offset})');
-      return false;
-    }
-    return super.isEqualNodes(first, second);
-  }
-
-  @override
-  bool isEqualTokens(Token first, Token second) {
-    if (expectTokensCopied && first != null && identical(first, second)) {
-      fail('Failed to copy token: ${first.lexeme} (${first.offset})');
-      return false;
-    }
-    return super.isEqualTokens(first, second);
-  }
-}
-
 class BooleanArrayTest {
   void test_get_negative() {
     try {
@@ -2388,36 +2381,6 @@
 class DirectedGraphTest_Node {
 }
 
-class Getter_NodeReplacerTest_testAnnotatedNode implements
-    NodeReplacerTest_Getter {
-  @override
-  Comment get(AnnotatedNode node) => node.documentationComment;
-}
-
-class Getter_NodeReplacerTest_testNormalFormalParameter implements
-    NodeReplacerTest_Getter {
-  @override
-  SimpleIdentifier get(NormalFormalParameter node) => node.identifier;
-}
-
-class Getter_NodeReplacerTest_testNormalFormalParameter_2 implements
-    NodeReplacerTest_Getter {
-  @override
-  Comment get(NormalFormalParameter node) => node.documentationComment;
-}
-
-class Getter_NodeReplacerTest_testTypedLiteral implements
-    NodeReplacerTest_Getter {
-  @override
-  TypeArgumentList get(TypedLiteral node) => node.typeArguments;
-}
-
-class Getter_NodeReplacerTest_testUriBasedDirective implements
-    NodeReplacerTest_Getter {
-  @override
-  StringLiteral get(UriBasedDirective node) => node.uri;
-}
-
 class Getter_NodeReplacerTest_test_annotation implements NodeReplacerTest_Getter
     {
   @override
@@ -2833,13 +2796,6 @@
   TypeName get(FunctionDeclaration node) => node.returnType;
 }
 
-class Getter_NodeReplacerTest_test_functionDeclarationStatement implements
-    NodeReplacerTest_Getter {
-  @override
-  FunctionDeclaration get(FunctionDeclarationStatement node) =>
-      node.functionDeclaration;
-}
-
 class Getter_NodeReplacerTest_test_functionDeclaration_2 implements
     NodeReplacerTest_Getter {
   @override
@@ -2852,12 +2808,25 @@
   SimpleIdentifier get(FunctionDeclaration node) => node.name;
 }
 
+class Getter_NodeReplacerTest_test_functionDeclarationStatement implements
+    NodeReplacerTest_Getter {
+  @override
+  FunctionDeclaration get(FunctionDeclarationStatement node) =>
+      node.functionDeclaration;
+}
+
 class Getter_NodeReplacerTest_test_functionExpression implements
     NodeReplacerTest_Getter {
   @override
   FormalParameterList get(FunctionExpression node) => node.parameters;
 }
 
+class Getter_NodeReplacerTest_test_functionExpression_2 implements
+    NodeReplacerTest_Getter {
+  @override
+  FunctionBody get(FunctionExpression node) => node.body;
+}
+
 class Getter_NodeReplacerTest_test_functionExpressionInvocation implements
     NodeReplacerTest_Getter {
   @override
@@ -2870,12 +2839,6 @@
   ArgumentList get(FunctionExpressionInvocation node) => node.argumentList;
 }
 
-class Getter_NodeReplacerTest_test_functionExpression_2 implements
-    NodeReplacerTest_Getter {
-  @override
-  FunctionBody get(FunctionExpression node) => node.body;
-}
-
 class Getter_NodeReplacerTest_test_functionTypeAlias implements
     NodeReplacerTest_Getter {
   @override
@@ -3091,12 +3054,6 @@
   Expression get(PostfixExpression node) => node.operand;
 }
 
-class Getter_NodeReplacerTest_test_prefixExpression implements
-    NodeReplacerTest_Getter {
-  @override
-  Expression get(PrefixExpression node) => node.operand;
-}
-
 class Getter_NodeReplacerTest_test_prefixedIdentifier implements
     NodeReplacerTest_Getter {
   @override
@@ -3109,6 +3066,12 @@
   SimpleIdentifier get(PrefixedIdentifier node) => node.prefix;
 }
 
+class Getter_NodeReplacerTest_test_prefixExpression implements
+    NodeReplacerTest_Getter {
+  @override
+  Expression get(PrefixExpression node) => node.operand;
+}
+
 class Getter_NodeReplacerTest_test_propertyAccess implements
     NodeReplacerTest_Getter {
   @override
@@ -3224,6 +3187,12 @@
   SimpleIdentifier get(VariableDeclaration node) => node.name;
 }
 
+class Getter_NodeReplacerTest_test_variableDeclaration_2 implements
+    NodeReplacerTest_Getter {
+  @override
+  Expression get(VariableDeclaration node) => node.initializer;
+}
+
 class Getter_NodeReplacerTest_test_variableDeclarationList implements
     NodeReplacerTest_Getter {
   @override
@@ -3237,12 +3206,6 @@
       node.variables;
 }
 
-class Getter_NodeReplacerTest_test_variableDeclaration_2 implements
-    NodeReplacerTest_Getter {
-  @override
-  Expression get(VariableDeclaration node) => node.initializer;
-}
-
 class Getter_NodeReplacerTest_test_whileStatement implements
     NodeReplacerTest_Getter {
   @override
@@ -3255,6 +3218,36 @@
   Statement get(WhileStatement node) => node.body;
 }
 
+class Getter_NodeReplacerTest_testAnnotatedNode implements
+    NodeReplacerTest_Getter {
+  @override
+  Comment get(AnnotatedNode node) => node.documentationComment;
+}
+
+class Getter_NodeReplacerTest_testNormalFormalParameter implements
+    NodeReplacerTest_Getter {
+  @override
+  SimpleIdentifier get(NormalFormalParameter node) => node.identifier;
+}
+
+class Getter_NodeReplacerTest_testNormalFormalParameter_2 implements
+    NodeReplacerTest_Getter {
+  @override
+  Comment get(NormalFormalParameter node) => node.documentationComment;
+}
+
+class Getter_NodeReplacerTest_testTypedLiteral implements
+    NodeReplacerTest_Getter {
+  @override
+  TypeArgumentList get(TypedLiteral node) => node.typeArguments;
+}
+
+class Getter_NodeReplacerTest_testUriBasedDirective implements
+    NodeReplacerTest_Getter {
+  @override
+  StringLiteral get(UriBasedDirective node) => node.uri;
+}
+
 class LineInfoTest {
   void test_creation() {
     expect(new LineInfo(<int>[0]), isNotNull);
@@ -3300,46 +3293,6 @@
   }
 }
 
-class ListGetter_NodeReplacerTest_testAnnotatedNode extends
-    NodeReplacerTest_ListGetter<AnnotatedNode, Annotation> {
-  ListGetter_NodeReplacerTest_testAnnotatedNode(int arg0) : super(arg0);
-
-  @override
-  NodeList<Annotation> getList(AnnotatedNode node) => node.metadata;
-}
-
-class ListGetter_NodeReplacerTest_testNamespaceDirective extends
-    NodeReplacerTest_ListGetter<NamespaceDirective, Combinator> {
-  ListGetter_NodeReplacerTest_testNamespaceDirective(int arg0) : super(arg0);
-
-  @override
-  NodeList<Combinator> getList(NamespaceDirective node) => node.combinators;
-}
-
-class ListGetter_NodeReplacerTest_testNormalFormalParameter extends
-    NodeReplacerTest_ListGetter<NormalFormalParameter, Annotation> {
-  ListGetter_NodeReplacerTest_testNormalFormalParameter(int arg0) : super(arg0);
-
-  @override
-  NodeList<Annotation> getList(NormalFormalParameter node) => node.metadata;
-}
-
-class ListGetter_NodeReplacerTest_testSwitchMember extends
-    NodeReplacerTest_ListGetter<SwitchMember, Label> {
-  ListGetter_NodeReplacerTest_testSwitchMember(int arg0) : super(arg0);
-
-  @override
-  NodeList<Label> getList(SwitchMember node) => node.labels;
-}
-
-class ListGetter_NodeReplacerTest_testSwitchMember_2 extends
-    NodeReplacerTest_ListGetter<SwitchMember, Statement> {
-  ListGetter_NodeReplacerTest_testSwitchMember_2(int arg0) : super(arg0);
-
-  @override
-  NodeList<Statement> getList(SwitchMember node) => node.statements;
-}
-
 class ListGetter_NodeReplacerTest_test_adjacentStrings extends
     NodeReplacerTest_ListGetter<AdjacentStrings, StringLiteral> {
   ListGetter_NodeReplacerTest_test_adjacentStrings(int arg0) : super(arg0);
@@ -3423,6 +3376,15 @@
       node.initializers;
 }
 
+class ListGetter_NodeReplacerTest_test_formalParameterList extends
+    NodeReplacerTest_ListGetter<FormalParameterList, FormalParameter> {
+  ListGetter_NodeReplacerTest_test_formalParameterList(int arg0) : super(arg0);
+
+  @override
+  NodeList<FormalParameter> getList(FormalParameterList node) =>
+      node.parameters;
+}
+
 class ListGetter_NodeReplacerTest_test_forStatement_withInitialization extends
     NodeReplacerTest_ListGetter<ForStatement, Expression> {
   ListGetter_NodeReplacerTest_test_forStatement_withInitialization(int arg0)
@@ -3441,15 +3403,6 @@
   NodeList<Expression> getList(ForStatement node) => node.updaters;
 }
 
-class ListGetter_NodeReplacerTest_test_formalParameterList extends
-    NodeReplacerTest_ListGetter<FormalParameterList, FormalParameter> {
-  ListGetter_NodeReplacerTest_test_formalParameterList(int arg0) : super(arg0);
-
-  @override
-  NodeList<FormalParameter> getList(FormalParameterList node) =>
-      node.parameters;
-}
-
 class ListGetter_NodeReplacerTest_test_hideCombinator extends
     NodeReplacerTest_ListGetter<HideCombinator, SimpleIdentifier> {
   ListGetter_NodeReplacerTest_test_hideCombinator(int arg0) : super(arg0);
@@ -3566,6 +3519,46 @@
   NodeList<TypeName> getList(WithClause node) => node.mixinTypes;
 }
 
+class ListGetter_NodeReplacerTest_testAnnotatedNode extends
+    NodeReplacerTest_ListGetter<AnnotatedNode, Annotation> {
+  ListGetter_NodeReplacerTest_testAnnotatedNode(int arg0) : super(arg0);
+
+  @override
+  NodeList<Annotation> getList(AnnotatedNode node) => node.metadata;
+}
+
+class ListGetter_NodeReplacerTest_testNamespaceDirective extends
+    NodeReplacerTest_ListGetter<NamespaceDirective, Combinator> {
+  ListGetter_NodeReplacerTest_testNamespaceDirective(int arg0) : super(arg0);
+
+  @override
+  NodeList<Combinator> getList(NamespaceDirective node) => node.combinators;
+}
+
+class ListGetter_NodeReplacerTest_testNormalFormalParameter extends
+    NodeReplacerTest_ListGetter<NormalFormalParameter, Annotation> {
+  ListGetter_NodeReplacerTest_testNormalFormalParameter(int arg0) : super(arg0);
+
+  @override
+  NodeList<Annotation> getList(NormalFormalParameter node) => node.metadata;
+}
+
+class ListGetter_NodeReplacerTest_testSwitchMember extends
+    NodeReplacerTest_ListGetter<SwitchMember, Label> {
+  ListGetter_NodeReplacerTest_testSwitchMember(int arg0) : super(arg0);
+
+  @override
+  NodeList<Label> getList(SwitchMember node) => node.labels;
+}
+
+class ListGetter_NodeReplacerTest_testSwitchMember_2 extends
+    NodeReplacerTest_ListGetter<SwitchMember, Statement> {
+  ListGetter_NodeReplacerTest_testSwitchMember_2(int arg0) : super(arg0);
+
+  @override
+  NodeList<Statement> getList(SwitchMember node) => node.statements;
+}
+
 class ListUtilitiesTest {
   void test_addAll_emptyToEmpty() {
     List<String> list = new List<String>();
@@ -3750,9 +3743,7 @@
   void test_asExpression() {
     AsExpression node = AstFactory.asExpression(
         AstFactory.integer(0),
-        AstFactory.typeName3(
-            AstFactory.identifier3("a"),
-            [AstFactory.typeName4("C")]));
+        AstFactory.typeName3(AstFactory.identifier3("a"), [AstFactory.typeName4("C")]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression());
   }
@@ -3886,9 +3877,10 @@
     CompilationUnit node = AstFactory.compilationUnit8(
         "",
         [AstFactory.libraryDirective2("lib")],
-        [AstFactory.topLevelVariableDeclaration2(
-            null,
-            [AstFactory.variableDeclaration("X")])]);
+        [
+            AstFactory.topLevelVariableDeclaration2(
+                null,
+                [AstFactory.variableDeclaration("X")])]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_compilationUnit());
     _assertReplace(
         node,
@@ -3925,8 +3917,7 @@
         AstFactory.emptyFunctionBody());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata =
-        [AstFactory.annotation(AstFactory.identifier3("a"))];
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     node.redirectedConstructor =
         AstFactory.constructorName(AstFactory.typeName4("B"), "a");
     _assertReplace(
@@ -3978,8 +3969,7 @@
         AstFactory.declaredIdentifier4(AstFactory.typeName4("C"), "i");
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
-    node.metadata =
-        [AstFactory.annotation(AstFactory.identifier3("a"))];
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier());
     _assertReplace(
         node,
@@ -4019,8 +4009,8 @@
 
   void test_enumDeclaration() {
     EnumDeclaration node = AstFactory.enumDeclaration2("E", ["ONE", "TWO"]);
-    node.documentationComment
-        = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.documentationComment =
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration());
     _testAnnotatedNode(node);
@@ -4052,8 +4042,7 @@
   }
 
   void test_extendsClause() {
-    ExtendsClause node =
-        AstFactory.extendsClause(AstFactory.typeName4("S"));
+    ExtendsClause node = AstFactory.extendsClause(AstFactory.typeName4("S"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_extendsClause());
   }
 
@@ -4120,6 +4109,14 @@
         new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_3());
   }
 
+  void test_formalParameterList() {
+    FormalParameterList node =
+        AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("p")]);
+    _assertReplace(
+        node,
+        new ListGetter_NodeReplacerTest_test_formalParameterList(0));
+  }
+
   void test_forStatement_withInitialization() {
     ForStatement node = AstFactory.forStatement(
         AstFactory.identifier3("a"),
@@ -4162,14 +4159,6 @@
         new ListGetter_NodeReplacerTest_test_forStatement_withVariables(0));
   }
 
-  void test_formalParameterList() {
-    FormalParameterList node =
-        AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("p")]);
-    _assertReplace(
-        node,
-        new ListGetter_NodeReplacerTest_test_formalParameterList(0));
-  }
-
   void test_functionDeclaration() {
     FunctionDeclaration node = AstFactory.functionDeclaration(
         AstFactory.typeName4("R"),
@@ -4348,9 +4337,8 @@
   }
 
   void test_labeledStatement() {
-    LabeledStatement node = AstFactory.labeledStatement(
-        [AstFactory.label2("l")],
-        AstFactory.block());
+    LabeledStatement node =
+        AstFactory.labeledStatement([AstFactory.label2("l")], AstFactory.block());
     _assertReplace(
         node,
         new ListGetter_NodeReplacerTest_test_labeledStatement(0));
@@ -4483,12 +4471,6 @@
     _assertReplace(node, new Getter_NodeReplacerTest_test_postfixExpression());
   }
 
-  void test_prefixExpression() {
-    PrefixExpression node =
-        AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("y"));
-    _assertReplace(node, new Getter_NodeReplacerTest_test_prefixExpression());
-  }
-
   void test_prefixedIdentifier() {
     PrefixedIdentifier node = AstFactory.identifier5("a", "b");
     _assertReplace(
@@ -4497,6 +4479,12 @@
     _assertReplace(node, new Getter_NodeReplacerTest_test_prefixedIdentifier());
   }
 
+  void test_prefixExpression() {
+    PrefixExpression node =
+        AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("y"));
+    _assertReplace(node, new Getter_NodeReplacerTest_test_prefixExpression());
+  }
+
   void test_propertyAccess() {
     PropertyAccess node =
         AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
@@ -4568,9 +4556,8 @@
   }
 
   void test_switchDefault() {
-    SwitchDefault node = AstFactory.switchDefault(
-        [AstFactory.label2("l")],
-        [AstFactory.block()]);
+    SwitchDefault node =
+        AstFactory.switchDefault([AstFactory.label2("l")], [AstFactory.block()]);
     _testSwitchMember(node);
   }
 
@@ -4582,9 +4569,7 @@
                 [AstFactory.label2("l")],
                 AstFactory.integer(0),
                 [AstFactory.block()]),
-            AstFactory.switchDefault(
-                [AstFactory.label2("l")],
-                [AstFactory.block()])]);
+            AstFactory.switchDefault([AstFactory.label2("l")], [AstFactory.block()])]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement());
     _assertReplace(
         node,
@@ -4690,9 +4675,8 @@
   }
 
   void test_whileStatement() {
-    WhileStatement node = AstFactory.whileStatement(
-        AstFactory.booleanLiteral(true),
-        AstFactory.block());
+    WhileStatement node =
+        AstFactory.whileStatement(AstFactory.booleanLiteral(true), AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement_2());
   }
@@ -4929,11 +4913,19 @@
   }
 
   void test_getUnion() {
-    expect(new SourceRange(10, 10).getUnion(new SourceRange(15, 10)), new SourceRange(10, 15));
-    expect(new SourceRange(15, 10).getUnion(new SourceRange(10, 10)), new SourceRange(10, 15));
+    expect(
+        new SourceRange(10, 10).getUnion(new SourceRange(15, 10)),
+        new SourceRange(10, 15));
+    expect(
+        new SourceRange(15, 10).getUnion(new SourceRange(10, 10)),
+        new SourceRange(10, 15));
     // "other" is covered/covers
-    expect(new SourceRange(10, 10).getUnion(new SourceRange(15, 2)), new SourceRange(10, 10));
-    expect(new SourceRange(15, 2).getUnion(new SourceRange(10, 10)), new SourceRange(10, 10));
+    expect(
+        new SourceRange(10, 10).getUnion(new SourceRange(15, 2)),
+        new SourceRange(10, 10));
+    expect(
+        new SourceRange(15, 2).getUnion(new SourceRange(10, 10)),
+        new SourceRange(10, 10));
   }
 
   void test_intersects() {
@@ -5019,18 +5011,34 @@
     expect(StringUtilities.indexOf4("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64), 0);
     expect(StringUtilities.indexOf4("abcdefghi", 0, 0x63, 0x64, 0x65, 0x66), 2);
     expect(StringUtilities.indexOf4("abcdefghi", 0, 0x66, 0x67, 0x68, 0x69), 5);
-    expect(StringUtilities.indexOf4("abcdefghi", 0, 0x64, 0x65, 0x61, 0x64), -1);
-    expect(StringUtilities.indexOf4("abcdefghi", 1, 0x61, 0x62, 0x63, 0x64), -1);
+    expect(
+        StringUtilities.indexOf4("abcdefghi", 0, 0x64, 0x65, 0x61, 0x64),
+        -1);
+    expect(
+        StringUtilities.indexOf4("abcdefghi", 1, 0x61, 0x62, 0x63, 0x64),
+        -1);
     // before start
   }
 
   void test_indexOf5() {
-    expect(StringUtilities.indexOf5("abcde", 0, 0x61, 0x62, 0x63, 0x64, 0x65), 0);
-    expect(StringUtilities.indexOf5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65), 0);
-    expect(StringUtilities.indexOf5("abcdefghi", 0, 0x63, 0x64, 0x65, 0x66, 0x67), 2);
-    expect(StringUtilities.indexOf5("abcdefghi", 0, 0x65, 0x66, 0x67, 0x68, 0x69), 4);
-    expect(StringUtilities.indexOf5("abcdefghi", 0, 0x64, 0x65, 0x66, 0x69, 0x6E), -1);
-    expect(StringUtilities.indexOf5("abcdefghi", 1, 0x61, 0x62, 0x63, 0x64, 0x65), -1);
+    expect(
+        StringUtilities.indexOf5("abcde", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
+        0);
+    expect(
+        StringUtilities.indexOf5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
+        0);
+    expect(
+        StringUtilities.indexOf5("abcdefghi", 0, 0x63, 0x64, 0x65, 0x66, 0x67),
+        2);
+    expect(
+        StringUtilities.indexOf5("abcdefghi", 0, 0x65, 0x66, 0x67, 0x68, 0x69),
+        4);
+    expect(
+        StringUtilities.indexOf5("abcdefghi", 0, 0x64, 0x65, 0x66, 0x69, 0x6E),
+        -1);
+    expect(
+        StringUtilities.indexOf5("abcdefghi", 1, 0x61, 0x62, 0x63, 0x64, 0x65),
+        -1);
     // before start
   }
 
@@ -5064,7 +5072,9 @@
   }
 
   void test_printListOfQuotedNames_five() {
-    expect(StringUtilities.printListOfQuotedNames(<String>["a", "b", "c", "d", "e"]), "'a', 'b', 'c', 'd' and 'e'");
+    expect(
+        StringUtilities.printListOfQuotedNames(<String>["a", "b", "c", "d", "e"]),
+        "'a', 'b', 'c', 'd' and 'e'");
   }
 
   void test_printListOfQuotedNames_null() {
@@ -5086,11 +5096,15 @@
   }
 
   void test_printListOfQuotedNames_three() {
-    expect(StringUtilities.printListOfQuotedNames(<String>["a", "b", "c"]), "'a', 'b' and 'c'");
+    expect(
+        StringUtilities.printListOfQuotedNames(<String>["a", "b", "c"]),
+        "'a', 'b' and 'c'");
   }
 
   void test_printListOfQuotedNames_two() {
-    expect(StringUtilities.printListOfQuotedNames(<String>["a", "b"]), "'a' and 'b'");
+    expect(
+        StringUtilities.printListOfQuotedNames(<String>["a", "b"]),
+        "'a' and 'b'");
   }
 
   void test_startsWith2() {
@@ -5104,69 +5118,75 @@
 
   void test_startsWith3() {
     expect(StringUtilities.startsWith3("abc", 0, 0x61, 0x62, 0x63), isTrue);
-    expect(StringUtilities.startsWith3("abcdefghi", 0, 0x61, 0x62, 0x63), isTrue);
-    expect(StringUtilities.startsWith3("abcdefghi", 2, 0x63, 0x64, 0x65), isTrue);
-    expect(StringUtilities.startsWith3("abcdefghi", 6, 0x67, 0x68, 0x69), isTrue);
-    expect(StringUtilities.startsWith3("abcdefghi", 0, 0x64, 0x65, 0x61), isFalse);
+    expect(
+        StringUtilities.startsWith3("abcdefghi", 0, 0x61, 0x62, 0x63),
+        isTrue);
+    expect(
+        StringUtilities.startsWith3("abcdefghi", 2, 0x63, 0x64, 0x65),
+        isTrue);
+    expect(
+        StringUtilities.startsWith3("abcdefghi", 6, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith3("abcdefghi", 0, 0x64, 0x65, 0x61),
+        isFalse);
     // missing
   }
 
   void test_startsWith4() {
-    expect(StringUtilities.startsWith4("abcd", 0, 0x61, 0x62, 0x63, 0x64), isTrue);
-    expect(StringUtilities.startsWith4("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64), isTrue);
-    expect(StringUtilities.startsWith4("abcdefghi", 2, 0x63, 0x64, 0x65, 0x66), isTrue);
-    expect(StringUtilities.startsWith4("abcdefghi", 5, 0x66, 0x67, 0x68, 0x69), isTrue);
-    expect(StringUtilities.startsWith4("abcdefghi", 0, 0x64, 0x65, 0x61, 0x64), isFalse);
+    expect(
+        StringUtilities.startsWith4("abcd", 0, 0x61, 0x62, 0x63, 0x64),
+        isTrue);
+    expect(
+        StringUtilities.startsWith4("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64),
+        isTrue);
+    expect(
+        StringUtilities.startsWith4("abcdefghi", 2, 0x63, 0x64, 0x65, 0x66),
+        isTrue);
+    expect(
+        StringUtilities.startsWith4("abcdefghi", 5, 0x66, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith4("abcdefghi", 0, 0x64, 0x65, 0x61, 0x64),
+        isFalse);
     // missing
   }
 
   void test_startsWith5() {
-    expect(StringUtilities.startsWith5("abcde", 0, 0x61, 0x62, 0x63, 0x64, 0x65), isTrue);
-    expect(StringUtilities.startsWith5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65), isTrue);
-    expect(StringUtilities.startsWith5("abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67), isTrue);
-    expect(StringUtilities.startsWith5("abcdefghi", 4, 0x65, 0x66, 0x67, 0x68, 0x69), isTrue);
-    expect(StringUtilities.startsWith5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x62, 0x61), isFalse);
+    expect(
+        StringUtilities.startsWith5("abcde", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5("abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5("abcdefghi", 4, 0x65, 0x66, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5("abcdefghi", 0, 0x61, 0x62, 0x63, 0x62, 0x61),
+        isFalse);
     // missing
   }
 
   void test_startsWith6() {
-    expect(StringUtilities.startsWith6("abcdef", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66), isTrue);
-    expect(StringUtilities.startsWith6(
-            "abcdefghi",
-            0,
-            0x61,
-            0x62,
-            0x63,
-            0x64,
-            0x65,
-            0x66), isTrue);
-    expect(StringUtilities.startsWith6(
-            "abcdefghi",
-            2,
-            0x63,
-            0x64,
-            0x65,
-            0x66,
-            0x67,
-            0x68), isTrue);
-    expect(StringUtilities.startsWith6(
-            "abcdefghi",
-            3,
-            0x64,
-            0x65,
-            0x66,
-            0x67,
-            0x68,
-            0x69), isTrue);
-    expect(StringUtilities.startsWith6(
-            "abcdefghi",
-            0,
-            0x61,
-            0x62,
-            0x63,
-            0x64,
-            0x65,
-            0x67), isFalse);
+    expect(
+        StringUtilities.startsWith6("abcdef", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6("abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6("abcdefghi", 3, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6("abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x67),
+        isFalse);
     // missing
   }
 
diff --git a/pkg/analyzer/test/options_test.dart b/pkg/analyzer/test/options_test.dart
index 2b30e62..12818c5 100644
--- a/pkg/analyzer/test/options_test.dart
+++ b/pkg/analyzer/test/options_test.dart
@@ -4,16 +4,16 @@
 
 library options_test;
 
-import 'package:unittest/unittest.dart';
 import 'package:analyzer/options.dart';
+import 'package:unittest/unittest.dart';
 
 main() {
 
   group('AnalyzerOptions.parse()', () {
 
     test('defaults', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', 'foo.dart']);
       expect(options, isNotNull);
       expect(options.dartSdkPath, isNotNull);
       expect(options.disableHints, isFalse);
@@ -35,87 +35,89 @@
     });
 
     test('batch', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--batch']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--batch']);
       expect(options.shouldBatch, isTrue);
     });
 
     test('defined variables', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '-Dfoo=bar', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '-Dfoo=bar', 'foo.dart']);
       expect(options.definedVariables['foo'], equals('bar'));
       expect(options.definedVariables['bar'], isNull);
     });
 
     test('enable async', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--enable-async', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--enable-async', 'foo.dart']);
       expect(options.enableAsync, isTrue);
     });
 
     test('enable enum', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--enable-enum', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--enable-enum', 'foo.dart']);
       expect(options.enableEnum, isTrue);
     });
 
     test('enable type checks', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']);
+      CommandLineOptions options = CommandLineOptions.parse(
+          ['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']);
       expect(options.enableTypeChecks, isTrue);
     });
 
     test('log', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--log', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']);
       expect(options.log, isTrue);
     });
 
     test('machine format', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
       expect(options.machineFormat, isTrue);
     });
 
     test('no-hints', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--no-hints', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--no-hints', 'foo.dart']);
       expect(options.disableHints, isTrue);
     });
 
     test('package root', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
       expect(options.packageRootPath, equals('bar'));
     });
 
     test('package warnings', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--package-warnings', 'foo.dart']);
+      CommandLineOptions options = CommandLineOptions.parse(
+          ['--dart-sdk', '.', '--package-warnings', 'foo.dart']);
       expect(options.showPackageWarnings, isTrue);
     });
 
     test('perf', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
       expect(options.perf, isTrue);
     });
 
     test('sdk warnings', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
       expect(options.showSdkWarnings, isTrue);
     });
 
     test('sourceFiles', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--log', 'foo.dart', 'foo2.dart', 'foo3.dart']);
-      expect(options.sourceFiles, equals(['foo.dart', 'foo2.dart', 'foo3.dart']));
+      CommandLineOptions options = CommandLineOptions.parse(
+          ['--dart-sdk', '.', '--log', 'foo.dart', 'foo2.dart', 'foo3.dart']);
+      expect(
+          options.sourceFiles,
+          equals(['foo.dart', 'foo2.dart', 'foo3.dart']));
     });
 
     test('warningsAreFatal', () {
-      CommandLineOptions options = CommandLineOptions
-          .parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
+      CommandLineOptions options =
+          CommandLineOptions.parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
       expect(options.warningsAreFatal, isTrue);
     });
 
diff --git a/pkg/analyzer/test/parse_compilation_unit_test.dart b/pkg/analyzer/test/parse_compilation_unit_test.dart
index a5bc79a..756c227 100644
--- a/pkg/analyzer/test/parse_compilation_unit_test.dart
+++ b/pkg/analyzer/test/parse_compilation_unit_test.dart
@@ -15,7 +15,8 @@
 
   test("throws errors for an invalid compilation unit", () {
     expect(() {
-      parseCompilationUnit("void main() => print('Hello, world!')",
+      parseCompilationUnit(
+          "void main() => print('Hello, world!')",
           name: 'test.dart');
     }, throwsA(predicate((error) {
       return error is AnalyzerErrorGroup &&
diff --git a/pkg/analyzer/test/reflective_tests.dart b/pkg/analyzer/test/reflective_tests.dart
index 8af9674..f2f05af 100644
--- a/pkg/analyzer/test/reflective_tests.dart
+++ b/pkg/analyzer/test/reflective_tests.dart
@@ -11,15 +11,6 @@
 
 
 /**
- * A marker annotation used to instruct dart2js to keep reflection information
- * for the annotated classes.
- */
-class ReflectiveTestCase {
-  const ReflectiveTestCase();
-}
-
-
-/**
  * Runs test methods existing in the given [type].
  *
  * Methods with names starting with `test` are run using [test] function.
@@ -65,14 +56,6 @@
 }
 
 
-_runTest(ClassMirror classMirror, Symbol symbol) {
-  InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
-  return _invokeSymbolIfExists(instanceMirror, #setUp).then(
-      (_) => instanceMirror.invoke(symbol, []).reflectee).whenComplete(
-      () => _invokeSymbolIfExists(instanceMirror, #tearDown));
-}
-
-
 Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
   var invocationResult = null;
   try {
@@ -85,3 +68,26 @@
     return new Future.value(invocationResult);
   }
 }
+
+
+_runTest(ClassMirror classMirror, Symbol symbol) {
+  InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
+  return _invokeSymbolIfExists(
+      instanceMirror,
+      #setUp).then(
+          (_) =>
+              instanceMirror.invoke(
+                  symbol,
+                  [
+                      ]).reflectee).whenComplete(
+                          () => _invokeSymbolIfExists(instanceMirror, #tearDown));
+}
+
+
+/**
+ * A marker annotation used to instruct dart2js to keep reflection information
+ * for the annotated classes.
+ */
+class ReflectiveTestCase {
+  const ReflectiveTestCase();
+}
diff --git a/pkg/analyzer/test/services/test_utils.dart b/pkg/analyzer/test/services/test_utils.dart
index 2e53cbd..4db8219 100644
--- a/pkg/analyzer/test/services/test_utils.dart
+++ b/pkg/analyzer/test/services/test_utils.dart
@@ -17,14 +17,6 @@
 /// Instances of the class [_GatheringErrorListener] implement an error listener
 /// that collects all of the errors passed to it for later examination.
 class _GatheringErrorListener implements AnalysisErrorListener {
-
-  /// The source being parsed.
-  String _rawSource;
-
-  /// The source being parsed after inserting a marker at the beginning and end
-  /// of the range of the most recent error.
-  String _markedSource;
-
   /// A list containing the errors that were collected.
   final List<AnalysisError> _errors = new List<AnalysisError>();
 
@@ -32,11 +24,6 @@
   final Map<Source, LineInfo> _lineInfoMap = new Map<Source, LineInfo>();
 
   void onError(AnalysisError error) {
-    if (_rawSource != null) {
-      var left = error.offset;
-      var right = left + error.length - 1;
-      _markedSource = '${_rawSource.substring(0, left)}^${_rawSource.substring(left, right)}^${_rawSource.substring(right)}';
-    }
     _errors.add(error);
   }
 
diff --git a/pkg/analyzer/test/source/package_map_provider_test.dart b/pkg/analyzer/test/source/package_map_provider_test.dart
index 839db68..311a5f5 100644
--- a/pkg/analyzer/test/source/package_map_provider_test.dart
+++ b/pkg/analyzer/test/source/package_map_provider_test.dart
@@ -6,10 +6,10 @@
 
 import 'dart:convert';
 
-import 'package:analyzer/source/package_map_provider.dart';
-import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/source/package_map_provider.dart';
+import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:unittest/unittest.dart';
 
@@ -25,20 +25,26 @@
 
       setUp(() {
         resourceProvider = new MemoryResourceProvider();
-        packageMapProvider = new PubPackageMapProvider(resourceProvider, DirectoryBasedDartSdk.defaultSdk);
+        packageMapProvider =
+            new PubPackageMapProvider(resourceProvider, DirectoryBasedDartSdk.defaultSdk);
         projectFolder = resourceProvider.newFolder(projectPath);
       });
 
       PackageMapInfo parsePackageMap(Object obj) {
-        return packageMapProvider.parsePackageMap(JSON.encode(obj), projectFolder);
+        return packageMapProvider.parsePackageMap(
+            JSON.encode(obj),
+            projectFolder);
       }
 
       test('normal folder', () {
         String packageName = 'foo';
         String folderPath = '/path/to/folder';
         resourceProvider.newFolder(folderPath);
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: folderPath}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: folderPath
+          }
+        }).packageMap;
         expect(result, hasLength(1));
         expect(result.keys, contains(packageName));
         expect(result[packageName], hasLength(1));
@@ -49,8 +55,11 @@
       test('ignore nonexistent folder', () {
         String packageName = 'foo';
         String folderPath = '/path/to/folder';
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: folderPath}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: folderPath
+          }
+        }).packageMap;
         expect(result, hasLength(0));
       });
 
@@ -60,8 +69,11 @@
         String folderPath2 = '/path/to/folder2';
         resourceProvider.newFolder(folderPath1);
         resourceProvider.newFolder(folderPath2);
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: [folderPath1, folderPath2]}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: [folderPath1, folderPath2]
+          }
+        }).packageMap;
         expect(result, hasLength(1));
         expect(result.keys, contains(packageName));
         expect(result[packageName], hasLength(2));
@@ -76,8 +88,10 @@
         String path2 = '/path/to/folder2/pubspec.lock';
         resourceProvider.newFile(path1, '...');
         resourceProvider.newFile(path2, '...');
-        Set<String> dependencies = parsePackageMap(
-            {'packages': {}, 'input_files': [path1, path2]}).dependencies;
+        Set<String> dependencies = parsePackageMap({
+          'packages': {},
+          'input_files': [path1, path2]
+        }).dependencies;
         expect(dependencies, hasLength(2));
         expect(dependencies, contains(path1));
         expect(dependencies, contains(path2));
@@ -89,8 +103,11 @@
         String packageName = 'foo';
         resourceProvider.newFolder(projectPath);
         resourceProvider.newFolder(packagePath);
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: [relativePackagePath]}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: [relativePackagePath]
+          }
+        }).packageMap;
         expect(result[packageName][0].path, equals(packagePath));
       });
 
@@ -99,8 +116,10 @@
         String relativeDependencyPath = '../pubspec.lock';
         resourceProvider.newFolder(projectPath);
         resourceProvider.newFile(dependencyPath, 'contents');
-        Set<String> dependencies = parsePackageMap(
-            {'packages': {}, 'input_files': [relativeDependencyPath]}).dependencies;
+        Set<String> dependencies = parsePackageMap({
+          'packages': {},
+          'input_files': [relativeDependencyPath]
+        }).dependencies;
         expect(dependencies, hasLength(1));
         expect(dependencies, contains(dependencyPath));
       });
diff --git a/pkg/analyzer/test/source/package_map_resolver_test.dart b/pkg/analyzer/test/source/package_map_resolver_test.dart
index a665608d..b7a644a 100644
--- a/pkg/analyzer/test/source/package_map_resolver_test.dart
+++ b/pkg/analyzer/test/source/package_map_resolver_test.dart
@@ -4,8 +4,6 @@
 
 library test.source.package_map_resolver;
 
-import 'dart:collection';
-
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
@@ -55,7 +53,7 @@
 
 
 class _PackageMapUriResolverTest {
-  static HashMap EMPTY_MAP = new HashMap<String, List<Folder>>();
+  static const Map EMPTY_MAP = const <String, List<Folder>>{};
   MemoryResourceProvider provider = new MemoryResourceProvider();
 
   void test_isPackageUri() {
@@ -76,34 +74,6 @@
     expect(PackageMapUriResolver.isPackageUri(uri), isFalse);
   }
 
-  void test_resolve_OK() {
-    const pkgFileA = '/pkgA/lib/libA.dart';
-    const pkgFileB = '/pkgB/lib/libB.dart';
-    provider.newFile(pkgFileA, 'library lib_a;');
-    provider.newFile(pkgFileB, 'library lib_b;');
-    PackageMapUriResolver resolver =
-        new PackageMapUriResolver(provider, <String, List<Folder>>{
-      'pkgA': [provider.getResource('/pkgA/lib/')],
-      'pkgB': [provider.getResource('/pkgB/lib/')]
-    });
-    {
-      Uri uri = Uri.parse('package:pkgA/libA.dart');
-      Source result = resolver.resolveAbsolute(uri);
-      expect(result, isNotNull);
-      expect(result.exists(), isTrue);
-      expect(result.uriKind, UriKind.PACKAGE_URI);
-      expect(result.fullName, pkgFileA);
-    }
-    {
-      Uri uri = Uri.parse('package:pkgB/libB.dart');
-      Source result = resolver.resolveAbsolute(uri);
-      expect(result, isNotNull);
-      expect(result.exists(), isTrue);
-      expect(result.uriKind, UriKind.PACKAGE_URI);
-      expect(result.fullName, pkgFileB);
-    }
-  }
-
   void test_resolve_multiple_folders() {
     const pkgFileA = '/part1/lib/libA.dart';
     const pkgFileB = '/part2/lib/libB.dart';
@@ -140,6 +110,34 @@
     expect(result, isNull);
   }
 
+  void test_resolve_OK() {
+    const pkgFileA = '/pkgA/lib/libA.dart';
+    const pkgFileB = '/pkgB/lib/libB.dart';
+    provider.newFile(pkgFileA, 'library lib_a;');
+    provider.newFile(pkgFileB, 'library lib_b;');
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
+      'pkgA': [provider.getResource('/pkgA/lib/')],
+      'pkgB': [provider.getResource('/pkgB/lib/')]
+    });
+    {
+      Uri uri = Uri.parse('package:pkgA/libA.dart');
+      Source result = resolver.resolveAbsolute(uri);
+      expect(result, isNotNull);
+      expect(result.exists(), isTrue);
+      expect(result.uriKind, UriKind.PACKAGE_URI);
+      expect(result.fullName, pkgFileA);
+    }
+    {
+      Uri uri = Uri.parse('package:pkgB/libB.dart');
+      Source result = resolver.resolveAbsolute(uri);
+      expect(result, isNotNull);
+      expect(result.exists(), isTrue);
+      expect(result.uriKind, UriKind.PACKAGE_URI);
+      expect(result.fullName, pkgFileB);
+    }
+  }
+
   void test_resolve_package_invalid_leadingSlash() {
     UriResolver resolver = new PackageMapUriResolver(provider, EMPTY_MAP);
     Uri uri = Uri.parse('package:/foo');
diff --git a/pkg/analyzer/test/source/test_all.dart b/pkg/analyzer/test/source/test_all.dart
index d5b4c54..0f6ef62 100644
--- a/pkg/analyzer/test/source/test_all.dart
+++ b/pkg/analyzer/test/source/test_all.dart
@@ -17,4 +17,4 @@
     package_map_provider_test.main();
     package_map_resolver_test.main();
   });
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/test/task/task_dart_test.dart b/pkg/analyzer/test/task/task_dart_test.dart
index 1d0da10..3d951be 100644
--- a/pkg/analyzer/test/task/task_dart_test.dart
+++ b/pkg/analyzer/test/task/task_dart_test.dart
@@ -22,13 +22,25 @@
 }
 
 class BuildUnitElementTaskTest extends EngineTestCase {
+  CompilationUnit parseUnit(InternalAnalysisContext context, Source source,
+      String content) {
+    ScanDartTask scanTask = new ScanDartTask(context, source, content);
+    scanTask.perform(new ScanDartTaskTestTV_accept());
+    ParseDartTask parseTask =
+        new ParseDartTask(context, source, scanTask.tokenStream, scanTask.lineInfo);
+    parseTask.perform(new ParseDartTaskTestTV_accept());
+    return parseTask.compilationUnit;
+  }
+
   void test_accept() {
-    BuildUnitElementTask task = new BuildUnitElementTask(null, null, null, null);
+    BuildUnitElementTask task =
+        new BuildUnitElementTask(null, null, null, null);
     expect(task.accept(new BuildUnitElementTaskTV_accept()), isTrue);
   }
 
   void test_getException() {
-    BuildUnitElementTask task = new BuildUnitElementTask(null, null, null, null);
+    BuildUnitElementTask task =
+        new BuildUnitElementTask(null, null, null, null);
     expect(task.exception, isNull);
   }
 
@@ -70,21 +82,6 @@
         new BuildUnitElementTask(context, source, source, unit);
     task.perform(new BuildUnitElementTaskTV_perform_valid(source, unit));
   }
-
-  CompilationUnit parseUnit(InternalAnalysisContext context, Source source, String content) {
-    ScanDartTask scanTask = new ScanDartTask(
-        context,
-        source,
-        content);
-    scanTask.perform(new ScanDartTaskTestTV_accept());
-    ParseDartTask parseTask = new ParseDartTask(
-        context,
-        source,
-        scanTask.tokenStream,
-        scanTask.lineInfo);
-    parseTask.perform(new ParseDartTaskTestTV_accept());
-    return parseTask.compilationUnit;
-  }
 }
 
 class BuildUnitElementTaskTV_accept extends TestTaskVisitor<bool> {
diff --git a/pkg/analyzer/test/utils.dart b/pkg/analyzer/test/utils.dart
index a3c36ac..df06283 100644
--- a/pkg/analyzer/test/utils.dart
+++ b/pkg/analyzer/test/utils.dart
@@ -25,8 +25,9 @@
       parseDartFile(path);
     } on AnalyzerErrorGroup catch (e) {
       return e.toString().replaceAllMapped(
-          new RegExp(r"^(Error on line \d+ of )((?:[A-Z]+:)?[^:]+): .*$",
-                     multiLine: true),
+          new RegExp(
+              r"^(Error on line \d+ of )((?:[A-Z]+:)?[^:]+): .*$",
+              multiLine: true),
           (match) => match[1] + pathos.basename(match[2]) + ': ...');
     }
     return null;
@@ -38,8 +39,7 @@
 ///
 /// Returns the return value of [fn].
 dynamic withTempDir(fn(String path)) {
-  var tempDir =
-      Directory.systemTemp.createTempSync('analyzer_').path;
+  var tempDir = Directory.systemTemp.createTempSync('analyzer_').path;
   try {
     return fn(tempDir);
   } finally {
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index c9326f2..a27b429 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -58,7 +58,7 @@
       // Visit the body directly to avoid processing the signature as

       // expressions.

       visit(node.body);

-      return irBuilder.buildFunctionDefinition(element, const []);

+      return irBuilder.buildFunctionDefinition(const []);

     });

   }

 

diff --git a/pkg/analyzer2dart/lib/src/modely.dart b/pkg/analyzer2dart/lib/src/modely.dart
index 1bd8947..69c5fc7 100644
--- a/pkg/analyzer2dart/lib/src/modely.dart
+++ b/pkg/analyzer2dart/lib/src/modely.dart
@@ -140,9 +140,6 @@
   bool get isFactoryConstructor => unsupported('isFactoryConstructor');
 
   @override
-  bool get isForwardingConstructor => unsupported('isForwardingConstructor');
-
-  @override
   bool get isInjected => unsupported('isInjected');
 
   @override
@@ -347,6 +344,11 @@
 
 abstract class FunctionElementMixin
     implements ElementY, dart2js.FunctionElement {
+
+  // TODO(johnniwinther): Ensure the correct semantics of this.
+  @override
+  bool get isExternal => false;
+
   @override
   get abstractField => unsupported('abstractField');
 
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 9b923bb..64bb66c 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -83,7 +83,9 @@
             enableExperimentalMirrors:
                 hasOption(options, '--enable-experimental-mirrors'),
             enableAsyncAwait: hasOption(options, '--enable-async'),
-            enableEnums: hasOption(options, '--enable-enum')) {
+            enableEnums: hasOption(options, '--enable-enum'),
+            allowNativeExtensions:
+                hasOption(options, '--allow-native-extensions')) {
     tasks.addAll([
         userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
         userProviderTask = new leg.GenericTask('Input provider', this),
@@ -94,9 +96,16 @@
     if (packageRoot != null && !packageRoot.path.endsWith("/")) {
       throw new ArgumentError("packageRoot must end with a /");
     }
-    if (enableAsyncAwait && !analyzeOnly) {
-      throw new ArgumentError(
-          "--enable-async is currently only supported with --analyze-only");
+    if (!analyzeOnly) {
+      if (enableAsyncAwait) {
+        throw new ArgumentError(
+            "--enable-async is currently only supported with --analyze-only");
+      }
+      if (allowNativeExtensions) {
+        throw new ArgumentError(
+            "--allow-native-extensions is only supported in combination with "
+            "--analyze-only");
+      }
     }
   }
 
@@ -199,12 +208,23 @@
     }
 
     Uri resourceUri = translateUri(node, readableUri);
+    String resourceUriString = resourceUri.toString();
+    if (resourceUri.scheme == 'dart-ext') {
+      if (!allowNativeExtensions) {
+        withCurrentElement(element, () {
+          reportError(node, leg.MessageKind.DART_EXT_NOT_SUPPORTED);
+        });
+      }
+      return new Future.value(new leg.Script(readableUri, resourceUri,
+          new StringSourceFile(resourceUriString,
+              "// Synthetic source file generated for '$readableUri'.")));
+    }
+
     // TODO(johnniwinther): Wrap the result from [provider] in a specialized
     // [Future] to ensure that we never execute an asynchronous action without
     // setting up the current element of the compiler.
     return new Future.sync(() => callUserProvider(resourceUri)).then((data) {
       SourceFile sourceFile;
-      String resourceUriString = resourceUri.toString();
       if (data is List<int>) {
         sourceFile = new Utf8BytesSourceFile(resourceUriString, data);
       } else if (data is String) {
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 7b04943..a104843 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -643,20 +643,14 @@
       FunctionElement target,
       {AstConstant compileArgument(Node node)}) {
     assert(invariant(node, target.isImplementation));
-    List<AstConstant> compiledArguments = <AstConstant>[];
 
     AstConstant compileDefaultValue(VariableElement element) {
       ConstantExpression constant = handler.compileConstant(element);
       return new AstConstant.fromDefaultValue(element, constant);
     }
     target.computeSignature(compiler);
-    bool succeeded = selector.addArgumentsToList(arguments,
-                                                 compiledArguments,
-                                                 target,
-                                                 compileArgument,
-                                                 compileDefaultValue,
-                                                 compiler.world);
-    if (!succeeded) {
+
+    if (!selector.applies(target, compiler.world)) {
       String name = Elements.constructorNameForDiagnostics(
           target.enclosingClass.name, target.name);
       compiler.reportFatalError(
@@ -664,7 +658,10 @@
           MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
           {'constructorName': name});
     }
-    return compiledArguments;
+    return selector.makeArgumentsList2(arguments,
+                                       target,
+                                       compileArgument,
+                                       compileDefaultValue);
   }
 
   AstConstant visitNewExpression(NewExpression node) {
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 74e408f..d298547 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -169,6 +169,10 @@
     world.registerStaticUse(element);
   }
 
+  void registerSuperInvocation(Element element) {
+    world.registerStaticUse(element);
+  }
+
   void registerInstantiation(InterfaceType type) {
     world.registerInstantiatedType(type, this);
   }
@@ -214,6 +218,12 @@
 
   bool get isForResolution;
 
+  void registerDynamicInvocation(Selector selector);
+
+  void registerDynamicGetter(Selector selector);
+
+  void registerDynamicSetter(Selector selector);
+
   void registerStaticInvocation(Element element);
 
   void registerInstantiation(InterfaceType type);
@@ -284,12 +294,17 @@
                                 Element annotatedElement,
                                 Registry registry) {}
 
-  /// Called during resolution to notify to the backend that a class is
-  /// being instantiated.
+  /// Called to notify to the backend that a class is being instantiated.
+  // TODO(johnniwinther): Remove this. It's only called once for each [cls] and
+  // only with [Compiler.globalDependencies] as [registry].
   void registerInstantiatedClass(ClassElement cls,
                                  Enqueuer enqueuer,
                                  Registry registry) {}
 
+  /// Called to notify to the backend that an interface type has been
+  /// instantiated.
+  void registerInstantiatedType(InterfaceType type, Registry registry) {}
+
   /// Register an is check to the backend.
   void registerIsCheckForCodegen(DartType type,
                                  Enqueuer enqueuer,
@@ -385,6 +400,10 @@
   /// backend has specialized handling for the element.
   bool isForeign(Element element) => false;
 
+  /// Processes [element] for resolution and returns the [FunctionElement] that
+  /// defines the implementation of [element].
+  FunctionElement resolveExternalFunction(FunctionElement element) => element;
+
   /// Returns `true` if [library] is a backend specific library whose members
   /// have special treatment, such as being allowed to extends blacklisted
   /// classes or member being eagerly resolved.
@@ -408,13 +427,6 @@
   /// This method is called immediately after the [library] and its parts have
   /// been scanned.
   Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
-    if (library.isPlatformLibrary && !library.isPatched) {
-      // Apply patch, if any.
-      Uri patchUri = compiler.resolvePatchUri(library.canonicalUri.path);
-      if (patchUri != null) {
-        return compiler.patchParser.patchLibrary(loader, patchUri, library);
-      }
-    }
     if (library.canUseNative) {
       library.forEachLocalMember((Element element) {
         if (element.isClass) {
@@ -730,6 +742,9 @@
   /// Incremental compilation is basically calling [run] more than once.
   final bool hasIncrementalSupport;
 
+  /// If `true` native extension syntax is supported by the frontend.
+  final bool allowNativeExtensions;
+
   api.CompilerOutputProvider outputProvider;
 
   bool disableInlining = false;
@@ -973,6 +988,7 @@
             this.enableExperimentalMirrors: false,
             this.enableAsyncAwait: false,
             this.enableEnums: false,
+            this.allowNativeExtensions: false,
             api.CompilerOutputProvider outputProvider,
             List<String> strips: const []})
       : this.disableTypeInferenceFlag =
@@ -1433,6 +1449,14 @@
     });
   }
 
+  bool irEnabled() {
+    // TODO(sigurdm,kmillikin): Support checked-mode checks.
+    return const bool.fromEnvironment('USE_NEW_BACKEND') &&
+        backend is DartBackend &&
+        !enableTypeAssertions &&
+        !enableConcreteTypeInference;
+  }
+
   void computeMain() {
     if (mainApp == null) return;
 
@@ -1555,8 +1579,10 @@
 
     deferredLoadTask.onResolutionComplete(mainFunction);
 
-    log('Building IR...');
-    irBuilder.buildNodes();
+    if (irEnabled()) {
+      log('Building IR...');
+      irBuilder.buildNodes();
+    }
 
     log('Inferring types...');
     typesTask.onResolutionComplete(mainFunction);
@@ -1967,6 +1993,7 @@
 
   void reportUnusedCode() {
     void checkLive(member) {
+      if (member.isErroneous) return;
       if (member.isFunction) {
         if (!enqueuer.resolution.hasBeenResolved(member)) {
           reportHint(member, MessageKind.UNUSED_METHOD,
diff --git a/pkg/compiler/lib/src/cps_ir/constant_propagation.dart b/pkg/compiler/lib/src/cps_ir/constant_propagation.dart
index fc9ebba..a6da66b 100644
--- a/pkg/compiler/lib/src/cps_ir/constant_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/constant_propagation.dart
@@ -12,7 +12,7 @@
  * Implemented according to 'Constant Propagation with Conditional Branches'
  * by Wegman, Zadeck.
  */
-class ConstantPropagator implements Pass {
+class ConstantPropagator extends Pass {
 
   // Required for type determination in analysis of TypeOperator expressions.
   final dart2js.Compiler _compiler;
@@ -23,12 +23,9 @@
 
   ConstantPropagator(this._compiler, this._constantSystem);
 
-  void rewrite(FunctionDefinition root) {
-    if (root.isAbstract) return;
-
+  void _rewriteExecutableDefinition(ExecutableDefinition root) {
     // Set all parent pointers.
-
-    new _ParentVisitor().visit(root);
+    new ParentVisitor().visit(root);
 
     // Analyze. In this phase, the entire term is analyzed for reachability
     // and the constant status of each expression.
@@ -45,6 +42,16 @@
         analyzer.reachableNodes, analyzer.node2value);
     transformer.transform(root);
   }
+
+  void rewriteFunctionDefinition(FunctionDefinition root) {
+    if (root.isAbstract) return;
+    _rewriteExecutableDefinition(root);
+  }
+
+  void rewriteFieldDefinition(FieldDefinition root) {
+    _rewriteExecutableDefinition(root);
+  }
+
 }
 
 /**
@@ -58,8 +65,8 @@
 
   _TransformingVisitor(this.reachable, this.node2value);
 
-  void transform(FunctionDefinition root) {
-    visitFunctionDefinition(root);
+  void transform(ExecutableDefinition root) {
+    visit(root);
   }
 
   /// Given an expression with a known constant result and a continuation,
@@ -226,7 +233,7 @@
 
   _ConstPropagationVisitor(this.compiler, this.constantSystem);
 
-  void analyze(FunctionDefinition root) {
+  void analyze(ExecutableDefinition root) {
     reachableNodes.clear();
     defWorkset.clear();
     nodeWorklist.clear();
@@ -304,6 +311,10 @@
     setReachable(node.body);
   }
 
+  void visitFieldDefinition(FieldDefinition node) {
+    setReachable(node.body);
+  }
+
   // Expressions.
 
   void visitLetPrim(LetPrim node) {
@@ -603,6 +614,28 @@
     Branch branch = node.parent;
     visitBranch(branch);
   }
+
+  // JavaScript specific nodes.
+
+  void visitIdentical(Identical node) {
+    _ConstnessLattice leftConst = getValue(node.left.definition);
+    _ConstnessLattice rightConst = getValue(node.left.definition);
+    ConstantValue leftValue = leftConst.constant;
+    ConstantValue rightValue = rightConst.constant;
+    if (leftConst.isUnknown || rightConst.isUnknown) {
+      // Come back later.
+      return;
+    } else if (!leftConst.isConstant || !rightConst.isConstant) {
+      setValue(node, _ConstnessLattice.NonConst);
+    } else if (leftValue.isPrimitive && rightValue.isPrimitive) {
+      assert(leftConst.isConstant && rightConst.isConstant);
+      PrimitiveConstantValue left = leftValue;
+      PrimitiveConstantValue right = rightValue;
+      ConstantValue result =
+          new BoolConstantValue(left.primitiveValue == right.primitiveValue);
+      setValue(node, new _ConstnessLattice(result));
+    }
+  }
 }
 
 /// Represents the constant-state of a variable at some point in the program.
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 538bddf..d5bad5d 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -191,12 +191,12 @@
 
   final Iterable<Entity> closureLocals;
 
-  final FunctionElement currentFunction;
+  final ExecutableElement currentElement;
 
   final ir.Continuation returnContinuation = new ir.Continuation.retrn();
 
   IrBuilderSharedState(this.constantSystem,
-                       this.currentFunction,
+                       this.currentElement,
                        this.closureLocals);
 }
 
@@ -240,10 +240,10 @@
   ir.Expression _current = null;
 
   IrBuilder(ConstantSystem constantSystem,
-            FunctionElement currentFunction,
+            ExecutableElement currentElement,
             Iterable<Entity> closureLocals)
       : this.state = new IrBuilderSharedState(
-            constantSystem, currentFunction, closureLocals),
+            constantSystem, currentElement, closureLocals),
         this.environment = new Environment.empty();
 
   /// Construct a delimited visitor for visiting a subtree.
@@ -533,19 +533,22 @@
     _current = null;
   }
 
+  /// Create a [ir.FieldDefinition] for the current [Element] using [_root] as
+  /// the body.
+  ir.FieldDefinition makeFieldDefinition() {
+    return new ir.FieldDefinition(state.currentElement,
+                                  state.returnContinuation,
+                                  _root);
+  }
+
   /// Create a [ir.FunctionDefinition] for [element] using [_root] as the body.
   ///
   /// Parameters must be created before the construction of the body using
   /// [createParameter].
   ir.FunctionDefinition buildFunctionDefinition(
-      FunctionElement element,
       List<ConstantExpression> defaults) {
-    if (!element.isAbstract) {
-      _ensureReturn();
-      return new ir.FunctionDefinition(
-          element, state.returnContinuation, _parameters, _root,
-          state.localConstants, defaults);
-    } else {
+    FunctionElement element = state.currentElement;
+    if (element.isAbstract || element.isExternal) {
       assert(invariant(element, _root == null,
           message: "Non-empty body for abstract method $element: $_root"));
       assert(invariant(element, state.localConstants.isEmpty,
@@ -553,6 +556,11 @@
                    "${state.localConstants}"));
       return new ir.FunctionDefinition.abstract(
                 element, _parameters, defaults);
+    } else {
+      _ensureReturn();
+      return new ir.FunctionDefinition(
+          element, state.returnContinuation, _parameters, _root,
+          state.localConstants, defaults);
     }
   }
 
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
index b7ac48e..c6f8d16 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
@@ -22,8 +22,8 @@
  * re-implemented to work directly on the IR.
  */
 class IrBuilderTask extends CompilerTask {
-  final Map<Element, ir.FunctionDefinition> nodes =
-      <Element, ir.FunctionDefinition>{};
+  final Map<Element, ir.ExecutableDefinition> nodes =
+      <Element, ir.ExecutableDefinition>{};
 
   IrBuilderTask(Compiler compiler) : super(compiler);
 
@@ -31,55 +31,47 @@
 
   bool hasIr(Element element) => nodes.containsKey(element.implementation);
 
-  ir.FunctionDefinition getIr(Element element) => nodes[element.implementation];
+  ir.ExecutableDefinition getIr(ExecutableElement element) {
+    return nodes[element.implementation];
+  }
 
-  void buildNodes({bool useNewBackend: false}) {
-    if (!irEnabled(useNewBackend: useNewBackend)) return;
+  ir.ExecutableDefinition buildNode(AstElement element) {
+    if (!canBuild(element)) return null;
+    TreeElements elementsMapping = element.resolvedAst.elements;
+    element = element.implementation;
+    return compiler.withCurrentElement(element, () {
+      SourceFile sourceFile = elementSourceFile(element);
+      IrBuilderVisitor builder =
+          new IrBuilderVisitor(elementsMapping, compiler, sourceFile);
+      return builder.buildExecutable(element);
+    });
+  }
+
+  void buildNodes() {
     measure(() {
       Set<Element> resolved = compiler.enqueuer.resolution.resolvedElements;
       resolved.forEach((AstElement element) {
-        if (canBuild(element)) {
-          TreeElements elementsMapping = element.resolvedAst.elements;
-          element = element.implementation;
-          compiler.withCurrentElement(element, () {
-            SourceFile sourceFile = elementSourceFile(element);
-            IrBuilderVisitor builder =
-                new IrBuilderVisitor(elementsMapping, compiler, sourceFile);
-            ir.FunctionDefinition function;
-            function = builder.buildFunction(element);
-
-            if (function != null) {
-              nodes[element] = function;
-              compiler.tracer.traceCompilation(element.name, null);
-              compiler.tracer.traceGraph("IR Builder", function);
-            }
-          });
+        ir.ExecutableDefinition definition = buildNode(element);
+        if (definition != null) {
+          nodes[element] = definition;
         }
       });
     });
   }
 
-  bool irEnabled({bool useNewBackend: false}) {
-    // TODO(sigurdm,kmillikin): Support checked-mode checks.
-    return (useNewBackend || const bool.fromEnvironment('USE_NEW_BACKEND')) &&
-        compiler.backend is DartBackend &&
-        !compiler.enableTypeAssertions &&
-        !compiler.enableConcreteTypeInference;
-  }
-
   bool canBuild(Element element) {
-    FunctionElement function = element.asFunctionElement();
-    // TODO(kmillikin,sigurdm): support lazy field initializers.
-    if (function == null) return false;
+    if (element is TypedefElement) return false;
+    if (element is FunctionElement) {
+      // TODO(sigurdm): Support native functions for dart2js.
+      assert(invariant(element, !element.isNative));
 
-    if (!compiler.backend.shouldOutput(function)) return false;
+      // TODO(kmillikin,sigurdm): Support constructors.
+      if (element is ConstructorElement) return false;
 
-    assert(invariant(element, !function.isNative));
-
-    // TODO(kmillikin,sigurdm): Support constructors.
-    if (function is ConstructorElement) return false;
-
-    return true;
+    } else if (element is! FieldElement) {
+      compiler.internalError(element, "Unexpected elementtype $element");
+    }
+    return compiler.backend.shouldOutput(element);
   }
 
   bool get inCheckedMode {
@@ -138,19 +130,57 @@
       : super(elements);
 
   /**
-   * Builds the [ir.FunctionDefinition] for a function element. In case the
-   * function uses features that cannot be expressed in the IR, this function
+   * Builds the [ir.ExecutableDefinition] for an executable element. In case the
+   * function uses features that cannot be expressed in the IR, this element
    * returns `null`.
    */
-  ir.FunctionDefinition buildFunction(FunctionElement functionElement) {
-    return nullIfGiveup(() => buildFunctionInternal(functionElement));
+  ir.ExecutableDefinition buildExecutable(ExecutableElement element) {
+    return nullIfGiveup(() {
+      if (element is FieldElement) {
+        return buildField(element);
+      } else if (element is FunctionElement) {
+        return buildFunction(element);
+      } else {
+        compiler.internalError(element, "Unexpected element type $element");
+      }
+    });
   }
 
-  ir.FunctionDefinition buildFunctionInternal(FunctionElement element) {
+  /// Returns a [ir.FieldDefinition] describing the initializer of [element].
+  /// Returns `null` if [element] has no initializer.
+  ir.FieldDefinition buildField(FieldElement element) {
+    assert(invariant(element, element.isImplementation));
+    ast.VariableDefinitions definitions = element.node;
+    ast.Node fieldDefinition =
+        definitions.definitions.nodes.first;
+    if (definitions.modifiers.isConst) {
+      // TODO(sigurdm): Just return const value.
+    }
+    assert(fieldDefinition != null);
+    assert(elements[fieldDefinition] != null);
+    // This means there is no initializer.
+    // TODO(sigurdm): Avoid ever getting here. Abstract functions and fields
+    // with no initializer should not have a representation in the IR.
+    if (fieldDefinition is! ast.SendSet) return null;
+    DetectClosureVariables closureLocals =
+    new DetectClosureVariables(elements);
+        closureLocals.visit(fieldDefinition);
+
+    IrBuilder builder = new IrBuilder(compiler.backend.constantSystem,
+        element,
+        closureLocals.usedFromClosure);
+    return withBuilder(builder, () {
+      ast.SendSet sendSet = fieldDefinition;
+      ir.Primitive result = visit(sendSet.arguments.first);
+      builder.buildReturn(result);
+      return builder.makeFieldDefinition();
+    });
+  }
+
+  ir.FunctionDefinition buildFunction(FunctionElement element) {
     assert(invariant(element, element.isImplementation));
     ast.FunctionExpression function = element.node;
     assert(function != null);
-    assert(!function.modifiers.isExternal);
     assert(elements[function] != null);
 
     DetectClosureVariables closureLocals = new DetectClosureVariables(elements);
@@ -171,7 +201,7 @@
       });
 
       visit(function.body);
-      return irBuilder.buildFunctionDefinition(element, defaults);
+      return irBuilder.buildFunctionDefinition(defaults);
     });
   }
 
@@ -816,7 +846,7 @@
   }
 
   ir.FunctionDefinition makeSubFunction(ast.FunctionExpression node) {
-    return buildFunctionInternal(elements[node]);
+    return buildFunction(elements[node]);
   }
 
   ir.Primitive visitFunctionExpression(ast.FunctionExpression node) {
@@ -835,7 +865,7 @@
     throw ABORT_IRNODE_BUILDER;
   }
 
-  ir.FunctionDefinition nullIfGiveup(ir.FunctionDefinition action()) {
+  ir.ExecutableDefinition nullIfGiveup(ir.ExecutableDefinition action()) {
     try {
       return action();
     } catch(e, tr) {
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 9ad19f0..a4e07f7 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -12,11 +12,9 @@
 import '../elements/elements.dart';
 import '../universe/universe.dart' show Selector, SelectorKind;
 import '../dart_types.dart' show DartType, GenericType;
+import '../cps_ir/optimizers.dart';
 
 abstract class Node {
-  static int hashCount = 0;
-  final int hashCode = hashCount = (hashCount + 1) & 0x3fffffff;
-
   /// A pointer to the parent node. Is null until set by optimization passes.
   Node parent;
 
@@ -112,9 +110,9 @@
 /// represent one-level context 'let val x = V in []'.
 class LetPrim extends Expression implements InteriorNode {
   final Primitive primitive;
-  Expression body = null;
+  Expression body;
 
-  LetPrim(this.primitive);
+  LetPrim(this.primitive, [this.body = null]);
 
   Expression plug(Expression expr) {
     assert(body == null);
@@ -451,6 +449,15 @@
   accept(Visitor visitor) => visitor.visitBranch(this);
 }
 
+class Identical extends Primitive {
+  final Reference<Primitive> left;
+  final Reference<Primitive> right;
+  Identical(Primitive left, Primitive right)
+      : left = new Reference<Primitive>(left),
+        right = new Reference<Primitive>(right);
+  accept(Visitor visitor) => visitor.visitIdentical(this);
+}
+
 class Constant extends Primitive {
   final ConstantExpression expression;
 
@@ -544,9 +551,30 @@
   accept(Visitor visitor) => visitor.visitContinuation(this);
 }
 
+abstract class ExecutableDefinition implements Node {
+  Expression get body;
+
+  applyPass(Pass pass);
+}
+
+// This is basically a function definition with an empty parameter list and a
+// field element instead of a function element and no const declarations, and
+// never a getter or setter, though that's less important.
+class FieldDefinition extends Node
+    implements InteriorNode, ExecutableDefinition {
+  final FieldElement element;
+  final Continuation returnContinuation;
+  Expression body;
+
+  FieldDefinition(this.element, this.returnContinuation, this.body);
+  accept(Visitor visitor) => visitor.visitFieldDefinition(this);
+  applyPass(Pass pass) => pass.rewriteFieldDefinition(this);
+}
+
 /// A function definition, consisting of parameters and a body.  The parameters
 /// include a distinguished continuation parameter.
-class FunctionDefinition extends Node implements InteriorNode {
+class FunctionDefinition extends Node
+    implements InteriorNode, ExecutableDefinition {
   final FunctionElement element;
   final Continuation returnContinuation;
   final List<Parameter> parameters;
@@ -567,8 +595,9 @@
         this.localConstants = const <ConstDeclaration>[];
 
   accept(Visitor visitor) => visitor.visitFunctionDefinition(this);
+  applyPass(Pass pass) => pass.rewriteFunctionDefinition(this);
 
-  /// Returns `true` if this function is abstract.
+  /// Returns `true` if this function is abstract or external.
   ///
   /// If `true`, [body] and [returnContinuation] are `null` and [localConstants]
   /// is empty.
@@ -580,6 +609,8 @@
 }
 
 abstract class Visitor<T> {
+  const Visitor();
+
   T visit(Node node) => node.accept(this);
   // Abstract classes.
   T visitNode(Node node) => null;
@@ -589,6 +620,7 @@
   T visitCondition(Condition node) => visitNode(node);
 
   // Concrete classes.
+  T visitFieldDefinition(FieldDefinition node) => visitNode(node);
   T visitFunctionDefinition(FunctionDefinition node) => visitNode(node);
 
   // Expressions.
@@ -618,11 +650,16 @@
 
   // Conditions.
   T visitIsTrue(IsTrue node) => visitCondition(node);
+
+  // JavaScript specific nodes.
+  T visitIdentical(Identical node) => visitPrimitive(node);
 }
 
 /// Recursively visits the entire CPS term, and calls abstract `process*`
 /// (i.e. `processLetPrim`) functions in pre-order.
 abstract class RecursiveVisitor extends Visitor {
+  const RecursiveVisitor();
+
   // Ensures that RecursiveVisitor contains overrides for all relevant nodes.
   // As a rule of thumb, nodes with structure to traverse should be overridden
   // with the appropriate visits in this class (for example, visitLetCont),
@@ -633,6 +670,12 @@
 
   processReference(Reference ref) {}
 
+  processFieldDefinition(FieldDefinition node) {}
+  visitFieldDefinition(FieldDefinition node) {
+    processFieldDefinition(node);
+    visit(node.body);
+  }
+
   processFunctionDefinition(FunctionDefinition node) {}
   visitFunctionDefinition(FunctionDefinition node) {
     processFunctionDefinition(node);
@@ -699,7 +742,6 @@
     node.arguments.forEach(processReference);
   }
 
-
   processBranch(Branch node) {}
   visitBranch(Branch node) {
     processBranch(node);
@@ -782,6 +824,14 @@
     processIsTrue(node);
     processReference(node.value);
   }
+
+  // JavaScript specific nodes.
+  processIdentical(Identical node) {}
+  visitIdentical(Identical node) {
+    processIdentical(node);
+    processReference(node.left);
+    processReference(node.right);
+  }
 }
 
 /// Keeps track of currently unused register indices.
@@ -842,12 +892,15 @@
     allocate(reference.definition);
   }
 
+  void visitFieldDefinition(FieldDefinition node) {
+    visit(node.body);
+  }
+
   void visitFunctionDefinition(FunctionDefinition node) {
     if (!node.isAbstract) {
       visit(node.body);
     }
     node.parameters.forEach(allocate); // Assign indices to unused parameters.
-    elementRegisters.clear();
   }
 
   void visitLetPrim(LetPrim node) {
@@ -950,5 +1003,11 @@
     visitReference(node.value);
   }
 
+  // JavaScript specific nodes.
+
+  void visitIdentical(Identical node) {
+    visitReference(node.left);
+    visitReference(node.right);
+  }
 }
 
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index c4621cb..121cccc 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -7,49 +7,65 @@
 import '../util/util.dart';
 import 'cps_ir_nodes.dart';
 
+/// A [Decorator] is a function used by [SExpressionStringifier] to augment the
+/// output produced for a node.  It can be provided to the constructor.
+typedef String Decorator(Node node, String s);
+
 /// Generate a Lisp-like S-expression representation of an IR node as a string.
 class SExpressionStringifier extends Visitor<String> with Indentation {
-  final Map<Definition, String> names = <Definition, String>{};
+  final _Namer namer = new _Namer();
 
-  int _valueCounter = 0;
-  int _continuationCounter = 0;
+  String newValueName(Node node) => namer.defineValueName(node);
+  String newContinuationName(Node node) => namer.defineContinuationName(node);
+  final Decorator decorator;
 
-  String newValueName() => 'v${_valueCounter++}';
-  String newContinuationName() => 'k${_continuationCounter++}';
+  SExpressionStringifier([this.decorator]);
+
+  String access(Reference<Definition> r) => namer.getName(r.definition);
+
+  String visitParameter(Parameter node) {
+    return namer.useElementName(node);
+  }
+
+  /// Main entry point for creating a [String] from a [Node].  All recursive
+  /// calls must go through this method.
+  String visit(Node node) {
+    String s = super.visit(node);
+    return (decorator == null) ? s : decorator(node, s);
+  }
 
   String visitFunctionDefinition(FunctionDefinition node) {
     String name = node.element.name;
-    names[node.returnContinuation] = 'return';
-    String parameters = node.parameters
-        .map((Parameter p) {
-          String name = p.hint.name;
-          names[p] = name;
-          return name;
-        })
-        .join(' ');
+    namer.useReturnName(node.returnContinuation);
+    String parameters = node.parameters.map(visit).join(' ');
     String body = indentBlock(() => visit(node.body));
     return '$indentation(FunctionDefinition $name ($parameters return)\n'
            '$body)';
   }
 
+  String visitFieldDefinition(FieldDefinition node) {
+    String name = node.element.name;
+    namer.useReturnName(node.returnContinuation);
+    String body = indentBlock(() => visit(node.body));
+    return '$indentation(FieldDefinition $name (return)\n'
+           '$body)';
+  }
+
   String visitLetPrim(LetPrim node) {
-    String name = newValueName();
-    names[node.primitive] = name;
+    String name = newValueName(node.primitive);
     String value = visit(node.primitive);
     String body = visit(node.body);
     return '$indentation(LetPrim $name $value)\n$body';
   }
 
   String visitLetCont(LetCont node) {
-    String cont = newContinuationName();
-    names[node.continuation] = cont;
+    String cont = newContinuationName(node.continuation);
+    // TODO(karlklose): this should be changed to `.map(visit).join(' ')`  and
+    // should recurse to [visit].  Currently we can't do that, because the
+    // unstringifier_test produces [LetConts] with dummy arguments on them.
     String parameters = node.continuation.parameters
-        .map((Parameter p) {
-          String name = newValueName();
-          names[p] = name;
-          return ' $name';
-        })
-       .join('');
+        .map((p) => ' ${newValueName(p)}')
+        .join('');
     String contBody = indentBlock(() => visit(node.continuation.body));
     String body = visit(node.body);
     String op = node.continuation.isRecursive ? 'LetCont*' : 'LetCont';
@@ -61,8 +77,8 @@
   String formatArguments(Invoke node) {
     int positionalArgumentCount = node.selector.positionalArgumentCount;
     List<String> args = new List<String>();
-    args.addAll(node.arguments.getRange(0, positionalArgumentCount)
-        .map((v) => names[v.definition]));
+    args.addAll(
+        node.arguments.getRange(0, positionalArgumentCount).map(access));
     for (int i = 0; i < node.selector.namedArgumentCount; ++i) {
       String name = node.selector.namedArguments[i];
       Definition arg = node.arguments[positionalArgumentCount + i].definition;
@@ -73,22 +89,22 @@
 
   String visitInvokeStatic(InvokeStatic node) {
     String name = node.target.name;
-    String cont = names[node.continuation.definition];
+    String cont = access(node.continuation);
     String args = formatArguments(node);
     return '$indentation(InvokeStatic $name $args $cont)';
   }
 
   String visitInvokeMethod(InvokeMethod node) {
     String name = node.selector.name;
-    String rcv = names[node.receiver.definition];
-    String cont = names[node.continuation.definition];
+    String rcv = access(node.receiver);
+    String cont = access(node.continuation);
     String args = formatArguments(node);
     return '$indentation(InvokeMethod $rcv $name $args $cont)';
   }
 
   String visitInvokeSuperMethod(InvokeSuperMethod node) {
     String name = node.selector.name;
-    String cont = names[node.continuation.definition];
+    String cont = access(node.continuation);
     String args = formatArguments(node);
     return '$indentation(InvokeSuperMethod $name $args $cont)';
   }
@@ -100,20 +116,20 @@
     } else {
       callName = '${node.type}.${node.target.name}';
     }
-    String cont = names[node.continuation.definition];
+    String cont = access(node.continuation);
     String args = formatArguments(node);
     return '$indentation(InvokeConstructor $callName $args $cont)';
   }
 
   String visitConcatenateStrings(ConcatenateStrings node) {
-    String cont = names[node.continuation.definition];
-    String args = node.arguments.map((v) => names[v.definition]).join(' ');
+    String cont = access(node.continuation);
+    String args = node.arguments.map(access).join(' ');
     return '$indentation(ConcatenateStrings $args $cont)';
   }
 
   String visitInvokeContinuation(InvokeContinuation node) {
-    String cont = names[node.continuation.definition];
-    String args = node.arguments.map((v) => names[v.definition]).join(' ');
+    String cont = access(node.continuation);
+    String args = node.arguments.map(access).join(' ');
     String op =
         node.isRecursive ? 'InvokeContinuation*' : 'InvokeContinuation';
     return '$indentation($op $cont $args)';
@@ -121,8 +137,8 @@
 
   String visitBranch(Branch node) {
     String condition = visit(node.condition);
-    String trueCont = names[node.trueContinuation.definition];
-    String falseCont = names[node.falseContinuation.definition];
+    String trueCont = access(node.trueContinuation);
+    String falseCont = access(node.falseContinuation);
     return '$indentation(Branch $condition $trueCont $falseCont)';
   }
 
@@ -143,11 +159,6 @@
     return '(CreateFunction\n$function)';
   }
 
-  String visitParameter(Parameter node) {
-    // Parameters are visited directly in visitLetCont.
-    return '(Unexpected Parameter)';
-  }
-
   String visitContinuation(Continuation node) {
     // Continuations are visited directly in visitLetCont.
     return '(Unexpected Continuation)';
@@ -158,28 +169,27 @@
   }
 
   String visitSetClosureVariable(SetClosureVariable node) {
-    String value = names[node.value.definition];
+    String value = access(node.value);
     String body = indentBlock(() => visit(node.body));
     return '$indentation(SetClosureVariable ${node.variable.name} $value\n'
            '$body)';
   }
 
   String visitTypeOperator(TypeOperator node) {
-    String receiver = names[node.receiver.definition];
-    String cont = names[node.continuation.definition];
+    String receiver = access(node.receiver);
+    String cont = access(node.continuation);
     String operator = node.isTypeTest ? 'is' : 'as';
     return '$indentation(TypeOperator $operator $receiver ${node.type} $cont)';
   }
 
   String visitLiteralList(LiteralList node) {
-    String values = node.values.map((v) => names[v.definition]).join(' ');
+    String values = node.values.map(access).join(' ');
     return '(LiteralList ($values))';
   }
 
   String visitLiteralMap(LiteralMap node) {
-    String keys = node.entries.map((e) => names[e.key.definition]).join(' ');
-    String values =
-        node.entries.map((e) => names[e.value.definition]).join(' ');
+    String keys = node.entries.map((e) => access(e.key)).join(' ');
+    String values = node.entries.map((e) => access(e.value)).join(' ');
     return '(LiteralMap ($keys) ($values))';
   }
 
@@ -192,7 +202,44 @@
   }
 
   String visitIsTrue(IsTrue node) {
-    String value = names[node.value.definition];
+    String value = access(node.value);
     return '(IsTrue $value)';
   }
+
+  String visitIdentical(Identical node) {
+    String left = access(node.left);
+    String right = access(node.right);
+    return '(Identical $left $right)';
+  }
+}
+
+class _Namer {
+  final Map<Node, String> _names = <Node, String>{};
+  int _valueCounter = 0;
+  int _continuationCounter = 0;
+
+  String useElementName(Parameter parameter) {
+    assert(!_names.containsKey(parameter));
+    return _names[parameter] = parameter.hint.name;
+  }
+
+  String defineContinuationName(Node node) {
+    assert(!_names.containsKey(node));
+    return _names[node] = 'k${_continuationCounter++}';
+  }
+
+  String defineValueName(Node node) {
+    assert(!_names.containsKey(node));
+    return _names[node] = 'v${_valueCounter++}';
+  }
+
+  String useReturnName(Continuation node) {
+    assert(!_names.containsKey(node) || _names[node] == 'return');
+    return _names[node] = 'return';
+  }
+
+  String getName(Node node) {
+    assert(_names.containsKey(node));
+    return _names[node];
+  }
 }
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
index cf21ad4..5a6431a 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -21,20 +21,20 @@
 
   visit(cps_ir.Node node) => node.accept(this);
 
-  void traceGraph(String name, cps_ir.FunctionDefinition graph) {
+  void traceGraph(String name, cps_ir.ExecutableDefinition graph) {
     tag("cfg", () {
       printProperty("name", name);
-      visitFunctionDefinition(graph);
+      visit(graph);
     });
   }
 
   // Temporary field used during tree walk
   Names names;
 
-  visitFunctionDefinition(cps_ir.FunctionDefinition f) {
+  visitExecutableDefinition(cps_ir.ExecutableDefinition node) {
     names = new Names();
     BlockCollector builder = new BlockCollector(names);
-    builder.visit(f);
+    builder.visit(node);
 
     printNode(builder.entry);
     for (Block block in builder.cont2block.values) {
@@ -43,6 +43,14 @@
     names = null;
   }
 
+  visitFieldDefinition(cps_ir.FieldDefinition node) {
+    visitExecutableDefinition(node);
+  }
+
+  visitFunctionDefinition(cps_ir.FunctionDefinition node) {
+    visitExecutableDefinition(node);
+  }
+
   int countUses(cps_ir.Definition definition) {
     int count = 0;
     cps_ir.Reference ref = definition.firstRef;
@@ -229,6 +237,12 @@
     return "IsTrue(${names.name(node.value.definition)})";
   }
 
+  visitIdentical(cps_ir.Identical node) {
+    String left = formatReference(node.left);
+    String right = formatReference(node.right);
+    return "Identical($left, $right)";
+  }
+
   visitThis(cps_ir.This node) {
     return "This";
   }
@@ -323,9 +337,17 @@
     return block;
   }
 
-  visitFunctionDefinition(cps_ir.FunctionDefinition f) {
-    entry = current_block = new Block(names.name(f), [], f.body);
-    visit(f.body);
+  visitExecutableDefinition(cps_ir.ExecutableDefinition node) {
+    entry = current_block = new Block(names.name(node), [], node.body);
+    visit(node.body);
+  }
+
+  visitFieldDefinition(cps_ir.FieldDefinition node) {
+    visitExecutableDefinition(node);
+  }
+
+  visitFunctionDefinition(cps_ir.FunctionDefinition node) {
+    visitExecutableDefinition(node);
   }
 
   visitLetPrim(cps_ir.LetPrim exp) {
diff --git a/pkg/compiler/lib/src/cps_ir/optimizers.dart b/pkg/compiler/lib/src/cps_ir/optimizers.dart
index c64650f..81f80bb 100644
--- a/pkg/compiler/lib/src/cps_ir/optimizers.dart
+++ b/pkg/compiler/lib/src/cps_ir/optimizers.dart
@@ -21,5 +21,11 @@
 /// An optimization pass over the CPS IR.
 abstract class Pass {
   /// Applies optimizations to root, rewriting it in the process.
-  void rewrite(FunctionDefinition root);
+  void rewrite(ExecutableDefinition root) => root.applyPass(this);
+  void rewriteFunctionDefinition(FunctionDefinition root) {
+    return root.applyPass(this);
+  }
+  void rewriteFieldDefinition(FieldDefinition root) {
+    return root.applyPass(this);
+  }
 }
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
index 11c6bf0..25f4cef 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
@@ -15,11 +15,21 @@
 class RedundantPhiEliminator extends RecursiveVisitor implements Pass {
   final Set<Continuation> workSet = new Set<Continuation>();
 
-  void rewrite(final FunctionDefinition root) {
+  void rewrite(final ExecutableDefinition root) => root.applyPass(this);
+
+  void rewriteFunctionDefinition(final FunctionDefinition root) {
     if (root.isAbstract) return;
+    rewriteExecutableDefinition(root);
+  }
+
+  void rewriteFieldDefinition(final FieldDefinition root) {
+    rewriteExecutableDefinition(root);
+  }
+
+  void rewriteExecutableDefinition(final ExecutableDefinition root) {
 
     // Set all parent pointers.
-    new _ParentVisitor().visit(root);
+    new ParentVisitor().visit(root);
 
     // Traverse the tree once to build the work set.
     visit(root);
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index f14ece5..46b6437 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -8,24 +8,21 @@
  * [[ShrinkingReducer]] applies shrinking reductions to CPS terms as described
  * in 'Compiling with Continuations, Continued' by Andrew Kennedy.
  */
-class ShrinkingReducer implements Pass {
+class ShrinkingReducer extends Pass {
   _RedexVisitor _redexVisitor;
   Set<_ReductionTask> _worklist;
 
   static final _DeletedNode _DELETED = new _DeletedNode();
 
-  /// Applies shrinking reductions to root, mutating root in the process.
-  void rewrite(FunctionDefinition root) {
-    if (root.isAbstract) return;
-
+  void rewriteExecutableDefinition(ExecutableDefinition root) {
     _worklist = new Set<_ReductionTask>();
     _redexVisitor = new _RedexVisitor(_worklist);
 
     // Set all parent pointers.
-    new _ParentVisitor().visit(root);
+    new ParentVisitor().visit(root);
 
     // Sweep over the term, collecting redexes into the worklist.
-    _redexVisitor.visitFunctionDefinition(root);
+    _redexVisitor.visit(root);
 
     // Process the worklist.
     while (_worklist.isNotEmpty) {
@@ -35,6 +32,17 @@
     }
   }
 
+  /// Applies shrinking reductions to root, mutating root in the process.
+  void rewriteFieldDefinition(FieldDefinition root) {
+    rewriteExecutableDefinition(root);
+  }
+
+  /// Applies shrinking reductions to root, mutating root in the process.
+  void rewriteFunctionDefinition(FunctionDefinition root) {
+    if (root.isAbstract) return;
+    rewriteExecutableDefinition(root);
+  }
+
   /// Removes the given node from the CPS graph, replacing it with its body
   /// and marking it as deleted. The node's parent must be a [[InteriorNode]].
   void _removeNode(InteriorNode node) {
@@ -293,7 +301,11 @@
 }
 
 /// Traverses the CPS term and sets node.parent for each visited node.
-class _ParentVisitor extends RecursiveVisitor {
+class ParentVisitor extends RecursiveVisitor {
+
+  processFieldDefinition(FieldDefinition node) {
+    node.body.parent = node;
+  }
 
   processFunctionDefinition(FunctionDefinition node) {
     node.body.parent = node;
@@ -391,6 +403,13 @@
   processIsTrue(IsTrue node) {
     node.value.parent = node;
   }
+
+  // JavaScript specific nodes.
+
+  processIdentical(Identical node) {
+    node.left.parent = node;
+    node.right.parent = node;
+  }
 }
 
 class _ReductionKind {
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 324e33a..0372b85 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -115,6 +115,7 @@
   bool analyzeOnly = false;
   bool analyzeAll = false;
   bool enableAsyncAwait = false;
+  bool allowNativeExtensions = false;
   bool trustTypeAnnotations = false;
   bool trustPrimitives = false;
   bool checkedMode = false;
@@ -196,6 +197,11 @@
     passThrough(argument);
   }
 
+  setAllowNativeExtensions(String argument) {
+    allowNativeExtensions = true;
+    passThrough(argument);
+  }
+
   setVerbose(_) {
     diagnosticHandler.verbose = true;
     passThrough('--verbose');
@@ -335,6 +341,7 @@
     new OptionHandler('--enable-experimental-mirrors', passThrough),
     new OptionHandler('--enable-async', setEnableAsync),
     new OptionHandler('--enable-enum', passThrough),
+    new OptionHandler('--allow-native-extensions', setAllowNativeExtensions),
     new OptionHandler('-D.+=.*', addInEnvironment),
 
     // The following two options must come last.
@@ -395,9 +402,15 @@
         api.Diagnostic.INFO);
   }
   if (analyzeAll) analyzeOnly = true;
-  if (enableAsyncAwait && !analyzeOnly) {
-    helpAndFail("Option '--enable-async' is currently only supported in "
-                "combination with the '--analyze-only' option.");
+  if (!analyzeOnly) {
+    if (enableAsyncAwait) {
+      helpAndFail("Option '--enable-async' is currently only supported in "
+                  "combination with the '--analyze-only' option.");
+    }
+    if (allowNativeExtensions) {
+      helpAndFail("Option '--allow-native-extensions' is only supported in "
+                  "combination with the '--analyze-only' option.");
+    }
   }
 
   diagnosticHandler.info('Package root is $packageRoot');
diff --git a/pkg/compiler/lib/src/dart2jslib.dart b/pkg/compiler/lib/src/dart2jslib.dart
index 01cd054..974bb5e 100644
--- a/pkg/compiler/lib/src/dart2jslib.dart
+++ b/pkg/compiler/lib/src/dart2jslib.dart
@@ -52,6 +52,7 @@
 import 'util/characters.dart' show $_;
 import 'util/uri_extras.dart' as uri_extras show relativize;
 import 'util/util.dart';
+import 'dart_backend/dart_backend.dart';
 
 export 'helpers/helpers.dart';
 export 'resolution/resolution.dart' show TreeElements, TreeElementMapping;
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 174c58b..171244d 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -47,6 +47,11 @@
 
   final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>();
 
+  /// The set of visible platform classes that are implemented by instantiated
+  /// user classes.
+  final Set<ClassElement> _userImplementedPlatformClasses =
+      new Set<ClassElement>();
+
   /**
    * Tells whether it is safe to remove type declarations from variables,
    * functions parameters. It becomes not safe if:
@@ -129,10 +134,10 @@
 
   /// Create an [ElementAst] from the CPS IR.
   static ElementAst createElementAst(Compiler compiler,
-                                     Tracer tracer,
-                                     ConstantSystem constantSystem,
-                                     Element element,
-                                     cps_ir.FunctionDefinition function) {
+       Tracer tracer,
+       ConstantSystem constantSystem,
+       Element element,
+       cps_ir.ExecutableDefinition cpsDefinition) {
     // Transformations on the CPS IR.
     if (tracer != null) {
       tracer.traceCompilation(element.name, null);
@@ -144,38 +149,38 @@
       }
     }
 
-    new ConstantPropagator(compiler, constantSystem).rewrite(function);
-    traceGraph("Sparse constant propagation", function);
-    new RedundantPhiEliminator().rewrite(function);
-    traceGraph("Redundant phi elimination", function);
-    new ShrinkingReducer().rewrite(function);
-    traceGraph("Shrinking reductions", function);
+    new ConstantPropagator(compiler, constantSystem).rewrite(cpsDefinition);
+    traceGraph("Sparse constant propagation", cpsDefinition);
+    new RedundantPhiEliminator().rewrite(cpsDefinition);
+    traceGraph("Redundant phi elimination", cpsDefinition);
+    new ShrinkingReducer().rewrite(cpsDefinition);
+    traceGraph("Shrinking reductions", cpsDefinition);
 
     // Do not rewrite the IR after variable allocation.  Allocation
     // makes decisions based on an approximation of IR variable live
     // ranges that can be invalidated by transforming the IR.
-    new cps_ir.RegisterAllocator().visit(function);
+    new cps_ir.RegisterAllocator().visit(cpsDefinition);
 
     tree_builder.Builder builder = new tree_builder.Builder(compiler);
-    tree_ir.FunctionDefinition definition = builder.build(function);
-    assert(definition != null);
-    traceGraph('Tree builder', definition);
+    tree_ir.ExecutableDefinition treeDefinition = builder.build(cpsDefinition);
+    assert(treeDefinition != null);
+    traceGraph('Tree builder', treeDefinition);
 
     // Transformations on the Tree IR.
-    new StatementRewriter().rewrite(definition);
-    traceGraph('Statement rewriter', definition);
-    new CopyPropagator().rewrite(definition);
-    traceGraph('Copy propagation', definition);
-    new LoopRewriter().rewrite(definition);
-    traceGraph('Loop rewriter', definition);
-    new LogicalRewriter().rewrite(definition);
-    traceGraph('Logical rewriter', definition);
-    new backend_ast_emitter.UnshadowParameters().unshadow(definition);
-    traceGraph('Unshadow parameters', definition);
+    new StatementRewriter().rewrite(treeDefinition);
+    traceGraph('Statement rewriter', treeDefinition);
+    new CopyPropagator().rewrite(treeDefinition);
+    traceGraph('Copy propagation', treeDefinition);
+    new LoopRewriter().rewrite(treeDefinition);
+    traceGraph('Loop rewriter', treeDefinition);
+    new LogicalRewriter().rewrite(treeDefinition);
+    traceGraph('Logical rewriter', treeDefinition);
+    new backend_ast_emitter.UnshadowParameters().unshadow(treeDefinition);
+    traceGraph('Unshadow parameters', treeDefinition);
 
     TreeElementMapping treeElements = new TreeElementMapping(element);
-    backend_ast.Node backendAst =
-        backend_ast_emitter.emit(definition);
+    backend_ast.ExecutableDefinition backendAst =
+        backend_ast_emitter.emit(treeDefinition);
     Node frontend_ast = backend2frontend.emit(treeElements, backendAst);
     return new ElementAst.internal(frontend_ast, treeElements);
 
@@ -199,9 +204,10 @@
       if (!compiler.irBuilder.hasIr(element)) {
         return new ElementAst(element);
       } else {
-        cps_ir.FunctionDefinition function = compiler.irBuilder.getIr(element);
+        cps_ir.ExecutableDefinition definition =
+            compiler.irBuilder.getIr(element);
         return createElementAst(compiler,
-            compiler.tracer, constantSystem, element, function);
+            compiler.tracer, constantSystem, element, definition);
       }
     }
 
@@ -261,6 +267,7 @@
 
   log(String message) => compiler.log('[DartBackend] $message');
 
+  @override
   Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
     // All platform classes must be resolved to ensure that their member names
     // are preserved.
@@ -287,6 +294,7 @@
     return new Future.value();
   }
 
+  @override
   void registerStaticUse(Element element, Enqueuer enqueuer) {
     if (element == compiler.mirrorSystemGetNameFunction) {
       FunctionElement getNameFunction = mirrorRenamer.getNameFunction;
@@ -295,6 +303,75 @@
       }
     }
   }
+
+  @override
+  void registerInstantiatedType(InterfaceType type, Registry registry) {
+    // Without patching, dart2dart has no way of performing sound tree-shaking
+    // in face external functions. Therefore we employ another scheme:
+    //
+    // Based on the assumption that the platform code only relies on the
+    // interfaces of it's own classes, we can approximate the semantics of
+    // external functions by eagerly registering dynamic invocation of instance
+    // members defined the platform interfaces.
+    //
+    // Since we only need to generate code for non-platform classes we can
+    // restrict this registration to platform interfaces implemented by
+    // instantiated non-platform classes.
+    //
+    // Consider for instance this program:
+    //
+    //     import 'dart:math' show Random;
+    //
+    //     class MyRandom implements Random {
+    //       int nextInt() => 0;
+    //     }
+    //
+    //     main() {
+    //       print([0, 1, 2].shuffle(new MyRandom()));
+    //     }
+    //
+    // Here `MyRandom` is a subtype if `Random` defined in 'dart:math'. By the
+    // assumption, all methods defined `Random` are potentially called, and
+    // therefore, though there are no visible call sites from the user node,
+    // dynamic invocation of for instance `nextInt` should be registered. In
+    // this case, `nextInt` is actually called by the standard implementation of
+    // `shuffle`.
+
+    ClassElement cls = type.element;
+    if (!cls.library.isPlatformLibrary) {
+      for (Link<DartType> link = cls.allSupertypes;
+           !link.isEmpty;
+           link = link.tail) {
+        InterfaceType supertype = link.head;
+        ClassElement superclass = supertype.element;
+        LibraryElement library = superclass.library;
+        if (library.isPlatformLibrary) {
+          if (_userImplementedPlatformClasses.add(superclass)) {
+            // Register selectors for all instance methods since these might
+            // be called on user classes from within the platform
+            // implementation.
+            superclass.forEachLocalMember((Element element) {
+              if (element.isConstructor || element.isStatic) return;
+
+              FunctionElement function = element.asFunctionElement();
+              if (function != null) {
+                function.computeSignature(compiler);
+              }
+              Selector selector = new Selector.fromElement(element);
+              if (selector.isGetter) {
+                registry.registerDynamicGetter(selector);
+              } else if (selector.isSetter) {
+                registry.registerDynamicSetter(selector);
+              } else {
+                registry.registerDynamicInvocation(selector);
+              }
+            });
+          }
+        }
+      }
+    }
+
+  }
 }
 
 class DartResolutionCallbacks extends ResolutionCallbacks {
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
index 7ae2d22..8a86eda 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
@@ -4,7 +4,7 @@
 
 library backend_ast_emitter;
 
-import 'tree_ir_nodes.dart' as tree;
+import '../tree_ir/tree_ir_nodes.dart' as tree;
 import 'backend_ast_nodes.dart';
 import '../constants/expressions.dart';
 import '../constants/values.dart';
@@ -15,7 +15,7 @@
 import '../tree/tree.dart' as tree show Modifiers;
 
 /// Translates the dart_tree IR to Dart backend AST.
-Expression emit(tree.FunctionDefinition definition) {
+ExecutableDefinition emit(tree.ExecutableDefinition definition) {
   return new ASTEmitter().emit(definition);
 }
 
@@ -41,8 +41,8 @@
   /// Statements emitted by the most recent call to [visitStatement].
   List<Statement> statementBuffer = <Statement>[];
 
-  /// The function currently being emitted.
-  FunctionElement functionElement;
+  /// The element currently being emitted.
+  ExecutableElement currentElement;
 
   /// Bookkeeping object needed to synthesize a variable declaration.
   modelx.VariableList variableList
@@ -70,8 +70,53 @@
       : this.parent = parent,
         usedVariableNames = parent.usedVariableNames;
 
-  FunctionExpression emit(tree.FunctionDefinition definition) {
-    functionElement = definition.element;
+  ExecutableDefinition emit(tree.ExecutableDefinition definition) {
+    if (definition is tree.FieldDefinition) {
+      return emitField(definition);
+    }
+    assert(definition is tree.FunctionDefinition);
+    return emitFunction(definition);
+  }
+
+  FieldDefinition emitField(tree.FieldDefinition definition) {
+    currentElement = definition.element;
+    visitStatement(definition.body);
+    List<Statement> bodyParts;
+    for (tree.Variable variable in variableNames.keys) {
+      if (!declaredVariables.contains(variable)) {
+        addDeclaration(variable);
+      }
+    }
+    if (variables.length > 0) {
+      bodyParts = new List<Statement>();
+      bodyParts.add(new VariableDeclarations(variables));
+      bodyParts.addAll(statementBuffer);
+    } else {
+      bodyParts = statementBuffer;
+    }
+
+    return new FieldDefinition(definition.element, ensureExpression(bodyParts));
+  }
+
+  /// Returns an expression that will evaluate all of [bodyParts].
+  /// If [bodyParts] is a single [Return] return its value.
+  /// Otherwise wrap the body-parts in an immediately invoked closure.
+  Expression ensureExpression(List<Statement> bodyParts) {
+    if (bodyParts.length == 1) {
+      Statement onlyStatement = bodyParts.single;
+      if (onlyStatement is Return) {
+        return onlyStatement.expression;
+      }
+    }
+    Statement body = new Block(bodyParts);
+    FunctionExpression function =
+        new FunctionExpression(new Parameters([]), body);
+    function.element = null;
+    return new CallFunction(function, []);
+  }
+
+  FunctionExpression emitFunction(tree.FunctionDefinition definition) {
+    currentElement = definition.element;
 
     Parameters parameters = emitRootParameters(definition);
 
@@ -122,16 +167,16 @@
 
       body = new Block(bodyParts);
     }
-    FunctionType functionType = functionElement.type;
+    FunctionType functionType = currentElement.type;
 
     return new FunctionExpression(
         parameters,
         body,
-        name: functionElement.name,
+        name: currentElement.name,
         returnType: emitOptionalType(functionType.returnType),
-        isGetter: functionElement.isGetter,
-        isSetter: functionElement.isSetter)
-        ..element = functionElement;
+        isGetter: currentElement.isGetter,
+        isSetter: currentElement.isSetter)
+        ..element = currentElement;
   }
 
   void addDeclaration(tree.Variable variable, [Expression initializer]) {
@@ -304,7 +349,7 @@
   String getVariableName(tree.Variable variable) {
     // If the variable belongs to an enclosing function, ask the parent emitter
     // for the variable name.
-    if (variable.host.element != functionElement) {
+    if (variable.host != currentElement) {
       return parent.getVariableName(variable);
     }
 
@@ -333,7 +378,7 @@
       // TODO(johnniwinther): Replace by synthetic [Entity].
       variable.element = new _SyntheticLocalVariableElement(
           name,
-          functionElement,
+          currentElement,
           variableList);
     }
     return name;
@@ -341,7 +386,7 @@
 
   String getConstantName(VariableElement element) {
     assert(element.kind == ElementKind.VARIABLE);
-    if (element.enclosingElement != functionElement) {
+    if (element.enclosingElement != currentElement) {
       return parent.getConstantName(element);
     }
     String name = constantNames[element];
@@ -377,7 +422,7 @@
     }
 
     bool isFirstOccurrence = (variableNames[stmt.variable] == null);
-    bool isDeclaredHere = stmt.variable.host.element == functionElement;
+    bool isDeclaredHere = stmt.variable.host == currentElement;
     String name = getVariableName(stmt.variable);
     Expression definition = visitExpression(stmt.definition);
 
@@ -858,13 +903,14 @@
   /// Parameters that are used in a context where it is shadowed.
   Set<tree.Variable> hasShadowedUse = new Set<tree.Variable>();
 
-  void unshadow(tree.FunctionDefinition definition) {
-    if (definition.isAbstract) return;
-
+  void unshadow(tree.ExecutableDefinition definition) {
+    // Fields have no parameters.
+    if (definition is tree.FieldDefinition) return;
     visitFunctionDefinition(definition);
   }
 
   visitFunctionDefinition(tree.FunctionDefinition definition) {
+    if (definition.isAbstract) return;
     var oldShadow = shadowedParameters;
     var oldEnvironment = environment;
     environment = new Map<String, tree.Variable>.from(environment);
@@ -883,7 +929,8 @@
     for (int i=0; i<definition.parameters.length; i++) {
       tree.Variable param = definition.parameters[i];
       if (hasShadowedUse.remove(param)) {
-        tree.Variable newParam = new tree.Variable(definition, param.element);
+        tree.Variable newParam = new tree.Variable(definition.element,
+            param.element);
         definition.parameters[i] = newParam;
         definition.body = new tree.Assign(param, newParam, definition.body);
         newParam.writeCount = 1; // Being a parameter counts as a write.
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
index 9048405..2d113ed 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
@@ -26,6 +26,16 @@
   bool get assignable => false;
 }
 
+abstract class ExecutableDefinition extends Node {
+  elements.Element get element;
+}
+
+class FieldDefinition extends ExecutableDefinition {
+  final elements.Element element;
+  final Expression initializer;
+  FieldDefinition(this.element, this.initializer);
+}
+
 abstract class Statement extends Node {}
 
 /// Used as receiver in expressions that dispatch to the super class.
@@ -296,7 +306,7 @@
 
 // EXPRESSIONS
 
-class FunctionExpression extends Expression {
+class FunctionExpression extends Expression implements ExecutableDefinition {
   final TypeAnnotation returnType;
   String name;
   final Parameters parameters;
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
index d314f54..e0c50d2 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
@@ -15,9 +15,9 @@
 import 'backend_ast_emitter.dart' show createTypeAnnotation;
 
 /// Translates the backend AST to Dart frontend AST.
-tree.FunctionExpression emit(dart2js.TreeElementMapping treeElements,
-                             Node definition) {
-  return new TreePrinter(treeElements).makeExpression(definition);
+tree.Node emit(dart2js.TreeElementMapping treeElements,
+               ExecutableDefinition definition) {
+  return new TreePrinter(treeElements).makeDefinition(definition);
 }
 
 /// If true, the unparser will insert a coment in front of every function
@@ -32,6 +32,34 @@
 
   TreePrinter([this.treeElements]);
 
+  tree.Node makeDefinition(ExecutableDefinition node) {
+    if (node is FieldDefinition) {
+      tree.Node definition;
+      if (node.initializer == null) {
+        definition = makeIdentifier(node.element.name);
+      } else {
+        definition = new tree.SendSet(
+            null,
+            makeIdentifier(node.element.name),
+            new tree.Operator(assignmentToken("=")),
+            singleton(makeExpression(node.initializer)));
+      }
+      setElement(definition, node.element, node);
+      return new tree.VariableDefinitions(
+          null, // TODO(sigurdm): Type
+          makeVarModifiers(useVar: true,
+                           isFinal: node.element.isFinal,
+                           isStatic: node.element.isStatic,
+                           isConst: node.element.isConst),
+          makeList(null, [definition], close: semicolon));
+    } else if (node is FunctionExpression) {
+      return makeExpression(node);
+    } else {
+      assert(false);
+      return null;
+    }
+  }
+
   void setElement(tree.Node node, elements.Element element, source) {
     if (treeElements != null) {
       if (element == null) {
@@ -418,8 +446,9 @@
           makeFunctionModifiers(exp),
           null,  // initializers
           getOrSet,  // get/set
-          null); // async modifier
-      setElement(result, exp.element, exp);
+          null);  // async modifier
+      elements.Element element = exp.element;
+      if (element != null) setElement(result, element, exp);
     } else if (exp is Identifier) {
       precedence = CALLEE;
       result = new tree.Send(
@@ -933,13 +962,17 @@
     return new tree.Modifiers(blankList());
   }
 
-  tree.Modifiers makeModifiers({bool isStatic: false,
+  tree.Modifiers makeModifiers({bool isExternal: false,
+                                bool isStatic: false,
                                 bool isAbstract: false,
                                 bool isFactory: false,
                                 bool isConst: false,
                                 bool isFinal: false,
                                 bool isVar: false}) {
     List<tree.Node> nodes = [];
+    if (isExternal) {
+      nodes.add(makeIdentifier('external'));
+    }
     if (isStatic) {
       nodes.add(makeIdentifier('static'));
     }
@@ -958,20 +991,23 @@
     if (isVar) {
       nodes.add(makeIdentifier('var'));
     }
-    return new tree.Modifiers(makeList('', nodes));
+    return new tree.Modifiers(makeList(' ', nodes));
   }
 
   tree.Modifiers makeVarModifiers({bool isConst: false,
                                    bool isFinal: false,
-                                   bool useVar: false}) {
-    return makeModifiers(isConst: isConst,
+                                   bool useVar: false,
+                                   bool isStatic: false}) {
+    return makeModifiers(isStatic: isStatic,
+                         isConst: isConst,
                          isFinal: isFinal,
                          isVar: useVar && !(isConst || isFinal));
   }
 
   tree.Modifiers makeFunctionModifiers(FunctionExpression exp) {
     if (exp.element == null) return makeEmptyModifiers();
-    return makeModifiers(isStatic: exp.element.isStatic,
+    return makeModifiers(isExternal: exp.element.isExternal,
+                         isStatic: exp.element.isStatic,
                          isFactory: exp.element.isFactoryConstructor);
   }
 
diff --git a/pkg/compiler/lib/src/dart_backend/dart_backend.dart b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
index e44d1d5..abb5d26 100644
--- a/pkg/compiler/lib/src/dart_backend/dart_backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
@@ -14,14 +14,12 @@
 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
 import '../constants/expressions.dart';
 import '../cps_ir/optimizers.dart';
-import 'tree_ir_builder.dart' as tree_builder;
-import 'tree_ir_nodes.dart' as tree_ir;
+import '../tree_ir/tree_ir_builder.dart' as tree_builder;
+import '../tree_ir/tree_ir_nodes.dart' as tree_ir;
 import '../util/util.dart';
 import '../mirror_renamer/mirror_renamer.dart';
-import 'logical_rewriter.dart' show LogicalRewriter;
-import 'loop_rewriter.dart' show LoopRewriter;
-import 'copy_propagator.dart' show CopyPropagator;
-import 'statement_rewriter.dart' show StatementRewriter;
+import '../tree_ir/optimization/optimization.dart'
+    show LogicalRewriter, LoopRewriter, CopyPropagator, StatementRewriter;
 import 'backend_ast_emitter.dart' as backend_ast_emitter;
 import 'backend_ast_nodes.dart' as backend_ast;
 import 'backend_ast_to_frontend_ast.dart' as backend2frontend;
diff --git a/pkg/compiler/lib/src/dart_backend/renamer.dart b/pkg/compiler/lib/src/dart_backend/renamer.dart
index 414737e..79b8c58 100644
--- a/pkg/compiler/lib/src/dart_backend/renamer.dart
+++ b/pkg/compiler/lib/src/dart_backend/renamer.dart
@@ -224,7 +224,7 @@
 
       Set<String> memberIdentifiers = new Set<String>();
       Set<LocalPlaceholder> placeholders = functionScope.localPlaceholders;
-      if (functionElement.enclosingClass != null) {
+      if (functionElement != null && functionElement.enclosingClass != null) {
         functionElement.enclosingClass.forEachMember(
             (enclosingClass, member) {
               memberIdentifiers.add(member.name);
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 6341a3b..9012b51 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -401,7 +401,6 @@
   Element get origin;
 
   bool get isSynthesized;
-  bool get isForwardingConstructor;
   bool get isMixinApplication;
 
   bool get hasFixedBackendName;
@@ -885,7 +884,6 @@
   bool get exportsHandled;
 
   // TODO(kasperl): We should try to get rid of these.
-  void set canUseNative(bool value);
   void set libraryTag(LibraryName value);
 
   LibraryElement get implementation;
@@ -1140,6 +1138,9 @@
 
   /// The synchronous/asynchronous marker on this function.
   AsyncMarker get asyncMarker;
+
+  /// `true` if this function is external.
+  bool get isExternal;
 }
 
 /// Enum for the synchronous/asynchronous function body modifiers.
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index c0feddb..007e584 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -118,8 +118,6 @@
 
   bool get isSynthesized => false;
 
-  bool get isForwardingConstructor => false;
-
   bool get isMixinApplication => false;
 
   bool get isLocal => false;
@@ -267,6 +265,10 @@
   }
 
   DeclarationSite get declarationSite => null;
+
+  void reuseElement() {
+    throw "reuseElement isn't implemented on ${runtimeType}.";
+  }
 }
 
 class ErroneousElementX extends ElementX implements ErroneousElement {
@@ -302,6 +304,7 @@
   get nestedClosures => unsupported();
   get memberContext => unsupported();
   get executableContext => unsupported();
+  get isExternal => unsupported();
 
   bool get isRedirectingFactory => unsupported();
 
@@ -1257,6 +1260,11 @@
     super.reuseElement();
     nestedClosures.clear();
   }
+
+  FieldElementX copyWithEnclosing(Element enclosingElement) {
+    return new FieldElementX(
+        new Identifier(token), enclosingElement, variables);
+  }
 }
 
 /// [Element] for a parameter-like element.
@@ -1553,6 +1561,10 @@
     assert(modifiers != null);
   }
 
+  bool get isExternal => modifiers.isExternal;
+
+  bool get hasNoBody => _hasNoBody;
+
   bool get isInstanceMember {
     return isClassMember
            && !isConstructor
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index a00c365..fb8c2cf 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -92,6 +92,7 @@
       cls.ensureResolved(compiler);
       universe.registerTypeInstantiation(type, byMirrors: mirrorUsage);
       processInstantiatedClass(cls);
+      compiler.backend.registerInstantiatedType(type, registry);
     });
   }
 
diff --git a/pkg/compiler/lib/src/js/builder.dart b/pkg/compiler/lib/src/js/builder.dart
index 142166e..ac63a56 100644
--- a/pkg/compiler/lib/src/js/builder.dart
+++ b/pkg/compiler/lib/src/js/builder.dart
@@ -334,12 +334,23 @@
       new ArrayInitializer.from(list.map(string));
 
   Comment comment(String text) => new Comment(text);
+
+  Call propertyCall(Expression receiver,
+                      String fieldName,
+                      List<Expression> arguments) {
+    return new Call(new PropertyAccess.field(receiver, fieldName), arguments);
+  }
 }
 
 LiteralString string(String value) => js.string(value);
 LiteralNumber number(num value) => js.number(value);
 ArrayInitializer numArray(Iterable<int> list) => js.numArray(list);
 ArrayInitializer stringArray(Iterable<String> list) => js.stringArray(list);
+Call propertyCall(Expression receiver,
+                    String fieldName,
+                    List<Expression> arguments) {
+  return js.propertyCall(receiver, fieldName, arguments);
+}
 
 class MiniJsParserError {
   MiniJsParserError(this.parser, this.message) { }
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 9864942..75238e4 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -6,11 +6,20 @@
 
 const VERBOSE_OPTIMIZER_HINTS = false;
 
+const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
+
 class JavaScriptItemCompilationContext extends ItemCompilationContext {
   final Set<HInstruction> boundsChecked = new Set<HInstruction>();
   final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>();
 }
 
+abstract class FunctionCompiler {
+  /// Generates JavaScript code for `work.element`.
+  jsAst.Fun compile(CodegenWorkItem work);
+
+  Iterable get tasks;
+}
+
 /*
  * Invariants:
  *   canInline(function) implies canInline(function, insideLoop:true)
@@ -97,9 +106,8 @@
     return [closureClass, jsIndexableClass];
   }
 
-  SsaBuilderTask builder;
-  SsaOptimizerTask optimizer;
-  SsaCodeGeneratorTask generator;
+  FunctionCompiler functionCompiler;
+
   CodeEmitterTask emitter;
 
   /**
@@ -323,8 +331,17 @@
    */
   final Set<ClassElement> specialOperatorEqClasses = new Set<ClassElement>();
 
+  /**
+   * A set of members that are called from subclasses via `super`.
+   */
+  final Set<FunctionElement> aliasedSuperMembers =
+      new Setlet<FunctionElement>();
+
   List<CompilerTask> get tasks {
-    return <CompilerTask>[builder, optimizer, generator, emitter];
+    List<CompilerTask> result = functionCompiler.tasks;
+    result.add(emitter);
+    result.add(patchResolverTask);
+    return result;
   }
 
   final RuntimeTypes rti;
@@ -431,6 +448,8 @@
 
   JavaScriptResolutionCallbacks resolutionCallbacks;
 
+  PatchResolverTask patchResolverTask;
+
   JavaScriptBackend(Compiler compiler, bool generateSourceMap)
       : namer = determineNamer(compiler),
         oneShotInterceptors = new Map<String, Selector>(),
@@ -439,13 +458,14 @@
         specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
         super(compiler) {
     emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
-    builder = new SsaBuilderTask(this);
-    optimizer = new SsaOptimizerTask(this);
-    generator = new SsaCodeGeneratorTask(this);
     typeVariableHandler = new TypeVariableHandler(this);
     customElementsAnalysis = new CustomElementsAnalysis(this);
     constantCompilerTask = new JavaScriptConstantTask(compiler);
     resolutionCallbacks = new JavaScriptResolutionCallbacks(this);
+    patchResolverTask = new PatchResolverTask(compiler);
+    functionCompiler = USE_CPS_IR
+         ? new CspFunctionCompiler(compiler, this)
+         : new SsaFunctionCompiler(this, generateSourceMap);
   }
 
   ConstantSystem get constantSystem => constants.constantSystem;
@@ -456,6 +476,12 @@
     return constantCompilerTask.jsConstantCompiler;
   }
 
+  FunctionElement resolveExternalFunction(FunctionElement element) {
+    return patchResolverTask.measure(() {
+      return patchResolverTask.resolveExternalFunction(element);
+    });
+  }
+
   // TODO(karlklose): Split into findHelperFunction and findHelperClass and
   // add a check that the element has the expected kind.
   Element findHelper(String name) => find(jsHelperLibrary, name);
@@ -528,6 +554,20 @@
     return name;
   }
 
+  /**
+   * Record that [method] is called from a subclass via `super`.
+   */
+  void registerAliasedSuperMember(FunctionElement method) {
+    aliasedSuperMembers.add(method);
+  }
+
+  /**
+   * Returns `true` if [member] is called from a subclass via `super`.
+   */
+  bool isAliasedSuperMember(FunctionElement member) {
+    return aliasedSuperMembers.contains(member);
+  }
+
   bool isInterceptedMethod(Element element) {
     if (!element.isInstanceMember) return false;
     if (element.isGenerativeConstructorBody) {
@@ -1167,7 +1207,8 @@
       return;
     }
     if (kind.category == ElementCategory.VARIABLE) {
-      ConstantExpression initialValue = constants.getConstantForVariable(element);
+      ConstantExpression initialValue =
+          constants.getConstantForVariable(element);
       if (initialValue != null) {
         registerCompileTimeConstant(initialValue.value, work.registry);
         constants.addCompileTimeConstantForEmission(initialValue.value);
@@ -1183,10 +1224,7 @@
         compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper());
       }
     }
-    HGraph graph = builder.build(work);
-    optimizer.optimize(work, graph);
-    jsAst.Expression code = generator.generateCode(work, graph);
-    generatedCode[element] = code;
+    generatedCode[element] = functionCompiler.compile(work);
   }
 
   native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) {
@@ -1669,6 +1707,14 @@
 
   Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
     return super.onLibraryScanned(library, loader).then((_) {
+      if (library.isPlatformLibrary && !library.isPatched) {
+        // Apply patch, if any.
+        Uri patchUri = compiler.resolvePatchUri(library.canonicalUri.path);
+        if (patchUri != null) {
+          return compiler.patchParser.patchLibrary(loader, patchUri, library);
+        }
+      }
+    }).then((_) {
       Uri uri = library.canonicalUri;
 
       VariableElement findVariable(String name) {
@@ -2233,6 +2279,7 @@
   void forgetElement(Element element) {
     constants.forgetElement(element);
     constantCompilerTask.dartConstantCompiler.forgetElement(element);
+    aliasedSuperMembers.remove(element);
   }
 
   void registerMainHasArguments(Enqueuer enqueuer) {
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
new file mode 100644
index 0000000..308e1af
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -0,0 +1,423 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library code_generator;
+
+import 'glue.dart';
+
+import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
+import '../../js/js.dart' as js;
+import '../../elements/elements.dart';
+import '../../util/maplet.dart';
+import '../../constants/values.dart';
+import '../../dart2jslib.dart';
+
+class CodegenBailout {
+  final tree_ir.Node node;
+  final String reason;
+  CodegenBailout(this.node, this.reason);
+  String get message {
+    return 'bailout${node != null ? " on $node" : ""}: $reason';
+  }
+}
+
+class CodeGenerator extends tree_ir.Visitor<dynamic, js.Expression> {
+  final CodegenRegistry registry;
+
+  final Glue glue;
+
+  ExecutableElement currentFunction;
+
+  /// Maps variables to their name.
+  Map<tree_ir.Variable, String> variableNames = <tree_ir.Variable, String>{};
+
+  /// Maps local constants to their name.
+  Maplet<VariableElement, String> constantNames =
+      new Maplet<VariableElement, String>();
+
+  /// Variable names that have already been used. Used to avoid name clashes.
+  Set<String> usedVariableNames = new Set<String>();
+
+  /// Input to [visitStatement]. Denotes the statement that will execute next
+  /// if the statements produced by [visitStatement] complete normally.
+  /// Set to null if control will fall over the end of the method.
+  tree_ir.Statement fallthrough = null;
+
+  Set<tree_ir.Label> usedLabels = new Set<tree_ir.Label>();
+
+  List<js.Statement> accumulator = new List<js.Statement>();
+
+  CodeGenerator(this.glue, this.registry);
+
+  /// Generates JavaScript code for the body of [function].
+  js.Fun buildFunction(tree_ir.FunctionDefinition function) {
+    currentFunction = function.element;
+    visitStatement(function.body);
+
+    List<js.Parameter> parameters = new List<js.Parameter>();
+    Set<tree_ir.Variable> parameterSet = new Set<tree_ir.Variable>();
+
+    for (tree_ir.Variable parameter in function.parameters) {
+      String name = getVariableName(parameter);
+      parameters.add(new js.Parameter(name));
+      parameterSet.add(parameter);
+    }
+
+    List<js.VariableInitialization> jsVariables = <js.VariableInitialization>[];
+
+    for (tree_ir.Variable variable in variableNames.keys) {
+      if (parameterSet.contains(variable)) continue;
+      String name = getVariableName(variable);
+      js.VariableInitialization jsVariable = new js.VariableInitialization(
+        new js.VariableDeclaration(name),
+        null);
+      jsVariables.add(jsVariable);
+    }
+
+    if (jsVariables.length > 0) {
+      // Would be nice to avoid inserting at the beginning of list.
+      accumulator.insert(0, new js.ExpressionStatement(
+          new js.VariableDeclarationList(jsVariables)));
+    }
+    return new js.Fun(parameters, new js.Block(accumulator));
+  }
+
+  js.Expression visit(tree_ir.Expression node) {
+    js.Expression result = node.accept(this);
+    if (result == null) {
+      glue.reportInternalError('$node did not produce code.');
+    }
+    return result;
+  }
+
+  /// Generates a name for the given variable. First trying with the name of
+  /// the [Variable.element] if it is non-null.
+  String getVariableName(tree_ir.Variable variable) {
+    // TODO(sigurdm): Handle case where the variable belongs to an enclosing
+    // function.
+    if (variable.host != currentFunction) giveup(variable);
+
+    // Get the name if we already have one.
+    String name = variableNames[variable];
+    if (name != null) {
+      return name;
+    }
+
+    // Synthesize a variable name that isn't used elsewhere.
+    // The [usedVariableNames] set is shared between nested emitters,
+    // so this also prevents clash with variables in an enclosing/inner scope.
+    // The renaming phase after codegen will further prefix local variables
+    // so they cannot clash with top-level variables or fields.
+    String prefix = variable.element == null ? 'v' : variable.element.name;
+    int counter = 0;
+    name = glue.safeVariableName(variable.element == null
+        ? '$prefix$counter'
+        : variable.element.name);
+    while (!usedVariableNames.add(name)) {
+      ++counter;
+      name = '$prefix$counter';
+    }
+    variableNames[variable] = name;
+
+    return name;
+  }
+
+  List<js.Expression> visitArguments(List<tree_ir.Expression> arguments) {
+    return arguments.map(visitExpression).toList();
+  }
+
+  giveup(tree_ir.Node node,
+         [String reason = 'unimplemented in CodeGenerator']) {
+    throw new CodegenBailout(node, reason);
+  }
+
+  @override
+  js.Expression visitConcatenateStrings(tree_ir.ConcatenateStrings node) {
+    return giveup(node);
+    // TODO: implement visitConcatenateStrings
+  }
+
+  @override
+  js.Expression visitConditional(tree_ir.Conditional node) {
+    return new js.Conditional(
+        visit(node.condition),
+        visit(node.thenExpression),
+        visit(node.elseExpression));
+  }
+
+  js.Expression buildConstant(ConstantValue constant) {
+    registry.registerCompileTimeConstant(constant);
+    return glue.constantReference(constant);
+  }
+
+  @override
+  js.Expression visitConstant(tree_ir.Constant node) {
+    return buildConstant(node.expression.value);
+  }
+
+  @override
+  js.Expression visitFunctionExpression(tree_ir.FunctionExpression node) {
+    return giveup(node);
+    // TODO: implement visitFunctionExpression
+  }
+
+  js.Expression compileConstant(ParameterElement parameter) {
+    return buildConstant(glue.getConstantForVariable(parameter).value);
+  }
+
+  js.Expression buildStaticInvoke(Selector selector,
+                                  Element target,
+                                  List<js.Expression> arguments) {
+    registry.registerStaticInvocation(target.declaration);
+
+    js.Expression elementAccess = glue.elementAccess(target);
+    List<js.Expression> compiledArguments =
+        selector.makeArgumentsList(target.implementation,
+                                   arguments,
+                                   compileConstant);
+    return new js.Call(elementAccess, compiledArguments);
+  }
+
+  @override
+  js.Expression visitInvokeConstructor(tree_ir.InvokeConstructor node) {
+    if (node.constant != null) return giveup(node);
+    return buildStaticInvoke(node.selector,
+                             node.target,
+                             visitArguments(node.arguments));
+  }
+
+  void registerMethodInvoke(tree_ir.InvokeMethod node) {
+    Selector selector = node.selector;
+    // TODO(sigurdm): We should find a better place to register the call.
+    Selector call = new Selector.callClosureFrom(selector);
+    registry.registerDynamicInvocation(call);
+    registry.registerDynamicInvocation(selector);
+  }
+
+  @override
+  js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) {
+    // TODO(sigurdm): Handle intercepted invocations.
+    if (glue.isIntercepted(node.selector)) giveup(node);
+    js.Expression receiver = visitExpression(node.receiver);
+
+    List<js.Expression> arguments = visitArguments(node.arguments);
+
+    String methodName = glue.invocationName(node.selector);
+    registerMethodInvoke(node);
+
+    return js.propertyCall(receiver, methodName, arguments);
+  }
+
+  @override
+  js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) {
+    return buildStaticInvoke(node.selector,
+                             node.target,
+                             visitArguments(node.arguments));
+  }
+
+  @override
+  js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) {
+    return giveup(node);
+    // TODO: implement visitInvokeSuperMethod
+  }
+
+  @override
+  js.Expression visitLiteralList(tree_ir.LiteralList node) {
+    registry.registerInstantiatedClass(glue.listClass);
+    int length = node.values.length;
+    List<js.ArrayElement> entries = new List<js.ArrayElement>.generate(length,
+        (int i) => new js.ArrayElement(i, visitExpression(node.values[i])));
+    return new js.ArrayInitializer(length, entries);
+  }
+
+  @override
+  js.Expression visitLiteralMap(tree_ir.LiteralMap node) {
+    ConstructorElement constructor;
+    if (node.entries.isEmpty) {
+      constructor = glue.mapLiteralConstructorEmpty;
+    } else {
+      constructor = glue.mapLiteralConstructor;
+    }
+    List<js.ArrayElement> entries =
+        new List<js.ArrayElement>(2 * node.entries.length);
+    for (int i = 0; i < node.entries.length; i++) {
+      js.Expression key = visitExpression(node.entries[i].key);
+      js.Expression value = visitExpression(node.entries[i].value);
+      entries[2 * i] = new js.ArrayElement(2 * i, key);
+      entries[2 * i + 1] = new js.ArrayElement(2 * i + 1, value);
+    }
+    List<js.Expression> args =
+        <js.Expression>[new js.ArrayInitializer(node.entries.length * 2,
+                                                entries)];
+    return buildStaticInvoke(
+        new Selector.call(constructor.name, constructor.library, 2),
+        constructor,
+        args);
+  }
+
+  @override
+  js.Expression visitLogicalOperator(tree_ir.LogicalOperator node) {
+    return new js.Binary(node.operator, visit(node.left), visit(node.right));
+  }
+
+  @override
+  js.Expression visitNot(tree_ir.Not node) {
+    return new js.Prefix("!", visitExpression(node.operand));
+  }
+
+  @override
+  js.Expression visitReifyTypeVar(tree_ir.ReifyTypeVar node) {
+    return giveup(node);
+    // TODO: implement visitReifyTypeVar
+  }
+
+  @override
+  js.Expression visitThis(tree_ir.This node) {
+    // TODO(sigurdm): Inside a js closure this will not work.
+    return new js.This();
+  }
+
+  @override
+  js.Expression visitTypeOperator(tree_ir.TypeOperator node) {
+    return giveup(node);
+    // TODO: implement visitTypeOperator
+  }
+
+  @override
+  js.Expression visitVariable(tree_ir.Variable node) {
+    return new js.VariableUse(getVariableName(node));
+  }
+
+  @override
+  void visitContinue(tree_ir.Continue node) {
+    tree_ir.Statement fallthrough = this.fallthrough;
+    if (node.target.binding == fallthrough) {
+      // Fall through to continue target
+    } else if (fallthrough is tree_ir.Continue &&
+               fallthrough.target == node.target) {
+      // Fall through to equivalent continue
+    } else {
+      usedLabels.add(node.target);
+      accumulator.add(new js.Continue(node.target.name));
+    }
+  }
+
+  @override
+  void visitExpressionStatement(tree_ir.ExpressionStatement node) {
+    accumulator.add(new js.ExpressionStatement(
+        visitExpression(node.expression)));
+    visitStatement(node.next);
+  }
+
+  @override
+  void visitFunctionDeclaration(tree_ir.FunctionDeclaration node) {
+    giveup(node);
+    // TODO: implement visitFunctionDeclaration
+  }
+
+  @override
+  void visitIf(tree_ir.If node) {
+    accumulator.add(new js.If(visitExpression(node.condition),
+                              buildBody(node.thenStatement),
+                              buildBody(node.elseStatement)));
+  }
+
+  @override
+  void visitLabeledStatement(tree_ir.LabeledStatement node) {
+    accumulator.add(buildLabeled(() => buildBody(node.body),
+                                 node.label,
+                                 node.next));
+    visitStatement(node.next);
+  }
+
+  js.Statement buildLabeled(js.Statement buildBody(),
+                tree_ir.Label label,
+                tree_ir.Statement fallthroughStatement) {
+    tree_ir.Statement savedFallthrough = fallthrough;
+    fallthrough = fallthroughStatement;
+    js.Statement result = buildBody();
+    if (usedLabels.remove(label)) {
+      result = new js.LabeledStatement(label.name, result);
+    }
+    fallthrough = savedFallthrough;
+    return result;
+  }
+
+  @override
+  void visitAssign(tree_ir.Assign node) {
+    tree_ir.Expression value = node.definition;
+    js.Expression definition = visitExpression(value);
+
+    accumulator.add(new js.ExpressionStatement(new js.Assignment(
+        visitVariable(node.variable),
+        definition)));
+    visitStatement(node.next);
+  }
+
+  @override
+  void visitBreak(tree_ir.Break node) {
+    tree_ir.Statement fallthrough = this.fallthrough;
+    if (node.target.binding.next == fallthrough) {
+      // Fall through to break target
+    } else if (fallthrough is tree_ir.Break &&
+               fallthrough.target == node.target) {
+      // Fall through to equivalent break
+    } else {
+      usedLabels.add(node.target);
+      accumulator.add(new js.Break(node.target.name));
+    }
+  }
+
+  /// Returns the current [accumulator] wrapped in a block if neccessary.
+  js.Statement _bodyAsStatement() {
+    if (accumulator.length == 0) {
+      return new js.EmptyStatement();
+    }
+    if (accumulator.length == 1) {
+      return accumulator.single;
+    }
+    return new js.Block(accumulator);
+  }
+
+  /// Builds a nested statement.
+  js.Statement buildBody(tree_ir.Statement statement) {
+    List<js.Statement> savedAccumulator = accumulator;
+    accumulator = new List<js.Statement>();
+    visitStatement(statement);
+    js.Statement result = _bodyAsStatement();
+    accumulator = savedAccumulator;
+    return result;
+  }
+
+  js.Statement buildWhile(js.Expression condition,
+                          tree_ir.Statement body,
+                          tree_ir.Label label,
+                          tree_ir.Statement fallthroughStatement) {
+    return buildLabeled(() => new js.While(condition, buildBody(body)),
+                        label,
+                        fallthroughStatement);
+  }
+
+  @override
+  void visitWhileCondition(tree_ir.WhileCondition node) {
+    accumulator.add(
+        buildWhile(visitExpression(node.condition),
+                   node.body,
+                   node.label,
+                   node));
+    visitStatement(node.next);
+  }
+
+  @override
+  void visitWhileTrue(tree_ir.WhileTrue node) {
+    accumulator.add(
+        buildWhile(new js.LiteralBool(true), node.body, node.label, node));
+  }
+
+  @override
+  void visitReturn(tree_ir.Return node) {
+    accumulator.add(new js.Return(visitExpression(node.value)));
+  }
+
+}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
new file mode 100644
index 0000000..fb73773
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library code_generator_dependencies;
+
+import '../js_backend.dart';
+import '../../dart2jslib.dart';
+import '../../js_emitter/js_emitter.dart';
+import '../../js/js.dart' as js;
+import '../../constants/values.dart';
+import '../../elements/elements.dart';
+import '../../constants/expressions.dart';
+
+/// Encapsulates the dependencies of the function-compiler to the compiler,
+/// backend and emitter.
+// TODO(sigurdm): Should be refactored when we have a better feeling for the
+// interface.
+class Glue {
+  final Compiler _compiler;
+
+  JavaScriptBackend get _backend => _compiler.backend;
+
+  CodeEmitterTask get _emitter => _backend.emitter;
+  Namer get _namer => _backend.namer;
+
+  Glue(this._compiler);
+
+  js.Expression constantReference(ConstantValue value) {
+    return _emitter.constantReference(value);
+  }
+
+  reportInternalError(String message) {
+    _compiler.internalError(_compiler.currentElement, message);
+  }
+
+  ConstantExpression getConstantForVariable(VariableElement variable) {
+    return _backend.constants.getConstantForVariable(variable);
+  }
+
+  js.Expression elementAccess(Element element) {
+    return _namer.elementAccess(element);
+  }
+
+  String safeVariableName(String name) {
+    return _namer.safeVariableName(name);
+  }
+
+  ClassElement get listClass => _compiler.listClass;
+
+  ConstructorElement get mapLiteralConstructor {
+    return _backend.mapLiteralConstructor;
+  }
+
+  ConstructorElement get mapLiteralConstructorEmpty {
+    return _backend.mapLiteralConstructorEmpty;
+  }
+
+  FunctionElement get identicalFunction => _compiler.identicalFunction;
+
+  String invocationName(Selector selector) {
+    return _namer.invocationName(selector);
+  }
+
+  bool isIntercepted(Selector selector) {
+    return _backend.isInterceptedSelector(selector);
+  }
+
+}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
new file mode 100644
index 0000000..68e1d5b
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -0,0 +1,198 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Generate code using the cps-based IR pipeline.
+library code_generator_task;
+
+import 'glue.dart';
+import 'codegen.dart';
+import 'unsugar.dart';
+
+import '../js_backend.dart';
+import '../../dart2jslib.dart';
+import '../../source_file.dart';
+import '../../cps_ir/cps_ir_nodes.dart' as cps;
+import '../../cps_ir/cps_ir_builder.dart';
+import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
+import '../../tree/tree.dart' as ast;
+import '../../scanner/scannerlib.dart' as scanner;
+import '../../elements/elements.dart';
+import '../../closure.dart';
+import '../../js/js.dart' as js;
+import '../../source_map_builder.dart';
+import '../../tree_ir/tree_ir_builder.dart' as tree_builder;
+import '../../dart_backend/backend_ast_emitter.dart' as backend_ast_emitter;
+import '../../cps_ir/optimizers.dart';
+import '../../tracer.dart';
+import '../../js_backend/codegen/codegen.dart';
+import '../../ssa/ssa.dart' as ssa;
+import '../../tree_ir/optimization/optimization.dart';
+
+class CspFunctionCompiler implements FunctionCompiler {
+  final IrBuilderTask irBuilderTask;
+  final ConstantSystem constantSystem;
+  final Compiler compiler;
+  final Glue glue;
+
+  // TODO(karlklose,sigurm): remove and update dart-doc of [compile].
+  final FunctionCompiler fallbackCompiler;
+
+  // TODO(sigurdm): Assign this.
+  Tracer tracer;
+
+  CspFunctionCompiler(Compiler compiler, JavaScriptBackend backend)
+      : irBuilderTask = new IrBuilderTask(compiler),
+        fallbackCompiler = new ssa.SsaFunctionCompiler(backend, true),
+        constantSystem = backend.constantSystem,
+        compiler = compiler,
+        glue = new Glue(compiler);
+
+  String get name => 'CPS Ir pipeline';
+
+  /// Generates JavaScript code for `work.element`. First tries to use the
+  /// Cps Ir -> tree ir -> js pipeline, and if that fails due to language
+  /// features not implemented it will fall back to the ssa pipeline (for
+  /// platform code) or will cancel compilation (for user code).
+  js.Fun compile(CodegenWorkItem work) {
+    AstElement element = work.element;
+    return compiler.withCurrentElement(element, () {
+      try {
+        if (tracer != null) {
+          tracer.traceCompilation(element.name, null);
+        }
+        cps.FunctionDefinition cpsFunction = compileToCpsIR(element);
+        cpsFunction = optimizeCpsIR(cpsFunction);
+        tree_ir.FunctionDefinition treeFunction = compileToTreeIR(cpsFunction);
+        treeFunction = optimizeTreeIR(treeFunction);
+        return compileToJavaScript(work, treeFunction);
+      } on CodegenBailout catch (e) {
+        if (element.library.isPlatformLibrary) {
+          compiler.log('Falling back to SSA compiler for $element'
+              ' (${e.message})');
+          return fallbackCompiler.compile(work);
+        } else {
+          String message = "Unable to compile $element with the new compiler.\n"
+              "  Reason: ${e.message}";
+          compiler.internalError(element, message);
+        }
+      }
+    });
+  }
+
+  void giveUp(String reason) {
+    throw new CodegenBailout(null, reason);
+  }
+
+  void traceGraph(String title, var irObject) {
+    if (tracer != null) {
+      tracer.traceGraph(title, irObject);
+    }
+  }
+
+  cps.FunctionDefinition compileToCpsIR(AstElement element) {
+    // TODO(sigurdm): Support these constructs.
+    if (element.isGenerativeConstructorBody ||
+        element.enclosingClass is ClosureClassElement ||
+        element.isNative ||
+        element.isField) {
+      giveUp('unsupported element kind: ${element.name}:${element.kind}');
+    }
+
+    cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element);
+    if (cpsNode == null) {
+      giveUp('unable to build cps definition of $element');
+    }
+    const UnsugarVisitor().rewrite(cpsNode);
+    return cpsNode;
+  }
+
+  cps.FunctionDefinition optimizeCpsIR(cps.FunctionDefinition cpsNode) {
+    // Transformations on the CPS IR.
+    traceGraph("IR Builder", cpsNode);
+    new ConstantPropagator(compiler, constantSystem)
+        .rewrite(cpsNode);
+    traceGraph("Sparse constant propagation", cpsNode);
+    new RedundantPhiEliminator().rewrite(cpsNode);
+    traceGraph("Redundant phi elimination", cpsNode);
+    new ShrinkingReducer().rewrite(cpsNode);
+    traceGraph("Shrinking reductions", cpsNode);
+
+    // Do not rewrite the IR after variable allocation.  Allocation
+    // makes decisions based on an approximation of IR variable live
+    // ranges that can be invalidated by transforming the IR.
+    new cps.RegisterAllocator().visit(cpsNode);
+    return cpsNode;
+  }
+
+  tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) {
+    tree_builder.Builder builder = new tree_builder.Builder(compiler);
+    tree_ir.FunctionDefinition treeNode = builder.buildFunction(cpsNode);
+    assert(treeNode != null);
+    traceGraph('Tree builder', treeNode);
+    return treeNode;
+  }
+
+  tree_ir.FunctionDefinition optimizeTreeIR(
+      tree_ir.FunctionDefinition treeNode) {
+    // Transformations on the Tree IR.
+    new StatementRewriter().rewrite(treeNode);
+    traceGraph('Statement rewriter', treeNode);
+    new CopyPropagator().rewrite(treeNode);
+    traceGraph('Copy propagation', treeNode);
+    new LoopRewriter().rewrite(treeNode);
+    traceGraph('Loop rewriter', treeNode);
+    new LogicalRewriter().rewrite(treeNode);
+    traceGraph('Logical rewriter', treeNode);
+    new backend_ast_emitter.UnshadowParameters().unshadow(treeNode);
+    traceGraph('Unshadow parameters', treeNode);
+    return treeNode;
+  }
+
+  js.Fun compileToJavaScript(CodegenWorkItem work,
+                             tree_ir.FunctionDefinition definition) {
+    CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
+
+    return attachPosition(codeGen.buildFunction(definition), work.element);
+  }
+
+  Iterable<CompilerTask> get tasks {
+    // TODO(sigurdm): Make a better list of tasks.
+    return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
+  }
+
+  js.Node attachPosition(js.Node node, AstElement element) {
+    // TODO(sra): Attaching positions might be cleaner if the source position
+    // was on a wrapping node.
+    SourceFile sourceFile = sourceFileOfElement(element);
+    String name = element.name;
+    AstElement implementation = element.implementation;
+    ast.Node expression = implementation.node;
+    scanner.Token beginToken;
+    scanner.Token endToken;
+    if (expression == null) {
+      // Synthesized node. Use the enclosing element for the location.
+      beginToken = endToken = element.position;
+    } else {
+      beginToken = expression.getBeginToken();
+      endToken = expression.getEndToken();
+    }
+    // TODO(podivilov): find the right sourceFile here and remove offset
+    // checks below.
+    var sourcePosition, endSourcePosition;
+    if (beginToken.charOffset < sourceFile.length) {
+      sourcePosition =
+          new TokenSourceFileLocation(sourceFile, beginToken, name);
+    }
+    if (endToken.charOffset < sourceFile.length) {
+      endSourcePosition =
+          new TokenSourceFileLocation(sourceFile, endToken, name);
+    }
+    return node.withPosition(sourcePosition, endSourcePosition);
+  }
+
+  SourceFile sourceFileOfElement(Element element) {
+    return element.implementation.compilationUnit.script.file;
+  }
+
+}
diff --git a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
new file mode 100644
index 0000000..1dc3627
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
@@ -0,0 +1,52 @@
+library dart2js.unsugar_cps;
+
+import '../../cps_ir/cps_ir_nodes.dart';
+
+// TODO(karlklose): share the [ParentVisitor].
+import '../../cps_ir/optimizers.dart';
+import '../../constants/expressions.dart';
+import '../../constants/values.dart';
+
+/// Rewrites the initial CPS IR to make Dart semantics explicit and inserts
+/// special nodes that respect JavaScript behavior.
+///
+/// Performs the following rewrites:
+///  - rewrite [IsTrue] in a [Branch] to do boolean conversion.
+class UnsugarVisitor extends RecursiveVisitor {
+  const UnsugarVisitor();
+
+  void rewrite(FunctionDefinition function) {
+    // Set all parent pointers.
+    new ParentVisitor().visit(function);
+    visit(function);
+  }
+
+  @override
+  visit(Node node) {
+    Node result = node.accept(this);
+    return result != null ? result : node;
+  }
+
+  Constant get trueConstant {
+    return new Constant(
+        new PrimitiveConstantExpression(
+            new TrueConstantValue()));
+  }
+
+  processBranch(Branch node) {
+    // TODO(karlklose): implement the checked mode part of boolean conversion.
+    InteriorNode parent = node.parent;
+    IsTrue condition = node.condition;
+    Primitive t = trueConstant;
+    Primitive i = new Identical(condition.value.definition, t);
+    LetPrim newNode = new LetPrim(t,
+        new LetPrim(i,
+            new Branch(new IsTrue(i),
+                node.trueContinuation.definition,
+                node.falseContinuation.definition)));
+    condition.value.unlink();
+    node.trueContinuation.unlink();
+    node.falseContinuation.unlink();
+    parent.body = newNode;
+  }
+}
diff --git a/pkg/compiler/lib/src/js_backend/js_backend.dart b/pkg/compiler/lib/src/js_backend/js_backend.dart
index df03b80..1667ec7 100644
--- a/pkg/compiler/lib/src/js_backend/js_backend.dart
+++ b/pkg/compiler/lib/src/js_backend/js_backend.dart
@@ -7,7 +7,8 @@
 import 'dart:async' show EventSink, Future;
 import 'dart:collection' show Queue, LinkedHashMap, LinkedHashSet;
 
-import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' as embeddedNames;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart'
+    as embeddedNames;
 
 import '../closure.dart';
 import '../constants/expressions.dart';
@@ -30,6 +31,8 @@
 
 import '../elements/visitor.dart' show
     ElementVisitor;
+import '../js_backend/codegen/task.dart';
+import 'patch_resolver.dart';
 
 part 'backend.dart';
 part 'checked_mode_helpers.dart';
diff --git a/pkg/compiler/lib/src/js_backend/minify_namer.dart b/pkg/compiler/lib/src/js_backend/minify_namer.dart
index a318279..4641afdd 100644
--- a/pkg/compiler/lib/src/js_backend/minify_namer.dart
+++ b/pkg/compiler/lib/src/js_backend/minify_namer.dart
@@ -10,6 +10,7 @@
 class MinifyNamer extends Namer {
   MinifyNamer(Compiler compiler) : super(compiler) {
     reserveBackendNames();
+    fieldRegistry = new _FieldNamingRegistry(this);
   }
 
   String get isolateName => 'I';
@@ -20,8 +21,10 @@
   final String setterPrefix = 's';
   final String callPrefix = ''; // this will create function names $<n>
 
-  static const ALPHABET_CHARACTERS = 52;  // a-zA-Z.
-  static const ALPHANUMERIC_CHARACTERS = 62;  // a-zA-Z0-9.
+  final ALPHABET_CHARACTERS = 52;  // a-zA-Z.
+  final ALPHANUMERIC_CHARACTERS = 62;  // a-zA-Z0-9.
+
+  _FieldNamingRegistry fieldRegistry;
 
   // You can pass an invalid identifier to this and unlike its non-minifying
   // counterpart it will never return the proposedName as the new fresh name.
@@ -34,7 +37,8 @@
     if (suggestion != null && !usedNames.contains(suggestion)) {
       freshName = suggestion;
     } else {
-      freshName = _getUnusedName(proposedName, usedNames);
+      freshName = _getUnusedName(proposedName, usedNames,
+          suggestedNames.values);
     }
     usedNames.add(freshName);
     return freshName;
@@ -47,34 +51,36 @@
     return "${getMappedInstanceName('closure')}_$id";
   }
 
-  void reserveBackendNames() {
-    // From issue 7554.  These should not be used on objects (as instance
-    // variables) because they clash with names from the DOM.
-    const reservedNativeProperties = const <String>[
-        'Q', 'a', 'b', 'c', 'd', 'e', 'f', 'r', 'x', 'y', 'z',
-        // 2-letter:
-        'ch', 'cx', 'cy', 'db', 'dx', 'dy', 'fr', 'fx', 'fy', 'go', 'id', 'k1',
-        'k2', 'k3', 'k4', 'r1', 'r2', 'rx', 'ry', 'x1', 'x2', 'y1', 'y2',
-        // 3-letter:
-        'add', 'all', 'alt', 'arc', 'CCW', 'cmp', 'dir', 'end', 'get', 'in1',
-        'in2', 'INT', 'key', 'log', 'low', 'm11', 'm12', 'm13', 'm14', 'm21',
-        'm22', 'm23', 'm24', 'm31', 'm32', 'm33', 'm34', 'm41', 'm42', 'm43',
-        'm44', 'max', 'min', 'now', 'ONE', 'put', 'red', 'rel', 'rev', 'RGB',
-        'sdp', 'set', 'src', 'tag', 'top', 'uid', 'uri', 'url', 'URL',
-        // 4-letter:
-        'abbr', 'atob', 'Attr', 'axes', 'axis', 'back', 'BACK', 'beta', 'bias',
-        'Blob', 'blue', 'blur', 'BLUR', 'body', 'BOOL', 'BOTH', 'btoa', 'BYTE',
-        'cite', 'clip', 'code', 'cols', 'cues', 'data', 'DECR', 'DONE', 'face',
-        'file', 'File', 'fill', 'find', 'font', 'form', 'gain', 'hash', 'head',
-        'high', 'hint', 'host', 'href', 'HRTF', 'IDLE', 'INCR', 'info', 'INIT',
-        'isId', 'item', 'KEEP', 'kind', 'knee', 'lang', 'left', 'LESS', 'line',
-        'link', 'list', 'load', 'loop', 'mode', 'name', 'Node', 'None', 'NONE',
-        'only', 'open', 'OPEN', 'ping', 'play', 'port', 'rect', 'Rect', 'refX',
-        'refY', 'RGBA', 'root', 'rows', 'save', 'seed', 'seek', 'self', 'send',
-        'show', 'SINE', 'size', 'span', 'stat', 'step', 'stop', 'tags', 'text',
-        'Text', 'time', 'type', 'view', 'warn', 'wrap', 'ZERO'];
+  // From issue 7554.  These should not be used on objects (as instance
+  // variables) because they clash with names from the DOM. However, it is
+  // OK to use them as fields, as we only access fields directly if we know
+  // the receiver type.
+  static const _reservedNativeProperties = const <String>[
+      'Q', 'a', 'b', 'c', 'd', 'e', 'f', 'r', 'x', 'y', 'z',
+      // 2-letter:
+      'ch', 'cx', 'cy', 'db', 'dx', 'dy', 'fr', 'fx', 'fy', 'go', 'id', 'k1',
+      'k2', 'k3', 'k4', 'r1', 'r2', 'rx', 'ry', 'x1', 'x2', 'y1', 'y2',
+      // 3-letter:
+      'add', 'all', 'alt', 'arc', 'CCW', 'cmp', 'dir', 'end', 'get', 'in1',
+      'in2', 'INT', 'key', 'log', 'low', 'm11', 'm12', 'm13', 'm14', 'm21',
+      'm22', 'm23', 'm24', 'm31', 'm32', 'm33', 'm34', 'm41', 'm42', 'm43',
+      'm44', 'max', 'min', 'now', 'ONE', 'put', 'red', 'rel', 'rev', 'RGB',
+      'sdp', 'set', 'src', 'tag', 'top', 'uid', 'uri', 'url', 'URL',
+      // 4-letter:
+      'abbr', 'atob', 'Attr', 'axes', 'axis', 'back', 'BACK', 'beta', 'bias',
+      'Blob', 'blue', 'blur', 'BLUR', 'body', 'BOOL', 'BOTH', 'btoa', 'BYTE',
+      'cite', 'clip', 'code', 'cols', 'cues', 'data', 'DECR', 'DONE', 'face',
+      'file', 'File', 'fill', 'find', 'font', 'form', 'gain', 'hash', 'head',
+      'high', 'hint', 'host', 'href', 'HRTF', 'IDLE', 'INCR', 'info', 'INIT',
+      'isId', 'item', 'KEEP', 'kind', 'knee', 'lang', 'left', 'LESS', 'line',
+      'link', 'list', 'load', 'loop', 'mode', 'name', 'Node', 'None', 'NONE',
+      'only', 'open', 'OPEN', 'ping', 'play', 'port', 'rect', 'Rect', 'refX',
+      'refY', 'RGBA', 'root', 'rows', 'save', 'seed', 'seek', 'self', 'send',
+      'show', 'SINE', 'size', 'span', 'stat', 'step', 'stop', 'tags', 'text',
+      'Text', 'time', 'type', 'view', 'warn', 'wrap', 'ZERO'];
 
-    for (var name in reservedNativeProperties) {
+  void reserveBackendNames() {
+    for (var name in _reservedNativeProperties) {
       if (name.length < 2) {
         instanceNameMap[name] = name;
       }
@@ -95,15 +101,17 @@
         suggestedInstanceNames,
         usedInstanceNames,
         const <String>[
-            r'$add', r'add$1', r'$and', r'codeUnitAt$1', r'$or',
+            r'$add', r'add$1', r'$and',
+            r'$or',
             r'current', r'$shr', r'$eq', r'$ne',
-            r'getPrototypeOf', r'hasOwnProperty', r'$index', r'$indexSet',
-            r'$isJavaScriptIndexingBehavior', r'$xor',
-            r'iterator', r'length', r'$lt', r'$gt', r'$le', r'$ge',
+            r'$index', r'$indexSet',
+            r'$xor', r'clone$0',
+            r'iterator', r'length',
+            r'$lt', r'$gt', r'$le', r'$ge',
             r'moveNext$0', r'node', r'on', r'$negate', r'push', r'self',
             r'start', r'target', r'$shl', r'value', r'width', r'style',
             r'noSuchMethod$1', r'$mul', r'$div', r'$sub', r'$not', r'$mod',
-            r'$tdiv']);
+            r'$tdiv', r'toString$0']);
 
     _populateSuggestedNames(
         suggestedGlobalNames,
@@ -111,16 +119,18 @@
         const <String>[
             r'Object', 'wrapException', r'$eq', r'S', r'ioore',
             r'UnsupportedError$', r'length', r'$sub',
-            r'getInterceptor$JSArrayJSString', r'$add',
-            r'$gt', r'$ge', r'$lt', r'$le', r'add', r'getInterceptor$JSNumber',
-            r'iterator', r'$index', r'iae', r'getInterceptor$JSArray',
-            r'ArgumentError$', r'BoundClosure', r'StateError$',
-            r'getInterceptor', r'max', r'$mul', r'List_List', r'Map_Map',
-            r'getInterceptor$JSString', r'$div', r'$indexSet',
-            r'List_List$from', r'Set_Set$from', r'toString', r'toInt', r'min',
-            r'StringBuffer_StringBuffer', r'contains1', r'WhereIterable$',
+            r'$add', r'$gt', r'$ge', r'$lt', r'$le', r'add',
+            r'iae',
+            r'ArgumentError$', r'BoundClosure', r'Closure', r'StateError$',
+            r'getInterceptor', r'max', r'$mul',
+            r'Map', r'Key_Key', r'$div',
+            r'List_List$from',
+            r'LinkedHashMap_LinkedHashMap$_empty',
+            r'LinkedHashMap_LinkedHashMap$_literal',
+            r'min',
             r'RangeError$value', r'JSString', r'JSNumber',
-            r'JSArray', r'createInvocationMirror'
+            r'JSArray', r'createInvocationMirror', r'String',
+            r'setRuntimeTypeInfo', r'createRuntimeType'
             ]);
   }
 
@@ -145,7 +155,8 @@
   // is slightly less efficient than just getting the next name in a series,
   // but it means that small changes in the input program will give smallish
   // changes in the output, which can be useful for diffing etc.
-  String _getUnusedName(String proposedName, Set<String> usedNames) {
+  String _getUnusedName(String proposedName, Set<String> usedNames,
+                        Iterable<String> suggestions) {
     int hash = _calculateHash(proposedName);
     // Avoid very small hashes that won't try many names.
     hash = hash < 1000 ? hash * 314159 : hash;  // Yes, it's prime.
@@ -155,7 +166,7 @@
     // in a predictable order determined by the proposed name.  This is in order
     // to make the renamer stable: small changes in the input should nornally
     // result in relatively small changes in the output.
-    for (var n = 2; n <= 3; n++) {
+    for (var n = 1; n <= 3; n++) {
       int h = hash;
       while (h > 10) {
         var codes = <int>[_letterNumber(h)];
@@ -167,7 +178,8 @@
         final candidate = new String.fromCharCodes(codes);
         if (!usedNames.contains(candidate) &&
             !jsReserved.contains(candidate) &&
-            !_hasBannedPrefix(candidate)) {
+            !_hasBannedPrefix(candidate) &&
+            (n != 1 || !suggestions.contains(candidate))) {
           return candidate;
         }
         // Try again with a slightly different hash.  After around 10 turns
@@ -175,18 +187,7 @@
         h ~/= 7;
       }
     }
-
-    // If we can't find a hash based name in the three-letter space, then base
-    // the name on a letter and a counter.
-    var startLetter = new String.fromCharCodes([_letterNumber(hash)]);
-    var i = 0;
-    while (usedNames.contains("$startLetter$i")) {
-      i++;
-    }
-    // We don't need to check for banned prefix because the name is in the form
-    // xnnn, where nnn is a number.  There can be no getter or setter called
-    // gnnn since that would imply a numeric field name.
-    return "$startLetter$i";
+    return _badName(hash, usedNames);
   }
 
   /// Instance members starting with g and s are reserved for getters and
@@ -209,6 +210,21 @@
     return h;
   }
 
+  /// If we can't find a hash based name in the three-letter space, then base
+  /// the name on a letter and a counter.
+  String _badName(int hash, Set<String> usedNames) {
+    var startLetter = new String.fromCharCodes([_letterNumber(hash)]);
+    var name;
+    var i = 0;
+    do {
+      name = "$startLetter${i++}";
+    } while (usedNames.contains(name));
+    // We don't need to check for banned prefix because the name is in the form
+    // xnnn, where nnn is a number.  There can be no getter or setter called
+    // gnnn since that would imply a numeric field name.
+    return name;
+  }
+
   int _letterNumber(int x) {
     if (x >= ALPHABET_CHARACTERS) x %= ALPHABET_CHARACTERS;
     if (x < 26) return $a + x;
@@ -222,4 +238,209 @@
     return $0 + x - 52;
   }
 
+  String instanceFieldPropertyName(Element element) {
+    if (element.hasFixedBackendName) {
+      return element.fixedBackendName;
+    }
+
+    _FieldNamingScope names;
+    if (element is BoxFieldElement) {
+      names = new _FieldNamingScope.forBox(element.box, fieldRegistry);
+    } else {
+      ClassElement cls = element is ClosureFieldElement
+          ? element.closureClass : element.enclosingClass;
+      names = new _FieldNamingScope.forClass(cls, compiler.world,
+          fieldRegistry);
+    }
+
+    // The inheritance scope based naming did not yield a name. For instance,
+    // this could be because the field belongs to a mixin.
+    if (!names.containsField(element)) {
+      return super.instanceFieldPropertyName(element);
+    }
+
+    return names[element];
+  }
+}
+
+/**
+ * Encapsulates the global state of field naming.
+ */
+class _FieldNamingRegistry {
+  final MinifyNamer namer;
+
+  final Map<Entity, _FieldNamingScope> scopes =
+      new Map<Entity, _FieldNamingScope>();
+
+  final Map<Entity, String> globalNames = new Map<Entity, String>();
+
+  int globalCount = 0;
+
+  final List<String> nameStore = new List<String>();
+
+  _FieldNamingRegistry(this.namer);
+
+  String getName(int count) {
+    if (count >= nameStore.length) {
+      // The namer usually does not use certain names as they clash with
+      // existing properties on JS objects (see [_reservedNativeProperties]).
+      // However, some of them are really short and safe to use for fields.
+      // Thus, we shortcut the namer to use those first.
+      if (count < MinifyNamer._reservedNativeProperties.length &&
+          MinifyNamer._reservedNativeProperties[count].length <= 2) {
+        nameStore.add(MinifyNamer._reservedNativeProperties[count]);
+      } else {
+        nameStore.add(namer.getFreshName("field$count",
+            namer.usedInstanceNames, namer.suggestedInstanceNames,
+            ensureSafe: true));
+      }
+    }
+
+    return nameStore[count];
+  }
+}
+
+/**
+ * A [_FieldNamingScope] encodes a node in the inheritance tree of the current
+ * class hierarchy. The root node typically is the node corresponding to the
+ * `Object` class. It is used to assign a unique name to each field of a class.
+ * Unique here means unique wrt. all fields along the path back to the root.
+ * This is achieved at construction time via the [_fieldNameCounter] field that counts the
+ * number of fields on the path to the root node that have been encountered so
+ * far.
+ *
+ * Obviously, this only works if no fields are added to a parent node after its
+ * children have added their first field.
+ */
+class _FieldNamingScope {
+  final _FieldNamingScope superScope;
+  final Entity container;
+  final Map<Element, String> names = new Maplet<Element, String>();
+  final _FieldNamingRegistry registry;
+
+  /// Naming counter used for fields of ordinary classes.
+  int _fieldNameCounter;
+
+  /// The number of fields along the superclass chain that use inheritance
+  /// based naming, including the ones allocated for this scope.
+  int get inheritanceBasedFieldNameCounter => _fieldNameCounter;
+
+  /// The number of locally used fields. Depending on the naming source
+  /// (e.g. inheritance based or globally unique for mixixns) this
+  /// might be different from [inheritanceBasedFieldNameCounter].
+  int get _localFieldNameCounter => _fieldNameCounter;
+  void set _localFieldNameCounter(int val) { _fieldNameCounter = val; }
+
+  factory _FieldNamingScope.forClass(ClassElement cls, ClassWorld world,
+      _FieldNamingRegistry registry) {
+    _FieldNamingScope result = registry.scopes[cls];
+    if (result != null) return result;
+
+    if (world.isUsedAsMixin(cls)) {
+      result = new _MixinFieldNamingScope.mixin(cls, registry);
+    } else {
+      if (cls.superclass == null) {
+        result = new _FieldNamingScope.rootScope(cls, registry);
+      } else {
+        _FieldNamingScope superScope = new _FieldNamingScope.forClass(
+            cls.superclass, world, registry);
+        if (cls.isMixinApplication) {
+          result = new _MixinFieldNamingScope.mixedIn(cls, superScope,
+              registry);
+        } else {
+          result = new _FieldNamingScope.inherit(cls, superScope, registry);
+        }
+      }
+    }
+
+    cls.forEachInstanceField((cls, field) => result.add(field));
+
+    registry.scopes[cls] = result;
+    return result;
+  }
+
+  factory _FieldNamingScope.forBox(Local box, _FieldNamingRegistry registry) {
+    return registry.scopes.putIfAbsent(box,
+        () => new _BoxFieldNamingScope(box, registry));
+  }
+
+  _FieldNamingScope.rootScope(this.container, this.registry)
+    : superScope = null,
+      _fieldNameCounter = 0;
+
+  _FieldNamingScope.inherit(this.container, this.superScope, this.registry) {
+    _fieldNameCounter = superScope.inheritanceBasedFieldNameCounter;
+  }
+
+  /**
+   * Checks whether [name] is already used in the current scope chain.
+   */
+  _isNameUnused(String name) {
+    return !names.values.contains(name) &&
+        ((superScope == null) || superScope._isNameUnused(name));
+  }
+
+  String _nextName() => registry.getName(_localFieldNameCounter++);
+
+  String operator[](Element field) {
+    String name = names[field];
+    if (name == null && superScope != null) return superScope[field];
+    return name;
+  }
+
+  void add(Element field) {
+    if (names.containsKey(field)) return;
+
+    String value = _nextName();
+    assert(invariant(field, _isNameUnused(value)));
+    names[field] = value;
+  }
+
+  bool containsField(Element field) => names.containsKey(field);
+}
+
+/**
+ * Field names for mixins have two constraints: They need to be unique in the
+ * hierarchy of each application of a mixin and they need to be the same for
+ * all applications of a mixin. To achieve this, we use global naming for
+ * mixins from the same name pool as fields and add a `$` at the end to ensure
+ * they do not collide with normal field names. The `$` sign is typically used
+ * as a separator between method names and argument counts and does not appear
+ * in generated names themselves.
+ */
+class _MixinFieldNamingScope extends _FieldNamingScope {
+  int get _localFieldNameCounter => registry.globalCount;
+  void set _localFieldNameCounter(int val) { registry.globalCount = val; }
+
+  Map<Entity, String> get names => registry.globalNames;
+
+  _MixinFieldNamingScope.mixin(ClassElement cls, _FieldNamingRegistry registry)
+    : super.rootScope(cls, registry);
+
+  _MixinFieldNamingScope.mixedIn(MixinApplicationElement container,
+      _FieldNamingScope superScope, _FieldNamingRegistry registry)
+    : super.inherit(container, superScope, registry);
+
+  String _nextName() {
+    var proposed = super._nextName();
+    return proposed + r'$';
+  }
+}
+
+/**
+ * [BoxFieldElement] fields work differently in that they do not belong to an
+ * actual class but an anonymous box associated to a [Local]. As there is no
+ * inheritance chain, we do not need to compute fields a priori but can assign
+ * names on the fly.
+ */
+class _BoxFieldNamingScope extends _FieldNamingScope {
+  _BoxFieldNamingScope(Local box, _FieldNamingRegistry registry) :
+    super.rootScope(box, registry);
+
+  bool containsField(_) => true;
+
+  String operator[](Element field) {
+    if (!names.containsKey(field)) add(field);
+    return names[field];
+  }
 }
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 4eff34a..a4a158f 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -220,6 +220,7 @@
   final String currentIsolate = r'$';
   final String getterPrefix = r'get$';
   final String setterPrefix = r'set$';
+  final String superPrefix = r'super$';
   final String metadataField = '@';
   final String callPrefix = 'call';
   final String callCatchAllName = r'call$catchAll';
@@ -809,6 +810,15 @@
   // TODO(ahe): Remove this method. Use get getNameOfMember instead.
   String getNameOfInstanceMember(Element member) => getNameX(member);
 
+  String getNameOfAliasedSuperMember(Element member) {
+    ClassElement superClass = member.enclosingClass;
+    String className = getNameOfClass(superClass);
+    String memberName = getNameOfMember(member);
+    String proposal = "$superPrefix$className\$$memberName";
+    // TODO(herhut): Use field naming constraints (unique wrt. inheritance).
+    return getMappedInstanceName(proposal);
+  }
+
   String getNameOfMember(Element member) => getNameX(member);
 
   String getNameOfGlobalField(VariableElement field) => getNameX(field);
@@ -882,25 +892,25 @@
 
   String globalObjectForConstant(ConstantValue constant) => 'C';
 
-  String operatorIsPrefix() => r'$is';
+  String get operatorIsPrefix => r'$is';
 
-  String operatorAsPrefix() => r'$as';
+  String get operatorAsPrefix => r'$as';
 
-  String operatorSignature() => r'$signature';
+  String get operatorSignature => r'$signature';
 
-  String typedefTag() => r'typedef';
+  String get typedefTag => r'typedef';
 
-  String functionTypeTag() => r'func';
+  String get functionTypeTag => r'func';
 
-  String functionTypeVoidReturnTag() => r'void';
+  String get functionTypeVoidReturnTag => r'void';
 
-  String functionTypeReturnTypeTag() => r'ret';
+  String get functionTypeReturnTypeTag => r'ret';
 
-  String functionTypeRequiredParametersTag() => r'args';
+  String get functionTypeRequiredParametersTag => r'args';
 
-  String functionTypeOptionalParametersTag() => r'opt';
+  String get functionTypeOptionalParametersTag => r'opt';
 
-  String functionTypeNamedParametersTag() => r'named';
+  String get functionTypeNamedParametersTag => r'named';
 
   Map<FunctionType,String> functionTypeNameMap =
       new Map<FunctionType,String>();
@@ -918,14 +928,14 @@
   String operatorIsType(DartType type) {
     if (type.isFunctionType) {
       // TODO(erikcorry): Reduce from $isx to ix when we are minifying.
-      return '${operatorIsPrefix()}_${getFunctionTypeName(type)}';
+      return '${operatorIsPrefix}_${getFunctionTypeName(type)}';
     }
     return operatorIs(type.element);
   }
 
   String operatorIs(Element element) {
     // TODO(erikcorry): Reduce from $isx to ix when we are minifying.
-    return '${operatorIsPrefix()}${getRuntimeTypeName(element)}';
+    return '${operatorIsPrefix}${getRuntimeTypeName(element)}';
   }
 
   /*
@@ -944,7 +954,7 @@
     // TODO(ahe): Creating a string here is unfortunate. It is slow (due to
     // string concatenation in the implementation), and may prevent
     // segmentation of '$'.
-    return '${operatorAsPrefix()}${getNameForRti(element)}';
+    return '${operatorAsPrefix}${getNameForRti(element)}';
   }
 
   String safeName(String name) => _safeName(name, jsReserved);
diff --git a/pkg/compiler/lib/src/js_backend/native_emitter.dart b/pkg/compiler/lib/src/js_backend/native_emitter.dart
index d585594..3c12682 100644
--- a/pkg/compiler/lib/src/js_backend/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/native_emitter.dart
@@ -112,7 +112,7 @@
     Set<ClassElement> neededByConstant =
         emitterTask.interceptorsReferencedFromConstants();
     Set<ClassElement> modifiedClasses =
-        emitterTask.typeTestEmitter.classesModifiedByEmitRuntimeTypeSupport();
+        emitterTask.typeTestRegistry.classesModifiedByEmitRuntimeTypeSupport();
 
     for (ClassElement classElement in preOrder.reversed) {
       // Post-order traversal ensures we visit the subclasses before their
@@ -313,7 +313,7 @@
         classElement, builder);
     emitterTask.oldEmitter.classEmitter.emitInstanceMembers(
         classElement, builder);
-    emitterTask.typeTestEmitter.emitIsTests(classElement, builder);
+    emitterTask.oldEmitter.typeTestEmitter.emitIsTests(classElement, builder);
 
     if (!hasFields &&
         builder.properties.length == propertyCount &&
diff --git a/pkg/compiler/lib/src/js_backend/patch_resolver.dart b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
new file mode 100644
index 0000000..d538fe5
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
@@ -0,0 +1,159 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.js_backend.patch_resolver;
+
+import '../dart2jslib.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart';
+import '../resolution/resolution.dart';
+import '../tree/tree.dart';
+import '../util/util.dart';
+
+class PatchResolverTask extends CompilerTask {
+  PatchResolverTask(Compiler compiler) : super(compiler);
+
+  String get name => 'JavaScript patch resolver';
+
+  FunctionElement resolveExternalFunction(FunctionElementX element) {
+    if (element.isPatched) {
+      FunctionElementX patch = element.patch;
+      compiler.withCurrentElement(patch, () {
+        patch.parseNode(compiler);
+        patch.computeType(compiler);
+      });
+      checkMatchingPatchSignatures(element, patch);
+      element = patch;
+      ResolverTask.processAsyncMarker(compiler, element);
+    } else {
+      compiler.reportError(
+         element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
+    }
+    return element;
+  }
+
+  void checkMatchingPatchParameters(FunctionElement origin,
+                                    Link<Element> originParameters,
+                                    Link<Element> patchParameters) {
+    while (!originParameters.isEmpty) {
+      ParameterElementX originParameter = originParameters.head;
+      ParameterElementX patchParameter = patchParameters.head;
+      // TODO(johnniwinther): Remove the conditional patching when we never
+      // resolve the same method twice.
+      if (!originParameter.isPatched) {
+        originParameter.applyPatch(patchParameter);
+      } else {
+        assert(invariant(origin, originParameter.patch == patchParameter,
+               message: "Inconsistent repatch of $originParameter."));
+      }
+      DartType originParameterType = originParameter.computeType(compiler);
+      DartType patchParameterType = patchParameter.computeType(compiler);
+      if (originParameterType != patchParameterType) {
+        compiler.reportError(
+            originParameter.parseNode(compiler),
+            MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
+            {'methodName': origin.name,
+             'parameterName': originParameter.name,
+             'originParameterType': originParameterType,
+             'patchParameterType': patchParameterType});
+        compiler.reportInfo(patchParameter,
+            MessageKind.PATCH_POINT_TO_PARAMETER,
+            {'parameterName': patchParameter.name});
+      } else {
+        // Hack: Use unparser to test parameter equality. This only works
+        // because we are restricting patch uses and the approach cannot be used
+        // elsewhere.
+
+        // The node contains the type, so there is a potential overlap.
+        // Therefore we only check the text if the types are identical.
+        String originParameterText =
+            originParameter.parseNode(compiler).toString();
+        String patchParameterText =
+            patchParameter.parseNode(compiler).toString();
+        if (originParameterText != patchParameterText
+            // We special case the list constructor because of the
+            // optional parameter.
+            && origin != compiler.unnamedListConstructor) {
+          compiler.reportError(
+              originParameter.parseNode(compiler),
+              MessageKind.PATCH_PARAMETER_MISMATCH,
+              {'methodName': origin.name,
+               'originParameter': originParameterText,
+               'patchParameter': patchParameterText});
+          compiler.reportInfo(patchParameter,
+              MessageKind.PATCH_POINT_TO_PARAMETER,
+              {'parameterName': patchParameter.name});
+        }
+      }
+
+      originParameters = originParameters.tail;
+      patchParameters = patchParameters.tail;
+    }
+  }
+
+  void checkMatchingPatchSignatures(FunctionElement origin,
+                                    FunctionElement patch) {
+    // TODO(johnniwinther): Show both origin and patch locations on errors.
+    FunctionExpression originTree = origin.node;
+    FunctionSignature originSignature = origin.functionSignature;
+    FunctionExpression patchTree = patch.node;
+    FunctionSignature patchSignature = patch.functionSignature;
+
+    if (originSignature.type.returnType != patchSignature.type.returnType) {
+      compiler.withCurrentElement(patch, () {
+        Node errorNode =
+            patchTree.returnType != null ? patchTree.returnType : patchTree;
+        compiler.reportError(
+            errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH,
+            {'methodName': origin.name,
+             'originReturnType': originSignature.type.returnType,
+             'patchReturnType': patchSignature.type.returnType});
+      });
+    }
+    if (originSignature.requiredParameterCount !=
+        patchSignature.requiredParameterCount) {
+      compiler.withCurrentElement(patch, () {
+        compiler.reportError(
+            patchTree,
+            MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
+            {'methodName': origin.name,
+             'originParameterCount': originSignature.requiredParameterCount,
+             'patchParameterCount': patchSignature.requiredParameterCount});
+      });
+    } else {
+      checkMatchingPatchParameters(origin,
+                                   originSignature.requiredParameters,
+                                   patchSignature.requiredParameters);
+    }
+    if (originSignature.optionalParameterCount != 0 &&
+        patchSignature.optionalParameterCount != 0) {
+      if (originSignature.optionalParametersAreNamed !=
+          patchSignature.optionalParametersAreNamed) {
+        compiler.withCurrentElement(patch, () {
+          compiler.reportError(
+              patchTree,
+              MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
+              {'methodName': origin.name});
+        });
+      }
+    }
+    if (originSignature.optionalParameterCount !=
+        patchSignature.optionalParameterCount) {
+      compiler.withCurrentElement(patch, () {
+        compiler.reportError(
+            patchTree,
+            MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
+            {'methodName': origin.name,
+             'originParameterCount': originSignature.optionalParameterCount,
+             'patchParameterCount': patchSignature.optionalParameterCount});
+      });
+    } else {
+      checkMatchingPatchParameters(origin,
+                                   originSignature.optionalParameters,
+                                   patchSignature.optionalParameters);
+    }
+  }
+
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index cb4e509..f32d77f 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -676,18 +676,18 @@
     }
 
     jsAst.LiteralString name = js.string(namer.getFunctionTypeName(type));
-    addProperty(namer.functionTypeTag(), name);
+    addProperty(namer.functionTypeTag, name);
     if (type.returnType.isVoid) {
-      addProperty(namer.functionTypeVoidReturnTag(), js('true'));
+      addProperty(namer.functionTypeVoidReturnTag, js('true'));
     } else if (!type.returnType.treatAsDynamic) {
-      addProperty(namer.functionTypeReturnTypeTag(), visit(type.returnType));
+      addProperty(namer.functionTypeReturnTypeTag, visit(type.returnType));
     }
     if (!type.parameterTypes.isEmpty) {
-      addProperty(namer.functionTypeRequiredParametersTag(),
+      addProperty(namer.functionTypeRequiredParametersTag,
                   visitList(type.parameterTypes));
     }
     if (!type.optionalParameterTypes.isEmpty) {
-      addProperty(namer.functionTypeOptionalParametersTag(),
+      addProperty(namer.functionTypeOptionalParametersTag,
                   visitList(type.optionalParameterTypes));
     }
     if (!type.namedParameterTypes.isEmpty) {
@@ -699,7 +699,7 @@
         jsAst.Expression name = js.string(names[index]);
         namedArguments.add(new jsAst.Property(name, visit(types[index])));
       }
-      addProperty(namer.functionTypeNamedParametersTag(),
+      addProperty(namer.functionTypeNamedParametersTag,
                   new jsAst.ObjectInitializer(namedArguments));
     }
     return new jsAst.ObjectInitializer(properties);
@@ -726,7 +726,7 @@
           type.treatAsRaw ? name : visitList(type.typeArguments, head: name);
 
       // Add it to the function-type object.
-      jsAst.LiteralString tag = js.string(namer.typedefTag());
+      jsAst.LiteralString tag = js.string(namer.typedefTag);
       initializer.properties.add(new jsAst.Property(tag, encodedTypedef));
       return initializer;
     } else {
diff --git a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
index de0592b..3cecbec 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -15,7 +15,7 @@
 class CodeEmitterTask extends CompilerTask {
   // TODO(floitsch): the code-emitter task should not need a namer.
   final Namer namer;
-  final TypeTestEmitter typeTestEmitter = new TypeTestEmitter();
+  final TypeTestRegistry typeTestRegistry;
   NativeEmitter nativeEmitter;
   OldEmitter oldEmitter;
   Emitter emitter;
@@ -47,13 +47,13 @@
 
   CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap)
       : super(compiler),
-        this.namer = namer {
+        this.namer = namer,
+        this.typeTestRegistry = new TypeTestRegistry(compiler) {
     oldEmitter = new OldEmitter(compiler, namer, generateSourceMap, this);
     emitter = USE_NEW_EMITTER
         ? new new_js_emitter.Emitter(compiler, namer)
         : oldEmitter;
     nativeEmitter = new NativeEmitter(this);
-    typeTestEmitter.emitter = this.oldEmitter;
   }
 
 
@@ -145,7 +145,7 @@
         }
       }
       for (ClassElement cls in neededClasses) {
-        final onlyForRti = typeTestEmitter.rtiNeededClasses.contains(cls);
+        final onlyForRti = typeTestRegistry.rtiNeededClasses.contains(cls);
         if (!onlyForRti) {
           backend.retainMetadataOf(cls);
           oldEmitter.classEmitter.visitFields(cls, false,
@@ -248,10 +248,13 @@
     // these are thought to not have been instantiated, so we neeed to be able
     // to identify them later and make sure we only emit "empty shells" without
     // fields, etc.
-    typeTestEmitter.computeRtiNeededClasses();
-    typeTestEmitter.rtiNeededClasses.removeAll(neededClasses);
+    typeTestRegistry.computeRtiNeededClasses();
+
+    // TODO(floitsch): either change the name, or get the rti-classes
+    // differently.
+    typeTestRegistry.rtiNeededClasses.removeAll(neededClasses);
     // rtiNeededClasses now contains only the "empty shells".
-    neededClasses.addAll(typeTestEmitter.rtiNeededClasses);
+    neededClasses.addAll(typeTestRegistry.rtiNeededClasses);
 
     // TODO(18175, floitsch): remove once issue 18175 is fixed.
     if (neededClasses.contains(backend.jsIntClass)) {
@@ -278,7 +281,7 @@
 
     for (ClassElement element in sortedClasses) {
       if (Elements.isNativeOrExtendsNative(element) &&
-          !typeTestEmitter.rtiNeededClasses.contains(element)) {
+          !typeTestRegistry.rtiNeededClasses.contains(element)) {
         // For now, native classes and related classes cannot be deferred.
         nativeClasses.add(element);
         if (!element.isNative) {
@@ -329,7 +332,7 @@
 
       // Compute the required type checks to know which classes need a
       // 'is$' method.
-      typeTestEmitter.computeRequiredTypeChecks();
+      typeTestRegistry.computeRequiredTypeChecks();
 
       computeNeededDeclarations();
       computeNeededConstants();
diff --git a/pkg/compiler/lib/src/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
index 2da79fe..1d16321 100644
--- a/pkg/compiler/lib/src/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -92,6 +92,7 @@
 part 'code_emitter_task.dart';
 part 'helpers.dart';
 part 'interceptor_stub_generator.dart';
+part 'type_test_registry.dart';
 
 part 'old_emitter/class_builder.dart';
 part 'old_emitter/class_emitter.dart';
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index f70be05..2991db3 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -132,18 +132,27 @@
 class Class {
   final String name;
   final Holder holder;
-  Class superclass;
+  Class _superclass;
   final List<Method> methods;
   final List<InstanceField> fields;
+  final bool onlyForRti;
+  final bool isDirectlyInstantiated;
 
   /// Whether the class must be evaluated eagerly.
   bool isEager = false;
 
   Class(this.name, this.holder, this.methods, this.fields,
-        { this.isEager: false });
+        {this.onlyForRti,
+         this.isDirectlyInstantiated}) {
+    assert(onlyForRti != null);
+    assert(isDirectlyInstantiated != null);
+  }
+
+  bool get isMixinApplication => false;
+  Class get superclass => _superclass;
 
   void setSuperclass(Class superclass) {
-    this.superclass = superclass;
+    _superclass = superclass;
   }
 
   String get superclassName
@@ -152,6 +161,24 @@
       => (superclass == null) ? 0 : superclass.holder.index;
 }
 
+class MixinApplication extends Class {
+  Class _mixinClass;
+
+  MixinApplication(String name, Holder holder,
+                   {bool onlyForRti,
+                    bool isDirectlyInstantiated})
+      : super(name, holder, const <Method>[], const <InstanceField>[],
+              onlyForRti: onlyForRti,
+              isDirectlyInstantiated: isDirectlyInstantiated);
+
+  bool get isMixinApplication => true;
+  Class get mixinClass => _mixinClass;
+
+  void setMixinClass(Class mixinClass) {
+    _mixinClass = mixinClass;
+  }
+}
+
 class InstanceField {
   final String name;
 
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index 1df89ae..3a6604c 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -78,16 +78,16 @@
     js.Expression code = new js.ArrayInitializer.from(elements);
     return js.js.statement(
         boilerplate,
-        [emitDeferredInitializerGlobal(program.loadMap),
-         emitHolders(unit.holders),
-         namer.elementAccess(backend.getCyclicThrowHelper()),
-         program.outputContainsConstantList,
-         emitEmbeddedGlobals(program.loadMap),
-         emitConstants(unit.constants),
-         emitStaticNonFinalFields(unit.staticNonFinalFields),
-         emitEagerClassInitializations(unit.libraries),
-         unit.main,
-         code]);
+        {'deferredInitializer': emitDeferredInitializerGlobal(program.loadMap),
+         'holders': emitHolders(unit.holders),
+         'cyclicThrow': namer.elementAccess(backend.getCyclicThrowHelper()),
+         'outputContainsConstantList': program.outputContainsConstantList,
+         'embeddedGlobals': emitEmbeddedGlobals(program.loadMap),
+         'constants': emitConstants(unit.constants),
+         'staticNonFinals': emitStaticNonFinalFields(unit.staticNonFinalFields),
+         'eagerClasses': emitEagerClassInitializations(unit.libraries),
+         'main': unit.main,
+         'code': code});
   }
 
   js.Block emitHolders(List<Holder> holders) {
@@ -256,11 +256,20 @@
 
   js.Expression _generateConstructor(Class cls) {
     List<String> allFieldNames = <String>[];
-    Class currentClass = cls;
-    while (currentClass != null) {
-      allFieldNames.addAll(
-          currentClass.fields.map((InstanceField field) => field.name));
-      currentClass = currentClass.superclass;
+
+    // If the class is not directly instantiated we only need it for inheritance
+    // or RTI. In either case we don't need its fields.
+    if (cls.isDirectlyInstantiated) {
+      Class currentClass = cls;
+      while (currentClass != null) {
+        // Mixins are not allowed to inject fields.
+        assert(!currentClass.isMixinApplication ||
+               (currentClass as MixinApplication).mixinClass.fields.isEmpty);
+
+        allFieldNames.addAll(
+            currentClass.fields.map((InstanceField field) => field.name));
+        currentClass = currentClass.superclass;
+      }
     }
     String name = cls.name;
     String parameters = allFieldNames.join(', ');
@@ -316,13 +325,28 @@
   }
 
   js.Expression emitClass(Class cls) {
-    List elements = [ js.string(cls.superclassName),
-                      js.number(cls.superclassHolderIndex),
-                      _generateConstructor(cls) ];
+    if (cls.isMixinApplication) return emitMixinApplication(cls);
+
+    List elements = [js.string(cls.superclassName),
+                     js.number(cls.superclassHolderIndex),
+                     _generateConstructor(cls)];
     Iterable<Method> methods = cls.methods;
     Iterable<Method> gettersSetters = _generateGettersSetters(cls);
     Iterable<Method> allMethods = [methods, gettersSetters].expand((x) => x);
-    elements.addAll(allMethods.expand((e) => [ js.string(e.name), e.code ]));
+    elements.addAll(allMethods.expand((e) => [js.string(e.name), e.code]));
+    return unparse(compiler, new js.ArrayInitializer.from(elements));
+  }
+
+  // This string should be referenced wherever JavaScript code makes assumptions
+  // on the mixin format.
+  static final String mixinFormatDescription =
+      "Mixins have no constructor, but a reference to their mixin class.";
+
+  js.Expression emitMixinApplication(MixinApplication cls) {
+    List elements = [js.string(cls.superclassName),
+                     js.number(cls.superclassHolderIndex),
+                     js.string(cls.mixinClass.name),
+                     js.number(cls.mixinClass.holder.index)];
     return unparse(compiler, new js.ArrayInitializer.from(elements));
   }
 
@@ -334,17 +358,16 @@
   js.Expression emitStaticMethod(StaticMethod method) {
     return unparse(compiler, method.code);
   }
-}
 
-final String boilerplate = r"""
+  static final String boilerplate = """
 {
 // Declare deferred-initializer global.
-#;
+#deferredInitializer;
 
 !function(start, program) {
 
   // Initialize holder objects.
-  #;
+  #holders;
 
   function setupProgram() {
     for (var i = 0; i < program.length - 1; i++) {
@@ -389,7 +412,7 @@
     holder[name] = null;
     holder[getterName] = function() {
       var initializer = compile(name, descriptor);
-      holder[getterName] = function() { #(name) };  // cyclicThrowHelper
+      holder[getterName] = function() { #cyclicThrow(name) };
       var result;
       var sentinelInProgress = descriptor;
       try {
@@ -434,6 +457,10 @@
   function compileConstructor(name, descriptor) {
     descriptor = compile(name, descriptor);
     var prototype = determinePrototype(descriptor);
+    // $mixinFormatDescription.
+    if (typeof descriptor[2] !== 'function') {
+      return compileMixinConstructor(name, prototype, descriptor);
+    }
     var constructor = descriptor[2];
     for (var i = 3; i < descriptor.length; i += 2) {
       prototype[descriptor[i]] = descriptor[i + 1];
@@ -442,6 +469,27 @@
     return constructor;
   }
 
+  function compileMixinConstructor(name, prototype, descriptor) {
+    // $mixinFormatDescription.
+    var mixinName = descriptor[2];
+    var mixinHolderIndex = descriptor[3];
+    var mixin = holders[mixinHolderIndex][mixinName];
+    if (mixin.resolve) mixin = mixin.resolve();
+    var mixinPrototype = mixin.prototype;
+
+    // Fill the prototype with the mixin's properties.
+    var mixinProperties = Object.keys(mixinPrototype);
+    for (var i = 0; i < mixinProperties.length; i++) {
+      var p = mixinProperties[i];
+      prototype[p] = mixinPrototype[p];
+    }
+    // Since this is a mixin application the constructor will actually never
+    // be invoked. We only use its prototype for the application's subclasses. 
+    var constructor = function() {};
+    constructor.prototype = prototype;
+    return constructor;
+  }
+
   function determinePrototype(descriptor) {
     var superclassName = descriptor[0];
     if (!superclassName) return { };
@@ -461,16 +509,16 @@
     'use strict';
     // TODO(floitsch): evaluate the performance impact of the string
     // concatenations.
-    return eval(__s__ + "\n//# sourceURL=" + __name__ + ".js");
+    return eval(__s__ + "\\n//# sourceURL=" + __name__ + ".js");
   }
 
-  if (#) { // outputContainsConstantList
+  if (#outputContainsConstantList) {
     function makeConstList(list) {
       // By assigning a function to the properties they become part of the
       // hidden class. The actual values of the fields don't matter, since we
       // only check if they exist.
-      list.immutable$list = Array;
-      list.fixed$length = Array;
+      list.immutable\$list = Array;
+      list.fixed\$length = Array;
       return list;
     }
   }
@@ -478,21 +526,23 @@
   setupProgram();
 
   // Initialize globals.
-  #;
+  #embeddedGlobals;
 
   // Initialize constants.
-  #;
+  #constants;
 
   // Initialize static non-final fields.
-  #;
+  #staticNonFinals;
 
   // Initialize eager classes.
-  #;
+  #eagerClasses;
 
   var end = Date.now();
   print('Setup: ' + (end - start) + ' ms.');
 
-  if (true) #();  // Start main.
+  #main();  // Start main.
 
-}(Date.now(), #)
+}(Date.now(), #code)
 }""";
+
+}
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
index 13e2df1..35133e5 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
@@ -18,7 +18,7 @@
                      ClassBuilder properties,
                      Map<String, jsAst.Expression> additionalProperties) {
     final onlyForRti =
-        emitter.typeTestEmitter.rtiNeededClasses.contains(classElement);
+        emitter.typeTestRegistry.rtiNeededClasses.contains(classElement);
 
     assert(invariant(classElement, classElement.isDeclaration));
     assert(invariant(classElement, !classElement.isNative || onlyForRti));
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index 802887d..4d6709b 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -388,8 +388,11 @@
     final bool canBeApplied = compiler.enabledFunctionApply &&
                               compiler.world.getMightBePassedToApply(member);
 
+    final bool hasSuperAlias = backend.isAliasedSuperMember(member);
+
     final bool needStructuredInfo =
-        canTearOff || canBeReflected || canBeApplied;
+        canTearOff || canBeReflected || canBeApplied || hasSuperAlias;
+
 
     if (canTearOff) {
       assert(invariant(member, !member.isGenerativeConstructor));
@@ -408,13 +411,14 @@
         tearOffName: tearOffName,
         canBeReflected: canBeReflected,
         canBeApplied: canBeApplied,
-        needStructuredInfo: needStructuredInfo);
-
+        hasSuperAlias: hasSuperAlias,
+        needStructuredInfo: needStructuredInfo
+    );
   }
 
   void addMemberMethodFromInfo(MemberInfo info, ClassBuilder builder) {
     final FunctionElement member = info.member;
-    final String name = info.name;
+    String name = info.name;
     final FunctionSignature parameters = info.parameters;
     jsAst.Expression code = info.code;
     final bool needsStubs = info.needsStubs;
@@ -424,6 +428,7 @@
     final bool canBeReflected = info.canBeReflected;
     final bool canBeApplied = info.canBeApplied;
     final bool needStructuredInfo = info.needStructuredInfo;
+    final bool hasSuperAlias = info.hasSuperAlias;
 
     emitter.interceptorEmitter.recordMangledNameOfMemberMethod(member, name);
 
@@ -435,21 +440,23 @@
             member,
             (Selector selector, jsAst.Fun function) {
               compiler.dumpInfoTask.registerElementAst(member,
-                  builder.addProperty(namer.invocationName(selector), function));
+                  builder.addProperty(namer.invocationName(selector),
+                                      function));
             });
       }
       return;
     }
 
 
-    // This element is needed for reflection or needs additional stubs. So we
-    // need to retain additional information.
+    // This element is needed for reflection or needs additional stubs or has a
+    // super alias. So we need to retain additional information.
 
     // The information is stored in an array with this format:
     //
-    // 1.   The JS function for this member.
-    // 2.   First stub.
-    // 3.   Name of first stub.
+    // 1.   The alias name for this function (optional).
+    // 2.   The JS function for this member.
+    // 3.   First stub.
+    // 4.   Name of first stub.
     // ...
     // M.   Call name of this member.
     // M+1. Call name of first stub.
@@ -471,6 +478,25 @@
 
     List<jsAst.Expression> expressions = <jsAst.Expression>[];
 
+    // Create the optional aliasing entry if this method is called via super.
+    if (backend.isAliasedSuperMember(member)) {
+      expressions.add(new jsAst.LiteralString(
+          '"${namer.getNameOfAliasedSuperMember(member)}"'));
+    }
+
+    expressions.add(code);
+
+    final bool onlyNeedsSuperAlias =
+        !(canTearOff || canBeReflected || canBeApplied || needsStubs);
+
+    if (onlyNeedsSuperAlias) {
+      jsAst.ArrayInitializer arrayInit =
+            new jsAst.ArrayInitializer.from(expressions);
+          compiler.dumpInfoTask.registerElementAst(member,
+              builder.addProperty(name, arrayInit));
+      return;
+    }
+
     String callSelectorString = 'null';
     if (member.isFunction) {
       Selector callSelector = new Selector.fromElement(member).toCallSelector();
@@ -485,8 +511,6 @@
     int optionalParameterCount = parameters.optionalParameterCount << 1;
     if (parameters.optionalParametersAreNamed) optionalParameterCount++;
 
-    expressions.add(code);
-
     // TODO(sra): Don't use LiteralString for non-strings.
     List tearOffInfo = [new jsAst.LiteralString(callSelectorString)];
 
@@ -581,6 +605,7 @@
       expressions.add(js.string(namer.privateName(member.library,
                                                   member.name)));
     }
+
     jsAst.ArrayInitializer arrayInit =
       new jsAst.ArrayInitializer.from(expressions);
     compiler.dumpInfoTask.registerElementAst(member,
@@ -615,6 +640,8 @@
 
   final bool needStructuredInfo;
 
+  final bool hasSuperAlias;
+
   MemberInfo(
       this.member,
       this.name,
@@ -626,6 +653,7 @@
        this.tearOffName,
        this.canBeReflected,
        this.canBeApplied,
+       this.hasSuperAlias,
        this.needStructuredInfo}) {
     assert(member != null);
     assert(name != null);
@@ -637,6 +665,7 @@
     assert(tearOffName != null || !canTearOff);
     assert(canBeReflected != null);
     assert(canBeApplied != null);
+    assert(hasSuperAlias != null);
     assert(needStructuredInfo != null);
   }
 }
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index b99843c..062c62f 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -12,7 +12,7 @@
   final ContainerBuilder containerBuilder = new ContainerBuilder();
   final ClassEmitter classEmitter = new ClassEmitter();
   final NsmEmitter nsmEmitter = new NsmEmitter();
-  TypeTestEmitter get typeTestEmitter => task.typeTestEmitter;
+  final TypeTestEmitter typeTestEmitter = new TypeTestEmitter();
   final InterceptorEmitter interceptorEmitter = new InterceptorEmitter();
   final MetadataEmitter metadataEmitter = new MetadataEmitter();
 
@@ -27,6 +27,7 @@
   final Namer namer;
   ConstantEmitter constantEmitter;
   NativeEmitter get nativeEmitter => task.nativeEmitter;
+  TypeTestRegistry get typeTestRegistry => task.typeTestRegistry;
 
   // The full code that is written to each hunk part-file.
   Map<OutputUnit, CodeBuffer> outputBuffers = new Map<OutputUnit, CodeBuffer>();
@@ -108,6 +109,7 @@
     containerBuilder.emitter = this;
     classEmitter.emitter = this;
     nsmEmitter.emitter = this;
+    typeTestEmitter.emitter = this;
     interceptorEmitter.emitter = this;
     metadataEmitter.emitter = this;
   }
@@ -267,27 +269,27 @@
     //  },
     // });
 
-    var defineClass = js('''function(name, cls, fields) {
+    var defineClass = js('''function(name, fields) {
       var accessors = [];
 
-      var str = "function " + cls + "(";
+      var str = "function " + name + "(";
       var body = "";
 
       for (var i = 0; i < fields.length; i++) {
         if(i != 0) str += ", ";
 
-        var field = generateAccessor(fields[i], accessors, cls);
+        var field = generateAccessor(fields[i], accessors, name);
         var parameter = "parameter_" + field;
         str += parameter;
         body += ("this." + field + " = " + parameter + ";\\n");
       }
       str += ") {\\n" + body + "}\\n";
-      str += cls + ".builtin\$cls=\\"" + name + "\\";\\n";
-      str += "\$desc=\$collectedClasses." + cls + ";\\n";
+      str += name + ".builtin\$cls=\\"" + name + "\\";\\n";
+      str += "\$desc=\$collectedClasses." + name + ";\\n";
       str += "if(\$desc instanceof Array) \$desc = \$desc[1];\\n";
-      str += cls + ".prototype = \$desc;\\n";
+      str += name + ".prototype = \$desc;\\n";
       if (typeof defineClass.name != "string") {
-        str += cls + ".name=\\"" + cls + "\\";\\n";
+        str += name + ".name=\\"" + name + "\\";\\n";
       }
       str += accessors.join("");
 
@@ -295,18 +297,23 @@
     }''');
     // Declare a function called "generateAccessor".  This is used in
     // defineClassFunction (it's a local declaration in init()).
+    List<jsAst.Node> saveDefineClass = [];
+    if (compiler.hasIncrementalSupport) {
+      saveDefineClass.add(
+          js(r'self.$dart_unsafe_eval.defineClass = defineClass'));
+    }
     return [
         generateAccessorFunction,
         js('$generateAccessorHolder = generateAccessor'),
         new jsAst.FunctionDeclaration(
-            new jsAst.VariableDeclaration('defineClass'), defineClass) ];
+            new jsAst.VariableDeclaration('defineClass'), defineClass) ]
+        ..addAll(saveDefineClass);
   }
 
   /** Needs defineClass to be defined. */
   jsAst.Expression buildInheritFrom() {
-    return js(r'''
-        var inheritFrom = function() {
-          function tmp() {}
+    jsAst.Expression result = js(r'''
+        function() {
           function tmp() {}
           var hasOwnProperty = Object.prototype.hasOwnProperty;
           return function (constructor, superConstructor) {
@@ -324,6 +331,10 @@
           };
         }()
       ''');
+    if (compiler.hasIncrementalSupport) {
+      result = js(r'self.$dart_unsafe_eval.inheritFrom = #', [result]);
+    }
+    return js(r'var inheritFrom = #', [result]);
   }
 
   /// Code that needs to be run before first invocation of
@@ -370,6 +381,7 @@
         generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES);
     jsAst.Expression metadataAccess =
         generateEmbeddedGlobalAccess(embeddedNames.METADATA);
+    String signaturePropertyName = namer.operatorSignature;
 
     return js('''
       function(collectedClasses, isolateProperties, existingIsolateProperties) {
@@ -399,27 +411,16 @@
           /* The 'fields' are either a constructor function or a
            * string encoding fields, constructor and superclass. Gets the
            * superclass and fields in the format
-           *   '[name/]Super;field1,field2'
+           *   'Super;field1,field2'
            * from the CLASS_DESCRIPTOR_PROPERTY property on the descriptor.
-           * The 'name/' is optional and contains the name that should be used
-           * when printing the runtime type string.  It is used, for example,
-           * to print the runtime type JSInt as 'int'.
            */
           var classData = desc["${namer.classDescriptorProperty}"],
-              supr, name = cls, fields = classData;
+              supr, fields = classData;
           if (#hasRetainedMetadata)
             if (typeof classData == "object" &&
                 classData instanceof Array) {
               classData = fields = classData[0];
             }
-          if (typeof classData == "string") {
-            var split = classData.split("/");
-            if (split.length == 2) {
-              name = split[0];
-              fields = split[1];
-            }
-          }
-
           var s = fields.split(";");
           fields = s[1] == "" ? [] : s[1].split(",");
           supr = s[0];
@@ -428,7 +429,7 @@
             supr = split[0];
             var functionSignature = split[1];
             if (functionSignature)
-              desc.\$signature = (function(s) {
+              desc.$signaturePropertyName = (function(s) {
                   return function(){ return #metadata[s]; };
                 })(functionSignature);
           }
@@ -447,7 +448,7 @@
             }
 
           if (typeof dart_precompiled != "function") {
-            combinedConstructorFunction += defineClass(name, cls, fields);
+            combinedConstructorFunction += defineClass(cls, fields);
             constructorsList.push(cls);
           }
           if (supr) pendingClasses[cls] = supr;
@@ -510,7 +511,7 @@
 
     return js.statement('''
     {
-      var finishedClasses = #;  // finishedClassesAccess.
+      var finishedClasses = #finishedClassesAccess;
 
       function finishClass(cls) {
 
@@ -518,22 +519,21 @@
         finishedClasses[cls] = true;
 
         var superclass = pendingClasses[cls];
-
         // The superclass is only false (empty string) for the Dart Object
         // class.  The minifier together with noSuchMethod can put methods on
         // the Object.prototype object, and they show through here, so we check
         // that we have a string.
         if (!superclass || typeof superclass != "string") return;
         finishClass(superclass);
-        var constructor = allClasses[cls];
         var superConstructor = allClasses[superclass];
 
         if (!superConstructor)
           superConstructor = existingIsolateProperties[superclass];
 
+        var constructor = allClasses[cls];
         var prototype = inheritFrom(constructor, superConstructor);
 
-        if (#) {  // !nativeClasses.isEmpty,
+        if (#hasNativeClasses) {
           // The property looks like this:
           //
           // HtmlElement: {
@@ -560,13 +560,13 @@
             if (nativeSpec[0]) {
               var tags = nativeSpec[0].split("|");
               for (var i = 0; i < tags.length; i++) {
-                #[tags[i]] = constructor;  // embedded interceptorsByTag.
-                #[tags[i]] = true;  // embedded leafTags.
+                #interceptorsByTagAccess[tags[i]] = constructor;
+                #leafTagsAccess[tags[i]] = true;
               }
             }
             if (nativeSpec[1]) {
               tags = nativeSpec[1].split("|");
-              if (#) {  // User subclassing of native classes?
+              if (#allowNativesSubclassing) {
                 if (nativeSpec[2]) {
                   var subclasses = nativeSpec[2].split("|");
                   for (var i = 0; i < subclasses.length; i++) {
@@ -575,21 +575,19 @@
                   }
                 }
                 for (i = 0; i < tags.length; i++) {
-                  #[tags[i]] = constructor;  // embedded interceptorsByTag.
-                  #[tags[i]] = false;  // embedded leafTags.
+                  #interceptorsByTagAccess[tags[i]] = constructor;
+                  #leafTagsAccess[tags[i]] = false;
                 }
               }
             }
           }
         }
       }
-    }''', [finishedClassesAccess,
-           !nativeClasses.isEmpty,
-           interceptorsByTagAccess,
-           leafTagsAccess,
-           true,
-           interceptorsByTagAccess,
-           leafTagsAccess]);
+    }''', {'finishedClassesAccess': finishedClassesAccess,
+           'hasNativeClasses': nativeClasses.isNotEmpty,
+           'interceptorsByTagAccess': interceptorsByTagAccess,
+           'leafTagsAccess': leafTagsAccess,
+           'allowNativesSubclassing': true});
   }
 
   jsAst.Fun get finishIsolateConstructorFunction {
@@ -694,9 +692,9 @@
   List buildDefineClassAndFinishClassFunctionsIfNecessary() {
     if (!needsDefineClass) return [];
     return defineClassFunction
-    ..add(buildInheritFrom())
-    ..add(js('$finishClassesName = #', finishClassesFunction))
-    ..add(initFinishClasses);
+        ..add(buildInheritFrom())
+        ..add(js('$finishClassesName = #', finishClassesFunction))
+        ..add(initFinishClasses);
   }
 
   List buildLazyInitializerFunctionIfNecessary() {
@@ -1448,9 +1446,14 @@
     mainBuffer.add('(function(${namer.currentIsolate})$_{\n');
     if (compiler.hasIncrementalSupport) {
       mainBuffer.add(
-          '(this.\$dart_unsafe_eval ='
-          ' this.\$dart_unsafe_eval || Object.create(null))'
-          '.patch = function(a) { eval(a) }$N');
+          'this.\$dart_unsafe_eval ='
+          ' this.\$dart_unsafe_eval || Object.create(null)$N');
+      mainBuffer.add(
+          'this.\$dart_unsafe_eval.patch = function(a) { eval(a) }$N');
+      String schemaChange =
+          jsAst.prettyPrint(buildSchemaChangeFunction(), compiler).getText();
+      mainBuffer.add(
+          'this.\$dart_unsafe_eval.schemaChange$_=$_$schemaChange$N');
     }
     if (isProgramSplit) {
       /// We collect all the global state of the, so it can be passed to the
@@ -1652,6 +1655,33 @@
     compiler.assembledCode = assembledCode;
   }
 
+  /// Used by incremental compilation to patch up the prototype of
+  /// [oldConstructor] for use as prototype of [newConstructor].
+  jsAst.Fun buildSchemaChangeFunction() {
+    return js('''
+function(newConstructor, oldConstructor, superclass) {
+  // Invariant: newConstructor.prototype has no interesting properties besides
+  // generated accessors. These are copied to oldPrototype which will be
+  // updated by other incremental changes.
+  if (superclass != null) {
+    this.inheritFrom(newConstructor, superclass);
+  }
+  var oldPrototype = oldConstructor.prototype;
+  var newPrototype = newConstructor.prototype;
+  var hasOwnProperty = Object.prototype.hasOwnProperty;
+  for (var property in newPrototype) {
+    if (hasOwnProperty.call(newPrototype, property)) {
+      // Copy generated accessors.
+      oldPrototype[property] = newPrototype[property];
+    }
+  }
+  oldPrototype.__proto__ = newConstructor.prototype.__proto__;
+  oldPrototype.constructor = newConstructor;
+  newConstructor.prototype = oldPrototype;
+  return newConstructor;
+}''');
+  }
+
   /// Returns a map from OutputUnit to a hash of its content. The hash uniquely
   /// identifies the code of the output-unit. It does not include
   /// boilerplate JS code, like the sourcemap directives or the hash
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
index a1d3610..b75c82e 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
@@ -143,12 +143,18 @@
   jsAst.Statement addStubs = js.statement('''
   function addStubs(descriptor, array, name, isStatic,
                     originalDescriptor, functions) {
-    var f, funcs =
-        [originalDescriptor[name] =
-        descriptor[name] = f = ${readFunction("array", "$FUNCTION_INDEX")}];
+    var index = $FUNCTION_INDEX, alias = array[index], f;
+    if (typeof alias == "string") {
+      f = array[++index];
+    } else {
+      f = alias;
+      alias = name;
+    }
+    var funcs = [originalDescriptor[name] = descriptor[name] =
+        descriptor[alias] = f];
     f.\$stubName = name;
     functions.push(name);
-    for (var index = $FUNCTION_INDEX; index < array.length; index += 2) {
+    for (; index < array.length; index += 2) {
       f = array[index + 1];
       if (typeof f != "function") break;
       f.\$stubName = ${readString("array", "index + 2")};
@@ -379,12 +385,6 @@
       'int');
 }
 
-String readFunction(String array, String index) {
-  return readChecked(
-      array, index, 'result != null && typeof result != "function"',
-      'function');
-}
-
 String readFunctionType(String array, String index) {
   return readChecked(
       array, index,
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
index aa88a7a..273984b 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
@@ -5,41 +5,14 @@
 part of dart2js.js_emitter;
 
 class TypeTestEmitter extends CodeEmitterHelper {
-  static const int MAX_FUNCTION_TYPE_PREDICATES = 10;
+  Set<ClassElement> get checkedClasses =>
+      emitter.typeTestRegistry.checkedClasses;
 
-  /**
-   * Raw ClassElement symbols occuring in is-checks and type assertions.  If the
-   * program contains parameterized checks `x is Set<int>` and
-   * `x is Set<String>` then the ClassElement `Set` will occur once in
-   * [checkedClasses].
-   */
-  Set<ClassElement> checkedClasses;
+  Iterable<ClassElement> get classesUsingTypeVariableTests =>
+      emitter.typeTestRegistry.classesUsingTypeVariableTests;
 
-  /**
-   * The set of function types that checked, both explicity through tests of
-   * typedefs and implicitly through type annotations in checked mode.
-   */
-  Set<FunctionType> checkedFunctionTypes;
-
-  Map<ClassElement, Set<FunctionType>> checkedGenericFunctionTypes =
-      new Map<ClassElement, Set<FunctionType>>();
-
-  Set<FunctionType> checkedNonGenericFunctionTypes =
-      new Set<FunctionType>();
-
-  final Set<ClassElement> rtiNeededClasses = new Set<ClassElement>();
-
-  Iterable<ClassElement> cachedClassesUsingTypeVariableTests;
-
-  Iterable<ClassElement> get classesUsingTypeVariableTests {
-    if (cachedClassesUsingTypeVariableTests == null) {
-      cachedClassesUsingTypeVariableTests = compiler.codegenWorld.isChecks
-          .where((DartType t) => t is TypeVariableType)
-          .map((TypeVariableType v) => v.element.enclosingClass)
-          .toList();
-    }
-    return cachedClassesUsingTypeVariableTests;
-  }
+  Set<FunctionType> get checkedFunctionTypes =>
+      emitter.typeTestRegistry.checkedFunctionTypes;
 
   void emitIsTests(ClassElement classElement, ClassBuilder builder) {
     assert(invariant(classElement, classElement.isDeclaration));
@@ -69,7 +42,7 @@
       }
       RuntimeTypes rti = backend.rti;
       jsAst.Expression encoding = rti.getSignatureEncoding(type, thisAccess);
-      String operatorSignature = namer.operatorSignature();
+      String operatorSignature = namer.operatorSignature;
       if (!type.containsTypeVariables) {
         builder.functionType = '${emitter.metadataEmitter.reifyType(type)}';
       } else {
@@ -177,12 +150,8 @@
                                     generated);
         }
         FunctionType callType = call.computeType(compiler);
-        Map<FunctionType, bool> functionTypeChecks =
-            getFunctionTypeChecksOn(callType);
-        generateFunctionTypeTests(
-            call, callType, functionTypeChecks,
-            emitFunctionTypeSignature);
-     }
+        emitFunctionTypeSignature(call, callType);
+      }
     }
 
     for (DartType interfaceType in cls.interfaces) {
@@ -224,58 +193,6 @@
     }
   }
 
-  /**
-   * Returns a mapping containing all checked function types for which [type]
-   * can be a subtype. A function type is mapped to [:true:] if [type] is
-   * statically known to be a subtype of it and to [:false:] if [type] might
-   * be a subtype, provided with the right type arguments.
-   */
-  // TODO(johnniwinther): Change to return a mapping from function types to
-  // a set of variable points and use this to detect statically/dynamically
-  // known subtype relations.
-  Map<FunctionType, bool> getFunctionTypeChecksOn(DartType type) {
-    Map<FunctionType, bool> functionTypeMap = new Map<FunctionType, bool>();
-    for (FunctionType functionType in checkedFunctionTypes) {
-      int maybeSubtype =
-          compiler.types.computeSubtypeRelation(type, functionType);
-      if (maybeSubtype == Types.IS_SUBTYPE) {
-        functionTypeMap[functionType] = true;
-      } else if (maybeSubtype == Types.MAYBE_SUBTYPE) {
-        functionTypeMap[functionType] = false;
-      }
-    }
-    // TODO(johnniwinther): Ensure stable ordering of the keys.
-    return functionTypeMap;
-  }
-
-  /**
-   * Generates function type checks on [method] with type [methodType] against
-   * the function type checks in [functionTypeChecks].
-   */
-  void generateFunctionTypeTests(
-      Element method,
-      FunctionType methodType,
-      Map<FunctionType, bool> functionTypeChecks,
-      FunctionTypeSignatureEmitter emitFunctionTypeSignature) {
-
-    // TODO(ahe): We should be able to remove this forEach loop.
-    functionTypeChecks.forEach((FunctionType functionType, bool knownSubtype) {
-      registerDynamicFunctionTypeCheck(functionType);
-    });
-
-    emitFunctionTypeSignature(method, methodType);
-  }
-
-  void registerDynamicFunctionTypeCheck(FunctionType functionType) {
-    ClassElement classElement = Types.getClassContext(functionType);
-    if (classElement != null) {
-      checkedGenericFunctionTypes.putIfAbsent(classElement,
-          () => new Set<FunctionType>()).add(functionType);
-    } else {
-      checkedNonGenericFunctionTypes.add(functionType);
-    }
-  }
-
   void emitRuntimeTypeSupport(CodeBuffer buffer, OutputUnit outputUnit) {
     emitter.addComment('Runtime type support', buffer);
     RuntimeTypes rti = backend.rti;
@@ -330,123 +247,4 @@
       buffer.write('$N');
     }
   }
-
-  /**
-   * Returns the classes with constructors used as a 'holder' in
-   * [emitRuntimeTypeSupport].
-   * TODO(9556): Some cases will go away when the class objects are created as
-   * complete.  Not all classes will go away while constructors are referenced
-   * from type substitutions.
-   */
-  Set<ClassElement> classesModifiedByEmitRuntimeTypeSupport() {
-    TypeChecks typeChecks = backend.rti.requiredChecks;
-    Set<ClassElement> result = new Set<ClassElement>();
-    for (ClassElement cls in typeChecks) {
-      for (TypeCheck check in typeChecks[cls]) {
-        result.add(cls);
-        break;
-      }
-    }
-    return result;
-  }
-
-  Set<ClassElement> computeRtiNeededClasses() {
-    void addClassWithSuperclasses(ClassElement cls) {
-      rtiNeededClasses.add(cls);
-      for (ClassElement superclass = cls.superclass;
-          superclass != null;
-          superclass = superclass.superclass) {
-        rtiNeededClasses.add(superclass);
-      }
-    }
-
-    void addClassesWithSuperclasses(Iterable<ClassElement> classes) {
-      for (ClassElement cls in classes) {
-        addClassWithSuperclasses(cls);
-      }
-    }
-
-    // 1.  Add classes that are referenced by type arguments or substitutions in
-    //     argument checks.
-    // TODO(karlklose): merge this case with 2 when unifying argument and
-    // object checks.
-    RuntimeTypes rti = backend.rti;
-    rti.getRequiredArgumentClasses(backend)
-       .forEach(addClassWithSuperclasses);
-
-    // 2.  Add classes that are referenced by substitutions in object checks and
-    //     their superclasses.
-    TypeChecks requiredChecks =
-        rti.computeChecks(rtiNeededClasses, checkedClasses);
-    Set<ClassElement> classesUsedInSubstitutions =
-        rti.getClassesUsedInSubstitutions(backend, requiredChecks);
-    addClassesWithSuperclasses(classesUsedInSubstitutions);
-
-    // 3.  Add classes that contain checked generic function types. These are
-    //     needed to store the signature encoding.
-    for (FunctionType type in checkedFunctionTypes) {
-      ClassElement contextClass = Types.getClassContext(type);
-      if (contextClass != null) {
-        rtiNeededClasses.add(contextClass);
-      }
-    }
-
-    bool canTearOff(Element function) {
-      if (!function.isFunction ||
-          function.isConstructor ||
-          function.isAccessor) {
-        return false;
-      } else if (function.isInstanceMember) {
-        if (!function.enclosingClass.isClosure) {
-          return compiler.codegenWorld.hasInvokedGetter(
-              function, compiler.world);
-        }
-      }
-      return false;
-    }
-
-    bool canBeReflectedAsFunction(Element element) {
-      return element.kind == ElementKind.FUNCTION ||
-          element.kind == ElementKind.GETTER ||
-          element.kind == ElementKind.SETTER ||
-          element.kind == ElementKind.GENERATIVE_CONSTRUCTOR;
-    }
-
-    bool canBeReified(Element element) {
-      return (canTearOff(element) || backend.isAccessibleByReflection(element));
-    }
-
-    // Find all types referenced from the types of elements that can be
-    // reflected on 'as functions'.
-    backend.generatedCode.keys.where((element) {
-      return canBeReflectedAsFunction(element) && canBeReified(element);
-    }).forEach((FunctionElement function) {
-      DartType type = function.computeType(compiler);
-      for (ClassElement cls in backend.rti.getReferencedClasses(type)) {
-        while (cls != null) {
-          rtiNeededClasses.add(cls);
-          cls = cls.superclass;
-        }
-      }
-    });
-
-    return rtiNeededClasses;
-  }
-
-  void computeRequiredTypeChecks() {
-    assert(checkedClasses == null && checkedFunctionTypes == null);
-
-    backend.rti.addImplicitChecks(compiler.codegenWorld,
-                                  classesUsingTypeVariableTests);
-
-    checkedClasses = new Set<ClassElement>();
-    checkedFunctionTypes = new Set<FunctionType>();
-    compiler.codegenWorld.isChecks.forEach((DartType t) {
-      if (t is InterfaceType) {
-        checkedClasses.add(t.element);
-      } else if (t is FunctionType) {
-        checkedFunctionTypes.add(t);
-      }
-    });
-  }
 }
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index 3738340..d1800f7 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -4,7 +4,9 @@
 
 library dart2js.js_emitter.program_builder;
 
+import 'js_emitter.dart' show computeMixinClass;
 import 'model.dart';
+
 import '../common.dart';
 import '../js/js.dart' as js;
 
@@ -78,6 +80,10 @@
       if (element.superclass != null) {
         c.setSuperclass(_classes[element.superclass]);
       }
+      if (element.isMixinApplication) {
+        MixinApplication mixinApplication = c;
+        mixinApplication.setMixinClass(_classes[computeMixinClass(element)]);
+      }
     });
 
     _markEagerClasses();
@@ -238,9 +244,6 @@
   }
 
   Class _buildClass(ClassElement element) {
-    bool isInstantiated =
-        _compiler.codegenWorld.directlyInstantiatedClasses.contains(element);
-
     List<Method> methods = [];
     List<InstanceField> fields = [];
 
@@ -258,13 +261,31 @@
     }
 
     ClassElement implementation = element.implementation;
-    if (isInstantiated) {
+
+    // MixinApplications run through the members of their mixin. Here, we are
+    // only interested in direct members.
+    if (!element.isMixinApplication) {
       implementation.forEachMember(visitMember, includeBackendMembers: true);
     }
     String name = namer.getNameOfClass(element);
     String holderName = namer.globalObjectFor(element);
     Holder holder = _registry.registerHolder(holderName);
-    Class result = new Class(name, holder, methods, fields);
+    bool onlyForRti = _task.typeTestRegistry.rtiNeededClasses.contains(element);
+    bool isInstantiated =
+        _compiler.codegenWorld.directlyInstantiatedClasses.contains(element);
+
+    Class result;
+    if (element.isMixinApplication) {
+      assert(methods.isEmpty);
+      assert(fields.isEmpty);
+      result = new MixinApplication(name, holder,
+                                    isDirectlyInstantiated: isInstantiated,
+                                    onlyForRti: onlyForRti);
+    } else {
+      result = new Class(name, holder, methods, fields,
+                         isDirectlyInstantiated: isInstantiated,
+                         onlyForRti: onlyForRti);
+    }
     _classes[element] = result;
     return result;
   }
diff --git a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
new file mode 100644
index 0000000..ead7fd3
--- /dev/null
+++ b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
@@ -0,0 +1,163 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart2js.js_emitter;
+
+class TypeTestRegistry {
+  /**
+   * Raw ClassElement symbols occuring in is-checks and type assertions.  If the
+   * program contains parameterized checks `x is Set<int>` and
+   * `x is Set<String>` then the ClassElement `Set` will occur once in
+   * [checkedClasses].
+   */
+  Set<ClassElement> checkedClasses;
+
+  /**
+   * The set of function types that checked, both explicity through tests of
+   * typedefs and implicitly through type annotations in checked mode.
+   */
+  Set<FunctionType> checkedFunctionTypes;
+
+  /// Initially contains all classes that need RTI. After
+  /// [computeNeededClasses]
+  /// this set only contains classes that are only used for RTI.
+  final Set<ClassElement> rtiNeededClasses = new Set<ClassElement>();
+
+  Iterable<ClassElement> cachedClassesUsingTypeVariableTests;
+
+  Iterable<ClassElement> get classesUsingTypeVariableTests {
+    if (cachedClassesUsingTypeVariableTests == null) {
+      cachedClassesUsingTypeVariableTests = compiler.codegenWorld.isChecks
+          .where((DartType t) => t is TypeVariableType)
+          .map((TypeVariableType v) => v.element.enclosingClass)
+          .toList();
+    }
+    return cachedClassesUsingTypeVariableTests;
+  }
+
+  final Compiler compiler;
+
+  TypeTestRegistry(this.compiler);
+
+  JavaScriptBackend get backend => compiler.backend;
+
+  /**
+   * Returns the classes with constructors used as a 'holder' in
+   * [emitRuntimeTypeSupport].
+   * TODO(9556): Some cases will go away when the class objects are created as
+   * complete.  Not all classes will go away while constructors are referenced
+   * from type substitutions.
+   */
+  Set<ClassElement> classesModifiedByEmitRuntimeTypeSupport() {
+    TypeChecks typeChecks = backend.rti.requiredChecks;
+    Set<ClassElement> result = new Set<ClassElement>();
+    for (ClassElement cls in typeChecks) {
+      for (TypeCheck check in typeChecks[cls]) {
+        result.add(cls);
+        break;
+      }
+    }
+    return result;
+  }
+
+  Set<ClassElement> computeRtiNeededClasses() {
+    void addClassWithSuperclasses(ClassElement cls) {
+      rtiNeededClasses.add(cls);
+      for (ClassElement superclass = cls.superclass;
+          superclass != null;
+          superclass = superclass.superclass) {
+        rtiNeededClasses.add(superclass);
+      }
+    }
+
+    void addClassesWithSuperclasses(Iterable<ClassElement> classes) {
+      for (ClassElement cls in classes) {
+        addClassWithSuperclasses(cls);
+      }
+    }
+
+    // 1.  Add classes that are referenced by type arguments or substitutions in
+    //     argument checks.
+    // TODO(karlklose): merge this case with 2 when unifying argument and
+    // object checks.
+    RuntimeTypes rti = backend.rti;
+    rti.getRequiredArgumentClasses(backend)
+       .forEach(addClassWithSuperclasses);
+
+    // 2.  Add classes that are referenced by substitutions in object checks and
+    //     their superclasses.
+    TypeChecks requiredChecks =
+        rti.computeChecks(rtiNeededClasses, checkedClasses);
+    Set<ClassElement> classesUsedInSubstitutions =
+        rti.getClassesUsedInSubstitutions(backend, requiredChecks);
+    addClassesWithSuperclasses(classesUsedInSubstitutions);
+
+    // 3.  Add classes that contain checked generic function types. These are
+    //     needed to store the signature encoding.
+    for (FunctionType type in checkedFunctionTypes) {
+      ClassElement contextClass = Types.getClassContext(type);
+      if (contextClass != null) {
+        rtiNeededClasses.add(contextClass);
+      }
+    }
+
+    bool canTearOff(Element function) {
+      if (!function.isFunction ||
+          function.isConstructor ||
+          function.isAccessor) {
+        return false;
+      } else if (function.isInstanceMember) {
+        if (!function.enclosingClass.isClosure) {
+          return compiler.codegenWorld.hasInvokedGetter(
+              function, compiler.world);
+        }
+      }
+      return false;
+    }
+
+    bool canBeReflectedAsFunction(Element element) {
+      return element.kind == ElementKind.FUNCTION ||
+          element.kind == ElementKind.GETTER ||
+          element.kind == ElementKind.SETTER ||
+          element.kind == ElementKind.GENERATIVE_CONSTRUCTOR;
+    }
+
+    bool canBeReified(Element element) {
+      return (canTearOff(element) || backend.isAccessibleByReflection(element));
+    }
+
+    // Find all types referenced from the types of elements that can be
+    // reflected on 'as functions'.
+    backend.generatedCode.keys.where((element) {
+      return canBeReflectedAsFunction(element) && canBeReified(element);
+    }).forEach((FunctionElement function) {
+      DartType type = function.computeType(compiler);
+      for (ClassElement cls in backend.rti.getReferencedClasses(type)) {
+        while (cls != null) {
+          rtiNeededClasses.add(cls);
+          cls = cls.superclass;
+        }
+      }
+    });
+
+    return rtiNeededClasses;
+  }
+
+  void computeRequiredTypeChecks() {
+    assert(checkedClasses == null && checkedFunctionTypes == null);
+
+    backend.rti.addImplicitChecks(compiler.codegenWorld,
+                                  classesUsingTypeVariableTests);
+
+    checkedClasses = new Set<ClassElement>();
+    checkedFunctionTypes = new Set<FunctionType>();
+    compiler.codegenWorld.isChecks.forEach((DartType t) {
+      if (t is InterfaceType) {
+        checkedClasses.add(t.element);
+      } else if (t is FunctionType) {
+        checkedFunctionTypes.add(t);
+      }
+    });
+  }
+}
diff --git a/pkg/compiler/lib/src/mirrors/analyze.dart b/pkg/compiler/lib/src/mirrors/analyze.dart
index 4ba7616..44bd859 100644
--- a/pkg/compiler/lib/src/mirrors/analyze.dart
+++ b/pkg/compiler/lib/src/mirrors/analyze.dart
@@ -39,6 +39,7 @@
   options.add('--analyze-all');
   options.add('--categories=Client,Server');
   options.add('--enable-async');
+  options.add('--allow-native-extensions');
 
   bool compilationFailed = false;
   void internalDiagnosticHandler(Uri uri, int begin, int end,
diff --git a/pkg/compiler/lib/src/native/native.dart b/pkg/compiler/lib/src/native/native.dart
index 9033735..3bba978 100644
--- a/pkg/compiler/lib/src/native/native.dart
+++ b/pkg/compiler/lib/src/native/native.dart
@@ -10,7 +10,8 @@
 import '../dart2jslib.dart';
 import '../dart_types.dart';
 import '../elements/elements.dart';
-import '../elements/modelx.dart' show ClassElementX, FunctionElementX;
+import '../elements/modelx.dart'
+    show ClassElementX, FunctionElementX, LibraryElementX;
 import '../js/js.dart' as js;
 import '../js_backend/js_backend.dart';
 import '../js_emitter/js_emitter.dart' show CodeEmitterTask;
@@ -28,7 +29,7 @@
 part 'ssa.dart';
 
 void maybeEnableNative(Compiler compiler,
-                       LibraryElement library) {
+                       LibraryElementX library) {
   String libraryName = library.canonicalUri.toString();
   if (library.entryCompilationUnit.script.name.contains(
           'dart/tests/compiler/dart2js_native')
@@ -41,7 +42,8 @@
       || libraryName == 'dart:_native_typed_data'
       || libraryName == 'dart:web_audio'
       || libraryName == 'dart:web_gl'
-      || libraryName == 'dart:web_sql') {
+      || libraryName == 'dart:web_sql'
+      || compiler.allowNativeExtensions) {
     library.canUseNative = true;
   }
 }
diff --git a/pkg/compiler/lib/src/native/scanner.dart b/pkg/compiler/lib/src/native/scanner.dart
index a5d72f3..bbbbb2e 100644
--- a/pkg/compiler/lib/src/native/scanner.dart
+++ b/pkg/compiler/lib/src/native/scanner.dart
@@ -6,9 +6,8 @@
 
 void checkAllowedLibrary(ElementListener listener, Token token) {
   LibraryElement currentLibrary = listener.compilationUnitElement.library;
-  if (!currentLibrary.canUseNative) {
-    listener.recoverableError(token, "Unexpected token");
-  }
+  if (currentLibrary.canUseNative) return;
+  listener.reportError(token, MessageKind.NATIVE_NOT_SUPPORTED);
 }
 
 Token handleNativeBlockToSkip(Listener listener, Token token) {
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index c697b2c..aa1ddfd 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -119,13 +119,6 @@
   TreeElementMapping(this.analyzedElement);
 
   operator []=(Node node, Element element) {
-    assert(invariant(node, () {
-      FunctionExpression functionExpression = node.asFunctionExpression();
-      if (functionExpression != null) {
-        return !functionExpression.modifiers.isExternal;
-      }
-      return true;
-    }));
     // TODO(johnniwinther): Simplify this invariant to use only declarations in
     // [TreeElements].
     assert(invariant(node, () {
@@ -498,124 +491,6 @@
     }
   }
 
-  void checkMatchingPatchParameters(FunctionElement origin,
-                                    Link<Element> originParameters,
-                                    Link<Element> patchParameters) {
-    while (!originParameters.isEmpty) {
-      ParameterElementX originParameter = originParameters.head;
-      ParameterElementX patchParameter = patchParameters.head;
-      // TODO(johnniwinther): Remove the conditional patching when we never
-      // resolve the same method twice.
-      if (!originParameter.isPatched) {
-        originParameter.applyPatch(patchParameter);
-      } else {
-        assert(invariant(origin, originParameter.patch == patchParameter,
-               message: "Inconsistent repatch of $originParameter."));
-      }
-      DartType originParameterType = originParameter.computeType(compiler);
-      DartType patchParameterType = patchParameter.computeType(compiler);
-      if (originParameterType != patchParameterType) {
-        compiler.reportError(
-            originParameter.parseNode(compiler),
-            MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
-            {'methodName': origin.name,
-             'parameterName': originParameter.name,
-             'originParameterType': originParameterType,
-             'patchParameterType': patchParameterType});
-        compiler.reportInfo(patchParameter,
-            MessageKind.PATCH_POINT_TO_PARAMETER,
-            {'parameterName': patchParameter.name});
-      } else {
-        // Hack: Use unparser to test parameter equality. This only works
-        // because we are restricting patch uses and the approach cannot be used
-        // elsewhere.
-
-        // The node contains the type, so there is a potential overlap.
-        // Therefore we only check the text if the types are identical.
-        String originParameterText =
-            originParameter.parseNode(compiler).toString();
-        String patchParameterText =
-            patchParameter.parseNode(compiler).toString();
-        if (originParameterText != patchParameterText
-            // We special case the list constructor because of the
-            // optional parameter.
-            && origin != compiler.unnamedListConstructor) {
-          compiler.reportError(
-              originParameter.parseNode(compiler),
-              MessageKind.PATCH_PARAMETER_MISMATCH,
-              {'methodName': origin.name,
-               'originParameter': originParameterText,
-               'patchParameter': patchParameterText});
-          compiler.reportInfo(patchParameter,
-              MessageKind.PATCH_POINT_TO_PARAMETER,
-              {'parameterName': patchParameter.name});
-        }
-      }
-
-      originParameters = originParameters.tail;
-      patchParameters = patchParameters.tail;
-    }
-  }
-
-  void checkMatchingPatchSignatures(FunctionElement origin,
-                                    FunctionElement patch) {
-    // TODO(johnniwinther): Show both origin and patch locations on errors.
-    FunctionExpression originTree = origin.node;
-    FunctionSignature originSignature = origin.functionSignature;
-    FunctionExpression patchTree = patch.node;
-    FunctionSignature patchSignature = patch.functionSignature;
-
-    if (originSignature.type.returnType != patchSignature.type.returnType) {
-      compiler.withCurrentElement(patch, () {
-        Node errorNode =
-            patchTree.returnType != null ? patchTree.returnType : patchTree;
-        error(errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH,
-              {'methodName': origin.name,
-               'originReturnType': originSignature.type.returnType,
-               'patchReturnType': patchSignature.type.returnType});
-      });
-    }
-    if (originSignature.requiredParameterCount !=
-        patchSignature.requiredParameterCount) {
-      compiler.withCurrentElement(patch, () {
-        error(patchTree,
-              MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
-              {'methodName': origin.name,
-               'originParameterCount': originSignature.requiredParameterCount,
-               'patchParameterCount': patchSignature.requiredParameterCount});
-      });
-    } else {
-      checkMatchingPatchParameters(origin,
-                                   originSignature.requiredParameters,
-                                   patchSignature.requiredParameters);
-    }
-    if (originSignature.optionalParameterCount != 0 &&
-        patchSignature.optionalParameterCount != 0) {
-      if (originSignature.optionalParametersAreNamed !=
-          patchSignature.optionalParametersAreNamed) {
-        compiler.withCurrentElement(patch, () {
-          error(patchTree,
-                MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
-                {'methodName': origin.name});
-        });
-      }
-    }
-    if (originSignature.optionalParameterCount !=
-        patchSignature.optionalParameterCount) {
-      compiler.withCurrentElement(patch, () {
-        error(patchTree,
-              MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
-              {'methodName': origin.name,
-               'originParameterCount': originSignature.optionalParameterCount,
-               'patchParameterCount': patchSignature.optionalParameterCount});
-      });
-    } else {
-      checkMatchingPatchParameters(origin,
-                                   originSignature.optionalParameters,
-                                   patchSignature.optionalParameters);
-    }
-  }
-
   static void processAsyncMarker(Compiler compiler,
                                  BaseFunctionElementX element) {
     FunctionExpression functionExpression = element.node;
@@ -654,11 +529,73 @@
     }
   }
 
+  TreeElements resolveMethodElementImplementation(
+      FunctionElement element, FunctionExpression tree) {
+    return compiler.withCurrentElement(element, () {
+      if (element.isExternal && tree.hasBody()) {
+        compiler.reportError(element,
+            MessageKind.EXTERNAL_WITH_BODY,
+            {'functionName': element.name});
+      }
+      if (element.isConstructor) {
+        if (tree.returnType != null) {
+          compiler.reportError(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
+        }
+        if (element.isConst &&
+            tree.hasBody() &&
+            !tree.isRedirectingFactory) {
+          compiler.reportError(tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY);
+        }
+      }
+
+      ResolverVisitor visitor = visitorFor(element);
+      ResolutionRegistry registry = visitor.registry;
+      registry.defineFunction(tree, element);
+      visitor.setupFunction(tree, element);
+
+      if (element.isGenerativeConstructor) {
+        // Even if there is no initializer list we still have to do the
+        // resolution in case there is an implicit super constructor call.
+        InitializerResolver resolver = new InitializerResolver(visitor);
+        FunctionElement redirection =
+            resolver.resolveInitializers(element, tree);
+        if (redirection != null) {
+          resolveRedirectingConstructor(resolver, tree, element, redirection);
+        }
+      } else if (tree.initializers != null) {
+        error(tree, MessageKind.FUNCTION_WITH_INITIALIZER);
+      }
+
+      if (!compiler.analyzeSignaturesOnly || tree.isRedirectingFactory) {
+        // We need to analyze the redirecting factory bodies to ensure that
+        // we can analyze compile-time constants.
+        visitor.visit(tree.body);
+      }
+
+      // Get the resolution tree and check that the resolved
+      // function doesn't use 'super' if it is mixed into another
+      // class. This is the part of the 'super' mixin check that
+      // happens when a function is resolved after the mixin
+      // application has been performed.
+      TreeElements resolutionTree = registry.mapping;
+      ClassElement enclosingClass = element.enclosingClass;
+      if (enclosingClass != null) {
+        // TODO(johnniwinther): Find another way to obtain mixin uses.
+        Iterable<MixinApplicationElement> mixinUses =
+            compiler.world.allMixinUsesOf(enclosingClass);
+        ClassElement mixin = enclosingClass;
+        for (MixinApplicationElement mixinApplication in mixinUses) {
+          checkMixinSuperUses(resolutionTree, mixinApplication, mixin);
+        }
+      }
+      return resolutionTree;
+    });
+
+  }
+
   TreeElements resolveMethodElement(FunctionElementX element) {
     assert(invariant(element, element.isDeclaration));
     return compiler.withCurrentElement(element, () {
-      bool isConstructor =
-          identical(element.kind, ElementKind.GENERATIVE_CONSTRUCTOR);
       if (compiler.enqueuer.resolution.hasBeenResolved(element)) {
         // TODO(karlklose): Remove the check for [isConstructor]. [elememts]
         // should never be non-null, not even for constructors.
@@ -668,7 +605,7 @@
         return element.resolvedAst.elements;
       }
       if (element.isSynthesized) {
-        if (isConstructor) {
+        if (element.isGenerativeConstructor) {
           ResolutionRegistry registry =
               new ResolutionRegistry(compiler, element);
           ConstructorElement constructor = element.asFunctionElement();
@@ -686,81 +623,17 @@
           assert(element.isDeferredLoaderGetter);
           return _ensureTreeElements(element);
         }
-      }
-      element.parseNode(compiler);
-      element.computeType(compiler);
-      processAsyncMarker(compiler, element);
-      if (element.isPatched) {
-        FunctionElementX patch = element.patch;
-        compiler.withCurrentElement(patch, () {
-          patch.parseNode(compiler);
-          patch.computeType(compiler);
-        });
-        checkMatchingPatchSignatures(element, patch);
-        element = patch;
+      } else {
+        element.parseNode(compiler);
+        element.computeType(compiler);
         processAsyncMarker(compiler, element);
+        FunctionElementX implementation = element;
+        if (element.isExternal) {
+          implementation = compiler.backend.resolveExternalFunction(element);
+        }
+        return resolveMethodElementImplementation(
+            implementation, implementation.node);
       }
-      return compiler.withCurrentElement(element, () {
-        FunctionExpression tree = element.node;
-        if (tree.modifiers.isExternal) {
-          error(tree, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
-          return null;
-        }
-        if (isConstructor || element.isFactoryConstructor) {
-          if (tree.returnType != null) {
-            error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
-          }
-          if (element.modifiers.isConst &&
-              tree.hasBody() &&
-              !tree.isRedirectingFactory) {
-            compiler.reportError(tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY);
-          }
-        }
-
-        ResolverVisitor visitor = visitorFor(element);
-        ResolutionRegistry registry = visitor.registry;
-        registry.defineFunction(tree, element);
-        visitor.setupFunction(tree, element);
-
-        if (isConstructor && !element.isForwardingConstructor) {
-          // Even if there is no initializer list we still have to do the
-          // resolution in case there is an implicit super constructor call.
-          InitializerResolver resolver = new InitializerResolver(visitor);
-          FunctionElement redirection =
-              resolver.resolveInitializers(element, tree);
-          if (redirection != null) {
-            resolveRedirectingConstructor(resolver, tree, element, redirection);
-          }
-        } else if (element.isForwardingConstructor) {
-          // Initializers will be checked on the original constructor.
-        } else if (tree.initializers != null) {
-          error(tree, MessageKind.FUNCTION_WITH_INITIALIZER);
-        }
-
-        if (!compiler.analyzeSignaturesOnly || tree.isRedirectingFactory) {
-          // We need to analyze the redirecting factory bodies to ensure that
-          // we can analyze compile-time constants.
-          visitor.visit(tree.body);
-        }
-
-        // Get the resolution tree and check that the resolved
-        // function doesn't use 'super' if it is mixed into another
-        // class. This is the part of the 'super' mixin check that
-        // happens when a function is resolved after the mixin
-        // application has been performed.
-        TreeElements resolutionTree = registry.mapping;
-        ClassElement enclosingClass = element.enclosingClass;
-        if (enclosingClass != null) {
-          // TODO(johnniwinther): Find another way to obtain mixin uses.
-          Iterable<MixinApplicationElement> mixinUses =
-              compiler.world.allMixinUsesOf(enclosingClass);
-          ClassElement mixin = enclosingClass;
-          for (MixinApplicationElement mixinApplication in mixinUses) {
-            checkMixinSuperUses(resolutionTree, mixinApplication, mixin);
-          }
-        }
-        return resolutionTree;
-      });
     });
   }
 
diff --git a/pkg/compiler/lib/src/scanner/class_element_parser.dart b/pkg/compiler/lib/src/scanner/class_element_parser.dart
index 6c43527..f0b0020 100644
--- a/pkg/compiler/lib/src/scanner/class_element_parser.dart
+++ b/pkg/compiler/lib/src/scanner/class_element_parser.dart
@@ -24,13 +24,13 @@
   }
 
   void set supertypeLoadState(int state) {
-    assert(state == supertypeLoadState + 1);
+    assert(state == STATE_NOT_STARTED || state == supertypeLoadState + 1);
     assert(state <= STATE_DONE);
     super.supertypeLoadState = state;
   }
 
   void set resolutionState(int state) {
-    assert(state == resolutionState + 1);
+    assert(state == STATE_NOT_STARTED || state == resolutionState + 1);
     assert(state <= STATE_DONE);
     super.resolutionState = state;
   }
@@ -73,6 +73,10 @@
       cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
 
   accept(ElementVisitor visitor) => visitor.visitClassElement(this);
+
+  PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
+    return new PartialClassElement(name, beginToken, endToken, enclosing, id);
+  }
 }
 
 class MemberListener extends NodeListener {
diff --git a/pkg/compiler/lib/src/scanner/listener.dart b/pkg/compiler/lib/src/scanner/listener.dart
index aa52241..887232e 100644
--- a/pkg/compiler/lib/src/scanner/listener.dart
+++ b/pkg/compiler/lib/src/scanner/listener.dart
@@ -2359,6 +2359,12 @@
     super.reuseElement();
     reusePartialFunctionMixin();
   }
+
+  PartialFunctionElement copyWithEnclosing(Element enclosing) {
+    return new PartialFunctionElement(
+        name, beginToken, getOrSet, endToken, kind, modifiers, enclosing,
+        hasNoBody);
+  }
 }
 
 class PartialConstructorElement extends ConstructorElementX
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 4b9e765..865e32c 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -4,6 +4,29 @@
 
 part of ssa;
 
+class SsaFunctionCompiler implements FunctionCompiler {
+  SsaCodeGeneratorTask generator;
+  SsaBuilderTask builder;
+  SsaOptimizerTask optimizer;
+
+  SsaFunctionCompiler(JavaScriptBackend backend, bool generateSourceMap)
+      : generator = new SsaCodeGeneratorTask(backend),
+        builder = new SsaBuilderTask(backend, generateSourceMap),
+        optimizer = new SsaOptimizerTask(backend);
+
+  /// Generates JavaScript code for `work.element`.
+  /// Using the ssa builder, optimizer and codegenerator.
+  js.Fun compile(CodegenWorkItem work) {
+    HGraph graph = builder.build(work);
+    optimizer.optimize(work, graph);
+    return generator.generateCode(work, graph);
+  }
+
+  Iterable<CompilerTask> get tasks {
+    return <CompilerTask>[builder, optimizer, generator];
+  }
+}
+
 /// A synthetic local variable only used with the SSA graph.
 ///
 /// For instance used for holding return value of function or the exception of a
@@ -18,10 +41,11 @@
 class SsaBuilderTask extends CompilerTask {
   final CodeEmitterTask emitter;
   final JavaScriptBackend backend;
+  final bool generateSourceMap;
 
   String get name => 'SSA builder';
 
-  SsaBuilderTask(JavaScriptBackend backend)
+  SsaBuilderTask(JavaScriptBackend backend, this.generateSourceMap)
     : emitter = backend.emitter,
       backend = backend,
       super(backend.compiler);
@@ -32,7 +56,8 @@
       return compiler.withCurrentElement(element, () {
         HInstruction.idCounter = 0;
         SsaBuilder builder =
-            new SsaBuilder(backend, work, emitter.nativeEmitter);
+            new SsaBuilder(
+                backend, work, emitter.nativeEmitter, generateSourceMap);
         HGraph graph;
         ElementKind kind = element.kind;
         if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
@@ -908,6 +933,7 @@
   final ConstantSystem constantSystem;
   final CodegenWorkItem work;
   final RuntimeTypes rti;
+  final bool generateSourceMap;
 
   /* This field is used by the native handler. */
   final NativeEmitter nativeEmitter;
@@ -986,7 +1012,8 @@
 
   SsaBuilder(JavaScriptBackend backend,
              CodegenWorkItem work,
-             this.nativeEmitter)
+             this.nativeEmitter,
+             this.generateSourceMap)
     : this.compiler = backend.compiler,
       this.backend = backend,
       this.constantSystem = backend.constantSystem,
@@ -1092,7 +1119,7 @@
 
     bool isInstanceMember = function.isInstanceMember;
     // For static calls, [providedArguments] is complete, default arguments
-    // have been included if necessary, see [addStaticSendArgumentsToList].
+    // have been included if necessary, see [makeStaticArgumentList].
     if (!isInstanceMember
         || currentNode == null // In erroneous code, currentNode can be null.
         || providedArgumentsKnownToBeComplete(currentNode)
@@ -1820,12 +1847,10 @@
           FunctionElement target = elements[call].implementation;
           Selector selector = elements.getSelector(call);
           Link<ast.Node> arguments = call.arguments;
-          List<HInstruction> compiledArguments = new List<HInstruction>();
+          List<HInstruction> compiledArguments;
           inlinedFrom(constructor, () {
-            addStaticSendArgumentsToList(selector,
-                                         arguments,
-                                         target,
-                                         compiledArguments);
+            compiledArguments =
+                makeStaticArgumentList(selector, arguments, target);
           });
           inlineSuperOrRedirect(target,
                                 compiledArguments,
@@ -1861,13 +1886,11 @@
           compiler.internalError(superClass,
               "No default constructor available.");
         }
-        List<HInstruction> arguments = <HInstruction>[];
-        selector.addArgumentsToList(const Link<ast.Node>(),
-                                    arguments,
-                                    target.implementation,
-                                    null,
-                                    handleConstantForOptionalParameter,
-                                    compiler.world);
+        List<HInstruction> arguments =
+            selector.makeArgumentsList2(const Link<ast.Node>(),
+                                        target.implementation,
+                                        null,
+                                        handleConstantForOptionalParameter);
         inlineSuperOrRedirect(target,
                               arguments,
                               constructors,
@@ -2391,7 +2414,7 @@
   }
 
   HInstruction attachPosition(HInstruction target, ast.Node node) {
-    if (node != null) {
+    if (generateSourceMap && node != null) {
       target.sourcePosition = sourceFileLocationForBeginToken(node);
     }
     return target;
@@ -3422,14 +3445,14 @@
   }
 
   /**
-   * Returns true if the arguments were compatible with the function signature.
+   * Returns a list with the evaluated [arguments] in the normalized order.
    *
+   * Precondition: `this.applies(element, world)`.
    * Invariant: [element] must be an implementation element.
    */
-  bool addStaticSendArgumentsToList(Selector selector,
-                                    Link<ast.Node> arguments,
-                                    FunctionElement element,
-                                    List<HInstruction> list) {
+  List<HInstruction> makeStaticArgumentList(Selector selector,
+                                            Link<ast.Node> arguments,
+                                            FunctionElement element) {
     assert(invariant(element, element.isImplementation));
 
     HInstruction compileArgument(ast.Node argument) {
@@ -3437,12 +3460,10 @@
       return pop();
     }
 
-    return selector.addArgumentsToList(arguments,
-                                       list,
+    return selector.makeArgumentsList2(arguments,
                                        element,
                                        compileArgument,
-                                       handleConstantForOptionalParameter,
-                                       compiler.world);
+                                       handleConstantForOptionalParameter);
   }
 
   void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> list) {
@@ -3813,41 +3834,57 @@
     } else if (name == 'JS_CREATE_ISOLATE') {
       handleForeignCreateIsolate(node);
     } else if (name == 'JS_OPERATOR_IS_PREFIX') {
-      stack.add(addConstantString(backend.namer.operatorIsPrefix()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.operatorIsPrefix));
     } else if (name == 'JS_OBJECT_CLASS_NAME') {
+      // TODO(floitsch): this should be a JS_NAME.
       String name = backend.namer.getRuntimeTypeName(compiler.objectClass);
       stack.add(addConstantString(name));
     } else if (name == 'JS_NULL_CLASS_NAME') {
+      // TODO(floitsch): this should be a JS_NAME.
       String name = backend.namer.getRuntimeTypeName(compiler.nullClass);
       stack.add(addConstantString(name));
     } else if (name == 'JS_FUNCTION_CLASS_NAME') {
+      // TODO(floitsch): this should be a JS_NAME.
       String name = backend.namer.getRuntimeTypeName(compiler.functionClass);
       stack.add(addConstantString(name));
     } else if (name == 'JS_OPERATOR_AS_PREFIX') {
-      stack.add(addConstantString(backend.namer.operatorAsPrefix()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.operatorAsPrefix));
     } else if (name == 'JS_SIGNATURE_NAME') {
-      stack.add(addConstantString(backend.namer.operatorSignature()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.operatorSignature));
+    } else if (name == 'JS_TYPEDEF_TAG') {
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.typedefTag));
     } else if (name == 'JS_FUNCTION_TYPE_TAG') {
-      stack.add(addConstantString(backend.namer.functionTypeTag()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.functionTypeTag));
     } else if (name == 'JS_FUNCTION_TYPE_VOID_RETURN_TAG') {
-      stack.add(addConstantString(backend.namer.functionTypeVoidReturnTag()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.functionTypeVoidReturnTag));
     } else if (name == 'JS_FUNCTION_TYPE_RETURN_TYPE_TAG') {
-      stack.add(addConstantString(backend.namer.functionTypeReturnTypeTag()));
+      // TODO(floitsch): this should be a JS_NAME.
+      stack.add(addConstantString(backend.namer.functionTypeReturnTypeTag));
     } else if (name ==
                'JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG') {
+      // TODO(floitsch): this should be a JS_NAME.
       stack.add(addConstantString(
-          backend.namer.functionTypeRequiredParametersTag()));
+          backend.namer.functionTypeRequiredParametersTag));
     } else if (name ==
                'JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG') {
+      // TODO(floitsch): this should be a JS_NAME.
       stack.add(addConstantString(
-          backend.namer.functionTypeOptionalParametersTag()));
+          backend.namer.functionTypeOptionalParametersTag));
     } else if (name ==
                'JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG') {
+      // TODO(floitsch): this should be a JS_NAME.
       stack.add(addConstantString(
-          backend.namer.functionTypeNamedParametersTag()));
+          backend.namer.functionTypeNamedParametersTag));
     } else if (name == 'JS_DART_OBJECT_CONSTRUCTOR') {
       handleForeignDartObjectJsConstructorFunction(node);
     } else if (name == 'JS_IS_INDEXABLE_FIELD_NAME') {
+      // TODO(floitsch): this should be a JS_NAME.
       Element element = backend.findHelper('JavaScriptIndexingBehavior');
       stack.add(addConstantString(backend.namer.operatorIs(element)));
     } else if (name == 'JS_CURRENT_ISOLATE') {
@@ -3954,11 +3991,12 @@
     } else if (element.isFunction || element.isGenerativeConstructor) {
       if (selector.applies(element, compiler.world)) {
         // TODO(5347): Try to avoid the need for calling [implementation] before
-        // calling [addStaticSendArgumentsToList].
+        // calling [makeStaticArgumentList].
         FunctionElement function = element.implementation;
-        bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
-                                                      function, inputs);
-        assert(succeeded);
+        assert(selector.applies(function, compiler.world));
+        inputs = makeStaticArgumentList(selector,
+                                        node.arguments,
+                                        function);
         push(buildInvokeSuper(selector, element, inputs));
       } else if (element.isGenerativeConstructor) {
         generateWrongArgumentCountError(node, element, node.arguments);
@@ -4236,14 +4274,14 @@
       inputs.add(graph.addConstantNull(compiler));
     }
     // TODO(5347): Try to avoid the need for calling [implementation] before
-    // calling [addStaticSendArgumentsToList].
-    bool succeeded = addStaticSendArgumentsToList(selector, send.arguments,
-                                                  constructor.implementation,
-                                                  inputs);
-    if (!succeeded) {
+    // calling [makeStaticArgumentList].
+    if (!selector.applies(constructor.implementation, compiler.world)) {
       generateWrongArgumentCountError(send, constructor, send.arguments);
       return;
     }
+    inputs.addAll(makeStaticArgumentList(selector,
+                                         send.arguments,
+                                         constructor.implementation));
 
     if (constructor.isFactoryConstructor &&
         !expectedType.typeArguments.isEmpty) {
@@ -4275,7 +4313,7 @@
       push(foreign);
       TypesInferrer inferrer = compiler.typesTask.typesInferrer;
       if (inferrer.isFixedArrayCheckedForGrowable(send)) {
-        js.Template code = js.js.parseForeignJS(r'#.fixed$length = init');
+        js.Template code = js.js.parseForeignJS(r'#.fixed$length = Array');
         // We set the instruction as [canThrow] to avoid it being dead code.
         // We need a finer grained side effect.
         add(new HForeign(
@@ -4425,17 +4463,18 @@
     invariant(element, !element.isGenerativeConstructor);
     generateIsDeferredLoadedCheckIfNeeded(node);
     if (element.isFunction) {
-      var inputs = <HInstruction>[];
       // TODO(5347): Try to avoid the need for calling [implementation] before
-      // calling [addStaticSendArgumentsToList].
-      bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
-                                                    element.implementation,
-                                                    inputs);
-      if (!succeeded) {
+      // calling [makeStaticArgumentList].
+      if (!selector.applies(element.implementation, compiler.world)) {
         generateWrongArgumentCountError(node, element, node.arguments);
         return;
       }
 
+      List<HInstruction> inputs =
+          makeStaticArgumentList(selector,
+                                 node.arguments,
+                                 element.implementation);
+
       if (element == compiler.identicalFunction) {
         pushWithPosition(
             new HIdentity(inputs[0], inputs[1], null, backend.boolType), node);
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 3829edd..fa1ea1f 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1490,13 +1490,6 @@
     }
   }
 
-  js.Call jsPropertyCall(js.Expression receiver,
-                         String fieldName,
-                         List<js.Expression> arguments) {
-    return new js.Call(new js.PropertyAccess.field(receiver, fieldName),
-                       arguments);
-  }
-
   void visitInterceptor(HInterceptor node) {
     registry.registerSpecializedGetInterceptor(node.interceptedClasses);
     String name = backend.namer.getInterceptorName(
@@ -1505,7 +1498,7 @@
         backend.namer.globalObjectFor(backend.interceptorsLibrary));
     use(node.receiver);
     List<js.Expression> arguments = <js.Expression>[pop()];
-    push(jsPropertyCall(isolate, name, arguments), node);
+    push(js.propertyCall(isolate, name, arguments), node);
     registry.registerUseInterceptor();
   }
 
@@ -1540,7 +1533,7 @@
       methodName = backend.namer.invocationName(node.selector);
       registerMethodInvoke(node);
     }
-    push(jsPropertyCall(object, methodName, arguments), node);
+    push(js.propertyCall(object, methodName, arguments), node);
   }
 
   void visitInvokeConstructorBody(HInvokeConstructorBody node) {
@@ -1548,7 +1541,7 @@
     js.Expression object = pop();
     String methodName = backend.namer.getNameOfInstanceMember(node.element);
     List<js.Expression> arguments = visitArguments(node.inputs);
-    push(jsPropertyCall(object, methodName, arguments), node);
+    push(js.propertyCall(object, methodName, arguments), node);
     registry.registerStaticUse(node.element);
   }
 
@@ -1558,7 +1551,7 @@
         backend.namer.globalObjectFor(backend.interceptorsLibrary));
     Selector selector = getOptimizedSelectorFor(node, node.selector);
     String methodName = backend.registerOneShotInterceptor(selector);
-    push(jsPropertyCall(isolate, methodName, arguments), node);
+    push(js.propertyCall(isolate, methodName, arguments), node);
     if (selector.isGetter) {
       registerGetter(node);
     } else if (selector.isSetter) {
@@ -1615,33 +1608,32 @@
   visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
     use(node.receiver);
     String name = backend.namer.invocationName(node.selector);
-    push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node);
+    push(js.propertyCall(pop(), name, visitArguments(node.inputs)), node);
     registerSetter(node);
   }
 
   visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
     use(node.receiver);
     String name = backend.namer.invocationName(node.selector);
-    push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node);
+    push(js.propertyCall(pop(), name, visitArguments(node.inputs)), node);
     registerGetter(node);
   }
 
   visitInvokeClosure(HInvokeClosure node) {
     Selector call = new Selector.callClosureFrom(node.selector);
     use(node.receiver);
-    push(jsPropertyCall(pop(),
-                        backend.namer.invocationName(call),
-                        visitArguments(node.inputs)),
+    push(js.propertyCall(pop(),
+                         backend.namer.invocationName(call),
+                         visitArguments(node.inputs)),
          node);
     registry.registerDynamicInvocation(call);
   }
 
   visitInvokeStatic(HInvokeStatic node) {
     Element element = node.element;
-    ClassElement cls = element.enclosingClass;
     List<DartType> instantiatedTypes = node.instantiatedTypes;
 
-    registry.registerStaticUse(element);
+    registry.registerStaticInvocation(element);
 
     if (instantiatedTypes != null && !instantiatedTypes.isEmpty) {
       instantiatedTypes.forEach((type) {
@@ -1655,7 +1647,7 @@
 
   visitInvokeSuper(HInvokeSuper node) {
     Element superMethod = node.element;
-    registry.registerStaticUse(superMethod);
+    registry.registerSuperInvocation(superMethod);
     ClassElement superClass = superMethod.enclosingClass;
     if (superMethod.kind == ElementKind.FIELD) {
       String fieldName = backend.namer.instanceFieldPropertyName(superMethod);
@@ -1683,14 +1675,23 @@
         registry.registerDynamicGetter(selector);
         registry.registerGetterForSuperMethod(node.element);
         methodName = backend.namer.invocationName(selector);
-      } else {
-        methodName = backend.namer.getNameOfInstanceMember(superMethod);
-      }
-      push(
+        push(
           js.js('#.prototype.#.call(#)', [
-              backend.namer.elementAccess(superClass),
-              methodName, visitArguments(node.inputs, start: 0)]),
+            backend.namer.elementAccess(superClass),
+            methodName, visitArguments(node.inputs, start: 0)]),
           node);
+      } else {
+        methodName =
+            backend.namer.getNameOfAliasedSuperMember(superMethod);
+        backend.registerAliasedSuperMember(superMethod);
+        use(node.receiver);
+        push(
+          js.js('#.#(#)', [
+            pop(), methodName,
+            visitArguments(node.inputs, start: 1)]), // Skip receiver argument.
+          node);
+      }
+
     }
   }
 
@@ -2578,7 +2579,7 @@
         use(node.checkedInput);
         String methodName =
             backend.namer.invocationName(node.receiverTypeCheckSelector);
-        js.Expression call = jsPropertyCall(pop(), methodName, []);
+        js.Expression call = js.propertyCall(pop(), methodName, []);
         pushStatement(new js.Return(call));
       }
       currentContainer = oldContainer;
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 43300de..c95d5db 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -39,23 +39,23 @@
       List<OptimizationPhase> phases = <OptimizationPhase>[
           // Run trivial instruction simplification first to optimize
           // some patterns useful for type conversion.
-          new SsaInstructionSimplifier(constantSystem, backend, work),
+          new SsaInstructionSimplifier(constantSystem, backend, this, work),
           new SsaTypeConversionInserter(compiler),
           new SsaRedundantPhiEliminator(),
           new SsaDeadPhiEliminator(),
           new SsaTypePropagator(compiler),
           // After type propagation, more instructions can be
           // simplified.
-          new SsaInstructionSimplifier(constantSystem, backend, work),
+          new SsaInstructionSimplifier(constantSystem, backend, this, work),
           new SsaCheckInserter(
               trustPrimitives, backend, work, context.boundsChecked),
-          new SsaInstructionSimplifier(constantSystem, backend, work),
+          new SsaInstructionSimplifier(constantSystem, backend, this, work),
           new SsaCheckInserter(
               trustPrimitives, backend, work, context.boundsChecked),
           new SsaTypePropagator(compiler),
           // Run a dead code eliminator before LICM because dead
           // interceptors are often in the way of LICM'able instructions.
-          new SsaDeadCodeEliminator(compiler),
+          new SsaDeadCodeEliminator(compiler, this),
           new SsaGlobalValueNumberer(compiler),
           // After GVN, some instructions might need their type to be
           // updated because they now have different inputs.
@@ -64,31 +64,31 @@
           new SsaLoadElimination(compiler),
           new SsaDeadPhiEliminator(),
           new SsaTypePropagator(compiler),
-          new SsaValueRangeAnalyzer(compiler, constantSystem, work),
+          new SsaValueRangeAnalyzer(compiler, constantSystem, this, work),
           // Previous optimizations may have generated new
           // opportunities for instruction simplification.
-          new SsaInstructionSimplifier(constantSystem, backend, work),
+          new SsaInstructionSimplifier(constantSystem, backend, this, work),
           new SsaCheckInserter(
               trustPrimitives, backend, work, context.boundsChecked),
           new SsaSimplifyInterceptors(compiler, constantSystem, work),
-          dce = new SsaDeadCodeEliminator(compiler),
+          dce = new SsaDeadCodeEliminator(compiler, this),
           new SsaTypePropagator(compiler)];
       runPhases(graph, phases);
       if (dce.eliminatedSideEffects) {
         phases = <OptimizationPhase>[
             new SsaGlobalValueNumberer(compiler),
             new SsaCodeMotion(),
-            new SsaValueRangeAnalyzer(compiler, constantSystem, work),
-            new SsaInstructionSimplifier(constantSystem, backend, work),
+            new SsaValueRangeAnalyzer(compiler, constantSystem, this, work),
+            new SsaInstructionSimplifier(constantSystem, backend, this, work),
             new SsaCheckInserter(
                 trustPrimitives, backend, work, context.boundsChecked),
             new SsaSimplifyInterceptors(compiler, constantSystem, work),
-            new SsaDeadCodeEliminator(compiler)];
+            new SsaDeadCodeEliminator(compiler, this)];
       } else {
         phases = <OptimizationPhase>[
             // Run the simplifier to remove unneeded type checks inserted
             // by type propagation.
-            new SsaInstructionSimplifier(constantSystem, backend, work)];
+            new SsaInstructionSimplifier(constantSystem, backend, this, work)];
       }
       runPhases(graph, phases);
     });
@@ -127,8 +127,12 @@
   final ConstantSystem constantSystem;
   HGraph graph;
   Compiler get compiler => backend.compiler;
+  final SsaOptimizerTask optimizer;
 
-  SsaInstructionSimplifier(this.constantSystem, this.backend, this.work);
+  SsaInstructionSimplifier(this.constantSystem,
+                           this.backend,
+                           this.optimizer,
+                           this.work);
 
   void visitGraph(HGraph visitee) {
     graph = visitee;
@@ -976,9 +980,10 @@
   final String name = "SsaDeadCodeEliminator";
 
   final Compiler compiler;
+  final SsaOptimizerTask optimizer;
   SsaLiveBlockAnalyzer analyzer;
   bool eliminatedSideEffects = false;
-  SsaDeadCodeEliminator(this.compiler);
+  SsaDeadCodeEliminator(this.compiler, this.optimizer);
 
   HInstruction zapInstructionCache;
   HInstruction get zapInstruction {
@@ -1031,7 +1036,7 @@
   }
 
   void visitGraph(HGraph graph) {
-    analyzer = new SsaLiveBlockAnalyzer(graph, compiler);
+    analyzer = new SsaLiveBlockAnalyzer(graph, compiler, optimizer);
     analyzer.analyze();
     visitPostDominatorTree(graph);
     cleanPhis(graph);
@@ -1115,14 +1120,14 @@
 
 class SsaLiveBlockAnalyzer extends HBaseVisitor {
   final HGraph graph;
-  final Compiler compiler;
   final Set<HBasicBlock> live = new Set<HBasicBlock>();
   final List<HBasicBlock> worklist = <HBasicBlock>[];
+  final SsaOptimizerTask optimizer;
+  final Compiler compiler;
 
-  SsaLiveBlockAnalyzer(this.graph, this.compiler);
+  SsaLiveBlockAnalyzer(this.graph, this.compiler, this.optimizer);
 
-  JavaScriptBackend get backend => compiler.backend;
-  Map<HInstruction, Range> get ranges => backend.optimizer.ranges;
+  Map<HInstruction, Range> get ranges => optimizer.ranges;
 
   bool isDeadBlock(HBasicBlock block) => !live.contains(block);
 
diff --git a/pkg/compiler/lib/src/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart
index c5559d5..7d122f0 100644
--- a/pkg/compiler/lib/src/ssa/ssa.dart
+++ b/pkg/compiler/lib/src/ssa/ssa.dart
@@ -29,6 +29,7 @@
 import '../types/types.dart';
 import '../universe/universe.dart';
 import '../util/util.dart';
+import '../js_backend/codegen/task.dart';
 
 part 'builder.dart';
 part 'codegen.dart';
diff --git a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
index 3b7f3dc..c89a8ce 100644
--- a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
+++ b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
@@ -595,11 +595,15 @@
   final Compiler compiler;
   final ConstantSystem constantSystem;
   final ValueRangeInfo info;
+  final SsaOptimizerTask optimizer;
 
   CodegenWorkItem work;
   HGraph graph;
 
-  SsaValueRangeAnalyzer(this.compiler, constantSystem, this.work)
+  SsaValueRangeAnalyzer(this.compiler,
+                        constantSystem,
+                        this.optimizer,
+                        this.work)
       : info = new ValueRangeInfo(constantSystem),
         this.constantSystem = constantSystem;
 
@@ -610,14 +614,13 @@
     // that the graph does not get polluted with these instructions
     // only necessary for this phase.
     removeRangeConversion();
-    JavaScriptBackend backend = compiler.backend;
     // TODO(herhut): Find a cleaner way to pass around ranges.
-    backend.optimizer.ranges = ranges;
+    optimizer.ranges = ranges;
   }
 
   void removeRangeConversion() {
     conversions.forEach((HRangeConversion instruction) {
-      instruction.block.rewrite(instruction, instruction.inputs[0]);;
+      instruction.block.rewrite(instruction, instruction.inputs[0]);
       instruction.block.remove(instruction);
     });
   }
diff --git a/pkg/compiler/lib/src/tracer.dart b/pkg/compiler/lib/src/tracer.dart
index cbdbf60..ac930ce 100644
--- a/pkg/compiler/lib/src/tracer.dart
+++ b/pkg/compiler/lib/src/tracer.dart
@@ -10,8 +10,8 @@
 import 'ssa/ssa_tracer.dart' show HTracer;
 import 'cps_ir/cps_ir_nodes.dart' as cps_ir;
 import 'cps_ir/cps_ir_tracer.dart' show IRTracer;
-import 'dart_backend/tree_ir_nodes.dart' as tree_ir;
-import 'dart_backend/tree_ir_tracer.dart' show TreeTracer;
+import 'tree_ir/tree_ir_nodes.dart' as tree_ir;
+import 'tree_ir/tree_ir_tracer.dart' show TreeTracer;
 import 'util/util.dart' show Indentation;
 import 'dart2jslib.dart';
 
@@ -57,10 +57,10 @@
     if (irObject is ssa.HGraph) {
       new HTracer(output, compiler, context).traceGraph(name, irObject);
     }
-    else if (irObject is cps_ir.FunctionDefinition) {
+    else if (irObject is cps_ir.ExecutableDefinition) {
       new IRTracer(output).traceGraph(name, irObject);
     }
-    else if (irObject is tree_ir.FunctionDefinition) {
+    else if (irObject is tree_ir.ExecutableDefinition) {
       new TreeTracer(output).traceGraph(name, irObject);
     }
   }
diff --git a/pkg/compiler/lib/src/dart_backend/copy_propagator.dart b/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
similarity index 89%
rename from pkg/compiler/lib/src/dart_backend/copy_propagator.dart
rename to pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
index 7115796..e85e16a 100644
--- a/pkg/compiler/lib/src/dart_backend/copy_propagator.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
@@ -2,10 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library copy_propagator;
-
-import '../elements/elements.dart';
-import 'tree_ir_nodes.dart';
+part of tree_ir.optimization;
 
 /// Eliminates moving assignments, such as w := v, by assigning directly to w
 /// at the definition of v.
@@ -13,7 +10,7 @@
 /// This compensates for suboptimal register allocation, and merges closure
 /// variables with local temporaries that were left behind when translating
 /// out of CPS (where closure variables live in a separate space).
-class CopyPropagator extends RecursiveVisitor {
+class CopyPropagator extends RecursiveVisitor with PassMixin {
 
   /// After visitStatement returns, [move] maps a variable v to an
   /// assignment A of form w := v, under the following conditions:
@@ -24,19 +21,16 @@
   /// Like [move], except w is the key instead of v.
   Map<Variable, Assign> inverseMove = <Variable, Assign>{};
 
-  /// The function currently being rewritten.
-  FunctionElement functionElement;
+  ExecutableElement currentElement;
 
-  void rewrite(FunctionDefinition function) {
-    if (function.isAbstract) return;
-
-    functionElement = function.element;
-    visitFunctionDefinition(function);
+  void rewriteExecutableDefinition(ExecutableDefinition root) {
+    currentElement = root.element;
+    root.body = visitStatement(root.body);
   }
 
-  void visitFunctionDefinition(FunctionDefinition function) {
-    assert(functionElement == function.element);
-    function.body = visitStatement(function.body);
+  rewriteFunctionDefinition(FunctionDefinition function) {
+    if (function.isAbstract) return;
+    rewriteExecutableDefinition(function);
 
     // Try to propagate moving assignments into function parameters.
     // For example:
@@ -60,7 +54,7 @@
     function.parameters.forEach(visitVariable);
 
     // Now do the propagation.
-    for (int i=0; i<function.parameters.length; i++) {
+    for (int i = 0; i < function.parameters.length; i++) {
       Variable param = function.parameters[i];
       Variable replacement = copyPropagateVariable(param);
       replacement.element = param.element; // Preserve parameter name.
@@ -134,7 +128,7 @@
     if (node.definition is Variable) {
       Variable def = node.definition;
       if (def.readCount == 1 &&
-          node.variable.host.element == functionElement) {
+          node.variable.host == currentElement) {
         move[node.definition] = node;
         inverseMove[node.variable] = node;
       }
diff --git a/pkg/compiler/lib/src/dart_backend/logical_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
similarity index 97%
rename from pkg/compiler/lib/src/dart_backend/logical_rewriter.dart
rename to pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
index 8689aaa..7138381 100644
--- a/pkg/compiler/lib/src/dart_backend/logical_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
@@ -2,10 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library logical_rewriter;
-
-import '../constants/values.dart' as values;
-import 'tree_ir_nodes.dart';
+part of tree_ir.optimization;
 
 /// Rewrites logical expressions to be more compact in the Tree IR.
 ///
@@ -57,17 +54,15 @@
 ///   x && !!y          (!!y validated by [isBooleanValued])
 ///   x && y            (double negation removed by [putInBooleanContext])
 ///
-class LogicalRewriter extends Visitor<Statement, Expression> {
+class LogicalRewriter extends Visitor<Statement, Expression> with PassMixin {
 
   /// Statement to be executed next by natural fallthrough. Although fallthrough
   /// is not introduced in this phase, we need to reason about fallthrough when
   /// evaluating the benefit of swapping the branches of an [If].
   Statement fallthrough;
 
-  void rewrite(FunctionDefinition definition) {
-    if (definition.isAbstract) return;
-
-    definition.body = visitStatement(definition.body);
+  void rewriteExecutableDefinition(ExecutableDefinition root) {
+    root.body = visitStatement(root.body);
   }
 
   Statement visitLabeledStatement(LabeledStatement node) {
diff --git a/pkg/compiler/lib/src/dart_backend/loop_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
similarity index 93%
rename from pkg/compiler/lib/src/dart_backend/loop_rewriter.dart
rename to pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
index 8c23383..182e806 100644
--- a/pkg/compiler/lib/src/dart_backend/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -2,9 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library loop_rewriter;
-
-import 'tree_ir_nodes.dart';
+part of tree_ir.optimization;
 
 /// Rewrites [WhileTrue] statements with an [If] body into a [WhileCondition],
 /// in situations where only one of the branches contains a [Continue] to the
@@ -29,14 +27,12 @@
 ///
 /// Note that the above pattern needs no iteration since nested ifs
 /// have been collapsed previously in the [StatementRewriter] phase.
-class LoopRewriter extends RecursiveVisitor {
+class LoopRewriter extends RecursiveVisitor with PassMixin {
 
   Set<Label> usedContinueLabels = new Set<Label>();
 
-  void rewrite(FunctionDefinition function) {
-    if (function.isAbstract) return;
-
-    function.body = visitStatement(function.body);
+  void rewriteExecutableDefinition(ExecutableDefinition root) {
+    root.body = visitStatement(root.body);
   }
 
   Statement visitLabeledStatement(LabeledStatement node) {
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart b/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
new file mode 100644
index 0000000..63652c4
--- /dev/null
+++ b/pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
@@ -0,0 +1,31 @@
+library tree_ir.optimization;
+
+import '../tree_ir_nodes.dart';
+import '../../elements/elements.dart';
+import '../../constants/values.dart' as values;
+
+part 'copy_propagator.dart';
+part 'logical_rewriter.dart';
+part 'loop_rewriter.dart';
+part 'statement_rewriter.dart';
+
+/// An optimization pass over the Tree IR.
+abstract class Pass {
+  /// Applies optimizations to root, rewriting it in the process.
+  void rewrite(ExecutableDefinition root) => root.applyPass(this);
+  void rewriteFieldDefinition(FieldDefinition root);
+  void rewriteFunctionDefinition(FunctionDefinition root);
+}
+
+
+abstract class PassMixin implements Pass {
+  void rewrite(ExecutableDefinition root) => root.applyPass(this);
+  void rewriteExecutableDefinition(ExecutableDefinition root);
+  void rewriteFieldDefinition(FieldDefinition root) {
+    rewriteExecutableDefinition(root);
+  }
+  void rewriteFunctionDefinition(FunctionDefinition root) {
+    if (root.isAbstract) return;
+    rewriteExecutableDefinition(root);
+  }
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/dart_backend/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
similarity index 96%
rename from pkg/compiler/lib/src/dart_backend/statement_rewriter.dart
rename to pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 8733f93..21cf920 100644
--- a/pkg/compiler/lib/src/dart_backend/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -2,9 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library statement_rewriter;
-
-import 'tree_ir_nodes.dart';
+part of tree_ir.optimization;
 
 /**
  * Performs the following transformations on the tree:
@@ -93,7 +91,7 @@
  * This may trigger a flattening of nested ifs in case the eliminated label
  * separated two ifs.
  */
-class StatementRewriter extends Visitor<Statement, Expression> {
+class StatementRewriter extends Visitor<Statement, Expression> implements Pass {
   // The binding environment.  The rightmost element of the list is the nearest
   // available enclosing binding.
   List<Assign> environment;
@@ -109,7 +107,19 @@
     return newJump != null ? newJump : jump;
   }
 
-  void rewrite(FunctionDefinition definition) {
+  void rewrite(ExecutableDefinition definition) => definition.applyPass(this);
+
+  void rewriteFieldDefinition(FieldDefinition definition) {
+    environment = <Assign>[];
+    definition.body = visitStatement(definition.body);
+
+    // TODO(kmillikin):  Allow definitions that are not propagated.  Here,
+    // this means rebuilding the binding with a recursively unnamed definition,
+    // or else introducing a variable definition and an assignment.
+    assert(environment.isEmpty);
+  }
+
+  void rewriteFunctionDefinition(FunctionDefinition definition) {
     if (definition.isAbstract) return;
 
     environment = <Assign>[];
@@ -121,6 +131,7 @@
     assert(environment.isEmpty);
   }
 
+
   Expression visitExpression(Expression e) => e.processed ? e : e.accept(this);
 
   Expression visitVariable(Variable node) {
diff --git a/pkg/compiler/lib/src/dart_backend/tree_ir_builder.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
similarity index 91%
rename from pkg/compiler/lib/src/dart_backend/tree_ir_builder.dart
rename to pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
index d4ba56e..77e7ea3 100644
--- a/pkg/compiler/lib/src/dart_backend/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -57,7 +57,7 @@
   // is the mapping from continuations to labels.
   final Map<cps_ir.Continuation, Label> labels = <cps_ir.Continuation, Label>{};
 
-  FunctionDefinition function;
+  ExecutableElement currentElement;
   cps_ir.Continuation returnContinuation;
 
   Builder parent;
@@ -73,12 +73,12 @@
   Variable phiTempVar;
 
   Variable getClosureVariable(Local local) {
-    if (local.executableContext != function.element) {
+    if (local.executableContext != currentElement) {
       return parent.getClosureVariable(local);
     }
     Variable variable = local2closure[local];
     if (variable == null) {
-      variable = new Variable(function, local);
+      variable = new Variable(currentElement, local);
       local2closure[local] = variable;
     }
     return variable;
@@ -96,7 +96,7 @@
       element2variables[primitive.hint] = variables;
     }
     while (variables.length <= primitive.registerIndex) {
-      variables.add(new Variable(function, primitive.hint));
+      variables.add(new Variable(currentElement, primitive.hint));
     }
     return variables[primitive.registerIndex];
   }
@@ -116,9 +116,43 @@
     return variable;
   }
 
-  FunctionDefinition build(cps_ir.FunctionDefinition node) {
-    visit(node);
-    return function;
+  ExecutableDefinition build(cps_ir.ExecutableDefinition node) {
+    if (node is cps_ir.FieldDefinition) {
+      return buildField(node);
+    } else if (node is cps_ir.FunctionDefinition) {
+      return buildFunction(node);
+    }
+    assert(false);
+  }
+
+  FieldDefinition buildField(cps_ir.FieldDefinition node) {
+    currentElement = node.element;
+    returnContinuation = node.returnContinuation;
+
+    phiTempVar = new Variable(node.element, null);
+
+    return new FieldDefinition(node.element, visit(node.body));
+  }
+
+  FunctionDefinition buildFunction(cps_ir.FunctionDefinition node) {
+    currentElement = node.element;
+    List<Variable> parameters = <Variable>[];
+    for (cps_ir.Parameter p in node.parameters) {
+      Variable parameter = getVariable(p);
+      assert(parameter != null);
+      ++parameter.writeCount; // Being a parameter counts as a write.
+      parameters.add(parameter);
+    }
+    returnContinuation = node.returnContinuation;
+
+    Statement body;
+    if (!node.isAbstract) {
+      phiTempVar = new Variable(node.element, null);
+      body = visit(node.body);
+    }
+
+    return new FunctionDefinition(node.element, parameters,
+        body, node.localConstants, node.defaultParameterValues);
   }
 
   List<Expression> translateArguments(List<cps_ir.Reference> args) {
@@ -232,24 +266,6 @@
 
   visitNode(cps_ir.Node node) => throw "Unhandled node: $node";
 
-  Expression visitFunctionDefinition(cps_ir.FunctionDefinition node) {
-    List<Variable> parameters = <Variable>[];
-    function = new FunctionDefinition(node.element, parameters,
-        null, node.localConstants, node.defaultParameterValues);
-    returnContinuation = node.returnContinuation;
-    for (cps_ir.Parameter p in node.parameters) {
-      Variable parameter = getVariable(p);
-      assert(parameter != null);
-      ++parameter.writeCount; // Being a parameter counts as a write.
-      parameters.add(parameter);
-    }
-    if (!node.isAbstract) {
-      phiTempVar = new Variable(function, null);
-      function.body = visit(node.body);
-    }
-    return null;
-  }
-
   Statement visitLetPrim(cps_ir.LetPrim node) {
     Variable variable = getVariable(node.primitive);
 
@@ -440,7 +456,7 @@
   }
 
   FunctionDefinition makeSubFunction(cps_ir.FunctionDefinition function) {
-    return new Builder.inner(this).build(function);
+    return new Builder.inner(this).buildFunction(function);
   }
 
   Node visitCreateFunction(cps_ir.CreateFunction node) {
@@ -473,5 +489,17 @@
   Expression visitIsTrue(cps_ir.IsTrue node) {
     return getVariableReference(node.value);
   }
+
+  dart2js.Selector get identicalSelector {
+    return new dart2js.Selector.call('identical', null, 2);
+  }
+
+  Expression visitIdentical(cps_ir.Identical node) {
+    return new InvokeStatic(
+        compiler.identicalFunction,
+        identicalSelector,
+        <Expression>[getVariableReference(node.left),
+                     getVariableReference(node.right)]);
+  }
 }
 
diff --git a/pkg/compiler/lib/src/dart_backend/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
similarity index 95%
rename from pkg/compiler/lib/src/dart_backend/tree_ir_nodes.dart
rename to pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index c076940..ac8e464 100644
--- a/pkg/compiler/lib/src/dart_backend/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -11,7 +11,7 @@
 import '../elements/elements.dart';
 import '../universe/universe.dart';
 import '../universe/universe.dart' show Selector;
-
+import 'optimization/optimization.dart';
 
 // The Tree language is the target of translation out of the CPS-based IR.
 //
@@ -87,7 +87,7 @@
  */
 class Variable extends Expression {
   /// Function that declares this variable.
-  FunctionDefinition host;
+  ExecutableElement host;
 
   /// [Entity] used for synthesizing a name for the variable.
   /// Different variables may have the same entity. May be null.
@@ -153,7 +153,7 @@
   final Selector selector;
   final List<Expression> arguments;
 
-  InvokeSuperMethod(this.selector, this.arguments) ;
+  InvokeSuperMethod(this.selector, this.arguments);
 
   accept(ExpressionVisitor visitor) => visitor.visitInvokeSuperMethod(this);
 }
@@ -493,7 +493,23 @@
   accept(StatementVisitor visitor) => visitor.visitExpressionStatement(this);
 }
 
-class FunctionDefinition extends Node {
+abstract class ExecutableDefinition {
+  ExecutableElement get element;
+  Statement body;
+
+  applyPass(Pass pass);
+}
+
+class FieldDefinition extends Node implements ExecutableDefinition {
+  final FieldElement element;
+  // The `body` of a field is its initializer.
+  Statement body;
+
+  FieldDefinition(this.element, this.body);
+  applyPass(Pass pass) => pass.rewriteFieldDefinition(this);
+}
+
+class FunctionDefinition extends Node implements ExecutableDefinition {
   final FunctionElement element;
   final List<Variable> parameters;
   Statement body;
@@ -507,6 +523,7 @@
   ///
   /// If `true` [body] is `null` and [localConstants] is empty.
   bool get isAbstract => body == null;
+  applyPass(Pass pass) => pass.rewriteFunctionDefinition(this);
 }
 
 abstract class ExpressionVisitor<E> {
@@ -543,8 +560,8 @@
   S visitExpressionStatement(ExpressionStatement node);
 }
 
-abstract class Visitor<S,E> implements ExpressionVisitor<E>,
-                                       StatementVisitor<S> {
+abstract class Visitor<S, E> implements ExpressionVisitor<E>,
+                                        StatementVisitor<S> {
    E visitExpression(Expression e) => e.accept(this);
    S visitStatement(Statement s) => s.accept(this);
 }
diff --git a/pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
similarity index 98%
rename from pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart
rename to pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
index b304450..a35e430 100644
--- a/pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
@@ -50,8 +50,8 @@
     blocks.add(block);
   }
 
-  void collect(FunctionDefinition function) {
-    visitStatement(function.body);
+  void collect(ExecutableDefinition node) {
+    visitStatement(node.body);
   }
 
   visitLabeledStatement(LabeledStatement node) {
@@ -151,11 +151,11 @@
   BlockCollector collector;
   int statementCounter;
 
-  void traceGraph(String name, FunctionDefinition function) {
+  void traceGraph(String name, ExecutableDefinition node) {
     names = new Names();
     statementCounter = 0;
     collector = new BlockCollector();
-    collector.collect(function);
+    collector.collect(node);
     tag("cfg", () {
       printProperty("name", name);
       int blockCounter = 0;
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index e5e3915..c3249d1 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -495,42 +495,78 @@
   }
 
   /**
-   * Fills [list] with the arguments in the normalized order.
-   *
-   * [compileArgument] is a function that returns a compiled version
-   * of an argument located in [arguments].
+   * Returns a `List` with the evaluated arguments in the normalized order.
    *
    * [compileDefaultValue] is a function that returns a compiled constant
-   * of an optional argument that is not in [arguments].
+   * of an optional argument that is not in [compiledArguments].
    *
-   * Returns [:true:] if the selector and the [element] match; [:false:]
-   * otherwise.
+   * Precondition: `this.applies(element, world)`.
    *
    * Invariant: [element] must be the implementation element.
    */
-  /*<T>*/ bool addArgumentsToList(
+  /*<S, T>*/ List/*<T>*/ makeArgumentsList(
+        FunctionElement element,
+        List/*<T>*/ compiledArguments,
+        /*T*/ compileDefaultValue(ParameterElement element)) {
+    assert(invariant(element, element.isImplementation));
+    List/*<T>*/ result = new List();
+    FunctionSignature parameters = element.functionSignature;
+    int i = 0;
+    parameters.forEachRequiredParameter((ParameterElement element) {
+      result.add(compiledArguments[i]);
+      ++i;
+    });
+
+    if (!parameters.optionalParametersAreNamed) {
+      parameters.forEachOptionalParameter((ParameterElement element) {
+        if (i < compiledArguments.length) {
+          result.add(compiledArguments[i]);
+          ++i;
+        } else {
+          result.add(compileDefaultValue(element));
+        }
+      });
+    } else {
+      int offset = i;
+      // Iterate over the optional parameters of the signature, and try to
+      // find them in [compiledNamedArguments]. If found, we use the
+      // value in the temporary list, otherwise the default value.
+      parameters.orderedOptionalParameters
+          .forEach((ParameterElement element) {
+        int foundIndex = namedArguments.indexOf(element.name);
+        if (foundIndex != -1) {
+          result.add(compiledArguments[offset + foundIndex]);
+        } else {
+          result.add(compileDefaultValue(element));
+        }
+      });
+    }
+    return result;
+  }
+
+  /// This is a version of [makeArgumentsList] that works for a `Link`
+  /// representation of arguments.
+  /*<T>*/ List/*<T>*/ makeArgumentsList2(
       Link<Node> arguments,
-      List/*<T>*/ list,
       FunctionElement element,
       /*T*/ compileArgument(Node argument),
-      /*T*/ compileDefaultValue(ParameterElement element),
-      World world) {
+      /*T*/ compileDefaultValue(ParameterElement element)) {
     assert(invariant(element, element.isImplementation));
-    if (!this.applies(element, world)) return false;
+    List/*<T>*/ result = new List();
 
     FunctionSignature parameters = element.functionSignature;
     parameters.forEachRequiredParameter((ParameterElement element) {
-      list.add(compileArgument(arguments.head));
+      result.add(compileArgument(arguments.head));
       arguments = arguments.tail;
     });
 
     if (!parameters.optionalParametersAreNamed) {
       parameters.forEachOptionalParameter((ParameterElement element) {
         if (!arguments.isEmpty) {
-          list.add(compileArgument(arguments.head));
+          result.add(compileArgument(arguments.head));
           arguments = arguments.tail;
         } else {
-          list.add(compileDefaultValue(element));
+          result.add(compileDefaultValue(element));
         }
       });
     } else {
@@ -546,15 +582,16 @@
       parameters.orderedOptionalParameters.forEach((ParameterElement element) {
         int foundIndex = namedArguments.indexOf(element.name);
         if (foundIndex != -1) {
-          list.add(compiledNamedArguments[foundIndex]);
+          result.add(compiledNamedArguments[foundIndex]);
         } else {
-          list.add(compileDefaultValue(element));
+          result.add(compileDefaultValue(element));
         }
       });
     }
-    return true;
+    return result;
   }
 
+
   /**
    * Fills [list] with the arguments in the order expected by
    * [callee], and where [caller] is a synthesized element
@@ -621,12 +658,13 @@
                                           signature.parameterCount,
                                           namedParameters);
 
-    return selector.addArgumentsToList(nodes,
-                                       list,
-                                       callee,
-                                       internalCompileArgument,
-                                       compileConstant,
-                                       world);
+    if (!selector.applies(callee, world)) return false;
+    list.addAll(selector.makeArgumentsList2(nodes,
+                                            callee,
+                                            internalCompileArgument,
+                                            compileConstant));
+
+    return true;
   }
 
   static bool sameNames(List<String> first, List<String> second) {
@@ -747,6 +785,14 @@
       new Map<Selector, Map<TypeMask, TypedSelector>>();
 
   factory TypedSelector(TypeMask mask, Selector selector, World world) {
+    if (!world.hasClosedWorldAssumption) {
+      // TODO(johnniwinther): Improve use of TypedSelector in an open world.
+      bool isNullable = mask.isNullable;
+      mask = world.compiler.typesTask.dynamicType;
+      if (isNullable) {
+        mask = mask.nullable();
+      }
+    }
     // TODO(johnniwinther): Allow more TypeSelector kinds during resoluton.
     assert(world.isClosed || mask.isExact);
     if (selector.mask == mask) return selector;
diff --git a/pkg/compiler/lib/src/use_unused_api.dart b/pkg/compiler/lib/src/use_unused_api.dart
index 8102e0c..2ffec97 100644
--- a/pkg/compiler/lib/src/use_unused_api.dart
+++ b/pkg/compiler/lib/src/use_unused_api.dart
@@ -31,6 +31,10 @@
 import 'universe/universe.dart' as universe;
 import 'util/util.dart' as util;
 
+import 'scanner/scannerlib.dart' show
+    PartialClassElement,
+    PartialFunctionElement;
+
 class ElementVisitor extends elements_visitor.ElementVisitor {
   visitElement(e) {}
 }
@@ -53,7 +57,7 @@
   useSsa(null);
   useCodeBuffer(null);
   usedByTests();
-  useElements(null, null, null);
+  useElements(null, null, null, null, null);
   useIr(null, null, null);
   useCompiler(null);
   useTypes();
@@ -119,6 +123,7 @@
 
 void useUtil(util.Link link) {
   link.reversePrependAll(link);
+  link.copyWithout(link);
   util.longestCommonPrefixLength(null, null);
   new util.Pair(null, null);
 }
@@ -205,11 +210,18 @@
   sourceFileProvider.readStringFromUri(null);
 }
 
-useElements(elements.ClassElement e, elements.Name n, modelx.FieldElementX f) {
+useElements(
+    elements.ClassElement e,
+    elements.Name n,
+    modelx.FieldElementX f,
+    PartialClassElement pce,
+    PartialFunctionElement pfe) {
   e.lookupClassMember(null);
   e.lookupInterfaceMember(null);
   n.isAccessibleFrom(null);
   f.reuseElement();
+  pce.copyWithEnclosing(null);
+  pfe.copyWithEnclosing(null);
 }
 
 useIr(cps_ir_nodes_sexpr.SExpressionStringifier stringifier,
@@ -217,13 +229,14 @@
       ir_builder.IrBuilder builder) {
   new cps_ir_nodes_sexpr.SExpressionStringifier();
   stringifier
-    ..newContinuationName()
-    ..newValueName()
+    ..newContinuationName(null)
+    ..newValueName(null)
     ..visitConstant(null)
     ..visitContinuation(null)
     ..visitDefinition(null)
     ..visitExpression(null)
     ..visitFunctionDefinition(null)
+    ..visitFieldDefinition(null)
     ..visitInvokeStatic(null)
     ..visitLetCont(null)
     ..visitNode(null)
diff --git a/pkg/compiler/lib/src/util/link.dart b/pkg/compiler/lib/src/util/link.dart
index c633abe..648e185 100644
--- a/pkg/compiler/lib/src/util/link.dart
+++ b/pkg/compiler/lib/src/util/link.dart
@@ -127,6 +127,8 @@
     }
     return true;
   }
+
+  Link copyWithout(e) => this;
 }
 
 abstract class LinkBuilder<T> {
diff --git a/pkg/compiler/lib/src/util/link_implementation.dart b/pkg/compiler/lib/src/util/link_implementation.dart
index 16997e9..5359102 100644
--- a/pkg/compiler/lib/src/util/link_implementation.dart
+++ b/pkg/compiler/lib/src/util/link_implementation.dart
@@ -136,6 +136,17 @@
   int get hashCode => throw new UnsupportedError('LinkEntry.hashCode');
 
   int slowLength() => 1 + tail.slowLength();
+
+  Link copyWithout(e) {
+    LinkBuilder copy = new LinkBuilder();
+    Link link = this;
+    for (; !link.isEmpty; link = link.tail) {
+      if (link.head != e) {
+        copy.addLast(link.head);
+      }
+    }
+    return copy.toLink(link);
+  }
 }
 
 class LinkBuilderImplementation<T> implements LinkBuilder<T> {
diff --git a/pkg/compiler/lib/src/util/setlet.dart b/pkg/compiler/lib/src/util/setlet.dart
index 10c0224..f497561e 100644
--- a/pkg/compiler/lib/src/util/setlet.dart
+++ b/pkg/compiler/lib/src/util/setlet.dart
@@ -157,7 +157,7 @@
     }
   }
 
-  bool remove(E element) {
+  bool remove(Object element) {
     if (_extra == null) {
       if (_contents == element) {
         _contents = _MARKER;
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 5b63242..f3e7cc1 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -4,7 +4,7 @@
 
 part of dart2js;
 
-const DONT_KNOW_HOW_TO_FIX = "";
+const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
 
 /**
  * The messages in this file should meet the following guide lines:
@@ -2160,6 +2160,24 @@
  var yield;
 }"""]);
 
+  static const MessageKind NATIVE_NOT_SUPPORTED = const MessageKind(
+      "'native' modifier is not supported.",
+      howToFix: "Try removing the 'native' implementation or analyzing the "
+                "code with the --allow-native-extensions option.",
+      examples: const ["""
+main() native "Main";
+"""]);
+
+  static const MessageKind DART_EXT_NOT_SUPPORTED = const MessageKind(
+      "The 'dart-ext' scheme is not supported.",
+      howToFix: "Try analyzing the code with the --allow-native-extensions "
+                "option.",
+      examples: const ["""
+import 'dart-ext:main';
+
+main() {}
+"""]);
+
   //////////////////////////////////////////////////////////////////////////////
   // Patch errors start.
   //////////////////////////////////////////////////////////////////////////////
@@ -2249,6 +2267,18 @@
       "Cannot patch non-function with function patch "
       "'#{functionName}'.");
 
+  static const MessageKind EXTERNAL_WITH_BODY = const MessageKind(
+      "External function '#{functionName}' cannot have a function body.",
+      options: const ["--output-type=dart"],
+      howToFix: "Try removing the 'external' modifier or the function body.",
+      examples: const ["""
+external foo() => 0;
+main() => foo();
+""", """
+external foo() {}
+main() => foo();
+"""]);
+
   //////////////////////////////////////////////////////////////////////////////
   // Patch errors end.
   //////////////////////////////////////////////////////////////////////////////
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 4391cdb..70bdcaa 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -96,6 +96,10 @@
 
   /// Returns `true` if any subclass of [superclass] implements [type].
   bool hasAnySubclassThatImplements(ClassElement superclass, ClassElement type);
+
+  /// Returns `true` if closed-world assumptions can be made, that is,
+  /// incremental compilation isn't enabled.
+  bool get hasClosedWorldAssumption;
 }
 
 class World implements ClassWorld {
@@ -521,4 +525,6 @@
     }
     return functionsThatMightBePassedToApply.contains(element);
   }
+
+  bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport;
 }
diff --git a/pkg/dart2js_incremental/lib/caching_compiler.dart b/pkg/dart2js_incremental/lib/caching_compiler.dart
index e239cb0..b2b193c 100644
--- a/pkg/dart2js_incremental/lib/caching_compiler.dart
+++ b/pkg/dart2js_incremental/lib/caching_compiler.dart
@@ -56,15 +56,19 @@
       }
     }
     oldTag.makeCurrent();
-    return new Future.value(
-        new Compiler(
-            inputProvider,
-            outputProvider,
-            diagnosticHandler,
-            libraryRoot,
-            packageRoot,
-            options,
-            environment));
+    compiler = new Compiler(
+        inputProvider,
+        outputProvider,
+        diagnosticHandler,
+        libraryRoot,
+        packageRoot,
+        options,
+        environment);
+    JavaScriptBackend backend = compiler.backend;
+    // Much like a scout, an incremental compiler is always prepared. For
+    // mixins, at least.
+    backend.emitter.oldEmitter.needsMixinSupport = true;
+    return new Future.value(compiler);
   } else {
     for (final task in compiler.tasks) {
       if (task.watch != null) {
@@ -100,11 +104,9 @@
     backend.emitter.oldEmitter.nsmEmitter
         ..trivialNsmHandlers.clear();
 
-    backend.emitter.typeTestEmitter
+    backend.emitter.typeTestRegistry
         ..checkedClasses = null
         ..checkedFunctionTypes = null
-        ..checkedGenericFunctionTypes.clear()
-        ..checkedNonGenericFunctionTypes.clear()
         ..rtiNeededClasses.clear()
         ..cachedClassesUsingTypeVariableTests = null;
 
diff --git a/pkg/dart2js_incremental/lib/dart2js_incremental.dart b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
index d1a3cb6..d5074f8 100644
--- a/pkg/dart2js_incremental/lib/dart2js_incremental.dart
+++ b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
@@ -75,6 +75,10 @@
     }
   }
 
+  LibraryElement get mainApp => _compiler.mainApp;
+
+  Compiler get compiler => _compiler;
+
   Future<bool> compile(Uri script) {
     return _reuseCompiler(null).then((Compiler compiler) {
       _compiler = compiler;
diff --git a/pkg/dart2js_incremental/lib/library_updater.dart b/pkg/dart2js_incremental/lib/library_updater.dart
index b5b20fc..559de96 100644
--- a/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/pkg/dart2js_incremental/lib/library_updater.dart
@@ -17,15 +17,18 @@
     Script;
 
 import 'package:compiler/src/elements/elements.dart' show
+    ClassElement,
     Element,
     FunctionElement,
     LibraryElement,
+    STATE_NOT_STARTED,
     ScopeContainerElement;
 
 import 'package:compiler/src/scanner/scannerlib.dart' show
     EOF_TOKEN,
     PartialClassElement,
     PartialElement,
+    PartialFieldList,
     PartialFunctionElement,
     Token;
 
@@ -43,8 +46,11 @@
 import 'package:compiler/src/js/js.dart' as jsAst;
 
 import 'package:compiler/src/js_emitter/js_emitter.dart' show
+    ClassBuilder,
+    ClassEmitter,
     CodeEmitterTask,
-    MemberInfo;
+    MemberInfo,
+    computeMixinClass;
 
 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart'
     as embeddedNames;
@@ -53,6 +59,18 @@
     JavaScriptBackend,
     Namer;
 
+import 'package:compiler/src/util/util.dart' show
+    Link,
+    LinkBuilder;
+
+import 'package:compiler/src/elements/modelx.dart' show
+    ClassElementX,
+    CompilationUnitElementX,
+    DeclarationSite,
+    ElementX,
+    FieldElementX,
+    LibraryElementX;
+
 import 'diff.dart' show
     Difference,
     computeDifference;
@@ -79,7 +97,7 @@
 
 // TODO(ahe): Generalize this class. For now only works for Compiler.mainApp,
 // and only if that library has exactly one compilation unit.
-class LibraryUpdater {
+class LibraryUpdater extends JsFeatures {
   final Compiler compiler;
 
   final api.CompilerInputProvider inputProvider;
@@ -96,6 +114,13 @@
 
   final List<FailedUpdate> _failedUpdates = <FailedUpdate>[];
 
+  final Set<ElementX> _elementsToInvalidate = new Set<ElementX>();
+
+  final Set<ElementX> _removedElements = new Set<ElementX>();
+
+  final Set<ClassElementX> _classesWithSchemaChanges =
+      new Set<ClassElementX>();
+
   LibraryUpdater(
       this.compiler,
       this.inputProvider,
@@ -109,12 +134,6 @@
 
   bool get failed => !_failedUpdates.isEmpty;
 
-  JavaScriptBackend get backend => compiler.backend;
-
-  Namer get namer => backend.namer;
-
-  CodeEmitterTask get emitter => backend.emitter;
-
   /// Used as tear-off passed to [LibraryLoaderTask.resetAsync].
   Future<bool> reuseLibrary(LibraryElement library) {
     assert(compiler != null);
@@ -169,8 +188,13 @@
     logTime('Differences computed.');
     for (Difference difference in differences) {
       logTime('Looking at difference: $difference');
-      if (difference.before == null || difference.after == null) {
-        cannotReuse(difference, "Can't reuse; Scope changed.");
+
+      if (difference.before == null && difference.after is PartialElement) {
+        canReuseAddedElement(difference.after, element, newElement);
+        continue;
+      }
+      if (difference.after == null && difference.before is PartialElement) {
+        canReuseRemovedElement(difference.before, element);
         continue;
       }
       Token diffToken = difference.token;
@@ -205,6 +229,204 @@
     return _failedUpdates.isEmpty;
   }
 
+  bool canReuseAddedElement(
+      PartialElement element,
+      ScopeContainerElement container,
+      ScopeContainerElement syntheticContainer) {
+    if (element is PartialFunctionElement) {
+      addFunction(element, container);
+      return true;
+    } else if (element is PartialClassElement) {
+      addClass(element, container);
+      return true;
+    } else if (element is PartialFieldList) {
+      addFields(element, container, syntheticContainer);
+      return true;
+    }
+    return cannotReuse(element, "Adding ${element.runtimeType} not supported.");
+  }
+
+  void addFunction(
+      PartialFunctionElement element,
+      /* ScopeContainerElement */ container) {
+    invalidateScopesAffectedBy(element, container);
+
+    updates.add(new AddedFunctionUpdate(compiler, element, container));
+  }
+
+  void addClass(
+      PartialClassElement element,
+      LibraryElementX library) {
+    invalidateScopesAffectedBy(element, library);
+
+    updates.add(new AddedClassUpdate(compiler, element, library));
+  }
+
+  /// Called when a field in [definition] has changed.
+  ///
+  /// There's no direct link from a [PartialFieldList] to its implied
+  /// [FieldElementX], so instead we use [syntheticContainer], the (synthetic)
+  /// container created by [canReuseLibrary], or [canReuseClass] (through
+  /// [PartialClassElement.parseNode]). This container is scanned looking for
+  /// fields whose declaration site is [definition].
+  // TODO(ahe): It would be nice if [computeDifference] returned this
+  // information directly.
+  void addFields(
+      PartialFieldList definition,
+      ScopeContainerElement container,
+      ScopeContainerElement syntheticContainer) {
+    List<FieldElementX> fields = <FieldElementX>[];
+    syntheticContainer.forEachLocalMember((ElementX member) {
+      if (member.declarationSite == definition) {
+        fields.add(member);
+      }
+    });
+    for (FieldElementX field in fields) {
+      // TODO(ahe): This only works when there's one field per
+      // PartialFieldList.
+      addField(field, container);
+    }
+  }
+
+  void addField(FieldElementX element, ScopeContainerElement container) {
+    invalidateScopesAffectedBy(element, container);
+    if (!element.isInstanceMember) {
+      cannotReuse(element, "Not an instance field.");
+    } else {
+      addInstanceField(element, container);
+    }
+  }
+
+  void addInstanceField(FieldElementX element, ClassElementX cls) {
+    _classesWithSchemaChanges.add(cls);
+
+    updates.add(new AddedFieldUpdate(compiler, element, cls));
+  }
+
+  bool canReuseRemovedElement(
+      PartialElement element,
+      ScopeContainerElement container) {
+    if (element is PartialFunctionElement) {
+      removeFunction(element);
+      return true;
+    } else if (element is PartialClassElement) {
+      removeClass(element);
+      return true;
+    } else if (element is PartialFieldList) {
+      removeFields(element, container);
+      return true;
+    }
+    return cannotReuse(
+        element, "Removing ${element.runtimeType} not supported.");
+  }
+
+  void removeFunction(PartialFunctionElement element) {
+    logVerbose("Removed method $element.");
+
+    invalidateScopesAffectedBy(element, element.enclosingElement);
+
+    _removedElements.add(element);
+
+    updates.add(new RemovedFunctionUpdate(compiler, element));
+  }
+
+  void removeClass(PartialClassElement element) {
+    logVerbose("Removed class $element.");
+
+    invalidateScopesAffectedBy(element, element.library);
+
+    _removedElements.add(element);
+    element.forEachLocalMember((ElementX member) {
+      _removedElements.add(member);
+    });
+
+    updates.add(new RemovedClassUpdate(compiler, element));
+  }
+
+  void removeFields(
+      PartialFieldList definition,
+      ScopeContainerElement container) {
+    List<FieldElementX> fields = <FieldElementX>[];
+    container.forEachLocalMember((ElementX member) {
+      if (member.declarationSite == definition) {
+        fields.add(member);
+      }
+    });
+    for (FieldElementX field in fields) {
+      // TODO(ahe): This only works when there's one field per
+      // PartialFieldList.
+      removeField(field);
+    }
+  }
+
+  void removeField(FieldElementX element) {
+    logVerbose("Removed field $element.");
+    if (!element.isInstanceMember) {
+      cannotReuse(element, "Not an instance field.");
+    } else {
+      removeInstanceField(element);
+    }
+  }
+
+  void removeInstanceField(FieldElementX element) {
+    PartialClassElement cls = element.enclosingClass;
+
+    _classesWithSchemaChanges.add(cls);
+    invalidateScopesAffectedBy(element, cls);
+
+    _removedElements.add(element);
+
+    updates.add(new RemovedFieldUpdate(compiler, element));
+  }
+
+  void invalidateScopesAffectedBy(
+      ElementX element,
+      /* ScopeContainerElement */ container) {
+    for (ScopeContainerElement scope in scopesAffectedBy(element, container)) {
+      scanSites(scope, (Element member, DeclarationSite site) {
+        // TODO(ahe): Cache qualifiedNamesIn to avoid quadratic behavior.
+        Set<String> names = qualifiedNamesIn(site);
+        if (canNamesResolveStaticallyTo(names, element, container)) {
+          _elementsToInvalidate.add(member);
+        }
+      });
+    }
+  }
+
+  /// Invoke [f] on each [DeclarationSite] in [element]. If [element] is a
+  /// [ScopeContainerElement], invoke f on all local members as well.
+  void scanSites(
+      Element element,
+      void f(ElementX element, DeclarationSite site)) {
+    DeclarationSite site = declarationSite(element);
+    if (site != null) {
+      f(element, site);
+    }
+    if (element is ScopeContainerElement) {
+      element.forEachLocalMember((member) { scanSites(member, f); });
+    }
+  }
+
+  /// Assume [element] is either removed from or added to [container], and
+  /// return all [ScopeContainerElement] that can see this change.
+  List<ScopeContainerElement> scopesAffectedBy(
+      Element element,
+      /* ScopeContainerElement */ container) {
+    // TODO(ahe): Use library export graph to compute this.
+    // TODO(ahe): Should return all user-defined libraries and packages.
+    LibraryElement library = container.library;
+    List<ScopeContainerElement> result = <ScopeContainerElement>[library];
+
+    if (!container.isClass) return result;
+
+    ClassElement cls = container;
+
+    var externalSubtypes =
+        compiler.world.subtypesOf(cls).where((e) => e.library != library);
+
+    return result..addAll(externalSubtypes);
+  }
+
   /// Returns true if function [before] can be reused to reflect the changes in
   /// [after].
   ///
@@ -223,7 +445,9 @@
       last = node.body.getBeginToken();
     }
     if (isTokenBetween(diffToken, after.beginToken, last)) {
-      return cannotReuse(after, 'Signature changed.');
+      removeFunction(before);
+      addFunction(after, before.enclosingElement);
+      return true;
     }
     logVerbose('Simple modification of ${after} detected');
     updates.add(new FunctionUpdate(compiler, before, after));
@@ -243,9 +467,13 @@
       return cannotReuse(after, "Class has no body.");
     }
     if (isTokenBetween(diffToken, node.beginToken, body.beginToken)) {
-      return cannotReuse(after, "Class header changed.");
+      logVerbose('Class header modified in ${after}');
+      updates.add(new ClassUpdate(compiler, before, after));
+      before.forEachLocalMember((ElementX member) {
+        // TODO(ahe): Quadratic.
+        invalidateScopesAffectedBy(member, before);
+      });
     }
-    logVerbose('Simple modification of ${after} detected');
     return canReuseScopeContainerElement(before, after);
   }
 
@@ -270,32 +498,119 @@
         ' ${before} (${before.runtimeType} -> ${after.runtimeType}).');
   }
 
-  List<Element> applyUpdates() {
+  /// Apply the collected [updates]. Return a list of elements that needs to be
+  /// recompiled after applying the updates. Any elements removed as a
+  /// consequence of applying the patches are added to [removals] if provided.
+  List<Element> applyUpdates([List<Update> removals]) {
+    for (Update update in updates) {
+      update.captureState();
+    }
     if (!_failedUpdates.isEmpty) {
       throw new StateError(
           "Can't compute update.\n\n${_failedUpdates.join('\n\n')}");
     }
-    return updates.map((Update update) => update.apply()).toList();
+    for (ElementX element in _elementsToInvalidate) {
+      compiler.forgetElement(element);
+      element.reuseElement();
+    }
+    List<Element> elementsToInvalidate = <Element>[];
+    for (ElementX element in _elementsToInvalidate) {
+      if (!_removedElements.contains(element)) {
+        elementsToInvalidate.add(element);
+      }
+    }
+    for (Update update in updates) {
+      Element element = update.apply();
+      if (update.isRemoval) {
+        if (removals != null) {
+          removals.add(update);
+        }
+      } else {
+        elementsToInvalidate.add(element);
+      }
+    }
+    return elementsToInvalidate;
   }
 
   String computeUpdateJs() {
-    List<Element> updatedElements = applyUpdates();
+    Set existingClasses =
+        new Set.from(compiler.codegenWorld.directlyInstantiatedClasses);
+
+    List<Update> removals = <Update>[];
+    List<Element> updatedElements = applyUpdates(removals);
     if (compiler.progress != null) {
       compiler.progress.reset();
     }
     for (Element element in updatedElements) {
-      compiler.enqueuer.resolution.addToWorkList(element);
+      if (!element.isClass) {
+        compiler.enqueuer.resolution.addToWorkList(element);
+      } else {
+        NO_WARN(element).ensureResolved(compiler);
+      }
     }
     compiler.processQueue(compiler.enqueuer.resolution, null);
 
     compiler.phase = Compiler.PHASE_DONE_RESOLVING;
 
+    // TODO(ahe): Clean this up. Don't call this method in analyze-only mode.
+    if (compiler.analyzeOnly) return "/* analyze only */";
+
+    Set<ClassElementX> changedClasses =
+        new Set<ClassElementX>.from(_classesWithSchemaChanges);
     for (Element element in updatedElements) {
-      compiler.enqueuer.codegen.addToWorkList(element);
+      if (!element.isClass) {
+        compiler.enqueuer.codegen.addToWorkList(element);
+      } else {
+        changedClasses.add(element);
+      }
     }
     compiler.processQueue(compiler.enqueuer.codegen, null);
 
     List<jsAst.Statement> updates = <jsAst.Statement>[];
+
+    Set newClasses =
+        new Set.from(compiler.codegenWorld.directlyInstantiatedClasses);
+    newClasses.removeAll(existingClasses);
+
+    List<jsAst.Statement> inherits = <jsAst.Statement>[];
+
+    for (ClassElementX cls in newClasses) {
+      jsAst.Node classAccess = namer.elementAccess(cls);
+      String name = namer.getNameOfClass(cls);
+
+      updates.add(
+          js.statement(
+              r'# = #', [classAccess, invokeDefineClass(cls)]));
+
+      ClassElement superclass = cls.superclass;
+      if (superclass != null) {
+        jsAst.Node superAccess = namer.elementAccess(superclass);
+        inherits.add(
+            js.statement(
+                r'self.$dart_unsafe_eval.inheritFrom(#, #)',
+                [classAccess, superAccess]));
+      }
+    }
+
+    // Call inheritFrom after all classes have been created. This way we don't
+    // need to sort the classes by having superclasses defined before their
+    // subclasses.
+    updates.addAll(inherits);
+
+    for (ClassElementX cls in changedClasses) {
+      ClassElement superclass = cls.superclass;
+      jsAst.Node superAccess =
+          superclass == null ? js('null') : namer.elementAccess(superclass);
+      jsAst.Node classAccess = namer.elementAccess(cls);
+      updates.add(
+          js.statement(
+              r'# = self.$dart_unsafe_eval.schemaChange(#, #, #)',
+              [classAccess, invokeDefineClass(cls), classAccess, superAccess]));
+    }
+
+    for (RemovalUpdate update in removals) {
+      update.writeUpdateJsOn(updates);
+    }
     for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
       if (!element.isField) {
         updates.add(computeMemberUpdateJs(element));
@@ -309,6 +624,19 @@
     }
   }
 
+  jsAst.Expression invokeDefineClass(ClassElementX cls) {
+    String name = namer.getNameOfClass(cls);
+    var descriptor = js('Object.create(null)');
+    return js(
+        r'''
+(new Function(
+    "$collectedClasses", "$desc",
+    self.$dart_unsafe_eval.defineClass(#, #) +"\n;return " + #))({#: #})''',
+        [js.string(name), js.stringArray(computeFields(cls)),
+         js.string(name),
+         js.string(name), descriptor]);
+  }
+
   jsAst.Node computeMemberUpdateJs(Element element) {
     MemberInfo info = emitter.oldEmitter.containerBuilder
         .analyzeMemberMethod(element);
@@ -322,6 +650,12 @@
       jsAst.Node elementAccess = namer.elementAccess(element.enclosingClass);
       statements.add(
           js.statement('#.prototype.# = f', [elementAccess, name]));
+
+      if (backend.isAliasedSuperMember(element)) {
+        String superName = namer.getNameOfAliasedSuperMember(element);
+        statements.add(
+          js.statement('#.prototype.# = f', [elementAccess, superName]));
+      }
     } else {
       jsAst.Node elementAccess = namer.elementAccess(element);
       jsAst.Expression globalFunctionsAccess =
@@ -357,6 +691,10 @@
     int parameterCount = element.functionSignature.parameterCount;
     return '$callPrefix\$$parameterCount';
   }
+
+  List<String> computeFields(ClassElement cls) {
+    return new EmitterHelper(compiler).computeFields(cls);
+  }
 }
 
 /// Represents an update (aka patch) of [before] to [after]. We use the word
@@ -371,11 +709,18 @@
   Update(this.compiler);
 
   /// Applies the update to [before] and returns that element.
-  PartialElement apply();
+  Element apply();
+
+  bool get isRemoval => false;
+
+  /// Called before any patches are applied to capture any state that is needed
+  /// later.
+  void captureState() {
+  }
 }
 
 /// Represents an update of a function element.
-class FunctionUpdate extends Update {
+class FunctionUpdate extends Update with ReuseFunction {
   final PartialFunctionElement before;
 
   final PartialFunctionElement after;
@@ -395,6 +740,12 @@
     before.endToken = after.endToken;
     before.getOrSet = after.getOrSet;
   }
+}
+
+abstract class ReuseFunction {
+  Compiler get compiler;
+
+  PartialFunctionElement get before;
 
   /// Reset various caches and remove this element from the compiler's internal
   /// state.
@@ -403,3 +754,419 @@
     before.reuseElement();
   }
 }
+
+abstract class RemovalUpdate extends Update {
+  ElementX get element;
+
+  RemovalUpdate(Compiler compiler)
+      : super(compiler);
+
+  bool get isRemoval => true;
+
+  void writeUpdateJsOn(List<jsAst.Statement> updates);
+
+  void removeFromEnclosing() {
+    // TODO(ahe): Need to recompute duplicated elements logic again. Simplest
+    // solution is probably to remove all elements from enclosing scope and add
+    // them back.
+    if (element.isTopLevel) {
+      removeFromLibrary(element.library);
+    } else {
+      removeFromEnclosingClass(element.enclosingClass);
+    }
+  }
+
+  void removeFromEnclosingClass(PartialClassElement cls) {
+    cls.localMembersCache = null;
+    cls.localMembersReversed = cls.localMembersReversed.copyWithout(element);
+    cls.localScope.contents.remove(element.name);
+  }
+
+  void removeFromLibrary(LibraryElementX library) {
+    library.localMembers = library.localMembers.copyWithout(element);
+    library.localScope.contents.remove(element.name);
+  }
+}
+
+class RemovedFunctionUpdate extends RemovalUpdate
+    with JsFeatures, ReuseFunction {
+  final PartialFunctionElement element;
+
+  /// Name of property to remove using JavaScript "delete". Null for
+  /// non-instance methods.
+  String name;
+
+  /// Name of super-alias property to remove using JavaScript "delete".  Null
+  /// for methods that aren't "super aliased", and non-instance methods.
+  String superName;
+
+  /// For instance methods, access to class object. Otherwise, access to the
+  /// method itself.
+  jsAst.Node elementAccess;
+
+  bool wasStateCaptured = false;
+
+  RemovedFunctionUpdate(Compiler compiler, this.element)
+      : super(compiler);
+
+  PartialFunctionElement get before => element;
+
+  PartialFunctionElement get after => null;
+
+  void captureState() {
+    if (wasStateCaptured) throw "captureState was called twice.";
+    wasStateCaptured = true;
+
+    if (element.isInstanceMember) {
+      elementAccess = namer.elementAccess(element.enclosingClass);
+      name = namer.getNameOfMember(element);
+      if (backend.isAliasedSuperMember(element)) {
+        superName = namer.getNameOfAliasedSuperMember(element);
+      }
+    } else {
+      elementAccess = namer.elementAccess(element);
+    }
+  }
+
+  PartialFunctionElement apply() {
+    if (!wasStateCaptured) throw "captureState must be called before apply.";
+    removeFromEnclosing();
+    reuseElement();
+    return null;
+  }
+
+  void writeUpdateJsOn(List<jsAst.Statement> updates) {
+    if (elementAccess == null) {
+      compiler.internalError(
+          element, 'No elementAccess for ${element.runtimeType}');
+    }
+    if (element.isInstanceMember) {
+      if (name == null) {
+        compiler.internalError(element, 'No name for ${element.runtimeType}');
+      }
+      updates.add(
+          js.statement('delete #.prototype.#', [elementAccess, name]));
+
+      if (superName != null) {
+        updates.add(
+            js.statement('delete #.prototype.#', [elementAccess, superName]));
+      }
+    } else {
+      updates.add(js.statement('delete #', [elementAccess]));
+    }
+  }
+}
+
+class RemovedClassUpdate extends RemovalUpdate with JsFeatures {
+  final PartialClassElement element;
+
+  bool wasStateCaptured = false;
+
+  final List<jsAst.Node> accessToStatics = <jsAst.Node>[];
+
+  RemovedClassUpdate(Compiler compiler, this.element)
+      : super(compiler);
+
+  PartialClassElement get before => element;
+
+  PartialClassElement get after => null;
+
+  void captureState() {
+    if (wasStateCaptured) throw "captureState was called twice.";
+    wasStateCaptured = true;
+
+    accessToStatics.add(namer.elementAccess(element));
+
+    element.forEachLocalMember((ElementX member) {
+      if (!member.isInstanceMember) {
+        accessToStatics.add(namer.elementAccess(member));
+      }
+    });
+  }
+
+  PartialClassElement apply() {
+    if (!wasStateCaptured) {
+      throw new StateError("captureState must be called before apply.");
+    }
+
+    removeFromEnclosing();
+
+    element.forEachLocalMember((ElementX member) {
+      compiler.forgetElement(member);
+      member.reuseElement();
+    });
+
+    compiler.forgetElement(element);
+    element.reuseElement();
+
+    return null;
+  }
+
+  void writeUpdateJsOn(List<jsAst.Statement> updates) {
+    if (accessToStatics.isEmpty) {
+      throw
+          new StateError("captureState must be called before writeUpdateJsOn.");
+    }
+
+    for (jsAst.Node access in accessToStatics) {
+      updates.add(js.statement('delete #', [access]));
+    }
+  }
+}
+
+class RemovedFieldUpdate extends RemovalUpdate with JsFeatures {
+  final FieldElementX element;
+
+  bool wasStateCaptured = false;
+
+  jsAst.Node elementAccess;
+
+  String getterName;
+
+  String setterName;
+
+  RemovedFieldUpdate(Compiler compiler, this.element)
+      : super(compiler);
+
+  PartialFieldList get before => element.declarationSite;
+
+  PartialFieldList get after => null;
+
+  void captureState() {
+    if (wasStateCaptured) throw "captureState was called twice.";
+    wasStateCaptured = true;
+
+    elementAccess = namer.elementAccess(element.enclosingClass);
+    getterName = namer.getterName(element);
+    setterName = namer.setterName(element);
+  }
+
+  FieldElementX apply() {
+    if (!wasStateCaptured) {
+      throw new StateError("captureState must be called before apply.");
+    }
+
+    removeFromEnclosing();
+
+    return element;
+  }
+
+  void writeUpdateJsOn(List<jsAst.Statement> updates) {
+    if (!wasStateCaptured) {
+      throw new StateError(
+          "captureState must be called before writeUpdateJsOn.");
+    }
+
+    updates.add(
+        js.statement('delete #.prototype.#', [elementAccess, getterName]));
+    updates.add(
+        js.statement('delete #.prototype.#', [elementAccess, setterName]));
+  }
+}
+
+class AddedFunctionUpdate extends Update with JsFeatures {
+  final PartialFunctionElement element;
+
+  final /* ScopeContainerElement */ container;
+
+  AddedFunctionUpdate(Compiler compiler, this.element, this.container)
+      : super(compiler) {
+    if (container == null) {
+      throw "container is null";
+    }
+  }
+
+  PartialFunctionElement get before => null;
+
+  PartialFunctionElement get after => element;
+
+  PartialFunctionElement apply() {
+    Element enclosing = container;
+    if (enclosing.isLibrary) {
+      // TODO(ahe): Reuse compilation unit of element instead?
+      enclosing = enclosing.compilationUnit;
+    }
+    PartialFunctionElement copy = element.copyWithEnclosing(enclosing);
+    NO_WARN(container).addMember(copy, compiler);
+    return copy;
+  }
+}
+
+class AddedClassUpdate extends Update with JsFeatures {
+  final PartialClassElement element;
+
+  final LibraryElementX library;
+
+  AddedClassUpdate(Compiler compiler, this.element, this.library)
+      : super(compiler);
+
+  PartialClassElement get before => null;
+
+  PartialClassElement get after => element;
+
+  PartialClassElement apply() {
+    // TODO(ahe): Reuse compilation unit of element instead?
+    CompilationUnitElementX compilationUnit = library.compilationUnit;
+    PartialClassElement copy = element.copyWithEnclosing(compilationUnit);
+    compilationUnit.addMember(copy, compiler);
+    return copy;
+  }
+}
+
+class AddedFieldUpdate extends Update with JsFeatures {
+  final FieldElementX element;
+
+  final ScopeContainerElement container;
+
+  AddedFieldUpdate(Compiler compiler, this.element, this.container)
+      : super(compiler);
+
+  PartialFieldList get before => null;
+
+  PartialFieldList get after => element.declarationSite;
+
+  FieldElementX apply() {
+    FieldElementX copy = element.copyWithEnclosing(container);
+    NO_WARN(container).addMember(copy, compiler);
+    return copy;
+  }
+}
+
+
+class ClassUpdate extends Update with JsFeatures {
+  final PartialClassElement before;
+
+  final PartialClassElement after;
+
+  ClassUpdate(Compiler compiler, this.before, this.after)
+      : super(compiler);
+
+  PartialClassElement apply() {
+    patchElement();
+    reuseElement();
+    return before;
+  }
+
+  /// Destructively change the tokens in [before] to match those of [after].
+  void patchElement() {
+    before.cachedNode = after.cachedNode;
+    before.beginToken = after.beginToken;
+    before.endToken = after.endToken;
+  }
+
+  void reuseElement() {
+    before.supertype = null;
+    before.interfaces = null;
+    before.nativeTagInfo = null;
+    before.supertypeLoadState = STATE_NOT_STARTED;
+    before.resolutionState = STATE_NOT_STARTED;
+    before.isProxy = false;
+    before.hasIncompleteHierarchy = false;
+    before.backendMembers = const Link<Element>();
+    before.allSupertypesAndSelf = null;
+  }
+}
+
+/// Returns all qualified names in [element] with less than four identifiers. A
+/// qualified name is an identifier followed by a sequence of dots and
+/// identifiers, for example, "x", and "x.y.z". But not "x.y.z.w" ("w" is the
+/// fourth identifier).
+///
+/// The longest possible name that can be resolved is three identifiers, for
+/// example, "prefix.MyClass.staticMethod". Since four or more identifiers
+/// cannot resolve to anything statically, they're not included in the returned
+/// value of this method.
+Set<String> qualifiedNamesIn(PartialElement element) {
+  Token beginToken = element.beginToken;
+  Token endToken = element.endToken;
+  Token token = beginToken;
+  if (element is PartialClassElement) {
+    ClassNode node = element.cachedNode;
+    if (node != null) {
+      NodeList body = node.body;
+      if (body != null) {
+        endToken = body.beginToken;
+      }
+    }
+  }
+  Set<String> names = new Set<String>();
+  do {
+    if (token.isIdentifier()) {
+      String name = token.value;
+      // [name] is a single "identifier".
+      names.add(name);
+      if (identical('.', token.next.stringValue) &&
+          token.next.next.isIdentifier()) {
+        token = token.next.next;
+        name += '.${token.value}';
+        // [name] is "idenfifier.idenfifier".
+        names.add(name);
+
+        if (identical('.', token.next.stringValue) &&
+            token.next.next.isIdentifier()) {
+          token = token.next.next;
+          name += '.${token.value}';
+          // [name] is "idenfifier.idenfifier.idenfifier".
+          names.add(name);
+
+          while (identical('.', token.next.stringValue) &&
+                 token.next.next.isIdentifier()) {
+            // Skip remaining identifiers, they cannot statically resolve to
+            // anything, and must be dynamic sends.
+            token = token.next.next;
+          }
+        }
+      }
+    }
+    token = token.next;
+  } while (token.kind != EOF_TOKEN && token != endToken);
+  return names;
+}
+
+/// Returns true if one of the qualified names in names (as computed by
+/// [qualifiedNamesIn]) could be a static reference to [element].
+bool canNamesResolveStaticallyTo(
+    Set<String> names,
+    Element element,
+    /* ScopeContainerElement */ container) {
+  if (names.contains(element.name)) return true;
+  if (container != null && container.isClass) {
+    // [names] contains C.m, where C is the name of [container], and m is the
+    // name of [element].
+    if (names.contains("${container.name}.${element.name}")) return true;
+  }
+  // TODO(ahe): Check for prefixes as well.
+  return false;
+}
+
+DeclarationSite declarationSite(Element element) {
+  return element is ElementX ? element.declarationSite : null;
+}
+
+abstract class JsFeatures {
+  Compiler get compiler;
+
+  JavaScriptBackend get backend => compiler.backend;
+
+  Namer get namer => backend.namer;
+
+  CodeEmitterTask get emitter => backend.emitter;
+}
+
+class EmitterHelper extends JsFeatures {
+  final Compiler compiler;
+
+  EmitterHelper(this.compiler);
+
+  ClassEmitter get classEmitter => backend.emitter.oldEmitter.classEmitter;
+
+  List<String> computeFields(ClassElement cls) {
+    // TODO(ahe): Rewrite for new emitter.
+    ClassBuilder builder = new ClassBuilder(cls, namer);
+    classEmitter.emitFields(cls, builder, "");
+    return builder.fields;
+  }
+}
+
+// TODO(ahe): Remove this method.
+NO_WARN(x) => x;
diff --git a/pkg/docgen/test/native_extensions_test.dart b/pkg/docgen/test/native_extensions_test.dart
new file mode 100644
index 0000000..70e789c
--- /dev/null
+++ b/pkg/docgen/test/native_extensions_test.dart
@@ -0,0 +1,100 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library native_extensions_test;
+
+import 'dart:io';
+
+import 'package:path/path.dart' as path;
+import 'package:unittest/unittest.dart';
+
+import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
+import '../lib/docgen.dart';
+
+const String DART_LIBRARY = '''
+  library sample_synchronous_extension;
+
+  import 'dart-ext:sample_extension';
+
+  // The simplest way to call native code: top-level functions.
+  int systemRand() native "SystemRand";
+  bool systemSrand(int seed) native "SystemSrand";
+
+  void main() {
+    systemRand();
+    systemSrand(4);
+  }
+''';
+
+main() {
+  group('Generate docs for', () {
+    test('file with native extensions.', () {
+      var temporaryDir = Directory.systemTemp.createTempSync('native_ext_');
+      var fileName = path.join(temporaryDir.path, 'temp.dart');
+      var file = new File(fileName);
+      file.writeAsStringSync(DART_LIBRARY);
+
+      return getMirrorSystem([new Uri.file(fileName)], false)
+        .then((mirrorSystem) {
+          var testLibraryUri = new Uri.file(path.absolute(fileName),
+                                            windows: Platform.isWindows);
+          var library = new Library(mirrorSystem.libraries[testLibraryUri]);
+          expect(library is Library, isTrue);
+
+          var classTypes = library.classes;
+          var classes = [];
+          classes.addAll(classTypes.values);
+          classes.addAll(library.errors.values);
+          expect(classes.every((e) => e is Class), isTrue);
+
+          expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
+
+          var classMethodTypes = [];
+          classes.forEach((e) {
+            classMethodTypes.add(e.methods);
+            classMethodTypes.add(e.inheritedMethods);
+          });
+          expect(classMethodTypes.every((e) => e is Map<String, Method>),
+                 isTrue);
+
+          var classMethods = [];
+          classMethodTypes.forEach((e) {
+            classMethods.addAll(e.values);
+          });
+          expect(classMethods.every((e) => e is Method), isTrue);
+
+          var methodParameters = [];
+          classMethods.forEach((e) {
+            methodParameters.addAll(e.parameters.values);
+          });
+          expect(methodParameters.every((e) => e is Parameter), isTrue);
+
+          var functionTypes = library.functions;
+          expect(functionTypes is Map<String, Method>, isTrue);
+
+          var functions = [];
+          functions.addAll(functionTypes.values);
+          expect(functions.every((e) => e is Method), isTrue);
+
+          var functionParameters = [];
+          functions.forEach((e) {
+            functionParameters.addAll(e.parameters.values);
+          });
+          expect(functionParameters.every((e) => e is Parameter), isTrue);
+
+          var variables = library.variables.values;
+          expect(variables.every((e) => e is Variable), isTrue);
+
+          // Testing trying to refer to m1 function
+          var libraryDocComment =
+              library.fixReference('systemRand').children.first.text;
+          expect(libraryDocComment, 'sample_synchronous_extension.systemRand');
+
+          libraryDocComment =
+              library.fixReference('systemSrand').children.first.text;
+          expect(libraryDocComment, 'sample_synchronous_extension.systemSrand');
+        }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
+    });
+  });
+}
diff --git a/pkg/glob/CHANGELOG.md b/pkg/glob/CHANGELOG.md
index 409bdec..4a1e352 100644
--- a/pkg/glob/CHANGELOG.md
+++ b/pkg/glob/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 1.0.3
+
+* Fix a bug where `Glob.list()` and `Glob.listSync()` would incorrectly throw
+  exceptions when a directory didn't exist on the filesystem.
+
 ## 1.0.2
 
 * Fixed `Glob.list()` on Windows.
diff --git a/pkg/glob/lib/src/list_tree.dart b/pkg/glob/lib/src/list_tree.dart
index 44eaaf3..3667d63 100644
--- a/pkg/glob/lib/src/list_tree.dart
+++ b/pkg/glob/lib/src/list_tree.dart
@@ -13,6 +13,13 @@
 import 'stream_pool.dart';
 import 'utils.dart';
 
+/// The errno for a file or directory not existing on Mac and Linux.
+const _ENOENT = 2;
+
+/// Another errno we see on Windows when trying to list a non-existent
+/// directory.
+const _ENOENT_WIN = 3;
+
 /// A structure built from a glob that efficiently lists filesystem entities
 /// that match that glob.
 ///
@@ -319,8 +326,17 @@
       children.forEach((sequence, child) {
         if (entity is! Directory) return;
         if (!sequence.matches(basename)) return;
-        resultPool.add(child.list(p.join(dir, basename),
-            followLinks: followLinks));
+        var stream = child.list(p.join(dir, basename), followLinks: followLinks)
+            .handleError((_) {}, test: (error) {
+          // Ignore errors from directories not existing. We do this here so
+          // that we only ignore warnings below wild cards. For example, the
+          // glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but
+          // succeed if "foo/bar/qux/baz" doesn't exist.
+          return error is FileSystemException &&
+              (error.osError.errorCode == _ENOENT ||
+              error.osError.errorCode == _ENOENT_WIN);
+        });
+        resultPool.add(stream);
       });
     },
         onError: resultController.addError,
@@ -361,8 +377,21 @@
       entities.addAll(children.keys
           .where((sequence) => sequence.matches(basename))
           .expand((sequence) {
-        return children[sequence].listSync(
-            p.join(dir, basename), followLinks: followLinks);
+        try {
+          return children[sequence].listSync(
+              p.join(dir, basename), followLinks: followLinks).toList();
+        } on FileSystemException catch (error) {
+          // Ignore errors from directories not existing. We do this here so
+          // that we only ignore warnings below wild cards. For example, the
+          // glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but
+          // succeed if "foo/bar/qux/baz" doesn't exist.
+          if (error.osError.errorCode == _ENOENT ||
+              error.osError.errorCode == _ENOENT_WIN) {
+            return const [];
+          } else {
+            rethrow;
+          }
+        }
       }));
 
       return entities;
diff --git a/pkg/glob/pubspec.yaml b/pkg/glob/pubspec.yaml
index 8c4deb2..997de2d 100644
--- a/pkg/glob/pubspec.yaml
+++ b/pkg/glob/pubspec.yaml
@@ -1,5 +1,5 @@
 name: glob
-version: 1.0.2
+version: 1.0.3
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: Bash-style filename globbing.
diff --git a/pkg/glob/test/list_test.dart b/pkg/glob/test/list_test.dart
index ff02343..3327524 100644
--- a/pkg/glob/test/list_test.dart
+++ b/pkg/glob/test/list_test.dart
@@ -251,6 +251,18 @@
         p.join("foo", "baz", "qux")
       ])));
     });
+
+    test("lists a subdirectory that sometimes exists", () {
+      d.dir("top", [
+        d.dir("dir1", [
+          d.dir("subdir", [d.file("file")])
+        ]),
+        d.dir("dir2", [])
+      ]).create();
+
+      expect(list("top/*/subdir/**"),
+          completion(equals([p.join("top", "dir1", "subdir", "file")])));
+    });
   });
 }
 
diff --git a/pkg/http_server/CHANGELOG.md b/pkg/http_server/CHANGELOG.md
new file mode 100644
index 0000000..d13aea8
--- /dev/null
+++ b/pkg/http_server/CHANGELOG.md
@@ -0,0 +1,12 @@
+# 0.9.5+1
+
+* Updated the layout of package contents.
+
+# 0.9.5
+
+* Removed the decoding of HTML entity values (in the form &#xxxxx;) for
+  values when parsing multipart/form-post requests.
+
+# 0.9.4
+
+* Fixed bugs in the handling of the Range header
diff --git a/pkg/http_server/README.md b/pkg/http_server/README.md
index f0b90f4..e428814 100644
--- a/pkg/http_server/README.md
+++ b/pkg/http_server/README.md
@@ -1,19 +1,12 @@
-# http_server
+A set of high-level classes that, together with
+`HttpServer`, makes is easier to serve web content.
 
-This package contains a set of high-level classes that, together with
-HttpServer, makes is easy to provide content through HTTP servers.
-
-**NOTE:** This package currently only works for
-server-side or command-line Dart applications. In other words, if the app
-imports `dart:io`, it can use this package.
-
-## Using
-
-Please see the [API docs][docs] for explanations and examples.
+**NOTE:** This package only works for server-side or command-line Dart 
+applications. In other words, if the app imports `dart:io`, it can use this 
+package.
 
 ## Filing issues
 
-Please file issues for the http package at [http://dartbug.com/new][bugs].
+File issues for the `http_server` package at [http://dartbug.com/new][bugs].
 
 [bugs]: http://dartbug.com/new
-[docs]: https://api.dartlang.org/docs/channels/stable/latest/http_server.html
\ No newline at end of file
diff --git a/pkg/http_server/lib/http_server.dart b/pkg/http_server/lib/http_server.dart
index afaf71c..bcd99df 100644
--- a/pkg/http_server/lib/http_server.dart
+++ b/pkg/http_server/lib/http_server.dart
@@ -26,11 +26,11 @@
  * 	import 'dart:io';
  * 	import 'dart:async';
  * 	import 'package:http_server/http_server.dart';
- * 
+ *
  * 	void main() {
  * 	  var staticFiles = new VirtualDirectory('.')
  * 	    ..allowDirectoryListing = true;
- * 
+ *
  * 	  runZoned(() {
  * 	    HttpServer.bind('0.0.0.0', 7777).then((server) {
  * 	      print('Server running');
@@ -41,25 +41,25 @@
  *     }
  *
  * ## Virtual directory
- * 
+ *
  * The [VirtualDirectory] class makes it easy to serve static content
  * from the file system. It supports:
- * 
+ *
  *  *  Range-based requests.
  *  *  If-Modified-Since based caching.
  *  *  Automatic GZip-compression of content.
  *  *  Following symlinks, either throughout the system or inside
  *     a jailed root.
  *  *  Directory listing.
- * 
+ *
  * See [VirtualDirectory] for more information.
- * 
+ *
  * ## Virtual host
- * 
+ *
  * The [VirtualHost] class helps to serve multiple hosts on the same
  * address, by using the `Host` field of the incoming requests. It also
  * works with wildcards for sub-domains.
- * 
+ *
  *     var virtualHost = new VirtualHost(server);
  *     // Filter out on a specific host
  *     var stream1 = virtualServer.addHost('static.myserver.com');
@@ -67,24 +67,14 @@
  *     var stream2 = virtualServer.addHost('*.myserver.com');
  *     // Requets not matching any hosts.
  *     var stream3 = virtualServer.unhandled;
- * 
+ *
  * See [VirtualHost] for more information.
  *
  * [pub]: http://pub.dartlang.org/packages/http_server
  */
 library http_server;
 
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:mime/mime.dart';
-import "package:path/path.dart";
-
-part 'src/http_body.dart';
-part 'src/http_body_impl.dart';
-part 'src/http_multipart_form_data.dart';
-part 'src/http_multipart_form_data_impl.dart';
-part 'src/virtual_directory.dart';
-part 'src/virtual_host.dart';
-
+export 'src/http_body.dart';
+export 'src/http_multipart_form_data.dart';
+export 'src/virtual_directory.dart';
+export 'src/virtual_host.dart';
diff --git a/pkg/http_server/lib/src/http_body.dart b/pkg/http_server/lib/src/http_body.dart
index 6eb4d31..c40d284 100644
--- a/pkg/http_server/lib/src/http_body.dart
+++ b/pkg/http_server/lib/src/http_body.dart
@@ -2,8 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.http_body;
 
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
+import 'http_body_impl.dart';
 
 /**
  * [HttpBodyHandler] is a helper class for processing and collecting
@@ -104,7 +109,7 @@
    * for more information on `multipart/form-data`.
    */
   HttpBodyHandler({Encoding defaultEncoding: UTF8})
-      : _transformer = new _HttpBodyHandlerTransformer(defaultEncoding);
+      : _transformer = new HttpBodyHandlerTransformer(defaultEncoding);
 
   /**
    * Process and parse an incoming [HttpRequest]. The returned [HttpRequestBody]
@@ -115,7 +120,7 @@
   static Future<HttpRequestBody> processRequest(
       HttpRequest request,
       {Encoding defaultEncoding: UTF8}) {
-    return _HttpBodyHandler.processRequest(request, defaultEncoding);
+    return HttpBodyHandlerImpl.processRequest(request, defaultEncoding);
   }
 
   /**
@@ -126,7 +131,7 @@
   static Future<HttpClientResponseBody> processResponse(
       HttpClientResponse response,
       {Encoding defaultEncoding: UTF8}) {
-    return _HttpBodyHandler.processResponse(response, defaultEncoding);
+    return HttpBodyHandlerImpl.processResponse(response, defaultEncoding);
   }
 
   Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
diff --git a/pkg/http_server/lib/src/http_body_impl.dart b/pkg/http_server/lib/src/http_body_impl.dart
index 7682902..b6c43c9 100644
--- a/pkg/http_server/lib/src/http_body_impl.dart
+++ b/pkg/http_server/lib/src/http_body_impl.dart
@@ -2,13 +2,22 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.http_body_impl;
 
-class _HttpBodyHandlerTransformer
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:mime/mime.dart';
+
+import 'http_body.dart';
+import 'http_multipart_form_data.dart';
+
+class HttpBodyHandlerTransformer
     implements StreamTransformer<HttpRequest, HttpRequestBody> {
   final Encoding _defaultEncoding;
 
-  const _HttpBodyHandlerTransformer(this._defaultEncoding);
+  const HttpBodyHandlerTransformer(this._defaultEncoding);
 
   Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
     return new Stream<HttpRequestBody>.eventTransformed(
@@ -28,7 +37,7 @@
 
   void add(HttpRequest request) {
     _pending++;
-    _HttpBodyHandler.processRequest(request, _defaultEncoding)
+    HttpBodyHandlerImpl.processRequest(request, _defaultEncoding)
         .then(_outSink.add, onError: _outSink.addError)
         .whenComplete(() {
           _pending--;
@@ -44,7 +53,7 @@
   }
 }
 
-class _HttpBodyHandler {
+class HttpBodyHandlerImpl {
   static Future<HttpRequestBody> processRequest(
       HttpRequest request,
       Encoding defaultEncoding) {
diff --git a/pkg/http_server/lib/src/http_multi_server.dart b/pkg/http_server/lib/src/http_multi_server.dart
deleted file mode 100644
index e69de29..0000000
--- a/pkg/http_server/lib/src/http_multi_server.dart
+++ /dev/null
diff --git a/pkg/http_server/lib/src/http_multipart_form_data.dart b/pkg/http_server/lib/src/http_multipart_form_data.dart
index eae575b..ec98d75 100644
--- a/pkg/http_server/lib/src/http_multipart_form_data.dart
+++ b/pkg/http_server/lib/src/http_multipart_form_data.dart
@@ -2,8 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.http_multipart_form_data;
 
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:mime/mime.dart';
+
+import 'http_multipart_form_data_impl.dart';
 
 /**
  * [:HttpMultipartFormData:] class used for 'upgrading' a [MimeMultipart] by
@@ -76,5 +83,5 @@
    */
   static HttpMultipartFormData parse(MimeMultipart multipart,
                                      {Encoding defaultEncoding: UTF8})
-      => _HttpMultipartFormData.parse(multipart, defaultEncoding);
+      => HttpMultipartFormDataImpl.parse(multipart, defaultEncoding);
 }
diff --git a/pkg/http_server/lib/src/http_multipart_form_data_impl.dart b/pkg/http_server/lib/src/http_multipart_form_data_impl.dart
index daebeec..dc72bf1 100644
--- a/pkg/http_server/lib/src/http_multipart_form_data_impl.dart
+++ b/pkg/http_server/lib/src/http_multipart_form_data_impl.dart
@@ -2,10 +2,18 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.http_multipart_form_data_impl;
 
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
 
-class _HttpMultipartFormData extends Stream implements HttpMultipartFormData {
+import 'package:mime/mime.dart';
+
+import 'http_multipart_form_data.dart';
+
+class HttpMultipartFormDataImpl extends Stream
+    implements HttpMultipartFormData {
   final ContentType contentType;
   final HeaderValue contentDisposition;
   final HeaderValue contentTransferEncoding;
@@ -16,7 +24,7 @@
 
   Stream _stream;
 
-  _HttpMultipartFormData(ContentType this.contentType,
+  HttpMultipartFormDataImpl(ContentType this.contentType,
                          HeaderValue this.contentDisposition,
                          HeaderValue this.contentTransferEncoding,
                          MimeMultipart this._mimeMultipart,
@@ -32,23 +40,12 @@
         contentType.primaryType == 'text' ||
         contentType.mimeType == 'application/json') {
       _isText = true;
-      StringBuffer buffer = new StringBuffer();
       Encoding encoding;
-      if (contentType != null) {
+      if (contentType != null && contentType.charset != null) {
         encoding = Encoding.getByName(contentType.charset);
       }
       if (encoding == null) encoding = defaultEncoding;
-      _stream = _stream
-          .transform(encoding.decoder)
-          .expand((data) {
-            buffer.write(data);
-            var out = _decodeHttpEntityString(buffer.toString());
-            if (out != null) {
-              buffer.clear();
-              return [out];
-            }
-            return const [];
-          });
+      _stream = _stream.transform(encoding.decoder);
     }
   }
 
@@ -85,7 +82,7 @@
       throw new HttpException(
           "Mime Multipart doesn't contain a Content-Disposition header value");
     }
-    return new _HttpMultipartFormData(
+    return new HttpMultipartFormDataImpl(
         type, disposition, encoding, multipart, defaultEncoding);
   }
 
@@ -102,41 +99,4 @@
   String value(String name) {
     return _mimeMultipart.headers[name];
   }
-
-  // Decode a string with HTTP entities. Returns null if the string ends in the
-  // middle of a http entity.
-  static String _decodeHttpEntityString(String input) {
-    int amp = input.lastIndexOf('&');
-    if (amp < 0) return input;
-    int end = input.lastIndexOf(';');
-    if (end < amp) return null;
-
-    var buffer = new StringBuffer();
-    int offset = 0;
-
-    parse(amp, end) {
-      switch (input[amp + 1]) {
-        case '#':
-          if (input[amp + 2] == 'x') {
-            buffer.writeCharCode(
-                int.parse(input.substring(amp + 3, end), radix: 16));
-          } else {
-            buffer.writeCharCode(int.parse(input.substring(amp + 2, end)));
-          }
-          break;
-
-        default:
-          throw new HttpException('Unhandled HTTP entity token');
-      }
-    }
-
-    while ((amp = input.indexOf('&', offset)) >= 0) {
-      buffer.write(input.substring(offset, amp));
-      int end = input.indexOf(';', amp);
-      parse(amp, end);
-      offset = end + 1;
-    }
-    buffer.write(input.substring(offset));
-    return buffer.toString();
-  }
 }
diff --git a/pkg/http_server/lib/src/virtual_directory.dart b/pkg/http_server/lib/src/virtual_directory.dart
index 6dfec5d..bd8ca73 100644
--- a/pkg/http_server/lib/src/virtual_directory.dart
+++ b/pkg/http_server/lib/src/virtual_directory.dart
@@ -2,8 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.virtual_directory;
 
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:mime/mime.dart';
+import 'package:path/path.dart';
 
 // Used for signal a directory redirecting, where a tailing slash is missing.
 class _DirectoryRedirect {
@@ -209,54 +215,73 @@
       response.headers.set(HttpHeaders.LAST_MODIFIED, lastModified);
       response.headers.set(HttpHeaders.ACCEPT_RANGES, "bytes");
 
-      if (request.method == 'HEAD') {
-        response.close();
-        return null;
-      }
-
       return file.length().then((length) {
-        String range = request.headers.value("range");
+        String range = request.headers.value(HttpHeaders.RANGE);
         if (range != null) {
           // We only support one range, where the standard support several.
           Match matches = new RegExp(r"^bytes=(\d*)\-(\d*)$").firstMatch(range);
           // If the range header have the right format, handle it.
-          if (matches != null) {
+          if (matches != null &&
+              (matches[1].isNotEmpty || matches[2].isNotEmpty)) {
             // Serve sub-range.
-            int start;
-            int end;
+            int start;  // First byte position - inclusive.
+            int end;  // Last byte position - inclusive.
             if (matches[1].isEmpty) {
-              start = matches[2].isEmpty ?
-                  length :
-                  length - int.parse(matches[2]);
-              end = length;
+              start = length - int.parse(matches[2]);
+              if (start < 0) start = 0;
+              end = length - 1;
             } else {
               start = int.parse(matches[1]);
-              end = matches[2].isEmpty ? length : int.parse(matches[2]) + 1;
+              end = matches[2].isEmpty ? length - 1: int.parse(matches[2]);
             }
+            // If the range is syntactically invalid the Range header
+            // MUST be ignored (RFC 2616 section 14.35.1).
+            if (start <= end) {
+              if (end >= length) {
+                end = length - 1;
+              }
 
-            // Override Content-Length with the actual bytes sent.
-            response.headers.set(HttpHeaders.CONTENT_LENGTH, end - start);
+              if (start >= length) {
+                response
+                    ..statusCode = HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE
+                    ..close();
+                return;
+              }
 
-            // Set 'Partial Content' status code.
-            response.statusCode = HttpStatus.PARTIAL_CONTENT;
-            response.headers.set(HttpHeaders.CONTENT_RANGE,
-                                 "bytes $start-${end - 1}/$length");
+              // Override Content-Length with the actual bytes sent.
+              response.headers.set(HttpHeaders.CONTENT_LENGTH, end - start + 1);
 
-            // Pipe the 'range' of the file.
-            file.openRead(start, end)
-                .pipe(new _VirtualDirectoryFileStream(response, file.path))
-                .catchError((_) {
-                  // TODO(kevmoo): log errors
-                });
-            return;
+              // Set 'Partial Content' status code.
+              response
+                  ..statusCode = HttpStatus.PARTIAL_CONTENT
+                  ..headers.set(HttpHeaders.CONTENT_RANGE,
+                                'bytes $start-$end/$length');
+
+              // Pipe the 'range' of the file.
+              if (request.method == 'HEAD') {
+                response.close();
+              } else {
+                file.openRead(start, end + 1)
+                    .pipe(new _VirtualDirectoryFileStream(response, file.path))
+                    .catchError((_) {
+                      // TODO(kevmoo): log errors
+                    });
+              }
+              return;
+            }
           }
         }
 
-        file.openRead()
-            .pipe(new _VirtualDirectoryFileStream(response, file.path))
-            .catchError((_) {
-              // TODO(kevmoo): log errors
-            });
+        response.headers.set(HttpHeaders.CONTENT_LENGTH, length);
+        if (request.method == 'HEAD') {
+          response.close();
+        } else {
+          file.openRead()
+              .pipe(new _VirtualDirectoryFileStream(response, file.path))
+              .catchError((_) {
+                // TODO(kevmoo): log errors
+              });
+        }
       });
     }).catchError((_) {
       response.statusCode = HttpStatus.NOT_FOUND;
diff --git a/pkg/http_server/lib/src/virtual_host.dart b/pkg/http_server/lib/src/virtual_host.dart
index 4c67eca..9c5229c 100644
--- a/pkg/http_server/lib/src/virtual_host.dart
+++ b/pkg/http_server/lib/src/virtual_host.dart
@@ -2,8 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of http_server;
+library http_server.virtual_host;
 
+import 'dart:async';
+import 'dart:io';
 
 /**
  * The [VirtualHost] class is a utility class for handling multiple hosts on
diff --git a/pkg/http_server/pubspec.yaml b/pkg/http_server/pubspec.yaml
index 7542e12..6bf4501 100644
--- a/pkg/http_server/pubspec.yaml
+++ b/pkg/http_server/pubspec.yaml
@@ -1,12 +1,12 @@
 name: http_server
-version: 0.9.3
+version: 0.9.5+1
 author: Dart Team <misc@dartlang.org>
 description: Library of HTTP server classes.
 homepage: http://www.dartlang.org
-dependencies:
-  mime: ">=0.9.0 <0.10.0"
-  path: ">=0.9.0 <2.0.0"
-dev_dependencies:
-  unittest: ">=0.10.0 <0.12.0"
 environment:
-  sdk: ">=0.8.10+6 <2.0.0"
+  sdk: '>=1.0.0 <2.0.0'
+dependencies:
+  mime: '>=0.9.0 <0.10.0'
+  path: '>=0.9.0 <2.0.0'
+dev_dependencies:
+  unittest: '>=0.10.0 <0.12.0'
diff --git a/pkg/http_server/test/http_mock.dart b/pkg/http_server/test/http_mock.dart
index aa20ffb..be2b50c 100644
--- a/pkg/http_server/test/http_mock.dart
+++ b/pkg/http_server/test/http_mock.dart
@@ -9,6 +9,9 @@
   final Map<String, List<String>> _headers =
       new HashMap<String, List<String>>();
 
+  operator[](key) => _headers[key];
+
+  int get contentLength => int.parse(_headers[HttpHeaders.CONTENT_LENGTH][0]);
 
   DateTime get ifModifiedSince {
     List<String> values = _headers[HttpHeaders.IF_MODIFIED_SINCE];
@@ -97,7 +100,11 @@
    * Implemented to remove editor warnings
    */
   dynamic noSuchMethod(Invocation invocation) {
-    print([invocation.memberName, invocation.isGetter, invocation.isSetter, invocation.isMethod, invocation.isAccessor]);
+    print([invocation.memberName,
+           invocation.isGetter,
+           invocation.isSetter,
+           invocation.isMethod,
+           invocation.isAccessor]);
     return super.noSuchMethod(invocation);
   }
 }
@@ -182,6 +189,8 @@
 
   String get mockContent => UTF8.decode(_buffer);
 
+  List<int> get mockContentBinary => _buffer;
+
   bool get mockDone => _isDone;
 
   // Copied from SDK http_impl.dart @ 845 on 2014-01-05
diff --git a/pkg/http_server/test/http_multipart_test.dart b/pkg/http_server/test/http_multipart_test.dart
index d1d0843..96d5702 100644
--- a/pkg/http_server/test/http_multipart_test.dart
+++ b/pkg/http_server/test/http_multipart_test.dart
@@ -9,10 +9,16 @@
 import 'dart:io';
 import 'dart:convert';
 
+// Representation of a form field from a multipart/form-data form POST body.
 class FormField {
+  // Name of the form field specified in Content-Disposition.
   final String name;
+  // Value of the form field. This is either a String or a List<int> depending
+  // on the Content-Type.
   final value;
+  // Content-Type of the form field.
   final String contentType;
+  // Filename if specified in Content-Disposition.
   final String filename;
 
   FormField(String this.name,
@@ -32,6 +38,8 @@
            filename == other.filename;
   }
 
+  int get hashCode => name.hashCode;
+
   String toString() {
     return "FormField('$name', '$value', '$contentType', '$filename')";
   }
@@ -40,23 +48,21 @@
 void postDataTest(List<int> message,
                   String contentType,
                   String boundary,
-                  List<FormField> expectedFields) {
+                  List<FormField> expectedFields,
+                  {defaultEncoding: LATIN1}) {
   HttpServer.bind("127.0.0.1", 0).then((server) {
     server.listen((request) {
       String boundary = request.headers.contentType.parameters['boundary'];
       request
           .transform(new MimeMultipartTransformer(boundary))
           .map((part) => HttpMultipartFormData.parse(
-              part, defaultEncoding: LATIN1))
+              part, defaultEncoding: defaultEncoding))
           .map((multipart) {
             var future;
             if (multipart.isText) {
-              future = multipart
-                  .fold(new StringBuffer(), (b, s) => b..write(s))
-                  .then((b) => b.toString());
+              future = multipart.join();
             } else {
-              future = multipart
-                  .fold([], (b, s) => b..addAll(s));
+              future = multipart.fold([], (b, s) => b..addAll(s));
             }
             return future
                 .then((data) {
@@ -72,7 +78,7 @@
                           multipart.contentDisposition.parameters['filename']);
                 });
           })
-          .fold([], (l, f) => l..add(f))
+          .toList()
           .then(Future.wait)
           .then((fields) {
             expect(fields, equals(expectedFields));
@@ -93,6 +99,16 @@
   });
 }
 
+void testEmptyPostData() {
+  var message = '''
+------WebKitFormBoundaryU3FBruSkJKG0Yor1--\r\n''';
+
+  postDataTest(message.codeUnits,
+               'multipart/form-data',
+               '----WebKitFormBoundaryU3FBruSkJKG0Yor1',
+               []);
+}
+
 void testPostData() {
   var message = '''
 \r\n--AaB03x\r
@@ -176,6 +192,9 @@
                               contentType: 'application/octet-stream',
                               filename: 'VERSION')]);
 
+  // In Chrome, Safari and Firefox HTML entity encoding might be used for
+  // values in form fields. The HTML entity encoding for ひらがな is
+  // &#12402;&#12425;&#12364;&#12394;
   message = [
       45, 45, 45, 45, 45, 45, 87, 101, 98, 75, 105, 116, 70, 111, 114, 109, 66,
       111, 117, 110, 100, 97, 114, 121, 118, 65, 86, 122, 117, 103, 75, 77, 116,
@@ -191,7 +210,28 @@
   postDataTest(message,
                'multipart/form-data',
                '----WebKitFormBoundaryvAVzugKMtZbyWoBG',
-               [new FormField('name', 'ひらがな')]);
+               [new FormField('name', '&#12402;&#12425;&#12364;&#12394;')],
+               defaultEncoding: UTF8);
+
+  // The UTF-8 encoding of ひらがな is
+  // [227, 129, 178, 227, 130, 137, 227, 129, 140, 227, 129, 170].
+  message = [
+      45, 45, 45, 45, 45, 45, 87, 101, 98, 75, 105, 116, 70, 111, 114, 109, 66,
+      111, 117, 110, 100, 97, 114, 121, 71, 88, 116, 66, 114, 99, 106, 120, 104,
+      101, 75, 101, 78, 54, 105, 48, 13, 10, 67, 111, 110, 116, 101, 110, 116,
+      45, 68, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 58, 32, 102,
+      111, 114, 109, 45, 100, 97, 116, 97, 59, 32, 110, 97, 109, 101, 61, 34,
+      116, 101, 115, 116, 34, 13, 10, 13, 10, 227, 129, 178, 227, 130, 137, 227,
+      129, 140, 227, 129, 170, 13, 10, 45, 45, 45, 45, 45, 45, 87, 101, 98, 75,
+      105, 116, 70, 111, 114, 109, 66, 111, 117, 110, 100, 97, 114, 121, 71, 88,
+      116, 66, 114, 99, 106, 120, 104, 101, 75, 101, 78, 54, 105, 48, 45, 45,
+      13, 10];
+
+  postDataTest(message,
+               'multipart/form-data',
+               '----WebKitFormBoundaryGXtBrcjxheKeN6i0',
+               [new FormField('test', 'ひらがな')],
+               defaultEncoding: UTF8);
 
   message = [
       45, 45, 45, 45, 45, 45, 87, 101, 98, 75, 105, 116, 70, 111, 114, 109, 66,
@@ -212,5 +252,6 @@
 
 
 void main() {
+  testEmptyPostData();
   testPostData();
 }
diff --git a/pkg/http_server/test/utils.dart b/pkg/http_server/test/utils.dart
index c0b3c5c..80c16ca 100644
--- a/pkg/http_server/test/utils.dart
+++ b/pkg/http_server/test/utils.dart
@@ -42,12 +42,14 @@
 }
 
 Future<int> getStatusCodeForVirtDir(VirtualDirectory virtualDir,
-                           String path,
-                          {String host,
-                           bool secure: false,
-                           DateTime ifModifiedSince,
-                           bool rawPath: false,
-                           bool followRedirects: true}) {
+                                    String path,
+                                    {String host,
+                                     bool secure: false,
+                                     DateTime ifModifiedSince,
+                                     bool rawPath: false,
+                                     bool followRedirects: true,
+                                     int from,
+                                     int to}) {
 
   // if this is a mock test, then run the mock code path
   if(_isMockTestExpando[currentTestCase]) {
@@ -55,6 +57,7 @@
 
     var request = new MockHttpRequest(uri, followRedirects: followRedirects,
         ifModifiedSince: ifModifiedSince);
+    _addRangeHeader(request, from, to);
 
     return _withMockRequest(virtualDir, request)
         .then((response) {
@@ -67,7 +70,7 @@
   return _withServer(virtualDir, (port) {
     return getStatusCode(port, path, host: host, secure: secure,
           ifModifiedSince: ifModifiedSince, rawPath: rawPath,
-          followRedirects: followRedirects);
+          followRedirects: followRedirects, from: from, to: to);
   });
 }
 
@@ -77,29 +80,36 @@
                            bool secure: false,
                            DateTime ifModifiedSince,
                            bool rawPath: false,
-                           bool followRedirects: true}) {
+                           bool followRedirects: true,
+                           int from,
+                           int to}) {
   var uri = _getUri(port, path, secure: secure, rawPath: rawPath);
 
-  return new HttpClient().getUrl(uri)
+  var client = new HttpClient();
+  return client.getUrl(uri)
       .then((request) {
         if (!followRedirects) request.followRedirects = false;
         if (host != null) request.headers.host = host;
         if (ifModifiedSince != null) {
           request.headers.ifModifiedSince = ifModifiedSince;
         }
+        _addRangeHeader(request, from, to);
         return request.close();
       })
-      .then((response) => response.drain().then(
-          (_) => response.statusCode));
+      .then((response) => response.drain()
+          .then((_) => response.statusCode))
+      .whenComplete(() => client.close());
 }
 
-Future<HttpHeaders> getHeaders(VirtualDirectory virDir, String path) {
+Future<HttpHeaders> getHeaders(
+    VirtualDirectory virDir, String path, {int from, int to}) {
 
   // if this is a mock test, then run the mock code path
   if(_isMockTestExpando[currentTestCase]) {
     var uri = _getUri(0, path);
 
     var request = new MockHttpRequest(uri);
+    _addRangeHeader(request, from, to);
 
     return _withMockRequest(virDir, request)
         .then((response) {
@@ -110,7 +120,7 @@
   assert(_isMockTestExpando[currentTestCase] == false);
 
   return _withServer(virDir, (port) {
-      return _getHeaders(port, path);
+      return _getHeaders(port, path, from, to);
     });
 }
 
@@ -135,6 +145,52 @@
     });
 }
 
+Future<List<int>> getAsBytes(
+    VirtualDirectory virtualDir, String path, {int from, int to}) {
+
+  // if this is a mock test, then run the mock code path
+  if (_isMockTestExpando[currentTestCase]) {
+    var uri = _getUri(0, path);
+
+    var request = new MockHttpRequest(uri);
+    _addRangeHeader(request, from, to);
+
+    return _withMockRequest(virtualDir, request)
+        .then((response) {
+          return response.mockContentBinary;
+        });
+  };
+
+  assert(_isMockTestExpando[currentTestCase] == false);
+
+  return _withServer(virtualDir, (int port) {
+      return _getAsBytes(port, path, from, to);
+    });
+}
+
+Future<List> getContentAndResponse(
+    VirtualDirectory virtualDir, String path, {int from, int to}) {
+  // if this is a mock test, then run the mock code path
+  if (_isMockTestExpando[currentTestCase]) {
+    var uri = _getUri(0, path);
+
+    var request = new MockHttpRequest(uri);
+    _addRangeHeader(request, from, to);
+
+    return _withMockRequest(virtualDir, request)
+        .then((response) {
+          return [response.mockContentBinary,
+                  response];
+        });
+  };
+
+  assert(_isMockTestExpando[currentTestCase] == false);
+
+  return _withServer(virtualDir, (int port) {
+      return _getContentAndResponse(port, path, from, to);
+    });
+}
+
 Future<MockHttpResponse> _withMockRequest(VirtualDirectory virDir,
     MockHttpRequest request) {
     return virDir.serveRequest(request).then((value) {
@@ -167,18 +223,48 @@
       .whenComplete(() => server.close());
 }
 
-Future<HttpHeaders> _getHeaders(int port, String path) =>
-    new HttpClient()
-      .get('localhost', port, path)
-      .then((request) => request.close())
-      .then((response) => response.drain().then(
-          (_) => response.headers));
+Future<HttpHeaders> _getHeaders(int port, String path, int from, int to) {
+    var client = new HttpClient();
+    return client.get('localhost', port, path)
+      .then((request) {
+        _addRangeHeader(request, from, to);
+        return request.close();
+      })
+      .then((response) => response.drain()
+          .then((_) => response.headers))
+      .whenComplete(() => client.close());
+}
 
-Future<String> _getAsString(int port, String path) =>
-    new HttpClient()
-      .get('localhost', port, path)
+Future<String> _getAsString(int port, String path) {
+    var client = new HttpClient();
+    return client.get('localhost', port, path)
       .then((request) => request.close())
-      .then((response) => UTF8.decodeStream(response));
+      .then((response) => UTF8.decodeStream(response))
+      .whenComplete(() => client.close());
+}
+
+Future<List<int>> _getAsBytes(int port, String path, int from, int to) {
+    var client = new HttpClient();
+    return client.get('localhost', port, path)
+      .then((request) {
+        _addRangeHeader(request, from, to);
+        return request.close();
+      })
+      .then((response) => response.fold([], (p, e) => p..addAll(e)))
+      .whenComplete(() => client.close());
+}
+
+Future<List> _getContentAndResponse(int port, String path, int from, int to) {
+    var client = new HttpClient();
+    return client.get('localhost', port, path)
+      .then((request) {
+        _addRangeHeader(request, from, to);
+        return request.close();
+      })
+      .then((response) => response.fold([], (p, e) => p..addAll(e))
+          .then((bytes) => [bytes, response]))
+      .whenComplete(() => client.close());
+}
 
 Uri _getUri(int port,
             String path,
@@ -196,6 +282,14 @@
   }
 }
 
+void _addRangeHeader(request, int from, int to) {
+  var fromStr = from != null ? '$from' : '';
+  var toStr = to != null ? '$to' : '';
+  if (fromStr.isNotEmpty || toStr.isNotEmpty) {
+    request.headers.set(HttpHeaders.RANGE, 'bytes=$fromStr-$toStr');
+  }
+}
+
 const CERTIFICATE = "localhost_cert";
 
 
diff --git a/pkg/http_server/test/virtual_directory_test.dart b/pkg/http_server/test/virtual_directory_test.dart
index bc05462..c6b381a 100644
--- a/pkg/http_server/test/virtual_directory_test.dart
+++ b/pkg/http_server/test/virtual_directory_test.dart
@@ -525,6 +525,167 @@
     });
   });
 
+  group('range', () {
+    var fileContent = [0, 1, 2, 3, 4, 5, 6, 7 ,8, 9];
+    var virDir;
+
+    prepare(dir) {
+      new File('${dir.path}/file').writeAsBytesSync(fileContent);
+      virDir = new VirtualDirectory(dir.path);
+    }
+
+    testVirtualDir('range', (dir) {
+      prepare(dir);
+      Future test(
+          int from, int to, [List<int> expected, String contentRange]) {
+        if (expected == null) {
+          expected = fileContent.sublist(from, to + 1);
+        }
+        if (contentRange == null) {
+          contentRange = 'bytes $from-$to/${fileContent.length}';
+        }
+        return getContentAndResponse(virDir, '/file', from: from, to: to)
+            .then(expectAsync((result) {
+              var content = result[0];
+              var response = result[1];
+              expect(content, expected);
+              expect(response.headers[HttpHeaders.CONTENT_RANGE][0],
+                     contentRange);
+              expect(expected.length, response.headers.contentLength);
+              expect(response.statusCode, HttpStatus.PARTIAL_CONTENT);
+            }));
+      }
+
+      return Future.forEach([
+          () => test(0, 0),
+          () => test(0, 1),
+          () => test(1, 2),
+          () => test(1, 9),
+          () => test(0, 9),
+          () => test(8, 9),
+          () => test(9, 9),
+          () => test(0, 10, fileContent, 'bytes 0-9/10'),
+          () => test(9, 10, [9], 'bytes 9-9/10'),
+          () => test(0, 1000, fileContent, 'bytes 0-9/10'),
+      ], (f) => f().then(expectAsync((_) {})));
+    });
+
+    testVirtualDir('prefix-range', (dir) {
+      prepare(dir);
+      Future test(int from,
+                  [List<int> expected,
+                   String contentRange,
+                   bool expectContentRange = true,
+                   int expectedStatusCode = HttpStatus.PARTIAL_CONTENT]) {
+        if (expected == null) {
+          expected = fileContent.sublist(from, fileContent.length);
+        }
+        if (contentRange == null && expectContentRange) {
+          contentRange = 'bytes ${from}-'
+                         '${fileContent.length - 1}/'
+                         '${fileContent.length}';
+        }
+        return getContentAndResponse(virDir, '/file', from: from)
+            .then(expectAsync((result) {
+              var content = result[0];
+              var response = result[1];
+              expect(content, expected);
+              if (expectContentRange) {
+                expect(response.headers[HttpHeaders.CONTENT_RANGE][0],
+                       contentRange);
+              } else {
+                expect(response.headers[HttpHeaders.CONTENT_RANGE], null);
+              }
+              expect(response.statusCode, expectedStatusCode);
+            }));
+      }
+
+      return Future.forEach([
+          () => test(0),
+          () => test(1),
+          () => test(9),
+          () => test(10, fileContent, null, false, HttpStatus.OK),
+          () => test(11, fileContent, null, false, HttpStatus.OK),
+          () => test(1000, fileContent, null, false, HttpStatus.OK),
+      ], (f) => f().then(expectAsync((_) {})));
+    });
+
+    testVirtualDir('suffix-range', (dir) {
+      prepare(dir);
+      Future test(int to, [List<int> expected, String contentRange]) {
+        if (expected == null) {
+          expected = fileContent.sublist(fileContent.length - to,
+                                         fileContent.length);
+        }
+        if (contentRange == null) {
+          contentRange = 'bytes ${fileContent.length - to}-'
+                         '${fileContent.length - 1}/'
+                         '${fileContent.length}';
+        }
+        return getContentAndResponse(virDir, '/file', to: to)
+            .then(expectAsync((result) {
+              var content = result[0];
+              var response = result[1];
+              expect(content, expected);
+              expect(response.headers[HttpHeaders.CONTENT_RANGE][0],
+                     contentRange);
+              expect(response.statusCode, HttpStatus.PARTIAL_CONTENT);
+            }));
+      }
+
+      return Future.forEach([
+          () => test(1),
+          () => test(2),
+          () => test(9),
+          () => test(10),
+          () => test(11, fileContent, 'bytes 0-9/10'),
+          () => test(1000, fileContent, 'bytes 0-9/10')
+      ], (f) => f().then(expectAsync((_) {})));
+    });
+
+    testVirtualDir('unsatisfiable-range', (dir) {
+      prepare(dir);
+      Future test(int from, int to) {
+        return getContentAndResponse(virDir, '/file', from: from, to: to)
+            .then(expectAsync((result) {
+              var content = result[0];
+              var response = result[1];
+              expect(content.length, 0);
+              expect(response.headers[HttpHeaders.CONTENT_RANGE], isNull);
+              expect(response.statusCode,
+                     HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE);
+            }));
+      }
+
+      return Future.forEach([
+          () => test(10, 11),
+          () => test(10, 1000),
+          () => test(1000, 1000)
+      ], (f) => f().then(expectAsync((_) {})));
+    });
+
+    testVirtualDir('invalid-range', (dir) {
+      prepare(dir);
+      Future test(int from, int to) {
+        return getContentAndResponse(virDir, '/file', from: from, to: to)
+            .then(expectAsync((result) {
+              var content = result[0];
+              var response = result[1];
+              expect(content, fileContent);
+              expect(response.headers[HttpHeaders.CONTENT_RANGE], isNull);
+              expect(response.statusCode, HttpStatus.OK);
+            }));
+      }
+
+      return Future.forEach([
+          () => test(1, 0),
+          () => test(10, 0),
+          () => test(1000, 999),
+          () => test(null, 0),  // This is effectively range 10-9.
+      ], (f) => f().then(expectAsync((_) {})));
+    });
+  });
+
   group('error-page', () {
     testVirtualDir('default', (dir) {
         var virDir = new VirtualDirectory(pathos.join(dir.path, 'foo'));
@@ -637,8 +798,12 @@
         };
 
         return getAsString(virDir, '/')
-          .then((result) {
-            expect(result, 'file contents');
+            .then((result) {
+              expect(result, 'file contents');
+              return getHeaders(virDir, '/')
+                  .then(expectAsync((headers) {
+                    expect('file contents'.length, headers.contentLength);
+                  }));
           });
     });
   });
diff --git a/pkg/intl/CHANGELOG.md b/pkg/intl/CHANGELOG.md
index b1ba358..ca7920e 100644
--- a/pkg/intl/CHANGELOG.md
+++ b/pkg/intl/CHANGELOG.md
@@ -3,6 +3,10 @@
     is DateFormat.parseUtc, but the parseUTC variant is still retained
     for backward-compatibility.
 
+  * Provide a better error message when generating translated versions
+    and the name of a variable substitution in the message doesn't
+    match the name in the translation.
+
 ## 0.11.9
   * Fix bug with per-mille parsing (only divided by 100, not 1000)
   
diff --git a/pkg/intl/lib/src/intl_message.dart b/pkg/intl/lib/src/intl_message.dart
index 97eb48e..8bb9fdb 100644
--- a/pkg/intl/lib/src/intl_message.dart
+++ b/pkg/intl/lib/src/intl_message.dart
@@ -69,6 +69,11 @@
    */
   get examples => parent == null ? const [] : parent.examples;
 
+  /**
+   * The name of the top-level [MainMessage].
+   */
+  String get name => parent == null ? '<unnamed>' : parent.name;
+
   String checkValidity(MethodInvocation node, List arguments,
                        String outerName, FormalParameterList outerArgs) {
     var hasArgs = arguments.any(
@@ -274,6 +279,12 @@
     // case-insensitive.
     _index = arguments.map((x) => x.toUpperCase()).toList()
         .indexOf(_variableNameUpper);
+    if (_index == -1) {
+      throw new ArgumentError(
+          "Cannot find parameter named '$_variableNameUpper' in "
+          "message named '$name'. Available "
+          "parameters are $arguments");
+    }
     return _index;
   }
 
diff --git a/pkg/intl/pubspec.yaml b/pkg/intl/pubspec.yaml
index b87c445..1f7f06d 100644
--- a/pkg/intl/pubspec.yaml
+++ b/pkg/intl/pubspec.yaml
@@ -1,5 +1,5 @@
 name: intl
-version: 0.11.9
+version: 0.11.10
 author: Dart Team <misc@dartlang.org>
 description: Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.
 homepage: https://www.dartlang.org
diff --git a/pkg/mime/CHANGELOG.md b/pkg/mime/CHANGELOG.md
new file mode 100644
index 0000000..eab1ae3
--- /dev/null
+++ b/pkg/mime/CHANGELOG.md
@@ -0,0 +1,3 @@
+# 0.9.1
+
+* Handle parsing of MIME multipart content with no parts.
diff --git a/pkg/mime/lib/src/bound_multipart_stream.dart b/pkg/mime/lib/src/bound_multipart_stream.dart
index d470034..a049b1d 100644
--- a/pkg/mime/lib/src/bound_multipart_stream.dart
+++ b/pkg/mime/lib/src/bound_multipart_stream.dart
@@ -54,8 +54,6 @@
 
 class BoundMultipartStream {
    static const int _START = 0;
-   static const int _FIRST_BOUNDARY_ENDING = 111;
-   static const int _FIRST_BOUNDARY_END = 112;
    static const int _BOUNDARY_ENDING = 1;
    static const int _BOUNDARY_END = 2;
    static const int _HEADER_START = 3;
@@ -187,7 +185,7 @@
            if (byte == _boundary[_boundaryIndex]) {
              _boundaryIndex++;
              if (_boundaryIndex == _boundary.length) {
-               _state = _FIRST_BOUNDARY_ENDING;
+               _state = _BOUNDARY_ENDING;
                _boundaryIndex = 0;
              }
            } else {
@@ -197,19 +195,6 @@
            }
            break;
 
-         case _FIRST_BOUNDARY_ENDING:
-           if (byte == CharCode.CR) {
-             _state = _FIRST_BOUNDARY_END;
-           } else {
-             _expectWhitespace(byte);
-           }
-           break;
-
-         case _FIRST_BOUNDARY_END:
-           _expectByteValue(byte, CharCode.LF);
-           _state = _HEADER_START;
-           break;
-
          case _BOUNDARY_ENDING:
            if (byte == CharCode.CR) {
              _state = _BOUNDARY_END;
@@ -222,8 +207,10 @@
 
          case _BOUNDARY_END:
            _expectByteValue(byte, CharCode.LF);
-           _multipartController.close();
-           _multipartController = null;
+           if (_multipartController != null) {
+             _multipartController.close();
+             _multipartController = null;
+           }
            _state = _HEADER_START;
            break;
 
@@ -345,8 +332,10 @@
 
          case _LAST_BOUNDARY_END:
            _expectByteValue(byte, CharCode.LF);
-           _multipartController.close();
-           _multipartController = null;
+           if (_multipartController != null) {
+             _multipartController.close();
+             _multipartController = null;
+           }
            _state = _DONE;
            break;
 
diff --git a/pkg/mime/pubspec.yaml b/pkg/mime/pubspec.yaml
index 7051582..7ca4669 100644
--- a/pkg/mime/pubspec.yaml
+++ b/pkg/mime/pubspec.yaml
@@ -1,5 +1,5 @@
 name: mime
-version: 0.9.0+3
+version: 0.9.1
 author: Dart Team <misc@dartlang.org>
 description: Helper-package for working with MIME.
 homepage: http://www.dartlang.org
diff --git a/pkg/mime/test/mime_multipart_transformer_test.dart b/pkg/mime/test/mime_multipart_transformer_test.dart
index 7bc2d7d..0008ff0 100644
--- a/pkg/mime/test/mime_multipart_transformer_test.dart
+++ b/pkg/mime/test/mime_multipart_transformer_test.dart
@@ -69,8 +69,12 @@
 }
 
 void _testParseValid() {
+  // Empty message from Chrome form post.
+  var message = '------WebKitFormBoundaryU3FBruSkJKG0Yor1--\r\n';
+  _testParse(message, "----WebKitFormBoundaryU3FBruSkJKG0Yor1", [], []);
+
   // Sample from Wikipedia.
-  var message = """
+  message = """
 This is a message with multiple parts in MIME format.\r
 --frontier\r
 Content-Type: text/plain\r
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 13f87c4..8602fc9 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -15,9 +15,6 @@
 scheduled_test/lib/*: Skip
 polymer/example/scoped_style/*: Skip
 
-[ $runtime == vm ]
-analysis_server/test/integration/asynchrony_test: Skip # Times out due to revert of 41436, see also issue 21564
-
 scheduled_test/test/scheduled_server_test: Pass, Fail # 13524
 scheduled_test/test/scheduled_process_test: Pass, Slow # Issue 9231
 scheduled_test/test/scheduled_stream/stream_matcher_test: Pass, Slow
@@ -159,6 +156,7 @@
 analysis_server/test/search/top_level_declarations_test: Pass, Slow # 16473, 19756
 analysis_server/test/socket_server_test: Pass, Slow # Issue 16473, 19756
 analyzer/test/generated/element_test: Pass, Slow # Issue 16473
+analyzer/test/generated/incremental_resolver_test: Pass, Slow # Issue 16473
 
 [ $runtime == d8 || $runtime == jsshell ]
 stack_trace/test/chain_test: Fail # Issues 15171 and 15105
@@ -260,14 +258,14 @@
 typed_data/test/typed_buffers_test/none: Fail # Issue   17607 (I put this here explicitly, since this is not the same as on ie9)
 
 [ $runtime == ie10 || $runtime == ie11 ]
-scheduled_test/test/scheduled_test/current_schedule_errors_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/nested_task_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/out_of_band_task_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/signal_error_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/task_return_value_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/timeout_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/wrap_async_test: Timeout # Issue 21007
-scheduled_test/test/scheduled_test/wrap_future_test: Timeout # Issue 21007
+scheduled_test/test/scheduled_test/current_schedule_errors_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/nested_task_test: Timeout # Skip 21007
+scheduled_test/test/scheduled_test/out_of_band_task_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/signal_error_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/task_return_value_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/timeout_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/wrap_async_test: Skip # Issue 21007
+scheduled_test/test/scheduled_test/wrap_future_test: Skip # Issue 21007
 
 [ $runtime == safarimobilesim ]
 # Unexplained errors only occuring on Safari 6.1 and earlier.
@@ -374,7 +372,6 @@
 polymer/test/build/index_page_builder_test: Fail, OK # Uses dart:io.
 polymer/test/build/import_inliner_test: Fail, OK # Uses dart:io.
 polymer/test/build/linter_test: Fail, OK # Uses dart:io.
-polymer/test/build/remove_sourcemap_comment_test: Fail, OK # Uses dart:io.
 polymer/test/build/unique_message_test: Skip # Intended only as a vm test.
 shelf/test/shelf_io_test: Fail, OK # Uses dart:io
 shelf_web_socket/test/*: Fail, OK # Uses dart:io.
diff --git a/pkg/polymer/CHANGELOG.md b/pkg/polymer/CHANGELOG.md
index c45932b..00d54b1 100644
--- a/pkg/polymer/CHANGELOG.md
+++ b/pkg/polymer/CHANGELOG.md
@@ -1,3 +1,10 @@
+#### Pub version 0.15.1+5
+  * Increase code_transformers lower bound and use shared transformers from it.
+
+#### 0.15.1+4
+  * Fix double-registration bug when using exports
+    [21439](http://dartbug.com/21439).
+
 #### 0.15.1+3
   * Make sure that `dart_support.js` is always appended after `platform.js`,
     [21435](http://dartbug.com/21435).
diff --git a/pkg/polymer/bin/new_entry.dart b/pkg/polymer/bin/new_entry.dart
index e8bab17..8a6160e 100644
--- a/pkg/polymer/bin/new_entry.dart
+++ b/pkg/polymer/bin/new_entry.dart
@@ -94,8 +94,6 @@
 <!doctype html>
 <html>
   <head>
-    <script src="packages/web_components/dart_support.js"></script>
-
     <!-- link rel="import" href="path_to_html_import.html" -->
   </head>
   <body>
@@ -118,60 +116,76 @@
   if (transformers != null) {
     // If there are transformers in the pubspec, look for the polymer
     // transformers, get the entry points, and delete the old entry points.
-    var transformersSourceSpan = transformers.span;
-    SourceSpan sourceSpan;
+    SourceSpan transformersSourceSpan = transformers.span;
 
+    SourceSpan polymerTransformerSourceSpan;
+    SourceSpan entryPointsSourceSpan;
     for (var e in transformers) {
-      if (e != 'polymer' && (e is! YamlMap || e['polymer'] == null)) continue;
-      if (e == 'polymer' || !e['polymer'].containsKey('entry_points')) {
-        if (path.split(entryPoint)[0] != 'web') {
-          print('WARNING: Did not add entry_point $entryPoint to pubspec.yaml'
-              ' because of already-existing transformer|polymer section');
-        }
-        return false;
-      } else if (e['polymer'].keys.length > 1) {
-        // TODO(dgrove): handle the case where there are additional sections
-        // in the polymer transformer.
-        throw new UnimplementedError('Cannot handle non-entry_point entries '
-            'for polymer transformer');
-      } else {
+      if (e == 'polymer') {
+        // If they had an empty polymer transformer, just get rid of it (we will
+        // replace it with our own map style one).
+        var polymerRegex = new RegExp(r'\n\s*-\spolymer\s*');
+        // Insert right after the newline.
+        insertionPoint = pubspecText.indexOf(polymerRegex) + 1;
+        pubspecText = pubspecText.replaceFirst(polymerRegex, '\n');
+      } else if (e is YamlMap && e['polymer'] != null) {
+        polymerTransformerSourceSpan = e['polymer'].span;
+
         var existing = e['polymer']['entry_points'];
+        if (existing == null && e['polymer'].containsKey('entry_points')) {
+          if (path.split(entryPoint)[0] != 'web') {
+            print('WARNING: Did not add entry_point $entryPoint to pubspec.yaml'
+              ' because of existing empty `entry_points` field in polymer'
+              ' transformer. This defaults to treating all files under `web/`'
+              ' as entry points, but you tried to add an entry point outside of'
+              ' the `web/` folder. You will need to explicitly list all entry'
+              ' points that you care about into your pubspec in order to'
+              ' include any outside of `web/`.');
+          }
+          return false;
+        }
         entryPoints = (existing == null ? [] :
             (existing is String ? [existing] : existing.toList()));
 
         if (entryPoints.contains(entryPoint)) return false;
         entryPoints.add(entryPoint);
 
-        sourceSpan = e.span;
+        if (existing != null) {
+          entryPointsSourceSpan = existing.span;
+        }
       }
     }
 
-    if (sourceSpan == null) {
-      // There were no polymer transformers.
-      insertionPoint = transformersSourceSpan.start.offset;
-      textToInsert = '- ';
+    if (polymerTransformerSourceSpan == null) {
+      if (insertionPoint == null) {
+        insertionPoint = transformersSourceSpan.start.offset;
+      }
+      textToInsert = '- polymer:\n    entry_points:\n';
+    } else if (entryPointsSourceSpan == null) {
+      insertionPoint = polymerTransformerSourceSpan.start.offset;
+      textToInsert = '    entry_points:\n';
     } else {
-      insertionPoint = sourceSpan.start.offset;
+      insertionPoint = entryPointsSourceSpan.start.offset;
       pubspecText = '${pubspecText.substring(0, insertionPoint)}'
-          '${pubspecText.substring(sourceSpan.end.offset)}';
+          '${pubspecText.substring(entryPointsSourceSpan.end.offset)}';
     }
   } else {
     // There were no transformers at all.
     insertionPoint = pubspecText.length;
     var optionalNewline = pubspecText.endsWith('\n') ? '' : '\n';
-    textToInsert = '${optionalNewline}transformers:\n- ';
+    textToInsert = '''
+${optionalNewline}transformers:
+- polymer:
+    entry_points:
+''';
     entryPoints = [entryPoint];
   }
 
+  if (entryPoints == null) entryPoints = [entryPoint];
   // TODO(dgrove): Once dartbug.com/20409 is addressed, use that here.
   var entryPointsText = entryPoints.map((e) => '    - $e').join('\n');
 
-  textToInsert =
-'''${textToInsert}polymer:
-    entry_points:
-$entryPointsText''';
-
-
+  textToInsert += entryPointsText;
   if (insertionPoint == pubspecText.length) {
     pubspecText = '${pubspecText}${textToInsert}';
   } else {
diff --git a/pkg/polymer/lib/src/build/delete_file.dart b/pkg/polymer/lib/src/build/delete_file.dart
deleted file mode 100644
index b417605..0000000
--- a/pkg/polymer/lib/src/build/delete_file.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Transformer that deletes everything that it sees, but only in release mode.
-library web_components.src.delete_file;
-
-import 'dart:async';
-import 'package:barback/barback.dart';
-
-// Deletes all files supplied in release mode.
-class DeleteFile extends Transformer {
-  BarbackSettings settings;
-
-  DeleteFile.asPlugin(this.settings);
-
-  /// Only apply to files in release mode.
-  isPrimary(_) => settings.mode == BarbackMode.RELEASE;
-
-  apply(Transform transform) {
-    transform.consumePrimary();
-  }
-}
diff --git a/pkg/polymer/lib/src/build/remove_sourcemap_comment.dart b/pkg/polymer/lib/src/build/remove_sourcemap_comment.dart
deleted file mode 100644
index cc106db..0000000
--- a/pkg/polymer/lib/src/build/remove_sourcemap_comment.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Transformer that removes any sourcemap comments from javascript files.
-library web_components.src.remove_sourcemap_comment;
-
-import 'dart:async';
-import 'package:barback/barback.dart';
-
-/// Transformer that removes any sourcemap comments from javascript files.
-/// Comments should be on their own line in the form: //# sourceMappingURL=*.map
-class RemoveSourcemapComment extends Transformer {
-  BarbackSettings settings;
-
-  RemoveSourcemapComment.asPlugin(this.settings);
-
-  /// Only apply to files in release mode.
-  isPrimary(_) => settings.mode == BarbackMode.RELEASE;
-
-  apply(Transform transform) {
-    var id = transform.primaryInput.id;
-    return transform.readInputAsString(id).then((file) {
-      if (file.contains(_SOURCE_MAP_COMMENT)) {
-        transform.addOutput(new Asset.fromString(
-            id, file.replaceAll(_SOURCE_MAP_COMMENT, '')));
-      }
-    });
-  }
-}
-
-final RegExp _SOURCE_MAP_COMMENT = new RegExp(r'\n\s*\/\/# sourceMappingURL.*');
diff --git a/pkg/polymer/pubspec.yaml b/pkg/polymer/pubspec.yaml
index ad7a7b7..8cc369c 100644
--- a/pkg/polymer/pubspec.yaml
+++ b/pkg/polymer/pubspec.yaml
@@ -1,5 +1,5 @@
 name: polymer
-version: 0.15.1+4
+version: 0.15.1+5
 author: Polymer.dart Authors <web-ui-dev@dartlang.org>
 description: >
   Polymer.dart is a new type of library for the web, built on top of Web
@@ -29,13 +29,13 @@
 transformers:
 - polymer/src/build/mirrors_remover:
     $include: lib/polymer.dart
-- polymer/src/build/delete_file:
+- code_transformers/src/delete_file:
     $include:
       - lib/src/build/log_injector.css
       - lib/src/js/polymer/polymer.concat.js
       - lib/src/js/polymer/polymer.concat.js.map
       - lib/src/js/polymer/polymer.js.map
-- polymer/src/build/remove_sourcemap_comment:
+- code_transformers/src/remove_sourcemap_comment:
     $include: lib/src/js/polymer/polymer.js
 - observe:
     files: lib/src/instance.dart
diff --git a/pkg/polymer/test/build/remove_sourcemap_comment_test.dart b/pkg/polymer/test/build/remove_sourcemap_comment_test.dart
deleted file mode 100644
index 44d1f45..0000000
--- a/pkg/polymer/test/build/remove_sourcemap_comment_test.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library polymer.test.build.remove_sourcemap_comment_test;
-
-import 'package:barback/barback.dart';
-import 'package:polymer/src/build/remove_sourcemap_comment.dart';
-import 'package:unittest/compact_vm_config.dart';
-import 'package:unittest/unittest.dart';
-import 'common.dart';
-
-final phases = [[new RemoveSourcemapComment.asPlugin(
-    new BarbackSettings({}, BarbackMode.RELEASE))]];
-
-void main() {
-  useCompactVMConfiguration();
-
-  testPhases('removes sourcemap comments', phases, {
-      'a|web/test.js': '''
-          var i = 0;
-          //# sourceMappingURL=*.map''',
-  }, {
-      'a|web/test.js': '''
-          var i = 0;''',
-  });
-}
diff --git a/pkg/shelf/CHANGELOG.md b/pkg/shelf/CHANGELOG.md
index f74d437..d7b74b6 100644
--- a/pkg/shelf/CHANGELOG.md
+++ b/pkg/shelf/CHANGELOG.md
@@ -1,6 +1,9 @@
-## 0.5.6-dev
+## 0.5.6
 
-* Fixed `createMiddleware` to only catch errors in `errorHandler` is provided.
+* Fixed `createMiddleware` to only catch errors if `errorHandler` is provided.
+
+* Updated `handleRequest` in `shelf_io` to more gracefully handle errors when
+  parsing `HttpRequest`.
 
 ## 0.5.5+1
 
diff --git a/pkg/shelf/lib/shelf_io.dart b/pkg/shelf/lib/shelf_io.dart
index c685302..878935f 100644
--- a/pkg/shelf/lib/shelf_io.dart
+++ b/pkg/shelf/lib/shelf_io.dart
@@ -53,7 +53,13 @@
 ///
 /// Returns a [Future] which completes when the request has been handled.
 Future handleRequest(HttpRequest request, Handler handler) {
-  var shelfRequest = _fromHttpRequest(request);
+  var shelfRequest;
+  try {
+    shelfRequest = _fromHttpRequest(request);
+  } catch (error, stackTrace) {
+    var response = _logError('Error parsing request.\n$error', stackTrace);
+    return _writeResponse(response, request.response);
+  }
 
   // TODO(nweiz): abstract out hijack handling to make it easier to implement an
   // adapter.
diff --git a/pkg/shelf/pubspec.yaml b/pkg/shelf/pubspec.yaml
index 7bf73f1..0b071aa 100644
--- a/pkg/shelf/pubspec.yaml
+++ b/pkg/shelf/pubspec.yaml
@@ -1,8 +1,8 @@
 name: shelf
-version: 0.5.6-dev
+version: 0.5.6
 author: Dart Team <misc@dartlang.org>
 description: Web Server Middleware for Dart
-homepage: http://www.dartlang.org
+homepage: https://pub.dartlang.org/packages/shelf
 environment:
   sdk: '>=1.4.0 <2.0.0'
 dependencies:
diff --git a/pkg/shelf/test/shelf_io_test.dart b/pkg/shelf/test/shelf_io_test.dart
index b3b4325..c1b4a41 100644
--- a/pkg/shelf/test/shelf_io_test.dart
+++ b/pkg/shelf/test/shelf_io_test.dart
@@ -251,6 +251,35 @@
     });
   });
 
+  test('a bad HTTP request results in a 500 response', () {
+    var socket;
+
+    _scheduleServer(syncHandler);
+
+    schedule(() {
+      return Socket.connect('localhost', _serverPort).then((value) {
+        socket = value;
+
+        currentSchedule.onComplete.schedule(() {
+          return socket.close();
+        }, 'close the socket');
+      });
+    });
+
+    schedule(() {
+      socket.write('GET / HTTP/1.1\r\n');
+      socket.write('Host: ^^super bad !@#host\r\n');
+      socket.write('\r\n');
+      return socket.close();
+    });
+
+    schedule(() {
+      return UTF8.decodeStream(socket).then((value) {
+        expect(value, contains('500 Internal Server Error'));
+      });
+    });
+  });
+
   group('date header', () {
     test('is sent by default', () {
       _scheduleServer(syncHandler);
diff --git a/pkg/source_span/CHANGELOG.md b/pkg/source_span/CHANGELOG.md
index e5190bc..f057e9b 100644
--- a/pkg/source_span/CHANGELOG.md
+++ b/pkg/source_span/CHANGELOG.md
@@ -1,3 +1,10 @@
+# 1.0.2
+
+* Avoid unintentionally allocating extra objects for internal `FileSpan`
+  operations.
+
+* Ensure that `SourceSpan.operator==` works on arbitrary `Object`s.
+
 # 1.0.1
 
 * Use a more compact internal representation for `FileSpan`.
diff --git a/pkg/source_span/lib/src/file.dart b/pkg/source_span/lib/src/file.dart
index 14aa226..ed5f6a8 100644
--- a/pkg/source_span/lib/src/file.dart
+++ b/pkg/source_span/lib/src/file.dart
@@ -199,10 +199,11 @@
   /// objects.
   final int _end;
 
+  Uri get sourceUrl => file.url;
+  int get length => _end - _start;
   FileLocation get start => new FileLocation._(file, _start);
   FileLocation get end => new FileLocation._(file, _end);
-
-  String get text => file.getText(start.offset, end.offset);
+  String get text => file.getText(_start, _end);
 
   FileSpan._(this.file, this._start, this._end) {
     if (_end < _start) {
@@ -215,20 +216,37 @@
     }
   }
 
+  int compareTo(SourceSpan other) {
+    if (other is! FileSpan) return super.compareTo(other);
+
+    FileSpan otherFile = other;
+    var result = _start.compareTo(otherFile._start);
+    return result == 0 ? _end.compareTo(otherFile._end) : result;
+  }
+
   SourceSpan union(SourceSpan other) {
     if (other is! FileSpan) return super.union(other);
 
     var span = expand(other);
-    var beginSpan = span.start == this.start ? this : other;
-    var endSpan = span.end == this.end ? this : other;
+    var beginSpan = span._start == _start ? this : other;
+    var endSpan = span._end == _end ? this : other;
 
-    if (beginSpan.end.compareTo(endSpan.start) < 0) {
+    if (beginSpan._end < endSpan._start) {
       throw new ArgumentError("Spans $this and $other are disjoint.");
     }
 
     return span;
   }
 
+  bool operator ==(other) {
+    if (other is! FileSpan) return super == other;
+    return _start == other._start && _end == other._end &&
+        sourceUrl == other.sourceUrl;
+  }
+
+  int get hashCode => _start.hashCode + 5 * _end.hashCode +
+      7 * sourceUrl.hashCode;
+
   /// Returns a new span that covers both [this] and [other].
   ///
   /// Unlike [union], [other] may be disjoint from [this]. If it is, the text
@@ -241,7 +259,7 @@
 
     var start = math.min(this._start, other._start);
     var end = math.max(this._end, other._end);
-    return new FileSpan._(file, start, end);    
+    return new FileSpan._(file, start, end);
   }
 
   String message(String message, {color}) {
diff --git a/pkg/source_span/lib/src/span_mixin.dart b/pkg/source_span/lib/src/span_mixin.dart
index 95a720a..716e6e0 100644
--- a/pkg/source_span/lib/src/span_mixin.dart
+++ b/pkg/source_span/lib/src/span_mixin.dart
@@ -21,8 +21,8 @@
   int get length => end.offset - start.offset;
 
   int compareTo(SourceSpan other) {
-    int d = start.compareTo(other.start);
-    return d == 0 ? end.compareTo(other.end) : d;
+    var result = start.compareTo(other.start);
+    return result == 0 ? end.compareTo(other.end) : result;
   }
 
   SourceSpan union(SourceSpan other) {
@@ -65,7 +65,7 @@
     return buffer.toString();
   }
 
-  bool operator ==(SourceSpan other) =>
+  bool operator ==(other) => other is SourceSpan &&
       start == other.start && end == other.end;
 
   int get hashCode => start.hashCode + (31 * end.hashCode);
diff --git a/pkg/source_span/pubspec.yaml b/pkg/source_span/pubspec.yaml
index ae1bfcf..5c166fc 100644
--- a/pkg/source_span/pubspec.yaml
+++ b/pkg/source_span/pubspec.yaml
@@ -1,6 +1,6 @@
 name: source_span
 
-version: 1.0.1
+version: 1.0.2
 author: Dart Team <misc@dartlang.org>
 description: A library for identifying source spans and locations.
 homepage: http://www.dartlang.org
diff --git a/pkg/unittest/CHANGELOG.md b/pkg/unittest/CHANGELOG.md
index 170b5c7..d564ff3 100644
--- a/pkg/unittest/CHANGELOG.md
+++ b/pkg/unittest/CHANGELOG.md
@@ -1,7 +1,13 @@
+##0.11.1+1
+
+* Fix bug in withTestEnvironment where test cases were not reinitialized if
+  called multiple times.
+
 ##0.11.1
 
 * Add `reason` named argument to `expectAsync` and `expectAsyncUntil`, which has
   the same definition as `expect`'s `reason` argument.
+* Added support for private test environments.
 
 ##0.11.0+6
 
diff --git a/pkg/unittest/lib/src/group_context.dart b/pkg/unittest/lib/src/group_context.dart
index 49c83a4..d44b6cd 100644
--- a/pkg/unittest/lib/src/group_context.dart
+++ b/pkg/unittest/lib/src/group_context.dart
@@ -54,7 +54,7 @@
     }
   }
 
-  String get fullName => (parent == null || parent == _rootContext)
+  String get fullName => (parent == null || parent == _environment.rootContext)
       ? _name
       : "${parent.fullName}$groupSep$_name";
 
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index 9f2a632..fc84ed7 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -60,9 +60,9 @@
   Completer _testComplete;
 
   TestCase._internal(this.id, this.description, this._testFunction)
-      : currentGroup = _currentContext.fullName,
-        _setUp = _currentContext.testSetup,
-        _tearDown = _currentContext.testTeardown;
+      : currentGroup = _environment.currentContext.fullName,
+        _setUp = _environment.currentContext.testSetup,
+        _tearDown = _environment.currentContext.testTeardown;
 
   bool get isComplete => !enabled || result != null;
 
diff --git a/pkg/unittest/lib/src/test_environment.dart b/pkg/unittest/lib/src/test_environment.dart
new file mode 100644
index 0000000..ebb39bd
--- /dev/null
+++ b/pkg/unittest/lib/src/test_environment.dart
@@ -0,0 +1,54 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of unittest;
+
+/// Class for encapsulating test environment state.
+///
+/// This is used by the [withTestEnvironment] method to support multiple
+/// invocations of the unittest library within the same application
+/// instance.
+class _TestEnvironment {
+  Configuration config;
+
+  // We use a 'dummy' context for the top level to eliminate null
+  // checks when querying the context. This allows us to easily
+  //  support top-level [setUp]/[tearDown] functions as well.
+  final rootContext = new _GroupContext();
+  _GroupContext currentContext;
+
+  /// The [currentTestCaseIndex] represents the index of the currently running
+  /// test case.
+  ///
+  /// If this is -1 it implies the test system is not running.
+  /// It will be set to [number of test cases] as a short-lived state flagging
+  /// that the last test has completed.
+  int currentTestCaseIndex = -1;
+
+  /// The [initialized] variable specifies whether the framework
+  /// has been initialized.
+  bool initialized = false;
+
+  /// The time since we last gave asynchronous code a chance to be scheduled.
+  int lastBreath = new DateTime.now().millisecondsSinceEpoch;
+
+  /// The set of tests to run can be restricted by using [solo_test] and
+  /// [solo_group].
+  ///
+  /// As groups can be nested we use a counter to keep track of the nesting
+  /// level of soloing, and a flag to tell if we have seen any solo tests.
+  int soloNestingLevel = 0;
+  bool soloTestSeen = false;
+
+  /// The list of test cases to run.
+  final List<TestCase> testCases = new List<TestCase>();
+
+  /// The [uncaughtErrorMessage] holds the error messages that are printed
+  /// in the test summary.
+  String uncaughtErrorMessage;
+
+  _TestEnvironment() {
+    currentContext = rootContext;
+  }
+}
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index b456cf1..3661f99 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -151,8 +151,31 @@
 part 'src/group_context.dart';
 part 'src/spread_args_helper.dart';
 part 'src/test_case.dart';
+part 'src/test_environment.dart';
 
-Configuration _config;
+const Symbol _UNITTEST_ENVIRONMENT = #unittest.environment;
+
+final _TestEnvironment _defaultEnvironment = new _TestEnvironment();
+
+/**
+ * Internal getter for the current unittest config.
+ */
+_TestEnvironment get _environment {
+  var environment = Zone.current[_UNITTEST_ENVIRONMENT];
+  if (environment == null) return _defaultEnvironment;
+  return environment;
+}
+
+// Convenience getter for the current environment's config.
+Configuration get _config => _environment.config;
+
+// Convenience setter for the current environment's config.
+void set _config(Configuration config) {
+  _environment.config = config;
+}
+
+// Convenience getter for the current environment's test cases.
+List<TestCase> get _testCases => _environment.testCases;
 
 /// [Configuration] used by the unittest library.
 ///
@@ -185,48 +208,21 @@
 /// Separator used between group names and test names.
 String groupSep = ' ';
 
-final List<TestCase> _testCases = new List<TestCase>();
-
 /// Tests executed in this suite.
-final List<TestCase> testCases = new UnmodifiableListView<TestCase>(_testCases);
+List<TestCase> get testCases =>
+    new UnmodifiableListView<TestCase>(_environment.testCases);
 
 /// Interval (in msecs) after which synchronous tests will insert an async
 /// delay to allow DOM or other updates.
 const int BREATH_INTERVAL = 200;
 
-/// The set of tests to run can be restricted by using [solo_test] and
-/// [solo_group].
-/// As groups can be nested we use a counter to keep track of the nest level
-/// of soloing, and a flag to tell if we have seen any solo tests.
-int _soloNestingLevel = 0;
-bool _soloTestSeen = false;
-
-// We use a 'dummy' context for the top level to eliminate null
-// checks when querying the context. This allows us to easily
-//  support top-level setUp/tearDown functions as well.
-final _rootContext = new _GroupContext();
-_GroupContext _currentContext = _rootContext;
-
-/// Represents the index of the currently running test case
-/// == -1 implies the test system is not running
-/// == [number of test cases] is a short-lived state flagging that the last test
-///    has completed
-int _currentTestCaseIndex = -1;
-
 /// [TestCase] currently being executed.
 TestCase get currentTestCase =>
-    (_currentTestCaseIndex >= 0 && _currentTestCaseIndex < testCases.length)
-        ? testCases[_currentTestCaseIndex]
+    (_environment.currentTestCaseIndex >= 0 &&
+     _environment.currentTestCaseIndex < testCases.length)
+        ? testCases[_environment.currentTestCaseIndex]
         : null;
 
-/// Whether the framework is in an initialized state.
-bool _initialized = false;
-
-String _uncaughtErrorMessage = null;
-
-/// Time since we last gave non-sync code a chance to be scheduled.
-int _lastBreath = new DateTime.now().millisecondsSinceEpoch;
-
 /* Test case result strings. */
 // TODO(gram) we should change these constants to use a different string
 // (so that writing 'FAIL' in the middle of a test doesn't
@@ -245,7 +241,7 @@
 void test(String spec, TestFunction body) {
   _requireNotRunning();
   ensureInitialized();
-  if (!_soloTestSeen || _soloNestingLevel > 0) {
+  if (!_environment.soloTestSeen || _environment.soloNestingLevel > 0) {
     var testcase = new TestCase._internal(testCases.length + 1, _fullSpec(spec),
         body);
     _testCases.add(testcase);
@@ -272,16 +268,16 @@
 void solo_test(String spec, TestFunction body) {
   _requireNotRunning();
   ensureInitialized();
-  if (!_soloTestSeen) {
-    _soloTestSeen = true;
+  if (!_environment.soloTestSeen) {
+    _environment.soloTestSeen = true;
     // This is the first solo-ed test. Discard all tests up to now.
     _testCases.clear();
   }
-  ++_soloNestingLevel;
+  ++_environment.soloNestingLevel;
   try {
     test(spec, body);
   } finally {
-    --_soloNestingLevel;
+    --_environment.soloNestingLevel;
   }
 }
 
@@ -335,15 +331,16 @@
 void group(String description, void body()) {
   ensureInitialized();
   _requireNotRunning();
-  _currentContext = new _GroupContext(_currentContext, description);
+  _environment.currentContext =
+      new _GroupContext(_environment.currentContext, description);
   try {
     body();
   } catch (e, trace) {
     var stack = (trace == null) ? '' : ': ${trace.toString()}';
-    _uncaughtErrorMessage = "${e.toString()}$stack";
+    _environment.uncaughtErrorMessage = "${e.toString()}$stack";
   } finally {
     // Now that the group is over, restore the previous one.
-    _currentContext = _currentContext.parent;
+    _environment.currentContext = _environment.currentContext.parent;
   }
 }
 
@@ -354,16 +351,16 @@
 void solo_group(String description, void body()) {
   _requireNotRunning();
   ensureInitialized();
-  if (!_soloTestSeen) {
-    _soloTestSeen = true;
+  if (!_environment.soloTestSeen) {
+    _environment.soloTestSeen = true;
     // This is the first solo-ed group. Discard all tests up to now.
     _testCases.clear();
   }
-  ++_soloNestingLevel;
+  ++_environment.soloNestingLevel;
   try {
     group(description, body);
   } finally {
-    --_soloNestingLevel;
+    --_environment.soloNestingLevel;
   }
 }
 
@@ -375,7 +372,7 @@
 /// case it must return a [Future].
 void setUp(Function setupTest) {
   _requireNotRunning();
-  _currentContext.testSetup = setupTest;
+  _environment.currentContext.testSetup = setupTest;
 }
 
 /// Register a [tearDown] function for a test [group].
@@ -388,12 +385,12 @@
 /// asynchronous; in this case it must return a [Future].
 void tearDown(Function teardownTest) {
   _requireNotRunning();
-  _currentContext.testTeardown = teardownTest;
+  _environment.currentContext.testTeardown = teardownTest;
 }
 
 /// Advance to the next test case.
 void _nextTestCase() {
-  _currentTestCaseIndex++;
+  _environment.currentTestCaseIndex++;
   _runTest();
 }
 
@@ -406,7 +403,7 @@
   if (currentTestCase != null) {
     currentTestCase._error(msg, stack);
   } else {
-    _uncaughtErrorMessage = "$msg: $stack";
+    _environment.uncaughtErrorMessage = "$msg: $stack";
   }
 }
 
@@ -432,7 +429,7 @@
 void runTests() {
   _requireNotRunning();
   _ensureInitialized(false);
-  _currentTestCaseIndex = 0;
+  _environment.currentTestCaseIndex = 0;
   _config.onStart();
   _runTest();
 }
@@ -454,11 +451,11 @@
 
 /// Runs the next test.
 void _runTest() {
-  if (_currentTestCaseIndex >= testCases.length) {
-    assert(_currentTestCaseIndex == testCases.length);
+  if (_environment.currentTestCaseIndex >= testCases.length) {
+    assert(_environment.currentTestCaseIndex == testCases.length);
     _completeTests();
   } else {
-    var testCase = testCases[_currentTestCaseIndex];
+    var testCase = testCases[_environment.currentTestCaseIndex];
     Future f = runZoned(testCase._run, onError: (error, stack) {
       // TODO(kevmoo) Do a better job of flagging these are async errors.
       // https://code.google.com/p/dart/issues/detail?id=16530
@@ -482,8 +479,8 @@
     f.whenComplete(() {
       if (timer != null) timer.cancel();
       var now = new DateTime.now().millisecondsSinceEpoch;
-      if ((now - _lastBreath) >= BREATH_INTERVAL) {
-        _lastBreath = now;
+      if ((now - _environment.lastBreath) >= BREATH_INTERVAL) {
+        _environment.lastBreath = now;
         Timer.run(_nextTestCase);
       } else {
         scheduleMicrotask(_nextTestCase); // Schedule the next test.
@@ -494,7 +491,7 @@
 
 /// Publish results on the page and notify controller.
 void _completeTests() {
-  if (!_initialized) return;
+  if (!_environment.initialized) return;
   int passed = 0;
   int failed = 0;
   int errors = 0;
@@ -506,15 +503,16 @@
       case ERROR: errors++; break;
     }
   }
-  _config.onSummary(passed, failed, errors, testCases, _uncaughtErrorMessage);
+  _config.onSummary(passed, failed, errors, testCases,
+      _environment.uncaughtErrorMessage);
   _config.onDone(passed > 0 && failed == 0 && errors == 0 &&
-      _uncaughtErrorMessage == null);
-  _initialized = false;
-  _currentTestCaseIndex = -1;
+      _environment.uncaughtErrorMessage == null);
+  _environment.initialized = false;
+  _environment.currentTestCaseIndex = -1;
 }
 
 String _fullSpec(String spec) {
-  var group = '${_currentContext.fullName}';
+  var group = '${_environment.currentContext.fullName}';
   if (spec == null) return group;
   return group != '' ? '$group$groupSep$spec' : spec;
 }
@@ -525,14 +523,14 @@
 }
 
 void _ensureInitialized(bool configAutoStart) {
-  if (_initialized) {
+  if (_environment.initialized) {
     return;
   }
-  _initialized = true;
+  _environment.initialized = true;
   // Hook our async guard into the matcher library.
   wrapAsync = (f, [id]) => expectAsync(f, id: id);
 
-  _uncaughtErrorMessage = null;
+  _environment.uncaughtErrorMessage = null;
 
   unittestConfiguration.onInit();
 
@@ -583,7 +581,19 @@
 bool filterStacks = true;
 
 void _requireNotRunning() {
-  if (_currentTestCaseIndex != -1) {
+  if (_environment.currentTestCaseIndex != -1) {
     throw new StateError('Not allowed when tests are running.');
   }
 }
+
+/// Method to create a test environment running in its own zone scope.
+///
+/// This allows for multiple invocations of the unittest library in the same
+/// application instance.
+/// This is useful when, for example, creating a test runner application which
+/// needs to create a new pristine test environment on each invocation to run
+/// a given set of test.
+dynamic withTestEnvironment(callback()) {
+  return runZoned(callback,
+      zoneValues: {_UNITTEST_ENVIRONMENT: new _TestEnvironment()});
+}
diff --git a/pkg/unittest/pubspec.yaml b/pkg/unittest/pubspec.yaml
index 7c4e919..170cf35 100644
--- a/pkg/unittest/pubspec.yaml
+++ b/pkg/unittest/pubspec.yaml
@@ -1,5 +1,5 @@
 name: unittest
-version: 0.11.1-dev
+version: 0.11.1+1
 author: Dart Team <misc@dartlang.org>
 description: A library for writing dart unit tests.
 homepage: https://pub.dartlang.org/packages/unittest
diff --git a/pkg/unittest/test/breath_test.dart b/pkg/unittest/test/breath_test.dart
index 23eec84..244d2d2 100644
--- a/pkg/unittest/test/breath_test.dart
+++ b/pkg/unittest/test/breath_test.dart
@@ -11,9 +11,16 @@
 void main() {
   // Test the sync test 'breath' feature of unittest.
 
+  // We use the testStartStopwatch to determine if the 'starve'
+  // test was executed within a small enough time interval from
+  // the first test that we are guaranteed the second test is
+  // running in a microtask. If the second test is running as a
+  // microtask we are guaranteed the timer scheduled in the
+  // first test has not been run yet.
+  var testStartStopwatch = new Stopwatch()..start();
+
   group('breath', () {
     var sentinel = 0;
-    var start;
 
     test('initial', () {
       Timer.run(() {
@@ -22,12 +29,19 @@
     });
 
     test('starve', () {
-      start = new DateTime.now().millisecondsSinceEpoch;
-      var now;
-      do {
+      // If less than BREATH_INTERVAL time has passed since before
+      // we started the test group then the previous test's timer
+      // has not been run (at least this is what we are testing).
+      if (testStartStopwatch.elapsed.inMilliseconds <= BREATH_INTERVAL) {
         expect(sentinel, 0);
-        now = new DateTime.now().millisecondsSinceEpoch;
-      } while (now - start <= BREATH_INTERVAL);
+      }
+
+      // Next we wait for at least BREATH_INTERVAL to guaranteed the
+      // next (third) test is run using a timer which means it will
+      // run after the timer scheduled in the first test and hence
+      // the sentinel should have been set to 1.
+      var sw = new Stopwatch()..start();
+      while (sw.elapsed.inMilliseconds < BREATH_INTERVAL);
     });
 
     test('breathed', () {
diff --git a/pkg/unittest/test/with_test_environment_test.dart b/pkg/unittest/test/with_test_environment_test.dart
new file mode 100644
index 0000000..ae35c20
--- /dev/null
+++ b/pkg/unittest/test/with_test_environment_test.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library unittest.with_test_environment_test;
+
+import 'dart:async';
+import 'package:unittest/unittest.dart';
+
+class TestConfiguration extends SimpleConfiguration {
+  final Completer _completer = new Completer();
+  List<TestCase> _results;
+
+  TestConfiguration();
+
+  void onSummary(int passed, int failed, int errors, List<TestCase> results,
+                 String uncaughtError) {
+    super.onSummary(passed, failed, errors, results, uncaughtError);
+    _results = results;
+  }
+
+  Future get done => _completer.future;
+
+  onDone(success) {
+    new Future.sync(() => super.onDone(success))
+        .then(_completer.complete)
+        .catchError(_completer.completeError);
+  }
+
+  bool checkIfTestRan(String testName) {
+    return _results.any((test) => test.description == testName);
+  }
+}
+
+Future runUnittests(Function callback) {
+  var config = new TestConfiguration();
+  unittestConfiguration = config;
+  callback();
+
+  return config.done;
+}
+
+void runTests() {
+  test('test', () => expect(2 + 3, equals(5)));
+}
+
+void runTests1() {
+  test('test1', () => expect(4 + 3, equals(7)));
+}
+
+// Test that we can run two different sets of tests in the same run using the
+// withTestEnvironment method.
+void main() {
+  // First check that we cannot call runUnittests twice in a row without it
+  // throwing a StateError due to the unittestConfiguration being set globally
+  // in the first call.
+  try {
+    runUnittests(runTests);
+    runUnittests(runTests1);
+    throw 'Expected this to be unreachable since 2nd run above should throw';
+  } on StateError catch (error) {
+    // expected, silently ignore.
+  }
+
+  // Test that we can run both when encapsulating in their own private test
+  // environment. Also test that the tests actually running are the ones
+  // scheduled in the runTests/runTests1 methods.
+  withTestEnvironment(() {
+    runUnittests(runTests).whenComplete(() {
+      TestConfiguration config = unittestConfiguration;
+      expect(config.checkIfTestRan('test'), true);
+      expect(config.checkIfTestRan('test1'), false);
+    });
+  });
+  withTestEnvironment(() {
+    runUnittests(runTests1).whenComplete(() {
+      TestConfiguration config = unittestConfiguration;
+      expect(config.checkIfTestRan('test'), false);
+      expect(config.checkIfTestRan('test1'), true);
+    });
+  });
+
+  // Third test that we can run with two nested test environments.
+  withTestEnvironment(() {
+    runUnittests(runTests);
+    withTestEnvironment(() {
+      runUnittests(runTests1);
+    });
+  });
+}
diff --git a/pkg/web_components/CHANGELOG.md b/pkg/web_components/CHANGELOG.md
index 65aed82..dcd317f 100644
--- a/pkg/web_components/CHANGELOG.md
+++ b/pkg/web_components/CHANGELOG.md
@@ -1,4 +1,7 @@
-#### Pub version 0.9.0-dev
+#### Pub version 0.9.0+1
+  * Remove all `.map` and `.concat.js` files during release mode.
+
+#### Pub version 0.9.0
   * Updated to platform version 0.4.2, internally a deprecated API was removed,
     hence the bump in the version number.
 
diff --git a/pkg/web_components/pubspec.yaml b/pkg/web_components/pubspec.yaml
index 98b2d7f..4e6872b 100644
--- a/pkg/web_components/pubspec.yaml
+++ b/pkg/web_components/pubspec.yaml
@@ -1,5 +1,5 @@
 name: web_components
-version: 0.9.0
+version: 0.9.0+1
 author: Polymer.dart Authors <web-ui-dev@dartlang.org>
 homepage: https://www.dartlang.org/polymer-dart/
 description: >
@@ -11,3 +11,16 @@
   bundle code and HTML as if they were libraries.
 environment:
   sdk: ">=1.4.0-dev.6.6 <2.0.0"
+dependencies:
+  code_transformers: ">=0.2.2 <0.3.0"
+transformers:
+# TODO(sigmund): once we have some easier way to do global app-level
+# transformers, we might want to remove this transformer here and only apply it
+# in apps that need it.
+- code_transformers/src/delete_file:
+    $include:
+      - lib/platform.concat.js
+      - lib/platform.concat.js.map
+      - lib/platform.js.map
+- code_transformers/src/remove_sourcemap_comment:
+    $include: lib/platform.js
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index 9a0e5af..d400306 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -30,7 +30,7 @@
       case _STDIO_HANDLE_TYPE_PIPE:
       case _STDIO_HANDLE_TYPE_SOCKET:
       case _STDIO_HANDLE_TYPE_FILE:
-        return wrap(new IOSink(new _StdConsumer(fd)));
+        return wrap(new IOSink(new _FileStreamConsumer.fromStdio(fd)));
       default:
         throw new FileSystemException("Unsupported stdin type");
     }
diff --git a/runtime/lib/bigint.dart b/runtime/lib/bigint.dart
index f6ea8e9..de499a9 100644
--- a/runtime/lib/bigint.dart
+++ b/runtime/lib/bigint.dart
@@ -58,7 +58,6 @@
   // Bigint constant values.
   // Note: Not declared as final in order to satisfy optimizer, which expects
   // constants to be in canonical form (Smi).
-  static _Bigint ZERO = new _Bigint();
   static _Bigint ONE = new _Bigint()._setInt(1);
 
   // Digit conversion table for parsing.
@@ -66,9 +65,9 @@
 
   // Internal data structure.
   bool get _neg native "Bigint_getNeg";
-  void set _neg(bool neg) native "Bigint_setNeg";
+  void set _neg(bool value) native "Bigint_setNeg";
   int get _used native "Bigint_getUsed";
-  void set _used(int used) native "Bigint_setUsed";
+  void set _used(int value) native "Bigint_setUsed";
   Uint32List get _digits native "Bigint_getDigits";
   void set _digits(Uint32List digits) {
     // The VM expects digits_ to be a Uint32List.
@@ -76,7 +75,7 @@
     _set_digits(digits);
   }
 
-  void _set_digits(Uint32List digits) native "Bigint_setDigits";
+  void _set_digits(Uint32List value) native "Bigint_setDigits";
 
   // Factory returning an instance initialized to value 0.
   factory _Bigint() native "Bigint_allocate";
@@ -203,36 +202,57 @@
   _Bigint _toBigint() => this;
 
   // Make sure at least 'length' _digits are allocated.
-  // Copy existing _digits if reallocation is necessary.
-  // TODO(regis): Check that we are not preserving _digits unnecessarily.
+  // Copy existing and used _digits if reallocation is necessary.
+  // Avoid preserving _digits unnecessarily by calling this function with a
+  // meaningful _used field.
   void _ensureLength(int length) {
+    length++;  // Account for leading zero for 64-bit processing.
     var digits = _digits;
-    if (length > 0 && (length > digits.length)) {
+    if (length > digits.length) {
       var new_digits = new Uint32List(length + EXTRA_DIGITS);
-      for (var i = _used; --i >= 0; ) {
-        new_digits[i] = digits[i];
-      }
       _digits = new_digits;
+      var used = _used;
+      if (used > 0) {
+        var i = used + 1;  // Copy leading zero for 64-bit processing.
+        while (--i >= 0) {
+          new_digits[i] = digits[i];
+        }
+      }
     }
   }
 
   // Clamp off excess high _digits.
   void _clamp() {
-    var digits = _digits;
-    while (_used > 0 && digits[_used - 1] == 0) {
-      --_used;
+    var used = _used;
+    if (used > 0) {
+      var digits = _digits;
+      if (digits[used - 1] == 0) {
+        do {
+          --used;
+        } while (used > 0 && digits[used - 1] == 0);
+        _used = used;
+      }
+      digits[used] = 0;  // Set leading zero for 64-bit processing.
     }
   }
 
   // Copy this to r.
   void _copyTo(_Bigint r) {
-    r._ensureLength(_used);
-    var digits = _digits;
-    var r_digits = r._digits;
-    for (var i = _used - 1; i >= 0; --i) {
-      r_digits[i] = digits[i];
+    var used = _used;
+    if (used > 0) {
+      // We could set r._used to 0 in order to avoid preserving digits. However,
+      // it would be wrong to do so if this === r. Checking is too expensive.
+      // This case does not occur in the current implementation, but we want to
+      // remain safe.
+      r._ensureLength(used);
+      var digits = _digits;
+      var r_digits = r._digits;
+      var i = used + 1;  // Copy leading zero for 64-bit processing.
+      while (--i >= 0) {
+        r_digits[i] = digits[i];
+      }
     }
-    r._used = _used;
+    r._used = used;
     r._neg = _neg;
   }
 
@@ -249,14 +269,22 @@
 
   // r = this << n*DIGIT_BITS.
   void _dlShiftTo(int n, _Bigint r) {
-    var r_used = _used + n;
+    var used = _used;
+    if (used == 0) {
+      r._used = 0;
+      r._neg = false;
+      return;
+    }
+    var r_used = used + n;
     r._ensureLength(r_used);
     var digits = _digits;
     var r_digits = r._digits;
-    for (var i = _used - 1; i >= 0; --i) {
+    var i = used + 1;  // Copy leading zero for 64-bit processing.
+    while (--i >= 0) {
       r_digits[i + n] = digits[i];
     }
-    for (var i = n - 1; i >= 0; --i) {
+    i = n;
+    while (--i >= 0) {
       r_digits[i] = 0;
     }
     r._used = r_used;
@@ -265,14 +293,22 @@
 
   // r = this >> n*DIGIT_BITS.
   void _drShiftTo(int n, _Bigint r) {
-    var r_used = _used - n;
-    if (r_used < 0) {
+    var used = _used;
+    if (used == 0) {
+      r._used = 0;
+      r._neg = false;
+      return;
+    }
+    var r_used = used - n;
+    if (r_used <= 0) {
       if (_neg) {
         // Set r to -1.
-        r._neg = true;
+        r._used = 0;  // No digits to preserve.
         r._ensureLength(1);
+        r._neg = true;
         r._used = 1;
         r._digits[0] = 1;
+        r._digits[1] = 0;  // Set leading zero for 64-bit processing.
       } else {
         // Set r to 0.
         r._neg = false;
@@ -283,8 +319,7 @@
     r._ensureLength(r_used);
     var digits = _digits;
     var r_digits = r._digits;
-    var used = _used;
-    for (var i = n; i < used; ++i) {
+    for (var i = n; i < used + 1; i++) {  // Copy leading zero for 64-bit proc.
       r_digits[i - n] = digits[i];
     }
     r._used = r_used;
@@ -315,11 +350,13 @@
     var digits = _digits;
     var r_digits = r._digits;
     var c = 0;
-    for (var i = _used - 1; i >= 0; --i) {
+    var i = _used;
+    while (--i >= 0) {
       r_digits[i + ds + 1] = (digits[i] >> cbs) | c;
       c = (digits[i] & bm) << bs;
     }
-    for (var i = ds - 1; i >= 0; --i) {
+    i = ds;
+    while (--i >= 0) {
       r_digits[i] = 0;
     }
     r_digits[ds] = c;
@@ -341,9 +378,11 @@
       if (_neg) {
         // Set r to -1.
         r._neg = true;
+        r._used = 0;  // No digits to preserve.
         r._ensureLength(1);
         r._used = 1;
         r._digits[0] = 1;
+        r._digits[1] = 0;  // Set leading zero for 64-bit processing.
       } else {
         // Set r to 0.
         r._neg = false;
@@ -358,7 +397,7 @@
     var r_digits = r._digits;
     r_digits[0] = digits[ds] >> bs;
     var used = _used;
-    for (var i = ds + 1; i < used; ++i) {
+    for (var i = ds + 1; i < used; i++) {
       r_digits[i - ds - 1] |= (digits[i] & bm) << cbs;
       r_digits[i - ds] = digits[i] >> bs;
     }
@@ -867,13 +906,18 @@
     // TODO(regis): Use karatsuba multiplication when appropriate.
     var used = _used;
     var a_used = a._used;
+    if (used == 0 || a_used == 0) {
+      r._used = 0;
+      r._neg = false;
+      return;
+    }
     var r_used = used + a_used;
     r._ensureLength(r_used);
     var digits = _digits;
     var a_digits = a._digits;
     var r_digits = r._digits;
     r._used = r_used;
-    var i = r_used;
+    var i = r_used + 1;  // Set leading zero for 64-bit processing.
     while (--i >= 0) {
       r_digits[i] = 0;
     }
@@ -887,11 +931,16 @@
   // r = this^2, r != this.
   void _sqrTo(_Bigint r) {
     var used = _used;
+    if (used == 0) {
+      r._used = 0;
+      r._neg = false;
+      return;
+    }
     var r_used = 2 * used;
     r._ensureLength(r_used);
     var digits = _digits;
     var r_digits = r._digits;
-    var i = r_used;
+    var i = r_used + 1;  // Set leading zero for 64-bit processing.
     while (--i >= 0) {
       r_digits[i] = 0;
     }
@@ -970,6 +1019,7 @@
     var r_digits = r._digits;
     if (r._compareTo(t) >= 0) {
       r_digits[r._used++] = 1;
+      r_digits[r._used] = 0;  // Set leading zero for 64-bit processing.
       r._subTo(t, r);
     }
     ONE._dlShiftTo(y_used, t);
@@ -977,6 +1027,7 @@
     while (y._used < y_used) {
       y_digits[y._used++] = 0;
     }
+    y_digits[y._used] = 0;  // Set leading zero for 64-bit processing.
     Uint32List args = new Uint32List(2);
     args[_YT] = yt;
     while (--j >= 0) {
@@ -992,8 +1043,8 @@
     }
     if (q != null) {
       r._drShiftTo(y_used, q);
-      if (_neg != a._neg) {
-        ZERO._subTo(q, q);
+      if (_neg != a._neg && q._used > 0) {
+        q._neg = !q._neg;
       }
     }
     r._used = y_used;
@@ -1001,8 +1052,8 @@
     if (nsh > 0) {
       r._rShiftTo(nsh, r);  // Denormalize remainder.
     }
-    if (_neg) {
-      ZERO._subTo(r, r);
+    if (_neg && r._used > 0) {
+      r._neg = !r._neg;
     }
   }
 
@@ -1118,6 +1169,41 @@
   bool get isEven => _used == 0 || (_digits[0] & 1) == 0;
   bool get isNegative => _neg;
 
+  String _toPow2String(int radix) {
+    if (_used == 0) return "0";
+    assert(radix & (radix - 1) == 0);
+    final bitsPerChar = radix.bitLength - 1;
+    final firstcx = _neg ? 1 : 0;  // Index of first char in str after the sign.
+    final lastdx = _used - 1;  // Index of last digit in bigint.
+    final bitLength = lastdx*DIGIT_BITS + _nbits(_digits[lastdx]);
+    // Index of char in str. Initialize with str length.
+    var cx = firstcx + (bitLength + bitsPerChar - 1) ~/ bitsPerChar;
+    _OneByteString str = _OneByteString._allocate(cx);
+    str._setAt(0, 0x2d);  // '-'. Is overwritten if not negative.
+    final mask = radix - 1;
+    var dx = 0;  // Digit index in bigint.
+    var bx = 0;  // Bit index in bigint digit.
+    do {
+      var ch;
+      if (bx > (DIGIT_BITS - bitsPerChar)) {
+        ch = _digits[dx++] >> bx;
+        bx += bitsPerChar - DIGIT_BITS;
+        if (dx <= lastdx) {
+          ch |= (_digits[dx] & ((1 << bx) - 1)) << (bitsPerChar - bx);
+        }
+      } else {
+        ch = (_digits[dx] >> bx) & mask;
+        bx += bitsPerChar;
+        if (bx >= DIGIT_BITS) {
+          bx -= DIGIT_BITS;
+          dx++;
+        }
+      }
+      str._setAt(--cx, _IntegerImplementation._digits.codeUnitAt(ch));
+    } while (cx > firstcx);
+    return str;
+  }
+
   _leftShiftWithMask32(int count, int mask) {
     if (_used == 0) return 0;
     if (count is! _Smi) {
@@ -1384,9 +1470,10 @@
     while (x._used <= _mused2) {  // Pad x so _mulAdd has enough room later.
       x_digits[x._used++] = 0;
     }
+    x_digits[x._used] = 0;  // Set leading zero for 64-bit processing.
     var m_used = _m._used;
     var m_digits = _m._digits;
-    for (var i = 0; i < m_used; ++i) {
+    for (var i = 0; i < m_used; i++) {
       _mulMod(_rho_mu, x_digits, i);
       _Bigint._mulAdd(_rho_mu, _MU, m_digits, 0, x_digits, i, m_used);
     }
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index 82e6df1..3f55293 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -43,8 +43,8 @@
       if (func_a.IsImplicitInstanceClosureFunction()) {
         const Context& context_a = Context::Handle(Closure::context(receiver));
         const Context& context_b = Context::Handle(Closure::context(other));
-        const Instance& receiver_a = Instance::Handle(context_a.At(0));
-        const Instance& receiver_b = Instance::Handle(context_b.At(0));
+        const Object& receiver_a = Object::Handle(context_a.At(0));
+        const Object& receiver_b = Object::Handle(context_b.At(0));
         if (receiver_a.raw() == receiver_b.raw()) return Bool::True().raw();
       }
     }
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index b888106..accda5b 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -220,7 +220,7 @@
       throw new ArgumentError(radix);
     }
     if (radix & (radix - 1) == 0) {
-      return _toPow2String(this, radix);
+      return _toPow2String(radix);
     }
     if (radix == 10) return this.toString();
     final bool isNegative = this < 0;
@@ -240,7 +240,8 @@
     return string;
   }
 
-  static String _toPow2String(value, radix) {
+  String _toPow2String(int radix) {
+    int value = this;
     if (value == 0) return "0";
     assert(radix & (radix - 1) == 0);
     var negative = value < 0;
diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc
index 4152923..057087e 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -7,11 +7,16 @@
 #include "vm/exceptions.h"
 #include "vm/native_entry.h"
 #include "vm/object.h"
+#include "vm/regexp_parser.h"
 
 #include "lib/regexp_jsc.h"
 
 namespace dart {
 
+DECLARE_FLAG(bool, trace_irregexp);
+DEFINE_FLAG(bool, use_jscre, true, "Use the JSCRE regular expression engine");
+
+
 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) {
   ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
   GET_NON_NULL_NATIVE_ARGUMENT(String, pattern, arguments->NativeArgAt(1));
@@ -21,7 +26,23 @@
       Instance, handle_case_sensitive, arguments->NativeArgAt(3));
   bool ignore_case = handle_case_sensitive.raw() != Bool::True().raw();
   bool multi_line = handle_multi_line.raw() == Bool::True().raw();
-  return Jscre::Compile(pattern, multi_line, ignore_case);
+
+  if (FLAG_use_jscre) {
+    return Jscre::Compile(pattern, multi_line, ignore_case);
+  }
+  // Parse the pattern once in order to throw any format exceptions within
+  // the factory constructor. It is parsed again upon compilation.
+  RegExpCompileData compileData;
+  if (!RegExpParser::ParseRegExp(pattern, multi_line, &compileData)) {
+    // Parsing failures throw an exception.
+    UNREACHABLE();
+  }
+
+  // Create a JSRegExp object containing only the initial parameters.
+  return RegExpEngine::CreateJSRegExp(isolate,
+                                      pattern,
+                                      multi_line,
+                                      ignore_case);
 }
 
 
@@ -68,7 +89,20 @@
   ASSERT(!regexp.IsNull());
   GET_NON_NULL_NATIVE_ARGUMENT(String, str, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
-  return Jscre::Execute(regexp, str, start_index.Value());
+
+  if (FLAG_use_jscre) {
+    return Jscre::Execute(regexp, str, start_index.Value());
+  }
+
+  // This function is intrinsified. See Intrinsifier::JSRegExp_ExecuteMatch.
+  const intptr_t cid = str.GetClassId();
+
+  // Retrieve the cached function.
+  const Function& fn = Function::Handle(regexp.function(cid));
+  ASSERT(!fn.IsNull());
+
+  // And finally call the generated code.
+  return IRRegExpMacroAssembler::Execute(fn, str, start_index, isolate);
 }
 
 }  // namespace dart
diff --git a/runtime/lib/regexp_patch.dart b/runtime/lib/regexp_patch.dart
index 7c94381..118b875 100644
--- a/runtime/lib/regexp_patch.dart
+++ b/runtime/lib/regexp_patch.dart
@@ -2,16 +2,86 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import "dart:collection" show LinkedList, LinkedListEntry;
+
 patch class RegExp {
   /* patch */ factory RegExp(String source,
                              {bool multiLine: false,
                               bool caseSensitive: true}) {
-    return new _JSSyntaxRegExp(source,
-                               multiLine: multiLine,
-                               caseSensitive: caseSensitive);
+    _JSSyntaxRegExpHashKey key = new _JSSyntaxRegExpHashKey(
+        source, multiLine, caseSensitive);
+    _JSSyntaxRegExpHashValue value = _cache[key];
+
+    if (value == null) {
+      if (_cache.length > _MAX_CACHE_SIZE) {
+        _JSSyntaxRegExpHashKey lastKey = _recentlyUsed.last;
+        lastKey.unlink();
+        _cache.remove(lastKey);
+      }
+
+      value = new _JSSyntaxRegExpHashValue(
+          new _JSSyntaxRegExp(source,
+                              multiLine: multiLine,
+                              caseSensitive: caseSensitive),
+          key);
+      _cache[key] = value;
+    } else {
+      value.key.unlink();
+    }
+
+    assert(value != null);
+
+    _recentlyUsed.addFirst(value.key);
+    assert(_recentlyUsed.length == _cache.length);
+
+    // TODO(zerny): We might not want to canonicalize regexp objects.
+    return value.regexp;
+  }
+
+  // Regular expression objects are stored in a cache of up to _MAX_CACHE_SIZE
+  // elements using an LRU eviction strategy.
+  // TODO(zerny): Do not impose a fixed limit on the number of cached objects.
+  // Other possibilities could be limiting by the size of the regexp objects,
+  // or imposing a lower time bound for the most recent use under which a regexp
+  // may not be removed from the cache.
+  // TODO(zerny): Use self-sizing cache similar to _AccessorCache in
+  // mirrors_impl.dart.
+  static const int _MAX_CACHE_SIZE = 256;
+  static final Map<_JSSyntaxRegExpHashKey, _JSSyntaxRegExpHashValue> _cache =
+      new HashMap<_JSSyntaxRegExpHashKey, _JSSyntaxRegExpHashValue>();
+  static final LinkedList<_JSSyntaxRegExpHashKey> _recentlyUsed =
+      new LinkedList<_JSSyntaxRegExpHashKey>();
+}
+
+
+// Represents both a key in the regular expression cache as well as its
+// corresponding entry in the LRU list.
+class _JSSyntaxRegExpHashKey extends LinkedListEntry<_JSSyntaxRegExpHashKey> {
+  final String pattern;
+  final bool multiLine;
+  final bool caseSensitive;
+
+  _JSSyntaxRegExpHashKey(this.pattern, this.multiLine, this.caseSensitive);
+
+  int get hashCode => pattern.hashCode;
+  bool operator==(_JSSyntaxRegExpHashKey that) {
+    return (this.pattern == that.pattern) &&
+           (this.multiLine == that.multiLine) &&
+           (this.caseSensitive == that.caseSensitive);
   }
 }
 
+
+// Represents a value in the regular expression cache. Contains a pointer
+// back to the key in order to access the corresponding LRU entry.
+class _JSSyntaxRegExpHashValue {
+  final _JSSyntaxRegExp regexp;
+  final _JSSyntaxRegExpHashKey key;
+
+  _JSSyntaxRegExpHashValue(this.regexp, this.key);
+}
+
+
 class _JSRegExpMatch implements Match {
   _JSRegExpMatch(this._regexp, this.input, this._match);
 
@@ -69,6 +139,7 @@
        bool caseSensitive: true}) native "JSSyntaxRegExp_factory";
 
   Match firstMatch(String str) {
+    if (str is! String) throw new ArgumentError(str);
     List match = _ExecuteMatch(str, 0);
     if (match == null) {
       return null;
@@ -86,6 +157,8 @@
   }
 
   Match matchAsPrefix(String string, [int start = 0]) {
+    if (string is! String) throw new ArgumentError(string);
+    if (start is! int) throw new ArgumentError(start);
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
@@ -98,11 +171,13 @@
   }
 
   bool hasMatch(String str) {
+    if (str is! String) throw new ArgumentError(str);
     List match = _ExecuteMatch(str, 0);
     return (match == null) ? false : true;
   }
 
   String stringMatch(String str) {
+    if (str is! String) throw new ArgumentError(str);
     List match = _ExecuteMatch(str, 0);
     if (match == null) {
       return null;
@@ -118,6 +193,51 @@
 
   int get _groupCount native "JSSyntaxRegExp_getGroupCount";
 
+  // Byte map of one byte characters with a 0xff if the character is a word
+  // character (digit, letter or underscore) and 0x00 otherwise.
+  // Used by generated RegExp code.
+  static const List<int> _wordCharacterMap = const <int>[
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // '0' - '7'
+    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // '8' - '9'
+
+    0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'A' - 'G'
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'H' - 'O'
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'P' - 'W'
+    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff,  // 'X' - 'Z', '_'
+
+    0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'a' - 'g'
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'h' - 'o'
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  // 'p' - 'w'
+    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,  // 'x' - 'z'
+    // Latin-1 range
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  ];
+
   List _ExecuteMatch(String str, int start_index)
       native "JSSyntaxRegExp_ExecuteMatch";
 }
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index bb3cbb1..09f02aa 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -1735,6 +1735,57 @@
 }
 
 
+void Assembler::InitializeFieldsNoBarrier(Register object,
+                                          Register begin,
+                                          Register end,
+                                          Register value_even,
+                                          Register value_odd) {
+  ASSERT(value_odd == value_even + 1);
+  Label init_loop;
+  Bind(&init_loop);
+  AddImmediate(begin, 2 * kWordSize);
+  cmp(begin, Operand(end));
+  strd(value_even, Address(begin, -2 * kWordSize), LS);
+  b(&init_loop, CC);
+  str(value_even, Address(begin, -2 * kWordSize), HI);
+#if defined(DEBUG)
+  Label done;
+  StoreIntoObjectFilter(object, value_even, &done);
+  StoreIntoObjectFilter(object, value_odd, &done);
+  Stop("Store buffer update is required");
+  Bind(&done);
+#endif  // defined(DEBUG)
+  // No store buffer update.
+}
+
+
+void Assembler::InitializeFieldsNoBarrierUnrolled(Register object,
+                                                  Register begin,
+                                                  intptr_t count,
+                                                  Register value_even,
+                                                  Register value_odd) {
+  ASSERT(value_odd == value_even + 1);
+  intptr_t current_offset = 0;
+  const intptr_t end_offset = count * kWordSize;
+  while (current_offset + kWordSize < end_offset) {
+    strd(value_even, Address(begin, current_offset));
+    current_offset += 2*kWordSize;
+  }
+  while (current_offset < end_offset) {
+    str(value_even, Address(begin, current_offset));
+    current_offset += kWordSize;
+  }
+#if defined(DEBUG)
+  Label done;
+  StoreIntoObjectFilter(object, value_even, &done);
+  StoreIntoObjectFilter(object, value_odd, &done);
+  Stop("Store buffer update is required");
+  Bind(&done);
+#endif  // defined(DEBUG)
+  // No store buffer update.
+}
+
+
 void Assembler::LoadClassId(Register result, Register object, Condition cond) {
   ASSERT(RawObject::kClassIdTagPos == 16);
   ASSERT(RawObject::kClassIdTagSize == 16);
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 4289916..d557640 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -668,6 +668,23 @@
                                       int32_t offset,
                                       const Object& value);
 
+  // Store value_even, value_odd, value_even, ... into the words in the address
+  // range [begin, end), assumed to be uninitialized fields in object (tagged).
+  // The stores must not need a generational store barrier (e.g., smi/null),
+  // and (value_even, value_odd) must be a valid register pair.
+  // Destroys register 'begin'.
+  void InitializeFieldsNoBarrier(Register object,
+                                 Register begin,
+                                 Register end,
+                                 Register value_even,
+                                 Register value_odd);
+  // Like above, for the range [begin, begin+count*kWordSize), unrolled.
+  void InitializeFieldsNoBarrierUnrolled(Register object,
+                                         Register begin,
+                                         intptr_t count,
+                                         Register value_even,
+                                         Register value_odd);
+
   void LoadClassId(Register result, Register object, Condition cond = AL);
   void LoadClassById(Register result, Register class_id);
   void LoadClass(Register result, Register object, Register scratch);
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index 8133003..f05f3bc 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -13,6 +13,7 @@
 #include "vm/runtime_entry.h"
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
+#include "vm/verified_memory.h"
 
 namespace dart {
 
@@ -1944,6 +1945,9 @@
 
 void Assembler::j(Condition condition, Label* label, bool near) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  if (VerifiedMemory::enabled()) {
+    near = Assembler::kFarJump;
+  }
   if (label->IsBound()) {
     static const int kShortSize = 2;
     static const int kLongSize = 6;
@@ -1986,6 +1990,9 @@
 
 void Assembler::jmp(Label* label, bool near) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  if (VerifiedMemory::enabled()) {
+    near = Assembler::kFarJump;
+  }
   if (label->IsBound()) {
     static const int kShortSize = 2;
     static const int kLongSize = 5;
@@ -2198,13 +2205,47 @@
 }
 
 
+void Assembler::VerifyHeapWord(const Address& address) {
+  if (VerifiedMemory::enabled()) {
+    Register addr_reg = EDX;
+    Register value = EBX;
+    // Preserve registers.
+    pushl(addr_reg);
+    pushl(value);
+    leal(addr_reg, address);
+    // ASSERT(*address == *(address + offset))
+    movl(value, Address(addr_reg, 0));
+    cmpl(value, Address(addr_reg, VerifiedMemory::offset()));
+    Label ok;
+    j(EQUAL, &ok, Assembler::kNearJump);
+    Stop("Write barrier verification failed");
+    Bind(&ok);
+    popl(value);
+    popl(addr_reg);
+  }
+}
+
+
+void Assembler::VerifiedWrite(const Address& dest, Register value) {
+  VerifyHeapWord(dest);
+  movl(dest, value);
+  if (VerifiedMemory::enabled()) {
+    Register temp = (value == EDX) ? ECX : EDX;
+    pushl(temp);
+    leal(temp, dest);
+    movl(Address(temp, VerifiedMemory::offset()), value);
+    popl(temp);
+  }
+}
+
+
 // Destroys the value register.
 void Assembler::StoreIntoObject(Register object,
                                 const Address& dest,
                                 Register value,
                                 bool can_value_be_smi) {
   ASSERT(object != value);
-  movl(dest, value);
+  VerifiedWrite(dest, value);
   Label done;
   if (can_value_be_smi) {
     StoreIntoObjectFilter(object, value, &done);
@@ -2230,7 +2271,7 @@
 void Assembler::StoreIntoObjectNoBarrier(Register object,
                                          const Address& dest,
                                          Register value) {
-  movl(dest, value);
+  VerifiedWrite(dest, value);
 #if defined(DEBUG)
   Label done;
   pushl(value);
@@ -2243,24 +2284,47 @@
 }
 
 
+void Assembler::UnverifiedStoreOldObject(const Address& dest,
+                                         const Object& value) {
+  ASSERT(value.IsOld());
+  ASSERT(!value.InVMHeap());
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitUint8(0xC7);
+  EmitOperand(0, dest);
+  buffer_.EmitObject(value);
+}
+
+
 void Assembler::StoreIntoObjectNoBarrier(Register object,
                                          const Address& dest,
                                          const Object& value) {
+  VerifyHeapWord(dest);
   if (value.IsSmi() || value.InVMHeap()) {
-    movl(dest, Immediate(reinterpret_cast<int32_t>(value.raw())));
+    Immediate imm_value(reinterpret_cast<int32_t>(value.raw()));
+    movl(dest, imm_value);
+    if (VerifiedMemory::enabled()) {
+      Register temp = ECX;
+      pushl(temp);
+      leal(temp, dest);
+      movl(Address(temp, VerifiedMemory::offset()), imm_value);
+      popl(temp);
+    }
   } else {
-    ASSERT(value.IsOld());
-    AssemblerBuffer::EnsureCapacity ensured(&buffer_);
-    EmitUint8(0xC7);
-    EmitOperand(0, dest);
-    buffer_.EmitObject(value);
+    UnverifiedStoreOldObject(dest, value);
+    if (VerifiedMemory::enabled()) {
+      Register temp = EDX;
+      pushl(temp);
+      leal(temp, dest);
+      UnverifiedStoreOldObject(Address(temp, VerifiedMemory::offset()), value);
+      popl(temp);
+    }
   }
   // No store buffer update.
 }
 
 
 void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
-  movl(dest, value);
+  VerifiedWrite(dest, value);
 #if defined(DEBUG)
   Label done;
   testl(value, Immediate(kHeapObjectTag));
@@ -2271,9 +2335,35 @@
 }
 
 
+void Assembler::ZeroSmiField(const Address& dest) {
+  // TODO(koda): Add VerifySmi once we distinguish initalization.
+  VerifyHeapWord(dest);
+  Immediate zero(Smi::RawValue(0));
+  movl(dest, zero);
+  if (VerifiedMemory::enabled()) {
+    Register temp = ECX;
+    pushl(temp);
+    leal(temp, dest);
+    movl(Address(temp, VerifiedMemory::offset()), zero);
+    popl(temp);
+  }
+}
+
+
 void Assembler::IncrementSmiField(const Address& dest, int32_t increment) {
-  // TODO(koda): Implement testl for addresses and check that dest is a smi.
-  addl(dest, Immediate(Smi::RawValue(increment)));
+  // Note: FlowGraphCompiler::EdgeCounterIncrementSizeInBytes depends on
+  // the length of this instruction sequence.
+  // TODO(koda): Add VerifySmi once we distinguish initalization.
+  VerifyHeapWord(dest);
+  Immediate inc_imm(Smi::RawValue(increment));
+  addl(dest, inc_imm);
+  if (VerifiedMemory::enabled()) {
+    Register temp = ECX;
+    pushl(temp);
+    leal(temp, dest);
+    addl(Address(temp, VerifiedMemory::offset()), inc_imm);
+    popl(temp);
+  }
 }
 
 
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index eb3f112..eae58e0 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -626,10 +626,12 @@
   void int3();
   void hlt();
 
+  // Note: verified_mem mode forces far jumps.
   void j(Condition condition, Label* label, bool near = kFarJump);
   void j(Condition condition, const ExternalLabel* label);
 
   void jmp(Register reg);
+  // Note: verified_mem mode forces far jumps.
   void jmp(Label* label, bool near = kFarJump);
   void jmp(const ExternalLabel* label);
 
@@ -679,6 +681,7 @@
 
   // Stores a Smi value into a heap object field that always contains a Smi.
   void StoreIntoSmiField(const Address& dest, Register value);
+  void ZeroSmiField(const Address& dest);
   // Increments a Smi field. Leaves flags in same state as an 'addl'.
   void IncrementSmiField(const Address& dest, int32_t increment);
 
@@ -928,6 +931,12 @@
                                   Register value,
                                   Label* no_update);
 
+  // Analogous to VerifiedMemory::Verify(address, kWordSize).
+  void VerifyHeapWord(const Address& address);
+  // Analogous to VerifiedMemory::Write.
+  void VerifiedWrite(const Address& dest, Register value);
+  void UnverifiedStoreOldObject(const Address& dest, const Object& value);
+
   int32_t jit_cookie();
 
   AssemblerBuffer buffer_;
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 336baf3..43544b5 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -1827,6 +1827,14 @@
 }
 
 
+void Assembler::addl(Register dst, const Immediate& imm) {
+  ASSERT(imm.is_int32());
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitRegisterREX(dst, REX_NONE);
+  EmitComplex(0, Operand(dst), imm);
+}
+
+
 void Assembler::addl(Register dst, const Address& address) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   EmitOperandREX(dst, address, REX_NONE);
@@ -1917,6 +1925,35 @@
 }
 
 
+void Assembler::adcq(Register dst, Register src) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  Operand operand(src);
+  EmitOperandREX(dst, operand, REX_W);
+  EmitUint8(0x13);
+  EmitOperand(dst & 7, operand);
+}
+
+
+void Assembler::adcq(Register dst, const Immediate& imm) {
+  if (imm.is_int32()) {
+    AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+    EmitRegisterREX(dst, REX_W);
+    EmitComplex(2, Operand(dst), imm);
+  } else {
+    movq(TMP, imm);
+    adcq(dst, TMP);
+  }
+}
+
+
+void Assembler::adcq(Register dst, const Address& address) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitOperandREX(dst, address, REX_W);
+  EmitUint8(0x13);
+  EmitOperand(dst & 7, address);
+}
+
+
 void Assembler::subl(Register dst, Register src) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   Operand operand(src);
@@ -1926,6 +1963,14 @@
 }
 
 
+void Assembler::subl(Register dst, const Immediate& imm) {
+  ASSERT(imm.is_int32());
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitRegisterREX(dst, REX_NONE);
+  EmitComplex(3, Operand(dst), imm);
+}
+
+
 void Assembler::subl(Register dst, const Address& address) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   EmitOperandREX(dst, address, REX_NONE);
@@ -2118,6 +2163,35 @@
 }
 
 
+void Assembler::sbbq(Register dst, Register src) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  Operand operand(src);
+  EmitOperandREX(dst, operand, REX_W);
+  EmitUint8(0x1B);
+  EmitOperand(dst & 7, operand);
+}
+
+
+void Assembler::sbbq(Register dst, const Immediate& imm) {
+  if (imm.is_int32()) {
+    AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+    EmitRegisterREX(dst, REX_W);
+    EmitComplex(3, Operand(dst), imm);
+  } else {
+    movq(TMP, imm);
+    sbbq(dst, TMP);
+  }
+}
+
+
+void Assembler::sbbq(Register dst, const Address& address) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitOperandREX(dst, address, REX_W);
+  EmitUint8(0x1B);
+  EmitOperand(dst & 7, address);
+}
+
+
 void Assembler::shll(Register reg, const Immediate& imm) {
   EmitGenericShift(false, 4, reg, imm);
 }
@@ -2384,6 +2458,9 @@
 
 void Assembler::j(Condition condition, Label* label, bool near) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  if (VerifiedMemory::enabled()) {
+    near = Assembler::kFarJump;
+  }
   if (label->IsBound()) {
     static const int kShortSize = 2;
     static const int kLongSize = 6;
@@ -2436,6 +2513,9 @@
 
 void Assembler::jmp(Label* label, bool near) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  if (VerifiedMemory::enabled()) {
+    near = Assembler::kFarJump;
+  }
   if (label->IsBound()) {
     static const int kShortSize = 2;
     static const int kLongSize = 5;
@@ -2754,7 +2834,7 @@
     LoadObject(TMP, object, pp);
     movq(dst, TMP);
   } else {
-    LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
+    MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
   }
 }
 
@@ -2819,7 +2899,7 @@
 }
 
 
-void Assembler::LoadImmediate(const Address& dst, const Immediate& imm,
+void Assembler::MoveImmediate(const Address& dst, const Immediate& imm,
                               Register pp) {
   if (CanLoadImmediateFromPool(imm, pp)) {
     LoadImmediate(TMP, imm, pp);
@@ -2871,12 +2951,47 @@
 }
 
 
+void Assembler::VerifyHeapWord(const Address& address) {
+  if (VerifiedMemory::enabled()) {
+    Register addr_reg = RDX;
+    Register value = RBX;
+    // Preserve registers.
+    pushq(addr_reg);
+    pushq(value);
+    leaq(addr_reg, address);
+    // ASSERT(*address == *(address + offset))
+    movq(value, Address(addr_reg, 0));
+    cmpq(value, Address(addr_reg, VerifiedMemory::offset()));
+    Label ok;
+    j(EQUAL, &ok);
+    static const bool kFixedLengthEncoding = true;
+    Stop("Write barrier verification failed", kFixedLengthEncoding);
+    Bind(&ok);
+    popq(value);
+    popq(addr_reg);
+  }
+}
+
+
+void Assembler::VerifiedWrite(const Address& dest, Register value) {
+  VerifyHeapWord(dest);
+  movq(dest, value);
+  if (VerifiedMemory::enabled()) {
+    Register temp = (value == RDX) ? RCX : RDX;
+    pushq(temp);
+    leaq(temp, dest);
+    movq(Address(temp, VerifiedMemory::offset()), value);
+    popq(temp);
+  }
+}
+
+
 void Assembler::StoreIntoObject(Register object,
                                 const Address& dest,
                                 Register value,
                                 bool can_value_be_smi) {
   ASSERT(object != value);
-  movq(dest, value);
+  VerifiedWrite(dest, value);
   Label done;
   if (can_value_be_smi) {
     StoreIntoObjectFilter(object, value, &done);
@@ -2884,13 +2999,13 @@
     StoreIntoObjectFilterNoSmi(object, value, &done);
   }
   // A store buffer update is required.
-  if (value != RAX) pushq(RAX);
-  if (object != RAX) {
-    movq(RAX, object);
+  if (value != RDX) pushq(RDX);
+  if (object != RDX) {
+    movq(RDX, object);
   }
   StubCode* stub_code = Isolate::Current()->stub_code();
   Call(&stub_code->UpdateStoreBufferLabel(), PP);
-  if (value != RAX) popq(RAX);
+  if (value != RDX) popq(RDX);
   Bind(&done);
 }
 
@@ -2898,7 +3013,7 @@
 void Assembler::StoreIntoObjectNoBarrier(Register object,
                                          const Address& dest,
                                          Register value) {
-  movq(dest, value);
+  VerifiedWrite(dest, value);
 #if defined(DEBUG)
   Label done;
   pushq(value);
@@ -2911,6 +3026,69 @@
 }
 
 
+void Assembler::StoreIntoObjectNoBarrier(Register object,
+                                         const Address& dest,
+                                         const Object& value,
+                                         Register pp) {
+  if (VerifiedMemory::enabled()) {
+    VerifyHeapWord(dest);
+    Register temp = (pp == RCX) ? RDX : RCX;
+    pushq(temp);
+    leaq(temp, dest);
+    StoreObject(Address(temp, 0), value, pp);
+    StoreObject(Address(temp, VerifiedMemory::offset()), value, pp);
+    popq(temp);
+  } else {
+    StoreObject(dest, value, pp);
+  }
+  // TODO(koda): Use 'object', verify that generational barrier's not needed.
+}
+
+
+void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
+  VerifiedWrite(dest, value);
+#if defined(DEBUG)
+  Label done;
+  testq(value, Immediate(kHeapObjectTag));
+  j(ZERO, &done);
+  Stop("Smi expected");
+  Bind(&done);
+#endif  // defined(DEBUG)
+}
+
+
+void Assembler::ZeroSmiField(const Address& dest) {
+  // TODO(koda): Add VerifySmi once we distinguish initalization.
+  VerifyHeapWord(dest);
+  Immediate zero(Smi::RawValue(0));
+  movq(dest, zero);
+  if (VerifiedMemory::enabled()) {
+    Register temp = RCX;
+    pushq(temp);
+    leaq(temp, dest);
+    movq(Address(temp, VerifiedMemory::offset()), zero);
+    popq(temp);
+  }
+}
+
+
+void Assembler::IncrementSmiField(const Address& dest, int64_t increment) {
+  // Note: FlowGraphCompiler::EdgeCounterIncrementSizeInBytes depends on
+  // the length of this instruction sequence.
+  // TODO(koda): Add VerifySmi once we distinguish initalization.
+  VerifyHeapWord(dest);
+  Immediate inc_imm(Smi::RawValue(increment));
+  addq(dest, inc_imm);
+  if (VerifiedMemory::enabled()) {
+    Register temp = RCX;
+    pushq(temp);
+    leaq(temp, dest);
+    addq(Address(temp, VerifiedMemory::offset()), inc_imm);
+    popq(temp);
+  }
+}
+
+
 void Assembler::DoubleNegate(XmmRegister d) {
   static const struct ALIGN16 {
     uint64_t a;
@@ -2935,12 +3113,19 @@
 }
 
 
-void Assembler::Stop(const char* message) {
+void Assembler::Stop(const char* message, bool fixed_length_encoding) {
   int64_t message_address = reinterpret_cast<int64_t>(message);
   if (FLAG_print_stop_message) {
     pushq(TMP);  // Preserve TMP register.
     pushq(RDI);  // Preserve RDI register.
-    LoadImmediate(RDI, Immediate(message_address), PP);
+    if (fixed_length_encoding) {
+      AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+      EmitRegisterREX(RDI, REX_W);
+      EmitUint8(0xB8 | (RDI & 7));
+      EmitInt64(message_address);
+    } else {
+      LoadImmediate(RDI, Immediate(message_address), PP);
+    }
     call(&StubCode::PrintStopMessageLabel());
     popq(RDI);  // Restore RDI register.
     popq(TMP);  // Restore TMP register.
@@ -3336,7 +3521,7 @@
     tags = RawObject::SizeTag::update(instance_size, tags);
     ASSERT(cls.id() != kIllegalCid);
     tags = RawObject::ClassIdTag::update(cls.id(), tags);
-    LoadImmediate(FieldAddress(instance_reg, Object::tags_offset()),
+    MoveImmediate(FieldAddress(instance_reg, Object::tags_offset()),
                   Immediate(tags), pp);
   } else {
     jmp(failure);
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index c098d4c..44d4596 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -546,6 +546,7 @@
   void XorImmediate(Register dst, const Immediate& imm, Register pp);
 
   void addl(Register dst, Register src);
+  void addl(Register dst, const Immediate& imm);
   void addl(Register dst, const Address& address);
   void addl(const Address& address, Register src);
   void adcl(Register dst, Register src);
@@ -557,6 +558,9 @@
   void addq(Register dst, const Address& address);
   void addq(const Address& address, const Immediate& imm);
   void addq(const Address& address, Register src);
+  void adcq(Register dst, Register src);
+  void adcq(Register dst, const Immediate& imm);
+  void adcq(Register dst, const Address& address);
 
   void cdq();
   void cqo();
@@ -576,6 +580,7 @@
   void MulImmediate(Register reg, const Immediate& imm, Register pp);
 
   void subl(Register dst, Register src);
+  void subl(Register dst, const Immediate& imm);
   void subl(Register dst, const Address& address);
   void sbbl(Register dst, Register src);
   void sbbl(Register dst, const Immediate& imm);
@@ -586,6 +591,9 @@
   void subq(Register reg, const Address& address);
   void subq(const Address& address, Register reg);
   void subq(const Address& address, const Immediate& imm);
+  void sbbq(Register dst, Register src);
+  void sbbq(Register dst, const Immediate& imm);
+  void sbbq(Register dst, const Address& address);
 
   void shll(Register reg, const Immediate& imm);
   void shll(Register operand, Register shifter);
@@ -650,10 +658,12 @@
   void int3();
   void hlt();
 
+  // Note: verified_mem mode forces far jumps.
   void j(Condition condition, Label* label, bool near = kFarJump);
   void j(Condition condition, const ExternalLabel* label);
 
   void jmp(Register reg);
+  // Note: verified_mem mode forces far jumps.
   void jmp(Label* label, bool near = kFarJump);
   void jmp(const ExternalLabel* label);
 
@@ -673,6 +683,7 @@
   void cpuid();
 
   // Issue memory to memory move through a TMP register.
+  // TODO(koda): Assert that these are not used for heap objects.
   void MoveMemoryToMemory(const Address& dst, const Address& src) {
     movq(TMP, src);
     movq(dst, TMP);
@@ -705,6 +716,7 @@
   // the object pool when possible. Unless you are sure that the untagged object
   // pool pointer is in another register, or that it is not available at all,
   // PP should be passed for pp.
+  // TODO(koda): Assert that these are not used for heap objects.
   void AddImmediate(Register reg, const Immediate& imm, Register pp);
   void AddImmediate(const Address& address, const Immediate& imm, Register pp);
   void SubImmediate(Register reg, const Immediate& imm, Register pp);
@@ -726,7 +738,6 @@
 
   bool CanLoadImmediateFromPool(const Immediate& imm, Register pp);
   void LoadImmediate(Register reg, const Immediate& imm, Register pp);
-  void LoadImmediate(const Address& dst, const Immediate& imm, Register pp);
   void LoadIsolate(Register dst);
   void LoadObject(Register dst, const Object& obj, Register pp);
   void JmpPatchable(const ExternalLabel* label, Register pp);
@@ -734,6 +745,8 @@
   void J(Condition condition, const ExternalLabel* label, Register pp);
   void CallPatchable(const ExternalLabel* label);
   void Call(const ExternalLabel* label, Register pp);
+  // Unaware of write barrier (use StoreInto* methods for storing to objects).
+  // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse.
   void StoreObject(const Address& dst, const Object& obj, Register pp);
   void PushObject(const Object& object, Register pp);
   void CompareObject(Register reg, const Object& object, Register pp);
@@ -747,15 +760,25 @@
   void StoreIntoObjectNoBarrier(Register object,
                                 const Address& dest,
                                 Register value);
+  void StoreIntoObjectNoBarrier(Register object,
+                                const Address& dest,
+                                const Object& value,
+                                Register pp);
+
+  // Stores a Smi value into a heap object field that always contains a Smi.
+  void StoreIntoSmiField(const Address& dest, Register value);
+  void ZeroSmiField(const Address& dest);
+  // Increments a Smi field. Leaves flags in same state as an 'addq'.
+  void IncrementSmiField(const Address& dest, int64_t increment);
 
   void DoubleNegate(XmmRegister d);
   void FloatNegate(XmmRegister f);
 
   void DoubleAbs(XmmRegister reg);
 
-  void LockCmpxchgl(const Address& address, Register reg) {
+  void LockCmpxchgq(const Address& address, Register reg) {
     lock();
-    cmpxchgl(address, reg);
+    cmpxchgq(address, reg);
   }
 
   void PushRegisters(intptr_t cpu_register_set, intptr_t xmm_register_set);
@@ -930,7 +953,7 @@
                         Register end_address);
 
   // Debugging and bringup support.
-  void Stop(const char* message);
+  void Stop(const char* message, bool fixed_length_encoding = false);
   void Unimplemented(const char* message);
   void Untested(const char* message);
   void Unreachable(const char* message);
@@ -1076,6 +1099,13 @@
                                   Register value,
                                   Label* no_update);
 
+  // Analogous to VerifiedMemory::Verify(address, kWordSize).
+  void VerifyHeapWord(const Address& address);
+  // Analogous to VerifiedMemory::Write.
+  void VerifiedWrite(const Address& dest, Register value);
+  // Unaware of write barrier (use StoreInto* methods for storing to objects).
+  void MoveImmediate(const Address& dst, const Immediate& imm, Register pp);
+
   void ComputeCounterAddressesForCid(intptr_t cid,
                                      Heap::Space space,
                                      Address* count_address,
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index f7ba59e..541b1b9 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -714,6 +714,32 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(LongAddImmediate, assembler) {
+  __ pushq(CallingConventions::kArg1Reg);
+  __ movl(RAX, Address(RSP, 0));  // left low.
+  __ movl(RDX, Address(RSP, 4));  // left high.
+  __ addl(RAX, Immediate(12));  // right low immediate.
+  __ adcl(RDX, Immediate(11));  // right high immediate.
+  // Result is in RAX/RDX.
+  __ movl(Address(RSP, 0), RAX);  // result low.
+  __ movl(Address(RSP, 4), RDX);  // result high.
+  __ popq(RAX);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(LongAddImmediate, test) {
+  typedef int64_t (*LongAddImmediateCode)(int64_t a);
+  int64_t a = (13LL << 32) + 14;
+  int64_t b = (11LL << 32) + 12;
+  int64_t res = reinterpret_cast<LongAddImmediateCode>(test->entry())(a);
+  EXPECT_EQ((a + b), res);
+  a = (13LL << 32) - 1;
+  res = reinterpret_cast<LongAddImmediateCode>(test->entry())(a);
+  EXPECT_EQ((a + b), res);
+}
+
+
 ASSEMBLER_TEST_GENERATE(LongAddAddress, assembler) {
   __ pushq(CallingConventions::kArg2Reg);
   __ pushq(CallingConventions::kArg1Reg);
@@ -774,6 +800,32 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(LongSubImmediate, assembler) {
+  __ pushq(CallingConventions::kArg1Reg);
+  __ movl(RAX, Address(RSP, 0));  // left low.
+  __ movl(RDX, Address(RSP, 4));  // left high.
+  __ subl(RAX, Immediate(12));  // right low immediate.
+  __ sbbl(RDX, Immediate(11));  // right high immediate.
+  // Result is in RAX/RDX.
+  __ movl(Address(RSP, 0), RAX);  // result low.
+  __ movl(Address(RSP, 4), RDX);  // result high.
+  __ popq(RAX);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(LongSubImmediate, test) {
+  typedef int64_t (*LongSubImmediateCode)(int64_t a);
+  int64_t a = (13LL << 32) + 14;
+  int64_t b = (11LL << 32) + 12;
+  int64_t res = reinterpret_cast<LongSubImmediateCode>(test->entry())(a);
+  EXPECT_EQ((a - b), res);
+  a = (13LL << 32) + 10;
+  res = reinterpret_cast<LongSubImmediateCode>(test->entry())(a);
+  EXPECT_EQ((a - b), res);
+}
+
+
 ASSEMBLER_TEST_GENERATE(LongSubAddress, assembler) {
   __ pushq(CallingConventions::kArg2Reg);
   __ pushq(CallingConventions::kArg1Reg);
@@ -803,6 +855,158 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(AddReg, assembler) {
+  __ movq(R10, CallingConventions::kArg1Reg);  // al.
+  __ addq(R10, CallingConventions::kArg3Reg);  // bl.
+  __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
+  __ adcq(RAX, CallingConventions::kArg4Reg);  // bh.
+  // RAX = high64(ah:al + bh:bl).
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(AddReg, test) {
+  typedef int64_t (*AddRegCode)(int64_t al, int64_t ah, int64_t bl, int64_t bh);
+  int64_t al = 11;
+  int64_t ah = 12;
+  int64_t bl = 13;
+  int64_t bh = 14;
+  int64_t res = reinterpret_cast<AddRegCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah + bh), res);
+  al = -1;
+  res = reinterpret_cast<AddRegCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah + bh + 1), res);
+}
+
+
+ASSEMBLER_TEST_GENERATE(AddImmediate, assembler) {
+  __ movq(R10, CallingConventions::kArg1Reg);  // al.
+  __ addq(R10, Immediate(13));  // bl.
+  __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
+  __ adcq(RAX, Immediate(14));  // bh.
+  // RAX = high64(ah:al + bh:bl).
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(AddImmediate, test) {
+  typedef int64_t (*AddImmediateCode)(int64_t al, int64_t ah);
+  int64_t al = 11;
+  int64_t ah = 12;
+  int64_t bh = 14;
+  int64_t res = reinterpret_cast<AddImmediateCode>(test->entry())(al, ah);
+  EXPECT_EQ((ah + bh), res);
+  al = -1;
+  res = reinterpret_cast<AddImmediateCode>(test->entry())(al, ah);
+  EXPECT_EQ((ah + bh + 1), res);
+}
+
+
+ASSEMBLER_TEST_GENERATE(AddAddress, assembler) {
+  __ pushq(CallingConventions::kArg4Reg);
+  __ pushq(CallingConventions::kArg3Reg);
+  __ pushq(CallingConventions::kArg2Reg);
+  __ pushq(CallingConventions::kArg1Reg);
+  __ movq(R10, Address(RSP, 0 * kWordSize));  // al.
+  __ addq(R10, Address(RSP, 2 * kWordSize));  // bl.
+  __ movq(RAX, Address(RSP, 1 * kWordSize));  // ah.
+  __ adcq(RAX, Address(RSP, 3 * kWordSize));  // bh.
+  // RAX = high64(ah:al + bh:bl).
+  __ Drop(4);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(AddAddress, test) {
+  typedef int64_t (*AddCode)(int64_t al, int64_t ah, int64_t bl, int64_t bh);
+  int64_t al = 11;
+  int64_t ah = 12;
+  int64_t bl = 13;
+  int64_t bh = 14;
+  int64_t res = reinterpret_cast<AddCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah + bh), res);
+  al = -1;
+  res = reinterpret_cast<AddCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah + bh + 1), res);
+}
+
+
+ASSEMBLER_TEST_GENERATE(SubReg, assembler) {
+  __ movq(R10, CallingConventions::kArg1Reg);  // al.
+  __ subq(R10, CallingConventions::kArg3Reg);  // bl.
+  __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
+  __ sbbq(RAX, CallingConventions::kArg4Reg);  // bh.
+  // RAX = high64(ah:al - bh:bl).
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(SubReg, test) {
+  typedef int64_t (*SubRegCode)(int64_t al, int64_t ah, int64_t bl, int64_t bh);
+  int64_t al = 14;
+  int64_t ah = 13;
+  int64_t bl = 12;
+  int64_t bh = 11;
+  int64_t res = reinterpret_cast<SubRegCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah - bh), res);
+  al = 10;
+  res = reinterpret_cast<SubRegCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah - bh - 1), res);
+}
+
+
+ASSEMBLER_TEST_GENERATE(SubImmediate, assembler) {
+  __ movq(R10, CallingConventions::kArg1Reg);  // al.
+  __ subq(R10, Immediate(12));  // bl.
+  __ movq(RAX, CallingConventions::kArg2Reg);  // ah.
+  __ sbbq(RAX, Immediate(11));  // bh.
+  // RAX = high64(ah:al - bh:bl).
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(SubImmediate, test) {
+  typedef int64_t (*SubImmediateCode)(int64_t al, int64_t ah);
+  int64_t al = 14;
+  int64_t ah = 13;
+  int64_t bh = 11;
+  int64_t res = reinterpret_cast<SubImmediateCode>(test->entry())(al, ah);
+  EXPECT_EQ((ah - bh), res);
+  al = 10;
+  res = reinterpret_cast<SubImmediateCode>(test->entry())(al, ah);
+  EXPECT_EQ((ah - bh - 1), res);
+}
+
+
+ASSEMBLER_TEST_GENERATE(SubAddress, assembler) {
+  __ pushq(CallingConventions::kArg4Reg);
+  __ pushq(CallingConventions::kArg3Reg);
+  __ pushq(CallingConventions::kArg2Reg);
+  __ pushq(CallingConventions::kArg1Reg);
+  __ movq(R10, Address(RSP, 0 * kWordSize));  // al.
+  __ subq(R10, Address(RSP, 2 * kWordSize));  // bl.
+  __ movq(RAX, Address(RSP, 1 * kWordSize));  // ah.
+  __ sbbq(RAX, Address(RSP, 3 * kWordSize));  // bh.
+  // RAX = high64(ah:al - bh:bl).
+  __ Drop(4);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(SubAddress, test) {
+  typedef int64_t (*SubCode)(int64_t al, int64_t ah, int64_t bl, int64_t bh);
+  int64_t al = 14;
+  int64_t ah = 13;
+  int64_t bl = 12;
+  int64_t bh = 11;
+  int64_t res = reinterpret_cast<SubCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah - bh), res);
+  al = 10;
+  res = reinterpret_cast<SubCode>(test->entry())(al, ah, bl, bh);
+  EXPECT_EQ((ah - bh - 1), res);
+}
+
+
 ASSEMBLER_TEST_GENERATE(Bitwise, assembler) {
   __ movl(RCX, Immediate(42));
   __ xorl(RCX, RCX);
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index bb04f29..bbc26e1 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -380,6 +380,7 @@
   for (intptr_t i = 0; i < node->length(); i++) {
     new_args->Add(Transform(node->NodeAt(i)));
   }
+  new_args->set_names(node->names());
   result_ = new_args;
 }
 
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index c495a76..05e306e 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2383,6 +2383,13 @@
     if (!ordinal_value.IsSmi()) continue;
     enum_value = Instance::New(enum_cls, Heap::kOld);
     enum_value.SetField(index_field, ordinal_value);
+    const char* error_msg = "";
+    enum_value = enum_value.CheckAndCanonicalize(&error_msg);
+    if (enum_value.IsNull()) {
+      ReportError(enum_cls, enum_cls.token_pos(), "Failed finalizing values.");
+      UNREACHABLE();
+    }
+    ASSERT(enum_value.IsCanonical());
     field.set_value(enum_value);
     field.RecordStore(enum_value);
     intptr_t ord = Smi::Cast(ordinal_value).Value();
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index f7cd53e..1077723 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -212,6 +212,7 @@
 
 
 void ClassHeapStats::ResetAtNewGC() {
+  Verify();
   pre_gc.new_count = post_gc.new_count + recent.new_count;
   pre_gc.new_size = post_gc.new_size + recent.new_size;
   // Accumulate allocations.
@@ -226,6 +227,7 @@
 
 
 void ClassHeapStats::ResetAtOldGC() {
+  Verify();
   pre_gc.old_count = post_gc.old_count + recent.old_count;
   pre_gc.old_size = post_gc.old_size + recent.old_size;
   // Accumulate allocations.
@@ -237,6 +239,15 @@
 }
 
 
+void ClassHeapStats::Verify() {
+  pre_gc.Verify();
+  post_gc.Verify();
+  recent.Verify();
+  accumulated.Verify();
+  last_reset.Verify();
+}
+
+
 void ClassHeapStats::UpdateSize(intptr_t instance_size) {
   pre_gc.UpdateSize(instance_size);
   post_gc.UpdateSize(instance_size);
@@ -345,6 +356,7 @@
   if (ShouldUpdateSizeForClassId(cid)) {
     stats->UpdateSize(cls.instance_size());
   }
+  stats->Verify();
   return stats;
 }
 
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index fbf3d42..579e761 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -60,6 +60,13 @@
     old_size = old_count * instance_size;
     new_size = new_count * instance_size;
   }
+
+  void Verify() {
+    ASSERT(new_count >= 0);
+    ASSERT(new_size >= 0);
+    ASSERT(old_count >= 0);
+    ASSERT(old_size >= 0);
+  }
 };
 
 class ClassHeapStats {
@@ -102,6 +109,7 @@
   void UpdatePromotedAfterNewGC();
   void UpdateSize(intptr_t instance_size);
   void PrintToJSONObject(const Class& cls, JSONObject* obj) const;
+  void Verify();
 
  private:
   // Recent old at start of last new GC (used to compute promoted_*).
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index ca54de5..c2e6f75 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -265,7 +265,7 @@
   const Context& ctx = Context::CheckedHandle(arguments.ArgAt(0));
   Context& cloned_ctx = Context::Handle(Context::New(ctx.num_variables()));
   cloned_ctx.set_parent(Context::Handle(ctx.parent()));
-  Instance& inst = Instance::Handle(isolate);
+  Object& inst = Object::Handle(isolate);
   for (int i = 0; i < ctx.num_variables(); i++) {
     inst = ctx.At(i);
     cloned_ctx.SetAt(i, inst);
diff --git a/runtime/vm/code_patcher.h b/runtime/vm/code_patcher.h
index edce812..10ab117 100644
--- a/runtime/vm/code_patcher.h
+++ b/runtime/vm/code_patcher.h
@@ -92,9 +92,6 @@
   static void InsertCallAt(uword start, uword target);
 
   static RawObject* GetEdgeCounterAt(uword pc, const Code& code);
-#if defined(TARGET_ARCH_IA32)
-  static int32_t EdgeCounterIncrementSizeInBytes();
-#endif  // TARGET_ARCH_IA32
 
   static int32_t GetPoolOffsetAt(uword return_address);
   static void SetPoolOffsetAt(uword return_address, int32_t offset);
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index f4829de..48cf684 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -9,6 +9,7 @@
 #include "vm/code_patcher.h"
 #include "vm/cpu.h"
 #include "vm/dart_entry.h"
+#include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
 #include "vm/object.h"
 #include "vm/raw_object.h"
@@ -275,7 +276,7 @@
 class EdgeCounter : public ValueObject {
  public:
   EdgeCounter(uword pc, const Code& ignored)
-      : end_(pc - CodePatcher::EdgeCounterIncrementSizeInBytes()) {
+      : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()) {
     ASSERT(IsValid(end_));
   }
 
@@ -292,14 +293,6 @@
 };
 
 
-int32_t CodePatcher::EdgeCounterIncrementSizeInBytes() {
-  // The edge counter load is followed by the fixed-size edge counter
-  // incrementing code:
-  //     83 40 0b 02               add [eax+0xb],0x2
-  return 4;
-}
-
-
 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
   ASSERT(code.ContainsInstructionAt(pc));
   EdgeCounter counter(pc, code);
diff --git a/runtime/vm/code_patcher_x64.cc b/runtime/vm/code_patcher_x64.cc
index ac578f9..a9bdf479 100644
--- a/runtime/vm/code_patcher_x64.cc
+++ b/runtime/vm/code_patcher_x64.cc
@@ -9,6 +9,7 @@
 #include "vm/code_patcher.h"
 #include "vm/cpu.h"
 #include "vm/dart_entry.h"
+#include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
 #include "vm/object.h"
 #include "vm/raw_object.h"
@@ -303,7 +304,8 @@
 class EdgeCounter : public ValueObject {
  public:
   EdgeCounter(uword pc, const Code& code)
-      : end_(pc - kAdjust), object_pool_(Array::Handle(code.ObjectPool())) {
+      : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()),
+        object_pool_(Array::Handle(code.ObjectPool())) {
     ASSERT(IsValid(end_));
   }
 
@@ -317,11 +319,6 @@
   }
 
  private:
-  // The edge counter load is followed by the fixed-size edge counter
-  // incrementing code:
-  //     48 83 40 17 02             addq [rax+0x17],0x2
-  static const intptr_t kAdjust = 5;
-
   uword end_;
   const Array& object_pool_;
 };
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 0c47e54..d746b53 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -29,6 +29,8 @@
 #include "vm/object_store.h"
 #include "vm/os.h"
 #include "vm/parser.h"
+#include "vm/regexp_parser.h"
+#include "vm/regexp_assembler.h"
 #include "vm/scanner.h"
 #include "vm/symbols.h"
 #include "vm/tags.h"
@@ -63,6 +65,102 @@
 
 DECLARE_FLAG(bool, trace_failed_optimization_attempts);
 DECLARE_FLAG(bool, trace_patching);
+DECLARE_FLAG(bool, trace_irregexp);
+
+// TODO(zerny): Factor out unoptimizing/optimizing pipelines and remove
+// separate helpers functions & `optimizing` args.
+class CompilationPipeline : public ZoneAllocated {
+ public:
+  static CompilationPipeline* New(Isolate* isolate, const Function& function);
+
+  virtual void ParseFunction(ParsedFunction* parsed_function) = 0;
+  virtual FlowGraph* BuildFlowGraph(
+      ParsedFunction* parsed_function,
+      const ZoneGrowableArray<const ICData*>& ic_data_array,
+      intptr_t osr_id) = 0;
+  virtual void FinalizeCompilation() = 0;
+  virtual ~CompilationPipeline() { }
+};
+
+
+class DartCompilationPipeline : public CompilationPipeline {
+ public:
+  virtual void ParseFunction(ParsedFunction* parsed_function) {
+    Parser::ParseFunction(parsed_function);
+    parsed_function->AllocateVariables();
+  }
+
+  virtual FlowGraph* BuildFlowGraph(
+      ParsedFunction* parsed_function,
+      const ZoneGrowableArray<const ICData*>& ic_data_array,
+      intptr_t osr_id) {
+    // Build the flow graph.
+    FlowGraphBuilder builder(parsed_function,
+                             ic_data_array,
+                             NULL,  // NULL = not inlining.
+                             osr_id);
+
+    return builder.BuildGraph();
+  }
+
+  virtual void FinalizeCompilation() { }
+};
+
+
+class IrregexpCompilationPipeline : public CompilationPipeline {
+ public:
+  explicit IrregexpCompilationPipeline(Isolate* isolate)
+    : backtrack_goto_(NULL),
+      isolate_(isolate) { }
+
+  virtual void ParseFunction(ParsedFunction* parsed_function) {
+    RegExpParser::ParseFunction(parsed_function);
+    // Variables are allocated after compilation.
+  }
+
+  virtual FlowGraph* BuildFlowGraph(
+      ParsedFunction* parsed_function,
+      const ZoneGrowableArray<const ICData*>& ic_data_array,
+      intptr_t osr_id) {
+    // Compile to the dart IR.
+    RegExpEngine::CompilationResult result =
+        RegExpEngine::Compile(parsed_function->regexp_compile_data(),
+                              parsed_function,
+                              ic_data_array);
+    backtrack_goto_ = result.backtrack_goto;
+
+    // Allocate variables now that we know the number of locals.
+    parsed_function->AllocateIrregexpVariables(result.num_stack_locals);
+
+    // Build the flow graph.
+    FlowGraphBuilder builder(parsed_function,
+                             ic_data_array,
+                             NULL,  // NULL = not inlining.
+                             osr_id);
+
+    return new(isolate_) FlowGraph(builder,
+                                   result.graph_entry,
+                                   result.num_blocks);
+  }
+
+  virtual void FinalizeCompilation() {
+    backtrack_goto_->ComputeOffsetTable(isolate_);
+  }
+
+ private:
+  IndirectGotoInstr* backtrack_goto_;
+  Isolate* isolate_;
+};
+
+CompilationPipeline* CompilationPipeline::New(Isolate* isolate,
+                                              const Function& function) {
+  if (function.IsIrregexpFunction()) {
+    return new(isolate) IrregexpCompilationPipeline(isolate);
+  } else {
+    return new(isolate) DartCompilationPipeline();
+  }
+}
+
 
 // Compile a function. Should call only if the function has not been compiled.
 //   Arg0: function object.
@@ -264,7 +362,8 @@
 
 
 // Return false if bailed out.
-static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
+static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
+                                        ParsedFunction* parsed_function,
                                         bool optimized,
                                         intptr_t osr_id) {
   const Function& function = parsed_function->function();
@@ -321,12 +420,9 @@
           }
         }
 
-        // Build the flow graph.
-        FlowGraphBuilder builder(parsed_function,
-                                 *ic_data_array,
-                                 NULL,  // NULL = not inlining.
-                                 osr_id);
-        flow_graph = builder.BuildGraph();
+        flow_graph = pipeline->BuildFlowGraph(parsed_function,
+                                              *ic_data_array,
+                                              osr_id);
       }
 
       if (FLAG_print_flow_graph ||
@@ -583,6 +679,7 @@
                          &CompilerStats::graphcompiler_timer,
                          isolate);
         graph_compiler.CompileGraph();
+        pipeline->FinalizeCompilation();
       }
       {
         TimerScope timer(FLAG_compiler_stats,
@@ -815,7 +912,8 @@
 }
 
 
-static RawError* CompileFunctionHelper(const Function& function,
+static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
+                                       const Function& function,
                                        bool optimized,
                                        intptr_t osr_id) {
   Isolate* isolate = Isolate::Current();
@@ -837,12 +935,13 @@
     }
     {
       HANDLESCOPE(isolate);
-      Parser::ParseFunction(parsed_function);
-      parsed_function->AllocateVariables();
+      pipeline->ParseFunction(parsed_function);
     }
 
-    const bool success =
-        CompileParsedFunctionHelper(parsed_function, optimized, osr_id);
+    const bool success = CompileParsedFunctionHelper(pipeline,
+                                                     parsed_function,
+                                                     optimized,
+                                                     osr_id);
     if (!success) {
       if (optimized) {
         // Optimizer bailed out. Disable optimizations and to never try again.
@@ -896,7 +995,8 @@
 RawError* Compiler::CompileFunction(Isolate* isolate,
                                     const Function& function) {
   VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId);
-  return CompileFunctionHelper(function, false, Isolate::kNoDeoptId);
+  CompilationPipeline* pipeline = CompilationPipeline::New(isolate, function);
+  return CompileFunctionHelper(pipeline, function, false, Isolate::kNoDeoptId);
 }
 
 
@@ -904,7 +1004,8 @@
                                              const Function& function,
                                              intptr_t osr_id) {
   VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId);
-  return CompileFunctionHelper(function, true, osr_id);
+  CompilationPipeline* pipeline = CompilationPipeline::New(isolate, function);
+  return CompileFunctionHelper(pipeline, function, true, osr_id);
 }
 
 
@@ -915,7 +1016,11 @@
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
     // Non-optimized code generator.
-    CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId);
+    DartCompilationPipeline pipeline;
+    CompileParsedFunctionHelper(&pipeline,
+                                parsed_function,
+                                false,
+                                Isolate::kNoDeoptId);
     if (FLAG_disassemble) {
       DisassembleCode(parsed_function->function(), false);
     }
@@ -992,7 +1097,11 @@
 
     parsed_function->AllocateVariables();
     // Non-optimized code generator.
-    CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId);
+    DartCompilationPipeline pipeline;
+    CompileParsedFunctionHelper(&pipeline,
+                                parsed_function,
+                                false,
+                                Isolate::kNoDeoptId);
 
     // Invoke the function to evaluate the expression.
     const Function& initializer = parsed_function->function();
@@ -1053,7 +1162,11 @@
     parsed_function->AllocateVariables();
 
     // Non-optimized code generator.
-    CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId);
+    DartCompilationPipeline pipeline;
+    CompileParsedFunctionHelper(&pipeline,
+                                parsed_function,
+                                false,
+                                Isolate::kNoDeoptId);
 
     const Object& result = PassiveObject::Handle(
         DartEntry::InvokeFunction(func, Object::empty_array()));
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 5eface55..226eeb9 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -707,7 +707,7 @@
                                  String* name,
                                  intptr_t* token_pos,
                                  intptr_t* end_pos,
-                                 Instance* value) {
+                                 Object* value) {
   GetDescIndices();
   ASSERT(i < desc_indices_.length());
   intptr_t desc_index = desc_indices_[i];
@@ -767,7 +767,7 @@
   GetDescIndices();
   intptr_t num_variables = desc_indices_.length();
   String& var_name = String::Handle();
-  Instance& value = Instance::Handle();
+  Object& value = Instance::Handle();
   const Array& list = Array::Handle(Array::New(2 * num_variables));
   for (intptr_t i = 0; i < num_variables; i++) {
     intptr_t ignore;
@@ -802,7 +802,7 @@
   const GrowableObjectArray& param_values =
       GrowableObjectArray::Handle(GrowableObjectArray::New());
   String& name = String::Handle();
-  Instance& value = Instance::Handle();
+  Object& value = Instance::Handle();
   intptr_t num_variables = desc_indices_.length();
   for (intptr_t i = 0; i < num_variables; i++) {
     intptr_t ignore;
@@ -1600,6 +1600,7 @@
       (kind == RawFunction::kMethodExtractor) ||
       (kind == RawFunction::kNoSuchMethodDispatcher) ||
       (kind == RawFunction::kInvokeFieldDispatcher) ||
+      (kind == RawFunction::kIrregexpFunction) ||
       func.IsImplicitConstructor()) {
     return false;
   }
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index cca84d4..fd83e06 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -174,7 +174,7 @@
                   String* name,
                   intptr_t* token_pos,
                   intptr_t* end_pos,
-                  Instance* value);
+                  Object* value);
 
   RawArray* GetLocalVariables();
   RawObject* GetReceiver();
diff --git a/runtime/vm/deferred_objects.cc b/runtime/vm/deferred_objects.cc
index 7dc8c95..ef76a00 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -97,7 +97,7 @@
 }
 
 
-RawInstance* DeferredObject::object() {
+RawObject* DeferredObject::object() {
   if (object_ == NULL) {
     Create();
   }
@@ -113,14 +113,34 @@
   Class& cls = Class::Handle();
   cls ^= GetClass();
 
-  if (FLAG_trace_deoptimization_verbose) {
-    OS::PrintErr("materializing instance of %s (%" Px ", %" Pd " fields)\n",
-                 cls.ToCString(),
-                 reinterpret_cast<uword>(args_),
-                 field_count_);
-  }
+  if (cls.raw() == Object::context_class()) {
+    intptr_t num_variables = Smi::Cast(Object::Handle(GetLength())).Value();
+    if (FLAG_trace_deoptimization_verbose) {
+      OS::PrintErr(
+          "materializing context of length %" Pd " (%" Px ", %" Pd " vars)\n",
+          num_variables,
+          reinterpret_cast<uword>(args_),
+          field_count_);
+    }
+    object_ = &Context::ZoneHandle(Context::New(num_variables));
 
-  object_ = &Instance::ZoneHandle(Instance::New(cls));
+  } else {
+    if (FLAG_trace_deoptimization_verbose) {
+      OS::PrintErr("materializing instance of %s (%" Px ", %" Pd " fields)\n",
+                   cls.ToCString(),
+                   reinterpret_cast<uword>(args_),
+                   field_count_);
+    }
+
+    object_ = &Instance::ZoneHandle(Instance::New(cls));
+  }
+}
+
+
+static intptr_t ToContextIndex(intptr_t offset_in_bytes) {
+  intptr_t result = (offset_in_bytes - Context::variable_offset(0)) / kWordSize;
+  ASSERT(result >= 0);
+  return result;
 }
 
 
@@ -130,32 +150,64 @@
   Class& cls = Class::Handle();
   cls ^= GetClass();
 
-  const Instance& obj = *object_;
+  if (cls.raw() == Object::context_class()) {
+    const Context& context = Context::Cast(*object_);
 
-  Smi& offset = Smi::Handle();
-  Field& field = Field::Handle();
-  Object& value = Object::Handle();
-  const Array& offset_map = Array::Handle(cls.OffsetToFieldMap());
+    Smi& offset = Smi::Handle();
+    Object& value = Object::Handle();
 
-  for (intptr_t i = 0; i < field_count_; i++) {
-    offset ^= GetFieldOffset(i);
-    field ^= offset_map.At(offset.Value() / kWordSize);
-    value = GetValue(i);
-    if (!field.IsNull()) {
-      obj.SetField(field, value);
-      if (FLAG_trace_deoptimization_verbose) {
-        OS::PrintErr("    %s <- %s\n",
-                     String::Handle(field.name()).ToCString(),
-                     value.ToCString());
+    for (intptr_t i = 0; i < field_count_; i++) {
+      offset ^= GetFieldOffset(i);
+      if (offset.Value() == Context::parent_offset()) {
+        // Copy parent.
+        Context& parent = Context::Handle();
+        parent ^= GetValue(i);
+        context.set_parent(parent);
+        if (FLAG_trace_deoptimization_verbose) {
+          OS::PrintErr("    ctx@parent (offset %" Pd ") <- %s\n",
+                       offset.Value(),
+                       value.ToCString());
+        }
+      } else {
+        intptr_t context_index = ToContextIndex(offset.Value());
+        value = GetValue(i);
+        context.SetAt(context_index, value);
+        if (FLAG_trace_deoptimization_verbose) {
+          OS::PrintErr("    ctx@%" Pd " (offset %" Pd ") <- %s\n",
+                       context_index,
+                       offset.Value(),
+                       value.ToCString());
+        }
       }
-    } else {
-      ASSERT(cls.IsSignatureClass() ||
-             (offset.Value() == cls.type_arguments_field_offset()));
-      obj.SetFieldAtOffset(offset.Value(), value);
-      if (FLAG_trace_deoptimization_verbose) {
-        OS::PrintErr("    null Field @ offset(%" Pd ") <- %s\n",
-                     offset.Value(),
-                     value.ToCString());
+    }
+  } else {
+    const Instance& obj = Instance::Cast(*object_);
+
+    Smi& offset = Smi::Handle();
+    Field& field = Field::Handle();
+    Object& value = Object::Handle();
+    const Array& offset_map = Array::Handle(cls.OffsetToFieldMap());
+
+    for (intptr_t i = 0; i < field_count_; i++) {
+      offset ^= GetFieldOffset(i);
+      field ^= offset_map.At(offset.Value() / kWordSize);
+      value = GetValue(i);
+      if (!field.IsNull()) {
+        obj.SetField(field, value);
+        if (FLAG_trace_deoptimization_verbose) {
+          OS::PrintErr("    %s <- %s\n",
+                       String::Handle(field.name()).ToCString(),
+                       value.ToCString());
+        }
+      } else {
+        ASSERT(cls.IsSignatureClass() ||
+               (offset.Value() == cls.type_arguments_field_offset()));
+        obj.SetFieldAtOffset(offset.Value(), value);
+        if (FLAG_trace_deoptimization_verbose) {
+          OS::PrintErr("    null Field @ offset(%" Pd ") <- %s\n",
+                       offset.Value(),
+                       value.ToCString());
+        }
       }
     }
   }
diff --git a/runtime/vm/deferred_objects.h b/runtime/vm/deferred_objects.h
index cfb8d94..0077388 100644
--- a/runtime/vm/deferred_objects.h
+++ b/runtime/vm/deferred_objects.h
@@ -10,8 +10,8 @@
 namespace dart {
 
 // Forward declarations.
-class Instance;
-class RawInstance;
+class Object;
+class RawObject;
 class RawObject;
 class DeoptContext;
 
@@ -21,17 +21,17 @@
 // the materialized object.
 class DeferredSlot {
  public:
-  DeferredSlot(RawInstance** slot, DeferredSlot* next)
+  DeferredSlot(RawObject** slot, DeferredSlot* next)
       : slot_(slot), next_(next) { }
   virtual ~DeferredSlot() { }
 
-  RawInstance** slot() const { return slot_; }
+  RawObject** slot() const { return slot_; }
   DeferredSlot* next() const { return next_; }
 
   virtual void Materialize(DeoptContext* deopt_context) = 0;
 
  private:
-  RawInstance** const slot_;
+  RawObject** const slot_;
   DeferredSlot* const next_;
 
   DISALLOW_COPY_AND_ASSIGN(DeferredSlot);
@@ -40,7 +40,7 @@
 
 class DeferredDouble : public DeferredSlot {
  public:
-  DeferredDouble(double value, RawInstance** slot, DeferredSlot* next)
+  DeferredDouble(double value, RawObject** slot, DeferredSlot* next)
       : DeferredSlot(slot, next), value_(value) { }
 
   virtual void Materialize(DeoptContext* deopt_context);
@@ -56,7 +56,7 @@
 
 class DeferredMint : public DeferredSlot {
  public:
-  DeferredMint(int64_t value, RawInstance** slot, DeferredSlot* next)
+  DeferredMint(int64_t value, RawObject** slot, DeferredSlot* next)
       : DeferredSlot(slot, next), value_(value) { }
 
   virtual void Materialize(DeoptContext* deopt_context);
@@ -72,7 +72,7 @@
 
 class DeferredFloat32x4 : public DeferredSlot {
  public:
-  DeferredFloat32x4(simd128_value_t value, RawInstance** slot,
+  DeferredFloat32x4(simd128_value_t value, RawObject** slot,
                     DeferredSlot* next)
       : DeferredSlot(slot, next), value_(value) { }
 
@@ -89,7 +89,7 @@
 
 class DeferredFloat64x2 : public DeferredSlot {
  public:
-  DeferredFloat64x2(simd128_value_t value, RawInstance** slot,
+  DeferredFloat64x2(simd128_value_t value, RawObject** slot,
                     DeferredSlot* next)
       : DeferredSlot(slot, next), value_(value) { }
 
@@ -106,7 +106,7 @@
 
 class DeferredInt32x4 : public DeferredSlot {
  public:
-  DeferredInt32x4(simd128_value_t value, RawInstance** slot,
+  DeferredInt32x4(simd128_value_t value, RawObject** slot,
                    DeferredSlot* next)
       : DeferredSlot(slot, next), value_(value) { }
 
@@ -126,7 +126,7 @@
 // Object itself is described and materialized by DeferredObject.
 class DeferredObjectRef : public DeferredSlot {
  public:
-  DeferredObjectRef(intptr_t index, RawInstance** slot, DeferredSlot* next)
+  DeferredObjectRef(intptr_t index, RawObject** slot, DeferredSlot* next)
       : DeferredSlot(slot, next), index_(index) { }
 
   virtual void Materialize(DeoptContext* deopt_context);
@@ -155,7 +155,7 @@
     return kFieldsStartIndex + kFieldEntrySize * field_count_;
   }
 
-  RawInstance* object();
+  RawObject* object();
 
   // Fill object with actual field values.
   void Fill();
@@ -163,7 +163,8 @@
  private:
   enum {
     kClassIndex = 0,
-    kFieldsStartIndex = kClassIndex + 1
+    kLengthIndex,  // Number of context variables for contexts, -1 otherwise.
+    kFieldsStartIndex
   };
 
   enum {
@@ -182,6 +183,10 @@
     return args_[kClassIndex];
   }
 
+  RawObject* GetLength() const {
+    return args_[kLengthIndex];
+  }
+
   RawObject* GetFieldOffset(intptr_t index) const {
     return args_[kFieldsStartIndex + kFieldEntrySize * index + kOffsetIndex];
   }
@@ -199,7 +204,7 @@
   RawObject** args_;
 
   // Object materialized from this description.
-  const Instance* object_;
+  const Object* object_;
 
   DISALLOW_COPY_AND_ASSIGN(DeferredObject);
 };
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index ad33977..45dfd81 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -1243,6 +1243,7 @@
     MaterializeObjectInstr* mat = materializations_[i];
     // Class of the instance to allocate.
     AddConstant(mat->cls(), dest_index++);
+    AddConstant(Smi::Handle(Smi::New(mat->num_variables())), dest_index++);
     for (intptr_t i = 0; i < mat->InputCount(); i++) {
       if (!mat->InputAt(i)->BindsToConstantNull()) {
         // Emit offset-value pair.
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h
index a7ae517..683750b 100644
--- a/runtime/vm/deopt_instructions.h
+++ b/runtime/vm/deopt_instructions.h
@@ -113,42 +113,42 @@
   void DeferMaterializedObjectRef(intptr_t idx, intptr_t* slot) {
     deferred_slots_ = new DeferredObjectRef(
         idx,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
   void DeferMaterialization(double value, RawDouble** slot) {
     deferred_slots_ = new DeferredDouble(
         value,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
   void DeferMintMaterialization(int64_t value, RawMint** slot) {
     deferred_slots_ = new DeferredMint(
         value,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawFloat32x4** slot) {
     deferred_slots_ = new DeferredFloat32x4(
         value,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawFloat64x2** slot) {
     deferred_slots_ = new DeferredFloat64x2(
         value,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
   void DeferMaterialization(simd128_value_t value, RawInt32x4** slot) {
     deferred_slots_ = new DeferredInt32x4(
         value,
-        reinterpret_cast<RawInstance**>(slot),
+        reinterpret_cast<RawObject**>(slot),
         deferred_slots_);
   }
 
@@ -444,6 +444,8 @@
   }
 
  private:
+  friend class CompilerDeoptInfo;  // For current_info_number_.
+
   class TrieNode;
 
   CpuRegisterSource ToCpuRegisterSource(const Location& loc);
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 78405d3..085d914 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -30,7 +30,6 @@
     parsed_function_(*builder.parsed_function()),
     num_copied_params_(builder.num_copied_params()),
     num_non_copied_params_(builder.num_non_copied_params()),
-    num_stack_locals_(builder.num_stack_locals()),
     graph_entry_(graph_entry),
     preorder_(),
     postorder_(),
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index c319412..b6929cc 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -99,10 +99,10 @@
     return num_copied_params_ + num_non_copied_params_;
   }
   intptr_t variable_count() const {
-    return parameter_count() + num_stack_locals_;
+    return parameter_count() + num_stack_locals();
   }
   intptr_t num_stack_locals() const {
-    return num_stack_locals_;
+    return parsed_function().num_stack_locals();
   }
   intptr_t num_copied_params() const {
     return num_copied_params_;
@@ -110,6 +110,9 @@
   intptr_t num_non_copied_params() const {
     return num_non_copied_params_;
   }
+  bool IsIrregexpFunction() const {
+    return parsed_function().function().IsIrregexpFunction();
+  }
 
   LocalVariable* CurrentContextVar() const {
     return parsed_function().current_context_var();
@@ -339,7 +342,6 @@
   ParsedFunction& parsed_function_;
   const intptr_t num_copied_params_;
   const intptr_t num_non_copied_params_;
-  const intptr_t num_stack_locals_;
   GraphEntryInstr* graph_entry_;
   GrowableArray<BlockEntryInstr*> preorder_;
   GrowableArray<BlockEntryInstr*> postorder_;
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 8ed3f1d..6d99ae4 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -3296,6 +3296,23 @@
         load->set_recognized_kind(kind);
         return ReturnDefinition(load);
       }
+      case MethodRecognizer::kBigint_setDigits: {
+        Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+        LocalVariable* value_var =
+            node->scope()->LookupVariable(Symbols::Value(), true);
+        ASSERT(value_var != NULL);
+        Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+        StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+            Bigint::digits_offset(),
+            receiver,
+            value,
+            kEmitStoreBarrier,
+            node->token_pos());
+        Do(store);
+        ConstantInstr* null_const = new(I) ConstantInstr(
+            Object::ZoneHandle(I, Object::null()));
+        return ReturnDefinition(null_const);
+      }
       case MethodRecognizer::kBigint_getUsed: {
         Value* receiver = Bind(BuildLoadThisVar(node->scope()));
         LoadFieldInstr* load = new(I) LoadFieldInstr(
@@ -3307,6 +3324,23 @@
         load->set_recognized_kind(kind);
         return ReturnDefinition(load);
       }
+      case MethodRecognizer::kBigint_setUsed: {
+        Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+        LocalVariable* value_var =
+            node->scope()->LookupVariable(Symbols::Value(), true);
+        ASSERT(value_var != NULL);
+        Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+        StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+            Bigint::used_offset(),
+            receiver,
+            value,
+            kNoStoreBarrier,
+            node->token_pos());
+        Do(store);
+        ConstantInstr* null_const = new(I) ConstantInstr(
+            Object::ZoneHandle(I, Object::null()));
+        return ReturnDefinition(null_const);
+      }
       case MethodRecognizer::kBigint_getNeg: {
         Value* receiver = Bind(BuildLoadThisVar(node->scope()));
         LoadFieldInstr* load = new(I) LoadFieldInstr(
@@ -3318,6 +3352,23 @@
         load->set_recognized_kind(kind);
         return ReturnDefinition(load);
       }
+      case MethodRecognizer::kBigint_setNeg: {
+        Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+        LocalVariable* value_var =
+            node->scope()->LookupVariable(Symbols::Value(), true);
+        ASSERT(value_var != NULL);
+        Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+        StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+            Bigint::neg_offset(),
+            receiver,
+            value,
+            kEmitStoreBarrier,
+            node->token_pos());
+        Do(store);
+        ConstantInstr* null_const = new(I) ConstantInstr(
+            Object::ZoneHandle(I, Object::null()));
+        return ReturnDefinition(null_const);
+      }
       default:
         break;
     }
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 5bb8e09..1a7854f 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -19,6 +19,7 @@
 #include "vm/longjump.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
+#include "vm/raw_object.h"
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
 #include "vm/symbols.h"
@@ -228,7 +229,8 @@
   return !block->IsCatchBlockEntry() &&
          !block->HasNonRedundantParallelMove() &&
          block->next()->IsGoto() &&
-         !block->next()->AsGoto()->HasNonRedundantParallelMove();
+         !block->next()->AsGoto()->HasNonRedundantParallelMove() &&
+         !block->IsIndirectEntry();
 }
 
 
@@ -355,6 +357,7 @@
 
     LoopInfoComment(assembler(), *entry, *loop_headers);
 
+    entry->set_offset(assembler()->CodeSize());
     entry->EmitNativeCode(this);
     // Compile all successors until an exit, branch, or a block entry.
     for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
@@ -827,9 +830,22 @@
 
 
 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) {
-  const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(
-          parsed_function_.node_sequence()->scope()->GetVarDescriptors(
-              parsed_function_.function()));
+  LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle();
+  if (parsed_function().node_sequence() == NULL) {
+    ASSERT(flow_graph().IsIrregexpFunction());
+    var_descs = LocalVarDescriptors::New(1);
+    RawLocalVarDescriptors::VarInfo info;
+    info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
+    info.scope_id = 0;
+    info.begin_pos = 0;
+    info.end_pos = 0;
+    info.set_index(parsed_function().current_context_var()->index());
+    var_descs.SetVar(0, Symbols::CurrentContextVar(), &info);
+  } else {
+    var_descs =
+        parsed_function_.node_sequence()->scope()->GetVarDescriptors(
+            parsed_function_.function());
+  }
   code.set_var_descriptors(var_descs);
 }
 
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 0cb7dc4..58f312b 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -384,6 +384,10 @@
 
   void EmitEdgeCounter();
 
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+  static int32_t EdgeCounterIncrementSizeInBytes();
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64
+
   void EmitOptimizedInstanceCall(ExternalLabel* target_label,
                                  const ICData& ic_data,
                                  intptr_t argument_count,
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index c6993f1..2bb3011 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -76,6 +76,7 @@
                                                  DeoptInfoBuilder* builder,
                                                  const Array& deopt_table) {
   if (deopt_env_ == NULL) {
+    ++builder->current_info_number_;
     return DeoptInfo::null();
   }
 
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index efe6b32..6bf0070 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -73,6 +73,7 @@
                                                  DeoptInfoBuilder* builder,
                                                  const Array& deopt_table) {
   if (deopt_env_ == NULL) {
+    ++builder->current_info_number_;
     return DeoptInfo::null();
   }
 
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 5463ed7..fbc513a 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -21,6 +21,7 @@
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
 #include "vm/symbols.h"
+#include "vm/verified_memory.h"
 
 namespace dart {
 
@@ -76,6 +77,7 @@
                                                  DeoptInfoBuilder* builder,
                                                  const Array& deopt_table) {
   if (deopt_env_ == NULL) {
+    ++builder->current_info_number_;
     return DeoptInfo::null();
   }
 
@@ -1233,8 +1235,15 @@
   intptr_t increment_start = assembler_->CodeSize();
 #endif  // DEBUG
   __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(0)), 1);
+  // If the assertion below fails, update EdgeCounterIncrementSizeInBytes.
   DEBUG_ASSERT((assembler_->CodeSize() - increment_start) ==
-               CodePatcher::EdgeCounterIncrementSizeInBytes());
+               EdgeCounterIncrementSizeInBytes());
+}
+
+
+int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
+  // Used by CodePatcher; so must be constant across all code in an isolate.
+  return VerifiedMemory::enabled() ? 50 : 4;
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index ab5fe5f..7061dc6 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -72,6 +72,7 @@
                                                  DeoptInfoBuilder* builder,
                                                  const Array& deopt_table) {
   if (deopt_env_ == NULL) {
+    ++builder->current_info_number_;
     return DeoptInfo::null();
   }
 
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index a7b1e2d..aff288c 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -18,6 +18,7 @@
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
 #include "vm/symbols.h"
+#include "vm/verified_memory.h"
 
 namespace dart {
 
@@ -76,6 +77,7 @@
                                                  DeoptInfoBuilder* builder,
                                                  const Array& deopt_table) {
   if (deopt_env_ == NULL) {
+    ++builder->current_info_number_;
     return DeoptInfo::null();
   }
 
@@ -1265,8 +1267,26 @@
   counter.SetAt(0, Smi::Handle(Smi::New(0)));
   __ Comment("Edge counter");
   __ LoadObject(RAX, counter, PP);
-  __ AddImmediate(FieldAddress(RAX, Array::element_offset(0)),
-                  Immediate(Smi::RawValue(1)), PP);
+#if defined(DEBUG)
+  intptr_t increment_start = assembler_->CodeSize();
+#endif  // DEBUG
+  __ IncrementSmiField(FieldAddress(RAX, Array::element_offset(0)), 1);
+#if defined(DEBUG)
+  // If the assertion below fails, update EdgeCounterIncrementSizeInBytes.
+  intptr_t expected = EdgeCounterIncrementSizeInBytes();
+  intptr_t actual = assembler_->CodeSize() - increment_start;
+  if (actual != expected) {
+    FATAL2("Edge counter increment length: %" Pd ", expected %" Pd "\n",
+           actual,
+           expected);
+  }
+#endif  // DEBUG
+}
+
+
+int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
+  // Used by CodePatcher; so must be constant across all code in an isolate.
+  return VerifiedMemory::enabled() ? 73 : 5;
 }
 
 
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 1a2cea8..1734ee1 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -28,7 +28,7 @@
 // Flags for inlining heuristics.
 DEFINE_FLAG(int, inline_getters_setters_smaller_than, 10,
     "Always inline getters and setters that have fewer instructions");
-DEFINE_FLAG(int, inlining_depth_threshold, 5,
+DEFINE_FLAG(int, inlining_depth_threshold, 6,
     "Inline function calls up to threshold nesting depth");
 DEFINE_FLAG(int, inlining_size_threshold, 25,
     "Always inline functions that have threshold or fewer instructions");
@@ -47,10 +47,13 @@
 DEFINE_FLAG(int, inlining_hotness, 10,
     "Inline only hotter calls, in percents (0 .. 100); "
     "default 10%: calls above-equal 10% of max-count are inlined.");
-DEFINE_FLAG(bool, inline_recursive, false, "Inline recursive calls.");
+DEFINE_FLAG(int, inlining_recursion_depth_threshold, 1,
+    "Inline recursive function calls up to threshold recursion depth.");
 DEFINE_FLAG(int, max_inlined_per_depth, 500,
     "Max. number of inlined calls per depth");
 DEFINE_FLAG(bool, print_inlining_tree, false, "Print inlining tree");
+DEFINE_FLAG(bool, enable_inlining_annotations, false,
+            "Enable inlining annotations");
 
 DECLARE_FLAG(bool, compiler_stats);
 DECLARE_FLAG(bool, enable_type_checks);
@@ -448,6 +451,25 @@
 };
 
 
+static bool HasAnnotation(const Function& function, const char* annotation) {
+  const Class& owner = Class::Handle(function.Owner());
+  const Library& library = Library::Handle(owner.library());
+  const Array& metadata =
+      Array::Cast(Object::Handle(library.GetMetadata(function)));
+
+  if (metadata.Length() > 0) {
+    Object& val = Object::Handle();
+    for (intptr_t i = 0; i < metadata.Length(); i++) {
+      val = metadata.At(i);
+      if (val.IsString() && String::Cast(val).Equals(annotation)) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+
 class CallSiteInliner : public ValueObject {
  public:
   explicit CallSiteInliner(FlowGraph* flow_graph)
@@ -455,7 +477,9 @@
         inlined_(false),
         initial_size_(flow_graph->InstructionCount()),
         inlined_size_(0),
+        inlined_recursive_call_(false),
         inlining_depth_(1),
+        inlining_recursion_depth_(0),
         collected_call_sites_(NULL),
         inlining_call_sites_(NULL),
         function_cache_(),
@@ -530,8 +554,12 @@
       InlineInstanceCalls();
       InlineStaticCalls();
       InlineClosureCalls();
-      // Increment the inlining depth. Checked before recursive inlining.
+      // Increment the inlining depths. Checked before subsequent inlining.
       ++inlining_depth_;
+      if (inlined_recursive_call_) {
+        ++inlining_recursion_depth_;
+        inlined_recursive_call_ = false;
+      }
     }
     collected_call_sites_ = NULL;
     inlining_call_sites_ = NULL;
@@ -593,6 +621,13 @@
       return false;
     }
 
+    const char* kNeverInlineAnnotation = "NeverInline";
+    if (FLAG_enable_inlining_annotations &&
+        HasAnnotation(function, kNeverInlineAnnotation)) {
+      TRACE_INLINING(OS::Print("     Bailout: NeverInline annotation\n"));
+      return false;
+    }
+
     GrowableArray<Value*>* arguments = call_data->arguments;
     const intptr_t constant_arguments = CountConstants(*arguments);
     if (!ShouldWeInline(function,
@@ -613,8 +648,10 @@
 
     // Abort if this is a recursive occurrence.
     Definition* call = call_data->call;
-    if (!FLAG_inline_recursive && IsCallRecursive(unoptimized_code, call)) {
-      function.set_is_inlinable(false);
+    // Added 'volatile' works around a possible GCC 4.9 compiler bug.
+    volatile bool is_recursive_call = IsCallRecursive(unoptimized_code, call);
+    if (is_recursive_call &&
+        inlining_recursion_depth_ >= FLAG_inlining_recursion_depth_threshold) {
       TRACE_INLINING(OS::Print("     Bailout: recursive function\n"));
       PRINT_INLINING_TREE("Recursive function",
           &call_data->caller, &function, call_data->call);
@@ -763,20 +800,12 @@
             &call_data->caller, &function, call_data->call);
         return false;
       }
-      if (function.IsInvokeFieldDispatcher() ||
-          function.IsNoSuchMethodDispatcher()) {
-        // Append call sites to the currently processed list so that dispatcher
-        // methods get inlined regardless of the current depth.
-        // Need a throttling mechanism for recursive inlining.
-        ASSERT(!FLAG_inline_recursive);
-        inlining_call_sites_->FindCallSites(callee_graph,
-                                            0,
-                                            &inlined_info_);
-      } else {
-        collected_call_sites_->FindCallSites(callee_graph,
-                                             inlining_depth_,
-                                             &inlined_info_);
-      }
+
+      // Inline dispatcher methods regardless of the current depth.
+      intptr_t depth =
+          (function.IsInvokeFieldDispatcher() ||
+           function.IsNoSuchMethodDispatcher()) ? 0 : inlining_depth_;
+      collected_call_sites_->FindCallSites(callee_graph, depth, &inlined_info_);
 
       // Add the function to the cache.
       if (!in_cache) {
@@ -786,6 +815,9 @@
       // Build succeeded so we restore the bailout jump.
       inlined_ = true;
       inlined_size_ += size;
+      if (is_recursive_call) {
+        inlined_recursive_call_ = true;
+      }
       isolate()->set_deopt_id(prev_deopt_id);
 
       call_data->callee_graph = callee_graph;
@@ -1193,7 +1225,9 @@
   bool inlined_;
   const intptr_t initial_size_;
   intptr_t inlined_size_;
+  bool inlined_recursive_call_;
   intptr_t inlining_depth_;
+  intptr_t inlining_recursion_depth_;
   CallSites* collected_call_sites_;
   CallSites* inlining_call_sites_;
   GrowableArray<ParsedFunction*> function_cache_;
@@ -1685,6 +1719,14 @@
 
 
 bool FlowGraphInliner::AlwaysInline(const Function& function) {
+  const char* kAlwaysInlineAnnotation = "AlwaysInline";
+  if (FLAG_enable_inlining_annotations &&
+      HasAnnotation(function, kAlwaysInlineAnnotation)) {
+    TRACE_INLINING(OS::Print("AlwaysInline annotation for %s\n",
+                             function.ToCString()));
+    return true;
+  }
+
   if (function.IsImplicitGetterFunction() || function.IsGetterFunction() ||
       function.IsImplicitSetterFunction() || function.IsSetterFunction()) {
     const intptr_t count = function.optimized_instruction_count();
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 13995c9..2ed1b29 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -589,7 +589,14 @@
     BlockEntryInstr* entry = block_order_[i];
     for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
       Instruction* current = it.Current();
+      if (current->HasUnmatchedInputRepresentations()) {
+        // Can't canonicalize this instruction until all conversions for its
+        // inputs are inserted.
+        continue;
+      }
+
       Instruction* replacement = current->Canonicalize(flow_graph());
+
       if (replacement != current) {
         // For non-definitions Canonicalize should return either NULL or
         // this.
@@ -2963,57 +2970,6 @@
     return true;
   }
 
-  if ((recognized_kind == MethodRecognizer::kBigint_setUsed) &&
-      (ic_data.NumberOfChecks() == 1) &&
-      (class_ids[0] == kBigintCid)) {
-    // This is an internal method, no need to check argument types nor
-    // range.
-    Definition* bigint = call->ArgumentAt(0);
-    Definition* value = call->ArgumentAt(1);
-    StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
-        Bigint::used_offset(),
-        new(I) Value(bigint),
-        new(I) Value(value),
-        kNoStoreBarrier,
-        call->token_pos());
-    ReplaceCall(call, store);
-    return true;
-  }
-
-  if ((recognized_kind == MethodRecognizer::kBigint_setDigits) &&
-      (ic_data.NumberOfChecks() == 1) &&
-      (class_ids[0] == kBigintCid)) {
-    // This is an internal method, no need to check argument types nor
-    // range.
-    Definition* bigint = call->ArgumentAt(0);
-    Definition* value = call->ArgumentAt(1);
-    StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
-        Bigint::digits_offset(),
-        new(I) Value(bigint),
-        new(I) Value(value),
-        kEmitStoreBarrier,
-        call->token_pos());
-    ReplaceCall(call, store);
-    return true;
-  }
-
-  if ((recognized_kind == MethodRecognizer::kBigint_setNeg) &&
-      (ic_data.NumberOfChecks() == 1) &&
-      (class_ids[0] == kBigintCid)) {
-    // This is an internal method, no need to check argument types nor
-    // range.
-    Definition* bigint = call->ArgumentAt(0);
-    Definition* value = call->ArgumentAt(1);
-    StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
-        Bigint::neg_offset(),
-        new(I) Value(bigint),
-        new(I) Value(value),
-        kEmitStoreBarrier,
-        call->token_pos());
-    ReplaceCall(call, store);
-    return true;
-  }
-
   if (((recognized_kind == MethodRecognizer::kStringBaseCodeUnitAt) ||
        (recognized_kind == MethodRecognizer::kStringBaseCharAt)) &&
       (ic_data.NumberOfChecks() == 1) &&
@@ -4611,6 +4567,15 @@
 }
 
 
+void FlowGraphOptimizer::VisitLoadCodeUnits(LoadCodeUnitsInstr* instr) {
+  // TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
+  if (!instr->can_pack_into_smi())
+    instr->set_representation(kUnboxedMint);
+#endif
+}
+
+
 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
                                                  const ICData& unary_ic_data) {
   ASSERT((unary_ic_data.NumberOfChecks() > 0) &&
@@ -5487,10 +5452,10 @@
   static Place* Wrap(Isolate* isolate, const Place& place, intptr_t id);
 
   static bool IsAllocation(Definition* defn) {
-    // TODO(vegorov): add CreateContext to this list.
     return (defn != NULL) &&
         (defn->IsAllocateObject() ||
          defn->IsCreateArray() ||
+         defn->IsAllocateUninitializedContext() ||
          (defn->IsStaticCall() &&
           defn->AsStaticCall()->IsRecognizedFactory()));
   }
@@ -5609,9 +5574,11 @@
 class AliasedSet : public ZoneAllocated {
  public:
   AliasedSet(Isolate* isolate,
+             DirectChainedHashMap<PointerKeyValueTrait<Place> >* places_map,
              ZoneGrowableArray<Place*>* places,
              PhiPlaceMoves* phi_moves)
       : isolate_(isolate),
+        places_map_(places_map),
         places_(*places),
         phi_moves_(phi_moves),
         aliases_(5),
@@ -5632,38 +5599,6 @@
     return (result != NULL) ? result->id() : static_cast<intptr_t>(kNoAlias);
   }
 
-  bool IsStore(Instruction* instr, BitVector** killed) {
-    bool is_load = false, is_store = false;
-    Place place(instr, &is_load, &is_store);
-    if (is_store && (place.kind() != Place::kNone)) {
-      const intptr_t alias_id = LookupAliasId(place.ToAlias());
-      if (alias_id != kNoAlias) {
-        *killed = GetKilledSet(alias_id);
-      } else if (!place.IsFinalField()) {
-        // We encountered unknown alias: this means intrablock load forwarding
-        // refined parameter of this store, for example
-        //
-        //     o   <- alloc()
-        //     a.f <- o
-        //     u   <- a.f
-        //     u.x <- null ;; this store alias is *.x
-        //
-        // after intrablock load forwarding
-        //
-        //     o   <- alloc()
-        //     a.f <- o
-        //     o.x <- null ;; this store alias is o.x
-        //
-        // In this case we fallback to using place id recorded in the
-        // instruction that still points to the old place with a more generic
-        // alias.
-        *killed = GetKilledSet(
-            LookupAliasId(places_[instr->place_id()]->ToAlias()));
-      }
-    }
-    return is_store;
-  }
-
   BitVector* GetKilledSet(intptr_t alias) {
     return (alias < killed_.length()) ? killed_[alias] : NULL;
   }
@@ -5677,6 +5612,10 @@
     return places_;
   }
 
+  Place* LookupCanonical(Place* place) const {
+    return places_map_->Lookup(place);
+  }
+
   void PrintSet(BitVector* set) {
     bool comma = false;
     for (BitVector::Iterator it(set);
@@ -5712,10 +5651,12 @@
     return !alloc->Identity().IsNotAliased();
   }
 
+  enum {
+    kNoAlias = 0
+  };
+
  private:
   enum {
-    kNoAlias = 0,
-
     // Artificial alias that is used to collect all representatives of the
     // *[C], X[C] aliases for arbitrary C.
     kAnyConstantIndexedAlias = 1,
@@ -5924,13 +5865,18 @@
   bool HasLoadsFromPlace(Definition* defn, const Place* place) {
     ASSERT((place->kind() == Place::kField) ||
            (place->kind() == Place::kVMField));
-    ASSERT(place->instance() == defn);
 
     for (Value* use = defn->input_use_list();
          use != NULL;
          use = use->next_use()) {
+      Instruction* instr = use->instruction();
+      if ((instr->IsRedefinition() ||
+           instr->IsAssertAssignable()) &&
+          HasLoadsFromPlace(instr->AsDefinition(), place)) {
+        return true;
+      }
       bool is_load = false, is_store;
-      Place load_place(use->instruction(), &is_load, &is_store);
+      Place load_place(instr, &is_load, &is_store);
 
       if (is_load && load_place.Equals(place)) {
         return true;
@@ -5951,9 +5897,10 @@
           (instr->IsStoreIndexed()
            && (use->use_index() == StoreIndexedInstr::kValuePos)) ||
           instr->IsStoreStaticField() ||
-          instr->IsPhi() ||
-          instr->IsAssertAssignable() ||
-          instr->IsRedefinition()) {
+          instr->IsPhi()) {
+        return true;
+      } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) &&
+                 AnyUseCreatesAlias(instr->AsDefinition())) {
         return true;
       } else if ((instr->IsStoreInstanceField()
            && (use->use_index() != StoreInstanceFieldInstr::kInstancePos))) {
@@ -5961,8 +5908,10 @@
         // If we store this value into an object that is not aliased itself
         // and we never load again then the store does not create an alias.
         StoreInstanceFieldInstr* store = instr->AsStoreInstanceField();
-        Definition* instance = store->instance()->definition();
-        if (instance->IsAllocateObject() && !instance->Identity().IsAliased()) {
+        Definition* instance =
+            store->instance()->definition()->OriginalDefinition();
+        if (Place::IsAllocation(instance) &&
+            !instance->Identity().IsAliased()) {
           bool is_load, is_store;
           Place store_place(instr, &is_load, &is_store);
 
@@ -5977,7 +5926,6 @@
             continue;
           }
         }
-
         return true;
       }
     }
@@ -5986,19 +5934,20 @@
 
   // Mark any value stored into the given object as potentially aliased.
   void MarkStoredValuesEscaping(Definition* defn) {
-    if (!defn->IsAllocateObject()) {
-      return;
-    }
-
     // Find all stores into this object.
     for (Value* use = defn->input_use_list();
          use != NULL;
          use = use->next_use()) {
+      if (use->instruction()->IsRedefinition() ||
+          use->instruction()->IsAssertAssignable()) {
+        MarkStoredValuesEscaping(use->instruction()->AsDefinition());
+        continue;
+      }
       if ((use->use_index() == StoreInstanceFieldInstr::kInstancePos) &&
           use->instruction()->IsStoreInstanceField()) {
         StoreInstanceFieldInstr* store =
             use->instruction()->AsStoreInstanceField();
-        Definition* value = store->value()->definition();
+        Definition* value = store->value()->definition()->OriginalDefinition();
         if (value->Identity().IsNotAliased()) {
           value->SetIdentity(AliasIdentity::Aliased());
           identity_rollback_.Add(value);
@@ -6012,6 +5961,7 @@
 
   // Determine if the given definition can't be aliased.
   void ComputeAliasing(Definition* alloc) {
+    ASSERT(Place::IsAllocation(alloc));
     ASSERT(alloc->Identity().IsUnknown());
     ASSERT(aliasing_worklist_.is_empty());
 
@@ -6020,7 +5970,7 @@
 
     while (!aliasing_worklist_.is_empty()) {
       Definition* defn = aliasing_worklist_.RemoveLast();
-
+      ASSERT(Place::IsAllocation(defn));
       // If the definition in the worklist was optimistically marked as
       // not-aliased check that optimistic assumption still holds: check if
       // any of its uses can create an alias.
@@ -6039,6 +5989,8 @@
 
   Isolate* isolate_;
 
+  DirectChainedHashMap<PointerKeyValueTrait<Place> >* places_map_;
+
   const ZoneGrowableArray<Place*>& places_;
 
   const PhiPlaceMoves* phi_moves_;
@@ -6208,17 +6160,14 @@
   PhiPlaceMoves* phi_moves = ComputePhiMoves(map, places);
 
   // Build aliasing sets mapping aliases to loads.
-  return new(isolate) AliasedSet(isolate, places, phi_moves);
+  return new(isolate) AliasedSet(isolate, map, places, phi_moves);
 }
 
 
 class LoadOptimizer : public ValueObject {
  public:
-  LoadOptimizer(FlowGraph* graph,
-                AliasedSet* aliased_set,
-                DirectChainedHashMap<PointerKeyValueTrait<Place> >* map)
+  LoadOptimizer(FlowGraph* graph, AliasedSet* aliased_set)
       : graph_(graph),
-        map_(map),
         aliased_set_(aliased_set),
         in_(graph_->preorder().length()),
         out_(graph_->preorder().length()),
@@ -6264,7 +6213,7 @@
       // as loads from loaded context.
       // TODO(vegorov): renumber newly discovered congruences during the
       // forwarding to forward chains without running whole pass twice.
-      LoadOptimizer load_optimizer(graph, aliased_set, &map);
+      LoadOptimizer load_optimizer(graph, aliased_set);
       return load_optimizer.Optimize();
     }
     return false;
@@ -6312,8 +6261,38 @@
            instr_it.Advance()) {
         Instruction* instr = instr_it.Current();
 
+        bool is_load = false, is_store = false;
+        Place place(instr, &is_load, &is_store);
+
         BitVector* killed = NULL;
-        if (aliased_set_->IsStore(instr, &killed)) {
+        if (is_store) {
+          const intptr_t alias_id =
+              aliased_set_->LookupAliasId(place.ToAlias());
+          if (alias_id != AliasedSet::kNoAlias) {
+            killed = aliased_set_->GetKilledSet(alias_id);
+          } else if (!place.IsFinalField()) {
+            // We encountered unknown alias: this means intrablock load
+            // forwarding refined parameter of this store, for example
+            //
+            //     o   <- alloc()
+            //     a.f <- o
+            //     u   <- a.f
+            //     u.x <- null ;; this store alias is *.x
+            //
+            // after intrablock load forwarding
+            //
+            //     o   <- alloc()
+            //     a.f <- o
+            //     o.x <- null ;; this store alias is o.x
+            //
+            // In this case we fallback to using place id recorded in the
+            // instruction that still points to the old place with a more
+            // generic alias.
+            const intptr_t old_alias_id = aliased_set_->LookupAliasId(
+                aliased_set_->places()[instr->place_id()]->ToAlias());
+            killed = aliased_set_->GetKilledSet(old_alias_id);
+          }
+
           if (killed != NULL) {
             kill->AddAll(killed);
             // There is no need to clear out_values when clearing GEN set
@@ -6331,22 +6310,27 @@
               (array_store->class_id() == kTypedDataFloat64ArrayCid) ||
               (array_store->class_id() == kTypedDataFloat32ArrayCid) ||
               (array_store->class_id() == kTypedDataFloat32x4ArrayCid)) {
-            bool is_load = false, is_store = false;
-            Place store_place(instr, &is_load, &is_store);
-            ASSERT(!is_load && is_store);
-            Place* place = map_->Lookup(&store_place);
-            if (place != NULL) {
+            Place* canonical_place = aliased_set_->LookupCanonical(&place);
+            if (canonical_place != NULL) {
               // Store has a corresponding numbered place that might have a
               // load. Try forwarding stored value to it.
-              gen->Add(place->id());
+              gen->Add(canonical_place->id());
               if (out_values == NULL) out_values = CreateBlockOutValues();
-              (*out_values)[place->id()] = GetStoredValue(instr);
+              (*out_values)[canonical_place->id()] = GetStoredValue(instr);
             }
           }
 
           ASSERT(!instr->IsDefinition() ||
                  !IsLoadEliminationCandidate(instr->AsDefinition()));
           continue;
+        } else if (is_load) {
+          // Check if this load needs renumbering because of the intrablock
+          // load forwarding.
+          const Place* canonical = aliased_set_->LookupCanonical(&place);
+          if ((canonical != NULL) &&
+            (canonical->id() != instr->AsDefinition()->place_id())) {
+            instr->AsDefinition()->set_place_id(canonical->id());
+          }
         }
 
         // If instruction has effects then kill all loads affected.
@@ -7509,10 +7493,10 @@
       non_constant_(Object::non_constant()),
       reachable_(new(graph->isolate()) BitVector(
           graph->isolate(), graph->preorder().length())),
-      definition_marks_(new(graph->isolate()) BitVector(
+      marked_phis_(new(graph->isolate()) BitVector(
           graph->isolate(), graph->max_virtual_register_number())),
       block_worklist_(),
-      definition_worklist_() {}
+      definition_worklist_(graph, 10) {}
 
 
 void ConstantPropagator::Optimize(FlowGraph* graph) {
@@ -7540,7 +7524,7 @@
 }
 
 
-void ConstantPropagator::SetValue(Definition* definition, const Object& value) {
+bool ConstantPropagator::SetValue(Definition* definition, const Object& value) {
   // We would like to assert we only go up (toward non-constant) in the lattice.
   //
   // ASSERT(IsUnknown(definition->constant_value()) ||
@@ -7552,13 +7536,11 @@
   if (definition->constant_value().raw() != value.raw()) {
     definition->constant_value() = value.raw();
     if (definition->input_use_list() != NULL) {
-      ASSERT(definition->HasSSATemp());
-      if (!definition_marks_->Contains(definition->ssa_temp_index())) {
-        definition_worklist_.Add(definition);
-        definition_marks_->Add(definition->ssa_temp_index());
-      }
+      definition_worklist_.Add(definition);
     }
+    return true;
   }
+  return false;
 }
 
 
@@ -7617,6 +7599,13 @@
 }
 
 
+void ConstantPropagator::VisitIndirectEntry(IndirectEntryInstr* block) {
+  for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
+    it.Current()->Accept(this);
+  }
+}
+
+
 void ConstantPropagator::VisitCatchBlockEntry(CatchBlockEntryInstr* block) {
   const GrowableArray<Definition*>& defs = *block->initial_definitions();
   for (intptr_t i = 0; i < defs.length(); ++i) {
@@ -7664,6 +7653,13 @@
 }
 
 
+void ConstantPropagator::VisitIndirectGoto(IndirectGotoInstr* instr) {
+  for (intptr_t i = 0; i < instr->SuccessorCount(); i++) {
+    SetReachable(instr->SuccessorAt(i));
+  }
+}
+
+
 void ConstantPropagator::VisitBranch(BranchInstr* instr) {
   instr->comparison()->Accept(this);
 
@@ -7724,6 +7720,34 @@
 }
 
 
+Definition* ConstantPropagator::UnwrapPhi(Definition* defn) {
+  if (defn->IsPhi()) {
+    JoinEntryInstr* block = defn->AsPhi()->block();
+
+    Definition* input = NULL;
+    for (intptr_t i = 0; i < defn->InputCount(); ++i) {
+      if (reachable_->Contains(block->PredecessorAt(i)->preorder_number())) {
+        if (input == NULL) {
+          input = defn->InputAt(i)->definition();
+        } else {
+          return defn;
+        }
+      }
+    }
+
+    return input;
+  }
+
+  return defn;
+}
+
+
+void ConstantPropagator::MarkPhi(Definition* phi) {
+  ASSERT(phi->IsPhi());
+  marked_phis_->Add(phi->ssa_temp_index());
+}
+
+
 // --------------------------------------------------------------------------
 // Analysis of definitions.  Compute the constant value.  If it has changed
 // and the definition has input uses, add the definition to the definition
@@ -7739,7 +7763,11 @@
            instr->InputAt(pred_idx)->definition()->constant_value());
     }
   }
-  SetValue(instr, value);
+  if (!SetValue(instr, value) &&
+      marked_phis_->Contains(instr->ssa_temp_index())) {
+    marked_phis_->Remove(instr->ssa_temp_index());
+    definition_worklist_.Add(instr);
+  }
 }
 
 
@@ -7855,15 +7883,25 @@
 
 
 void ConstantPropagator::VisitStrictCompare(StrictCompareInstr* instr) {
-  const Object& left = instr->left()->definition()->constant_value();
-  const Object& right = instr->right()->definition()->constant_value();
+  Definition* left_defn = instr->left()->definition();
+  Definition* right_defn = instr->right()->definition();
 
-  if (instr->left()->definition() == instr->right()->definition()) {
+  Definition* unwrapped_left_defn = UnwrapPhi(left_defn);
+  Definition* unwrapped_right_defn = UnwrapPhi(right_defn);
+  if (unwrapped_left_defn == unwrapped_right_defn) {
     // Fold x === x, and x !== x to true/false.
     SetValue(instr, Bool::Get(instr->kind() == Token::kEQ_STRICT));
+    if (unwrapped_left_defn != left_defn) {
+      MarkPhi(left_defn);
+    }
+    if (unwrapped_right_defn != right_defn) {
+      MarkPhi(right_defn);
+    }
     return;
   }
 
+  const Object& left = left_defn->constant_value();
+  const Object& right = right_defn->constant_value();
   if (IsNonConstant(left) || IsNonConstant(right)) {
     // TODO(vegorov): incorporate nullability information into the lattice.
     if ((left.IsNull() && instr->right()->Type()->HasDecidableNullability()) ||
@@ -7941,16 +7979,28 @@
 
 
 void ConstantPropagator::VisitEqualityCompare(EqualityCompareInstr* instr) {
-  const Object& left = instr->left()->definition()->constant_value();
-  const Object& right = instr->right()->definition()->constant_value();
+  Definition* left_defn = instr->left()->definition();
+  Definition* right_defn = instr->right()->definition();
 
-  if (instr->left()->definition() == instr->right()->definition()) {
+  if (RawObject::IsIntegerClassId(instr->operation_cid())) {
     // Fold x == x, and x != x to true/false for numbers comparisons.
-    if (RawObject::IsIntegerClassId(instr->operation_cid())) {
-      return SetValue(instr, Bool::Get(instr->kind() == Token::kEQ));
+    Definition* unwrapped_left_defn = UnwrapPhi(left_defn);
+    Definition* unwrapped_right_defn = UnwrapPhi(right_defn);
+    if (unwrapped_left_defn == unwrapped_right_defn) {
+      // Fold x === x, and x !== x to true/false.
+      SetValue(instr, Bool::Get(instr->kind() == Token::kEQ));
+      if (unwrapped_left_defn != left_defn) {
+        MarkPhi(left_defn);
+      }
+      if (unwrapped_right_defn != right_defn) {
+        MarkPhi(right_defn);
+      }
+      return;
     }
   }
 
+  const Object& left = left_defn->constant_value();
+  const Object& right = right_defn->constant_value();
   if (IsNonConstant(left) || IsNonConstant(right)) {
     SetValue(instr, non_constant_);
   } else if (IsConstant(left) && IsConstant(right)) {
@@ -8072,6 +8122,12 @@
 }
 
 
+void ConstantPropagator::VisitLoadCodeUnits(LoadCodeUnitsInstr* instr) {
+  // TODO(zerny): Implement constant propagation.
+  SetValue(instr, non_constant_);
+}
+
+
 void ConstantPropagator::VisitStoreIndexed(StoreIndexedInstr* instr) {
   SetValue(instr, instr->value()->definition()->constant_value());
 }
@@ -8714,6 +8770,12 @@
 }
 
 
+void ConstantPropagator::VisitCaseInsensitiveCompareUC16(
+    CaseInsensitiveCompareUC16Instr *instr) {
+  SetValue(instr, non_constant_);
+}
+
+
 void ConstantPropagator::VisitUnbox(UnboxInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsNonConstant(value)) {
@@ -8779,9 +8841,8 @@
 
   while (true) {
     if (block_worklist_.is_empty()) {
-      if (definition_worklist_.is_empty()) break;
+      if (definition_worklist_.IsEmpty()) break;
       Definition* definition = definition_worklist_.RemoveLast();
-      definition_marks_->Remove(definition->ssa_temp_index());
       Value* use = definition->input_use_list();
       while (use != NULL) {
         use->instruction()->Accept(this);
@@ -8797,7 +8858,8 @@
 
 static bool IsEmptyBlock(BlockEntryInstr* block) {
   return block->next()->IsGoto() &&
-      (!block->IsJoinEntry() || (block->AsJoinEntry()->phis() == NULL));
+      (!block->IsJoinEntry() || (block->AsJoinEntry()->phis() == NULL)) &&
+      !block->IsIndirectEntry();
 }
 
 
@@ -9442,7 +9504,7 @@
 // deoptimization exit. So candidate should only be used in StoreInstanceField
 // instructions that write into fields of the allocated object.
 // We do not support materialization of the object that has type arguments.
-static bool IsAllocationSinkingCandidate(AllocateObjectInstr* alloc,
+static bool IsAllocationSinkingCandidate(Definition* alloc,
                                          SafeUseCheck check_type) {
   for (Value* use = alloc->input_use_list();
        use != NULL;
@@ -9475,7 +9537,7 @@
 
 // Remove the given allocation from the graph. It is not observable.
 // If deoptimization occurs the object will be materialized.
-void AllocationSinking::EliminateAllocation(AllocateObjectInstr* alloc) {
+void AllocationSinking::EliminateAllocation(Definition* alloc) {
   ASSERT(IsAllocationSinkingCandidate(alloc, kStrictCheck));
 
   if (FLAG_trace_optimization) {
@@ -9521,11 +9583,20 @@
        block_it.Advance()) {
     BlockEntryInstr* block = block_it.Current();
     for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
-      AllocateObjectInstr* alloc = it.Current()->AsAllocateObject();
-      if ((alloc != NULL) &&
-          IsAllocationSinkingCandidate(alloc, kOptimisticCheck)) {
-        alloc->SetIdentity(AliasIdentity::AllocationSinkingCandidate());
-        candidates_.Add(alloc);
+      { AllocateObjectInstr* alloc = it.Current()->AsAllocateObject();
+        if ((alloc != NULL) &&
+            IsAllocationSinkingCandidate(alloc, kOptimisticCheck)) {
+          alloc->SetIdentity(AliasIdentity::AllocationSinkingCandidate());
+          candidates_.Add(alloc);
+        }
+      }
+      { AllocateUninitializedContextInstr* alloc =
+            it.Current()->AsAllocateUninitializedContext();
+        if ((alloc != NULL) &&
+            IsAllocationSinkingCandidate(alloc, kOptimisticCheck)) {
+          alloc->SetIdentity(AliasIdentity::AllocationSinkingCandidate());
+          candidates_.Add(alloc);
+        }
       }
     }
   }
@@ -9535,7 +9606,7 @@
   do {
     changed = false;
     for (intptr_t i = 0; i < candidates_.length(); i++) {
-      AllocateObjectInstr* alloc = candidates_[i];
+      Definition* alloc = candidates_[i];
       if (alloc->Identity().IsAllocationSinkingCandidate()) {
         if (!IsAllocationSinkingCandidate(alloc, kStrictCheck)) {
           alloc->SetIdentity(AliasIdentity::Unknown());
@@ -9548,7 +9619,7 @@
   // Shrink the list of candidates removing all unmarked ones.
   intptr_t j = 0;
   for (intptr_t i = 0; i < candidates_.length(); i++) {
-    AllocateObjectInstr* alloc = candidates_[i];
+    Definition* alloc = candidates_[i];
     if (alloc->Identity().IsAllocationSinkingCandidate()) {
       if (FLAG_trace_optimization) {
         OS::Print("discovered allocation sinking candidate: v%" Pd "\n",
@@ -9630,7 +9701,7 @@
   do {
     changed = false;
     for (intptr_t i = 0; i < candidates_.length(); i++) {
-      AllocateObjectInstr* alloc = candidates_[i];
+      Definition* alloc = candidates_[i];
       if (alloc->Identity().IsAllocationSinkingCandidate()) {
         if (!IsAllocationSinkingCandidate(alloc, kStrictCheck)) {
           alloc->SetIdentity(AliasIdentity::Unknown());
@@ -9643,7 +9714,7 @@
   // Remove all failed candidates from the candidates list.
   intptr_t j = 0;
   for (intptr_t i = 0; i < candidates_.length(); i++) {
-    AllocateObjectInstr* alloc = candidates_[i];
+    Definition* alloc = candidates_[i];
     if (!alloc->Identity().IsAllocationSinkingCandidate()) {
       if (FLAG_trace_optimization) {
         OS::Print("allocation v%" Pd " can't be eliminated\n",
@@ -9827,8 +9898,7 @@
 // the given instruction that can deoptimize.
 void AllocationSinking::CreateMaterializationAt(
     Instruction* exit,
-    AllocateObjectInstr* alloc,
-    const Class& cls,
+    Definition* alloc,
     const ZoneGrowableArray<const Object*>& slots) {
   ZoneGrowableArray<Value*>* values =
       new(I) ZoneGrowableArray<Value*>(slots.length());
@@ -9856,8 +9926,16 @@
     values->Add(new(I) Value(load));
   }
 
-  MaterializeObjectInstr* mat =
-      new(I) MaterializeObjectInstr(alloc, cls, slots, values);
+  MaterializeObjectInstr* mat = NULL;
+  if (alloc->IsAllocateObject()) {
+    mat = new(I) MaterializeObjectInstr(
+        alloc->AsAllocateObject(), slots, values);
+  } else {
+    ASSERT(alloc->IsAllocateUninitializedContext());
+    mat = new(I) MaterializeObjectInstr(
+        alloc->AsAllocateUninitializedContext(), slots, values);
+  }
+
   flow_graph_->InsertBefore(exit, mat, NULL, FlowGraph::kValue);
 
   // Replace all mentions of this allocation with a newly inserted
@@ -9950,7 +10028,7 @@
 }
 
 
-void AllocationSinking::InsertMaterializations(AllocateObjectInstr* alloc) {
+void AllocationSinking::InsertMaterializations(Definition* alloc) {
   // Collect all fields that are written for this instance.
   ZoneGrowableArray<const Object*>* slots =
       new(I) ZoneGrowableArray<const Object*>(5);
@@ -9969,8 +10047,10 @@
   }
 
   if (alloc->ArgumentCount() > 0) {
-    ASSERT(alloc->ArgumentCount() == 1);
-    intptr_t type_args_offset = alloc->cls().type_arguments_field_offset();
+    AllocateObjectInstr* alloc_object = alloc->AsAllocateObject();
+    ASSERT(alloc_object->ArgumentCount() == 1);
+    intptr_t type_args_offset =
+        alloc_object->cls().type_arguments_field_offset();
     AddSlot(slots, Smi::ZoneHandle(I, Smi::New(type_args_offset)));
   }
 
@@ -9980,7 +10060,7 @@
   // Insert materializations at environment uses.
   for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
     CreateMaterializationAt(
-        exits_collector_.exits()[i], alloc, alloc->cls(), *slots);
+        exits_collector_.exits()[i], alloc, *slots);
   }
 }
 
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 3415b6d..b5ba79c 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -65,6 +65,7 @@
   virtual void VisitInstanceCall(InstanceCallInstr* instr);
   virtual void VisitStoreInstanceField(StoreInstanceFieldInstr* instr);
   virtual void VisitAllocateContext(AllocateContextInstr* instr);
+  virtual void VisitLoadCodeUnits(LoadCodeUnitsInstr* instr);
 
   void InsertBefore(Instruction* next,
                     Instruction* instr,
@@ -345,7 +346,10 @@
   void EliminateRedundantBranches();
 
   void SetReachable(BlockEntryInstr* block);
-  void SetValue(Definition* definition, const Object& value);
+  bool SetValue(Definition* definition, const Object& value);
+
+  Definition* UnwrapPhi(Definition* defn);
+  void MarkPhi(Definition* defn);
 
   // Assign the join (least upper bound) of a pair of abstract values to the
   // first one.
@@ -381,14 +385,11 @@
   // preorder number.
   BitVector* reachable_;
 
-  // Definitions can move up the lattice twice, so we use a mark bit to
-  // indicate that they are already on the worklist in order to avoid adding
-  // them again.  Indexed by SSA temp index.
-  BitVector* definition_marks_;
+  BitVector* marked_phis_;
 
   // Worklists of blocks and definitions.
   GrowableArray<BlockEntryInstr*> block_worklist_;
-  GrowableArray<Definition*> definition_worklist_;
+  DefinitionWorklist definition_worklist_;
 };
 
 
@@ -435,7 +436,7 @@
         candidates_(5),
         materializations_(5) { }
 
-  const GrowableArray<AllocateObjectInstr*>& candidates() const {
+  const GrowableArray<Definition*>& candidates() const {
     return candidates_;
   }
 
@@ -480,21 +481,20 @@
 
   void DiscoverFailedCandidates();
 
-  void InsertMaterializations(AllocateObjectInstr* alloc);
+  void InsertMaterializations(Definition* alloc);
 
   void CreateMaterializationAt(
       Instruction* exit,
-      AllocateObjectInstr* alloc,
-      const Class& cls,
+      Definition* alloc,
       const ZoneGrowableArray<const Object*>& fields);
 
-  void EliminateAllocation(AllocateObjectInstr* alloc);
+  void EliminateAllocation(Definition* alloc);
 
   Isolate* isolate() const { return flow_graph_->isolate(); }
 
   FlowGraph* flow_graph_;
 
-  GrowableArray<AllocateObjectInstr*> candidates_;
+  GrowableArray<Definition*> candidates_;
   GrowableArray<MaterializeObjectInstr*> materializations_;
 
   ExitsCollector exits_collector_;
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index 0f87533..98d3da5 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -2402,7 +2402,7 @@
 }
 
 
-bool Range::And(const Range* left_range,
+void Range::And(const Range* left_range,
                 const Range* right_range,
                 RangeBoundary* result_min,
                 RangeBoundary* result_max) {
@@ -2414,16 +2414,17 @@
   if (Range::ConstantMin(right_range).ConstantValue() >= 0) {
     *result_min = RangeBoundary::FromConstant(0);
     *result_max = Range::ConstantMax(right_range);
-    return true;
+    return;
   }
 
   if (Range::ConstantMin(left_range).ConstantValue() >= 0) {
     *result_min = RangeBoundary::FromConstant(0);
     *result_max = Range::ConstantMax(left_range);
-    return true;
+    return;
   }
 
-  return false;
+  *result_min = RangeBoundary::MinConstant(RangeBoundary::kRangeBoundaryInt64);
+  *result_max = RangeBoundary::MaxConstant(RangeBoundary::kRangeBoundaryInt64);
 }
 
 
@@ -2524,7 +2525,7 @@
 }
 
 
-bool Range::Mul(const Range* left_range,
+void Range::Mul(const Range* left_range,
                 const Range* right_range,
                 RangeBoundary* result_min,
                 RangeBoundary* result_max) {
@@ -2545,7 +2546,7 @@
     const int64_t r_max =
         OnlyNegativeOrZero(*left_range, *right_range) ? 0 : mul_max;
     *result_max = RangeBoundary::FromConstant(r_max);
-    return true;
+    return;
   }
 
   // TODO(vegorov): handle mixed sign case that leads to (-Infinity, 0] range.
@@ -2553,10 +2554,11 @@
       OnlyNegativeOrZero(*left_range, *right_range)) {
     *result_min = RangeBoundary::FromConstant(0);
     *result_max = RangeBoundary::PositiveInfinity();
-    return true;
+    return;
   }
 
-  return false;
+  *result_min = RangeBoundary::NegativeInfinity();
+  *result_max = RangeBoundary::PositiveInfinity();
 }
 
 
@@ -2603,39 +2605,39 @@
     case Token::kADD:
       Range::Add(left_range, right_range, &min, &max, left_defn);
       break;
+
     case Token::kSUB:
       Range::Sub(left_range, right_range, &min, &max, left_defn);
       break;
-    case Token::kMUL: {
-      if (!Range::Mul(left_range, right_range, &min, &max)) {
-        *result = Range::Full(RangeBoundary::kRangeBoundaryInt64);
-        return;
-      }
+
+    case Token::kMUL:
+      Range::Mul(left_range, right_range, &min, &max);
       break;
-    }
-    case Token::kSHL: {
+
+    case Token::kSHL:
       Range::Shl(left_range, right_range, &min, &max);
       break;
-    }
-    case Token::kSHR: {
+
+    case Token::kSHR:
       Range::Shr(left_range, right_range, &min, &max);
       break;
-    }
 
     case Token::kBIT_AND:
-      if (!Range::And(left_range, right_range, &min, &max)) {
-        *result = Range::Full(RangeBoundary::kRangeBoundaryInt64);
-        return;
-      }
+      Range::And(left_range, right_range, &min, &max);
       break;
 
     case Token::kBIT_XOR:
       Range::Xor(left_range, right_range, &min, &max);
       break;
 
-    default:
+    case Token::kBIT_OR:
       *result = Range::Full(RangeBoundary::kRangeBoundaryInt64);
       return;
+
+    default:
+      *result = Range(RangeBoundary::NegativeInfinity(),
+                      RangeBoundary::PositiveInfinity());
+      return;
   }
 
   ASSERT(!min.IsUnknown() && !max.IsUnknown());
@@ -2901,6 +2903,22 @@
 }
 
 
+void LoadCodeUnitsInstr::InferRange(RangeAnalysis* analysis, Range* range) {
+  ASSERT(class_id() == kOneByteStringCid ||
+         class_id() == kTwoByteStringCid);
+  switch (class_id()) {
+    case kOneByteStringCid:
+    case kTwoByteStringCid:
+      *range = Range(RangeBoundary::FromConstant(0),
+                     RangeBoundary::FromConstant(kMaxUint32));
+      break;
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
 void IfThenElseInstr::InferRange(RangeAnalysis* analysis, Range* range) {
   const intptr_t min = Utils::Minimum(if_true_, if_false_);
   const intptr_t max = Utils::Maximum(if_true_, if_false_);
diff --git a/runtime/vm/flow_graph_range_analysis.h b/runtime/vm/flow_graph_range_analysis.h
index a4bc7e6..3b39ba2 100644
--- a/runtime/vm/flow_graph_range_analysis.h
+++ b/runtime/vm/flow_graph_range_analysis.h
@@ -440,7 +440,7 @@
                   RangeBoundary* max,
                   Definition* left_defn);
 
-  static bool Mul(const Range* left_range,
+  static void Mul(const Range* left_range,
                   const Range* right_range,
                   RangeBoundary* min,
                   RangeBoundary* max);
@@ -454,7 +454,7 @@
                   RangeBoundary* min,
                   RangeBoundary* max);
 
-  static bool And(const Range* left_range,
+  static void And(const Range* left_range,
                   const Range* right_range,
                   RangeBoundary* min,
                   RangeBoundary* max);
diff --git a/runtime/vm/flow_graph_range_analysis_test.cc b/runtime/vm/flow_graph_range_analysis_test.cc
index 781aae2..4b38b44 100644
--- a/runtime/vm/flow_graph_range_analysis_test.cc
+++ b/runtime/vm/flow_graph_range_analysis_test.cc
@@ -531,8 +531,9 @@
                  static_cast<int64_t>(20),
                  static_cast<int64_t>(-20),
                  static_cast<int64_t>(20),
-                 RangeBoundary(),
-                 RangeBoundary());
+                 RangeBoundary::MinConstant(RangeBoundary::kRangeBoundaryInt64),
+                 RangeBoundary::MaxConstant(
+                    RangeBoundary::kRangeBoundaryInt64));
 
 #undef TEST_RANGE_AND
 }
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index cce0c2a..0863a162 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -7,6 +7,7 @@
 #include "vm/cha.h"
 #include "vm/bit_vector.h"
 #include "vm/il_printer.h"
+#include "vm/regexp_assembler.h"
 
 namespace dart {
 
@@ -709,6 +710,21 @@
   }
 
   const Function& function = graph_entry->parsed_function().function();
+  if (function.IsIrregexpFunction()) {
+    // In irregexp functions, types of input parameters are known and immutable.
+    // Set parameter types here in order to prevent unnecessary CheckClassInstr
+    // from being generated.
+    switch (index()) {
+      case RegExpMacroAssembler::kParamStringIndex:
+        return CompileType::FromCid(function.regexp_cid());
+      case RegExpMacroAssembler::kParamStartOffsetIndex:
+        return CompileType::FromCid(kSmiCid);
+      default: UNREACHABLE();
+    }
+    UNREACHABLE();
+    return CompileType::Dynamic();
+  }
+
   LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope();
   const AbstractType& type = scope->VariableAt(index())->type();
 
@@ -995,6 +1011,21 @@
 }
 
 
+CompileType LoadCodeUnitsInstr::ComputeType() const {
+  switch (class_id()) {
+    case kOneByteStringCid:
+    case kExternalOneByteStringCid:
+    case kTwoByteStringCid:
+    case kExternalTwoByteStringCid:
+      return can_pack_into_smi() ? CompileType::FromCid(kSmiCid)
+                                 : CompileType::Int();
+    default:
+      UNIMPLEMENTED();
+      return CompileType::Dynamic();
+  }
+}
+
+
 CompileType BinaryInt32OpInstr::ComputeType() const {
   // TODO(vegorov): range analysis information shall be used here.
   return CompileType::Int();
@@ -1254,6 +1285,11 @@
 }
 
 
+CompileType CaseInsensitiveCompareUC16Instr::ComputeType() const {
+  return CompileType::FromCid(kBoolCid);
+}
+
+
 CompileType UnboxInstr::ComputeType() const {
   switch (representation()) {
     case kUnboxedDouble:
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h
index 6f26c74..5f73008 100644
--- a/runtime/vm/growable_array.h
+++ b/runtime/vm/growable_array.h
@@ -60,6 +60,10 @@
     return data_[index];
   }
 
+  const T& At(intptr_t index) const {
+    return operator[](index);
+  }
+
   T& Last() const {
     ASSERT(length_ > 0);
     return operator[](length_ - 1);
diff --git a/runtime/vm/heap_test.cc b/runtime/vm/heap_test.cc
index 99d7ce8..b9ea5ad 100644
--- a/runtime/vm/heap_test.cc
+++ b/runtime/vm/heap_test.cc
@@ -169,6 +169,46 @@
 }
 
 
+TEST_CASE(ArrayHeapStats) {
+  const char* kScriptChars =
+  "List f(int len) {\n"
+  "  return new List(len);\n"
+  "}\n"
+  ""
+  "main() {\n"
+  "  return f(1234);\n"
+  "}\n";
+  Dart_Handle h_lib = TestCase::LoadTestScript(kScriptChars, NULL);
+  Isolate* isolate = Isolate::Current();
+  ClassTable* class_table = isolate->class_table();
+  intptr_t cid = kArrayCid;
+  ClassHeapStats* class_stats =
+      ClassHeapStatsTestHelper::GetHeapStatsForCid(class_table,
+                                                   cid);
+  Dart_EnterScope();
+  // Invoke 'main' twice, since initial compilation might trigger extra array
+  // allocations.
+  Dart_Handle result = Dart_Invoke(h_lib, NewString("main"), 0, NULL);
+  EXPECT_VALID(result);
+  EXPECT(!Dart_IsNull(result));
+  Library& lib = Library::Handle();
+  lib ^= Api::UnwrapHandle(h_lib);
+  EXPECT(!lib.IsNull());
+  intptr_t before = class_stats->recent.new_size;
+  Dart_Handle result2 = Dart_Invoke(h_lib, NewString("main"), 0, NULL);
+  EXPECT_VALID(result2);
+  EXPECT(!Dart_IsNull(result2));
+  intptr_t after = class_stats->recent.new_size;
+  const intptr_t expected_size = Array::InstanceSize(1234);
+  // Invoking the method might involve some additional tiny array allocations,
+  // so we allow slightly more than expected.
+  static const intptr_t kTolerance = 10 * kWordSize;
+  EXPECT_LE(expected_size, after - before);
+  EXPECT_GT(expected_size + kTolerance, after - before);
+  Dart_ExitScope();
+}
+
+
 class FindOnly : public FindObjectVisitor {
  public:
   FindOnly(Isolate* isolate, RawObject* target)
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index df8c95c..b9cd6d4 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -505,7 +505,7 @@
 
 
 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
-  f->Print("%s", cls().ToCString());
+  f->Print("%s", String::Handle(cls().PrettyName()).ToCString());
   for (intptr_t i = 0; i < ArgumentCount(); i++) {
     f->Print(", ");
     PushArgumentAt(i)->value()->PrintTo(f);
@@ -518,7 +518,7 @@
 
 
 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
-  f->Print("%s", String::Handle(cls_.Name()).ToCString());
+  f->Print("%s", String::Handle(cls_.PrettyName()).ToCString());
   for (intptr_t i = 0; i < InputCount(); i++) {
     f->Print(", ");
     f->Print("%s: ", slots_[i]->ToCString());
@@ -571,6 +571,10 @@
 void AllocateUninitializedContextInstr::PrintOperandsTo(
     BufferFormatter* f) const {
   f->Print("%" Pd "", num_context_variables());
+
+  if (Identity().IsNotAliased()) {
+    f->Print(" <not-aliased>");
+  }
 }
 
 
@@ -924,6 +928,30 @@
 }
 
 
+void IndirectEntryInstr::PrintTo(BufferFormatter* f) const {
+  ASSERT(try_index() == CatchClauseNode::kInvalidTryIndex);
+  f->Print("B%" Pd "[join indirect]:%" Pd " pred(", block_id(), GetDeoptId());
+  for (intptr_t i = 0; i < predecessors_.length(); ++i) {
+    if (i > 0) f->Print(", ");
+    f->Print("B%" Pd, predecessors_[i]->block_id());
+  }
+  f->Print(")");
+  if (phis_ != NULL) {
+    f->Print(" {");
+    for (intptr_t i = 0; i < phis_->length(); ++i) {
+      if ((*phis_)[i] == NULL) continue;
+      f->Print("\n      ");
+      (*phis_)[i]->PrintTo(f);
+    }
+    f->Print("\n}");
+  }
+  if (HasParallelMove()) {
+    f->Print(" ");
+    parallel_move()->PrintTo(f);
+  }
+}
+
+
 static const char *RepresentationToCString(Representation rep) {
   switch (rep) {
     case kTagged:
@@ -1066,6 +1094,17 @@
 }
 
 
+void IndirectGotoInstr::PrintTo(BufferFormatter* f) const {
+  if (GetDeoptId() != Isolate::kNoDeoptId) {
+    f->Print("igoto:%" Pd "(", GetDeoptId());
+  } else {
+    f->Print("igoto:(");
+  }
+  InputAt(0)->PrintTo(f);
+  f->Print(")");
+}
+
+
 void BranchInstr::PrintTo(BufferFormatter* f) const {
   f->Print("%s ", DebugName());
   f->Print("if ");
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 59f0cb2..9ac5c3f 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -17,6 +17,7 @@
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os.h"
+#include "vm/regexp_assembler.h"
 #include "vm/resolver.h"
 #include "vm/scopes.h"
 #include "vm/stub_code.h"
@@ -451,6 +452,7 @@
       parsed_function_(parsed_function),
       normal_entry_(normal_entry),
       catch_entries_(),
+      indirect_entries_(),
       initial_definitions_(),
       osr_id_(osr_id),
       entry_count_(0),
@@ -789,6 +791,18 @@
 }
 
 
+bool Instruction::HasUnmatchedInputRepresentations() const {
+  for (intptr_t i = 0; i < InputCount(); i++) {
+    Definition* input = InputAt(i)->definition();
+    if (RequiredInputRepresentation(i) != input->representation()) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+
 void Definition::ReplaceWith(Definition* other,
                              ForwardInstructionIterator* iterator) {
   // Record other's input uses.
@@ -1205,7 +1219,8 @@
       return false;
 
     case Token::kSHL:
-      return true;
+      return can_overflow() ||
+          !RangeUtils::IsPositive(right()->definition()->range());
 
     case Token::kMOD: {
       UNREACHABLE();
@@ -1228,19 +1243,14 @@
     case Token::kBIT_OR:
     case Token::kBIT_XOR:
       return false;
-    case Token::kSHR: {
-      // Can't deopt if shift-count is known positive.
-      Range* right_range = this->right()->definition()->range();
-      return (right_range == NULL) || !right_range->IsPositive();
-    }
-    case Token::kSHL: {
-      Range* right_range = this->right()->definition()->range();
-      if ((right_range != NULL) && !can_overflow()) {
-        // Can deoptimize if right can be negative.
-        return !right_range->IsPositive();
-      }
-      return true;
-    }
+
+    case Token::kSHR:
+      return !RangeUtils::IsPositive(right()->definition()->range());
+
+    case Token::kSHL:
+      return can_overflow() ||
+          !RangeUtils::IsPositive(right()->definition()->range());
+
     case Token::kMOD: {
       Range* right_range = this->right()->definition()->range();
       return (right_range == NULL) || right_range->Overlaps(0, 0);
@@ -1994,7 +2004,7 @@
 
 
 Definition* UnboxInstr::Canonicalize(FlowGraph* flow_graph) {
-  if (!HasUses()) return NULL;
+  if (!HasUses() && !CanDeoptimize()) return NULL;
 
   // Fold away Unbox<rep>(Box<rep>(v)).
   BoxInstr* box_defn = value()->definition()->AsBox();
@@ -2026,7 +2036,7 @@
 
 
 Definition* UnboxIntegerInstr::Canonicalize(FlowGraph* flow_graph) {
-  if (!HasUses()) return NULL;
+  if (!HasUses() && !CanDeoptimize()) return NULL;
 
   // Fold away UnboxInteger<rep_to>(BoxInteger<rep_from>(v)).
   BoxIntegerInstr* box_defn = value()->definition()->AsBoxInteger();
@@ -2040,7 +2050,7 @@
           box_defn->value()->CopyWithType(),
           (representation() == kUnboxedInt32) ?
               GetDeoptId() : Isolate::kNoDeoptId);
-      if ((representation() == kUnboxedInt32) && is_truncating()) {
+      if ((representation() == kUnboxedInt32) && !CanDeoptimize()) {
         converter->mark_truncating();
       }
       flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue);
@@ -2071,6 +2081,9 @@
 
     UnboxedConstantInstr* uc =
         new UnboxedConstantInstr(c->value(), kUnboxedInt32);
+    if (c->range() != NULL) {
+      uc->set_range(*c->range());
+    }
     flow_graph->InsertBefore(this, uc, NULL, FlowGraph::kValue);
     return uc;
   }
@@ -2250,19 +2263,12 @@
       return this;
     }
     ComparisonInstr* comp = replacement->AsComparison();
-    if ((comp == NULL) || comp->CanDeoptimize()) {
+    if ((comp == NULL) ||
+        comp->CanDeoptimize() ||
+        comp->HasUnmatchedInputRepresentations()) {
       return this;
     }
 
-    // Assert that the comparison is not serving as a pending deoptimization
-    // target for conversions.
-    for (intptr_t i = 0; i < comp->InputCount(); i++) {
-      if (comp->RequiredInputRepresentation(i) !=
-          comp->InputAt(i)->definition()->representation()) {
-        return this;
-      }
-    }
-
     // Replace the comparison if the replacement is used at this branch,
     // and has exactly one use.
     Value* use = comp->input_use_list();
@@ -2545,6 +2551,52 @@
 }
 
 
+void IndirectGotoInstr::ComputeOffsetTable(Isolate* isolate) {
+  if (GetBlock()->offset() < 0) {
+    // Don't generate a table when contained in an unreachable block.
+    return;
+  }
+  ASSERT(SuccessorCount() == offsets_.Capacity());
+  offsets_.SetLength(SuccessorCount());
+  for (intptr_t i = 0; i < SuccessorCount(); i++) {
+    TargetEntryInstr* target = SuccessorAt(i);
+    intptr_t offset = target->offset();
+
+    // The intermediate block might be compacted, if so, use the indirect entry.
+    if (offset < 0) {
+      // Optimizations might have modified the immediate target block, but it
+      // must end with a goto to the indirect entry. Also, we can't use
+      // last_instruction because 'target' is compacted/unreachable.
+      Instruction* last = target->next();
+      while (last != NULL && !last->IsGoto()) {
+        last = last->next();
+      }
+      ASSERT(last);
+      IndirectEntryInstr* ientry =
+          last->AsGoto()->successor()->AsIndirectEntry();
+      ASSERT(ientry != NULL);
+      ASSERT(ientry->indirect_id() == i);
+      offset = ientry->offset();
+    }
+
+    ASSERT(offset > 0);
+    offset -= Assembler::EntryPointToPcMarkerOffset();
+    offsets_.SetAt(i, Smi::ZoneHandle(isolate, Smi::New(offset)));
+  }
+}
+
+
+LocationSummary* IndirectEntryInstr::MakeLocationSummary(
+    Isolate* isolate, bool optimizing) const {
+  return JoinEntryInstr::MakeLocationSummary(isolate, optimizing);
+}
+
+
+void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  JoinEntryInstr::EmitNativeCode(compiler);
+}
+
+
 LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate,
                                                bool optimizing) const {
   UNREACHABLE();
@@ -3335,6 +3387,23 @@
   return "";
 }
 
+typedef RawBool* (*CaseInsensitiveCompareUC16Function) (
+    RawString* string_raw,
+    RawSmi* lhs_index_raw,
+    RawSmi* rhs_index_raw,
+    RawSmi* length_raw);
+
+
+extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry(
+    "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>(
+        static_cast<CaseInsensitiveCompareUC16Function>(
+        &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false);
+
+
+const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const {
+  return kCaseInsensitiveCompareUC16RuntimeEntry;
+}
+
 
 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs,
                                  intptr_t deopt_id,
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 5867762..ea0ef61 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -430,6 +430,7 @@
   M(GraphEntry)                                                                \
   M(JoinEntry)                                                                 \
   M(TargetEntry)                                                               \
+  M(IndirectEntry)                                                             \
   M(CatchBlockEntry)                                                           \
   M(Phi)                                                                       \
   M(Redefinition)                                                              \
@@ -440,6 +441,7 @@
   M(Throw)                                                                     \
   M(ReThrow)                                                                   \
   M(Goto)                                                                      \
+  M(IndirectGoto)                                                              \
   M(Branch)                                                                    \
   M(AssertAssignable)                                                          \
   M(AssertBoolean)                                                             \
@@ -458,6 +460,7 @@
   M(NativeCall)                                                                \
   M(DebugStepCheck)                                                            \
   M(LoadIndexed)                                                               \
+  M(LoadCodeUnits)                                                             \
   M(StoreIndexed)                                                              \
   M(StoreInstanceField)                                                        \
   M(InitStaticField)                                                           \
@@ -501,6 +504,7 @@
   M(Unbox)                                                                     \
   M(BoxInt64)                                                                  \
   M(UnboxInt64)                                                                \
+  M(CaseInsensitiveCompareUC16)                                                \
   M(BinaryMintOp)                                                              \
   M(ShiftMintOp)                                                               \
   M(UnaryMintOp)                                                               \
@@ -741,6 +745,8 @@
     lifetime_position_ = pos;
   }
 
+  bool HasUnmatchedInputRepresentations() const;
+
   // Returns representation expected for the input operand at the given index.
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
     return kTagged;
@@ -1165,6 +1171,9 @@
 
   void set_block_id(intptr_t block_id) { block_id_ = block_id; }
 
+  intptr_t offset() const { return offset_; }
+  void set_offset(intptr_t offset) { offset_ = offset; }
+
   // For all instruction in this block: Remove all inputs (including in the
   // environment) from their definition's use lists for all instructions.
   void ClearAllInstructions();
@@ -1181,6 +1190,7 @@
         dominator_(NULL),
         dominated_blocks_(1),
         last_instruction_(NULL),
+        offset_(-1),
         parallel_move_(NULL),
         loop_info_(NULL) {
   }
@@ -1206,6 +1216,9 @@
   GrowableArray<BlockEntryInstr*> dominated_blocks_;
   Instruction* last_instruction_;
 
+  // Offset of this block from the start of the emitted code.
+  intptr_t offset_;
+
   // Parallel move that will be used by linear scan register allocator to
   // connect live ranges at the start of the block.
   ParallelMoveInstr* parallel_move_;
@@ -1286,6 +1299,10 @@
 
   CatchBlockEntryInstr* GetCatchEntry(intptr_t index);
 
+  void AddIndirectEntry(IndirectEntryInstr* entry) {
+    indirect_entries_.Add(entry);
+  }
+
   GrowableArray<Definition*>* initial_definitions() {
     return &initial_definitions_;
   }
@@ -1320,6 +1337,10 @@
     return catch_entries_;
   }
 
+  const GrowableArray<IndirectEntryInstr*>& indirect_entries() const {
+    return indirect_entries_;
+  }
+
   virtual void PrintTo(BufferFormatter* f) const;
 
  private:
@@ -1329,6 +1350,8 @@
   const ParsedFunction* parsed_function_;
   TargetEntryInstr* normal_entry_;
   GrowableArray<CatchBlockEntryInstr*> catch_entries_;
+  // Indirect targets are blocks reachable only through indirect gotos.
+  GrowableArray<IndirectEntryInstr*> indirect_entries_;
   GrowableArray<Definition*> initial_definitions_;
   const intptr_t osr_id_;
   intptr_t entry_count_;
@@ -1374,6 +1397,7 @@
   friend class BlockEntryInstr;
   friend class InlineExitCollector;
   friend class PolymorphicInliner;
+  friend class IndirectEntryInstr;  // Access in il_printer.cc.
 
   // Direct access to phis_ in order to resize it due to phi elimination.
   friend class ConstantPropagator;
@@ -1452,6 +1476,25 @@
 };
 
 
+class IndirectEntryInstr : public JoinEntryInstr {
+ public:
+  IndirectEntryInstr(intptr_t block_id,
+                     intptr_t indirect_id,
+                     intptr_t try_index)
+      : JoinEntryInstr(block_id, try_index),
+        indirect_id_(indirect_id) { }
+
+  DECLARE_INSTRUCTION(IndirectEntry)
+
+  virtual void PrintTo(BufferFormatter* f) const;
+
+  intptr_t indirect_id() const { return indirect_id_; }
+
+ private:
+  const intptr_t indirect_id_;
+};
+
+
 class CatchBlockEntryInstr : public BlockEntryInstr {
  public:
   CatchBlockEntryInstr(intptr_t block_id,
@@ -1658,15 +1701,6 @@
 
   Value* input_use_list() const { return input_use_list_; }
   void set_input_use_list(Value* head) { input_use_list_ = head; }
-  intptr_t InputUseListLength() const {
-    intptr_t length = 0;
-    Value* use = input_use_list_;
-    while (use != NULL) {
-      length++;
-      use = use->next_use();
-    }
-    return length;
-  }
 
   Value* env_use_list() const { return env_use_list_; }
   void set_env_use_list(Value* head) { env_use_list_ = head; }
@@ -2133,6 +2167,58 @@
 };
 
 
+// IndirectGotoInstr represents a dynamically computed jump. Only
+// IndirectEntryInstr targets are valid targets of an indirect goto. The
+// concrete target to jump to is given as a parameter to the indirect goto.
+//
+// In order to preserve split-edge form, an indirect goto does not itself point
+// to its targets. Instead, for each possible target, the successors_ field
+// will contain an ordinary goto instruction that jumps to the target.
+// TODO(zerny): Implement direct support instead of embedding gotos.
+//
+// Byte offsets of all possible targets are stored in the offsets_ array. The
+// desired offset is looked up while the generated code is executing, and passed
+// to IndirectGoto as an input.
+class IndirectGotoInstr : public TemplateInstruction<1, NoThrow> {
+ public:
+  IndirectGotoInstr(GrowableObjectArray* offsets,
+                    Value* offset_from_start)
+    : offsets_(*offsets) {
+    SetInputAt(0, offset_from_start);
+  }
+
+  DECLARE_INSTRUCTION(IndirectGoto)
+
+  virtual intptr_t ArgumentCount() const { return 0; }
+
+  void AddSuccessor(TargetEntryInstr* successor) {
+    ASSERT(successor->next()->IsGoto());
+    ASSERT(successor->next()->AsGoto()->successor()->IsIndirectEntry());
+    successors_.Add(successor);
+  }
+
+  virtual intptr_t SuccessorCount() const { return successors_.length(); }
+  virtual TargetEntryInstr* SuccessorAt(intptr_t index) const {
+    ASSERT(index < SuccessorCount());
+    return successors_[index];
+  }
+
+  virtual bool CanDeoptimize() const { return false; }
+  virtual bool CanBecomeDeoptimizationTarget() const { return false; }
+
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
+  virtual void PrintTo(BufferFormatter* f) const;
+
+  const GrowableObjectArray& offsets() const { return offsets_; }
+  void ComputeOffsetTable(Isolate* isolate);
+
+ private:
+  GrowableArray<TargetEntryInstr*> successors_;
+  GrowableObjectArray& offsets_;
+};
+
+
 class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
   Value* left() const { return inputs_[0]; }
@@ -3590,6 +3676,67 @@
 };
 
 
+// Loads the specified number of code units from the given string, packing
+// multiple code units into a single datatype. In essence, this is a specialized
+// version of LoadIndexedInstr which accepts only string targets and can load
+// multiple elements at once. The result datatype differs depending on the
+// string type, element count, and architecture; if possible, the result is
+// packed into a Smi, falling back to a Mint otherwise.
+// TODO(zerny): Add support for loading into UnboxedInt32x4.
+class LoadCodeUnitsInstr : public TemplateDefinition<2, NoThrow> {
+ public:
+  LoadCodeUnitsInstr(Value* str,
+                     Value* index,
+                     intptr_t element_count,
+                     intptr_t class_id,
+                     intptr_t token_pos)
+      : class_id_(class_id),
+        token_pos_(token_pos),
+        element_count_(element_count),
+        representation_(kTagged) {
+    ASSERT(element_count == 1 || element_count == 2 || element_count == 4);
+    ASSERT(class_id == kOneByteStringCid || class_id == kTwoByteStringCid);
+    SetInputAt(0, str);
+    SetInputAt(1, index);
+  }
+
+  intptr_t token_pos() const { return token_pos_; }
+
+  DECLARE_INSTRUCTION(LoadCodeUnits)
+  virtual CompileType ComputeType() const;
+
+  bool IsExternal() const {
+    return array()->definition()->representation() == kUntagged;
+  }
+
+  Value* array() const { return inputs_[0]; }
+  Value* index() const { return inputs_[1]; }
+  intptr_t index_scale() const { return Instance::ElementSizeFor(class_id_); }
+  intptr_t class_id() const { return class_id_; }
+  intptr_t element_count() const { return element_count_; }
+
+  bool can_pack_into_smi() const {
+    return element_count() <= kSmiBits / (index_scale() * kBitsPerByte);
+  }
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation representation() const { return representation_; }
+  void set_representation(Representation repr) { representation_ = repr; }
+  virtual void InferRange(RangeAnalysis* analysis, Range* range);
+
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ private:
+  const intptr_t class_id_;
+  const intptr_t token_pos_;
+  const intptr_t element_count_;
+  Representation representation_;
+
+  DISALLOW_COPY_AND_ASSIGN(LoadCodeUnitsInstr);
+};
+
+
 class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
  public:
   StringFromCharCodeInstr(Value* char_code, intptr_t cid) : cid_(cid) {
@@ -3861,17 +4008,50 @@
 };
 
 
+class AllocateUninitializedContextInstr
+    : public TemplateDefinition<0, NoThrow> {
+ public:
+  AllocateUninitializedContextInstr(intptr_t token_pos,
+                                    intptr_t num_context_variables)
+      : token_pos_(token_pos),
+        num_context_variables_(num_context_variables),
+        identity_(AliasIdentity::Unknown()) {}
+
+  DECLARE_INSTRUCTION(AllocateUninitializedContext)
+  virtual CompileType ComputeType() const;
+
+  virtual intptr_t token_pos() const { return token_pos_; }
+  intptr_t num_context_variables() const { return num_context_variables_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual EffectSet Effects() const { return EffectSet::None(); }
+
+  virtual AliasIdentity Identity() const { return identity_; }
+  virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
+
+ private:
+  const intptr_t token_pos_;
+  const intptr_t num_context_variables_;
+  AliasIdentity identity_;
+
+  DISALLOW_COPY_AND_ASSIGN(AllocateUninitializedContextInstr);
+};
+
+
 // This instruction captures the state of the object which had its allocation
 // removed during the AllocationSinking pass.
 // It does not produce any real code only deoptimization information.
 class MaterializeObjectInstr : public Definition {
  public:
   MaterializeObjectInstr(AllocateObjectInstr* allocation,
-                         const Class& cls,
                          const ZoneGrowableArray<const Object*>& slots,
                          ZoneGrowableArray<Value*>* values)
       : allocation_(allocation),
-        cls_(cls),
+        cls_(allocation->cls()),
+        num_variables_(-1),
         slots_(slots),
         values_(values),
         locations_(NULL),
@@ -3884,13 +4064,37 @@
     }
   }
 
-  AllocateObjectInstr* allocation() const { return allocation_; }
+  MaterializeObjectInstr(AllocateUninitializedContextInstr* allocation,
+                         const ZoneGrowableArray<const Object*>& slots,
+                         ZoneGrowableArray<Value*>* values)
+      : allocation_(allocation),
+        cls_(Class::ZoneHandle(Object::context_class())),
+        num_variables_(allocation->num_context_variables()),
+        slots_(slots),
+        values_(values),
+        locations_(NULL),
+        visited_for_liveness_(false),
+        registers_remapped_(false) {
+    ASSERT(slots_.length() == values_->length());
+    for (intptr_t i = 0; i < InputCount(); i++) {
+      InputAt(i)->set_instruction(this);
+      InputAt(i)->set_use_index(i);
+    }
+  }
+
+  Definition* allocation() const { return allocation_; }
   const Class& cls() const { return cls_; }
+
+  intptr_t num_variables() const {
+    return num_variables_;
+  }
+
   intptr_t FieldOffsetAt(intptr_t i) const {
     return slots_[i]->IsField()
         ? Field::Cast(*slots_[i]).Offset()
         : Smi::Cast(*slots_[i]).Value();
   }
+
   const Location& LocationAt(intptr_t i) {
     return locations_[i];
   }
@@ -3937,8 +4141,9 @@
     (*values_)[i] = value;
   }
 
-  AllocateObjectInstr* allocation_;
+  Definition* allocation_;
   const Class& cls_;
+  intptr_t num_variables_;
   const ZoneGrowableArray<const Object*>& slots_;
   ZoneGrowableArray<Value*>* values_;
   Location* locations_;
@@ -4228,7 +4433,7 @@
   AllocateContextInstr(intptr_t token_pos,
                        intptr_t num_context_variables)
       : token_pos_(token_pos),
-        num_context_variables_(num_context_variables) {}
+        num_context_variables_(num_context_variables) { }
 
   DECLARE_INSTRUCTION(AllocateContext)
   virtual CompileType ComputeType() const;
@@ -4274,34 +4479,6 @@
 };
 
 
-class AllocateUninitializedContextInstr
-    : public TemplateDefinition<0, NoThrow> {
- public:
-  AllocateUninitializedContextInstr(intptr_t token_pos,
-                                    intptr_t num_context_variables)
-      : token_pos_(token_pos),
-        num_context_variables_(num_context_variables) {}
-
-  DECLARE_INSTRUCTION(AllocateUninitializedContext)
-  virtual CompileType ComputeType() const;
-
-  virtual intptr_t token_pos() const { return token_pos_; }
-  intptr_t num_context_variables() const { return num_context_variables_; }
-
-  virtual void PrintOperandsTo(BufferFormatter* f) const;
-
-  virtual bool CanDeoptimize() const { return false; }
-
-  virtual EffectSet Effects() const { return EffectSet::None(); }
-
- private:
-  const intptr_t token_pos_;
-  const intptr_t num_context_variables_;
-
-  DISALLOW_COPY_AND_ASSIGN(AllocateUninitializedContextInstr);
-};
-
-
 class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
  public:
   CloneContextInstr(intptr_t token_pos, Value* context_value)
@@ -4764,6 +4941,60 @@
 };
 
 
+// Calls into the runtime and performs a case-insensitive comparison of the
+// UTF16 strings (i.e. TwoByteString or ExternalTwoByteString) located at
+// str[lhs_index:lhs_index + length] and str[rhs_index:rhs_index + length].
+//
+// TODO(zerny): Remove this once (if) functions inherited from unibrow
+// are moved to dart code.
+class CaseInsensitiveCompareUC16Instr
+    : public TemplateDefinition<4, NoThrow, Pure> {
+ public:
+  CaseInsensitiveCompareUC16Instr(
+      Value* str,
+      Value* lhs_index,
+      Value* rhs_index,
+      Value* length,
+      intptr_t cid)
+    : cid_(cid) {
+    ASSERT(cid == kTwoByteStringCid || cid == kExternalTwoByteStringCid);
+    ASSERT(index_scale() == 2);
+    SetInputAt(0, str);
+    SetInputAt(1, lhs_index);
+    SetInputAt(2, rhs_index);
+    SetInputAt(3, length);
+  }
+
+  Value* str() const { return inputs_[0]; }
+  Value* lhs_index() const { return inputs_[1]; }
+  Value* rhs_index() const { return inputs_[2]; }
+  Value* length() const { return inputs_[3]; }
+
+  const RuntimeEntry& TargetFunction() const;
+  bool IsExternal() const { return cid_ == kExternalTwoByteStringCid; }
+  intptr_t class_id() const { return cid_; }
+  intptr_t index_scale() const { return Instance::ElementSizeFor(cid_); }
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual Representation representation() const {
+    return kTagged;
+  }
+
+  DECLARE_INSTRUCTION(CaseInsensitiveCompareUC16)
+  virtual CompileType ComputeType() const;
+
+  virtual bool AttributesEqual(Instruction* other) const {
+    return other->AsCaseInsensitiveCompareUC16()->cid_ == cid_;
+  }
+
+ private:
+  const intptr_t cid_;
+
+  DISALLOW_COPY_AND_ASSIGN(CaseInsensitiveCompareUC16Instr);
+};
+
+
 // Represents Math's static min and max functions.
 class MathMinMaxInstr : public TemplateDefinition<2, NoThrow, Pure> {
  public:
@@ -7453,7 +7684,6 @@
            (to == kUnboxedUint32) ||
            (to == kUnboxedInt32));
     SetInputAt(0, value);
-    ASSERT(!CanDeoptimize() || (deopt_id != Isolate::kNoDeoptId));
   }
 
   Value* value() const { return inputs_[0]; }
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 05ebe6c..4391ca6 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -554,16 +554,16 @@
                                            Token::Kind kind) {
   ASSERT(Token::IsEqualityOperator(kind));
   PairLocation* left_pair = locs->in(0).AsPairLocation();
-  Register left1 = left_pair->At(0).reg();
-  Register left2 = left_pair->At(1).reg();
+  Register left_lo = left_pair->At(0).reg();
+  Register left_hi = left_pair->At(1).reg();
   PairLocation* right_pair = locs->in(1).AsPairLocation();
-  Register right1 = right_pair->At(0).reg();
-  Register right2 = right_pair->At(1).reg();
+  Register right_lo = right_pair->At(0).reg();
+  Register right_hi = right_pair->At(1).reg();
 
   // Compare lower.
-  __ cmp(left1, Operand(right1));
+  __ cmp(left_lo, Operand(right_lo));
   // Compare upper if lower is equal.
-  __ cmp(left2, Operand(right2), EQ);
+  __ cmp(left_hi, Operand(right_hi), EQ);
   return TokenKindToMintCondition(kind);
 }
 
@@ -572,11 +572,11 @@
                                              LocationSummary* locs,
                                              Token::Kind kind) {
   PairLocation* left_pair = locs->in(0).AsPairLocation();
-  Register left1 = left_pair->At(0).reg();
-  Register left2 = left_pair->At(1).reg();
+  Register left_lo = left_pair->At(0).reg();
+  Register left_hi = left_pair->At(1).reg();
   PairLocation* right_pair = locs->in(1).AsPairLocation();
-  Register right1 = right_pair->At(0).reg();
-  Register right2 = right_pair->At(1).reg();
+  Register right_lo = right_pair->At(0).reg();
+  Register right_hi = right_pair->At(1).reg();
 
   Register out = locs->temp(0).reg();
 
@@ -600,15 +600,15 @@
       hi_true_cond = hi_false_cond = lo_false_cond = VS;
   }
 
-  Label is_true, is_false, done;
+  Label done;
   // Compare upper halves first.
-  __ cmp(left2, Operand(right2));
+  __ cmp(left_hi, Operand(right_hi));
   __ LoadImmediate(out, 0, hi_false_cond);
   __ LoadImmediate(out, 1, hi_true_cond);
   // If higher words aren't equal, skip comparing lower words.
   __ b(&done, NE);
 
-  __ cmp(left1, Operand(right1));
+  __ cmp(left_lo, Operand(right_lo));
   __ LoadImmediate(out, 1);
   __ LoadImmediate(out, 0, lo_false_cond);
   __ Bind(&done);
@@ -829,7 +829,7 @@
                                    Location::RequiresRegister()));
     locs->set_in(1, Location::Pair(Location::RequiresRegister(),
                                    Location::RequiresRegister()));
-    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_temp(0, Location::RequiresRegister());  // TODO(regis): Improve.
     locs->set_out(0, Location::RequiresRegister());
     return locs;
   }
@@ -903,7 +903,7 @@
   if (operation_cid() == kSmiCid) {
     EmitBranchOnCondition(compiler, true_condition, labels);
   } else if (operation_cid() == kMintCid) {
-    const Register result = locs()->temp(0).reg();
+    const Register result = locs()->temp(0).reg();  // TODO(regis): Improve.
     __ CompareImmediate(result, 1);
     __ b(labels.true_label, EQ);
     __ b(labels.false_label, NE);
@@ -1863,6 +1863,116 @@
 };
 
 
+
+
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
+                                                         bool opt) const {
+  const bool might_box = (representation() == kTagged) && !can_pack_into_smi();
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = might_box ? 1 : 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, kNumInputs, kNumTemps,
+      might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+
+  if (might_box) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+
+  if (representation() == kUnboxedMint) {
+    summary->set_out(0, Location::Pair(Location::RequiresRegister(),
+                                       Location::RequiresRegister()));
+  } else {
+    ASSERT(representation() == kTagged);
+    summary->set_out(0, Location::RequiresRegister());
+  }
+
+  return summary;
+}
+
+
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const Register array = locs()->in(0).reg();
+  const Location index = locs()->in(1);
+
+  Address element_address = __ ElementAddressForRegIndex(
+        true,  IsExternal(), class_id(), index_scale(), array, index.reg());
+  // Warning: element_address may use register IP as base.
+
+  if (representation() == kUnboxedMint) {
+    ASSERT(compiler->is_optimizing());
+    ASSERT(locs()->out(0).IsPairLocation());
+    PairLocation* result_pair = locs()->out(0).AsPairLocation();
+    Register result1 = result_pair->At(0).reg();
+    Register result2 = result_pair->At(1).reg();
+    switch (class_id()) {
+      case kOneByteStringCid:
+      case kExternalOneByteStringCid:
+        ASSERT(element_count() == 4);
+        __ ldr(result1, element_address);
+        __ eor(result2, result2, Operand(result2));
+        break;
+      case kTwoByteStringCid:
+      case kExternalTwoByteStringCid:
+        ASSERT(element_count() == 2);
+        __ ldr(result1, element_address);
+        __ eor(result2, result2, Operand(result2));
+        break;
+      default:
+        UNREACHABLE();
+    }
+  } else {
+    ASSERT(representation() == kTagged);
+    Register result = locs()->out(0).reg();
+    switch (class_id()) {
+      case kOneByteStringCid:
+      case kExternalOneByteStringCid:
+        switch (element_count()) {
+          case 1: __ ldrb(result, element_address); break;
+          case 2: __ ldrh(result, element_address); break;
+          case 4: __ ldr(result, element_address); break;
+          default: UNREACHABLE();
+        }
+        break;
+      case kTwoByteStringCid:
+      case kExternalTwoByteStringCid:
+        switch (element_count()) {
+          case 1: __ ldrh(result, element_address); break;
+          case 2: __ ldr(result, element_address); break;
+          default: UNREACHABLE();
+        }
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+    if (can_pack_into_smi()) {
+      __ SmiTag(result);
+    } else {
+      // If the value cannot fit in a smi then allocate a mint box for it.
+      Register value = locs()->temp(0).reg();
+      Register temp = locs()->temp(1).reg();
+      ASSERT(result != value);
+      __ MoveRegister(value, result);
+      __ SmiTag(result);
+
+      Label done;
+      __ TestImmediate(value, 0xC0000000);
+      __ b(&done, EQ);
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->mint_class(), result, temp);
+      __ eor(temp, temp, Operand(temp));
+      __ StoreToOffset(kWord, value, result,
+                       Mint::value_offset() - kHeapObjectTag);
+      __ StoreToOffset(kWord, temp, result,
+                       Mint::value_offset() - kHeapObjectTag + kWordSize);
+      __ Bind(&done);
+    }
+  }
+}
+
+
 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
@@ -2220,23 +2330,9 @@
     __ mov(R7, Operand(R6));
     __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag);
     if (array_size < (kInlineArraySize * kWordSize)) {
-      intptr_t current_offset = 0;
-      while (current_offset + kWordSize < array_size) {
-        __ strd(R6, Address(R8, current_offset));
-        current_offset += 2*kWordSize;
-      }
-      while (current_offset < array_size) {
-        __ str(R6, Address(R8, current_offset));
-        current_offset += kWordSize;
-      }
+      __ InitializeFieldsNoBarrierUnrolled(R0, R8, num_elements, R6, R7);
     } else {
-      Label init_loop;
-      __ Bind(&init_loop);
-      __ AddImmediate(R8, 2 * kWordSize);
-      __ cmp(R8, Operand(R3));
-      __ strd(R6, Address(R8, -2 * kWordSize), LS);
-      __ b(&init_loop, CC);
-      __ str(R6, Address(R8, -2 * kWordSize), HI);
+      __ InitializeFieldsNoBarrier(R0, R8, R3, R6, R7);
     }
   }
   __ b(done);
@@ -3786,7 +3882,7 @@
 
 
 LocationSummary* BoxInt64Instr::MakeLocationSummary(Isolate* isolate,
-                                                      bool opt) const {
+                                                    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
   LocationSummary* summary = new(isolate) LocationSummary(
@@ -5140,6 +5236,28 @@
 }
 
 
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
+    Isolate* isolate, bool opt) const {
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, InputCount(), kNumTemps, LocationSummary::kCall);
+  summary->set_in(0, Location::RegisterLocation(R0));
+  summary->set_in(1, Location::RegisterLocation(R1));
+  summary->set_in(2, Location::RegisterLocation(R2));
+  summary->set_in(3, Location::RegisterLocation(R3));
+  summary->set_out(0, Location::RegisterLocation(R0));
+  return summary;
+}
+
+
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
+    FlowGraphCompiler* compiler) {
+
+  // Call the function.
+  __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
+}
+
+
 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   if (result_cid() == kDoubleCid) {
@@ -6207,8 +6325,13 @@
         // Check for overflow.
         if (can_overflow()) {
           // Compare high word from input with shifted high word from output.
-          if (shift > 31) {
-            __ cmp(left_hi, Operand(out_hi));
+          // If shift > 32, also compare low word from input with high word from
+          // output shifted back shift - 32.
+          if (shift > 32) {
+            __ cmp(left_lo, Operand(out_hi, ASR, shift - 32));
+            __ cmp(left_hi, Operand(out_hi, ASR, 31), EQ);
+          } else if (shift == 32) {
+            __ cmp(left_hi, Operand(out_hi, ASR, 31));
           } else {
             __ cmp(left_hi, Operand(out_hi, ASR, shift));
           }
@@ -6233,35 +6356,33 @@
       __ b(deopt, HI);
     }
 
-    __ mov(out_lo, Operand(left_lo));
-    __ mov(out_hi, Operand(left_hi));
-
     switch (op_kind()) {
       case Token::kSHR: {
-        __ cmp(shift, Operand(32));
-
-        __ mov(out_lo, Operand(out_hi), HI);
-        __ Asr(out_hi, out_hi, Operand(31), HI);
-        __ sub(shift, shift, Operand(32), HI);
-
-        __ rsb(IP, shift, Operand(32));
-        __ mov(IP, Operand(out_hi, LSL, IP));
-        __ orr(out_lo, IP, Operand(out_lo, LSR, shift));
-        __ Asr(out_hi, out_hi, shift);
+        __ rsbs(IP, shift, Operand(32));
+        __ sub(IP, shift, Operand(32), MI);
+        __ mov(out_lo, Operand(left_hi, ASR, IP), MI);
+        __ mov(out_lo, Operand(left_lo, LSR, shift), PL);
+        __ orr(out_lo, out_lo, Operand(left_hi, LSL, IP), PL);
+        __ mov(out_hi, Operand(left_hi, ASR, shift));
         break;
       }
       case Token::kSHL: {
         __ rsbs(IP, shift, Operand(32));
         __ sub(IP, shift, Operand(32), MI);
-        __ mov(out_hi, Operand(out_lo, LSL, IP), MI);
-        __ mov(out_hi, Operand(out_hi, LSL, shift), PL);
-        __ orr(out_hi, out_hi, Operand(out_lo, LSR, IP), PL);
-        __ mov(out_lo, Operand(out_lo, LSL, shift));
+        __ mov(out_hi, Operand(left_lo, LSL, IP), MI);
+        __ mov(out_hi, Operand(left_hi, LSL, shift), PL);
+        __ orr(out_hi, out_hi, Operand(left_lo, LSR, IP), PL);
+        __ mov(out_lo, Operand(left_lo, LSL, shift));
 
         // Check for overflow.
         if (can_overflow()) {
+          // If shift > 32, compare low word from input with high word from
+          // output shifted back shift - 32.
+          __ mov(IP, Operand(out_hi, ASR, IP), MI);
+          __ mov(IP, Operand(left_lo), PL);  // No test if shift <= 32.
+          __ cmp(left_lo, Operand(IP));
           // Compare high word from input with shifted high word from output.
-          __ cmp(left_hi, Operand(out_hi, ASR, shift));
+          __ cmp(left_hi, Operand(out_hi, ASR, shift), EQ);
           // Overflow if they aren't equal.
           __ b(deopt, NE);
         }
@@ -6615,6 +6736,38 @@
 }
 
 
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+
+  LocationSummary* summary = new(isolate) LocationSummary(
+        isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Register target_address_reg = locs()->temp_slot(0)->reg();
+
+  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
+  __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+
+  // Add the offset.
+  Register offset_reg = locs()->in(0).reg();
+  __ add(target_address_reg,
+         target_address_reg,
+         Operand(offset_reg, ASR, kSmiTagSize));
+
+  // Jump to the absolute address.
+  __ bx(target_address_reg);
+}
+
+
 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index ecea14d..47f9089 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -1135,6 +1135,55 @@
 }
 
 
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
+                                                         bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const Register array = locs()->in(0).reg();
+  const Location index = locs()->in(1);
+
+  Address element_address = __ ElementAddressForRegIndex(
+        true,  IsExternal(), class_id(), index_scale(), array, index.reg());
+  // Warning: element_address may use register TMP as base.
+
+  Register result = locs()->out(0).reg();
+  switch (class_id()) {
+    case kOneByteStringCid:
+    case kExternalOneByteStringCid:
+      switch (element_count()) {
+        case 1: __ ldr(result, element_address, kUnsignedByte); break;
+        case 2: __ ldr(result, element_address, kUnsignedHalfword); break;
+        case 4: __ ldr(result, element_address, kUnsignedWord); break;
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    case kTwoByteStringCid:
+    case kExternalTwoByteStringCid:
+      switch (element_count()) {
+        case 1: __ ldr(result, element_address, kUnsignedHalfword); break;
+        case 2: __ ldr(result, element_address, kUnsignedWord); break;
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
@@ -4321,6 +4370,28 @@
 }
 
 
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
+    Isolate* isolate, bool opt) const {
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, InputCount(), kNumTemps, LocationSummary::kCall);
+  summary->set_in(0, Location::RegisterLocation(R0));
+  summary->set_in(1, Location::RegisterLocation(R1));
+  summary->set_in(2, Location::RegisterLocation(R2));
+  summary->set_in(3, Location::RegisterLocation(R3));
+  summary->set_out(0, Location::RegisterLocation(R0));
+  return summary;
+}
+
+
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
+    FlowGraphCompiler* compiler) {
+
+  // Call the function.
+  __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
+}
+
+
 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   if (result_cid() == kDoubleCid) {
@@ -5353,6 +5424,38 @@
 }
 
 
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+
+  LocationSummary* summary = new(isolate) LocationSummary(
+        isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Register target_address_reg = locs()->temp_slot(0)->reg();
+
+  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
+  __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+
+  // Add the offset.
+  Register offset_reg = locs()->in(0).reg();
+  __ add(target_address_reg,
+         target_address_reg,
+         Operand(offset_reg, ASR, kSmiTagSize));
+
+  // Jump to the absolute address.
+  __ br(target_address_reg);
+}
+
+
 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 7eb2995..ccf4a25 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -2080,13 +2080,13 @@
       intptr_t current_offset = 0;
       __ movl(EBX, raw_null);
       while (current_offset < array_size) {
-        __ movl(Address(EDI, current_offset), EBX);
+        __ StoreIntoObjectNoBarrier(EAX, Address(EDI, current_offset), EBX);
         current_offset += kWordSize;
       }
     } else {
       Label init_loop;
       __ Bind(&init_loop);
-      __ movl(Address(EDI, 0), raw_null);
+      __ StoreIntoObjectNoBarrier(EAX, Address(EDI, 0), Object::null_object());
       __ addl(EDI, Immediate(kWordSize));
       __ cmpl(EDI, EBX);
       __ j(BELOW, &init_loop, Assembler::kNearJump);
@@ -3695,6 +3695,117 @@
 }
 
 
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
+                                                         bool opt) const {
+  const bool might_box = (representation() == kTagged) && !can_pack_into_smi();
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = might_box ? 1 : 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, kNumInputs, kNumTemps,
+      might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  // The smi index is either untagged (element size == 1), or it is left smi
+  // tagged (for all element sizes > 1).
+  summary->set_in(1, (index_scale() == 1) ? Location::WritableRegister()
+                                          : Location::RequiresRegister());
+  if (might_box) {
+    summary->set_temp(0, Location::RequiresRegister());
+  }
+
+  if (representation() == kUnboxedMint) {
+    summary->set_out(0, Location::Pair(Location::RequiresRegister(),
+                                       Location::RequiresRegister()));
+  } else {
+    ASSERT(representation() == kTagged);
+    summary->set_out(0, Location::RequiresRegister());
+  }
+
+  return summary;
+}
+
+
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const Register array = locs()->in(0).reg();
+  const Location index = locs()->in(1);
+
+  Address element_address = Assembler::ElementAddressForRegIndex(
+        IsExternal(), class_id(), index_scale(), array, index.reg());
+
+  if ((index_scale() == 1)) {
+    __ SmiUntag(index.reg());
+  }
+
+  if (representation() == kUnboxedMint) {
+    ASSERT(compiler->is_optimizing());
+    ASSERT(locs()->out(0).IsPairLocation());
+    PairLocation* result_pair = locs()->out(0).AsPairLocation();
+    Register result1 = result_pair->At(0).reg();
+    Register result2 = result_pair->At(1).reg();
+
+    switch (class_id()) {
+      case kOneByteStringCid:
+      case kExternalOneByteStringCid:
+        ASSERT(element_count() == 4);
+        __ movl(result1, element_address);
+        __ xorl(result2, result2);
+        break;
+      case kTwoByteStringCid:
+      case kExternalTwoByteStringCid:
+        ASSERT(element_count() == 2);
+        __ movl(result1, element_address);
+        __ xorl(result2, result2);
+        break;
+      default:
+        UNREACHABLE();
+    }
+  } else {
+    ASSERT(representation() == kTagged);
+    Register result = locs()->out(0).reg();
+    switch (class_id()) {
+      case kOneByteStringCid:
+      case kExternalOneByteStringCid:
+        switch (element_count()) {
+          case 1: __ movzxb(result, element_address); break;
+          case 2: __ movzxw(result, element_address); break;
+          case 4: __ movl(result, element_address); break;
+          default: UNREACHABLE();
+        }
+        break;
+      case kTwoByteStringCid:
+      case kExternalTwoByteStringCid:
+        switch (element_count()) {
+          case 1: __ movzxw(result, element_address); break;
+          case 2: __ movl(result, element_address); break;
+          default: UNREACHABLE();
+        }
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+    if (can_pack_into_smi()) {
+      __ SmiTag(result);
+    } else {
+      // If the value cannot fit in a smi then allocate a mint box for it.
+      Register temp = locs()->temp(0).reg();
+      ASSERT(temp != result);
+      __ MoveRegister(temp, result);
+      __ SmiTag(result);
+
+      Label done;
+      __ testl(temp, Immediate(0xC0000000));
+      __ j(ZERO, &done);
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->mint_class(), result, kNoRegister);
+      __ movl(FieldAddress(result, Mint::value_offset()), temp);
+      __ movl(FieldAddress(result, Mint::value_offset() + kWordSize),
+              Immediate(0));
+      __ Bind(&done);
+    }
+  }
+}
+
+
 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate,
                                                           bool opt) const {
   const intptr_t kNumInputs = 2;
@@ -4791,6 +4902,42 @@
 }
 
 
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
+    Isolate* isolate, bool opt) const {
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, InputCount(), kNumTemps, LocationSummary::kCall);
+  summary->set_in(0, Location::RegisterLocation(EAX));
+  summary->set_in(1, Location::RegisterLocation(ECX));
+  summary->set_in(2, Location::RegisterLocation(EDX));
+  summary->set_in(3, Location::RegisterLocation(EBX));
+  summary->set_out(0, Location::RegisterLocation(EAX));
+  return summary;
+}
+
+
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
+    FlowGraphCompiler* compiler) {
+
+  // Save ESP. EDI is chosen because it is callee saved so we do not need to
+  // back it up before calling into the runtime.
+  static const Register kSavedSPReg = EDI;
+  __ movl(kSavedSPReg, ESP);
+  __ ReserveAlignedFrameSpace(kWordSize * TargetFunction().argument_count());
+
+  __ movl(Address(ESP, + 0 * kWordSize), locs()->in(0).reg());
+  __ movl(Address(ESP, + 1 * kWordSize), locs()->in(1).reg());
+  __ movl(Address(ESP, + 2 * kWordSize), locs()->in(2).reg());
+  __ movl(Address(ESP, + 3 * kWordSize), locs()->in(3).reg());
+
+  // Call the function.
+  __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
+
+  // Restore ESP.
+  __ movl(ESP, kSavedSPReg);
+}
+
+
 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   if (result_cid() == kDoubleCid) {
@@ -5921,7 +6068,6 @@
           __ movl(temp1, left_hi);  // Preserve high 32 bits.
           if (shift > 31) {
             __ movl(left_hi, left_lo);  // Shift by 32.
-            __ xorl(left_lo, left_lo);  // Zero left_lo.
             if (shift > 32) {
               __ shll(left_hi, Immediate(shift - 32));
             }
@@ -5931,6 +6077,15 @@
             __ sarl(temp2, Immediate(31));
             __ cmpl(temp1, temp2);
             __ j(NOT_EQUAL, deopt);
+            if (shift > 32) {
+              // Also compare low word from input with high word from
+              // output shifted back shift - 32.
+              __ movl(temp2, left_hi);
+              __ sarl(temp2, Immediate(shift - 32));
+              __ cmpl(left_lo, temp2);
+              __ j(NOT_EQUAL, deopt);
+            }
+            __ xorl(left_lo, left_lo);  // Zero left_lo.
           } else {
             __ shldl(left_hi, left_lo, Immediate(shift));
             __ shll(left_lo, Immediate(shift));
@@ -6006,7 +6161,6 @@
           __ Bind(&large_shift);
           // No need to subtract 32 from CL, only 5 bits used by shll.
           __ movl(left_hi, left_lo);  // Shift by 32.
-          __ xorl(left_lo, left_lo);  // Zero left_lo.
           __ shll(left_hi, ECX);  // Shift count: CL % 32.
           // Check for overflow by sign extending the high 32 bits
           // and comparing with the input.
@@ -6014,6 +6168,13 @@
           __ sarl(temp2, Immediate(31));
           __ cmpl(temp1, temp2);
           __ j(NOT_EQUAL, deopt);
+          // Also compare low word from input with high word from
+          // output shifted back shift - 32.
+          __ movl(temp2, left_hi);
+          __ sarl(temp2, ECX);  // Shift count: CL % 32.
+          __ cmpl(left_lo, temp2);
+          __ j(NOT_EQUAL, deopt);
+          __ xorl(left_lo, left_lo);  // Zero left_lo.
         } else {
           __ cmpl(ECX, Immediate(31));
           __ j(ABOVE, &large_shift);
@@ -6362,6 +6523,37 @@
 }
 
 
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+
+  LocationSummary* summary = new(isolate) LocationSummary(
+        isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Register target_address_reg = locs()->temp_slot(0)->reg();
+
+  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
+  __ movl(target_address_reg, Address(EBP, kPcMarkerSlotFromFp * kWordSize));
+
+  // Add the offset.
+  Register offset_reg = locs()->in(0).reg();
+  __ SmiUntag(offset_reg);
+  __ addl(target_address_reg, offset_reg);
+
+  // Jump to the absolute address.
+  __ jmp(target_address_reg);
+}
+
+
 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 46b2555..1257aed 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1241,6 +1241,58 @@
 }
 
 
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
+                                                         bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, Location::RequiresRegister());
+
+  // TODO(zerny): Handle mints properly once possible.
+  ASSERT(representation() == kTagged);
+  summary->set_out(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const Register array = locs()->in(0).reg();
+  const Location index = locs()->in(1);
+
+  Address element_address = __ ElementAddressForRegIndex(
+        true, IsExternal(), class_id(), index_scale(), array, index.reg());
+  // Warning: element_address may use register TMP as base.
+
+  ASSERT(representation() == kTagged);
+  Register result = locs()->out(0).reg();
+  switch (class_id()) {
+    case kOneByteStringCid:
+      switch (element_count()) {
+        case 1: __ lbu(result, element_address); break;
+        case 2: __ lhu(result, element_address); break;
+        case 4:  // Loading multiple code units is disabled on MIPS.
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    case kTwoByteStringCid:
+      switch (element_count()) {
+        case 1: __ lhu(result, element_address); break;
+        case 2:  // Loading multiple code units is disabled on MIPS.
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   // Array can be a Dart object or a pointer to external data.
@@ -3744,6 +3796,28 @@
 }
 
 
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
+    Isolate* isolate, bool opt) const {
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, InputCount(), kNumTemps, LocationSummary::kCall);
+  summary->set_in(0, Location::RegisterLocation(A0));
+  summary->set_in(1, Location::RegisterLocation(A1));
+  summary->set_in(2, Location::RegisterLocation(A2));
+  summary->set_in(3, Location::RegisterLocation(A3));
+  summary->set_out(0, Location::RegisterLocation(V0));
+  return summary;
+}
+
+
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
+    FlowGraphCompiler* compiler) {
+
+  // Call the function.
+  __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
+}
+
+
 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   if (result_cid() == kDoubleCid) {
@@ -4721,6 +4795,37 @@
 }
 
 
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+
+  LocationSummary* summary = new(isolate) LocationSummary(
+        isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Register target_address_reg = locs()->temp_slot(0)->reg();
+
+  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
+  __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+
+  // Add the offset.
+  Register offset_reg = locs()->in(0).reg();
+  __ SmiUntag(offset_reg);
+  __ addu(target_address_reg, target_address_reg, offset_reg);
+
+  // Jump to the absolute address.
+  __ jr(target_address_reg);
+}
+
+
 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 0616adb..e45d150 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1131,6 +1131,60 @@
 }
 
 
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
+                                                         bool opt) const {
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  // The smi index is either untagged (element size == 1), or it is left smi
+  // tagged (for all element sizes > 1).
+  summary->set_in(1, index_scale() == 1 ? Location::WritableRegister()
+                                        : Location::RequiresRegister());
+  summary->set_out(0, Location::RequiresRegister());
+  return summary;
+}
+
+
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  const Register array = locs()->in(0).reg();
+  const Location index = locs()->in(1);
+
+  Address element_address = Assembler::ElementAddressForRegIndex(
+        IsExternal(), class_id(), index_scale(), array, index.reg());
+
+  if ((index_scale() == 1)) {
+    __ SmiUntag(index.reg());
+  }
+  Register result = locs()->out(0).reg();
+  switch (class_id()) {
+    case kOneByteStringCid:
+    case kExternalOneByteStringCid:
+      switch (element_count()) {
+        case 1: __ movzxb(result, element_address); break;
+        case 2: __ movzxw(result, element_address); break;
+        case 4: __ movl(result, element_address); break;
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    case kTwoByteStringCid:
+    case kExternalTwoByteStringCid:
+      switch (element_count()) {
+        case 1: __ movzxw(result, element_address); break;
+        case 2: __ movl(result, element_address); break;
+        default: UNREACHABLE();
+      }
+      __ SmiTag(result);
+      break;
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
 Representation StoreIndexedInstr::RequiredInputRepresentation(
     intptr_t idx) const {
   if (idx == 0) return kNoRepresentation;
@@ -1253,7 +1307,7 @@
         __ StoreIntoObject(array, element_address, value);
       } else if (locs()->in(2).IsConstant()) {
         const Object& constant = locs()->in(2).constant();
-        __ StoreObject(element_address, constant, PP);
+        __ StoreIntoObjectNoBarrier(array, element_address, constant, PP);
       } else {
         Register value = locs()->in(2).reg();
         __ StoreIntoObjectNoBarrier(array, element_address, value);
@@ -1857,8 +1911,9 @@
                        CanValueBeSmi());
   } else {
     if (locs()->in(1).IsConstant()) {
-      __ StoreObject(FieldAddress(instance_reg, offset_in_bytes_),
-                     locs()->in(1).constant(), PP);
+      __ StoreIntoObjectNoBarrier(instance_reg,
+                                  FieldAddress(instance_reg, offset_in_bytes_),
+                                  locs()->in(1).constant(), PP);
     } else {
       Register value_reg = locs()->in(1).reg();
       __ StoreIntoObjectNoBarrier(instance_reg,
@@ -1999,13 +2054,13 @@
     if (array_size < (kInlineArraySize * kWordSize)) {
       intptr_t current_offset = 0;
       while (current_offset < array_size) {
-        __ movq(Address(RDI, current_offset), R12);
+        __ StoreIntoObjectNoBarrier(RAX, Address(RDI, current_offset), R12);
         current_offset += kWordSize;
       }
     } else {
       Label init_loop;
       __ Bind(&init_loop);
-      __ movq(Address(RDI, 0), R12);
+      __ StoreIntoObjectNoBarrier(RAX, Address(RDI, 0), R12);
       __ addq(RDI, Immediate(kWordSize));
       __ cmpq(RDI, RCX);
       __ j(BELOW, &init_loop, Assembler::kNearJump);
@@ -3416,7 +3471,7 @@
 
 
 LocationSummary* BoxInt64Instr::MakeLocationSummary(Isolate* isolate,
-                                                      bool opt) const {
+                                                    bool opt) const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
   LocationSummary* summary = new(isolate) LocationSummary(
@@ -4561,6 +4616,37 @@
 }
 
 
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
+    Isolate* isolate, bool opt) const {
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary = new(isolate) LocationSummary(
+      isolate, InputCount(), kNumTemps, LocationSummary::kCall);
+  summary->set_in(0, Location::RegisterLocation(CallingConventions::kArg1Reg));
+  summary->set_in(1, Location::RegisterLocation(CallingConventions::kArg2Reg));
+  summary->set_in(2, Location::RegisterLocation(CallingConventions::kArg3Reg));
+  summary->set_in(3, Location::RegisterLocation(CallingConventions::kArg4Reg));
+  summary->set_out(0, Location::RegisterLocation(RAX));
+  return summary;
+}
+
+
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
+    FlowGraphCompiler* compiler) {
+
+  // Save RSP. R13 is chosen because it is callee saved so we do not need to
+  // back it up before calling into the runtime.
+  static const Register kSavedSPReg = R13;
+  __ movq(kSavedSPReg, RSP);
+  __ ReserveAlignedFrameSpace(0);
+
+  // Call the function. Parameters are already in their correct spots.
+  __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
+
+  // Restore RSP.
+  __ movq(RSP, kSavedSPReg);
+}
+
+
 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -6084,6 +6170,36 @@
 }
 
 
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate,
+                                                        bool opt) const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 1;
+
+  LocationSummary* summary = new(isolate) LocationSummary(
+        isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_temp(0, Location::RequiresRegister());
+
+  return summary;
+}
+
+
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  Register offset_reg = locs()->in(0).reg();
+  Register target_address_reg = locs()->temp_slot(0)->reg();
+
+  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
+  __ movq(target_address_reg, Address(RBP, kPcMarkerSlotFromFp * kWordSize));
+
+  // Calculate the final absolute address.
+  __ SmiUntag(offset_reg);
+  __ addq(target_address_reg, offset_reg);
+
+  // Jump to the absolute address.
+  __ jmp(target_address_reg);
+}
+
 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate,
                                                          bool opt) const {
   const intptr_t kNumInputs = 2;
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index c195e30..a59af23 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -153,7 +153,7 @@
 #undef EMIT_CASE
   }
 
-  if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) {
+  if (FLAG_print_flow_graph) {
     OS::Print("Intrinsic graph before\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
@@ -163,7 +163,7 @@
   FlowGraphAllocator allocator(*graph, true);  // Intrinsic mode.
   allocator.AllocateRegisters();
 
-  if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) {
+  if (FLAG_print_flow_graph) {
     OS::Print("Intrinsic graph after\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index d921f98..f608b5a 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -9,9 +9,11 @@
 
 #include "vm/assembler.h"
 #include "vm/cpu.h"
+#include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/regexp_assembler.h"
 #include "vm/symbols.h"
 
 namespace dart {
@@ -1978,6 +1980,41 @@
 }
 
 
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+  if (FLAG_use_jscre) {
+    return;
+  }
+  static const intptr_t kRegExpParamOffset = 2 * kWordSize;
+  static const intptr_t kStringParamOffset = 1 * kWordSize;
+  // start_index smi is located at offset 0.
+
+  // Incoming registers:
+  // R0: Function. (Will be reloaded with the specialized matcher function.)
+  // R4: Arguments descriptor. (Will be preserved.)
+  // R5: Unknown. (Must be GC safe on tail call.)
+
+  // Load the specialized function pointer into R0. Leverage the fact the
+  // string CIDs as well as stored function pointers are in sequence.
+  __ ldr(R2, Address(SP, kRegExpParamOffset));
+  __ ldr(R1, Address(SP, kStringParamOffset));
+  __ LoadClassId(R1, R1);
+  __ AddImmediate(R1, R1, -kOneByteStringCid);
+  __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
+  __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid)));
+
+  // Registers are now set up for the lazy compile stub. It expects the function
+  // in R0, the argument descriptor in R4, and IC-Data in R5.
+  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+  __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
+  __ eor(R5, R5, Operand(R5));
+
+  // Tail-call the function.
+  __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
+  __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag);
+  __ bx(R1);
+}
+
+
 // On stack: user tag (+0).
 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
   // R1: Isolate.
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 5e15cfc..ede143b 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -8,9 +8,11 @@
 #include "vm/intrinsifier.h"
 
 #include "vm/assembler.h"
+#include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/regexp_assembler.h"
 #include "vm/symbols.h"
 
 namespace dart {
@@ -1933,6 +1935,41 @@
 }
 
 
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+  if (FLAG_use_jscre) {
+    return;
+  }
+  static const intptr_t kRegExpParamOffset = 2 * kWordSize;
+  static const intptr_t kStringParamOffset = 1 * kWordSize;
+  // start_index smi is located at offset 0.
+
+  // Incoming registers:
+  // R0: Function. (Will be reloaded with the specialized matcher function.)
+  // R4: Arguments descriptor. (Will be preserved.)
+  // R5: Unknown. (Must be GC safe on tail call.)
+
+  // Load the specialized function pointer into R0. Leverage the fact the
+  // string CIDs as well as stored function pointers are in sequence.
+  __ ldr(R2, Address(SP, kRegExpParamOffset));
+  __ ldr(R1, Address(SP, kStringParamOffset));
+  __ LoadClassId(R1, R1, kNoPP);
+  __ AddImmediate(R1, R1, -kOneByteStringCid, kNoPP);
+  __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
+  __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid)));
+
+  // Registers are now set up for the lazy compile stub. It expects the function
+  // in R0, the argument descriptor in R4, and IC-Data in R5.
+  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+  __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)), kNoPP);
+  __ eor(R5, R5, Operand(R5));
+
+  // Tail-call the function.
+  __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
+  __ AddImmediate(R1, R1, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
+  __ br(R1);
+}
+
+
 // On stack: user tag (+0).
 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
   // R1: Isolate.
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 35db4cd..9101614bb 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -14,11 +14,12 @@
 #include "vm/intrinsifier.h"
 
 #include "vm/assembler.h"
+#include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os.h"
-#include "vm/stub_code.h"
+#include "vm/regexp_assembler.h"
 #include "vm/symbols.h"
 
 namespace dart {
@@ -132,9 +133,7 @@
       FieldAddress(EAX, GrowableObjectArray::type_arguments_offset()),
       EBX);
 
-  // Set the length field in the growable array object to 0.
-  __ movl(FieldAddress(EAX, GrowableObjectArray::length_offset()),
-          Immediate(0));
+  __ ZeroSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()));
   __ ret();  // returns the newly allocated object in EAX.
 
   __ Bind(&fall_through);
@@ -199,7 +198,8 @@
   __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Length value.
   __ testl(EBX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi length.
-  __ movl(FieldAddress(EAX, GrowableObjectArray::length_offset()), EBX);
+  FieldAddress length_field(EAX, GrowableObjectArray::length_offset());
+  __ StoreIntoSmiField(length_field, EBX);
   __ ret();
   __ Bind(&fall_through);
 }
@@ -1828,7 +1828,7 @@
   __ incl(EAX);
   __ Bind(&set_hash_code);
   __ SmiTag(EAX);
-  __ movl(FieldAddress(EBX, String::hash_offset()), EAX);
+  __ StoreIntoSmiField(FieldAddress(EBX, String::hash_offset()), EAX);
   __ ret();
 }
 
@@ -1901,7 +1901,7 @@
                               FieldAddress(EAX, String::length_offset()),
                               EDI);
   // Clear hash.
-  __ movl(FieldAddress(EAX, String::hash_offset()), Immediate(0));
+  __ ZeroSmiField(FieldAddress(EAX, String::hash_offset()));
   __ jmp(ok, Assembler::kNearJump);
 
   __ Bind(&pop_and_fail);
@@ -2050,6 +2050,41 @@
 }
 
 
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+  if (FLAG_use_jscre) {
+    return;
+  }
+  static const intptr_t kRegExpParamOffset = 3 * kWordSize;
+  static const intptr_t kStringParamOffset = 2 * kWordSize;
+  // start_index smi is located at offset 1.
+
+  // Incoming registers:
+  // EAX: Function. (Will be loaded with the specialized matcher function.)
+  // ECX: Unknown. (Must be GC safe on tail call.)
+  // EDX: Arguments descriptor. (Will be preserved.)
+
+  // Load the specialized function pointer into EAX. Leverage the fact the
+  // string CIDs as well as stored function pointers are in sequence.
+  __ movl(EBX, Address(ESP, kRegExpParamOffset));
+  __ movl(EDI, Address(ESP, kStringParamOffset));
+  __ LoadClassId(EDI, EDI);
+  __ SubImmediate(EDI, Immediate(kOneByteStringCid));
+  __ movl(EAX, FieldAddress(EBX, EDI, TIMES_4,
+                            JSRegExp::function_offset(kOneByteStringCid)));
+
+  // Registers are now set up for the lazy compile stub. It expects the function
+  // in EAX, the argument descriptor in EDX, and IC-Data in ECX.
+  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+  __ LoadObject(EDX, Array::Handle(ArgumentsDescriptor::New(arg_count)));
+  __ xorl(ECX, ECX);
+
+  // Tail-call the function.
+  __ movl(EDI, FieldAddress(EAX, Function::instructions_offset()));
+  __ addl(EDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ jmp(EDI);
+}
+
+
 // On stack: user tag (+1), return-address (+0).
 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
   Isolate* isolate = Isolate::Current();
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index f3c1ef5..e70a0d5 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -8,9 +8,11 @@
 #include "vm/intrinsifier.h"
 
 #include "vm/assembler.h"
+#include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/regexp_assembler.h"
 #include "vm/symbols.h"
 
 namespace dart {
@@ -2066,6 +2068,43 @@
   StringEquality(assembler, kTwoByteStringCid);
 }
 
+
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+  if (FLAG_use_jscre) {
+    return;
+  }
+  static const intptr_t kRegExpParamOffset = 2 * kWordSize;
+  static const intptr_t kStringParamOffset = 1 * kWordSize;
+  // start_index smi is located at 0.
+
+  // Incoming registers:
+  // T0: Function. (Will be reloaded with the specialized matcher function.)
+  // S4: Arguments descriptor. (Will be preserved.)
+  // S5: Unknown. (Must be GC safe on tail call.)
+
+  // Load the specialized function pointer into T0. Leverage the fact the
+  // string CIDs as well as stored function pointers are in sequence.
+  __ lw(T1, Address(SP, kRegExpParamOffset));
+  __ lw(T3, Address(SP, kStringParamOffset));
+  __ LoadClassId(T2, T3);
+  __ AddImmediate(T2, -kOneByteStringCid);
+  __ sll(T2, T2, kWordSizeLog2);
+  __ addu(T2, T2, T1);
+  __ lw(T0, FieldAddress(T2, JSRegExp::function_offset(kOneByteStringCid)));
+
+  // Registers are now set up for the lazy compile stub. It expects the function
+  // in T0, the argument descriptor in S4, and IC-Data in S5.
+  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+  __ LoadObject(S4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
+  __ mov(S5, ZR);
+
+  // Tail-call the function.
+  __ lw(T3, FieldAddress(T0, Function::instructions_offset()));
+  __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
+  __ jr(T3);
+}
+
+
 // On stack: user tag (+0).
 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
   // T1: Isolate.
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 0ee068a..7f9b8de 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -8,9 +8,11 @@
 #include "vm/intrinsifier.h"
 
 #include "vm/assembler.h"
+#include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
 #include "vm/object_store.h"
+#include "vm/regexp_assembler.h"
 #include "vm/symbols.h"
 
 namespace dart {
@@ -88,8 +90,7 @@
       RCX);
 
   // Set the length field in the growable array object to 0.
-  __ movq(FieldAddress(RAX, GrowableObjectArray::length_offset()),
-          Immediate(0));
+  __ ZeroSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset()));
   __ ret();  // returns the newly allocated object in RAX.
 
   __ Bind(&fall_through);
@@ -154,7 +155,8 @@
   __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Length value.
   __ testq(RCX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi length.
-  __ movq(FieldAddress(RAX, GrowableObjectArray::length_offset()), RCX);
+  FieldAddress length_field(RAX, GrowableObjectArray::length_offset());
+  __ StoreIntoSmiField(length_field, RCX);
   __ ret();
   __ Bind(&fall_through);
 }
@@ -196,10 +198,9 @@
   // Compare length with capacity.
   __ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
   __ j(EQUAL, &fall_through);  // Must grow data.
-  const Immediate& value_one =
-      Immediate(reinterpret_cast<int64_t>(Smi::New(1)));
   // len = len + 1;
-  __ addq(FieldAddress(RAX, GrowableObjectArray::length_offset()), value_one);
+  __ IncrementSmiField(FieldAddress(RAX, GrowableObjectArray::length_offset()),
+                       1);
   __ movq(RAX, Address(RSP, + 1 * kWordSize));  // Value
   ASSERT(kSmiTagShift == 1);
   __ StoreIntoObject(RDX,
@@ -829,10 +830,12 @@
 
   __ movq(RDI, Address(RSP, 5 * kWordSize));  // digits
   __ movq(R8, Address(RSP, 4 * kWordSize));  // used is Smi
-  __ SmiUntag(R8);  // used > 0.
+  __ addq(R8, Immediate(2));  // used > 0, Smi. R8 = used + 1, round up.
+  __ sarq(R8, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RSI, Address(RSP, 3 * kWordSize));  // a_digits
   __ movq(RCX, Address(RSP, 2 * kWordSize));  // a_used is Smi
-  __ SmiUntag(RCX);  // a_used > 0.
+  __ addq(RCX, Immediate(2));  // a_used > 0, Smi. R8 = a_used + 1, round up.
+  __ sarq(RCX, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RBX, Address(RSP, 1 * kWordSize));  // r_digits
 
   // Precompute 'used - a_used' now so that carry flag is not lost later.
@@ -842,10 +845,10 @@
   __ xorq(RDX, RDX);  // RDX = 0, carry flag = 0.
   Label add_loop;
   __ Bind(&add_loop);
-  // Loop a_used times, RCX = a_used, RCX > 0.
-  __ movl(RAX, FieldAddress(RDI, RDX, TIMES_4, TypedData::data_offset()));
-  __ adcl(RAX, FieldAddress(RSI, RDX, TIMES_4, TypedData::data_offset()));
-  __ movl(FieldAddress(RBX, RDX, TIMES_4, TypedData::data_offset()), RAX);
+  // Loop (a_used+1)/2 times, RCX > 0.
+  __ movq(RAX, FieldAddress(RDI, RDX, TIMES_8, TypedData::data_offset()));
+  __ adcq(RAX, FieldAddress(RSI, RDX, TIMES_8, TypedData::data_offset()));
+  __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
   __ decq(RCX);  // Does not affect carry flag.
   __ j(NOT_ZERO, &add_loop, Assembler::kNearJump);
@@ -856,18 +859,18 @@
 
   Label carry_loop;
   __ Bind(&carry_loop);
-  // Loop used - a_used times, R8 = used - a_used, R8 > 0.
-  __ movl(RAX, FieldAddress(RDI, RDX, TIMES_4, TypedData::data_offset()));
-  __ adcl(RAX, Immediate(0));
-  __ movl(FieldAddress(RBX, RDX, TIMES_4, TypedData::data_offset()), RAX);
+  // Loop (used+1)/2 - (a_used+1)/2 times, R8 > 0.
+  __ movq(RAX, FieldAddress(RDI, RDX, TIMES_8, TypedData::data_offset()));
+  __ adcq(RAX, Immediate(0));
+  __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
   __ decq(R8);  // Does not affect carry flag.
   __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump);
 
   __ Bind(&last_carry);
-  __ movl(RAX, Immediate(0));
-  __ adcl(RAX, Immediate(0));
-  __ movl(FieldAddress(RBX, RDX, TIMES_4, TypedData::data_offset()), RAX);
+  __ movq(RAX, Immediate(0));
+  __ adcq(RAX, Immediate(0));
+  __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
 
   // Returning Object::null() is not required, since this method is private.
   __ ret();
@@ -881,10 +884,12 @@
 
   __ movq(RDI, Address(RSP, 5 * kWordSize));  // digits
   __ movq(R8, Address(RSP, 4 * kWordSize));  // used is Smi
-  __ SmiUntag(R8);  // used > 0.
+  __ addq(R8, Immediate(2));  // used > 0, Smi. R8 = used + 1, round up.
+  __ sarq(R8, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RSI, Address(RSP, 3 * kWordSize));  // a_digits
   __ movq(RCX, Address(RSP, 2 * kWordSize));  // a_used is Smi
-  __ SmiUntag(RCX);  // a_used > 0.
+  __ addq(RCX, Immediate(2));  // a_used > 0, Smi. R8 = a_used + 1, round up.
+  __ sarq(RCX, Immediate(2));  // R8 = number of digit pairs to process.
   __ movq(RBX, Address(RSP, 1 * kWordSize));  // r_digits
 
   // Precompute 'used - a_used' now so that carry flag is not lost later.
@@ -894,10 +899,10 @@
   __ xorq(RDX, RDX);  // RDX = 0, carry flag = 0.
   Label sub_loop;
   __ Bind(&sub_loop);
-  // Loop a_used times, RCX = a_used, RCX > 0.
-  __ movl(RAX, FieldAddress(RDI, RDX, TIMES_4, TypedData::data_offset()));
-  __ sbbl(RAX, FieldAddress(RSI, RDX, TIMES_4, TypedData::data_offset()));
-  __ movl(FieldAddress(RBX, RDX, TIMES_4, TypedData::data_offset()), RAX);
+  // Loop (a_used+1)/2 times, RCX > 0.
+  __ movq(RAX, FieldAddress(RDI, RDX, TIMES_8, TypedData::data_offset()));
+  __ sbbq(RAX, FieldAddress(RSI, RDX, TIMES_8, TypedData::data_offset()));
+  __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
   __ decq(RCX);  // Does not affect carry flag.
   __ j(NOT_ZERO, &sub_loop, Assembler::kNearJump);
@@ -908,10 +913,10 @@
 
   Label carry_loop;
   __ Bind(&carry_loop);
-  // Loop used - a_used times, R8 = used - a_used, R8 > 0.
-  __ movl(RAX, FieldAddress(RDI, RDX, TIMES_4, TypedData::data_offset()));
-  __ sbbl(RAX, Immediate(0));
-  __ movl(FieldAddress(RBX, RDX, TIMES_4, TypedData::data_offset()), RAX);
+  // Loop (used+1)/2 - (a_used+1)/2 times, R8 > 0.
+  __ movq(RAX, FieldAddress(RDI, RDX, TIMES_8, TypedData::data_offset()));
+  __ sbbq(RAX, Immediate(0));
+  __ movq(FieldAddress(RBX, RDX, TIMES_8, TypedData::data_offset()), RAX);
   __ incq(RDX);  // Does not affect carry flag.
   __ decq(R8);  // Does not affect carry flag.
   __ j(NOT_ZERO, &carry_loop, Assembler::kNearJump);
@@ -1691,7 +1696,7 @@
   __ incq(RAX);
   __ Bind(&set_hash_code);
   __ SmiTag(RAX);
-  __ movq(FieldAddress(RBX, String::hash_offset()), RAX);
+  __ StoreIntoSmiField(FieldAddress(RBX, String::hash_offset()), RAX);
   __ ret();
 }
 
@@ -1765,7 +1770,7 @@
                               FieldAddress(RAX, String::length_offset()),
                               RDI);
   // Clear hash.
-  __ movq(FieldAddress(RAX, String::hash_offset()), Immediate(0));
+  __ ZeroSmiField(FieldAddress(RAX, String::hash_offset()));
   __ jmp(ok, Assembler::kNearJump);
 
   __ Bind(&pop_and_fail);
@@ -1914,6 +1919,41 @@
 }
 
 
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+  if (FLAG_use_jscre) {
+    return;
+  }
+  static const intptr_t kRegExpParamOffset = 3 * kWordSize;
+  static const intptr_t kStringParamOffset = 2 * kWordSize;
+  // start_index smi is located at offset 1.
+
+  // Incoming registers:
+  // RAX: Function. (Will be loaded with the specialized matcher function.)
+  // RCX: Unknown. (Must be GC safe on tail call.)
+  // R10: Arguments descriptor. (Will be preserved.)
+
+  // Load the specialized function pointer into RAX. Leverage the fact the
+  // string CIDs as well as stored function pointers are in sequence.
+  __ movq(RBX, Address(RSP, kRegExpParamOffset));
+  __ movq(RDI, Address(RSP, kStringParamOffset));
+  __ LoadClassId(RDI, RDI);
+  __ SubImmediate(RDI, Immediate(kOneByteStringCid), PP);
+  __ movq(RAX, FieldAddress(RBX, RDI, TIMES_8,
+                            JSRegExp::function_offset(kOneByteStringCid)));
+
+  // Registers are now set up for the lazy compile stub. It expects the function
+  // in RAX, the argument descriptor in R10, and IC-Data in RCX.
+  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+  __ LoadObject(R10, Array::Handle(ArgumentsDescriptor::New(arg_count)), PP);
+  __ xorq(RCX, RCX);
+
+  // Tail-call the function.
+  __ movq(RDI, FieldAddress(RAX, Function::instructions_offset()));
+  __ addq(RDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ jmp(RDI);
+}
+
+
 // On stack: user tag (+1), return-address (+0).
 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
   // RBX: Isolate.
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 3c5e938..6be38c3 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -647,6 +647,10 @@
 
 
 void Isolate::SetStackLimitFromStackBase(uword stack_base) {
+  // Set stack base.
+  stack_base_ = stack_base;
+
+  // Set stack limit.
 #if defined(USING_SIMULATOR)
   // Ignore passed-in native stack top and use Simulator stack top.
   Simulator* sim = Simulator::Current();  // May allocate a simulator.
@@ -654,10 +658,7 @@
   stack_base = sim->StackTop();
   // The overflow area is accounted for by the simulator.
 #endif
-  // Set stack base.
-  stack_base_ = stack_base;
-  // Set stack limit.
-  SetStackLimit(stack_base_ - GetSpecifiedStackSize());
+  SetStackLimit(stack_base - GetSpecifiedStackSize());
 }
 
 
@@ -680,14 +681,11 @@
 
 
 bool Isolate::GetProfilerStackBounds(uword* lower, uword* upper) const {
-  uword stack_lower = stack_limit();
-  if (stack_lower == kUwordMax) {
-    stack_lower = saved_stack_limit();
-  }
-  if (stack_lower == kUwordMax) {
+  uword stack_upper = stack_base_;
+  if (stack_upper == 0) {
     return false;
   }
-  uword stack_upper = stack_lower + GetSpecifiedStackSize();
+  uword stack_lower = stack_upper - GetSpecifiedStackSize();
   *lower = stack_lower;
   *upper = stack_upper;
   return true;
diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h
index 8d4b7274..e4506e7 100644
--- a/runtime/vm/method_recognizer.h
+++ b/runtime/vm/method_recognizer.h
@@ -155,9 +155,9 @@
 #define CORE_LIB_INTRINSIC_LIST(V)                                             \
   V(_Smi, ~, Smi_bitNegate, 134149043)                                         \
   V(_Smi, get:bitLength, Smi_bitLength, 869986288)                             \
-  V(_Bigint, set:_neg, Bigint_setNeg, 855560832)                               \
-  V(_Bigint, set:_used, Bigint_setUsed, 1792932615)                            \
-  V(_Bigint, _set_digits, Bigint_setDigits, 178162491)                         \
+  V(_Bigint, set:_neg, Bigint_setNeg, 1924982939)                              \
+  V(_Bigint, set:_used, Bigint_setUsed, 1574448752)                            \
+  V(_Bigint, _set_digits, Bigint_setDigits, 1865626071)                        \
   V(_Bigint, _absAdd, Bigint_absAdd, 97148049)                                 \
   V(_Bigint, _absSub, Bigint_absSub, 159012285)                                \
   V(_Bigint, _mulAdd, Bigint_mulAdd, 101252203)                                \
@@ -184,6 +184,7 @@
   V(_GrowableList, _setLength, GrowableArraySetLength, 1832199634)             \
   V(_GrowableList, _setData, GrowableArraySetData, 1722254196)                 \
   V(_GrowableList, add, GrowableArray_add, 422087403)                          \
+  V(_JSSyntaxRegExp, _ExecuteMatch, JSRegExp_ExecuteMatch, 1654250896)         \
   V(Object, ==, ObjectEquals, 1955975370)                                      \
   V(_StringBase, get:hashCode, String_getHashCode, 2102936032)                 \
   V(_StringBase, get:isEmpty, StringBaseIsEmpty, 769493198)                    \
@@ -320,6 +321,8 @@
   V(_ImmutableList, get:length, ImmutableArrayLength, 274947518)               \
   V(_TypedList, get:length, TypedDataLength, 522595148)                        \
   V(_GrowableList, get:length, GrowableArrayLength, 778534898)                 \
+  V(_GrowableList, add, GrowableListAdd, 422087403)                            \
+  V(_GrowableList, removeLast, GrowableListRemoveLast, 1285719639)             \
   V(_StringBase, get:length, StringBaseLength, 784429419)                      \
   V(ListIterator, moveNext, ListIteratorMoveNext, 1001265875)                  \
   V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 890839431)   \
@@ -374,9 +377,12 @@
   V(::, tan, MathTan, 982072809)                                               \
   V(Lists, copy, ListsCopy, 605584668)                                         \
   V(_Bigint, get:_neg, Bigint_getNeg, 1151543890)                              \
+  V(_Bigint, set:_neg, Bigint_setNeg, 1924982939)                              \
   V(_Bigint, get:_used, Bigint_getUsed, 1308559334)                            \
+  V(_Bigint, set:_used, Bigint_setUsed, 1574448752)                            \
   V(_Bigint, get:_digits, Bigint_getDigits, 1408092463)                        \
   V(_Bigint, set:_digits, Bigint_setDigits, 1625268649)                        \
+  V(_Bigint, _set_digits, Bigint_setDigits, 1865626071)                        \
 
 // A list of core function that should never be inlined.
 #define INLINE_BLACK_LIST(V)                                                   \
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6eab91a..557e24d 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -44,6 +44,7 @@
 #include "vm/tags.h"
 #include "vm/timer.h"
 #include "vm/unicode.h"
+#include "vm/verified_memory.h"
 #include "vm/weak_code.h"
 
 namespace dart {
@@ -1698,6 +1699,7 @@
   tags = RawObject::ClassIdTag::update(class_id, tags);
   tags = RawObject::SizeTag::update(size, tags);
   reinterpret_cast<RawObject*>(address)->tags_ = tags;
+  VerifiedMemory::Accept(address, size);
 }
 
 
@@ -1807,6 +1809,7 @@
   memmove(reinterpret_cast<uint8_t*>(clone_addr + kHeaderSizeInBytes),
           reinterpret_cast<uint8_t*>(orig_addr + kHeaderSizeInBytes),
           size - kHeaderSizeInBytes);
+  VerifiedMemory::Accept(clone_addr, size);
   // Add clone to store buffer, if needed.
   if (!raw_clone->IsOldObject()) {
     // No need to remember an object in new space.
@@ -5385,6 +5388,9 @@
     case RawFunction::kInvokeFieldDispatcher:
       return "kInvokeFieldDispatcher";
       break;
+    case RawFunction::kIrregexpFunction:
+      return "kIrregexpFunction";
+      break;
     default:
       UNREACHABLE();
       return NULL;
@@ -5470,6 +5476,29 @@
 }
 
 
+RawJSRegExp* Function::regexp() const {
+  ASSERT(kind() == RawFunction::kIrregexpFunction);
+  const Object& obj = Object::Handle(raw_ptr()->data_);
+  return JSRegExp::Cast(obj).raw();
+}
+
+
+void Function::set_regexp(const JSRegExp& value) const {
+  ASSERT(kind() == RawFunction::kIrregexpFunction);
+  ASSERT(raw_ptr()->data_ == Object::null());
+  set_data(value);
+}
+
+
+void Function::set_regexp_cid(intptr_t regexp_cid) const {
+    ASSERT((regexp_cid == kIllegalCid) ||
+           (kind() == RawFunction::kIrregexpFunction));
+    ASSERT((regexp_cid == kIllegalCid) ||
+           RawObject::IsStringClassId(regexp_cid));
+    StoreNonPointer(&raw_ptr()->regexp_cid_, regexp_cid);
+}
+
+
 void Function::set_result_type(const AbstractType& value) const {
   ASSERT(!value.IsNull());
   StorePointer(&raw_ptr()->result_type_, value.raw());
@@ -6150,6 +6179,7 @@
   result.set_num_optional_parameters(0);
   result.set_usage_counter(0);
   result.set_deoptimization_counter(0);
+  result.set_regexp_cid(kIllegalCid);
   result.set_optimized_instruction_count(0);
   result.set_optimized_call_site_count(0);
   result.set_is_optimizable(is_native ? false : true);
@@ -6178,6 +6208,7 @@
   clone.ClearCode();
   clone.set_usage_counter(0);
   clone.set_deoptimization_counter(0);
+  clone.set_regexp_cid(kIllegalCid);
   clone.set_optimized_instruction_count(0);
   clone.set_optimized_call_site_count(0);
   clone.set_ic_data_array(Array::Handle());
@@ -6745,6 +6776,9 @@
     case RawFunction::kInvokeFieldDispatcher:
       kind_str = "invoke-field-dispatcher";
       break;
+    case RawFunction::kIrregexpFunction:
+      kind_str = "irregexp-function";
+      break;
     default:
       UNREACHABLE();
   }
@@ -12169,6 +12203,7 @@
   MemoryRegion region(reinterpret_cast<void*>(instrs.EntryPoint()),
                       instrs.size());
   assembler->FinalizeInstructions(region);
+  VerifiedMemory::Accept(region.start(), region.size());
   CPU::FlushICache(instrs.EntryPoint(), instrs.size());
 
   code.set_compile_timestamp(OS::GetCurrentTimeMicros());
@@ -12570,7 +12605,7 @@
 
   JSONArray jsarr(&jsobj, "variables");
   for (intptr_t i = 0; i < num_variables(); i++) {
-    const Instance& var = Instance::Handle(At(i));
+    const Object& var = Object::Handle(At(i));
     JSONObject jselement(&jsarr);
     jselement.AddProperty("index", i);
     jselement.AddProperty("value", var);
@@ -15904,9 +15939,9 @@
         return raw();
       }
       { // Check for overflow.
-        int cnt = Utils::HighestBit(left_value);
-        if ((cnt + right_value) >= Smi::kBits) {
-          if ((cnt + right_value) >= Mint::kBits) {
+        int cnt = Utils::BitLength(left_value);
+        if ((cnt + right_value) > Smi::kBits) {
+          if ((cnt + right_value) > Mint::kBits) {
             return Bigint::NewFromShiftedInt64(left_value, right_value);
           } else {
             int64_t left_64 = left_value;
@@ -16404,7 +16439,7 @@
 
 
 RawBigint* Bigint::NewFromShiftedInt64(int64_t value, intptr_t shift,
-                                         Heap::Space space) {
+                                       Heap::Space space) {
   ASSERT(kBitsPerDigit == 32);
   ASSERT(shift >= 0);
   const Bigint& result = Bigint::Handle(New(space));
@@ -16436,26 +16471,32 @@
 
 void Bigint::EnsureLength(intptr_t length, Heap::Space space) const {
   ASSERT(length >= 0);
+  length++;  // Account for leading zero for 64-bit processing.
   TypedData& old_digits = TypedData::Handle(digits());
-  if ((length > 0) && (length > old_digits.Length())) {
+  if (length > old_digits.Length()) {
     TypedData& new_digits = TypedData::Handle(
         TypedData::New(kTypedDataUint32ArrayCid, length + kExtraDigits, space));
-    if (old_digits.Length() > 0) {
+    set_digits(new_digits);
+    if (Used() > 0) {
       TypedData::Copy(new_digits, TypedData::data_offset(),
                       old_digits, TypedData::data_offset(),
-                      old_digits.LengthInBytes());
+                      (Used() + 1)*kBytesPerDigit);  // Copy leading zero.
     }
-    set_digits(new_digits);
   }
 }
 
 
 void Bigint::Clamp() const {
   intptr_t used = Used();
-  while ((used > 0) && (DigitAt(used - 1) == 0)) {
-    --used;
+  if (used > 0) {
+    if (DigitAt(used - 1) == 0) {
+      do {
+        --used;
+      } while ((used > 0) && (DigitAt(used - 1) == 0));
+      SetUsed(used);
+    }
+    SetDigitAt(used, 0);  // Set leading zero for 64-bit processing.
   }
-  SetUsed(used);
 }
 
 
@@ -16467,17 +16508,10 @@
 
 RawBigint* Bigint::NewFromCString(const char* str, Heap::Space space) {
   ASSERT(str != NULL);
-  if (str[0] == '\0') {
-    return NewFromInt64(0, space);
-  }
-
   // If the string starts with '-' recursively restart the whole operation
   // without the character and then toggle the sign.
-  // This allows multiple leading '-' (which will cancel each other out), but
-  // we have added an assert, to make sure that the returned result of the
-  // recursive call is not negative.
-  // We don't catch leading '-'s for zero. Ex: "--0", or "---".
   if (str[0] == '-') {
+    ASSERT(str[1] != '-');
     const Bigint& result = Bigint::Handle(NewFromCString(&str[1], space));
     result.SetNeg(!result.Neg());  // Toggle sign.
     ASSERT(result.IsZero() || result.IsNegative());
@@ -16488,7 +16522,7 @@
   // No overflow check needed since overflowing str_length implies that we take
   // the branch to NewFromDecCString() which contains a check itself.
   const intptr_t str_length = strlen(str);
-  if ((str_length > 2) &&
+  if ((str_length >= 2) &&
       (str[0] == '0') &&
       ((str[1] == 'x') || (str[1] == 'X'))) {
     const Bigint& result = Bigint::Handle(NewFromHexCString(&str[2], space));
@@ -16530,17 +16564,14 @@
 
 
 RawBigint* Bigint::NewFromHexCString(const char* str, Heap::Space space) {
-  // TODO(regis): Do we need to check for max length?
   // If the string starts with '-' recursively restart the whole operation
   // without the character and then toggle the sign.
-  // This allows multiple leading '-' (which will cancel each other out), but
-  // we have added an assert, to make sure that the returned result of the
-  // recursive call is not negative.
-  // We don't catch leading '-'s for zero. Ex: "--0", or "---".
   if (str[0] == '-') {
+    ASSERT(str[1] != '-');
     const Bigint& result = Bigint::Handle(NewFromHexCString(&str[1], space));
-    result.SetNeg(!result.Neg());  // Toggle sign.
-    ASSERT(result.IsZero() || result.IsNegative());
+    if (!result.IsZero()) {
+      result.SetNeg(!result.Neg());  // Toggle sign.
+    }
     ASSERT(result.IsClamped());
     return result.raw();
   }
@@ -16549,6 +16580,9 @@
   const int kHexDigitsPerDigit = 8;
   const int kBitsPerDigit = kBitsPerHexDigit * kHexDigitsPerDigit;
   intptr_t hex_i = strlen(str);  // Terminating byte excluded.
+  if ((hex_i <= 0) || (hex_i >= kMaxInt32)) {
+    FATAL("Fatal error in Bigint::NewFromHexCString: string too long or empty");
+  }
   result.EnsureLength((hex_i + kHexDigitsPerDigit - 1) / kHexDigitsPerDigit,
                       space);
   intptr_t used_ = 0;
@@ -16579,8 +16613,8 @@
   ASSERT(kBitsPerDigit == 32);
 
   const intptr_t str_length = strlen(str);
-  if (str_length < 0) {  // TODO(regis): Pick a smaller limit.
-    FATAL("Fatal error in Bigint::NewFromDecCString: string too long");
+  if ((str_length <= 0) || (str_length >= kMaxInt32)) {
+    FATAL("Fatal error in Bigint::NewFromDecCString: string too long or empty");
   }
   intptr_t str_pos = 0;
 
@@ -16590,6 +16624,7 @@
   // The extra digits allocated take care of variations (kExtraDigits).
   const int64_t kLog10Dividend = 33219281;
   const int64_t kLog10Divisor = 10000000;
+
   result.EnsureLength((kLog10Dividend * str_length) /
                       (kLog10Divisor * kBitsPerDigit) + 1, space);
 
@@ -18809,6 +18844,8 @@
                          space));
     NoGCScope no_gc;
     raw->StoreSmi(&(raw->ptr()->length_), Smi::New(len));
+    VerifiedMemory::Accept(reinterpret_cast<uword>(raw->ptr()),
+                           Array::InstanceSize(len));
     return raw;
   }
 }
@@ -19147,8 +19184,7 @@
     hash_code ^= Instance::Cast(obj).HashCode();
     if (hash_code.IsSmi()) {
       // May waste some bits on 64-bit, to ensure consistency with non-Smi case.
-      return static_cast<uword>(Smi::Cast(hash_code).Value() & 0xFFFFFFFF);
-      // TODO(regis): Same as Smi::AsTruncatedUint32Value(), simplify?
+      return static_cast<uword>(Smi::Cast(hash_code).AsTruncatedUint32Value());
     } else if (hash_code.IsInteger()) {
       return static_cast<uword>(
           Integer::Cast(hash_code).AsTruncatedUint32Value());
@@ -20086,6 +20122,11 @@
 }
 
 
+void JSRegExp::set_function(intptr_t cid, const Function& value) const {
+  StorePointer(FunctionAddr(cid), value.raw());
+}
+
+
 void JSRegExp::set_num_bracket_expressions(intptr_t value) const {
   StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value));
 }
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 8def916..a46c121 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -21,9 +21,12 @@
 #include "vm/report.h"
 #include "vm/scanner.h"
 #include "vm/tags.h"
+#include "vm/verified_memory.h"
 
 namespace dart {
 
+DECLARE_FLAG(bool, use_jscre);
+
 // Forward declarations.
 #define DEFINE_FORWARD_DECLARATION(clazz)                                      \
   class clazz;
@@ -610,6 +613,7 @@
     ASSERT(Contains(reinterpret_cast<uword>(to)));
     if (raw()->IsNewObject()) {
       memmove(const_cast<RawObject**>(to), from, count * kWordSize);
+      VerifiedMemory::Accept(reinterpret_cast<uword>(to), count * kWordSize);
     } else {
       for (intptr_t i = 0; i < count; ++i) {
         StorePointer(&to[i], from[i]);
@@ -1295,11 +1299,6 @@
   // Patch the signature function of a signature class allocated without it.
   void PatchSignatureFunction(const Function& signature_function) const;
 
-  // Return a class object corresponding to the specified kind. If
-  // a canonicalized version of it exists then that object is returned
-  // otherwise a new object is allocated and returned.
-  static RawClass* GetClass(intptr_t class_id, bool is_signature_class);
-
   // Register code that has used CHA for optimization.
   // TODO(srdjan): Also register kind of CHA optimization (e.g.: leaf class,
   // leaf method, ...).
@@ -1593,10 +1592,6 @@
   static const intptr_t kBytesPerElement = kWordSize;
   static const intptr_t kMaxElements = kSmiMax / kBytesPerElement;
 
-  static intptr_t length_offset() {
-    return OFFSET_OF(RawTypeArguments, length_);
-  }
-
   static intptr_t InstanceSize() {
     ASSERT(sizeof(RawTypeArguments) ==
            OFFSET_OF_RETURNED_VALUE(RawTypeArguments, types));
@@ -1732,6 +1727,14 @@
   RawClass* origin() const;
   RawScript* script() const;
 
+  void set_regexp(const JSRegExp& value) const;
+  RawJSRegExp* regexp() const;
+
+  // Get and set the class id this function is specialized for. Only set for
+  // irregexp functions.
+  intptr_t regexp_cid() const { return raw_ptr()->regexp_cid_; }
+  void set_regexp_cid(intptr_t regexp_cid) const;
+
   RawAbstractType* result_type() const { return raw_ptr()->result_type_; }
   void set_result_type(const AbstractType& value) const;
 
@@ -1861,6 +1864,7 @@
       case RawFunction::kClosureFunction:
       case RawFunction::kConstructor:
       case RawFunction::kImplicitStaticFinalGetter:
+      case RawFunction::kIrregexpFunction:
         return false;
       default:
         UNREACHABLE();
@@ -1878,6 +1882,7 @@
       case RawFunction::kImplicitGetter:
       case RawFunction::kImplicitSetter:
       case RawFunction::kImplicitStaticFinalGetter:
+      case RawFunction::kIrregexpFunction:
         return true;
       case RawFunction::kClosureFunction:
       case RawFunction::kConstructor:
@@ -2072,6 +2077,11 @@
     return kind() == RawFunction::kClosureFunction;
   }
 
+  // Returns true if this function represents a generated irregexp function.
+  bool IsIrregexpFunction() const {
+    return kind() == RawFunction::kIrregexpFunction;
+  }
+
   // Returns true if this function represents an implicit closure function.
   bool IsImplicitClosureFunction() const;
 
@@ -4074,10 +4084,10 @@
     return OFFSET_OF(RawContext, num_variables_);
   }
 
-  RawInstance* At(intptr_t context_index) const {
-    return *InstanceAddr(context_index);
+  RawObject* At(intptr_t context_index) const {
+    return *ObjectAddr(context_index);
   }
-  inline void SetAt(intptr_t context_index, const Instance& value) const;
+  inline void SetAt(intptr_t context_index, const Object& value) const;
 
   void Dump(int indent = 0) const;
 
@@ -4103,7 +4113,7 @@
                          Heap::Space space = Heap::kNew);
 
  private:
-  RawInstance* const* InstanceAddr(intptr_t context_index) const {
+  RawObject* const* ObjectAddr(intptr_t context_index) const {
     ASSERT((context_index >= 0) && (context_index < num_variables()));
     return &raw_ptr()->data()[context_index];
   }
@@ -4555,6 +4565,7 @@
   friend class Class;
   friend class Closure;
   friend class DeferredObject;
+  friend class JSRegExp;
   friend class SnapshotWriter;
   friend class StubCode;
   friend class TypedDataView;
@@ -7232,7 +7243,34 @@
     return raw_ptr()->num_bracket_expressions_;
   }
 
+  static intptr_t function_offset(intptr_t cid) {
+    switch (cid) {
+      case kOneByteStringCid:
+        return OFFSET_OF(RawJSRegExp, one_byte_function_);
+      case kTwoByteStringCid:
+        return OFFSET_OF(RawJSRegExp, two_byte_function_);
+      case kExternalOneByteStringCid:
+         return OFFSET_OF(RawJSRegExp, external_one_byte_function_);
+      case kExternalTwoByteStringCid:
+        return OFFSET_OF(RawJSRegExp, external_two_byte_function_);
+    }
+
+    UNREACHABLE();
+    return -1;
+  }
+
+  RawFunction** FunctionAddr(intptr_t cid) const {
+    return reinterpret_cast<RawFunction**>(
+          FieldAddrAtOffset(function_offset(cid)));
+  }
+
+  RawFunction* function(intptr_t cid) const {
+    return *FunctionAddr(cid);
+  }
+
   void set_pattern(const String& pattern) const;
+  void set_function(intptr_t cid, const Function& value) const;
+
   void set_num_bracket_expressions(intptr_t value) const;
   void set_is_global() const { set_flags(flags() | kGlobal); }
   void set_is_ignore_case() const { set_flags(flags() | kIgnoreCase); }
@@ -7251,7 +7289,10 @@
 
   static intptr_t InstanceSize() {
     ASSERT(sizeof(RawJSRegExp) == OFFSET_OF_RETURNED_VALUE(RawJSRegExp, data));
-    return 0;
+    if (FLAG_use_jscre) {
+      return 0;
+    }
+    return RoundedAllocationSize(sizeof(RawJSRegExp));
   }
 
   static intptr_t InstanceSize(intptr_t len) {
@@ -7453,8 +7494,8 @@
 }
 
 
-void Context::SetAt(intptr_t index, const Instance& value) const {
-  StorePointer(InstanceAddr(index), value.raw());
+void Context::SetAt(intptr_t index, const Object& value) const {
+  StorePointer(ObjectAddr(index), value.raw());
 }
 
 
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 4bd4aff..8368a85 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -4133,6 +4133,16 @@
 TEST_CASE(PrintJSON) {
   Heap* heap = Isolate::Current()->heap();
   heap->CollectAllGarbage();
+  // We don't want to print garbage objects, so wait for concurrent sweeper.
+  // TODO(21620): Add heap iteration interface that excludes garbage (or
+  // use ObjectGraph).
+  PageSpace* old_space = heap->old_space();
+  {
+    MonitorLocker ml(old_space->tasks_lock());
+    while (old_space->tasks() > 0) {
+      ml.Wait();
+    }
+  }
   GrowableArray<Object*> objects;
   ObjectAccumulator acc(&objects);
   heap->IterateObjects(&acc);
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 3972b55..4b08bae 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -11,6 +11,7 @@
 #include "vm/lockers.h"
 #include "vm/object.h"
 #include "vm/thread.h"
+#include "vm/verified_memory.h"
 #include "vm/virtual_memory.h"
 
 namespace dart {
@@ -35,13 +36,13 @@
             "Emit a log message when pointers to unused code are dropped.");
 DEFINE_FLAG(bool, always_drop_code, false,
             "Always try to drop code if the function's usage counter is >= 0");
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
-DEFINE_FLAG(bool, concurrent_sweep, true,
-            "Concurrent sweep for old generation.");
-#else  // TARGET_ARCH_IA32 || TARGET_ARCH_ARM
+#if defined(TARGET_ARCH_MIPS) || defined(TARGET_ARCH_ARM64)
 DEFINE_FLAG(bool, concurrent_sweep, false,
             "Concurrent sweep for old generation.");
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_ARM
+#else  // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
+DEFINE_FLAG(bool, concurrent_sweep, true,
+            "Concurrent sweep for old generation.");
+#endif  // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions.");
 
 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
@@ -59,7 +60,7 @@
 
 HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) {
   VirtualMemory* memory =
-      VirtualMemory::Reserve(size_in_words << kWordSizeLog2);
+      VerifiedMemory::Reserve(size_in_words << kWordSizeLog2);
   return Initialize(memory, type);
 }
 
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 524db36..048f8af 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -24,6 +24,7 @@
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os.h"
+#include "vm/regexp_assembler.h"
 #include "vm/report.h"
 #include "vm/resolver.h"
 #include "vm/scanner.h"
@@ -99,6 +100,21 @@
 #endif  // DEBUG
 
 
+class BoolScope : public ValueObject {
+ public:
+  BoolScope(bool* addr, bool new_value) : _addr(addr), _saved_value(*addr) {
+    *_addr = new_value;
+  }
+  ~BoolScope() {
+    *_addr = _saved_value;
+  }
+
+ private:
+  bool* _addr;
+  bool _saved_value;
+};
+
+
 static RawTypeArguments* NewTypeArguments(const GrowableObjectArray& objs) {
   const TypeArguments& a =
       TypeArguments::Handle(TypeArguments::New(objs.Length()));
@@ -148,6 +164,14 @@
 }
 
 
+void ParsedFunction::SetRegExpCompileData(
+    RegExpCompileData* regexp_compile_data) {
+  ASSERT(regexp_compile_data_ == NULL);
+  ASSERT(regexp_compile_data != NULL);
+  regexp_compile_data_ = regexp_compile_data;
+}
+
+
 void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) {
   ASSERT(prefix.is_deferred_load());
   ASSERT(!prefix.is_loaded());
@@ -161,6 +185,7 @@
 
 
 void ParsedFunction::AllocateVariables() {
+  ASSERT(!function().IsIrregexpFunction());
   LocalScope* scope = node_sequence()->scope();
   const intptr_t num_fixed_params = function().num_fixed_parameters();
   const intptr_t num_opt_params = function().NumOptionalParameters();
@@ -209,6 +234,24 @@
 };
 
 
+void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) {
+  ASSERT(function().IsIrregexpFunction());
+  ASSERT(function().NumOptionalParameters() == 0);
+  const intptr_t num_params = function().num_fixed_parameters();
+  ASSERT(num_params == RegExpMacroAssembler::kParamCount);
+  // Compute start indices to parameters and locals, and the number of
+  // parameters to copy.
+  // Parameter i will be at fp[kParamEndSlotFromFp + num_params - i] and
+  // local variable j will be at fp[kFirstLocalSlotFromFp - j].
+  first_parameter_index_ = kParamEndSlotFromFp + num_params;
+  first_stack_local_index_ = kFirstLocalSlotFromFp;
+  num_copied_params_ = 0;
+
+  // Frame indices are relative to the frame pointer and are decreasing.
+  num_stack_locals_ = num_stack_locals;
+}
+
+
 struct Parser::Block : public ZoneAllocated {
   Block(Block* outer_block, LocalScope* local_scope, SequenceNode* seq)
     : parent(outer_block), scope(local_scope), statements(seq) {
@@ -837,6 +880,8 @@
       node_sequence =
           parser.ParseInvokeFieldDispatcher(func, &default_parameter_values);
       break;
+    case RawFunction::kIrregexpFunction:
+      UNREACHABLE();  // Irregexp functions have their own parser.
     default:
       UNREACHABLE();
   }
@@ -3055,9 +3100,8 @@
     OpenAsyncClosure();
   }
 
-  bool saved_await_is_keyword = await_is_keyword_;
-  await_is_keyword_ = func.IsAsyncFunction() || func.is_async_closure();
-
+  BoolScope allow_await(&this->await_is_keyword_,
+                        func.IsAsyncFunction() || func.is_async_closure());
   intptr_t end_token_pos = 0;
   if (CurrentToken() == Token::kLBRACE) {
     ConsumeToken();
@@ -3080,7 +3124,7 @@
       }
     }
     const intptr_t expr_pos = TokenPos();
-    AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades);
+    AstNode* expr = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
     ASSERT(expr != NULL);
     current_block_->statements->Add(new ReturnNode(expr_pos, expr));
     end_token_pos = TokenPos();
@@ -3126,7 +3170,6 @@
   current_block_->statements->Add(body);
   innermost_function_ = saved_innermost_function.raw();
   last_used_try_index_ = saved_try_index;
-  await_is_keyword_ = saved_await_is_keyword;
   async_temp_scope_ = saved_async_temp_scope;
   parsed_function()->set_saved_try_ctx(saved_saved_try_ctx);
   parsed_function()->set_async_saved_try_ctx_name(
@@ -3482,6 +3525,8 @@
       ExpectToken(Token::kRBRACE);
     } else {
       ConsumeToken();
+      BoolScope allow_await(&this->await_is_keyword_,
+                            async_modifier != RawFunction::kNoModifier);
       SkipExpr();
       method_end_pos = TokenPos();
       ExpectSemicolon();
@@ -4453,7 +4498,6 @@
       helper_class.LookupDynamicFunctionAllowPrivate(Symbols::toString()));
   ASSERT(!to_string_func.IsNull());
   to_string_func = to_string_func.Clone(cls);
-  to_string_func.set_is_visible(false);
   enum_members.AddFunction(to_string_func);
 
   cls.AddFields(enum_members.fields());
@@ -5156,6 +5200,8 @@
     ExpectToken(Token::kRBRACE);
   } else if (CurrentToken() == Token::kARROW) {
     ConsumeToken();
+    BoolScope allow_await(&this->await_is_keyword_,
+                          func_modifier != RawFunction::kNoModifier);
     SkipExpr();
     function_end_pos = TokenPos();
     ExpectSemicolon();
@@ -6319,18 +6365,6 @@
 }
 
 
-AstNode* Parser::LoadTypeArgumentsParameter(intptr_t token_pos) {
-  // A nested function may access ':type_arguments' to use as instantiator,
-  // referring to the implicit first parameter of the outermost enclosing
-  // factory function.
-  const bool kTestOnly = false;
-  LocalVariable* param = LookupTypeArgumentsParameter(current_block_->scope,
-                                                      kTestOnly);
-  ASSERT(param != NULL);
-  return new(I) LoadLocalNode(TokenPos(), param);
-}
-
-
 AstNode* Parser::CallGetter(intptr_t token_pos,
                             AstNode* object,
                             const String& name) {
@@ -9183,7 +9217,7 @@
                                     bool consume_cascades,
                                     SequenceNode** await_preamble) {
   TRACE_PARSER("ParseAwaitableExpr");
-  parsed_function()->reset_have_seen_await();
+  BoolScope saved_seen_await(&parsed_function()->have_seen_await_expr_, false);
   AstNode* expr = ParseExpr(require_compiletime_const, consume_cascades);
   if (parsed_function()->have_seen_await()) {
     // Make sure we do not reuse the scope to avoid creating contexts that we
@@ -9201,7 +9235,6 @@
     } else {
       *await_preamble = preamble;
     }
-    parsed_function()->reset_have_seen_await();
     return result;
   }
   return expr;
@@ -10796,8 +10829,8 @@
       }
       const_list.SetAt(i, elem->AsLiteralNode()->literal());
     }
-    const_list ^= TryCanonicalize(const_list, literal_pos);
     const_list.MakeImmutable();
+    const_list ^= TryCanonicalize(const_list, literal_pos);
     return new(I) LiteralNode(literal_pos, const_list);
   } else {
     // Factory call at runtime.
@@ -11021,8 +11054,8 @@
       }
       key_value_array.SetAt(i, arg->AsLiteralNode()->literal());
     }
-    key_value_array ^= TryCanonicalize(key_value_array, TokenPos());
     key_value_array.MakeImmutable();
+    key_value_array ^= TryCanonicalize(key_value_array, TokenPos());
 
     // Construct the map object.
     const Class& immutable_map_class = Class::Handle(I,
@@ -11815,7 +11848,9 @@
     params.skipped = true;
     ParseFormalParameterList(allow_explicit_default_values, false, &params);
   }
-  ParseFunctionModifier();
+  RawFunction::AsyncModifier async_modifier = ParseFunctionModifier();
+  BoolScope allow_await(&this->await_is_keyword_,
+                        async_modifier != RawFunction::kNoModifier);
   if (CurrentToken() == Token::kLBRACE) {
     SkipBlock();
     ExpectToken(Token::kRBRACE);
@@ -12062,7 +12097,8 @@
 
 void Parser::SkipUnaryExpr() {
   if (IsPrefixOperator(CurrentToken()) ||
-      IsIncrementOperator(CurrentToken())) {
+      IsIncrementOperator(CurrentToken()) ||
+      IsAwaitKeyword()) {
     ConsumeToken();
     SkipUnaryExpr();
   } else {
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 19c7f61..44f9c77 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -25,8 +25,10 @@
 class Isolate;
 class LocalScope;
 class LocalVariable;
+struct RegExpCompileData;
 class SourceLabel;
 template <typename T> class GrowableArray;
+class Parser;
 
 struct CatchParamDesc;
 class ClassDesc;
@@ -42,6 +44,7 @@
       : function_(function),
         code_(Code::Handle(isolate, function.unoptimized_code())),
         node_sequence_(NULL),
+        regexp_compile_data_(NULL),
         instantiator_(NULL),
         default_parameter_values_(Array::ZoneHandle(isolate, Array::null())),
         current_context_var_(NULL),
@@ -72,6 +75,11 @@
   SequenceNode* node_sequence() const { return node_sequence_; }
   void SetNodeSequence(SequenceNode* node_sequence);
 
+  RegExpCompileData* regexp_compile_data() const {
+    return regexp_compile_data_;
+  }
+  void SetRegExpCompileData(RegExpCompileData* regexp_compile_data);
+
   LocalVariable* instantiator() const { return instantiator_; }
   void set_instantiator(LocalVariable* instantiator) {
     // May be NULL.
@@ -130,11 +138,9 @@
   int num_stack_locals() const { return num_stack_locals_; }
 
   void AllocateVariables();
+  void AllocateIrregexpVariables(intptr_t num_stack_locals);
 
-  void record_await() {
-    have_seen_await_expr_ = true;
-  }
-  void reset_have_seen_await() { have_seen_await_expr_ = false; }
+  void record_await() { have_seen_await_expr_ = true; }
   bool have_seen_await() const { return have_seen_await_expr_; }
 
   void set_saved_try_ctx(LocalVariable* saved_try_ctx) {
@@ -161,6 +167,7 @@
   const Function& function_;
   Code& code_;
   SequenceNode* node_sequence_;
+  RegExpCompileData* regexp_compile_data_;
   LocalVariable* instantiator_;
   Array& default_parameter_values_;
   LocalVariable* current_context_var_;
@@ -178,6 +185,7 @@
 
   Isolate* isolate_;
 
+  friend class Parser;
   DISALLOW_COPY_AND_ASSIGN(ParsedFunction);
 };
 
@@ -550,7 +558,6 @@
                                               bool test_only);
   void CaptureInstantiator();
   AstNode* LoadReceiver(intptr_t token_pos);
-  AstNode* LoadTypeArgumentsParameter(intptr_t token_pos);
   AstNode* LoadFieldIfUnresolved(AstNode* node);
   AstNode* LoadClosure(PrimaryNode* primary);
   AstNode* CallGetter(intptr_t token_pos, AstNode* object, const String& name);
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 875704d..1a2709b 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -22,8 +22,7 @@
 namespace dart {
 
 
-#if defined(USING_SIMULATOR) || defined(TARGET_OS_ANDROID) || \
-    defined(HOST_ARCH_ARM64)
+#if defined(TARGET_OS_ANDROID) || defined(HOST_ARCH_ARM64)
   DEFINE_FLAG(bool, profile, false, "Enable Sampling Profiler");
 #else
   DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler");
@@ -35,7 +34,7 @@
             "Time between profiler samples in microseconds. Minimum 50.");
 DEFINE_FLAG(int, profile_depth, 8,
             "Maximum number stack frames walked. Minimum 1. Maximum 255.");
-#if defined(PROFILE_NATIVE_CODE)
+#if defined(PROFILE_NATIVE_CODE) || defined(USING_SIMULATOR)
 DEFINE_FLAG(bool, profile_vm, true,
             "Always collect native stack traces.");
 #else
@@ -2040,15 +2039,24 @@
   // At this point we have a valid stack boundary for this isolate and
   // know that our initial stack and frame pointers are within the boundary.
 
-  // Increment counter for vm tag.
-  VMTagCounters* counters = isolate->vm_tag_counters();
-  ASSERT(counters != NULL);
-  counters->Increment(isolate->vm_tag());
-
   // Setup sample.
   Sample* sample = sample_buffer->ReserveSample();
   sample->Init(isolate, OS::GetCurrentTimeMicros(), state.tid);
-  sample->set_vm_tag(isolate->vm_tag());
+  uword vm_tag = isolate->vm_tag();
+#if defined(USING_SIMULATOR)
+  // When running in the simulator, the runtime entry function address
+  // (stored as the vm tag) is the address of a redirect function.
+  // Attempt to find the real runtime entry function address and use that.
+  uword redirect_vm_tag = Simulator::FunctionForRedirect(vm_tag);
+  if (redirect_vm_tag != 0) {
+    vm_tag = redirect_vm_tag;
+  }
+#endif
+  // Increment counter for vm tag.
+  VMTagCounters* counters = isolate->vm_tag_counters();
+  ASSERT(counters != NULL);
+  counters->Increment(vm_tag);
+  sample->set_vm_tag(vm_tag);
   sample->set_user_tag(isolate->user_tag());
   sample->set_sp(sp);
   sample->set_fp(state.fp);
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 5470991..e83e01e 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -8,8 +8,9 @@
 #include "platform/assert.h"
 #include "vm/atomic.h"
 #include "vm/globals.h"
-#include "vm/token.h"
 #include "vm/snapshot.h"
+#include "vm/token.h"
+#include "vm/verified_memory.h"
 
 namespace dart {
 
@@ -487,7 +488,7 @@
   void StorePointer(type const* addr, type value) {
     // Ensure that this object contains the addr.
     ASSERT(Contains(reinterpret_cast<uword>(addr)));
-    *const_cast<type*>(addr) = value;
+    VerifiedMemory::Write(const_cast<type*>(addr), value);
     // Filter stores based on source and target.
     if (!value->IsHeapObject()) return;
     if (value->IsNewObject() && this->IsOldObject() &&
@@ -502,7 +503,7 @@
   void StoreSmi(RawSmi* const* addr, RawSmi* value) {
     // Can't use Contains, as array length is initialized through this method.
     ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this));
-    *const_cast<RawSmi**>(addr) = value;
+    VerifiedMemory::Write(const_cast<RawSmi**>(addr), value);
   }
 
   friend class Api;
@@ -671,6 +672,7 @@
     kMethodExtractor,  // converts method into implicit closure on the receiver.
     kNoSuchMethodDispatcher,  // invokes noSuchMethod.
     kInvokeFieldDispatcher,  // invokes a field as a closure.
+    kIrregexpFunction,   // represents a generated irregexp matcher function.
   };
 
   enum AsyncModifier {
@@ -713,6 +715,7 @@
   int16_t num_fixed_parameters_;
   int16_t num_optional_parameters_;  // > 0: positional; < 0: named.
   int16_t deoptimization_counter_;
+  int16_t regexp_cid_;
   uint32_t kind_tag_;  // See Function::KindTagBits.
   uint16_t optimized_instruction_count_;
   uint16_t optimized_call_site_count_;
@@ -1212,9 +1215,9 @@
   RawContext* parent_;
 
   // Variable length data follows here.
-  RawInstance** data() { OPEN_ARRAY_START(RawInstance*, RawInstance*); }
-  RawInstance* const* data() const {
-      OPEN_ARRAY_START(RawInstance*, RawInstance*);
+  RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); }
+  RawObject* const* data() const {
+      OPEN_ARRAY_START(RawObject*, RawObject*);
   }
   RawObject** to(intptr_t num_vars) {
     return reinterpret_cast<RawObject**>(&ptr()->data()[num_vars - 1]);
@@ -1828,8 +1831,12 @@
   RawSmi* data_length_;
   RawSmi* num_bracket_expressions_;
   RawString* pattern_;  // Pattern to be used for matching.
+  RawFunction* one_byte_function_;
+  RawFunction* two_byte_function_;
+  RawFunction* external_one_byte_function_;
+  RawFunction* external_two_byte_function_;
   RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->pattern_);
+    return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_);
   }
 
   // A bitfield with two fields:
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index b0faf50..46f9117 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -698,6 +698,7 @@
   func.set_num_fixed_parameters(reader->Read<int16_t>());
   func.set_num_optional_parameters(reader->Read<int16_t>());
   func.set_deoptimization_counter(reader->Read<int16_t>());
+  func.set_regexp_cid(reader->Read<int16_t>());
   func.set_kind_tag(reader->Read<uint32_t>());
   func.set_optimized_instruction_count(reader->Read<uint16_t>());
   func.set_optimized_call_site_count(reader->Read<uint16_t>());
@@ -741,6 +742,7 @@
   writer->Write<int16_t>(ptr()->num_fixed_parameters_);
   writer->Write<int16_t>(ptr()->num_optional_parameters_);
   writer->Write<int16_t>(ptr()->deoptimization_counter_);
+  writer->Write<int16_t>(ptr()->regexp_cid_);
   writer->Write<uint32_t>(ptr()->kind_tag_);
   writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
   writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
@@ -1756,7 +1758,7 @@
   // allocations may happen.
   intptr_t num_flds = (obj.raw()->to() - obj.raw()->from());
   for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectRef();
+    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl();
     obj.StorePointer(obj.raw()->from() + i,
                      reader->PassiveObjectHandle()->raw());
   }
@@ -1796,7 +1798,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, false);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1914,7 +1916,7 @@
     RawOneByteString* obj = reader->NewOneByteString(len);
     str_obj = obj;
     str_obj.set_tags(tags);
-    obj->ptr()->hash_ = Smi::New(hash);
+    str_obj.SetHash(hash);
     if (len > 0) {
       uint8_t* raw_ptr = CharAddr(str_obj, 0);
       reader->ReadBytes(raw_ptr, len);
@@ -1943,7 +1945,7 @@
     RawTwoByteString* obj = reader->NewTwoByteString(len);
     str_obj = obj;
     str_obj.set_tags(tags);
-    obj->ptr()->hash_ = Smi::New(hash);
+    str_obj.SetHash(hash);
     NoGCScope no_gc;
     uint16_t* raw_ptr = (len > 0)? CharAddr(str_obj, 0) : NULL;
     for (intptr_t i = 0; i < len; i++) {
@@ -2108,6 +2110,7 @@
                                 NEW_OBJECT_WITH_LEN_SPACE(Array, len, kind)));
     reader->AddBackRef(object_id, array, kIsDeserialized);
   }
+  ASSERT(!RawObject::IsCanonical(tags));
   reader->ArrayReadFrom(*array, len, tags);
   return array->raw();
 }
@@ -2129,6 +2132,9 @@
     reader->AddBackRef(object_id, array, kIsDeserialized);
   }
   reader->ArrayReadFrom(*array, len, tags);
+  if (RawObject::IsCanonical(tags)) {
+    *array ^= array->CheckAndCanonicalize(NULL);
+  }
   return raw(*array);
 }
 
@@ -2136,6 +2142,7 @@
 void RawArray::WriteTo(SnapshotWriter* writer,
                        intptr_t object_id,
                        Snapshot::Kind kind) {
+  ASSERT(!RawObject::IsCanonical(writer->GetObjectTags(this)));
   writer->ArrayWriteTo(object_id,
                        kArrayCid,
                        writer->GetObjectTags(this),
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 534e0c5..a996a11 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -4,29 +4,66 @@
 
 #include "vm/regexp.h"
 
-// SNIP
+#include "vm/dart_entry.h"
+#include "vm/regexp_assembler.h"
+#include "vm/regexp_ast.h"
+#include "vm/unibrow-inl.h"
+#include "vm/unicode.h"
+#include "vm/symbols.h"
+
+#define I (isolate())
+#define CI (compiler->isolate())
 
 namespace dart {
 
-// SNIP
+DECLARE_FLAG(bool, trace_irregexp);
+
+// Default to generating optimized regexp code.
+static const bool kRegexpOptimization = true;
+
+// More makes code generation slower, less makes V8 benchmark score lower.
+static const intptr_t kMaxLookaheadForBoyerMoore = 8;
+
+ContainedInLattice AddRange(ContainedInLattice containment,
+                            const intptr_t* ranges,
+                            intptr_t ranges_length,
+                            Interval new_range) {
+  ASSERT((ranges_length & 1) == 1);
+  ASSERT(ranges[ranges_length - 1] == Utf16::kMaxCodeUnit + 1);
+  if (containment == kLatticeUnknown) return containment;
+  bool inside = false;
+  intptr_t last = 0;
+  for (intptr_t i = 0; i < ranges_length;
+       inside = !inside, last = ranges[i], i++) {
+    // Consider the range from last to ranges[i].
+    // We haven't got to the new range yet.
+    if (ranges[i] <= new_range.from()) continue;
+    // New range is wholly inside last-ranges[i].  Note that new_range.to() is
+    // inclusive, but the values in ranges are not.
+    if (last <= new_range.from() && new_range.to() < ranges[i]) {
+      return Combine(containment, inside ? kLatticeIn : kLatticeOut);
+    }
+    return kLatticeUnknown;
+  }
+  return containment;
+}
 
 // -------------------------------------------------------------------
 // Implementation of the Irregexp regular expression engine.
 //
 // The Irregexp regular expression engine is intended to be a complete
-// implementation of ECMAScript regular expressions.  It generates either
-// bytecodes or native code.
+// implementation of ECMAScript regular expressions.  It generates
+// IR code that is subsequently compiled to native code.
 
 //   The Irregexp regexp engine is structured in three steps.
-//   1) The parser generates an abstract syntax tree.  See ast.cc.
+//   1) The parser generates an abstract syntax tree.  See regexp_ast.cc.
 //   2) From the AST a node network is created.  The nodes are all
 //      subclasses of RegExpNode.  The nodes represent states when
 //      executing a regular expression.  Several optimizations are
 //      performed on the node network.
-//   3) From the nodes we generate either byte codes or native code
-//      that can actually execute the regular expression (perform
-//      the search).  The code generation step is described in more
-//      detail below.
+//   3) From the nodes we generate IR instructions that can actually
+//      execute the regular expression (perform the search).  The
+//      code generation step is described in more detail below.
 
 // Code generation.
 //
@@ -49,8 +86,8 @@
 //        These are used to implement the actions required on finding
 //        a successful match or failing to find a match.
 //
-//   The code generated (whether as byte codes or native code) maintains
-//   some state as it runs.  This consists of the following elements:
+//   The code generated maintains some state as it runs.  This consists of the
+//   following elements:
 //
 //   * The capture registers.  Used for string captures.
 //   * Other registers.  Used for counters etc.
@@ -160,24 +197,24 @@
 //   the event that code generation is requested for an identical trace.
 
 
-void RegExpTree::AppendToText(RegExpText* text, Zone* zone) {
+void RegExpTree::AppendToText(RegExpText* text) {
   UNREACHABLE();
 }
 
 
-void RegExpAtom::AppendToText(RegExpText* text, Zone* zone) {
-  text->AddElement(TextElement::Atom(this), zone);
+void RegExpAtom::AppendToText(RegExpText* text) {
+  text->AddElement(TextElement::Atom(this));
 }
 
 
-void RegExpCharacterClass::AppendToText(RegExpText* text, Zone* zone) {
-  text->AddElement(TextElement::CharClass(this), zone);
+void RegExpCharacterClass::AppendToText(RegExpText* text) {
+  text->AddElement(TextElement::CharClass(this));
 }
 
 
-void RegExpText::AppendToText(RegExpText* text, Zone* zone) {
-  for (int i = 0; i < elements()->length(); i++)
-    text->AddElement(elements()->at(i), zone);
+void RegExpText::AppendToText(RegExpText* text) {
+  for (intptr_t i = 0; i < elements()->length(); i++)
+    text->AddElement((*elements())[i]);
 }
 
 
@@ -191,7 +228,7 @@
 }
 
 
-int TextElement::length() const {
+intptr_t TextElement::length() const {
   switch (text_type()) {
     case ATOM:
       return atom()->length();
@@ -204,36 +241,26 @@
 }
 
 
-DispatchTable* ChoiceNode::GetTable(bool ignore_case) {
-  if (table_ == NULL) {
-    table_ = new(zone()) DispatchTable(zone());
-    DispatchTableConstructor cons(table_, ignore_case, zone());
-    cons.BuildTable(this);
-  }
-  return table_;
-}
-
-
-class FrequencyCollator {
+class FrequencyCollator : public ValueObject {
  public:
   FrequencyCollator() : total_samples_(0) {
-    for (int i = 0; i < RegExpMacroAssembler::kTableSize; i++) {
+    for (intptr_t i = 0; i < RegExpMacroAssembler::kTableSize; i++) {
       frequencies_[i] = CharacterFrequency(i);
     }
   }
 
-  void CountCharacter(int character) {
-    int index = (character & RegExpMacroAssembler::kTableMask);
+  void CountCharacter(intptr_t character) {
+    intptr_t index = (character & RegExpMacroAssembler::kTableMask);
     frequencies_[index].Increment();
     total_samples_++;
   }
 
   // Does not measure in percent, but rather per-128 (the table size from the
   // regexp macro assembler).
-  int Frequency(int in_character) {
-    DCHECK((in_character & RegExpMacroAssembler::kTableMask) == in_character);
+  intptr_t Frequency(intptr_t in_character) {
+    ASSERT((in_character & RegExpMacroAssembler::kTableMask) == in_character);
     if (total_samples_ < 1) return 1;  // Division by zero.
-    int freq_in_per128 =
+    intptr_t freq_in_per128 =
         (frequencies_[in_character].counter() * 128) / total_samples_;
     return freq_in_per128;
   }
@@ -242,88 +269,91 @@
   class CharacterFrequency {
    public:
     CharacterFrequency() : counter_(0), character_(-1) { }
-    explicit CharacterFrequency(int character)
+    explicit CharacterFrequency(intptr_t character)
         : counter_(0), character_(character) { }
 
     void Increment() { counter_++; }
-    int counter() { return counter_; }
-    int character() { return character_; }
+    intptr_t counter() { return counter_; }
+    intptr_t character() { return character_; }
 
    private:
-    int counter_;
-    int character_;
+    intptr_t counter_;
+    intptr_t character_;
+
+    DISALLOW_ALLOCATION();
   };
 
 
  private:
   CharacterFrequency frequencies_[RegExpMacroAssembler::kTableSize];
-  int total_samples_;
+  intptr_t total_samples_;
 };
 
 
-class RegExpCompiler {
+class RegExpCompiler : public ValueObject {
  public:
-  RegExpCompiler(int capture_count, bool ignore_case, bool is_one_byte,
-                 Zone* zone);
+  RegExpCompiler(intptr_t capture_count,
+                 bool ignore_case,
+                 intptr_t specialization_cid);
 
-  int AllocateRegister() {
-    if (next_register_ >= RegExpMacroAssembler::kMaxRegister) {
-      reg_exp_too_big_ = true;
-      return next_register_;
-    }
+  intptr_t AllocateRegister() {
     return next_register_++;
   }
 
-  RegExpEngine::CompilationResult Assemble(RegExpMacroAssembler* assembler,
+  RegExpEngine::CompilationResult Assemble(IRRegExpMacroAssembler* assembler,
                                            RegExpNode* start,
-                                           int capture_count,
-                                           Handle<String> pattern);
+                                           intptr_t capture_count,
+                                           const String& pattern);
 
   inline void AddWork(RegExpNode* node) { work_list_->Add(node); }
 
-  static const int kImplementationOffset = 0;
-  static const int kNumberOfRegistersOffset = 0;
-  static const int kCodeOffset = 1;
+  static const intptr_t kImplementationOffset = 0;
+  static const intptr_t kNumberOfRegistersOffset = 0;
+  static const intptr_t kCodeOffset = 1;
 
-  RegExpMacroAssembler* macro_assembler() { return macro_assembler_; }
+  IRRegExpMacroAssembler* macro_assembler() { return macro_assembler_; }
   EndNode* accept() { return accept_; }
 
-  static const int kMaxRecursion = 100;
-  inline int recursion_depth() { return recursion_depth_; }
+  static const intptr_t kMaxRecursion = 100;
+  inline intptr_t recursion_depth() { return recursion_depth_; }
   inline void IncrementRecursionDepth() { recursion_depth_++; }
   inline void DecrementRecursionDepth() { recursion_depth_--; }
 
   void SetRegExpTooBig() { reg_exp_too_big_ = true; }
 
   inline bool ignore_case() { return ignore_case_; }
-  inline bool one_byte() { return one_byte_; }
+  inline bool one_byte() const {
+    return (specialization_cid_ == kOneByteStringCid ||
+            specialization_cid_ == kExternalOneByteStringCid);
+  }
+  inline intptr_t specialization_cid() { return specialization_cid_; }
   FrequencyCollator* frequency_collator() { return &frequency_collator_; }
 
-  int current_expansion_factor() { return current_expansion_factor_; }
-  void set_current_expansion_factor(int value) {
+  intptr_t current_expansion_factor() { return current_expansion_factor_; }
+  void set_current_expansion_factor(intptr_t value) {
     current_expansion_factor_ = value;
   }
 
-  Zone* zone() const { return zone_; }
+  Isolate* isolate() const { return isolate_; }
 
-  static const int kNoRegister = -1;
+  static const intptr_t kNoRegister = -1;
 
  private:
   EndNode* accept_;
-  int next_register_;
-  List<RegExpNode*>* work_list_;
-  int recursion_depth_;
-  RegExpMacroAssembler* macro_assembler_;
+  intptr_t next_register_;
+  ZoneGrowableArray<RegExpNode*>* work_list_;
+  intptr_t recursion_depth_;
+  IRRegExpMacroAssembler* macro_assembler_;
   bool ignore_case_;
-  bool one_byte_;
+  intptr_t specialization_cid_;
   bool reg_exp_too_big_;
-  int current_expansion_factor_;
+  intptr_t current_expansion_factor_;
   FrequencyCollator frequency_collator_;
-  Zone* zone_;
+  Isolate* isolate_;
 };
 
 
-class RecursionCheck {
+class RecursionCheck : public ValueObject {
  public:
   explicit RecursionCheck(RegExpCompiler* compiler) : compiler_(compiler) {
     compiler->IncrementRecursionDepth();
@@ -334,84 +364,60 @@
 };
 
 
-static RegExpEngine::CompilationResult IrregexpRegExpTooBig(Isolate* isolate) {
-  return RegExpEngine::CompilationResult(isolate, "RegExp too big");
+static RegExpEngine::CompilationResult IrregexpRegExpTooBig() {
+  return RegExpEngine::CompilationResult("RegExp too big");
 }
 
 
 // Attempts to compile the regexp using an Irregexp code generator.  Returns
 // a fixed array or a null handle depending on whether it succeeded.
-RegExpCompiler::RegExpCompiler(int capture_count, bool ignore_case,
-                               bool one_byte, Zone* zone)
+RegExpCompiler::RegExpCompiler(intptr_t capture_count, bool ignore_case,
+                               intptr_t specialization_cid)
     : next_register_(2 * (capture_count + 1)),
       work_list_(NULL),
       recursion_depth_(0),
       ignore_case_(ignore_case),
-      one_byte_(one_byte),
+      specialization_cid_(specialization_cid),
       reg_exp_too_big_(false),
       current_expansion_factor_(1),
-      frequency_collator_(),
-      zone_(zone) {
-  accept_ = new(zone) EndNode(EndNode::ACCEPT, zone);
-  DCHECK(next_register_ - 1 <= RegExpMacroAssembler::kMaxRegister);
+      isolate_(Isolate::Current()) {
+  accept_ = new(I) EndNode(EndNode::ACCEPT, I);
 }
 
 
 RegExpEngine::CompilationResult RegExpCompiler::Assemble(
-    RegExpMacroAssembler* macro_assembler,
+    IRRegExpMacroAssembler* macro_assembler,
     RegExpNode* start,
-    int capture_count,
-    Handle<String> pattern) {
-  Heap* heap = pattern->GetHeap();
-
-  bool use_slow_safe_regexp_compiler = false;
-  if (heap->total_regexp_code_generated() >
-          RegExpImpl::kRegWxpCompiledLimit &&
-      heap->isolate()->memory_allocator()->SizeExecutable() >
-          RegExpImpl::kRegExpExecutableMemoryLimit) {
-    use_slow_safe_regexp_compiler = true;
-  }
+    intptr_t capture_count,
+    const String& pattern) {
+  static const bool use_slow_safe_regexp_compiler = false;
 
   macro_assembler->set_slow_safe(use_slow_safe_regexp_compiler);
+  macro_assembler_ = macro_assembler;
 
-#ifdef DEBUG
-  if (FLAG_trace_regexp_assembler)
-    macro_assembler_ = new RegExpMacroAssemblerTracer(macro_assembler);
-  else
-#endif
-    macro_assembler_ = macro_assembler;
-
-  List <RegExpNode*> work_list(0);
+  ZoneGrowableArray<RegExpNode*> work_list(0);
   work_list_ = &work_list;
-  Label fail;
+  BlockLabel fail;
   macro_assembler_->PushBacktrack(&fail);
   Trace new_trace;
   start->Emit(this, &new_trace);
-  macro_assembler_->Bind(&fail);
+  macro_assembler_->BindBlock(&fail);
   macro_assembler_->Fail();
   while (!work_list.is_empty()) {
     work_list.RemoveLast()->Emit(this, &new_trace);
   }
-  if (reg_exp_too_big_) return IrregexpRegExpTooBig(zone_->isolate());
+  if (reg_exp_too_big_) return IrregexpRegExpTooBig();
 
-  Handle<HeapObject> code = macro_assembler_->GetCode(pattern);
-  heap->IncreaseTotalRegexpCodeGenerated(code->Size());
-  work_list_ = NULL;
-#ifdef DEBUG
-  if (FLAG_print_code) {
-    CodeTracer::Scope trace_scope(heap->isolate()->GetCodeTracer());
-    OFStream os(trace_scope.file());
-    Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os);
-  }
-  if (FLAG_trace_regexp_assembler) {
-    delete macro_assembler_;
-  }
-#endif
-  return RegExpEngine::CompilationResult(*code, next_register_);
+  macro_assembler->GenerateBacktrackBlock();
+
+  return RegExpEngine::CompilationResult(macro_assembler->backtrack_goto(),
+                                         macro_assembler->graph_entry(),
+                                         macro_assembler->num_blocks(),
+                                         macro_assembler->num_stack_locals());
 }
 
 
-bool Trace::DeferredAction::Mentions(int that) {
+bool Trace::DeferredAction::Mentions(intptr_t that) {
   if (action_type() == ActionNode::CLEAR_CAPTURES) {
     Interval range = static_cast<DeferredClearCaptures*>(this)->range();
     return range.Contains(that);
@@ -421,7 +427,7 @@
 }
 
 
-bool Trace::mentions_reg(int reg) {
+bool Trace::mentions_reg(intptr_t reg) {
   for (DeferredAction* action = actions_;
        action != NULL;
        action = action->next()) {
@@ -432,8 +438,8 @@
 }
 
 
-bool Trace::GetStoredPosition(int reg, int* cp_offset) {
-  DCHECK_EQ(0, *cp_offset);
+bool Trace::GetStoredPosition(intptr_t reg, intptr_t* cp_offset) {
+  ASSERT(*cp_offset == 0);
   for (DeferredAction* action = actions_;
        action != NULL;
        action = action->next()) {
@@ -450,19 +456,22 @@
 }
 
 
-int Trace::FindAffectedRegisters(OutSet* affected_registers,
-                                 Zone* zone) {
-  int max_register = RegExpCompiler::kNoRegister;
+// This is called as we come into a loop choice node and some other tricky
+// nodes.  It normalizes the state of the code generator to ensure we can
+// generate generic code.
+intptr_t Trace::FindAffectedRegisters(OutSet* affected_registers,
+                                      Isolate* isolate) {
+  intptr_t max_register = RegExpCompiler::kNoRegister;
   for (DeferredAction* action = actions_;
        action != NULL;
        action = action->next()) {
     if (action->action_type() == ActionNode::CLEAR_CAPTURES) {
       Interval range = static_cast<DeferredClearCaptures*>(action)->range();
-      for (int i = range.from(); i <= range.to(); i++)
-        affected_registers->Set(i, zone);
+      for (intptr_t i = range.from(); i <= range.to(); i++)
+        affected_registers->Set(i, isolate);
       if (range.to() > max_register) max_register = range.to();
     } else {
-      affected_registers->Set(action->reg(), zone);
+      affected_registers->Set(action->reg(), isolate);
       if (action->reg() > max_register) max_register = action->reg();
     }
   }
@@ -471,14 +480,14 @@
 
 
 void Trace::RestoreAffectedRegisters(RegExpMacroAssembler* assembler,
-                                     int max_register,
+                                     intptr_t max_register,
                                      const OutSet& registers_to_pop,
                                      const OutSet& registers_to_clear) {
-  for (int reg = max_register; reg >= 0; reg--) {
+  for (intptr_t reg = max_register; reg >= 0; reg--) {
     if (registers_to_pop.Get(reg)) {
       assembler->PopRegister(reg);
     } else if (registers_to_clear.Get(reg)) {
-      int clear_to = reg;
+      intptr_t clear_to = reg;
       while (reg > 0 && registers_to_clear.Get(reg - 1)) {
         reg--;
       }
@@ -489,18 +498,12 @@
 
 
 void Trace::PerformDeferredActions(RegExpMacroAssembler* assembler,
-                                   int max_register,
+                                   intptr_t max_register,
                                    const OutSet& affected_registers,
                                    OutSet* registers_to_pop,
                                    OutSet* registers_to_clear,
-                                   Zone* zone) {
-  // The "+1" is to avoid a push_limit of zero if stack_limit_slack() is 1.
-  const int push_limit = (assembler->stack_limit_slack() + 1) / 2;
-
-  // Count pushes performed to force a stack limit check occasionally.
-  int pushes = 0;
-
-  for (int reg = 0; reg <= max_register; reg++) {
+                                   Isolate* isolate) {
+  for (intptr_t reg = 0; reg <= max_register; reg++) {
     if (!affected_registers.Get(reg)) {
       continue;
     }
@@ -508,13 +511,13 @@
     // The chronologically first deferred action in the trace
     // is used to infer the action needed to restore a register
     // to its previous state (or not, if it's safe to ignore it).
-    enum DeferredActionUndoType { IGNORE, RESTORE, CLEAR };
-    DeferredActionUndoType undo_action = IGNORE;
+    enum DeferredActionUndoType { ACTION_IGNORE, ACTION_RESTORE, ACTION_CLEAR };
+    DeferredActionUndoType undo_action = ACTION_IGNORE;
 
-    int value = 0;
+    intptr_t value = 0;
     bool absolute = false;
     bool clear = false;
-    int store_position = -1;
+    intptr_t store_position = -1;
     // This is a little tricky because we are scanning the actions in reverse
     // historical order (newest first).
     for (DeferredAction* action = actions_;
@@ -531,21 +534,21 @@
             }
             // SET_REGISTER is currently only used for newly introduced loop
             // counters. They can have a significant previous value if they
-            // occour in a loop. TODO(lrn): Propagate this information, so
-            // we can set undo_action to IGNORE if we know there is no value to
-            // restore.
-            undo_action = RESTORE;
-            DCHECK_EQ(store_position, -1);
-            DCHECK(!clear);
+            // occour in a loop. TODO(lrn): Propagate this information, so we
+            // can set undo_action to ACTION_IGNORE if we know there is no
+            // value to restore.
+            undo_action = ACTION_RESTORE;
+            ASSERT(store_position == -1);
+            ASSERT(!clear);
             break;
           }
           case ActionNode::INCREMENT_REGISTER:
             if (!absolute) {
               value++;
             }
-            DCHECK_EQ(store_position, -1);
-            DCHECK(!clear);
-            undo_action = RESTORE;
+            ASSERT(store_position == -1);
+            ASSERT(!clear);
+            undo_action = ACTION_RESTORE;
             break;
           case ActionNode::STORE_POSITION: {
             Trace::DeferredCapture* pc =
@@ -562,12 +565,12 @@
               // always set correctly if we succeed. There is no
               // need to undo a setting on backtrack, because we
               // will set it again or fail.
-              undo_action = IGNORE;
+              undo_action = ACTION_IGNORE;
             } else {
-              undo_action = pc->is_capture() ? CLEAR : RESTORE;
+              undo_action = pc->is_capture() ? ACTION_CLEAR : ACTION_RESTORE;
             }
-            DCHECK(!absolute);
-            DCHECK_EQ(value, 0);
+            ASSERT(!absolute);
+            ASSERT(value == 0);
             break;
           }
           case ActionNode::CLEAR_CAPTURES: {
@@ -577,9 +580,9 @@
             if (store_position == -1) {
               clear = true;
             }
-            undo_action = RESTORE;
-            DCHECK(!absolute);
-            DCHECK_EQ(value, 0);
+            undo_action = ACTION_RESTORE;
+            ASSERT(!absolute);
+            ASSERT(value == 0);
             break;
           }
           default:
@@ -589,19 +592,11 @@
       }
     }
     // Prepare for the undo-action (e.g., push if it's going to be popped).
-    if (undo_action == RESTORE) {
-      pushes++;
-      RegExpMacroAssembler::StackCheckFlag stack_check =
-          RegExpMacroAssembler::kNoStackLimitCheck;
-      if (pushes == push_limit) {
-        stack_check = RegExpMacroAssembler::kCheckStackLimit;
-        pushes = 0;
-      }
-
-      assembler->PushRegister(reg, stack_check);
-      registers_to_pop->Set(reg, zone);
-    } else if (undo_action == CLEAR) {
-      registers_to_clear->Set(reg, zone);
+    if (undo_action == ACTION_RESTORE) {
+      assembler->PushRegister(reg);
+      registers_to_pop->Set(reg, isolate);
+    } else if (undo_action == ACTION_CLEAR) {
+      registers_to_clear->Set(reg, isolate);
     }
     // Perform the chronologically last action (or accumulated increment)
     // for the register.
@@ -624,7 +619,7 @@
 void Trace::Flush(RegExpCompiler* compiler, RegExpNode* successor) {
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
 
-  DCHECK(!is_trivial());
+  ASSERT(!is_trivial());
 
   if (actions_ == NULL && backtrack() == NULL) {
     // Here we just have some deferred cp advances to fix and we are back to
@@ -647,8 +642,7 @@
     assembler->PushCurrentPosition();
   }
 
-  int max_register = FindAffectedRegisters(&affected_registers,
-                                           compiler->zone());
+  intptr_t max_register = FindAffectedRegisters(&affected_registers, CI);
   OutSet registers_to_pop;
   OutSet registers_to_clear;
   PerformDeferredActions(assembler,
@@ -656,19 +650,19 @@
                          affected_registers,
                          &registers_to_pop,
                          &registers_to_clear,
-                         compiler->zone());
+                         CI);
   if (cp_offset_ != 0) {
     assembler->AdvanceCurrentPosition(cp_offset_);
   }
 
   // Create a new trivial state and generate the node with that.
-  Label undo;
+  BlockLabel undo;
   assembler->PushBacktrack(&undo);
   Trace new_state;
   successor->Emit(compiler, &new_state);
 
   // On backtrack we need to restore state.
-  assembler->Bind(&undo);
+  assembler->BindBlock(&undo);
   RestoreAffectedRegisters(assembler,
                            max_register,
                            registers_to_pop,
@@ -687,10 +681,10 @@
 
   // Omit flushing the trace. We discard the entire stack frame anyway.
 
-  if (!label()->is_bound()) {
+  if (!label()->IsBound()) {
     // We are completely independent of the trace, since we ignore it,
     // so this code can be used as the generic version.
-    assembler->Bind(label());
+    assembler->BindBlock(label());
   }
 
   // Throw away everything on the backtrack stack since the start
@@ -715,8 +709,8 @@
     return;
   }
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  if (!label()->is_bound()) {
-    assembler->Bind(label());
+  if (!label()->IsBound()) {
+    assembler->BindBlock(label());
   }
   switch (action_) {
     case ACCEPT:
@@ -733,37 +727,38 @@
 }
 
 
-void GuardedAlternative::AddGuard(Guard* guard, Zone* zone) {
+void GuardedAlternative::AddGuard(Guard* guard, Isolate* isolate) {
   if (guards_ == NULL)
-    guards_ = new(zone) ZoneList<Guard*>(1, zone);
-  guards_->Add(guard, zone);
+    guards_ = new(isolate) ZoneGrowableArray<Guard*>(1);
+  guards_->Add(guard);
 }
 
 
-ActionNode* ActionNode::SetRegister(int reg,
-                                    int val,
+ActionNode* ActionNode::SetRegister(intptr_t reg,
+                                    intptr_t val,
                                     RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(SET_REGISTER, on_success);
+      new(on_success->isolate()) ActionNode(SET_REGISTER, on_success);
   result->data_.u_store_register.reg = reg;
   result->data_.u_store_register.value = val;
   return result;
 }
 
 
-ActionNode* ActionNode::IncrementRegister(int reg, RegExpNode* on_success) {
+ActionNode* ActionNode::IncrementRegister(intptr_t reg,
+                                          RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(INCREMENT_REGISTER, on_success);
+      new(on_success->isolate()) ActionNode(INCREMENT_REGISTER, on_success);
   result->data_.u_increment_register.reg = reg;
   return result;
 }
 
 
-ActionNode* ActionNode::StorePosition(int reg,
+ActionNode* ActionNode::StorePosition(intptr_t reg,
                                       bool is_capture,
                                       RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(STORE_POSITION, on_success);
+      new(on_success->isolate()) ActionNode(STORE_POSITION, on_success);
   result->data_.u_position_register.reg = reg;
   result->data_.u_position_register.is_capture = is_capture;
   return result;
@@ -773,31 +768,32 @@
 ActionNode* ActionNode::ClearCaptures(Interval range,
                                       RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(CLEAR_CAPTURES, on_success);
+      new(on_success->isolate()) ActionNode(CLEAR_CAPTURES, on_success);
   result->data_.u_clear_captures.range_from = range.from();
   result->data_.u_clear_captures.range_to = range.to();
   return result;
 }
 
 
-ActionNode* ActionNode::BeginSubmatch(int stack_reg,
-                                      int position_reg,
+ActionNode* ActionNode::BeginSubmatch(intptr_t stack_reg,
+                                      intptr_t position_reg,
                                       RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(BEGIN_SUBMATCH, on_success);
+      new(on_success->isolate()) ActionNode(BEGIN_SUBMATCH, on_success);
   result->data_.u_submatch.stack_pointer_register = stack_reg;
   result->data_.u_submatch.current_position_register = position_reg;
   return result;
 }
 
 
-ActionNode* ActionNode::PositiveSubmatchSuccess(int stack_reg,
-                                                int position_reg,
-                                                int clear_register_count,
-                                                int clear_register_from,
+ActionNode* ActionNode::PositiveSubmatchSuccess(intptr_t stack_reg,
+                                                intptr_t position_reg,
+                                                intptr_t clear_register_count,
+                                                intptr_t clear_register_from,
                                                 RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(POSITIVE_SUBMATCH_SUCCESS, on_success);
+      new(on_success->isolate()) ActionNode(POSITIVE_SUBMATCH_SUCCESS,
+                                            on_success);
   result->data_.u_submatch.stack_pointer_register = stack_reg;
   result->data_.u_submatch.current_position_register = position_reg;
   result->data_.u_submatch.clear_register_count = clear_register_count;
@@ -806,12 +802,12 @@
 }
 
 
-ActionNode* ActionNode::EmptyMatchCheck(int start_register,
-                                        int repetition_register,
-                                        int repetition_limit,
+ActionNode* ActionNode::EmptyMatchCheck(intptr_t start_register,
+                                        intptr_t repetition_register,
+                                        intptr_t repetition_limit,
                                         RegExpNode* on_success) {
   ActionNode* result =
-      new(on_success->zone()) ActionNode(EMPTY_MATCH_CHECK, on_success);
+      new(on_success->isolate()) ActionNode(EMPTY_MATCH_CHECK, on_success);
   result->data_.u_empty_match_check.start_register = start_register;
   result->data_.u_empty_match_check.repetition_register = repetition_register;
   result->data_.u_empty_match_check.repetition_limit = repetition_limit;
@@ -841,13 +837,13 @@
                                Trace* trace) {
   switch (guard->op()) {
     case Guard::LT:
-      DCHECK(!trace->mentions_reg(guard->reg()));
+      ASSERT(!trace->mentions_reg(guard->reg()));
       macro_assembler->IfRegisterGE(guard->reg(),
                                     guard->value(),
                                     trace->backtrack());
       break;
     case Guard::GEQ:
-      DCHECK(!trace->mentions_reg(guard->reg()));
+      ASSERT(!trace->mentions_reg(guard->reg()));
       macro_assembler->IfRegisterLT(guard->reg(),
                                     guard->value(),
                                     trace->backtrack());
@@ -858,18 +854,18 @@
 
 // Returns the number of characters in the equivalence class, omitting those
 // that cannot occur in the source string because it is ASCII.
-static int GetCaseIndependentLetters(Isolate* isolate, uc16 character,
-                                     bool one_byte_subject,
-                                     unibrow::uchar* letters) {
-  int length =
-      isolate->jsregexp_uncanonicalize()->get(character, '\0', letters);
+static intptr_t GetCaseIndependentLetters(uint16_t character,
+                                          bool one_byte_subject,
+                                          int32_t* letters) {
+  unibrow::Mapping<unibrow::Ecma262UnCanonicalize> jsregexp_uncanonicalize;
+  intptr_t length = jsregexp_uncanonicalize.get(character, '\0', letters);
   // Unibrow returns 0 or 1 for characters where case independence is
   // trivial.
   if (length == 0) {
     letters[0] = character;
     length = 1;
   }
-  if (!one_byte_subject || character <= String::kMaxOneByteCharCode) {
+  if (!one_byte_subject || character <= Symbols::kMaxOneCharCodeSymbol) {
     return length;
   }
 
@@ -883,9 +879,9 @@
 
 static inline bool EmitSimpleCharacter(Isolate* isolate,
                                        RegExpCompiler* compiler,
-                                       uc16 c,
-                                       Label* on_failure,
-                                       int cp_offset,
+                                       uint16_t c,
+                                       BlockLabel* on_failure,
+                                       intptr_t cp_offset,
                                        bool check,
                                        bool preloaded) {
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
@@ -906,15 +902,15 @@
 // independent matches.
 static inline bool EmitAtomNonLetter(Isolate* isolate,
                                      RegExpCompiler* compiler,
-                                     uc16 c,
-                                     Label* on_failure,
-                                     int cp_offset,
+                                     uint16_t c,
+                                     BlockLabel* on_failure,
+                                     intptr_t cp_offset,
                                      bool check,
                                      bool preloaded) {
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   bool one_byte = compiler->one_byte();
-  unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(isolate, c, one_byte, chars);
+  int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+  intptr_t length = GetCaseIndependentLetters(c, one_byte, chars);
   if (length < 1) {
     // This can't match.  Must be an one-byte subject and a non-one-byte
     // character.  We do not need to do anything since the one-byte pass
@@ -924,7 +920,7 @@
   bool checked = false;
   // We handle the length > 1 case in a later pass.
   if (length == 1) {
-    if (one_byte && c > String::kMaxOneByteCharCodeU) {
+    if (one_byte && c > Symbols::kMaxOneCharCodeSymbol) {
       // Can't match - see above.
       return false;  // Bounds not checked.
     }
@@ -939,32 +935,34 @@
 
 
 static bool ShortCutEmitCharacterPair(RegExpMacroAssembler* macro_assembler,
-                                      bool one_byte, uc16 c1, uc16 c2,
-                                      Label* on_failure) {
-  uc16 char_mask;
+                                      bool one_byte,
+                                      uint16_t c1,
+                                      uint16_t c2,
+                                      BlockLabel* on_failure) {
+  uint16_t char_mask;
   if (one_byte) {
-    char_mask = String::kMaxOneByteCharCode;
+    char_mask = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    char_mask = String::kMaxUtf16CodeUnit;
+    char_mask = Utf16::kMaxCodeUnit;
   }
-  uc16 exor = c1 ^ c2;
+  uint16_t exor = c1 ^ c2;
   // Check whether exor has only one bit set.
   if (((exor - 1) & exor) == 0) {
     // If c1 and c2 differ only by one bit.
     // Ecma262UnCanonicalize always gives the highest number last.
-    DCHECK(c2 > c1);
-    uc16 mask = char_mask ^ exor;
+    ASSERT(c2 > c1);
+    uint16_t mask = char_mask ^ exor;
     macro_assembler->CheckNotCharacterAfterAnd(c1, mask, on_failure);
     return true;
   }
-  DCHECK(c2 > c1);
-  uc16 diff = c2 - c1;
+  ASSERT(c2 > c1);
+  uint16_t diff = c2 - c1;
   if (((diff - 1) & diff) == 0 && c1 >= diff) {
     // If the characters differ by 2^n but don't differ by one bit then
     // subtract the difference from the found character, then do the or
     // trick.  We avoid the theoretical case where negative numbers are
     // involved in order to simplify code generation.
-    uc16 mask = char_mask ^ diff;
+    uint16_t mask = char_mask ^ diff;
     macro_assembler->CheckNotCharacterAfterMinusAnd(c1 - diff,
                                                     diff,
                                                     mask,
@@ -977,9 +975,9 @@
 
 typedef bool EmitCharacterFunction(Isolate* isolate,
                                    RegExpCompiler* compiler,
-                                   uc16 c,
-                                   Label* on_failure,
-                                   int cp_offset,
+                                   uint16_t c,
+                                   BlockLabel* on_failure,
+                                   intptr_t cp_offset,
                                    bool check,
                                    bool preloaded);
 
@@ -987,31 +985,34 @@
 // matches.
 static inline bool EmitAtomLetter(Isolate* isolate,
                                   RegExpCompiler* compiler,
-                                  uc16 c,
-                                  Label* on_failure,
-                                  int cp_offset,
+                                  uint16_t c,
+                                  BlockLabel* on_failure,
+                                  intptr_t cp_offset,
                                   bool check,
                                   bool preloaded) {
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   bool one_byte = compiler->one_byte();
-  unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(isolate, c, one_byte, chars);
+  int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+  intptr_t length = GetCaseIndependentLetters(c, one_byte, chars);
   if (length <= 1) return false;
   // We may not need to check against the end of the input string
   // if this character lies before a character that matched.
   if (!preloaded) {
     macro_assembler->LoadCurrentCharacter(cp_offset, on_failure, check);
   }
-  Label ok;
-  DCHECK(unibrow::Ecma262UnCanonicalize::kMaxWidth == 4);
+  BlockLabel ok;
+  ASSERT(unibrow::Ecma262UnCanonicalize::kMaxWidth == 4);
   switch (length) {
     case 2: {
-      if (ShortCutEmitCharacterPair(macro_assembler, one_byte, chars[0],
-                                    chars[1], on_failure)) {
+      if (ShortCutEmitCharacterPair(macro_assembler,
+                                    one_byte,
+                                    chars[0],
+                                    chars[1],
+                                    on_failure)) {
       } else {
         macro_assembler->CheckCharacter(chars[0], &ok);
         macro_assembler->CheckNotCharacter(chars[1], on_failure);
-        macro_assembler->Bind(&ok);
+        macro_assembler->BindBlock(&ok);
       }
       break;
     }
@@ -1022,7 +1023,7 @@
       macro_assembler->CheckCharacter(chars[0], &ok);
       macro_assembler->CheckCharacter(chars[1], &ok);
       macro_assembler->CheckNotCharacter(chars[2], on_failure);
-      macro_assembler->Bind(&ok);
+      macro_assembler->BindBlock(&ok);
       break;
     default:
       UNREACHABLE();
@@ -1033,10 +1034,10 @@
 
 
 static void EmitBoundaryTest(RegExpMacroAssembler* masm,
-                             int border,
-                             Label* fall_through,
-                             Label* above_or_equal,
-                             Label* below) {
+                             intptr_t border,
+                             BlockLabel* fall_through,
+                             BlockLabel* above_or_equal,
+                             BlockLabel* below) {
   if (below != fall_through) {
     masm->CheckCharacterLT(border, below);
     if (above_or_equal != fall_through) masm->GoTo(above_or_equal);
@@ -1047,11 +1048,11 @@
 
 
 static void EmitDoubleBoundaryTest(RegExpMacroAssembler* masm,
-                                   int first,
-                                   int last,
-                                   Label* fall_through,
-                                   Label* in_range,
-                                   Label* out_of_range) {
+                                   intptr_t first,
+                                   intptr_t last,
+                                   BlockLabel* fall_through,
+                                   BlockLabel* in_range,
+                                   BlockLabel* out_of_range) {
   if (in_range == fall_through) {
     if (first == last) {
       masm->CheckNotCharacter(first, out_of_range);
@@ -1073,29 +1074,28 @@
 // odd_label is for ranges[i] to ranges[i + 1] where i - start_index is odd.
 static void EmitUseLookupTable(
     RegExpMacroAssembler* masm,
-    ZoneList<int>* ranges,
-    int start_index,
-    int end_index,
-    int min_char,
-    Label* fall_through,
-    Label* even_label,
-    Label* odd_label) {
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  static const int kMask = RegExpMacroAssembler::kTableMask;
+    ZoneGrowableArray<int>* ranges,
+    intptr_t start_index,
+    intptr_t end_index,
+    intptr_t min_char,
+    BlockLabel* fall_through,
+    BlockLabel* even_label,
+    BlockLabel* odd_label) {
+  static const intptr_t kSize = RegExpMacroAssembler::kTableSize;
+  static const intptr_t kMask = RegExpMacroAssembler::kTableMask;
 
-  int base = (min_char & ~kMask);
-  USE(base);
+  intptr_t base = (min_char & ~kMask);
 
   // Assert that everything is on one kTableSize page.
-  for (int i = start_index; i <= end_index; i++) {
-    DCHECK_EQ(ranges->at(i) & ~kMask, base);
+  for (intptr_t i = start_index; i <= end_index; i++) {
+    ASSERT((ranges->At(i) & ~kMask) == base);
   }
-  DCHECK(start_index == 0 || (ranges->at(start_index - 1) & ~kMask) <= base);
+  ASSERT(start_index == 0 || (ranges->At(start_index - 1) & ~kMask) <= base);
 
   char templ[kSize];
-  Label* on_bit_set;
-  Label* on_bit_clear;
-  int bit;
+  BlockLabel* on_bit_set;
+  BlockLabel* on_bit_clear;
+  intptr_t bit;
   if (even_label == fall_through) {
     on_bit_set = odd_label;
     on_bit_clear = even_label;
@@ -1105,25 +1105,27 @@
     on_bit_clear = odd_label;
     bit = 0;
   }
-  for (int i = 0; i < (ranges->at(start_index) & kMask) && i < kSize; i++) {
+  for (intptr_t i = 0; i < (ranges->At(start_index) & kMask) && i < kSize;
+       i++) {
     templ[i] = bit;
   }
-  int j = 0;
+  intptr_t j = 0;
   bit ^= 1;
-  for (int i = start_index; i < end_index; i++) {
-    for (j = (ranges->at(i) & kMask); j < (ranges->at(i + 1) & kMask); j++) {
+  for (intptr_t i = start_index; i < end_index; i++) {
+    for (j = (ranges->At(i) & kMask); j < (ranges->At(i + 1) & kMask); j++) {
       templ[j] = bit;
     }
     bit ^= 1;
   }
-  for (int i = j; i < kSize; i++) {
+  for (intptr_t i = j; i < kSize; i++) {
     templ[i] = bit;
   }
-  Factory* factory = masm->zone()->isolate()->factory();
   // TODO(erikcorry): Cache these.
-  Handle<ByteArray> ba = factory->NewByteArray(kSize, TENURED);
-  for (int i = 0; i < kSize; i++) {
-    ba->set(i, templ[i]);
+  const TypedData& ba = TypedData::ZoneHandle(
+        masm->isolate(),
+        TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
+  for (intptr_t i = 0; i < kSize; i++) {
+    ba.SetUint8(i, templ[i]);
   }
   masm->CheckBitInTable(ba, on_bit_set);
   if (on_bit_clear != fall_through) masm->GoTo(on_bit_clear);
@@ -1131,52 +1133,52 @@
 
 
 static void CutOutRange(RegExpMacroAssembler* masm,
-                        ZoneList<int>* ranges,
-                        int start_index,
-                        int end_index,
-                        int cut_index,
-                        Label* even_label,
-                        Label* odd_label) {
+                        ZoneGrowableArray<int>* ranges,
+                        intptr_t start_index,
+                        intptr_t end_index,
+                        intptr_t cut_index,
+                        BlockLabel* even_label,
+                        BlockLabel* odd_label) {
   bool odd = (((cut_index - start_index) & 1) == 1);
-  Label* in_range_label = odd ? odd_label : even_label;
-  Label dummy;
+  BlockLabel* in_range_label = odd ? odd_label : even_label;
+  BlockLabel dummy;
   EmitDoubleBoundaryTest(masm,
-                         ranges->at(cut_index),
-                         ranges->at(cut_index + 1) - 1,
+                         ranges->At(cut_index),
+                         ranges->At(cut_index + 1) - 1,
                          &dummy,
                          in_range_label,
                          &dummy);
-  DCHECK(!dummy.is_linked());
+  ASSERT(!dummy.IsLinked());
   // Cut out the single range by rewriting the array.  This creates a new
   // range that is a merger of the two ranges on either side of the one we
   // are cutting out.  The oddity of the labels is preserved.
-  for (int j = cut_index; j > start_index; j--) {
-    ranges->at(j) = ranges->at(j - 1);
+  for (intptr_t j = cut_index; j > start_index; j--) {
+    (*ranges)[j] = ranges->At(j - 1);
   }
-  for (int j = cut_index + 1; j < end_index; j++) {
-    ranges->at(j) = ranges->at(j + 1);
+  for (intptr_t j = cut_index + 1; j < end_index; j++) {
+    (*ranges)[j] = ranges->At(j + 1);
   }
 }
 
 
 // Unicode case.  Split the search space into kSize spaces that are handled
 // with recursion.
-static void SplitSearchSpace(ZoneList<int>* ranges,
-                             int start_index,
-                             int end_index,
-                             int* new_start_index,
-                             int* new_end_index,
-                             int* border) {
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  static const int kMask = RegExpMacroAssembler::kTableMask;
+static void SplitSearchSpace(ZoneGrowableArray<int>* ranges,
+                             intptr_t start_index,
+                             intptr_t end_index,
+                             intptr_t* new_start_index,
+                             intptr_t* new_end_index,
+                             intptr_t* border) {
+  static const intptr_t kSize = RegExpMacroAssembler::kTableSize;
+  static const intptr_t kMask = RegExpMacroAssembler::kTableMask;
 
-  int first = ranges->at(start_index);
-  int last = ranges->at(end_index) - 1;
+  intptr_t first = ranges->At(start_index);
+  intptr_t last = ranges->At(end_index) - 1;
 
   *new_start_index = start_index;
-  *border = (ranges->at(start_index) & ~kMask) + kSize;
+  *border = (ranges->At(start_index) & ~kMask) + kSize;
   while (*new_start_index < end_index) {
-    if (ranges->at(*new_start_index) > *border) break;
+    if (ranges->At(*new_start_index) > *border) break;
     (*new_start_index)++;
   }
   // new_start_index is the index of the first edge that is beyond the
@@ -1190,20 +1192,21 @@
   // 128-character space can take up a lot of space in the ranges array if,
   // for example, we only want to match every second character (eg. the lower
   // case characters on some Unicode pages).
-  int binary_chop_index = (end_index + start_index) / 2;
+  intptr_t binary_chop_index = (end_index + start_index) / 2;
   // The first test ensures that we get to the code that handles the Latin1
   // range with a single not-taken branch, speeding up this important
   // character range (even non-Latin1 charset-based text has spaces and
   // punctuation).
-  if (*border - 1 > String::kMaxOneByteCharCode &&  // Latin1 case.
+  if (*border - 1 > Symbols::kMaxOneCharCodeSymbol &&  // Latin1 case.
       end_index - start_index > (*new_start_index - start_index) * 2 &&
-      last - first > kSize * 2 && binary_chop_index > *new_start_index &&
-      ranges->at(binary_chop_index) >= first + 2 * kSize) {
-    int scan_forward_for_section_border = binary_chop_index;;
-    int new_border = (ranges->at(binary_chop_index) | kMask) + 1;
+      last - first > kSize * 2 &&
+      binary_chop_index > *new_start_index &&
+      ranges->At(binary_chop_index) >= first + 2 * kSize) {
+    intptr_t scan_forward_for_section_border = binary_chop_index;;
+    intptr_t new_border = (ranges->At(binary_chop_index) | kMask) + 1;
 
     while (scan_forward_for_section_border < end_index) {
-      if (ranges->at(scan_forward_for_section_border) > new_border) {
+      if (ranges->At(scan_forward_for_section_border) > new_border) {
         *new_start_index = scan_forward_for_section_border;
         *border = new_border;
         break;
@@ -1212,13 +1215,13 @@
     }
   }
 
-  DCHECK(*new_start_index > start_index);
+  ASSERT(*new_start_index > start_index);
   *new_end_index = *new_start_index - 1;
-  if (ranges->at(*new_end_index) == *border) {
+  if (ranges->At(*new_end_index) == *border) {
     (*new_end_index)--;
   }
-  if (*border >= ranges->at(end_index)) {
-    *border = ranges->at(end_index);
+  if (*border >= ranges->At(end_index)) {
+    *border = ranges->At(end_index);
     *new_start_index = end_index;  // Won't be used.
     *new_end_index = end_index - 1;
   }
@@ -1232,18 +1235,18 @@
 // Either label can be NULL indicating backtracking.  Either label can also be
 // equal to the fall_through label.
 static void GenerateBranches(RegExpMacroAssembler* masm,
-                             ZoneList<int>* ranges,
-                             int start_index,
-                             int end_index,
-                             uc16 min_char,
-                             uc16 max_char,
-                             Label* fall_through,
-                             Label* even_label,
-                             Label* odd_label) {
-  int first = ranges->at(start_index);
-  int last = ranges->at(end_index) - 1;
+                             ZoneGrowableArray<int>* ranges,
+                             intptr_t start_index,
+                             intptr_t end_index,
+                             uint16_t min_char,
+                             uint16_t max_char,
+                             BlockLabel* fall_through,
+                             BlockLabel* even_label,
+                             BlockLabel* odd_label) {
+  intptr_t first = ranges->At(start_index);
+  intptr_t last = ranges->At(end_index) - 1;
 
-  DCHECK_LT(min_char, first);
+  ASSERT(min_char < first);
 
   // Just need to test if the character is before or on-or-after
   // a particular character.
@@ -1265,10 +1268,10 @@
   if (end_index - start_index <= 6) {
     // It is faster to test for individual characters, so we look for those
     // first, then try arbitrary ranges in the second round.
-    static int kNoCutIndex = -1;
-    int cut = kNoCutIndex;
-    for (int i = start_index; i < end_index; i++) {
-      if (ranges->at(i) == ranges->at(i + 1) - 1) {
+    static intptr_t kNoCutIndex = -1;
+    intptr_t cut = kNoCutIndex;
+    for (intptr_t i = start_index; i < end_index; i++) {
+      if (ranges->At(i) == ranges->At(i + 1) - 1) {
         cut = i;
         break;
       }
@@ -1276,7 +1279,7 @@
     if (cut == kNoCutIndex) cut = start_index;
     CutOutRange(
         masm, ranges, start_index, end_index, cut, even_label, odd_label);
-    DCHECK_GE(end_index - start_index, 2);
+    ASSERT(end_index - start_index >= 2);
     GenerateBranches(masm,
                      ranges,
                      start_index + 1,
@@ -1291,7 +1294,7 @@
 
   // If there are a lot of intervals in the regexp, then we will use tables to
   // determine whether the character is inside or outside the character class.
-  static const int kBits = RegExpMacroAssembler::kTableSizeBits;
+  static const intptr_t kBits = RegExpMacroAssembler::kTableSizeBits;
 
   if ((max_char >> kBits) == (min_char >> kBits)) {
     EmitUseLookupTable(masm,
@@ -1319,9 +1322,9 @@
     return;
   }
 
-  int new_start_index = 0;
-  int new_end_index = 0;
-  int border = 0;
+  intptr_t new_start_index = 0;
+  intptr_t new_end_index = 0;
+  intptr_t border = 0;
 
   SplitSearchSpace(ranges,
                    start_index,
@@ -1330,34 +1333,34 @@
                    &new_end_index,
                    &border);
 
-  Label handle_rest;
-  Label* above = &handle_rest;
+  BlockLabel handle_rest;
+  BlockLabel* above = &handle_rest;
   if (border == last + 1) {
     // We didn't find any section that started after the limit, so everything
     // above the border is one of the terminal labels.
     above = (end_index & 1) != (start_index & 1) ? odd_label : even_label;
-    DCHECK(new_end_index == end_index - 1);
+    ASSERT(new_end_index == end_index - 1);
   }
 
-  DCHECK_LE(start_index, new_end_index);
-  DCHECK_LE(new_start_index, end_index);
-  DCHECK_LT(start_index, new_start_index);
-  DCHECK_LT(new_end_index, end_index);
-  DCHECK(new_end_index + 1 == new_start_index ||
+  ASSERT(start_index <= new_end_index);
+  ASSERT(new_start_index <= end_index);
+  ASSERT(start_index < new_start_index);
+  ASSERT(new_end_index < end_index);
+  ASSERT(new_end_index + 1 == new_start_index ||
          (new_end_index + 2 == new_start_index &&
-          border == ranges->at(new_end_index + 1)));
-  DCHECK_LT(min_char, border - 1);
-  DCHECK_LT(border, max_char);
-  DCHECK_LT(ranges->at(new_end_index), border);
-  DCHECK(border < ranges->at(new_start_index) ||
-         (border == ranges->at(new_start_index) &&
+          border == ranges->At(new_end_index + 1)));
+  ASSERT(min_char < border - 1);
+  ASSERT(border < max_char);
+  ASSERT(ranges->At(new_end_index) < border);
+  ASSERT(border < ranges->At(new_start_index) ||
+         (border == ranges->At(new_start_index) &&
           new_start_index == end_index &&
           new_end_index == end_index - 1 &&
           border == last + 1));
-  DCHECK(new_start_index == 0 || border >= ranges->at(new_start_index - 1));
+  ASSERT(new_start_index == 0 || border >= ranges->At(new_start_index - 1));
 
   masm->CheckCharacterGT(border - 1, above);
-  Label dummy;
+  BlockLabel dummy;
   GenerateBranches(masm,
                    ranges,
                    start_index,
@@ -1367,8 +1370,9 @@
                    &dummy,
                    even_label,
                    odd_label);
-  if (handle_rest.is_linked()) {
-    masm->Bind(&handle_rest);
+
+  if (handle_rest.IsLinked()) {
+    masm->BindBlock(&handle_rest);
     bool flip = (new_start_index & 1) != (start_index & 1);
     GenerateBranches(masm,
                      ranges,
@@ -1384,26 +1388,30 @@
 
 
 static void EmitCharClass(RegExpMacroAssembler* macro_assembler,
-                          RegExpCharacterClass* cc, bool one_byte,
-                          Label* on_failure, int cp_offset, bool check_offset,
-                          bool preloaded, Zone* zone) {
-  ZoneList<CharacterRange>* ranges = cc->ranges(zone);
+                          RegExpCharacterClass* cc,
+                          bool one_byte,
+                          BlockLabel* on_failure,
+                          intptr_t cp_offset,
+                          bool check_offset,
+                          bool preloaded,
+                          Isolate* isolate) {
+  ZoneGrowableArray<CharacterRange>* ranges = cc->ranges();
   if (!CharacterRange::IsCanonical(ranges)) {
     CharacterRange::Canonicalize(ranges);
   }
 
-  int max_char;
+  intptr_t max_char;
   if (one_byte) {
-    max_char = String::kMaxOneByteCharCode;
+    max_char = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    max_char = String::kMaxUtf16CodeUnit;
+    max_char = Utf16::kMaxCodeUnit;
   }
 
-  int range_count = ranges->length();
+  intptr_t range_count = ranges->length();
 
-  int last_valid_range = range_count - 1;
+  intptr_t last_valid_range = range_count - 1;
   while (last_valid_range >= 0) {
-    CharacterRange& range = ranges->at(last_valid_range);
+    CharacterRange& range = (*ranges)[last_valid_range];
     if (range.from() <= max_char) {
       break;
     }
@@ -1421,7 +1429,7 @@
   }
 
   if (last_valid_range == 0 &&
-      ranges->at(0).IsEverything(max_char)) {
+      ranges->At(0).IsEverything(max_char)) {
     if (cc->is_negated()) {
       macro_assembler->GoTo(on_failure);
     } else {
@@ -1434,7 +1442,7 @@
   }
   if (last_valid_range == 0 &&
       !cc->is_negated() &&
-      ranges->at(0).IsEverything(max_char)) {
+      ranges->At(0).IsEverything(max_char)) {
     // This is a common case hit by non-anchored expressions.
     if (check_offset) {
       macro_assembler->CheckPosition(cp_offset, on_failure);
@@ -1446,7 +1454,7 @@
     macro_assembler->LoadCurrentCharacter(cp_offset, on_failure, check_offset);
   }
 
-  if (cc->is_standard(zone) &&
+  if (cc->is_standard() &&
         macro_assembler->CheckSpecialCharacterClass(cc->standard_type(),
                                                     on_failure)) {
       return;
@@ -1459,27 +1467,27 @@
   // entry at zero which goes to the failure label, but if there
   // was already one there we fall through for success on that entry.
   // Subsequent entries have alternating meaning (success/failure).
-  ZoneList<int>* range_boundaries =
-      new(zone) ZoneList<int>(last_valid_range, zone);
+  ZoneGrowableArray<int>* range_boundaries =
+      new(isolate) ZoneGrowableArray<int>(last_valid_range);
 
   bool zeroth_entry_is_failure = !cc->is_negated();
 
-  for (int i = 0; i <= last_valid_range; i++) {
-    CharacterRange& range = ranges->at(i);
+  for (intptr_t i = 0; i <= last_valid_range; i++) {
+    CharacterRange& range = (*ranges)[i];
     if (range.from() == 0) {
-      DCHECK_EQ(i, 0);
+      ASSERT(i == 0);
       zeroth_entry_is_failure = !zeroth_entry_is_failure;
     } else {
-      range_boundaries->Add(range.from(), zone);
+      range_boundaries->Add(range.from());
     }
-    range_boundaries->Add(range.to() + 1, zone);
+    range_boundaries->Add(range.to() + 1);
   }
-  int end_index = range_boundaries->length() - 1;
-  if (range_boundaries->at(end_index) > max_char) {
+  intptr_t end_index = range_boundaries->length() - 1;
+  if (range_boundaries->At(end_index) > max_char) {
     end_index--;
   }
 
-  Label fall_through;
+  BlockLabel fall_through;
   GenerateBranches(macro_assembler,
                    range_boundaries,
                    0,  // start_index.
@@ -1489,7 +1497,7 @@
                    &fall_through,
                    zeroth_entry_is_failure ? &fall_through : on_failure,
                    zeroth_entry_is_failure ? on_failure : &fall_through);
-  macro_assembler->Bind(&fall_through);
+  macro_assembler->BindBlock(&fall_through);
 }
 
 
@@ -1506,7 +1514,7 @@
 
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   if (trace->is_trivial()) {
-    if (label_.is_bound()) {
+    if (label_.IsBound()) {
       // We are being asked to generate a generic version, but that's already
       // been done so just go to it.
       macro_assembler->GoTo(&label_);
@@ -1520,14 +1528,14 @@
       return DONE;
     }
     // Generate generic version of the node and bind the label for later use.
-    macro_assembler->Bind(&label_);
+    macro_assembler->BindBlock(&label_);
     return CONTINUE;
   }
 
   // We are being asked to make a non-generic version.  Keep track of how many
   // non-generic versions we generate so as not to overdo it.
   trace_count_++;
-  if (FLAG_regexp_optimization &&
+  if (kRegexpOptimization &&
       trace_count_ < kMaxCopiesCodeGenerated &&
       compiler->recursion_depth() <= RegExpCompiler::kMaxRecursion) {
     return CONTINUE;
@@ -1541,9 +1549,9 @@
 }
 
 
-int ActionNode::EatsAtLeast(int still_to_find,
-                            int budget,
-                            bool not_at_start) {
+intptr_t ActionNode::EatsAtLeast(intptr_t still_to_find,
+                                 intptr_t budget,
+                                 bool not_at_start) {
   if (budget <= 0) return 0;
   if (action_type_ == POSITIVE_SUBMATCH_SUCCESS) return 0;  // Rewinds input!
   return on_success()->EatsAtLeast(still_to_find,
@@ -1552,8 +1560,8 @@
 }
 
 
-void ActionNode::FillInBMInfo(int offset,
-                              int budget,
+void ActionNode::FillInBMInfo(intptr_t offset,
+                              intptr_t budget,
                               BoyerMooreLookahead* bm,
                               bool not_at_start) {
   if (action_type_ == BEGIN_SUBMATCH) {
@@ -1565,9 +1573,9 @@
 }
 
 
-int AssertionNode::EatsAtLeast(int still_to_find,
-                               int budget,
-                               bool not_at_start) {
+intptr_t AssertionNode::EatsAtLeast(intptr_t still_to_find,
+                                    intptr_t budget,
+                                    bool not_at_start) {
   if (budget <= 0) return 0;
   // If we know we are not at the start and we are asked "how many characters
   // will you match if you succeed?" then we can answer anything since false
@@ -1581,8 +1589,8 @@
 }
 
 
-void AssertionNode::FillInBMInfo(int offset,
-                                 int budget,
+void AssertionNode::FillInBMInfo(intptr_t offset,
+                                 intptr_t budget,
                                  BoyerMooreLookahead* bm,
                                  bool not_at_start) {
   // Match the behaviour of EatsAtLeast on this node.
@@ -1592,9 +1600,9 @@
 }
 
 
-int BackReferenceNode::EatsAtLeast(int still_to_find,
-                                   int budget,
-                                   bool not_at_start) {
+intptr_t BackReferenceNode::EatsAtLeast(intptr_t still_to_find,
+                                        intptr_t budget,
+                                        bool not_at_start) {
   if (budget <= 0) return 0;
   return on_success()->EatsAtLeast(still_to_find,
                                    budget - 1,
@@ -1602,10 +1610,10 @@
 }
 
 
-int TextNode::EatsAtLeast(int still_to_find,
-                          int budget,
-                          bool not_at_start) {
-  int answer = Length();
+intptr_t TextNode::EatsAtLeast(intptr_t still_to_find,
+                               intptr_t budget,
+                               bool not_at_start) {
+  intptr_t answer = Length();
   if (answer >= still_to_find) return answer;
   if (budget <= 0) return answer;
   // We are not at start after this node so we set the last argument to 'true'.
@@ -1615,13 +1623,13 @@
 }
 
 
-int NegativeLookaheadChoiceNode::EatsAtLeast(int still_to_find,
-                                             int budget,
-                                             bool not_at_start) {
+intptr_t NegativeLookaheadChoiceNode::EatsAtLeast(intptr_t still_to_find,
+                                                  intptr_t budget,
+                                                  bool not_at_start) {
   if (budget <= 0) return 0;
   // Alternative 0 is the negative lookahead, alternative 1 is what comes
   // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
+  RegExpNode* node = (*alternatives_)[1].node();
   return node->EatsAtLeast(still_to_find, budget - 1, not_at_start);
 }
 
@@ -1629,27 +1637,27 @@
 void NegativeLookaheadChoiceNode::GetQuickCheckDetails(
     QuickCheckDetails* details,
     RegExpCompiler* compiler,
-    int filled_in,
+    intptr_t filled_in,
     bool not_at_start) {
   // Alternative 0 is the negative lookahead, alternative 1 is what comes
   // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
+  RegExpNode* node = (*alternatives_)[1].node();
   return node->GetQuickCheckDetails(details, compiler, filled_in, not_at_start);
 }
 
 
-int ChoiceNode::EatsAtLeastHelper(int still_to_find,
-                                  int budget,
-                                  RegExpNode* ignore_this_node,
-                                  bool not_at_start) {
+intptr_t ChoiceNode::EatsAtLeastHelper(intptr_t still_to_find,
+                                       intptr_t budget,
+                                       RegExpNode* ignore_this_node,
+                                       bool not_at_start) {
   if (budget <= 0) return 0;
-  int min = 100;
-  int choice_count = alternatives_->length();
+  intptr_t min = 100;
+  intptr_t choice_count = alternatives_->length();
   budget = (budget - 1) / choice_count;
-  for (int i = 0; i < choice_count; i++) {
-    RegExpNode* node = alternatives_->at(i).node();
+  for (intptr_t i = 0; i < choice_count; i++) {
+    RegExpNode* node = (*alternatives_)[i].node();
     if (node == ignore_this_node) continue;
-    int node_eats_at_least =
+    intptr_t node_eats_at_least =
         node->EatsAtLeast(still_to_find, budget, not_at_start);
     if (node_eats_at_least < min) min = node_eats_at_least;
     if (min == 0) return 0;
@@ -1658,9 +1666,9 @@
 }
 
 
-int LoopChoiceNode::EatsAtLeast(int still_to_find,
-                                int budget,
-                                bool not_at_start) {
+intptr_t LoopChoiceNode::EatsAtLeast(intptr_t still_to_find,
+                                     intptr_t budget,
+                                     bool not_at_start) {
   return EatsAtLeastHelper(still_to_find,
                            budget - 1,
                            loop_node_,
@@ -1668,9 +1676,9 @@
 }
 
 
-int ChoiceNode::EatsAtLeast(int still_to_find,
-                            int budget,
-                            bool not_at_start) {
+intptr_t ChoiceNode::EatsAtLeast(intptr_t still_to_find,
+                                 intptr_t budget,
+                                 bool not_at_start) {
   return EatsAtLeastHelper(still_to_find,
                            budget,
                            NULL,
@@ -1693,16 +1701,16 @@
   bool found_useful_op = false;
   uint32_t char_mask;
   if (asc) {
-    char_mask = String::kMaxOneByteCharCode;
+    char_mask = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    char_mask = String::kMaxUtf16CodeUnit;
+    char_mask = Utf16::kMaxCodeUnit;
   }
   mask_ = 0;
   value_ = 0;
-  int char_shift = 0;
-  for (int i = 0; i < characters_; i++) {
+  intptr_t char_shift = 0;
+  for (intptr_t i = 0; i < characters_; i++) {
     Position* pos = &positions_[i];
-    if ((pos->mask & String::kMaxOneByteCharCode) != 0) {
+    if ((pos->mask & Symbols::kMaxOneCharCodeSymbol) != 0) {
       found_useful_op = true;
     }
     mask_ |= (pos->mask & char_mask) << char_shift;
@@ -1717,7 +1725,7 @@
                                 Trace* bounds_check_trace,
                                 Trace* trace,
                                 bool preload_has_checked_bounds,
-                                Label* on_possible_success,
+                                BlockLabel* on_possible_success,
                                 QuickCheckDetails* details,
                                 bool fall_through_on_failure) {
   if (details->characters() == 0) return false;
@@ -1725,7 +1733,7 @@
       details, compiler, 0, trace->at_start() == Trace::FALSE_VALUE);
   if (details->cannot_match()) return false;
   if (!details->Rationalize(compiler->one_byte())) return false;
-  DCHECK(details->characters() == 1 ||
+  ASSERT(details->characters() == 1 ||
          compiler->macro_assembler()->CanReadUnaligned());
   uint32_t mask = details->mask();
   uint32_t value = details->value();
@@ -1733,7 +1741,7 @@
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
 
   if (trace->characters_preloaded() != details->characters()) {
-    DCHECK(trace->cp_offset() == bounds_check_trace->cp_offset());
+    ASSERT(trace->cp_offset() == bounds_check_trace->cp_offset());
     // We are attempting to preload the minimum number of characters
     // any choice would eat, so if the bounds check fails, then none of the
     // choices can succeed, so we can just immediately backtrack, rather
@@ -1752,9 +1760,9 @@
     // load so the value is already masked down.
     uint32_t char_mask;
     if (compiler->one_byte()) {
-      char_mask = String::kMaxOneByteCharCode;
+      char_mask = Symbols::kMaxOneCharCodeSymbol;
     } else {
-      char_mask = String::kMaxUtf16CodeUnit;
+      char_mask = Utf16::kMaxCodeUnit;
     }
     if ((mask & char_mask) == char_mask) need_mask = false;
     mask &= char_mask;
@@ -1797,28 +1805,32 @@
 // generating a quick check.
 void TextNode::GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start) {
-  Isolate* isolate = compiler->macro_assembler()->zone()->isolate();
-  DCHECK(characters_filled_in < details->characters());
-  int characters = details->characters();
-  int char_mask;
+#if defined(__GNUC__) && defined(__BYTE_ORDER__)
+  // TODO(zerny): Make the combination code byte-order independent.
+  ASSERT(details->characters() == 1 ||
+         (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__));
+#endif
+  ASSERT(characters_filled_in < details->characters());
+  intptr_t characters = details->characters();
+  intptr_t char_mask;
   if (compiler->one_byte()) {
-    char_mask = String::kMaxOneByteCharCode;
+    char_mask = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    char_mask = String::kMaxUtf16CodeUnit;
+    char_mask = Utf16::kMaxCodeUnit;
   }
-  for (int k = 0; k < elms_->length(); k++) {
-    TextElement elm = elms_->at(k);
+  for (intptr_t k = 0; k < elms_->length(); k++) {
+    TextElement elm = elms_->At(k);
     if (elm.text_type() == TextElement::ATOM) {
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int i = 0; i < characters && i < quarks.length(); i++) {
+      ZoneGrowableArray<uint16_t>* quarks = elm.atom()->data();
+      for (intptr_t i = 0; i < characters && i < quarks->length(); i++) {
         QuickCheckDetails::Position* pos =
             details->positions(characters_filled_in);
-        uc16 c = quarks[i];
+        uint16_t c = quarks->At(i);
         if (c > char_mask) {
           // If we expect a non-Latin1 character from an one-byte string,
-          // there is no way we can match. Not even case-independent
+          // there is no way we can match. Not even case independent
           // matching can turn an Latin1 character into non-Latin1 or
           // vice versa.
           // TODO(dcarney): issue 3550.  Verify that this works as expected.
@@ -1828,10 +1840,10 @@
           return;
         }
         if (compiler->ignore_case()) {
-          unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-          int length = GetCaseIndependentLetters(isolate, c,
-                                                 compiler->one_byte(), chars);
-          DCHECK(length != 0);  // Can only happen if c > char_mask (see above).
+          int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+          intptr_t length =
+              GetCaseIndependentLetters(c, compiler->one_byte(), chars);
+          ASSERT(length != 0);  // Can only happen if c > char_mask (see above).
           if (length == 1) {
             // This letter has no case equivalents, so it's nice and simple
             // and the mask-compare will determine definitely whether we have
@@ -1842,7 +1854,7 @@
           } else {
             uint32_t common_bits = char_mask;
             uint32_t bits = chars[0];
-            for (int j = 1; j < length; j++) {
+            for (intptr_t j = 1; j < length; j++) {
               uint32_t differing_bits = ((chars[j] & common_bits) ^ bits);
               common_bits ^= differing_bits;
               bits &= common_bits;
@@ -1867,7 +1879,7 @@
           pos->determines_perfectly = true;
         }
         characters_filled_in++;
-        DCHECK(characters_filled_in <= details->characters());
+        ASSERT(characters_filled_in <= details->characters());
         if (characters_filled_in == details->characters()) {
           return;
         }
@@ -1876,7 +1888,7 @@
       QuickCheckDetails::Position* pos =
           details->positions(characters_filled_in);
       RegExpCharacterClass* tree = elm.char_class();
-      ZoneList<CharacterRange>* ranges = tree->ranges(zone());
+      ZoneGrowableArray<CharacterRange>* ranges = tree->ranges();
       if (tree->is_negated()) {
         // A quick check uses multi-character mask and compare.  There is no
         // useful way to incorporate a negative char class into this scheme
@@ -1885,8 +1897,8 @@
         pos->mask = 0;
         pos->value = 0;
       } else {
-        int first_range = 0;
-        while (ranges->at(first_range).from() > char_mask) {
+        intptr_t first_range = 0;
+        while (ranges->At(first_range).from() > char_mask) {
           first_range++;
           if (first_range == ranges->length()) {
             details->set_cannot_match();
@@ -1894,9 +1906,9 @@
             return;
           }
         }
-        CharacterRange range = ranges->at(first_range);
-        uc16 from = range.from();
-        uc16 to = range.to();
+        CharacterRange range = ranges->At(first_range);
+        uint16_t from = range.from();
+        uint16_t to = range.to();
         if (to > char_mask) {
           to = char_mask;
         }
@@ -1909,10 +1921,10 @@
         }
         uint32_t common_bits = ~SmearBitsRight(differing_bits);
         uint32_t bits = (from & common_bits);
-        for (int i = first_range + 1; i < ranges->length(); i++) {
-          CharacterRange range = ranges->at(i);
-          uc16 from = range.from();
-          uc16 to = range.to();
+        for (intptr_t i = first_range + 1; i < ranges->length(); i++) {
+          CharacterRange range = ranges->At(i);
+          uint16_t from = range.from();
+          uint16_t to = range.to();
           if (from > char_mask) continue;
           if (to > char_mask) to = char_mask;
           // Here we are combining more ranges into the mask and compare
@@ -1933,13 +1945,13 @@
         pos->value = bits;
       }
       characters_filled_in++;
-      DCHECK(characters_filled_in <= details->characters());
+      ASSERT(characters_filled_in <= details->characters());
       if (characters_filled_in == details->characters()) {
         return;
       }
     }
   }
-  DCHECK(characters_filled_in != details->characters());
+  ASSERT(characters_filled_in != details->characters());
   if (!details->cannot_match()) {
     on_success()-> GetQuickCheckDetails(details,
                                         compiler,
@@ -1959,16 +1971,16 @@
 }
 
 
-void QuickCheckDetails::Advance(int by, bool one_byte) {
-  DCHECK(by >= 0);
+void QuickCheckDetails::Advance(intptr_t by, bool one_byte) {
+  ASSERT(by >= 0);
   if (by >= characters_) {
     Clear();
     return;
   }
-  for (int i = 0; i < characters_ - by; i++) {
+  for (intptr_t i = 0; i < characters_ - by; i++) {
     positions_[i] = positions_[by + i];
   }
-  for (int i = characters_ - by; i < characters_; i++) {
+  for (intptr_t i = characters_ - by; i < characters_; i++) {
     positions_[i].mask = 0;
     positions_[i].value = 0;
     positions_[i].determines_perfectly = false;
@@ -1980,8 +1992,8 @@
 }
 
 
-void QuickCheckDetails::Merge(QuickCheckDetails* other, int from_index) {
-  DCHECK(characters_ == other->characters_);
+void QuickCheckDetails::Merge(QuickCheckDetails* other, intptr_t from_index) {
+  ASSERT(characters_ == other->characters_);
   if (other->cannot_match_) {
     return;
   }
@@ -1989,7 +2001,7 @@
     *this = *other;
     return;
   }
-  for (int i = from_index; i < characters_; i++) {
+  for (intptr_t i = from_index; i < characters_; i++) {
     QuickCheckDetails::Position* pos = positions(i);
     QuickCheckDetails::Position* other_pos = other->positions(i);
     if (pos->mask != other_pos->mask ||
@@ -2002,17 +2014,17 @@
     pos->mask &= other_pos->mask;
     pos->value &= pos->mask;
     other_pos->value &= pos->mask;
-    uc16 differing_bits = (pos->value ^ other_pos->value);
+    uint16_t differing_bits = (pos->value ^ other_pos->value);
     pos->mask &= ~differing_bits;
     pos->value &= pos->mask;
   }
 }
 
 
-class VisitMarker {
+class VisitMarker : public ValueObject {
  public:
   explicit VisitMarker(NodeInfo* info) : info_(info) {
-    DCHECK(!info->visited);
+    ASSERT(!info->visited);
     info->visited = true;
   }
   ~VisitMarker() {
@@ -2023,16 +2035,16 @@
 };
 
 
-RegExpNode* SeqRegExpNode::FilterOneByte(int depth, bool ignore_case) {
+RegExpNode* SeqRegExpNode::FilterOneByte(intptr_t depth, bool ignore_case) {
   if (info()->replacement_calculated) return replacement();
   if (depth < 0) return this;
-  DCHECK(!info()->visited);
+  ASSERT(!info()->visited);
   VisitMarker marker(info());
   return FilterSuccessor(depth - 1, ignore_case);
 }
 
 
-RegExpNode* SeqRegExpNode::FilterSuccessor(int depth, bool ignore_case) {
+RegExpNode* SeqRegExpNode::FilterSuccessor(intptr_t depth, bool ignore_case) {
   RegExpNode* next = on_success_->FilterOneByte(depth - 1, ignore_case);
   if (next == NULL) return set_replacement(NULL);
   on_success_ = next;
@@ -2048,58 +2060,74 @@
 }
 
 
-static bool RangesContainLatin1Equivalents(ZoneList<CharacterRange>* ranges) {
-  for (int i = 0; i < ranges->length(); i++) {
+static bool RangesContainLatin1Equivalents(
+    ZoneGrowableArray<CharacterRange>* ranges) {
+  for (intptr_t i = 0; i < ranges->length(); i++) {
     // TODO(dcarney): this could be a lot more efficient.
-    if (RangeContainsLatin1Equivalents(ranges->at(i))) return true;
+    if (RangeContainsLatin1Equivalents(ranges->At(i))) return true;
   }
   return false;
 }
 
 
-RegExpNode* TextNode::FilterOneByte(int depth, bool ignore_case) {
+static uint16_t ConvertNonLatin1ToLatin1(uint16_t c) {
+  ASSERT(c > Symbols::kMaxOneCharCodeSymbol);
+  switch (c) {
+    // This are equivalent characters in unicode.
+    case 0x39c:
+    case 0x3bc:
+      return 0xb5;
+    // This is an uppercase of a Latin-1 character
+    // outside of Latin-1.
+    case 0x178:
+      return 0xff;
+  }
+  return 0;
+}
+
+
+RegExpNode* TextNode::FilterOneByte(intptr_t depth, bool ignore_case) {
   if (info()->replacement_calculated) return replacement();
   if (depth < 0) return this;
-  DCHECK(!info()->visited);
+  ASSERT(!info()->visited);
   VisitMarker marker(info());
-  int element_count = elms_->length();
-  for (int i = 0; i < element_count; i++) {
-    TextElement elm = elms_->at(i);
+  intptr_t element_count = elms_->length();
+  for (intptr_t i = 0; i < element_count; i++) {
+    TextElement elm = elms_->At(i);
     if (elm.text_type() == TextElement::ATOM) {
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int j = 0; j < quarks.length(); j++) {
-        uint16_t c = quarks[j];
-        if (c <= String::kMaxOneByteCharCode) continue;
+      ZoneGrowableArray<uint16_t>* quarks = elm.atom()->data();
+      for (intptr_t j = 0; j < quarks->length(); j++) {
+        uint16_t c = quarks->At(j);
+        if (c <= Symbols::kMaxOneCharCodeSymbol) continue;
         if (!ignore_case) return set_replacement(NULL);
         // Here, we need to check for characters whose upper and lower cases
         // are outside the Latin-1 range.
-        uint16_t converted = unibrow::Latin1::ConvertNonLatin1ToLatin1(c);
+        uint16_t converted = ConvertNonLatin1ToLatin1(c);
         // Character is outside Latin-1 completely
         if (converted == 0) return set_replacement(NULL);
         // Convert quark to Latin-1 in place.
-        uint16_t* copy = const_cast<uint16_t*>(quarks.start());
-        copy[j] = converted;
+        (*quarks)[0] = converted;
       }
     } else {
-      DCHECK(elm.text_type() == TextElement::CHAR_CLASS);
+      ASSERT(elm.text_type() == TextElement::CHAR_CLASS);
       RegExpCharacterClass* cc = elm.char_class();
-      ZoneList<CharacterRange>* ranges = cc->ranges(zone());
+      ZoneGrowableArray<CharacterRange>* ranges = cc->ranges();
       if (!CharacterRange::IsCanonical(ranges)) {
         CharacterRange::Canonicalize(ranges);
       }
       // Now they are in order so we only need to look at the first.
-      int range_count = ranges->length();
+      intptr_t range_count = ranges->length();
       if (cc->is_negated()) {
         if (range_count != 0 &&
-            ranges->at(0).from() == 0 &&
-            ranges->at(0).to() >= String::kMaxOneByteCharCode) {
+            ranges->At(0).from() == 0 &&
+            ranges->At(0).to() >= Symbols::kMaxOneCharCodeSymbol) {
           // This will be handled in a later filter.
           if (ignore_case && RangesContainLatin1Equivalents(ranges)) continue;
           return set_replacement(NULL);
         }
       } else {
         if (range_count == 0 ||
-            ranges->at(0).from() > String::kMaxOneByteCharCode) {
+            ranges->At(0).from() > Symbols::kMaxOneCharCodeSymbol) {
           // This will be handled in a later filter.
           if (ignore_case && RangesContainLatin1Equivalents(ranges)) continue;
           return set_replacement(NULL);
@@ -2111,7 +2139,7 @@
 }
 
 
-RegExpNode* LoopChoiceNode::FilterOneByte(int depth, bool ignore_case) {
+RegExpNode* LoopChoiceNode::FilterOneByte(intptr_t depth, bool ignore_case) {
   if (info()->replacement_calculated) return replacement();
   if (depth < 0) return this;
   if (info()->visited) return this;
@@ -2129,30 +2157,30 @@
 }
 
 
-RegExpNode* ChoiceNode::FilterOneByte(int depth, bool ignore_case) {
+RegExpNode* ChoiceNode::FilterOneByte(intptr_t depth, bool ignore_case) {
   if (info()->replacement_calculated) return replacement();
   if (depth < 0) return this;
   if (info()->visited) return this;
   VisitMarker marker(info());
-  int choice_count = alternatives_->length();
+  intptr_t choice_count = alternatives_->length();
 
-  for (int i = 0; i < choice_count; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
+  for (intptr_t i = 0; i < choice_count; i++) {
+    GuardedAlternative alternative = alternatives_->At(i);
     if (alternative.guards() != NULL && alternative.guards()->length() != 0) {
       set_replacement(this);
       return this;
     }
   }
 
-  int surviving = 0;
+  intptr_t surviving = 0;
   RegExpNode* survivor = NULL;
-  for (int i = 0; i < choice_count; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
+  for (intptr_t i = 0; i < choice_count; i++) {
+    GuardedAlternative alternative = alternatives_->At(i);
     RegExpNode* replacement =
         alternative.node()->FilterOneByte(depth - 1, ignore_case);
-    DCHECK(replacement != this);  // No missing EMPTY_MATCH_CHECK.
+    ASSERT(replacement != this);  // No missing EMPTY_MATCH_CHECK.
     if (replacement != NULL) {
-      alternatives_->at(i).set_node(replacement);
+      (*alternatives_)[i].set_node(replacement);
       surviving++;
       survivor = replacement;
     }
@@ -2165,14 +2193,14 @@
   }
   // Only some of the nodes survived the filtering.  We need to rebuild the
   // alternatives list.
-  ZoneList<GuardedAlternative>* new_alternatives =
-      new(zone()) ZoneList<GuardedAlternative>(surviving, zone());
-  for (int i = 0; i < choice_count; i++) {
+  ZoneGrowableArray<GuardedAlternative>* new_alternatives =
+      new(I) ZoneGrowableArray<GuardedAlternative>(surviving);
+  for (intptr_t i = 0; i < choice_count; i++) {
     RegExpNode* replacement =
-        alternatives_->at(i).node()->FilterOneByte(depth - 1, ignore_case);
+        (*alternatives_)[i].node()->FilterOneByte(depth - 1, ignore_case);
     if (replacement != NULL) {
-      alternatives_->at(i).set_node(replacement);
-      new_alternatives->Add(alternatives_->at(i), zone());
+      (*alternatives_)[i].set_node(replacement);
+      new_alternatives->Add((*alternatives_)[i]);
     }
   }
   alternatives_ = new_alternatives;
@@ -2180,7 +2208,7 @@
 }
 
 
-RegExpNode* NegativeLookaheadChoiceNode::FilterOneByte(int depth,
+RegExpNode* NegativeLookaheadChoiceNode::FilterOneByte(intptr_t depth,
                                                        bool ignore_case) {
   if (info()->replacement_calculated) return replacement();
   if (depth < 0) return this;
@@ -2188,24 +2216,24 @@
   VisitMarker marker(info());
   // Alternative 0 is the negative lookahead, alternative 1 is what comes
   // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
+  RegExpNode* node = (*alternatives_)[1].node();
   RegExpNode* replacement = node->FilterOneByte(depth - 1, ignore_case);
   if (replacement == NULL) return set_replacement(NULL);
-  alternatives_->at(1).set_node(replacement);
+  (*alternatives_)[1].set_node(replacement);
 
-  RegExpNode* neg_node = alternatives_->at(0).node();
+  RegExpNode* neg_node = (*alternatives_)[0].node();
   RegExpNode* neg_replacement = neg_node->FilterOneByte(depth - 1, ignore_case);
   // If the negative lookahead is always going to fail then
   // we don't need to check it.
   if (neg_replacement == NULL) return set_replacement(replacement);
-  alternatives_->at(0).set_node(neg_replacement);
+  (*alternatives_)[0].set_node(neg_replacement);
   return set_replacement(this);
 }
 
 
 void LoopChoiceNode::GetQuickCheckDetails(QuickCheckDetails* details,
                                           RegExpCompiler* compiler,
-                                          int characters_filled_in,
+                                          intptr_t characters_filled_in,
                                           bool not_at_start) {
   if (body_can_be_zero_length_ || info()->visited) return;
   VisitMarker marker(info());
@@ -2216,8 +2244,8 @@
 }
 
 
-void LoopChoiceNode::FillInBMInfo(int offset,
-                                  int budget,
+void LoopChoiceNode::FillInBMInfo(intptr_t offset,
+                                  intptr_t budget,
                                   BoyerMooreLookahead* bm,
                                   bool not_at_start) {
   if (body_can_be_zero_length_ || budget <= 0) {
@@ -2232,18 +2260,18 @@
 
 void ChoiceNode::GetQuickCheckDetails(QuickCheckDetails* details,
                                       RegExpCompiler* compiler,
-                                      int characters_filled_in,
+                                      intptr_t characters_filled_in,
                                       bool not_at_start) {
   not_at_start = (not_at_start || not_at_start_);
-  int choice_count = alternatives_->length();
-  DCHECK(choice_count > 0);
-  alternatives_->at(0).node()->GetQuickCheckDetails(details,
+  intptr_t choice_count = alternatives_->length();
+  ASSERT(choice_count > 0);
+  (*alternatives_)[0].node()->GetQuickCheckDetails(details,
                                                     compiler,
                                                     characters_filled_in,
                                                     not_at_start);
-  for (int i = 1; i < choice_count; i++) {
+  for (intptr_t i = 1; i < choice_count; i++) {
     QuickCheckDetails new_details(details->characters());
-    RegExpNode* node = alternatives_->at(i).node();
+    RegExpNode* node = (*alternatives_)[i].node();
     node->GetQuickCheckDetails(&new_details, compiler,
                                characters_filled_in,
                                not_at_start);
@@ -2255,8 +2283,8 @@
 
 // Check for [0-9A-Z_a-z].
 static void EmitWordCheck(RegExpMacroAssembler* assembler,
-                          Label* word,
-                          Label* non_word,
+                          BlockLabel* word,
+                          BlockLabel* non_word,
                           bool fall_through_on_word) {
   if (assembler->CheckSpecialCharacterClass(
           fall_through_on_word ? 'w' : 'W',
@@ -2289,7 +2317,7 @@
   Trace new_trace(*trace);
   new_trace.InvalidateCurrentCharacter();
 
-  Label ok;
+  BlockLabel ok;
   if (new_trace.cp_offset() == 0) {
     // The start of input counts as a newline in this context, so skip to
     // ok if we are at the start.
@@ -2309,7 +2337,7 @@
     assembler->CheckCharacter('\n', &ok);
     assembler->CheckNotCharacter('\r', new_trace.backtrack());
   }
-  assembler->Bind(&ok);
+  assembler->BindBlock(&ok);
   on_success->Emit(compiler, &new_trace);
 }
 
@@ -2321,13 +2349,14 @@
   bool not_at_start = (trace->at_start() == Trace::FALSE_VALUE);
   BoyerMooreLookahead* lookahead = bm_info(not_at_start);
   if (lookahead == NULL) {
-    int eats_at_least =
-        Min(kMaxLookaheadForBoyerMoore, EatsAtLeast(kMaxLookaheadForBoyerMoore,
-                                                    kRecursionBudget,
-                                                    not_at_start));
+    intptr_t eats_at_least =
+        Utils::Minimum(kMaxLookaheadForBoyerMoore,
+                       EatsAtLeast(kMaxLookaheadForBoyerMoore,
+                                   kRecursionBudget,
+                                   not_at_start));
     if (eats_at_least >= 1) {
       BoyerMooreLookahead* bm =
-          new(zone()) BoyerMooreLookahead(eats_at_least, compiler, zone());
+          new(I) BoyerMooreLookahead(eats_at_least, compiler, I);
       FillInBMInfo(0, kRecursionBudget, bm, not_at_start);
       if (bm->at(0)->is_non_word())
         next_is_word_character = Trace::FALSE_VALUE;
@@ -2341,26 +2370,31 @@
   }
   bool at_boundary = (assertion_type_ == AssertionNode::AT_BOUNDARY);
   if (next_is_word_character == Trace::UNKNOWN) {
-    Label before_non_word;
-    Label before_word;
+    BlockLabel before_non_word;
+    BlockLabel before_word;
     if (trace->characters_preloaded() != 1) {
       assembler->LoadCurrentCharacter(trace->cp_offset(), &before_non_word);
     }
     // Fall through on non-word.
     EmitWordCheck(assembler, &before_word, &before_non_word, false);
     // Next character is not a word character.
-    assembler->Bind(&before_non_word);
-    Label ok;
+    assembler->BindBlock(&before_non_word);
+    BlockLabel ok;
+    // Backtrack on \B (non-boundary check) if previous is a word,
+    // since we know next *is not* a word and this would be a boundary.
     BacktrackIfPrevious(compiler, trace, at_boundary ? kIsNonWord : kIsWord);
-    assembler->GoTo(&ok);
 
-    assembler->Bind(&before_word);
+    if (!assembler->IsClosed()) {
+      assembler->GoTo(&ok);
+    }
+
+    assembler->BindBlock(&before_word);
     BacktrackIfPrevious(compiler, trace, at_boundary ? kIsWord : kIsNonWord);
-    assembler->Bind(&ok);
+    assembler->BindBlock(&ok);
   } else if (next_is_word_character == Trace::TRUE_VALUE) {
     BacktrackIfPrevious(compiler, trace, at_boundary ? kIsWord : kIsNonWord);
   } else {
-    DCHECK(next_is_word_character == Trace::FALSE_VALUE);
+    ASSERT(next_is_word_character == Trace::FALSE_VALUE);
     BacktrackIfPrevious(compiler, trace, at_boundary ? kIsNonWord : kIsWord);
   }
 }
@@ -2374,14 +2408,14 @@
   Trace new_trace(*trace);
   new_trace.InvalidateCurrentCharacter();
 
-  Label fall_through, dummy;
+  BlockLabel fall_through, dummy;
 
-  Label* non_word = backtrack_if_previous == kIsNonWord ?
-                    new_trace.backtrack() :
-                    &fall_through;
-  Label* word = backtrack_if_previous == kIsNonWord ?
-                &fall_through :
-                new_trace.backtrack();
+  BlockLabel* non_word = backtrack_if_previous == kIsNonWord ?
+                         new_trace.backtrack() :
+                         &fall_through;
+  BlockLabel* word = backtrack_if_previous == kIsNonWord ?
+                     &fall_through :
+                     new_trace.backtrack();
 
   if (new_trace.cp_offset() == 0) {
     // The start of input counts as a non-word character, so the question is
@@ -2393,14 +2427,14 @@
   assembler->LoadCurrentCharacter(new_trace.cp_offset() - 1, &dummy, false);
   EmitWordCheck(assembler, word, non_word, backtrack_if_previous == kIsNonWord);
 
-  assembler->Bind(&fall_through);
+  assembler->BindBlock(&fall_through);
   on_success()->Emit(compiler, &new_trace);
 }
 
 
 void AssertionNode::GetQuickCheckDetails(QuickCheckDetails* details,
                                          RegExpCompiler* compiler,
-                                         int filled_in,
+                                         intptr_t filled_in,
                                          bool not_at_start) {
   if (assertion_type_ == AT_START && not_at_start) {
     details->set_cannot_match();
@@ -2417,10 +2451,10 @@
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
   switch (assertion_type_) {
     case AT_END: {
-      Label ok;
+      BlockLabel ok;
       assembler->CheckPosition(trace->cp_offset(), &ok);
       assembler->GoTo(trace->backtrack());
-      assembler->Bind(&ok);
+      assembler->BindBlock(&ok);
       break;
     }
     case AT_START: {
@@ -2450,14 +2484,14 @@
 }
 
 
-static bool DeterminedAlready(QuickCheckDetails* quick_check, int offset) {
+static bool DeterminedAlready(QuickCheckDetails* quick_check, intptr_t offset) {
   if (quick_check == NULL) return false;
   if (offset >= quick_check->characters()) return false;
   return quick_check->positions(offset)->determines_perfectly;
 }
 
 
-static void UpdateBoundsCheck(int index, int* checked_up_to) {
+static void UpdateBoundsCheck(intptr_t index, intptr_t* checked_up_to) {
   if (index > *checked_up_to) {
     *checked_up_to = index;
   }
@@ -2498,26 +2532,25 @@
                             bool preloaded,
                             Trace* trace,
                             bool first_element_checked,
-                            int* checked_up_to) {
+                            intptr_t* checked_up_to) {
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  Isolate* isolate = assembler->zone()->isolate();
   bool one_byte = compiler->one_byte();
-  Label* backtrack = trace->backtrack();
+  BlockLabel* backtrack = trace->backtrack();
   QuickCheckDetails* quick_check = trace->quick_check_performed();
-  int element_count = elms_->length();
-  for (int i = preloaded ? 0 : element_count - 1; i >= 0; i--) {
-    TextElement elm = elms_->at(i);
-    int cp_offset = trace->cp_offset() + elm.cp_offset();
+  intptr_t element_count = elms_->length();
+  for (intptr_t i = preloaded ? 0 : element_count - 1; i >= 0; i--) {
+    TextElement elm = elms_->At(i);
+    intptr_t cp_offset = trace->cp_offset() + elm.cp_offset();
     if (elm.text_type() == TextElement::ATOM) {
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int j = preloaded ? 0 : quarks.length() - 1; j >= 0; j--) {
+      ZoneGrowableArray<uint16_t>* quarks = elm.atom()->data();
+      for (intptr_t j = preloaded ? 0 : quarks->length() - 1; j >= 0; j--) {
         if (first_element_checked && i == 0 && j == 0) continue;
         if (DeterminedAlready(quick_check, elm.cp_offset() + j)) continue;
         EmitCharacterFunction* emit_function = NULL;
         switch (pass) {
           case NON_LATIN1_MATCH:
-            DCHECK(one_byte);
-            if (quarks[j] > String::kMaxOneByteCharCode) {
+            ASSERT(one_byte);
+            if (quarks->At(j) > Symbols::kMaxOneCharCodeSymbol) {
               assembler->GoTo(backtrack);
               return;
             }
@@ -2535,9 +2568,9 @@
             break;
         }
         if (emit_function != NULL) {
-          bool bound_checked = emit_function(isolate,
+          bool bound_checked = emit_function(I,
                                              compiler,
-                                             quarks[j],
+                                             quarks->At(j),
                                              backtrack,
                                              cp_offset + j,
                                              *checked_up_to < cp_offset + j,
@@ -2546,13 +2579,19 @@
         }
       }
     } else {
-      DCHECK_EQ(TextElement::CHAR_CLASS, elm.text_type());
+      ASSERT(elm.text_type() == TextElement::CHAR_CLASS);
       if (pass == CHARACTER_CLASS_MATCH) {
         if (first_element_checked && i == 0) continue;
         if (DeterminedAlready(quick_check, elm.cp_offset())) continue;
         RegExpCharacterClass* cc = elm.char_class();
-        EmitCharClass(assembler, cc, one_byte, backtrack, cp_offset,
-                      *checked_up_to < cp_offset, preloaded, zone());
+        EmitCharClass(assembler,
+                      cc,
+                      one_byte,
+                      backtrack,
+                      cp_offset,
+                      *checked_up_to < cp_offset,
+                      preloaded,
+                      I);
         UpdateBoundsCheck(cp_offset, checked_up_to);
       }
     }
@@ -2560,15 +2599,15 @@
 }
 
 
-int TextNode::Length() {
-  TextElement elm = elms_->last();
-  DCHECK(elm.cp_offset() >= 0);
+intptr_t TextNode::Length() {
+  TextElement elm = elms_->Last();
+  ASSERT(elm.cp_offset() >= 0);
   return elm.cp_offset() + elm.length();
 }
 
 
-bool TextNode::SkipPass(int int_pass, bool ignore_case) {
-  TextEmitPassType pass = static_cast<TextEmitPassType>(int_pass);
+bool TextNode::SkipPass(intptr_t intptr_t_pass, bool ignore_case) {
+  TextEmitPassType pass = static_cast<TextEmitPassType>(intptr_t_pass);
   if (ignore_case) {
     return pass == SIMPLE_CHARACTER_MATCH;
   } else {
@@ -2586,7 +2625,7 @@
 void TextNode::Emit(RegExpCompiler* compiler, Trace* trace) {
   LimitResult limit_result = LimitVersions(compiler, trace);
   if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
+  ASSERT(limit_result == CONTINUE);
 
   if (trace->cp_offset() + Length() > RegExpMacroAssembler::kMaxCPOffset) {
     compiler->SetRegExpTooBig();
@@ -2594,18 +2633,18 @@
   }
 
   if (compiler->one_byte()) {
-    int dummy = 0;
+    intptr_t dummy = 0;
     TextEmitPass(compiler, NON_LATIN1_MATCH, false, trace, false, &dummy);
   }
 
   bool first_elt_done = false;
-  int bound_checked_to = trace->cp_offset() - 1;
+  intptr_t bound_checked_to = trace->cp_offset() - 1;
   bound_checked_to += trace->bound_checked_up_to();
 
   // If a character is preloaded into the current character register then
   // check that now.
   if (trace->characters_preloaded() == 1) {
-    for (int pass = kFirstRealPass; pass <= kLastPass; pass++) {
+    for (intptr_t pass = kFirstRealPass; pass <= kLastPass; pass++) {
       if (!SkipPass(pass, compiler->ignore_case())) {
         TextEmitPass(compiler,
                      static_cast<TextEmitPassType>(pass),
@@ -2618,7 +2657,7 @@
     first_elt_done = true;
   }
 
-  for (int pass = kFirstRealPass; pass <= kLastPass; pass++) {
+  for (intptr_t pass = kFirstRealPass; pass <= kLastPass; pass++) {
     if (!SkipPass(pass, compiler->ignore_case())) {
       TextEmitPass(compiler,
                    static_cast<TextEmitPassType>(pass),
@@ -2642,8 +2681,9 @@
 }
 
 
-void Trace::AdvanceCurrentPositionInTrace(int by, RegExpCompiler* compiler) {
-  DCHECK(by > 0);
+void Trace::AdvanceCurrentPositionInTrace(intptr_t by,
+                                          RegExpCompiler* compiler) {
+  ASSERT(by > 0);
   // We don't have an instruction for shifting the current character register
   // down or for using a shifted value for anything so lets just forget that
   // we preloaded any characters into it.
@@ -2657,31 +2697,32 @@
     compiler->SetRegExpTooBig();
     cp_offset_ = 0;
   }
-  bound_checked_up_to_ = Max(0, bound_checked_up_to_ - by);
+  bound_checked_up_to_ = Utils::Maximum(static_cast<intptr_t>(0),
+                                        bound_checked_up_to_ - by);
 }
 
 
 void TextNode::MakeCaseIndependent(bool is_one_byte) {
-  int element_count = elms_->length();
-  for (int i = 0; i < element_count; i++) {
-    TextElement elm = elms_->at(i);
+  intptr_t element_count = elms_->length();
+  for (intptr_t i = 0; i < element_count; i++) {
+    TextElement elm = elms_->At(i);
     if (elm.text_type() == TextElement::CHAR_CLASS) {
       RegExpCharacterClass* cc = elm.char_class();
       // None of the standard character classes is different in the case
       // independent case and it slows us down if we don't know that.
-      if (cc->is_standard(zone())) continue;
-      ZoneList<CharacterRange>* ranges = cc->ranges(zone());
-      int range_count = ranges->length();
-      for (int j = 0; j < range_count; j++) {
-        ranges->at(j).AddCaseEquivalents(ranges, is_one_byte, zone());
+      if (cc->is_standard()) continue;
+      ZoneGrowableArray<CharacterRange>* ranges = cc->ranges();
+      intptr_t range_count = ranges->length();
+      for (intptr_t j = 0; j < range_count; j++) {
+        (*ranges)[j].AddCaseEquivalents(ranges, is_one_byte, I);
       }
     }
   }
 }
 
 
-int TextNode::GreedyLoopTextLength() {
-  TextElement elm = elms_->at(elms_->length() - 1);
+intptr_t TextNode::GreedyLoopTextLength() {
+  TextElement elm = elms_->At(elms_->length() - 1);
   return elm.cp_offset() + elm.length();
 }
 
@@ -2689,10 +2730,10 @@
 RegExpNode* TextNode::GetSuccessorOfOmnivorousTextNode(
     RegExpCompiler* compiler) {
   if (elms_->length() != 1) return NULL;
-  TextElement elm = elms_->at(0);
+  TextElement elm = elms_->At(0);
   if (elm.text_type() != TextElement::CHAR_CLASS) return NULL;
   RegExpCharacterClass* node = elm.char_class();
-  ZoneList<CharacterRange>* ranges = node->ranges(zone());
+  ZoneGrowableArray<CharacterRange>* ranges = node->ranges();
   if (!CharacterRange::IsCanonical(ranges)) {
     CharacterRange::Canonicalize(ranges);
   }
@@ -2702,11 +2743,11 @@
   if (ranges->length() != 1) return NULL;
   uint32_t max_char;
   if (compiler->one_byte()) {
-    max_char = String::kMaxOneByteCharCode;
+    max_char = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    max_char = String::kMaxUtf16CodeUnit;
+    max_char = Utf16::kMaxCodeUnit;
   }
-  return ranges->at(0).IsEverything(max_char) ? on_success() : NULL;
+  return ranges->At(0).IsEverything(max_char) ? on_success() : NULL;
 }
 
 
@@ -2714,18 +2755,18 @@
 // this alternative and back to this choice node.  If there are variable
 // length nodes or other complications in the way then return a sentinel
 // value indicating that a greedy loop cannot be constructed.
-int ChoiceNode::GreedyLoopTextLengthForAlternative(
+intptr_t ChoiceNode::GreedyLoopTextLengthForAlternative(
     GuardedAlternative* alternative) {
-  int length = 0;
+  intptr_t length = 0;
   RegExpNode* node = alternative->node();
   // Later we will generate code for all these text nodes using recursion
   // so we have to limit the max number.
-  int recursion_depth = 0;
+  intptr_t recursion_depth = 0;
   while (node != this) {
     if (recursion_depth++ > RegExpCompiler::kMaxRecursion) {
       return kNodeIsTooComplexForGreedyLoops;
     }
-    int node_length = node->GreedyLoopTextLength();
+    intptr_t node_length = node->GreedyLoopTextLength();
     if (node_length == kNodeIsTooComplexForGreedyLoops) {
       return kNodeIsTooComplexForGreedyLoops;
     }
@@ -2738,14 +2779,14 @@
 
 
 void LoopChoiceNode::AddLoopAlternative(GuardedAlternative alt) {
-  DCHECK_EQ(loop_node_, NULL);
+  ASSERT(loop_node_ == NULL);
   AddAlternative(alt);
   loop_node_ = alt.node();
 }
 
 
 void LoopChoiceNode::AddContinueAlternative(GuardedAlternative alt) {
-  DCHECK_EQ(continue_node_, NULL);
+  ASSERT(continue_node_ == NULL);
   AddAlternative(alt);
   continue_node_ = alt.node();
 }
@@ -2755,17 +2796,17 @@
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   if (trace->stop_node() == this) {
     // Back edge of greedy optimized loop node graph.
-    int text_length =
-        GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
-    DCHECK(text_length != kNodeIsTooComplexForGreedyLoops);
+    intptr_t text_length =
+        GreedyLoopTextLengthForAlternative(&((*alternatives_)[0]));
+    ASSERT(text_length != kNodeIsTooComplexForGreedyLoops);
     // Update the counter-based backtracking info on the stack.  This is an
     // optimization for greedy loops (see below).
-    DCHECK(trace->cp_offset() == text_length);
+    ASSERT(trace->cp_offset() == text_length);
     macro_assembler->AdvanceCurrentPosition(text_length);
     macro_assembler->GoTo(trace->loop_label());
     return;
   }
-  DCHECK(trace->stop_node() == NULL);
+  ASSERT(trace->stop_node() == NULL);
   if (!trace->is_trivial()) {
     trace->Flush(compiler, this);
     return;
@@ -2774,9 +2815,10 @@
 }
 
 
-int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
-                                           int eats_at_least) {
-  int preload_characters = Min(4, eats_at_least);
+intptr_t ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
+                                                intptr_t eats_at_least) {
+  intptr_t preload_characters = Utils::Minimum(static_cast<intptr_t>(4),
+                                               eats_at_least);
   if (compiler->macro_assembler()->CanReadUnaligned()) {
     bool one_byte = compiler->one_byte();
     if (one_byte) {
@@ -2795,18 +2837,17 @@
 }
 
 
-// This class is used when generating the alternatives in a choice node.  It
+// This structure is used when generating the alternatives in a choice node.  It
 // records the way the alternative is being code generated.
-class AlternativeGeneration: public Malloced {
- public:
+struct AlternativeGeneration {
   AlternativeGeneration()
       : possible_success(),
         expects_preload(false),
         after(),
         quick_check_details() { }
-  Label possible_success;
+  BlockLabel possible_success;
   bool expects_preload;
-  Label after;
+  BlockLabel after;
   QuickCheckDetails quick_check_details;
 };
 
@@ -2815,55 +2856,57 @@
 // size then it is on the stack, otherwise the excess is on the heap.
 class AlternativeGenerationList {
  public:
-  AlternativeGenerationList(int count, Zone* zone)
-      : alt_gens_(count, zone) {
-    for (int i = 0; i < count && i < kAFew; i++) {
-      alt_gens_.Add(a_few_alt_gens_ + i, zone);
+  explicit AlternativeGenerationList(intptr_t count)
+      : alt_gens_(count) {
+    for (intptr_t i = 0; i < count && i < kAFew; i++) {
+      alt_gens_.Add(a_few_alt_gens_ + i);
     }
-    for (int i = kAFew; i < count; i++) {
-      alt_gens_.Add(new AlternativeGeneration(), zone);
+    for (intptr_t i = kAFew; i < count; i++) {
+      alt_gens_.Add(new AlternativeGeneration());
     }
   }
   ~AlternativeGenerationList() {
-    for (int i = kAFew; i < alt_gens_.length(); i++) {
+    for (intptr_t i = kAFew; i < alt_gens_.length(); i++) {
       delete alt_gens_[i];
       alt_gens_[i] = NULL;
     }
   }
 
-  AlternativeGeneration* at(int i) {
+  AlternativeGeneration* at(intptr_t i) {
     return alt_gens_[i];
   }
 
  private:
-  static const int kAFew = 10;
-  ZoneList<AlternativeGeneration*> alt_gens_;
+  static const intptr_t kAFew = 10;
+  GrowableArray<AlternativeGeneration*> alt_gens_;
   AlternativeGeneration a_few_alt_gens_[kAFew];
+
+  DISALLOW_ALLOCATION();
 };
 
 
-// The '2' variant is has inclusive from and exclusive to.
+// The '2' variant is inclusive from and exclusive to.
 // This covers \s as defined in ECMA-262 5.1, 15.10.2.12,
 // which include WhiteSpace (7.2) or LineTerminator (7.3) values.
-static const int kSpaceRanges[] = { '\t', '\r' + 1, ' ', ' ' + 1,
+static const intptr_t kSpaceRanges[] = { '\t', '\r' + 1, ' ', ' ' + 1,
     0x00A0, 0x00A1, 0x1680, 0x1681, 0x180E, 0x180F, 0x2000, 0x200B,
     0x2028, 0x202A, 0x202F, 0x2030, 0x205F, 0x2060, 0x3000, 0x3001,
     0xFEFF, 0xFF00, 0x10000 };
-static const int kSpaceRangeCount = arraysize(kSpaceRanges);
-
-static const int kWordRanges[] = {
+static const intptr_t kSpaceRangeCount = ARRAY_SIZE(kSpaceRanges);
+static const intptr_t kWordRanges[] = {
     '0', '9' + 1, 'A', 'Z' + 1, '_', '_' + 1, 'a', 'z' + 1, 0x10000 };
-static const int kWordRangeCount = arraysize(kWordRanges);
-static const int kDigitRanges[] = { '0', '9' + 1, 0x10000 };
-static const int kDigitRangeCount = arraysize(kDigitRanges);
-static const int kSurrogateRanges[] = { 0xd800, 0xe000, 0x10000 };
-static const int kSurrogateRangeCount = arraysize(kSurrogateRanges);
-static const int kLineTerminatorRanges[] = { 0x000A, 0x000B, 0x000D, 0x000E,
-    0x2028, 0x202A, 0x10000 };
-static const int kLineTerminatorRangeCount = arraysize(kLineTerminatorRanges);
+static const intptr_t kWordRangeCount = ARRAY_SIZE(kWordRanges);
+static const intptr_t kDigitRanges[] = { '0', '9' + 1, 0x10000 };
+static const intptr_t kDigitRangeCount = ARRAY_SIZE(kDigitRanges);
+static const intptr_t kSurrogateRanges[] = { 0xd800, 0xe000, 0x10000 };
+static const intptr_t kSurrogateRangeCount = ARRAY_SIZE(kSurrogateRanges);
+static const intptr_t kLineTerminatorRanges[] = {
+    0x000A, 0x000B, 0x000D, 0x000E, 0x2028, 0x202A, 0x10000 };
+static const intptr_t kLineTerminatorRangeCount =
+    ARRAY_SIZE(kLineTerminatorRanges);
 
 
-void BoyerMoorePositionInfo::Set(int character) {
+void BoyerMoorePositionInfo::Set(intptr_t character) {
   SetInterval(Interval(character, character));
 }
 
@@ -2877,15 +2920,15 @@
   if (interval.to() - interval.from() >= kMapSize - 1) {
     if (map_count_ != kMapSize) {
       map_count_ = kMapSize;
-      for (int i = 0; i < kMapSize; i++) map_->at(i) = true;
+      for (intptr_t i = 0; i < kMapSize; i++) (*map_)[i] = true;
     }
     return;
   }
-  for (int i = interval.from(); i <= interval.to(); i++) {
-    int mod_character = (i & kMask);
-    if (!map_->at(mod_character)) {
+  for (intptr_t i = interval.from(); i <= interval.to(); i++) {
+    intptr_t mod_character = (i & kMask);
+    if (!map_->At(mod_character)) {
       map_count_++;
-      map_->at(mod_character) = true;
+      (*map_)[mod_character] = true;
     }
     if (map_count_ == kMapSize) return;
   }
@@ -2896,23 +2939,23 @@
   s_ = w_ = d_ = kLatticeUnknown;
   if (map_count_ != kMapSize) {
     map_count_ = kMapSize;
-    for (int i = 0; i < kMapSize; i++) map_->at(i) = true;
+    for (intptr_t i = 0; i < kMapSize; i++) (*map_)[i] = true;
   }
 }
 
 
 BoyerMooreLookahead::BoyerMooreLookahead(
-    int length, RegExpCompiler* compiler, Zone* zone)
+    intptr_t length, RegExpCompiler* compiler, Isolate* isolate)
     : length_(length),
       compiler_(compiler) {
   if (compiler->one_byte()) {
-    max_char_ = String::kMaxOneByteCharCode;
+    max_char_ = Symbols::kMaxOneCharCodeSymbol;
   } else {
-    max_char_ = String::kMaxUtf16CodeUnit;
+    max_char_ = Utf16::kMaxCodeUnit;
   }
-  bitmaps_ = new(zone) ZoneList<BoyerMoorePositionInfo*>(length, zone);
-  for (int i = 0; i < length; i++) {
-    bitmaps_->Add(new(zone) BoyerMoorePositionInfo(zone), zone);
+  bitmaps_ = new(isolate) ZoneGrowableArray<BoyerMoorePositionInfo*>(length);
+  for (intptr_t i = 0; i < length; i++) {
+    bitmaps_->Add(new(isolate) BoyerMoorePositionInfo(isolate));
   }
 }
 
@@ -2920,12 +2963,12 @@
 // Find the longest range of lookahead that has the fewest number of different
 // characters that can occur at a given position.  Since we are optimizing two
 // different parameters at once this is a tradeoff.
-bool BoyerMooreLookahead::FindWorthwhileInterval(int* from, int* to) {
-  int biggest_points = 0;
+bool BoyerMooreLookahead::FindWorthwhileInterval(intptr_t* from, intptr_t* to) {
+  intptr_t biggest_points = 0;
   // If more than 32 characters out of 128 can occur it is unlikely that we can
   // be lucky enough to step forwards much of the time.
-  const int kMaxMax = 32;
-  for (int max_number_of_chars = 4;
+  const intptr_t kMaxMax = 32;
+  for (intptr_t max_number_of_chars = 4;
        max_number_of_chars < kMaxMax;
        max_number_of_chars *= 2) {
     biggest_points =
@@ -2942,23 +2985,26 @@
 // of points as the product of width-of-the-range and
 // probability-of-finding-one-of-the-characters, where the probability is
 // calculated using the frequency distribution of the sample subject string.
-int BoyerMooreLookahead::FindBestInterval(
-    int max_number_of_chars, int old_biggest_points, int* from, int* to) {
-  int biggest_points = old_biggest_points;
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  for (int i = 0; i < length_; ) {
+intptr_t BoyerMooreLookahead::FindBestInterval(
+    intptr_t max_number_of_chars,
+    intptr_t old_biggest_points,
+    intptr_t* from,
+    intptr_t* to) {
+  intptr_t biggest_points = old_biggest_points;
+  static const intptr_t kSize = RegExpMacroAssembler::kTableSize;
+  for (intptr_t i = 0; i < length_; ) {
     while (i < length_ && Count(i) > max_number_of_chars) i++;
     if (i == length_) break;
-    int remembered_from = i;
+    intptr_t remembered_from = i;
     bool union_map[kSize];
-    for (int j = 0; j < kSize; j++) union_map[j] = false;
+    for (intptr_t j = 0; j < kSize; j++) union_map[j] = false;
     while (i < length_ && Count(i) <= max_number_of_chars) {
-      BoyerMoorePositionInfo* map = bitmaps_->at(i);
-      for (int j = 0; j < kSize; j++) union_map[j] |= map->at(j);
+      BoyerMoorePositionInfo* map = bitmaps_->At(i);
+      for (intptr_t j = 0; j < kSize; j++) union_map[j] |= map->at(j);
       i++;
     }
-    int frequency = 0;
-    for (int j = 0; j < kSize; j++) {
+    intptr_t frequency = 0;
+    for (intptr_t j = 0; j < kSize; j++) {
       if (union_map[j]) {
         // Add 1 to the frequency to give a small per-character boost for
         // the cases where our sampling is not good enough and many
@@ -2973,13 +3019,13 @@
     // dividing by 2 we switch off the skipping if the probability of skipping
     // is less than 50%.  This is because the multibyte mask-and-compare
     // skipping in quickcheck is more likely to do well on this case.
-    bool in_quickcheck_range =
-        ((i - remembered_from < 4) ||
-         (compiler_->one_byte() ? remembered_from <= 4 : remembered_from <= 2));
+    bool in_quickcheck_range = ((i - remembered_from < 4) ||
+        (compiler_->one_byte() ? remembered_from <= 4 : remembered_from <= 2));
     // Called 'probability' but it is only a rough estimate and can actually
     // be outside the 0-kSize range.
-    int probability = (in_quickcheck_range ? kSize / 2 : kSize) - frequency;
-    int points = (i - remembered_from) * probability;
+    intptr_t probability =
+        (in_quickcheck_range ? kSize / 2 : kSize) - frequency;
+    intptr_t points = (i - remembered_from) * probability;
     if (points > biggest_points) {
       *from = remembered_from;
       *to = i - 1;
@@ -2995,24 +3041,25 @@
 // max_lookahead (inclusive) measured from the current position.  If the
 // character at max_lookahead offset is not one of these characters, then we
 // can safely skip forwards by the number of characters in the range.
-int BoyerMooreLookahead::GetSkipTable(int min_lookahead,
-                                      int max_lookahead,
-                                      Handle<ByteArray> boolean_skip_table) {
-  const int kSize = RegExpMacroAssembler::kTableSize;
+intptr_t BoyerMooreLookahead::GetSkipTable(
+    intptr_t min_lookahead,
+    intptr_t max_lookahead,
+    const TypedData& boolean_skip_table) {
+  const intptr_t kSize = RegExpMacroAssembler::kTableSize;
 
-  const int kSkipArrayEntry = 0;
-  const int kDontSkipArrayEntry = 1;
+  const intptr_t kSkipArrayEntry = 0;
+  const intptr_t kDontSkipArrayEntry = 1;
 
-  for (int i = 0; i < kSize; i++) {
-    boolean_skip_table->set(i, kSkipArrayEntry);
+  for (intptr_t i = 0; i < kSize; i++) {
+    boolean_skip_table.SetUint8(i, kSkipArrayEntry);
   }
-  int skip = max_lookahead + 1 - min_lookahead;
+  intptr_t skip = max_lookahead + 1 - min_lookahead;
 
-  for (int i = max_lookahead; i >= min_lookahead; i--) {
-    BoyerMoorePositionInfo* map = bitmaps_->at(i);
-    for (int j = 0; j < kSize; j++) {
+  for (intptr_t i = max_lookahead; i >= min_lookahead; i--) {
+    BoyerMoorePositionInfo* map = bitmaps_->At(i);
+    for (intptr_t j = 0; j < kSize; j++) {
       if (map->at(j)) {
-        boolean_skip_table->set(j, kDontSkipArrayEntry);
+        boolean_skip_table.SetUint8(j, kDontSkipArrayEntry);
       }
     }
   }
@@ -3023,23 +3070,23 @@
 
 // See comment above on the implementation of GetSkipTable.
 void BoyerMooreLookahead::EmitSkipInstructions(RegExpMacroAssembler* masm) {
-  const int kSize = RegExpMacroAssembler::kTableSize;
+  const intptr_t kSize = RegExpMacroAssembler::kTableSize;
 
-  int min_lookahead = 0;
-  int max_lookahead = 0;
+  intptr_t min_lookahead = 0;
+  intptr_t max_lookahead = 0;
 
   if (!FindWorthwhileInterval(&min_lookahead, &max_lookahead)) return;
 
   bool found_single_character = false;
-  int single_character = 0;
-  for (int i = max_lookahead; i >= min_lookahead; i--) {
-    BoyerMoorePositionInfo* map = bitmaps_->at(i);
+  intptr_t single_character = 0;
+  for (intptr_t i = max_lookahead; i >= min_lookahead; i--) {
+    BoyerMoorePositionInfo* map = bitmaps_->At(i);
     if (map->map_count() > 1 ||
         (found_single_character && map->map_count() != 0)) {
       found_single_character = false;
       break;
     }
-    for (int j = 0; j < kSize; j++) {
+    for (intptr_t j = 0; j < kSize; j++) {
       if (map->at(j)) {
         found_single_character = true;
         single_character = j;
@@ -3048,7 +3095,7 @@
     }
   }
 
-  int lookahead_width = max_lookahead + 1 - min_lookahead;
+  intptr_t lookahead_width = max_lookahead + 1 - min_lookahead;
 
   if (found_single_character && lookahead_width == 1 && max_lookahead < 3) {
     // The mask-compare can probably handle this better.
@@ -3056,8 +3103,8 @@
   }
 
   if (found_single_character) {
-    Label cont, again;
-    masm->Bind(&again);
+    BlockLabel cont, again;
+    masm->BindBlock(&again);
     masm->LoadCurrentCharacter(max_lookahead, &cont, true);
     if (max_char_ > kSize) {
       masm->CheckCharacterAfterAnd(single_character,
@@ -3068,23 +3115,27 @@
     }
     masm->AdvanceCurrentPosition(lookahead_width);
     masm->GoTo(&again);
-    masm->Bind(&cont);
+    masm->BindBlock(&cont);
     return;
   }
 
-  Factory* factory = masm->zone()->isolate()->factory();
-  Handle<ByteArray> boolean_skip_table = factory->NewByteArray(kSize, TENURED);
-  int skip_distance = GetSkipTable(
+  const TypedData& boolean_skip_table = TypedData::ZoneHandle(
+        compiler_->isolate(),
+        TypedData::New(kTypedDataUint8ArrayCid, kSize, Heap::kOld));
+  intptr_t skip_distance = GetSkipTable(
       min_lookahead, max_lookahead, boolean_skip_table);
-  DCHECK(skip_distance != 0);
+  ASSERT(skip_distance != 0);
 
-  Label cont, again;
-  masm->Bind(&again);
+  BlockLabel cont, again;
+
+  masm->BindBlock(&again);
   masm->LoadCurrentCharacter(max_lookahead, &cont, true);
   masm->CheckBitInTable(boolean_skip_table, &cont);
   masm->AdvanceCurrentPosition(skip_distance);
   masm->GoTo(&again);
-  masm->Bind(&cont);
+  masm->BindBlock(&cont);
+
+  return;
 }
 
 
@@ -3170,13 +3221,13 @@
 
 void ChoiceNode::AssertGuardsMentionRegisters(Trace* trace) {
 #ifdef DEBUG
-  int choice_count = alternatives_->length();
-  for (int i = 0; i < choice_count - 1; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
-    ZoneList<Guard*>* guards = alternative.guards();
-    int guard_count = (guards == NULL) ? 0 : guards->length();
-    for (int j = 0; j < guard_count; j++) {
-      DCHECK(!trace->mentions_reg(guards->at(j)->reg()));
+  intptr_t choice_count = alternatives_->length();
+  for (intptr_t i = 0; i < choice_count - 1; i++) {
+    GuardedAlternative alternative = alternatives_->At(i);
+    ZoneGrowableArray<Guard*>* guards = alternative.guards();
+    intptr_t guard_count = (guards == NULL) ? 0 : guards->length();
+    for (intptr_t j = 0; j < guard_count; j++) {
+      ASSERT(!trace->mentions_reg(guards->At(j)->reg()));
     }
   }
 #endif
@@ -3202,13 +3253,13 @@
 
 
 void ChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  int choice_count = alternatives_->length();
+  intptr_t choice_count = alternatives_->length();
 
   AssertGuardsMentionRegisters(trace);
 
   LimitResult limit_result = LimitVersions(compiler, trace);
   if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
+  ASSERT(limit_result == CONTINUE);
 
   // For loop nodes we already flushed (see LoopChoiceNode::Emit), but for
   // other choice nodes we only flush if we are out of code size budget.
@@ -3223,8 +3274,9 @@
   preload.init();
   GreedyLoopState greedy_loop_state(not_at_start());
 
-  int text_length = GreedyLoopTextLengthForAlternative(&alternatives_->at(0));
-  AlternativeGenerationList alt_gens(choice_count, zone());
+  intptr_t text_length =
+      GreedyLoopTextLengthForAlternative(&((*alternatives_)[0]));
+  AlternativeGenerationList alt_gens(choice_count);
 
   if (choice_count > 1 && text_length != kNodeIsTooComplexForGreedyLoops) {
     trace = EmitGreedyLoop(compiler,
@@ -3236,8 +3288,8 @@
   } else {
     // TODO(erikcorry): Delete this.  We don't need this label, but it makes us
     // match the traces produced pre-cleanup.
-    Label second_choice;
-    compiler->macro_assembler()->Bind(&second_choice);
+    BlockLabel second_choice;
+    compiler->macro_assembler()->BindBlock(&second_choice);
 
     preload.eats_at_least_ = EmitOptimizedUnanchoredSearch(compiler, trace);
 
@@ -3251,8 +3303,8 @@
   // At this point we need to generate slow checks for the alternatives where
   // the quick check was inlined.  We can recognize these because the associated
   // label was bound.
-  int new_flush_budget = trace->flush_budget() / choice_count;
-  for (int i = 0; i < choice_count; i++) {
+  intptr_t new_flush_budget = trace->flush_budget() / choice_count;
+  for (intptr_t i = 0; i < choice_count; i++) {
     AlternativeGeneration* alt_gen = alt_gens.at(i);
     Trace new_trace(*trace);
     // If there are actions to be flushed we have to limit how many times
@@ -3265,20 +3317,19 @@
         i == choice_count - 1 ? false : alt_gens.at(i + 1)->expects_preload;
     EmitOutOfLineContinuation(compiler,
                               &new_trace,
-                              alternatives_->at(i),
+                              alternatives_->At(i),
                               alt_gen,
                               preload.preload_characters_,
                               next_expects_preload);
   }
 }
 
-
 Trace* ChoiceNode::EmitGreedyLoop(RegExpCompiler* compiler,
                                   Trace* trace,
                                   AlternativeGenerationList* alt_gens,
                                   PreloadState* preload,
                                   GreedyLoopState* greedy_loop_state,
-                                  int text_length) {
+                                  intptr_t text_length) {
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   // Here we have special handling for greedy loops containing only text nodes
   // and other simple nodes.  These are handled by pushing the current
@@ -3287,21 +3338,21 @@
   // and check it against the pushed value.  This avoids pushing backtrack
   // information for each iteration of the loop, which could take up a lot of
   // space.
-  DCHECK(trace->stop_node() == NULL);
+  ASSERT(trace->stop_node() == NULL);
   macro_assembler->PushCurrentPosition();
-  Label greedy_match_failed;
+  BlockLabel greedy_match_failed;
   Trace greedy_match_trace;
   if (not_at_start()) greedy_match_trace.set_at_start(false);
   greedy_match_trace.set_backtrack(&greedy_match_failed);
-  Label loop_label;
-  macro_assembler->Bind(&loop_label);
+  BlockLabel loop_label;
+  macro_assembler->BindBlock(&loop_label);
   greedy_match_trace.set_stop_node(this);
   greedy_match_trace.set_loop_label(&loop_label);
-  alternatives_->at(0).node()->Emit(compiler, &greedy_match_trace);
-  macro_assembler->Bind(&greedy_match_failed);
+  (*alternatives_)[0].node()->Emit(compiler, &greedy_match_trace);
+  macro_assembler->BindBlock(&greedy_match_failed);
 
-  Label second_choice;  // For use in greedy matches.
-  macro_assembler->Bind(&second_choice);
+  BlockLabel second_choice;  // For use in greedy matches.
+  macro_assembler->BindBlock(&second_choice);
 
   Trace* new_trace = greedy_loop_state->counter_backtrack_trace();
 
@@ -3311,7 +3362,7 @@
               new_trace,
               preload);
 
-  macro_assembler->Bind(greedy_loop_state->label());
+  macro_assembler->BindBlock(greedy_loop_state->label());
   // If we have unwound to the bottom then backtrack.
   macro_assembler->CheckGreedyLoop(trace->backtrack());
   // Otherwise try the second priority at an earlier position.
@@ -3320,12 +3371,13 @@
   return new_trace;
 }
 
-int ChoiceNode::EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler,
-                                              Trace* trace) {
-  int eats_at_least = PreloadState::kEatsAtLeastNotYetInitialized;
+
+intptr_t ChoiceNode::EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler,
+                                                   Trace* trace) {
+  intptr_t eats_at_least = PreloadState::kEatsAtLeastNotYetInitialized;
   if (alternatives_->length() != 2) return eats_at_least;
 
-  GuardedAlternative alt1 = alternatives_->at(1);
+  GuardedAlternative alt1 = alternatives_->At(1);
   if (alt1.guards() != NULL && alt1.guards()->length() != 0) {
     return eats_at_least;
   }
@@ -3340,7 +3392,7 @@
   // loop.  That also implies that there are no preloaded characters, which is
   // good, because it means we won't be violating any assumptions by
   // overwriting those characters with new load instructions.
-  DCHECK(trace->is_trivial());
+  ASSERT(trace->is_trivial());
 
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   // At this point we know that we are at a non-greedy loop that will eat
@@ -3352,15 +3404,13 @@
   // small alternation.
   BoyerMooreLookahead* bm = bm_info(false);
   if (bm == NULL) {
-    eats_at_least = Min(kMaxLookaheadForBoyerMoore,
+    eats_at_least = Utils::Minimum(kMaxLookaheadForBoyerMoore,
                         EatsAtLeast(kMaxLookaheadForBoyerMoore,
                                     kRecursionBudget,
                                     false));
     if (eats_at_least >= 1) {
-      bm = new(zone()) BoyerMooreLookahead(eats_at_least,
-                                           compiler,
-                                           zone());
-      GuardedAlternative alt0 = alternatives_->at(0);
+      bm = new(I) BoyerMooreLookahead(eats_at_least, compiler, I);
+      GuardedAlternative alt0 = alternatives_->At(0);
       alt0.node()->FillInBMInfo(0, kRecursionBudget, bm, false);
     }
   }
@@ -3373,7 +3423,7 @@
 
 void ChoiceNode::EmitChoices(RegExpCompiler* compiler,
                              AlternativeGenerationList* alt_gens,
-                             int first_choice,
+                             intptr_t first_choice,
                              Trace* trace,
                              PreloadState* preload) {
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
@@ -3381,18 +3431,18 @@
 
   // For now we just call all choices one after the other.  The idea ultimately
   // is to use the Dispatch table to try only the relevant ones.
-  int choice_count = alternatives_->length();
+  intptr_t choice_count = alternatives_->length();
 
-  int new_flush_budget = trace->flush_budget() / choice_count;
+  intptr_t new_flush_budget = trace->flush_budget() / choice_count;
 
-  for (int i = first_choice; i < choice_count; i++) {
+  for (intptr_t i = first_choice; i < choice_count; i++) {
     bool is_last = i == choice_count - 1;
     bool fall_through_on_failure = !is_last;
-    GuardedAlternative alternative = alternatives_->at(i);
+    GuardedAlternative alternative = alternatives_->At(i);
     AlternativeGeneration* alt_gen = alt_gens->at(i);
     alt_gen->quick_check_details.set_characters(preload->preload_characters_);
-    ZoneList<Guard*>* guards = alternative.guards();
-    int guard_count = (guards == NULL) ? 0 : guards->length();
+    ZoneGrowableArray<Guard*>* guards = alternative.guards();
+    intptr_t guard_count = (guards == NULL) ? 0 : guards->length();
     Trace new_trace(*trace);
     new_trace.set_characters_preloaded(preload->preload_is_current_ ?
                                          preload->preload_characters_ :
@@ -3407,7 +3457,7 @@
     }
     alt_gen->expects_preload = preload->preload_is_current_;
     bool generate_full_check_inline = false;
-    if (FLAG_regexp_optimization &&
+    if (kRegexpOptimization &&
         try_to_emit_quick_check_for_alternative(i == 0) &&
         alternative.node()->EmitQuickCheck(compiler,
                                            trace,
@@ -3422,7 +3472,7 @@
       // If we generated the quick check to fall through on possible success,
       // we now need to generate the full check inline.
       if (!fall_through_on_failure) {
-        macro_assembler->Bind(&alt_gen->possible_success);
+        macro_assembler->BindBlock(&alt_gen->possible_success);
         new_trace.set_quick_check_performed(&alt_gen->quick_check_details);
         new_trace.set_characters_preloaded(preload->preload_characters_);
         new_trace.set_bound_checked_up_to(preload->preload_characters_);
@@ -3449,13 +3499,13 @@
       if (new_trace.actions() != NULL) {
         new_trace.set_flush_budget(new_flush_budget);
       }
-      for (int j = 0; j < guard_count; j++) {
-        GenerateGuard(macro_assembler, guards->at(j), &new_trace);
+      for (intptr_t j = 0; j < guard_count; j++) {
+        GenerateGuard(macro_assembler, guards->At(j), &new_trace);
       }
       alternative.node()->Emit(compiler, &new_trace);
       preload->preload_is_current_ = false;
     }
-    macro_assembler->Bind(&alt_gen->after);
+    macro_assembler->BindBlock(&alt_gen->after);
   }
 }
 
@@ -3464,26 +3514,26 @@
                                            Trace* trace,
                                            GuardedAlternative alternative,
                                            AlternativeGeneration* alt_gen,
-                                           int preload_characters,
+                                           intptr_t preload_characters,
                                            bool next_expects_preload) {
-  if (!alt_gen->possible_success.is_linked()) return;
+  if (!alt_gen->possible_success.IsLinked()) return;
 
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  macro_assembler->Bind(&alt_gen->possible_success);
+  macro_assembler->BindBlock(&alt_gen->possible_success);
   Trace out_of_line_trace(*trace);
   out_of_line_trace.set_characters_preloaded(preload_characters);
   out_of_line_trace.set_quick_check_performed(&alt_gen->quick_check_details);
   if (not_at_start_) out_of_line_trace.set_at_start(Trace::FALSE_VALUE);
-  ZoneList<Guard*>* guards = alternative.guards();
-  int guard_count = (guards == NULL) ? 0 : guards->length();
+  ZoneGrowableArray<Guard*>* guards = alternative.guards();
+  intptr_t guard_count = (guards == NULL) ? 0 : guards->length();
   if (next_expects_preload) {
-    Label reload_current_char;
+    BlockLabel reload_current_char;
     out_of_line_trace.set_backtrack(&reload_current_char);
-    for (int j = 0; j < guard_count; j++) {
-      GenerateGuard(macro_assembler, guards->at(j), &out_of_line_trace);
+    for (intptr_t j = 0; j < guard_count; j++) {
+      GenerateGuard(macro_assembler, guards->At(j), &out_of_line_trace);
     }
     alternative.node()->Emit(compiler, &out_of_line_trace);
-    macro_assembler->Bind(&reload_current_char);
+    macro_assembler->BindBlock(&reload_current_char);
     // Reload the current character, since the next quick check expects that.
     // We don't need to check bounds here because we only get into this
     // code through a quick check which already did the checked load.
@@ -3494,8 +3544,8 @@
     macro_assembler->GoTo(&(alt_gen->after));
   } else {
     out_of_line_trace.set_backtrack(&(alt_gen->after));
-    for (int j = 0; j < guard_count; j++) {
-      GenerateGuard(macro_assembler, guards->at(j), &out_of_line_trace);
+    for (intptr_t j = 0; j < guard_count; j++) {
+      GenerateGuard(macro_assembler, guards->At(j), &out_of_line_trace);
     }
     alternative.node()->Emit(compiler, &out_of_line_trace);
   }
@@ -3506,7 +3556,7 @@
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
   LimitResult limit_result = LimitVersions(compiler, trace);
   if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
+  ASSERT(limit_result == CONTINUE);
 
   RecursionCheck rc(compiler);
 
@@ -3558,9 +3608,9 @@
       }
       break;
     case EMPTY_MATCH_CHECK: {
-      int start_pos_reg = data_.u_empty_match_check.start_register;
-      int stored_pos = 0;
-      int rep_reg = data_.u_empty_match_check.repetition_register;
+      intptr_t start_pos_reg = data_.u_empty_match_check.start_register;
+      intptr_t stored_pos = 0;
+      intptr_t rep_reg = data_.u_empty_match_check.repetition_register;
       bool has_minimum = (rep_reg != RegExpCompiler::kNoRegister);
       bool know_dist = trace->GetStoredPosition(start_pos_reg, &stored_pos);
       if (know_dist && !has_minimum && stored_pos == trace->cp_offset()) {
@@ -3574,18 +3624,18 @@
       } else if (!trace->is_trivial()) {
         trace->Flush(compiler, this);
       } else {
-        Label skip_empty_check;
+        BlockLabel skip_empty_check;
         // If we have a minimum number of repetitions we check the current
         // number first and skip the empty check if it's not enough.
         if (has_minimum) {
-          int limit = data_.u_empty_match_check.repetition_limit;
+          intptr_t limit = data_.u_empty_match_check.repetition_limit;
           assembler->IfRegisterLT(rep_reg, limit, &skip_empty_check);
         }
         // If the match is empty we bail out, otherwise we fall through
         // to the on-success continuation.
         assembler->IfRegisterEqPos(data_.u_empty_match_check.start_register,
                                    trace->backtrack());
-        assembler->Bind(&skip_empty_check);
+        assembler->BindBlock(&skip_empty_check);
         on_success()->Emit(compiler, trace);
       }
       break;
@@ -3599,22 +3649,23 @@
           data_.u_submatch.current_position_register);
       assembler->ReadStackPointerFromRegister(
           data_.u_submatch.stack_pointer_register);
-      int clear_register_count = data_.u_submatch.clear_register_count;
+      intptr_t clear_register_count = data_.u_submatch.clear_register_count;
       if (clear_register_count == 0) {
         on_success()->Emit(compiler, trace);
         return;
       }
-      int clear_registers_from = data_.u_submatch.clear_register_from;
-      Label clear_registers_backtrack;
+      intptr_t clear_registers_from = data_.u_submatch.clear_register_from;
+      BlockLabel clear_registers_backtrack;
       Trace new_trace = *trace;
       new_trace.set_backtrack(&clear_registers_backtrack);
       on_success()->Emit(compiler, &new_trace);
 
-      assembler->Bind(&clear_registers_backtrack);
-      int clear_registers_to = clear_registers_from + clear_register_count - 1;
+      assembler->BindBlock(&clear_registers_backtrack);
+      intptr_t clear_registers_to =
+          clear_registers_from + clear_register_count - 1;
       assembler->ClearRegisters(clear_registers_from, clear_registers_to);
 
-      DCHECK(trace->backtrack() == NULL);
+      ASSERT(trace->backtrack() == NULL);
       assembler->Backtrack();
       return;
     }
@@ -3633,11 +3684,11 @@
 
   LimitResult limit_result = LimitVersions(compiler, trace);
   if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
+  ASSERT(limit_result == CONTINUE);
 
   RecursionCheck rc(compiler);
 
-  DCHECK_EQ(start_reg_ + 1, end_reg_);
+  ASSERT(start_reg_ + 1 == end_reg_);
   if (compiler->ignore_case()) {
     assembler->CheckNotBackReferenceIgnoreCase(start_reg_,
                                                trace->backtrack());
@@ -3657,9 +3708,7 @@
 
 class DotPrinter: public NodeVisitor {
  public:
-  DotPrinter(OStream& os, bool ignore_case)  // NOLINT
-      : os_(os),
-        ignore_case_(ignore_case) {}
+  explicit DotPrinter(bool ignore_case) {}
   void PrintNode(const char* label, RegExpNode* node);
   void Visit(RegExpNode* node);
   void PrintAttributes(RegExpNode* from);
@@ -3668,30 +3717,27 @@
   virtual void Visit##Type(Type##Node* that);
 FOR_EACH_NODE_TYPE(DECLARE_VISIT)
 #undef DECLARE_VISIT
- private:
-  OStream& os_;
-  bool ignore_case_;
 };
 
 
 void DotPrinter::PrintNode(const char* label, RegExpNode* node) {
-  os_ << "digraph G {\n  graph [label=\"";
-  for (int i = 0; label[i]; i++) {
+  OS::Print("digraph G {\n  graph [label=\"");
+  for (intptr_t i = 0; label[i]; i++) {
     switch (label[i]) {
       case '\\':
-        os_ << "\\\\";
+        OS::Print("\\\\");
         break;
       case '"':
-        os_ << "\"";
+        OS::Print("\"");
         break;
       default:
-        os_ << label[i];
+        OS::Print("%c", label[i]);
         break;
     }
   }
-  os_ << "\"];\n";
+  OS::Print("\"];\n");
   Visit(node);
-  os_ << "}" << endl;
+  OS::Print("}\n");
 }
 
 
@@ -3703,292 +3749,194 @@
 
 
 void DotPrinter::PrintOnFailure(RegExpNode* from, RegExpNode* on_failure) {
-  os_ << "  n" << from << " -> n" << on_failure << " [style=dotted];\n";
+  OS::Print("  n%p -> n%p [style=dotted];\n", from, on_failure);
   Visit(on_failure);
 }
 
 
-class TableEntryBodyPrinter {
+class AttributePrinter : public ValueObject {
  public:
-  TableEntryBodyPrinter(OStream& os, ChoiceNode* choice)  // NOLINT
-      : os_(os),
-        choice_(choice) {}
-  void Call(uc16 from, DispatchTable::Entry entry) {
-    OutSet* out_set = entry.out_set();
-    for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-      if (out_set->Get(i)) {
-        os_ << "    n" << choice() << ":s" << from << "o" << i << " -> n"
-            << choice()->alternatives()->at(i).node() << ";\n";
-      }
-    }
-  }
- private:
-  ChoiceNode* choice() { return choice_; }
-  OStream& os_;
-  ChoiceNode* choice_;
-};
-
-
-class TableEntryHeaderPrinter {
- public:
-  explicit TableEntryHeaderPrinter(OStream& os)  // NOLINT
-      : first_(true),
-        os_(os) {}
-  void Call(uc16 from, DispatchTable::Entry entry) {
-    if (first_) {
-      first_ = false;
-    } else {
-      os_ << "|";
-    }
-    os_ << "{\\" << AsUC16(from) << "-\\" << AsUC16(entry.to()) << "|{";
-    OutSet* out_set = entry.out_set();
-    int priority = 0;
-    for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-      if (out_set->Get(i)) {
-        if (priority > 0) os_ << "|";
-        os_ << "<s" << from << "o" << i << "> " << priority;
-        priority++;
-      }
-    }
-    os_ << "}}";
-  }
-
- private:
-  bool first_;
-  OStream& os_;
-};
-
-
-class AttributePrinter {
- public:
-  explicit AttributePrinter(OStream& os)  // NOLINT
-      : os_(os),
-        first_(true) {}
+  AttributePrinter() : first_(true) {}
   void PrintSeparator() {
     if (first_) {
       first_ = false;
     } else {
-      os_ << "|";
+      OS::Print("|");
     }
   }
   void PrintBit(const char* name, bool value) {
     if (!value) return;
     PrintSeparator();
-    os_ << "{" << name << "}";
+    OS::Print("{%s}", name);
   }
-  void PrintPositive(const char* name, int value) {
+  void PrintPositive(const char* name, intptr_t value) {
     if (value < 0) return;
     PrintSeparator();
-    os_ << "{" << name << "|" << value << "}";
+    OS::Print("{%s|%" Pd "}", name, value);
   }
 
  private:
-  OStream& os_;
   bool first_;
 };
 
 
 void DotPrinter::PrintAttributes(RegExpNode* that) {
-  os_ << "  a" << that << " [shape=Mrecord, color=grey, fontcolor=grey, "
-      << "margin=0.1, fontsize=10, label=\"{";
-  AttributePrinter printer(os_);
+  OS::Print("  a%p [shape=Mrecord, color=grey, fontcolor=grey, "
+            "margin=0.1, fontsize=10, label=\"{", that);
+  AttributePrinter printer;
   NodeInfo* info = that->info();
   printer.PrintBit("NI", info->follows_newline_interest);
   printer.PrintBit("WI", info->follows_word_interest);
   printer.PrintBit("SI", info->follows_start_interest);
-  Label* label = that->label();
-  if (label->is_bound())
-    printer.PrintPositive("@", label->pos());
-  os_ << "}\"];\n"
-      << "  a" << that << " -> n" << that
-      << " [style=dashed, color=grey, arrowhead=none];\n";
+  BlockLabel* label = that->label();
+  if (label->IsBound())
+    printer.PrintPositive("@", label->Position());
+  OS::Print("}\"];\n"
+            "  a%p -> n%p [style=dashed, color=grey, arrowhead=none];\n",
+            that, that);
 }
 
 
-static const bool kPrintDispatchTable = false;
 void DotPrinter::VisitChoice(ChoiceNode* that) {
-  if (kPrintDispatchTable) {
-    os_ << "  n" << that << " [shape=Mrecord, label=\"";
-    TableEntryHeaderPrinter header_printer(os_);
-    that->GetTable(ignore_case_)->ForEach(&header_printer);
-    os_ << "\"]\n";
-    PrintAttributes(that);
-    TableEntryBodyPrinter body_printer(os_, that);
-    that->GetTable(ignore_case_)->ForEach(&body_printer);
-  } else {
-    os_ << "  n" << that << " [shape=Mrecord, label=\"?\"];\n";
-    for (int i = 0; i < that->alternatives()->length(); i++) {
-      GuardedAlternative alt = that->alternatives()->at(i);
-      os_ << "  n" << that << " -> n" << alt.node();
-    }
+  OS::Print("  n%p [shape=Mrecord, label=\"?\"];\n", that);
+  for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
+    GuardedAlternative alt = that->alternatives()->At(i);
+    OS::Print("  n%p -> n%p", that, alt.node());
   }
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    GuardedAlternative alt = that->alternatives()->at(i);
+  for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
+    GuardedAlternative alt = that->alternatives()->At(i);
     alt.node()->Accept(this);
   }
 }
 
 
 void DotPrinter::VisitText(TextNode* that) {
-  Zone* zone = that->zone();
-  os_ << "  n" << that << " [label=\"";
-  for (int i = 0; i < that->elements()->length(); i++) {
-    if (i > 0) os_ << " ";
-    TextElement elm = that->elements()->at(i);
+  OS::Print("  n%p [label=\"", that);
+  for (intptr_t i = 0; i < that->elements()->length(); i++) {
+    if (i > 0) OS::Print(" ");
+    TextElement elm = that->elements()->At(i);
     switch (elm.text_type()) {
       case TextElement::ATOM: {
-        Vector<const uc16> data = elm.atom()->data();
-        for (int i = 0; i < data.length(); i++) {
-          os_ << static_cast<char>(data[i]);
+        ZoneGrowableArray<uint16_t>* data = elm.atom()->data();
+        for (intptr_t i = 0; i < data->length(); i++) {
+          OS::Print("%c", static_cast<char>(data->At(i)));
         }
         break;
       }
       case TextElement::CHAR_CLASS: {
         RegExpCharacterClass* node = elm.char_class();
-        os_ << "[";
-        if (node->is_negated()) os_ << "^";
-        for (int j = 0; j < node->ranges(zone)->length(); j++) {
-          CharacterRange range = node->ranges(zone)->at(j);
-          os_ << AsUC16(range.from()) << "-" << AsUC16(range.to());
+        OS::Print("[");
+        if (node->is_negated()) OS::Print("^");
+        for (intptr_t j = 0; j < node->ranges()->length(); j++) {
+          CharacterRange range = node->ranges()->At(j);
+          PrintUtf16(range.from());
+          OS::Print("-");
+          PrintUtf16(range.to());
         }
-        os_ << "]";
+        OS::Print("]");
         break;
       }
       default:
         UNREACHABLE();
     }
   }
-  os_ << "\", shape=box, peripheries=2];\n";
+  OS::Print("\", shape=box, peripheries=2];\n");
   PrintAttributes(that);
-  os_ << "  n" << that << " -> n" << that->on_success() << ";\n";
+  OS::Print("  n%p -> n%p;\n", that, that->on_success());
   Visit(that->on_success());
 }
 
 
 void DotPrinter::VisitBackReference(BackReferenceNode* that) {
-  os_ << "  n" << that << " [label=\"$" << that->start_register() << "..$"
-      << that->end_register() << "\", shape=doubleoctagon];\n";
+  OS::Print("  n%p [label=\"$%" Pd "..$%" Pd "\", shape=doubleoctagon];\n",
+            that, that->start_register(), that->end_register());
   PrintAttributes(that);
-  os_ << "  n" << that << " -> n" << that->on_success() << ";\n";
+  OS::Print("  n%p -> n%p;\n", that, that->on_success());
   Visit(that->on_success());
 }
 
 
 void DotPrinter::VisitEnd(EndNode* that) {
-  os_ << "  n" << that << " [style=bold, shape=point];\n";
+  OS::Print("  n%p [style=bold, shape=point];\n", that);
   PrintAttributes(that);
 }
 
 
 void DotPrinter::VisitAssertion(AssertionNode* that) {
-  os_ << "  n" << that << " [";
+  OS::Print("  n%p [", that);
   switch (that->assertion_type()) {
     case AssertionNode::AT_END:
-      os_ << "label=\"$\", shape=septagon";
+      OS::Print("label=\"$\", shape=septagon");
       break;
     case AssertionNode::AT_START:
-      os_ << "label=\"^\", shape=septagon";
+      OS::Print("label=\"^\", shape=septagon");
       break;
     case AssertionNode::AT_BOUNDARY:
-      os_ << "label=\"\\b\", shape=septagon";
+      OS::Print("label=\"\\b\", shape=septagon");
       break;
     case AssertionNode::AT_NON_BOUNDARY:
-      os_ << "label=\"\\B\", shape=septagon";
+      OS::Print("label=\"\\B\", shape=septagon");
       break;
     case AssertionNode::AFTER_NEWLINE:
-      os_ << "label=\"(?<=\\n)\", shape=septagon";
+      OS::Print("label=\"(?<=\\n)\", shape=septagon");
       break;
   }
-  os_ << "];\n";
+  OS::Print("];\n");
   PrintAttributes(that);
   RegExpNode* successor = that->on_success();
-  os_ << "  n" << that << " -> n" << successor << ";\n";
+  OS::Print("  n%p -> n%p;\n", that, successor);
   Visit(successor);
 }
 
 
 void DotPrinter::VisitAction(ActionNode* that) {
-  os_ << "  n" << that << " [";
+  OS::Print("  n%p [", that);
   switch (that->action_type_) {
     case ActionNode::SET_REGISTER:
-      os_ << "label=\"$" << that->data_.u_store_register.reg
-          << ":=" << that->data_.u_store_register.value << "\", shape=octagon";
+      OS::Print("label=\"$%" Pd ":=%" Pd "\", shape=octagon",
+                that->data_.u_store_register.reg,
+                that->data_.u_store_register.value);
       break;
     case ActionNode::INCREMENT_REGISTER:
-      os_ << "label=\"$" << that->data_.u_increment_register.reg
-          << "++\", shape=octagon";
+      OS::Print("label=\"$%" Pd "++\", shape=octagon",
+                that->data_.u_increment_register.reg);
       break;
     case ActionNode::STORE_POSITION:
-      os_ << "label=\"$" << that->data_.u_position_register.reg
-          << ":=$pos\", shape=octagon";
+      OS::Print("label=\"$%" Pd ":=$pos\", shape=octagon",
+                that->data_.u_position_register.reg);
       break;
     case ActionNode::BEGIN_SUBMATCH:
-      os_ << "label=\"$" << that->data_.u_submatch.current_position_register
-          << ":=$pos,begin\", shape=septagon";
+      OS::Print("label=\"$%" Pd ":=$pos,begin\", shape=septagon",
+                that->data_.u_submatch.current_position_register);
       break;
     case ActionNode::POSITIVE_SUBMATCH_SUCCESS:
-      os_ << "label=\"escape\", shape=septagon";
+      OS::Print("label=\"escape\", shape=septagon");
       break;
     case ActionNode::EMPTY_MATCH_CHECK:
-      os_ << "label=\"$" << that->data_.u_empty_match_check.start_register
-          << "=$pos?,$" << that->data_.u_empty_match_check.repetition_register
-          << "<" << that->data_.u_empty_match_check.repetition_limit
-          << "?\", shape=septagon";
+      OS::Print("label=\"$%" Pd "=$pos?,$%" Pd "<%" Pd "?\", shape=septagon",
+                that->data_.u_empty_match_check.start_register,
+                that->data_.u_empty_match_check.repetition_register,
+                that->data_.u_empty_match_check.repetition_limit);
       break;
     case ActionNode::CLEAR_CAPTURES: {
-      os_ << "label=\"clear $" << that->data_.u_clear_captures.range_from
-          << " to $" << that->data_.u_clear_captures.range_to
-          << "\", shape=septagon";
+      OS::Print("label=\"clear $%" Pd " to $%" Pd "\", shape=septagon",
+                that->data_.u_clear_captures.range_from,
+                that->data_.u_clear_captures.range_to);
       break;
     }
   }
-  os_ << "];\n";
+  OS::Print("];\n");
   PrintAttributes(that);
   RegExpNode* successor = that->on_success();
-  os_ << "  n" << that << " -> n" << successor << ";\n";
+  OS::Print("  n%p -> n%p;\n", that, successor);
   Visit(successor);
 }
 
 
-class DispatchTableDumper {
- public:
-  explicit DispatchTableDumper(OStream& os) : os_(os) {}
-  void Call(uc16 key, DispatchTable::Entry entry);
- private:
-  OStream& os_;
-};
-
-
-void DispatchTableDumper::Call(uc16 key, DispatchTable::Entry entry) {
-  os_ << "[" << AsUC16(key) << "-" << AsUC16(entry.to()) << "]: {";
-  OutSet* set = entry.out_set();
-  bool first = true;
-  for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-    if (set->Get(i)) {
-      if (first) {
-        first = false;
-      } else {
-        os_ << ", ";
-      }
-      os_ << i;
-    }
-  }
-  os_ << "}\n";
-}
-
-
-void DispatchTable::Dump() {
-  OFStream os(stderr);
-  DispatchTableDumper dumper(os);
-  tree()->ForEach(&dumper);
-}
-
-
 void RegExpEngine::DotPrint(const char* label,
                             RegExpNode* node,
                             bool ignore_case) {
-  OFStream os(stdout);
-  DotPrinter printer(os, ignore_case);
+  DotPrinter printer(ignore_case);
   printer.PrintNode(label, node);
 }
 
@@ -4001,39 +3949,44 @@
 
 RegExpNode* RegExpAtom::ToNode(RegExpCompiler* compiler,
                                RegExpNode* on_success) {
-  ZoneList<TextElement>* elms =
-      new(compiler->zone()) ZoneList<TextElement>(1, compiler->zone());
-  elms->Add(TextElement::Atom(this), compiler->zone());
-  return new(compiler->zone()) TextNode(elms, on_success);
+  ZoneGrowableArray<TextElement>* elms =
+      new(CI) ZoneGrowableArray<TextElement>(1);
+  elms->Add(TextElement::Atom(this));
+  return new(CI) TextNode(elms, on_success);
 }
 
 
 RegExpNode* RegExpText::ToNode(RegExpCompiler* compiler,
                                RegExpNode* on_success) {
-  return new(compiler->zone()) TextNode(elements(), on_success);
+  ZoneGrowableArray<TextElement>* elms =
+      new(CI) ZoneGrowableArray<TextElement>(1);
+  for (intptr_t  i = 0; i < elements()->length(); i++) {
+    elms->Add(elements()->At(i));
+  }
+  return new(CI) TextNode(elms, on_success);
 }
 
 
-static bool CompareInverseRanges(ZoneList<CharacterRange>* ranges,
-                                 const int* special_class,
-                                 int length) {
+static bool CompareInverseRanges(ZoneGrowableArray<CharacterRange>* ranges,
+                                 const intptr_t* special_class,
+                                 intptr_t length) {
   length--;  // Remove final 0x10000.
-  DCHECK(special_class[length] == 0x10000);
-  DCHECK(ranges->length() != 0);
-  DCHECK(length != 0);
-  DCHECK(special_class[0] != 0);
+  ASSERT(special_class[length] == 0x10000);
+  ASSERT(ranges->length() != 0);
+  ASSERT(length != 0);
+  ASSERT(special_class[0] != 0);
   if (ranges->length() != (length >> 1) + 1) {
     return false;
   }
-  CharacterRange range = ranges->at(0);
+  CharacterRange range = ranges->At(0);
   if (range.from() != 0) {
     return false;
   }
-  for (int i = 0; i < length; i += 2) {
+  for (intptr_t i = 0; i < length; i += 2) {
     if (special_class[i] != (range.to() + 1)) {
       return false;
     }
-    range = ranges->at((i >> 1) + 1);
+    range = ranges->At((i >> 1) + 1);
     if (special_class[i+1] != range.from()) {
       return false;
     }
@@ -4045,16 +3998,16 @@
 }
 
 
-static bool CompareRanges(ZoneList<CharacterRange>* ranges,
-                          const int* special_class,
-                          int length) {
+static bool CompareRanges(ZoneGrowableArray<CharacterRange>* ranges,
+                          const intptr_t* special_class,
+                          intptr_t length) {
   length--;  // Remove final 0x10000.
-  DCHECK(special_class[length] == 0x10000);
+  ASSERT(special_class[length] == 0x10000);
   if (ranges->length() * 2 != length) {
     return false;
   }
-  for (int i = 0; i < length; i += 2) {
-    CharacterRange range = ranges->at(i >> 1);
+  for (intptr_t i = 0; i < length; i += 2) {
+    CharacterRange range = ranges->At(i >> 1);
     if (range.from() != special_class[i] ||
         range.to() != special_class[i + 1] - 1) {
       return false;
@@ -4064,7 +4017,7 @@
 }
 
 
-bool RegExpCharacterClass::is_standard(Zone* zone) {
+bool RegExpCharacterClass::is_standard() {
   // TODO(lrn): Remove need for this function, by not throwing away information
   // along the way.
   if (is_negated_) {
@@ -4073,31 +4026,31 @@
   if (set_.is_standard()) {
     return true;
   }
-  if (CompareRanges(set_.ranges(zone), kSpaceRanges, kSpaceRangeCount)) {
+  if (CompareRanges(set_.ranges(), kSpaceRanges, kSpaceRangeCount)) {
     set_.set_standard_set_type('s');
     return true;
   }
-  if (CompareInverseRanges(set_.ranges(zone), kSpaceRanges, kSpaceRangeCount)) {
+  if (CompareInverseRanges(set_.ranges(), kSpaceRanges, kSpaceRangeCount)) {
     set_.set_standard_set_type('S');
     return true;
   }
-  if (CompareInverseRanges(set_.ranges(zone),
+  if (CompareInverseRanges(set_.ranges(),
                            kLineTerminatorRanges,
                            kLineTerminatorRangeCount)) {
     set_.set_standard_set_type('.');
     return true;
   }
-  if (CompareRanges(set_.ranges(zone),
+  if (CompareRanges(set_.ranges(),
                     kLineTerminatorRanges,
                     kLineTerminatorRangeCount)) {
     set_.set_standard_set_type('n');
     return true;
   }
-  if (CompareRanges(set_.ranges(zone), kWordRanges, kWordRangeCount)) {
+  if (CompareRanges(set_.ranges(), kWordRanges, kWordRangeCount)) {
     set_.set_standard_set_type('w');
     return true;
   }
-  if (CompareInverseRanges(set_.ranges(zone), kWordRanges, kWordRangeCount)) {
+  if (CompareInverseRanges(set_.ranges(), kWordRanges, kWordRangeCount)) {
     set_.set_standard_set_type('W');
     return true;
   }
@@ -4107,18 +4060,18 @@
 
 RegExpNode* RegExpCharacterClass::ToNode(RegExpCompiler* compiler,
                                          RegExpNode* on_success) {
-  return new(compiler->zone()) TextNode(this, on_success);
+  return new(CI) TextNode(this, on_success);
 }
 
 
 RegExpNode* RegExpDisjunction::ToNode(RegExpCompiler* compiler,
                                       RegExpNode* on_success) {
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  int length = alternatives->length();
+  ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
+  intptr_t length = alternatives->length();
   ChoiceNode* result =
-      new(compiler->zone()) ChoiceNode(length, compiler->zone());
-  for (int i = 0; i < length; i++) {
-    GuardedAlternative alternative(alternatives->at(i)->ToNode(compiler,
+      new(CI) ChoiceNode(length, CI);
+  for (intptr_t i = 0; i < length; i++) {
+    GuardedAlternative alternative(alternatives->At(i)->ToNode(compiler,
                                                                on_success));
     result->AddAlternative(alternative);
   }
@@ -4139,21 +4092,21 @@
 
 // Scoped object to keep track of how much we unroll quantifier loops in the
 // regexp graph generator.
-class RegExpExpansionLimiter {
+class RegExpExpansionLimiter : public ValueObject {
  public:
-  static const int kMaxExpansionFactor = 6;
-  RegExpExpansionLimiter(RegExpCompiler* compiler, int factor)
+  static const intptr_t kMaxExpansionFactor = 6;
+  RegExpExpansionLimiter(RegExpCompiler* compiler, intptr_t factor)
       : compiler_(compiler),
         saved_expansion_factor_(compiler->current_expansion_factor()),
         ok_to_expand_(saved_expansion_factor_ <= kMaxExpansionFactor) {
-    DCHECK(factor > 0);
+    ASSERT(factor > 0);
     if (ok_to_expand_) {
       if (factor > kMaxExpansionFactor) {
         // Avoid integer overflow of the current expansion factor.
         ok_to_expand_ = false;
         compiler->set_current_expansion_factor(kMaxExpansionFactor + 1);
       } else {
-        int new_factor = saved_expansion_factor_ * factor;
+        intptr_t new_factor = saved_expansion_factor_ * factor;
         ok_to_expand_ = (new_factor <= kMaxExpansionFactor);
         compiler->set_current_expansion_factor(new_factor);
       }
@@ -4168,15 +4121,15 @@
 
  private:
   RegExpCompiler* compiler_;
-  int saved_expansion_factor_;
+  intptr_t saved_expansion_factor_;
   bool ok_to_expand_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpExpansionLimiter);
 };
 
 
-RegExpNode* RegExpQuantifier::ToNode(int min,
-                                     int max,
+RegExpNode* RegExpQuantifier::ToNode(intptr_t min,
+                                     intptr_t max,
                                      bool is_greedy,
                                      RegExpTree* body,
                                      RegExpCompiler* compiler,
@@ -4202,25 +4155,27 @@
   // simpler since we don't need to make the special zero length match check
   // from step 2.1.  If the min and max are small we can unroll a little in
   // this case.
-  static const int kMaxUnrolledMinMatches = 3;  // Unroll (foo)+ and (foo){3,}
-  static const int kMaxUnrolledMaxMatches = 3;  // Unroll (foo)? and (foo){x,3}
+  // Unroll (foo)+ and (foo){3,}
+  static const intptr_t kMaxUnrolledMinMatches = 3;
+  // Unroll (foo)? and (foo){x,3}
+  static const intptr_t kMaxUnrolledMaxMatches = 3;
   if (max == 0) return on_success;  // This can happen due to recursion.
   bool body_can_be_empty = (body->min_match() == 0);
-  int body_start_reg = RegExpCompiler::kNoRegister;
+  intptr_t body_start_reg = RegExpCompiler::kNoRegister;
   Interval capture_registers = body->CaptureRegisters();
   bool needs_capture_clearing = !capture_registers.is_empty();
-  Zone* zone = compiler->zone();
+  Isolate* isolate = compiler->isolate();
 
   if (body_can_be_empty) {
     body_start_reg = compiler->AllocateRegister();
-  } else if (FLAG_regexp_optimization && !needs_capture_clearing) {
+  } else if (kRegexpOptimization && !needs_capture_clearing) {
     // Only unroll if there are no captures and the body can't be
     // empty.
     {
       RegExpExpansionLimiter limiter(
           compiler, min + ((max != min) ? 1 : 0));
       if (min > 0 && min <= kMaxUnrolledMinMatches && limiter.ok_to_expand()) {
-        int new_max = (max == kInfinity) ? max : max - min;
+        intptr_t new_max = (max == kInfinity) ? max : max - min;
         // Recurse once to get the loop or optional matches after the fixed
         // ones.
         RegExpNode* answer = ToNode(
@@ -4228,20 +4183,20 @@
         // Unroll the forced matches from 0 to min.  This can cause chains of
         // TextNodes (which the parser does not generate).  These should be
         // combined if it turns out they hinder good code generation.
-        for (int i = 0; i < min; i++) {
+        for (intptr_t i = 0; i < min; i++) {
           answer = body->ToNode(compiler, answer);
         }
         return answer;
       }
     }
     if (max <= kMaxUnrolledMaxMatches && min == 0) {
-      DCHECK(max > 0);  // Due to the 'if' above.
+      ASSERT(max > 0);  // Due to the 'if' above.
       RegExpExpansionLimiter limiter(compiler, max);
       if (limiter.ok_to_expand()) {
         // Unroll the optional matches up to max.
         RegExpNode* answer = on_success;
-        for (int i = 0; i < max; i++) {
-          ChoiceNode* alternation = new(zone) ChoiceNode(2, zone);
+        for (intptr_t i = 0; i < max; i++) {
+          ChoiceNode* alternation = new(isolate) ChoiceNode(2, isolate);
           if (is_greedy) {
             alternation->AddAlternative(
                 GuardedAlternative(body->ToNode(compiler, answer)));
@@ -4261,11 +4216,11 @@
   bool has_min = min > 0;
   bool has_max = max < RegExpTree::kInfinity;
   bool needs_counter = has_min || has_max;
-  int reg_ctr = needs_counter
+  intptr_t reg_ctr = needs_counter
       ? compiler->AllocateRegister()
       : RegExpCompiler::kNoRegister;
-  LoopChoiceNode* center = new(zone) LoopChoiceNode(body->min_match() == 0,
-                                                    zone);
+  LoopChoiceNode* center = new(isolate) LoopChoiceNode(body->min_match() == 0,
+                                                       isolate);
   if (not_at_start) center->set_not_at_start();
   RegExpNode* loop_return = needs_counter
       ? static_cast<RegExpNode*>(ActionNode::IncrementRegister(reg_ctr, center))
@@ -4291,13 +4246,13 @@
   GuardedAlternative body_alt(body_node);
   if (has_max) {
     Guard* body_guard =
-        new(zone) Guard(reg_ctr, Guard::LT, max);
-    body_alt.AddGuard(body_guard, zone);
+        new(isolate) Guard(reg_ctr, Guard::LT, max);
+    body_alt.AddGuard(body_guard, isolate);
   }
   GuardedAlternative rest_alt(on_success);
   if (has_min) {
-    Guard* rest_guard = new(compiler->zone()) Guard(reg_ctr, Guard::GEQ, min);
-    rest_alt.AddGuard(rest_guard, zone);
+    Guard* rest_guard = new(isolate) Guard(reg_ctr, Guard::GEQ, min);
+    rest_alt.AddGuard(rest_guard, isolate);
   }
   if (is_greedy) {
     center->AddLoopAlternative(body_alt);
@@ -4316,9 +4271,6 @@
 
 RegExpNode* RegExpAssertion::ToNode(RegExpCompiler* compiler,
                                     RegExpNode* on_success) {
-  NodeInfo info;
-  Zone* zone = compiler->zone();
-
   switch (assertion_type()) {
     case START_OF_LINE:
       return AssertionNode::AfterNewline(on_success);
@@ -4334,16 +4286,16 @@
       // Compile $ in multiline regexps as an alternation with a positive
       // lookahead in one side and an end-of-input on the other side.
       // We need two registers for the lookahead.
-      int stack_pointer_register = compiler->AllocateRegister();
-      int position_register = compiler->AllocateRegister();
+      intptr_t stack_pointer_register = compiler->AllocateRegister();
+      intptr_t position_register = compiler->AllocateRegister();
       // The ChoiceNode to distinguish between a newline and end-of-input.
-      ChoiceNode* result = new(zone) ChoiceNode(2, zone);
+      ChoiceNode* result = new ChoiceNode(2, on_success->isolate());
       // Create a newline atom.
-      ZoneList<CharacterRange>* newline_ranges =
-          new(zone) ZoneList<CharacterRange>(3, zone);
-      CharacterRange::AddClassEscape('n', newline_ranges, zone);
-      RegExpCharacterClass* newline_atom = new(zone) RegExpCharacterClass('n');
-      TextNode* newline_matcher = new(zone) TextNode(
+      ZoneGrowableArray<CharacterRange>* newline_ranges =
+          new ZoneGrowableArray<CharacterRange>(3);
+      CharacterRange::AddClassEscape('n', newline_ranges);
+      RegExpCharacterClass* newline_atom = new RegExpCharacterClass('n');
+      TextNode* newline_matcher = new TextNode(
          newline_atom,
          ActionNode::PositiveSubmatchSuccess(stack_pointer_register,
                                              position_register,
@@ -4371,7 +4323,7 @@
 
 RegExpNode* RegExpBackReference::ToNode(RegExpCompiler* compiler,
                                         RegExpNode* on_success) {
-  return new(compiler->zone())
+  return new(CI)
       BackReferenceNode(RegExpCapture::StartRegister(index()),
                         RegExpCapture::EndRegister(index()),
                         on_success);
@@ -4386,13 +4338,13 @@
 
 RegExpNode* RegExpLookahead::ToNode(RegExpCompiler* compiler,
                                     RegExpNode* on_success) {
-  int stack_pointer_register = compiler->AllocateRegister();
-  int position_register = compiler->AllocateRegister();
+  intptr_t stack_pointer_register = compiler->AllocateRegister();
+  intptr_t position_register = compiler->AllocateRegister();
 
-  const int registers_per_capture = 2;
-  const int register_of_first_capture = 2;
-  int register_count = capture_count_ * registers_per_capture;
-  int register_start =
+  const intptr_t registers_per_capture = 2;
+  const intptr_t register_of_first_capture = 2;
+  intptr_t register_count = capture_count_ * registers_per_capture;
+  intptr_t register_start =
     register_of_first_capture + capture_from_ * registers_per_capture;
 
   RegExpNode* success;
@@ -4419,20 +4371,19 @@
     // for a negative lookahead.  The NegativeLookaheadChoiceNode is a special
     // ChoiceNode that knows to ignore the first exit when calculating quick
     // checks.
-    Zone* zone = compiler->zone();
 
     GuardedAlternative body_alt(
         body()->ToNode(
             compiler,
-            success = new(zone) NegativeSubmatchSuccess(stack_pointer_register,
-                                                        position_register,
-                                                        register_count,
-                                                        register_start,
-                                                        zone)));
+            success = new(CI) NegativeSubmatchSuccess(stack_pointer_register,
+                                                      position_register,
+                                                      register_count,
+                                                      register_start,
+                                                      CI)));
     ChoiceNode* choice_node =
-        new(zone) NegativeLookaheadChoiceNode(body_alt,
-                                              GuardedAlternative(on_success),
-                                              zone);
+        new(CI) NegativeLookaheadChoiceNode(body_alt,
+                                            GuardedAlternative(on_success),
+                                            CI);
     return ActionNode::BeginSubmatch(stack_pointer_register,
                                      position_register,
                                      choice_node);
@@ -4447,11 +4398,11 @@
 
 
 RegExpNode* RegExpCapture::ToNode(RegExpTree* body,
-                                  int index,
+                                  intptr_t index,
                                   RegExpCompiler* compiler,
                                   RegExpNode* on_success) {
-  int start_reg = RegExpCapture::StartRegister(index);
-  int end_reg = RegExpCapture::EndRegister(index);
+  intptr_t start_reg = RegExpCapture::StartRegister(index);
+  intptr_t end_reg = RegExpCapture::EndRegister(index);
   RegExpNode* store_end = ActionNode::StorePosition(end_reg, true, on_success);
   RegExpNode* body_node = body->ToNode(compiler, store_end);
   return ActionNode::StorePosition(start_reg, true, body_node);
@@ -4460,88 +4411,83 @@
 
 RegExpNode* RegExpAlternative::ToNode(RegExpCompiler* compiler,
                                       RegExpNode* on_success) {
-  ZoneList<RegExpTree*>* children = nodes();
+  ZoneGrowableArray<RegExpTree*>* children = nodes();
   RegExpNode* current = on_success;
-  for (int i = children->length() - 1; i >= 0; i--) {
-    current = children->at(i)->ToNode(compiler, current);
+  for (intptr_t i = children->length() - 1; i >= 0; i--) {
+    current = children->At(i)->ToNode(compiler, current);
   }
   return current;
 }
 
 
-static void AddClass(const int* elmv,
-                     int elmc,
-                     ZoneList<CharacterRange>* ranges,
-                     Zone* zone) {
+static void AddClass(const intptr_t* elmv,
+                     intptr_t elmc,
+                     ZoneGrowableArray<CharacterRange>* ranges) {
   elmc--;
-  DCHECK(elmv[elmc] == 0x10000);
-  for (int i = 0; i < elmc; i += 2) {
-    DCHECK(elmv[i] < elmv[i + 1]);
-    ranges->Add(CharacterRange(elmv[i], elmv[i + 1] - 1), zone);
+  ASSERT(elmv[elmc] == 0x10000);
+  for (intptr_t i = 0; i < elmc; i += 2) {
+    ASSERT(elmv[i] < elmv[i + 1]);
+    ranges->Add(CharacterRange(elmv[i], elmv[i + 1] - 1));
   }
 }
 
 
-static void AddClassNegated(const int *elmv,
-                            int elmc,
-                            ZoneList<CharacterRange>* ranges,
-                            Zone* zone) {
+static void AddClassNegated(const intptr_t *elmv,
+                            intptr_t elmc,
+                            ZoneGrowableArray<CharacterRange>* ranges) {
   elmc--;
-  DCHECK(elmv[elmc] == 0x10000);
-  DCHECK(elmv[0] != 0x0000);
-  DCHECK(elmv[elmc-1] != String::kMaxUtf16CodeUnit);
-  uc16 last = 0x0000;
-  for (int i = 0; i < elmc; i += 2) {
-    DCHECK(last <= elmv[i] - 1);
-    DCHECK(elmv[i] < elmv[i + 1]);
-    ranges->Add(CharacterRange(last, elmv[i] - 1), zone);
+  ASSERT(elmv[elmc] == 0x10000);
+  ASSERT(elmv[0] != 0x0000);
+  ASSERT(elmv[elmc-1] != Utf16::kMaxCodeUnit);
+  uint16_t last = 0x0000;
+  for (intptr_t i = 0; i < elmc; i += 2) {
+    ASSERT(last <= elmv[i] - 1);
+    ASSERT(elmv[i] < elmv[i + 1]);
+    ranges->Add(CharacterRange(last, elmv[i] - 1));
     last = elmv[i + 1];
   }
-  ranges->Add(CharacterRange(last, String::kMaxUtf16CodeUnit), zone);
+  ranges->Add(CharacterRange(last, Utf16::kMaxCodeUnit));
 }
 
 
-void CharacterRange::AddClassEscape(uc16 type,
-                                    ZoneList<CharacterRange>* ranges,
-                                    Zone* zone) {
+void CharacterRange::AddClassEscape(uint16_t type,
+                                    ZoneGrowableArray<CharacterRange>* ranges) {
   switch (type) {
     case 's':
-      AddClass(kSpaceRanges, kSpaceRangeCount, ranges, zone);
+      AddClass(kSpaceRanges, kSpaceRangeCount, ranges);
       break;
     case 'S':
-      AddClassNegated(kSpaceRanges, kSpaceRangeCount, ranges, zone);
+      AddClassNegated(kSpaceRanges, kSpaceRangeCount, ranges);
       break;
     case 'w':
-      AddClass(kWordRanges, kWordRangeCount, ranges, zone);
+      AddClass(kWordRanges, kWordRangeCount, ranges);
       break;
     case 'W':
-      AddClassNegated(kWordRanges, kWordRangeCount, ranges, zone);
+      AddClassNegated(kWordRanges, kWordRangeCount, ranges);
       break;
     case 'd':
-      AddClass(kDigitRanges, kDigitRangeCount, ranges, zone);
+      AddClass(kDigitRanges, kDigitRangeCount, ranges);
       break;
     case 'D':
-      AddClassNegated(kDigitRanges, kDigitRangeCount, ranges, zone);
+      AddClassNegated(kDigitRanges, kDigitRangeCount, ranges);
       break;
     case '.':
       AddClassNegated(kLineTerminatorRanges,
                       kLineTerminatorRangeCount,
-                      ranges,
-                      zone);
+                      ranges);
       break;
     // This is not a character range as defined by the spec but a
     // convenient shorthand for a character class that matches any
     // character.
     case '*':
-      ranges->Add(CharacterRange::Everything(), zone);
+      ranges->Add(CharacterRange::Everything());
       break;
     // This is the set of characters matched by the $ and ^ symbols
     // in multiline mode.
     case 'n':
       AddClass(kLineTerminatorRanges,
                kLineTerminatorRangeCount,
-               ranges,
-               zone);
+               ranges);
       break;
     default:
       UNREACHABLE();
@@ -4549,77 +4495,29 @@
 }
 
 
-Vector<const int> CharacterRange::GetWordBounds() {
-  return Vector<const int>(kWordRanges, kWordRangeCount - 1);
-}
-
-
-class CharacterRangeSplitter {
- public:
-  CharacterRangeSplitter(ZoneList<CharacterRange>** included,
-                         ZoneList<CharacterRange>** excluded,
-                         Zone* zone)
-      : included_(included),
-        excluded_(excluded),
-        zone_(zone) { }
-  void Call(uc16 from, DispatchTable::Entry entry);
-
-  static const int kInBase = 0;
-  static const int kInOverlay = 1;
-
- private:
-  ZoneList<CharacterRange>** included_;
-  ZoneList<CharacterRange>** excluded_;
-  Zone* zone_;
-};
-
-
-void CharacterRangeSplitter::Call(uc16 from, DispatchTable::Entry entry) {
-  if (!entry.out_set()->Get(kInBase)) return;
-  ZoneList<CharacterRange>** target = entry.out_set()->Get(kInOverlay)
-    ? included_
-    : excluded_;
-  if (*target == NULL) *target = new(zone_) ZoneList<CharacterRange>(2, zone_);
-  (*target)->Add(CharacterRange(entry.from(), entry.to()), zone_);
-}
-
-
-void CharacterRange::Split(ZoneList<CharacterRange>* base,
-                           Vector<const int> overlay,
-                           ZoneList<CharacterRange>** included,
-                           ZoneList<CharacterRange>** excluded,
-                           Zone* zone) {
-  DCHECK_EQ(NULL, *included);
-  DCHECK_EQ(NULL, *excluded);
-  DispatchTable table(zone);
-  for (int i = 0; i < base->length(); i++)
-    table.AddRange(base->at(i), CharacterRangeSplitter::kInBase, zone);
-  for (int i = 0; i < overlay.length(); i += 2) {
-    table.AddRange(CharacterRange(overlay[i], overlay[i + 1] - 1),
-                   CharacterRangeSplitter::kInOverlay, zone);
-  }
-  CharacterRangeSplitter callback(included, excluded, zone);
-  table.ForEach(&callback);
-}
-
-
-void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges,
-                                        bool is_one_byte, Zone* zone) {
-  Isolate* isolate = zone->isolate();
-  uc16 bottom = from();
-  uc16 top = to();
+void CharacterRange::AddCaseEquivalents(
+                        ZoneGrowableArray<CharacterRange>* ranges,
+                        bool is_one_byte,
+                        Isolate* isolate) {
+  uint16_t bottom = from();
+  uint16_t top = to();
   if (is_one_byte && !RangeContainsLatin1Equivalents(*this)) {
-    if (bottom > String::kMaxOneByteCharCode) return;
-    if (top > String::kMaxOneByteCharCode) top = String::kMaxOneByteCharCode;
+    if (bottom > Symbols::kMaxOneCharCodeSymbol) return;
+    if (top > Symbols::kMaxOneCharCodeSymbol) {
+      top = Symbols::kMaxOneCharCodeSymbol;
+    }
   }
-  unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+
+  unibrow::Mapping<unibrow::Ecma262UnCanonicalize> jsregexp_uncanonicalize;
+  unibrow::Mapping<unibrow::CanonicalizationRange> jsregexp_canonrange;
+  int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
   if (top == bottom) {
     // If this is a singleton we just expand the one character.
-    int length = isolate->jsregexp_uncanonicalize()->get(bottom, '\0', chars);
-    for (int i = 0; i < length; i++) {
-      uc32 chr = chars[i];
+    intptr_t length = jsregexp_uncanonicalize.get(bottom, '\0', chars); // NOLINT
+    for (intptr_t i = 0; i < length; i++) {
+      uint32_t chr = chars[i];
       if (chr != bottom) {
-        ranges->Add(CharacterRange::Singleton(chars[i]), zone);
+        ranges->Add(CharacterRange::Singleton(chars[i]));
       }
     }
   } else {
@@ -4641,25 +4539,25 @@
     // completely contained in a block we do this for all the blocks
     // covered by the range (handling characters that is not in a block
     // as a "singleton block").
-    unibrow::uchar range[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-    int pos = bottom;
+    int32_t range[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+    intptr_t pos = bottom;
     while (pos <= top) {
-      int length = isolate->jsregexp_canonrange()->get(pos, '\0', range);
-      uc16 block_end;
+      intptr_t length = jsregexp_canonrange.get(pos, '\0', range);
+      uint16_t block_end;
       if (length == 0) {
         block_end = pos;
       } else {
-        DCHECK_EQ(1, length);
+        ASSERT(length == 1);
         block_end = range[0];
       }
-      int end = (block_end > top) ? top : block_end;
-      length = isolate->jsregexp_uncanonicalize()->get(block_end, '\0', range);
-      for (int i = 0; i < length; i++) {
-        uc32 c = range[i];
-        uc16 range_from = c - (block_end - pos);
-        uc16 range_to = c - (block_end - end);
+      intptr_t end = (block_end > top) ? top : block_end;
+      length = jsregexp_uncanonicalize.get(block_end, '\0', range); // NOLINT
+      for (intptr_t i = 0; i < length; i++) {
+        uint32_t c = range[i];
+        uint16_t range_from = c - (block_end - pos);
+        uint16_t range_to = c - (block_end - end);
         if (!(bottom <= range_from && range_to <= top)) {
-          ranges->Add(CharacterRange(range_from, range_to), zone);
+          ranges->Add(CharacterRange(range_from, range_to));
         }
       }
       pos = end + 1;
@@ -4668,13 +4566,13 @@
 }
 
 
-bool CharacterRange::IsCanonical(ZoneList<CharacterRange>* ranges) {
-  DCHECK_NOT_NULL(ranges);
-  int n = ranges->length();
+bool CharacterRange::IsCanonical(ZoneGrowableArray<CharacterRange>* ranges) {
+  ASSERT(ranges != NULL);
+  intptr_t n = ranges->length();
   if (n <= 1) return true;
-  int max = ranges->at(0).to();
-  for (int i = 1; i < n; i++) {
-    CharacterRange next_range = ranges->at(i);
+  intptr_t max = ranges->At(0).to();
+  for (intptr_t i = 1; i < n; i++) {
+    CharacterRange next_range = ranges->At(i);
     if (next_range.from() <= max + 1) return false;
     max = next_range.to();
   }
@@ -4682,48 +4580,49 @@
 }
 
 
-ZoneList<CharacterRange>* CharacterSet::ranges(Zone* zone) {
+ZoneGrowableArray<CharacterRange>* CharacterSet::ranges() {
   if (ranges_ == NULL) {
-    ranges_ = new(zone) ZoneList<CharacterRange>(2, zone);
-    CharacterRange::AddClassEscape(standard_set_type_, ranges_, zone);
+    ranges_ = new ZoneGrowableArray<CharacterRange>(2);
+    CharacterRange::AddClassEscape(standard_set_type_, ranges_);
   }
   return ranges_;
 }
 
 
-// Move a number of elements in a zonelist to another position
-// in the same list. Handles overlapping source and target areas.
-static void MoveRanges(ZoneList<CharacterRange>* list,
-                       int from,
-                       int to,
-                       int count) {
+// Move a number of elements in a zone array to another position
+// in the same array. Handles overlapping source and target areas.
+static void MoveRanges(ZoneGrowableArray<CharacterRange>* list,
+                       intptr_t from,
+                       intptr_t to,
+                       intptr_t count) {
   // Ranges are potentially overlapping.
   if (from < to) {
-    for (int i = count - 1; i >= 0; i--) {
-      list->at(to + i) = list->at(from + i);
+    for (intptr_t i = count - 1; i >= 0; i--) {
+      (*list)[to + i] = list->At(from + i);
     }
   } else {
-    for (int i = 0; i < count; i++) {
-      list->at(to + i) = list->at(from + i);
+    for (intptr_t i = 0; i < count; i++) {
+      (*list)[to + i] = list->At(from + i);
     }
   }
 }
 
 
-static int InsertRangeInCanonicalList(ZoneList<CharacterRange>* list,
-                                      int count,
-                                      CharacterRange insert) {
+static intptr_t InsertRangeInCanonicalList(
+                    ZoneGrowableArray<CharacterRange>* list,
+                    intptr_t count,
+                    CharacterRange insert) {
   // Inserts a range into list[0..count[, which must be sorted
   // by from value and non-overlapping and non-adjacent, using at most
   // list[0..count] for the result. Returns the number of resulting
   // canonicalized ranges. Inserting a range may collapse existing ranges into
   // fewer ranges, so the return value can be anything in the range 1..count+1.
-  uc16 from = insert.from();
-  uc16 to = insert.to();
-  int start_pos = 0;
-  int end_pos = count;
-  for (int i = count - 1; i >= 0; i--) {
-    CharacterRange current = list->at(i);
+  uint16_t from = insert.from();
+  uint16_t to = insert.to();
+  intptr_t start_pos = 0;
+  intptr_t end_pos = count;
+  for (intptr_t i = count - 1; i >= 0; i--) {
+    CharacterRange current = list->At(i);
     if (current.from() > to + 1) {
       end_pos = i;
     } else if (current.to() + 1 < from) {
@@ -4744,26 +4643,26 @@
     if (start_pos < count) {
       MoveRanges(list, start_pos, start_pos + 1, count - start_pos);
     }
-    list->at(start_pos) = insert;
+    (*list)[start_pos] = insert;
     return count + 1;
   }
   if (start_pos + 1 == end_pos) {
     // Replace single existing range at position start_pos.
-    CharacterRange to_replace = list->at(start_pos);
-    int new_from = Min(to_replace.from(), from);
-    int new_to = Max(to_replace.to(), to);
-    list->at(start_pos) = CharacterRange(new_from, new_to);
+    CharacterRange to_replace = list->At(start_pos);
+    intptr_t new_from = Utils::Minimum(to_replace.from(), from);
+    intptr_t new_to = Utils::Maximum(to_replace.to(), to);
+    (*list)[start_pos] = CharacterRange(new_from, new_to);
     return count;
   }
   // Replace a number of existing ranges from start_pos to end_pos - 1.
   // Move the remaining ranges down.
 
-  int new_from = Min(list->at(start_pos).from(), from);
-  int new_to = Max(list->at(end_pos - 1).to(), to);
+  intptr_t new_from = Utils::Minimum(list->At(start_pos).from(), from);
+  intptr_t new_to = Utils::Maximum(list->At(end_pos - 1).to(), to);
   if (end_pos < count) {
     MoveRanges(list, end_pos, start_pos + 1, count - end_pos);
   }
-  list->at(start_pos) = CharacterRange(new_from, new_to);
+  (*list)[start_pos] = CharacterRange(new_from, new_to);
   return count - (end_pos - start_pos) + 1;
 }
 
@@ -4776,15 +4675,16 @@
 }
 
 
-void CharacterRange::Canonicalize(ZoneList<CharacterRange>* character_ranges) {
+void CharacterRange::Canonicalize(
+    ZoneGrowableArray<CharacterRange>* character_ranges) {
   if (character_ranges->length() <= 1) return;
   // Check whether ranges are already canonical (increasing, non-overlapping,
   // non-adjacent).
-  int n = character_ranges->length();
-  int max = character_ranges->at(0).to();
-  int i = 1;
+  intptr_t n = character_ranges->length();
+  intptr_t max = character_ranges->At(0).to();
+  intptr_t i = 1;
   while (i < n) {
-    CharacterRange current = character_ranges->at(i);
+    CharacterRange current = character_ranges->At(i);
     if (current.from() <= max + 1) {
       break;
     }
@@ -4799,41 +4699,39 @@
   // list, in order).
   // Notice that inserting a range can reduce the number of ranges in the
   // result due to combining of adjacent and overlapping ranges.
-  int read = i;  // Range to insert.
-  int num_canonical = i;  // Length of canonicalized part of list.
+  intptr_t read = i;  // Range to insert.
+  intptr_t num_canonical = i;  // Length of canonicalized part of list.
   do {
     num_canonical = InsertRangeInCanonicalList(character_ranges,
                                                num_canonical,
-                                               character_ranges->at(read));
+                                               character_ranges->At(read));
     read++;
   } while (read < n);
-  character_ranges->Rewind(num_canonical);
+  character_ranges->TruncateTo(num_canonical);
 
-  DCHECK(CharacterRange::IsCanonical(character_ranges));
+  ASSERT(CharacterRange::IsCanonical(character_ranges));
 }
 
 
-void CharacterRange::Negate(ZoneList<CharacterRange>* ranges,
-                            ZoneList<CharacterRange>* negated_ranges,
-                            Zone* zone) {
-  DCHECK(CharacterRange::IsCanonical(ranges));
-  DCHECK_EQ(0, negated_ranges->length());
-  int range_count = ranges->length();
-  uc16 from = 0;
-  int i = 0;
-  if (range_count > 0 && ranges->at(0).from() == 0) {
-    from = ranges->at(0).to();
+void CharacterRange::Negate(ZoneGrowableArray<CharacterRange>* ranges,
+                            ZoneGrowableArray<CharacterRange>* negated_ranges) {
+  ASSERT(CharacterRange::IsCanonical(ranges));
+  ASSERT(negated_ranges->length() == 0);
+  intptr_t range_count = ranges->length();
+  uint16_t from = 0;
+  intptr_t i = 0;
+  if (range_count > 0 && ranges->At(0).from() == 0) {
+    from = ranges->At(0).to();
     i = 1;
   }
   while (i < range_count) {
-    CharacterRange range = ranges->at(i);
-    negated_ranges->Add(CharacterRange(from + 1, range.from() - 1), zone);
+    CharacterRange range = ranges->At(i);
+    negated_ranges->Add(CharacterRange(from + 1, range.from() - 1));
     from = range.to();
     i++;
   }
-  if (from < String::kMaxUtf16CodeUnit) {
-    negated_ranges->Add(CharacterRange(from + 1, String::kMaxUtf16CodeUnit),
-                        zone);
+  if (from < Utf16::kMaxCodeUnit) {
+    negated_ranges->Add(CharacterRange(from + 1, Utf16::kMaxCodeUnit));
   }
 }
 
@@ -4842,33 +4740,29 @@
 // Splay tree
 
 
-OutSet* OutSet::Extend(unsigned value, Zone* zone) {
-  if (Get(value))
-    return this;
-  if (successors(zone) != NULL) {
-    for (int i = 0; i < successors(zone)->length(); i++) {
-      OutSet* successor = successors(zone)->at(i);
-      if (successor->Get(value))
-        return successor;
+// Workaround for the fact that ZoneGrowableArray does not have contains().
+static bool ArrayContains(ZoneGrowableArray<unsigned>* array,
+                          unsigned value) {
+  for (intptr_t i = 0; i < array->length(); i++) {
+    if (array->At(i) == value) {
+      return true;
     }
-  } else {
-    successors_ = new(zone) ZoneList<OutSet*>(2, zone);
   }
-  OutSet* result = new(zone) OutSet(first_, remaining_);
-  result->Set(value, zone);
-  successors(zone)->Add(result, zone);
-  return result;
+  return false;
 }
 
 
-void OutSet::Set(unsigned value, Zone *zone) {
+void OutSet::Set(unsigned value, Isolate* isolate) {
   if (value < kFirstLimit) {
     first_ |= (1 << value);
   } else {
     if (remaining_ == NULL)
-      remaining_ = new(zone) ZoneList<unsigned>(1, zone);
-    if (remaining_->is_empty() || !remaining_->Contains(value))
-      remaining_->Add(value, zone);
+      remaining_ = new(isolate) ZoneGrowableArray<unsigned>(1);
+
+    bool remaining_contains_value = ArrayContains(remaining_, value);
+    if (remaining_->is_empty() || !remaining_contains_value) {
+      remaining_->Add(value);
+    }
   }
 }
 
@@ -4879,125 +4773,16 @@
   } else if (remaining_ == NULL) {
     return false;
   } else {
-    return remaining_->Contains(value);
+    return ArrayContains(remaining_, value);
   }
 }
 
 
-const uc16 DispatchTable::Config::kNoKey = unibrow::Utf8::kBadChar;
-
-
-void DispatchTable::AddRange(CharacterRange full_range, int value,
-                             Zone* zone) {
-  CharacterRange current = full_range;
-  if (tree()->is_empty()) {
-    // If this is the first range we just insert into the table.
-    ZoneSplayTree<Config>::Locator loc;
-    DCHECK_RESULT(tree()->Insert(current.from(), &loc));
-    loc.set_value(Entry(current.from(), current.to(),
-                        empty()->Extend(value, zone)));
-    return;
-  }
-  // First see if there is a range to the left of this one that
-  // overlaps.
-  ZoneSplayTree<Config>::Locator loc;
-  if (tree()->FindGreatestLessThan(current.from(), &loc)) {
-    Entry* entry = &loc.value();
-    // If we've found a range that overlaps with this one, and it
-    // starts strictly to the left of this one, we have to fix it
-    // because the following code only handles ranges that start on
-    // or after the start point of the range we're adding.
-    if (entry->from() < current.from() && entry->to() >= current.from()) {
-      // Snap the overlapping range in half around the start point of
-      // the range we're adding.
-      CharacterRange left(entry->from(), current.from() - 1);
-      CharacterRange right(current.from(), entry->to());
-      // The left part of the overlapping range doesn't overlap.
-      // Truncate the whole entry to be just the left part.
-      entry->set_to(left.to());
-      // The right part is the one that overlaps.  We add this part
-      // to the map and let the next step deal with merging it with
-      // the range we're adding.
-      ZoneSplayTree<Config>::Locator loc;
-      DCHECK_RESULT(tree()->Insert(right.from(), &loc));
-      loc.set_value(Entry(right.from(),
-                          right.to(),
-                          entry->out_set()));
-    }
-  }
-  while (current.is_valid()) {
-    if (tree()->FindLeastGreaterThan(current.from(), &loc) &&
-        (loc.value().from() <= current.to()) &&
-        (loc.value().to() >= current.from())) {
-      Entry* entry = &loc.value();
-      // We have overlap.  If there is space between the start point of
-      // the range we're adding and where the overlapping range starts
-      // then we have to add a range covering just that space.
-      if (current.from() < entry->from()) {
-        ZoneSplayTree<Config>::Locator ins;
-        DCHECK_RESULT(tree()->Insert(current.from(), &ins));
-        ins.set_value(Entry(current.from(),
-                            entry->from() - 1,
-                            empty()->Extend(value, zone)));
-        current.set_from(entry->from());
-      }
-      DCHECK_EQ(current.from(), entry->from());
-      // If the overlapping range extends beyond the one we want to add
-      // we have to snap the right part off and add it separately.
-      if (entry->to() > current.to()) {
-        ZoneSplayTree<Config>::Locator ins;
-        DCHECK_RESULT(tree()->Insert(current.to() + 1, &ins));
-        ins.set_value(Entry(current.to() + 1,
-                            entry->to(),
-                            entry->out_set()));
-        entry->set_to(current.to());
-      }
-      DCHECK(entry->to() <= current.to());
-      // The overlapping range is now completely contained by the range
-      // we're adding so we can just update it and move the start point
-      // of the range we're adding just past it.
-      entry->AddValue(value, zone);
-      // Bail out if the last interval ended at 0xFFFF since otherwise
-      // adding 1 will wrap around to 0.
-      if (entry->to() == String::kMaxUtf16CodeUnit)
-        break;
-      DCHECK(entry->to() + 1 > current.from());
-      current.set_from(entry->to() + 1);
-    } else {
-      // There is no overlap so we can just add the range
-      ZoneSplayTree<Config>::Locator ins;
-      DCHECK_RESULT(tree()->Insert(current.from(), &ins));
-      ins.set_value(Entry(current.from(),
-                          current.to(),
-                          empty()->Extend(value, zone)));
-      break;
-    }
-  }
-}
-
-
-OutSet* DispatchTable::Get(uc16 value) {
-  ZoneSplayTree<Config>::Locator loc;
-  if (!tree()->FindGreatestLessThan(value, &loc))
-    return empty();
-  Entry* entry = &loc.value();
-  if (value <= entry->to())
-    return entry->out_set();
-  else
-    return empty();
-}
-
-
 // -------------------------------------------------------------------
 // Analysis
 
 
 void Analysis::EnsureAnalyzed(RegExpNode* that) {
-  StackLimitCheck check(that->zone()->isolate());
-  if (check.HasOverflowed()) {
-    fail("Stack overflow");
-    return;
-  }
   if (that->info()->been_analyzed || that->info()->being_analyzed)
     return;
   that->info()->being_analyzed = true;
@@ -5013,12 +4798,12 @@
 
 
 void TextNode::CalculateOffsets() {
-  int element_count = elements()->length();
+  intptr_t element_count = elements()->length();
   // Set up the offsets of the elements relative to the start.  This is a fixed
   // quantity since a TextNode can only contain fixed-width things.
-  int cp_offset = 0;
-  for (int i = 0; i < element_count; i++) {
-    TextElement& elm = elements()->at(i);
+  intptr_t cp_offset = 0;
+  for (intptr_t i = 0; i < element_count; i++) {
+    TextElement& elm = (*elements())[i];
     elm.set_cp_offset(cp_offset);
     cp_offset += elm.length();
   }
@@ -5049,8 +4834,8 @@
 
 void Analysis::VisitChoice(ChoiceNode* that) {
   NodeInfo* info = that->info();
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    RegExpNode* node = that->alternatives()->at(i).node();
+  for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
+    RegExpNode* node = (*that->alternatives())[i].node();
     EnsureAnalyzed(node);
     if (has_failed()) return;
     // Anything the following nodes need to know has to be known by
@@ -5062,8 +4847,8 @@
 
 void Analysis::VisitLoopChoice(LoopChoiceNode* that) {
   NodeInfo* info = that->info();
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    RegExpNode* node = that->alternatives()->at(i).node();
+  for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
+    RegExpNode* node = (*that->alternatives())[i].node();
     if (node != that->loop_node()) {
       EnsureAnalyzed(node);
       if (has_failed()) return;
@@ -5089,8 +4874,8 @@
 }
 
 
-void BackReferenceNode::FillInBMInfo(int offset,
-                                     int budget,
+void BackReferenceNode::FillInBMInfo(intptr_t offset,
+                                     intptr_t budget,
                                      BoyerMooreLookahead* bm,
                                      bool not_at_start) {
   // Working out the set of characters that a backreference can match is too
@@ -5100,18 +4885,18 @@
 }
 
 
-STATIC_ASSERT(BoyerMoorePositionInfo::kMapSize ==
-              RegExpMacroAssembler::kTableSize);
+COMPILE_ASSERT(BoyerMoorePositionInfo::kMapSize ==
+               RegExpMacroAssembler::kTableSize);
 
 
-void ChoiceNode::FillInBMInfo(int offset,
-                              int budget,
+void ChoiceNode::FillInBMInfo(intptr_t offset,
+                              intptr_t budget,
                               BoyerMooreLookahead* bm,
                               bool not_at_start) {
-  ZoneList<GuardedAlternative>* alts = alternatives();
+  ZoneGrowableArray<GuardedAlternative>* alts = alternatives();
   budget = (budget - 1) / alts->length();
-  for (int i = 0; i < alts->length(); i++) {
-    GuardedAlternative& alt = alts->at(i);
+  for (intptr_t i = 0; i < alts->length(); i++) {
+    GuardedAlternative& alt = (*alts)[i];
     if (alt.guards() != NULL && alt.guards()->length() != 0) {
       bm->SetRest(offset);  // Give up trying to fill in info.
       SaveBMInfo(bm, not_at_start, offset);
@@ -5123,35 +4908,34 @@
 }
 
 
-void TextNode::FillInBMInfo(int initial_offset,
-                            int budget,
+void TextNode::FillInBMInfo(intptr_t initial_offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
   if (initial_offset >= bm->length()) return;
-  int offset = initial_offset;
-  int max_char = bm->max_char();
-  for (int i = 0; i < elements()->length(); i++) {
+  intptr_t offset = initial_offset;
+  intptr_t max_char = bm->max_char();
+  for (intptr_t i = 0; i < elements()->length(); i++) {
     if (offset >= bm->length()) {
       if (initial_offset == 0) set_bm_info(not_at_start, bm);
       return;
     }
-    TextElement text = elements()->at(i);
+    TextElement text = elements()->At(i);
     if (text.text_type() == TextElement::ATOM) {
       RegExpAtom* atom = text.atom();
-      for (int j = 0; j < atom->length(); j++, offset++) {
+      for (intptr_t j = 0; j < atom->length(); j++, offset++) {
         if (offset >= bm->length()) {
           if (initial_offset == 0) set_bm_info(not_at_start, bm);
           return;
         }
-        uc16 character = atom->data()[j];
+        uint16_t character = atom->data()->At(j);
         if (bm->compiler()->ignore_case()) {
-          unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-          int length = GetCaseIndependentLetters(
-              Isolate::Current(),
+          int32_t chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
+          intptr_t length = GetCaseIndependentLetters(
               character,
-              bm->max_char() == String::kMaxOneByteCharCode,
+              bm->max_char() == Symbols::kMaxOneCharCodeSymbol,
               chars);
-          for (int j = 0; j < length; j++) {
+          for (intptr_t j = 0; j < length; j++) {
             bm->Set(offset, chars[j]);
           }
         } else {
@@ -5159,16 +4943,17 @@
         }
       }
     } else {
-      DCHECK_EQ(TextElement::CHAR_CLASS, text.text_type());
+      ASSERT(text.text_type() == TextElement::CHAR_CLASS);
       RegExpCharacterClass* char_class = text.char_class();
-      ZoneList<CharacterRange>* ranges = char_class->ranges(zone());
+      ZoneGrowableArray<CharacterRange>* ranges = char_class->ranges();
       if (char_class->is_negated()) {
         bm->SetAll(offset);
       } else {
-        for (int k = 0; k < ranges->length(); k++) {
-          CharacterRange& range = ranges->at(k);
+        for (intptr_t k = 0; k < ranges->length(); k++) {
+          CharacterRange& range = (*ranges)[k];
           if (range.from() > max_char) continue;
-          int to = Min(max_char, static_cast<int>(range.to()));
+          intptr_t to = Utils::Minimum(max_char,
+                                       static_cast<intptr_t>(range.to()));
           bm->SetInterval(offset, Interval(range.from(), to));
         }
       }
@@ -5187,159 +4972,54 @@
 }
 
 
-// -------------------------------------------------------------------
-// Dispatch table construction
-
-
-void DispatchTableConstructor::VisitEnd(EndNode* that) {
-  AddRange(CharacterRange::Everything());
-}
-
-
-void DispatchTableConstructor::BuildTable(ChoiceNode* node) {
-  node->set_being_calculated(true);
-  ZoneList<GuardedAlternative>* alternatives = node->alternatives();
-  for (int i = 0; i < alternatives->length(); i++) {
-    set_choice_index(i);
-    alternatives->at(i).node()->Accept(this);
-  }
-  node->set_being_calculated(false);
-}
-
-
-class AddDispatchRange {
- public:
-  explicit AddDispatchRange(DispatchTableConstructor* constructor)
-    : constructor_(constructor) { }
-  void Call(uc32 from, DispatchTable::Entry entry);
- private:
-  DispatchTableConstructor* constructor_;
-};
-
-
-void AddDispatchRange::Call(uc32 from, DispatchTable::Entry entry) {
-  CharacterRange range(from, entry.to());
-  constructor_->AddRange(range);
-}
-
-
-void DispatchTableConstructor::VisitChoice(ChoiceNode* node) {
-  if (node->being_calculated())
-    return;
-  DispatchTable* table = node->GetTable(ignore_case_);
-  AddDispatchRange adder(this);
-  table->ForEach(&adder);
-}
-
-
-void DispatchTableConstructor::VisitBackReference(BackReferenceNode* that) {
-  // TODO(160): Find the node that we refer back to and propagate its start
-  // set back to here.  For now we just accept anything.
-  AddRange(CharacterRange::Everything());
-}
-
-
-void DispatchTableConstructor::VisitAssertion(AssertionNode* that) {
-  RegExpNode* target = that->on_success();
-  target->Accept(this);
-}
-
-
-static int CompareRangeByFrom(const CharacterRange* a,
-                              const CharacterRange* b) {
-  return Compare<uc16>(a->from(), b->from());
-}
-
-
-void DispatchTableConstructor::AddInverse(ZoneList<CharacterRange>* ranges) {
-  ranges->Sort(CompareRangeByFrom);
-  uc16 last = 0;
-  for (int i = 0; i < ranges->length(); i++) {
-    CharacterRange range = ranges->at(i);
-    if (last < range.from())
-      AddRange(CharacterRange(last, range.from() - 1));
-    if (range.to() >= last) {
-      if (range.to() == String::kMaxUtf16CodeUnit) {
-        return;
-      } else {
-        last = range.to() + 1;
-      }
-    }
-  }
-  AddRange(CharacterRange(last, String::kMaxUtf16CodeUnit));
-}
-
-
-void DispatchTableConstructor::VisitText(TextNode* that) {
-  TextElement elm = that->elements()->at(0);
-  switch (elm.text_type()) {
-    case TextElement::ATOM: {
-      uc16 c = elm.atom()->data()[0];
-      AddRange(CharacterRange(c, c));
-      break;
-    }
-    case TextElement::CHAR_CLASS: {
-      RegExpCharacterClass* tree = elm.char_class();
-      ZoneList<CharacterRange>* ranges = tree->ranges(that->zone());
-      if (tree->is_negated()) {
-        AddInverse(ranges);
-      } else {
-        for (int i = 0; i < ranges->length(); i++)
-          AddRange(ranges->at(i));
-      }
-      break;
-    }
-    default: {
-      UNIMPLEMENTED();
-    }
-  }
-}
-
-
-void DispatchTableConstructor::VisitAction(ActionNode* that) {
-  RegExpNode* target = that->on_success();
-  target->Accept(this);
-}
-
-
 RegExpEngine::CompilationResult RegExpEngine::Compile(
-    RegExpCompileData* data, bool ignore_case, bool is_global,
-    bool is_multiline, bool is_sticky, Handle<String> pattern,
-    Handle<String> sample_subject, bool is_one_byte, Zone* zone) {
-  if ((data->capture_count + 1) * 2 - 1 > RegExpMacroAssembler::kMaxRegister) {
-    return IrregexpRegExpTooBig(zone->isolate());
-  }
-  RegExpCompiler compiler(data->capture_count, ignore_case, is_one_byte, zone);
+    RegExpCompileData* data,
+    const ParsedFunction* parsed_function,
+    const ZoneGrowableArray<const ICData*>& ic_data_array) {
+  Isolate* isolate = Isolate::Current();
 
-  // Sample some characters from the middle of the string.
-  static const int kSampleSize = 128;
+  const Function& function = parsed_function->function();
+  const intptr_t specialization_cid = function.regexp_cid();
+  const bool is_one_byte = (specialization_cid == kOneByteStringCid ||
+                            specialization_cid == kExternalOneByteStringCid);
+  JSRegExp& regexp = JSRegExp::Handle(isolate, function.regexp());
+  const String& pattern = String::Handle(isolate, regexp.pattern());
 
-  sample_subject = String::Flatten(sample_subject);
-  int chars_sampled = 0;
-  int half_way = (sample_subject->length() - kSampleSize) / 2;
-  for (int i = Max(0, half_way);
-       i < sample_subject->length() && chars_sampled < kSampleSize;
-       i++, chars_sampled++) {
-    compiler.frequency_collator()->CountCharacter(sample_subject->Get(i));
-  }
+  ASSERT(!regexp.IsNull());
+  ASSERT(!pattern.IsNull());
+
+  const bool ignore_case = regexp.is_ignore_case();
+  const bool is_global = regexp.is_global();
+
+  RegExpCompiler compiler(data->capture_count, ignore_case, specialization_cid);
+
+  // TODO(zerny): Frequency sampling is currently disabled because of several
+  // issues. We do not want to store subject strings in the regexp object since
+  // they might be long and we should not prevent their garbage collection.
+  // Passing them to this function explicitly does not help, since we must
+  // generate exactly the same IR for both the unoptimizing and optimizing
+  // pipelines (otherwise it gets confused when i.e. deopt id's differ).
+  // An option would be to store sampling results in the regexp object, but
+  // I'm not sure the performance gains are relevant enough.
 
   // Wrap the body of the regexp in capture #0.
   RegExpNode* captured_body = RegExpCapture::ToNode(data->tree,
                                                     0,
                                                     &compiler,
                                                     compiler.accept());
+
   RegExpNode* node = captured_body;
   bool is_end_anchored = data->tree->IsAnchoredAtEnd();
   bool is_start_anchored = data->tree->IsAnchoredAtStart();
-  int max_length = data->tree->max_match();
-  if (!is_start_anchored && !is_sticky) {
+  intptr_t max_length = data->tree->max_match();
+  if (!is_start_anchored) {
     // Add a .*? at the beginning, outside the body capture, unless
-    // this expression is anchored at the beginning or sticky.
+    // this expression is anchored at the beginning.
     RegExpNode* loop_node =
         RegExpQuantifier::ToNode(0,
                                  RegExpTree::kInfinity,
                                  false,
-                                 new(zone) RegExpCharacterClass('*'),
+                                 new(isolate) RegExpCharacterClass('*'),
                                  &compiler,
                                  captured_body,
                                  data->contains_anchor);
@@ -5347,10 +5027,11 @@
     if (data->contains_anchor) {
       // Unroll loop once, to take care of the case that might start
       // at the start of input.
-      ChoiceNode* first_step_node = new(zone) ChoiceNode(2, zone);
+      ChoiceNode* first_step_node = new(isolate) ChoiceNode(2, isolate);
       first_step_node->AddAlternative(GuardedAlternative(captured_body));
       first_step_node->AddAlternative(GuardedAlternative(
-          new(zone) TextNode(new(zone) RegExpCharacterClass('*'), loop_node)));
+          new(isolate) TextNode(
+              new(isolate) RegExpCharacterClass('*'), loop_node)));
       node = first_step_node;
     } else {
       node = loop_node;
@@ -5365,74 +5046,124 @@
     }
   }
 
-  if (node == NULL) node = new(zone) EndNode(EndNode::BACKTRACK, zone);
+  if (node == NULL) node = new(isolate) EndNode(EndNode::BACKTRACK, isolate);
   data->node = node;
   Analysis analysis(ignore_case, is_one_byte);
   analysis.EnsureAnalyzed(node);
   if (analysis.has_failed()) {
     const char* error_message = analysis.error_message();
-    return CompilationResult(zone->isolate(), error_message);
+    return CompilationResult(error_message);
   }
 
-  // Create the correct assembler for the architecture.
-#ifndef V8_INTERPRETED_REGEXP
   // Native regexp implementation.
 
-  NativeRegExpMacroAssembler::Mode mode =
-      is_one_byte ? NativeRegExpMacroAssembler::LATIN1
-                  : NativeRegExpMacroAssembler::UC16;
-
-#if V8_TARGET_ARCH_IA32
-  RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
-#elif V8_TARGET_ARCH_X64
-  RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
-#elif V8_TARGET_ARCH_ARM
-  RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
-#elif V8_TARGET_ARCH_ARM64
-  RegExpMacroAssemblerARM64 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                            zone);
-#elif V8_TARGET_ARCH_MIPS
-  RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
-#elif V8_TARGET_ARCH_MIPS64
-  RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
-#elif V8_TARGET_ARCH_X87
-  RegExpMacroAssemblerX87 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
-#else
-#error "Unsupported architecture"
-#endif
-
-#else  // V8_INTERPRETED_REGEXP
-  // Interpreted regexp implementation.
-  EmbeddedVector<byte, 1024> codes;
-  RegExpMacroAssemblerIrregexp macro_assembler(codes, zone);
-#endif  // V8_INTERPRETED_REGEXP
+  IRRegExpMacroAssembler* macro_assembler =
+      new(isolate) IRRegExpMacroAssembler(specialization_cid,
+                                          data->capture_count,
+                                          parsed_function,
+                                          ic_data_array,
+                                          isolate);
 
   // Inserted here, instead of in Assembler, because it depends on information
   // in the AST that isn't replicated in the Node structure.
-  static const int kMaxBacksearchLimit = 1024;
+  static const intptr_t kMaxBacksearchLimit = 1024;
   if (is_end_anchored &&
       !is_start_anchored &&
       max_length < kMaxBacksearchLimit) {
-    macro_assembler.SetCurrentPositionFromEnd(max_length);
+    macro_assembler->SetCurrentPositionFromEnd(max_length);
   }
 
   if (is_global) {
-    macro_assembler.set_global_mode(
+    macro_assembler->set_global_mode(
         (data->tree->min_match() > 0)
             ? RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_CHECK
             : RegExpMacroAssembler::GLOBAL);
   }
 
-  return compiler.Assemble(&macro_assembler,
-                           node,
-                           data->capture_count,
-                           pattern);
+  RegExpEngine::CompilationResult result =
+      compiler.Assemble(macro_assembler,
+                        node,
+                        data->capture_count,
+                        pattern);
+
+  if (FLAG_trace_irregexp) {
+    macro_assembler->PrintBlocks();
+  }
+
+  return result;
 }
 
+
+static void CreateSpecializedFunction(Isolate* isolate,
+                                      const JSRegExp& regexp,
+                                      intptr_t specialization_cid,
+                                      const Object& owner) {
+  const intptr_t kParamCount = RegExpMacroAssembler::kParamCount;
+
+  Function& fn = Function::Handle(isolate, Function::New(
+      Symbols::IrregExp(),
+      RawFunction::kIrregexpFunction,
+      true,  // Static.
+      false,  // Not const.
+      false,  // Not abstract.
+      false,  // Not external.
+      false,  // Not native.
+      owner,
+      0));  // No token position.
+
+  // TODO(zerny): Share these arrays between all irregexp functions.
+  fn.set_num_fixed_parameters(kParamCount);
+  fn.set_parameter_types(Array::Handle(isolate, Array::New(kParamCount,
+                                                           Heap::kOld)));
+  fn.set_parameter_names(Array::Handle(isolate, Array::New(kParamCount,
+                                                           Heap::kOld)));
+  fn.SetParameterTypeAt(0, Type::Handle(isolate, Type::DynamicType()));
+  fn.SetParameterNameAt(0, Symbols::string_param());
+  fn.SetParameterTypeAt(1, Type::Handle(isolate, Type::DynamicType()));
+  fn.SetParameterNameAt(1, Symbols::start_index_param());
+  fn.set_result_type(Type::Handle(isolate, Type::ArrayType()));
+
+  // Cache the result.
+  regexp.set_function(specialization_cid, fn);
+
+  fn.set_regexp(regexp);
+  fn.set_regexp_cid(specialization_cid);
+
+  // The function is compiled lazily during the first call.
+}
+
+
+RawJSRegExp* RegExpEngine::CreateJSRegExp(Isolate* isolate,
+                                          const String& pattern,
+                                          bool multi_line,
+                                          bool ignore_case) {
+  const JSRegExp& regexp = JSRegExp::Handle(JSRegExp::New(0));
+
+  regexp.set_pattern(pattern);
+
+  if (multi_line) {
+    regexp.set_is_multi_line();
+  }
+  if (ignore_case) {
+    regexp.set_is_ignore_case();
+  }
+
+  // TODO(zerny): We might want to use normal string searching algorithms
+  // for simple patterns.
+  regexp.set_is_complex();
+  regexp.set_is_global();   // All dart regexps are global.
+
+  const Library& lib = Library::Handle(isolate, Library::CoreLibrary());
+  const Class& owner = Class::Handle(
+      isolate, lib.LookupClass(Symbols::RegExp()));
+
+  CreateSpecializedFunction(isolate, regexp, kOneByteStringCid, owner);
+  CreateSpecializedFunction(isolate, regexp, kTwoByteStringCid, owner);
+  CreateSpecializedFunction(isolate, regexp, kExternalOneByteStringCid, owner);
+  CreateSpecializedFunction(isolate, regexp, kExternalTwoByteStringCid, owner);
+
+  return regexp.raw();
+}
+
+
 }  // namespace dart
diff --git a/runtime/vm/regexp.h b/runtime/vm/regexp.h
index 921ec20..5e8ce22 100644
--- a/runtime/vm/regexp.h
+++ b/runtime/vm/regexp.h
@@ -5,7 +5,10 @@
 #ifndef VM_REGEXP_H_
 #define VM_REGEXP_H_
 
-// SNIP
+#include "vm/assembler.h"
+#include "vm/intermediate_language.h"
+#include "vm/object.h"
+#include "vm/regexp_assembler.h"
 
 namespace dart {
 
@@ -16,79 +19,71 @@
 class RegExpTree;
 class BoyerMooreLookahead;
 
-// Represents the location of one element relative to the intersection of
-// two sets. Corresponds to the four areas of a Venn diagram.
-enum ElementInSetsRelation {
-  kInsideNone = 0,
-  kInsideFirst = 1,
-  kInsideSecond = 2,
-  kInsideBoth = 3
-};
-
 
 // Represents code units in the range from from_ to to_, both ends are
 // inclusive.
 class CharacterRange {
  public:
   CharacterRange() : from_(0), to_(0) { }
-  // For compatibility with the CHECK_OK macro
-  CharacterRange(void* null) { DCHECK_EQ(NULL, null); }  //NOLINT
-  CharacterRange(uc16 from, uc16 to) : from_(from), to_(to) { }
-  static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges,
-                             Zone* zone);
-  static Vector<const int> GetWordBounds();
-  static inline CharacterRange Singleton(uc16 value) {
+  CharacterRange(uint16_t from, uint16_t to) : from_(from), to_(to) { }
+
+  static void AddClassEscape(uint16_t type,
+                             ZoneGrowableArray<CharacterRange>* ranges);
+  static GrowableArray<const intptr_t> GetWordBounds();
+  static inline CharacterRange Singleton(uint16_t value) {
     return CharacterRange(value, value);
   }
-  static inline CharacterRange Range(uc16 from, uc16 to) {
-    DCHECK(from <= to);
+  static inline CharacterRange Range(uint16_t from, uint16_t to) {
+    ASSERT(from <= to);
     return CharacterRange(from, to);
   }
   static inline CharacterRange Everything() {
     return CharacterRange(0, 0xFFFF);
   }
-  bool Contains(uc16 i) { return from_ <= i && i <= to_; }
-  uc16 from() const { return from_; }
-  void set_from(uc16 value) { from_ = value; }
-  uc16 to() const { return to_; }
-  void set_to(uc16 value) { to_ = value; }
-  bool is_valid() { return from_ <= to_; }
-  bool IsEverything(uc16 max) { return from_ == 0 && to_ >= max; }
-  bool IsSingleton() { return (from_ == to_); }
-  void AddCaseEquivalents(ZoneList<CharacterRange>* ranges, bool is_one_byte,
-                          Zone* zone);
-  static void Split(ZoneList<CharacterRange>* base,
-                    Vector<const int> overlay,
-                    ZoneList<CharacterRange>** included,
-                    ZoneList<CharacterRange>** excluded,
-                    Zone* zone);
+  bool Contains(uint16_t i) const { return from_ <= i && i <= to_; }
+  uint16_t from() const { return from_; }
+  void set_from(uint16_t value) { from_ = value; }
+  uint16_t to() const { return to_; }
+  void set_to(uint16_t value) { to_ = value; }
+  bool is_valid() const { return from_ <= to_; }
+  bool IsEverything(uint16_t max) const { return from_ == 0 && to_ >= max; }
+  bool IsSingleton() const { return (from_ == to_); }
+  void AddCaseEquivalents(ZoneGrowableArray<CharacterRange>* ranges,
+                          bool is_one_byte,
+                          Isolate* isolate);
+  static void Split(ZoneGrowableArray<CharacterRange>* base,
+                    GrowableArray<const intptr_t> overlay,
+                    ZoneGrowableArray<CharacterRange>** included,
+                    ZoneGrowableArray<CharacterRange>** excluded,
+                    Isolate* isolate);
   // Whether a range list is in canonical form: Ranges ordered by from value,
   // and ranges non-overlapping and non-adjacent.
-  static bool IsCanonical(ZoneList<CharacterRange>* ranges);
+  static bool IsCanonical(ZoneGrowableArray<CharacterRange>* ranges);
   // Convert range list to canonical form. The characters covered by the ranges
   // will still be the same, but no character is in more than one range, and
   // adjacent ranges are merged. The resulting list may be shorter than the
   // original, but cannot be longer.
-  static void Canonicalize(ZoneList<CharacterRange>* ranges);
+  static void Canonicalize(ZoneGrowableArray<CharacterRange>* ranges);
   // Negate the contents of a character range in canonical form.
-  static void Negate(ZoneList<CharacterRange>* src,
-                     ZoneList<CharacterRange>* dst,
-                     Zone* zone);
-  static const int kStartMarker = (1 << 24);
-  static const int kPayloadMask = (1 << 24) - 1;
+  static void Negate(ZoneGrowableArray<CharacterRange>* src,
+                     ZoneGrowableArray<CharacterRange>* dst);
+  static const intptr_t kStartMarker = (1 << 24);
+  static const intptr_t kPayloadMask = (1 << 24) - 1;
 
  private:
-  uc16 from_;
-  uc16 to_;
+  uint16_t from_;
+  uint16_t to_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
 // A set of unsigned integers that behaves especially well on small
 // integers (< 32).  May do zone-allocation.
-class OutSet: public ZoneObject {
+class OutSet: public ZoneAllocated {
  public:
   OutSet() : first_(0), remaining_(NULL), successors_(NULL) { }
-  OutSet* Extend(unsigned value, Zone* zone);
+  OutSet* Extend(unsigned value, Isolate* isolate);
   bool Get(unsigned value) const;
   static const unsigned kFirstLimit = 32;
 
@@ -96,81 +91,22 @@
   // Destructively set a value in this set.  In most cases you want
   // to use Extend instead to ensure that only one instance exists
   // that contains the same values.
-  void Set(unsigned value, Zone* zone);
+  void Set(unsigned value, Isolate* isolate);
 
   // The successors are a list of sets that contain the same values
   // as this set and the one more value that is not present in this
   // set.
-  ZoneList<OutSet*>* successors(Zone* zone) { return successors_; }
+  ZoneGrowableArray<OutSet*>* successors() { return successors_; }
 
-  OutSet(uint32_t first, ZoneList<unsigned>* remaining)
+  OutSet(uint32_t first, ZoneGrowableArray<unsigned>* remaining)
       : first_(first), remaining_(remaining), successors_(NULL) { }
   uint32_t first_;
-  ZoneList<unsigned>* remaining_;
-  ZoneList<OutSet*>* successors_;
+  ZoneGrowableArray<unsigned>* remaining_;
+  ZoneGrowableArray<OutSet*>* successors_;
   friend class Trace;
 };
 
 
-// A mapping from integers, specified as ranges, to a set of integers.
-// Used for mapping character ranges to choices.
-class DispatchTable : public ZoneObject {
- public:
-  explicit DispatchTable(Zone* zone) : tree_(zone) { }
-
-  class Entry {
-   public:
-    Entry() : from_(0), to_(0), out_set_(NULL) { }
-    Entry(uc16 from, uc16 to, OutSet* out_set)
-        : from_(from), to_(to), out_set_(out_set) { }
-    uc16 from() { return from_; }
-    uc16 to() { return to_; }
-    void set_to(uc16 value) { to_ = value; }
-    void AddValue(int value, Zone* zone) {
-      out_set_ = out_set_->Extend(value, zone);
-    }
-    OutSet* out_set() { return out_set_; }
-   private:
-    uc16 from_;
-    uc16 to_;
-    OutSet* out_set_;
-  };
-
-  class Config {
-   public:
-    typedef uc16 Key;
-    typedef Entry Value;
-    static const uc16 kNoKey;
-    static const Entry NoValue() { return Value(); }
-    static inline int Compare(uc16 a, uc16 b) {
-      if (a == b)
-        return 0;
-      else if (a < b)
-        return -1;
-      else
-        return 1;
-    }
-  };
-
-  void AddRange(CharacterRange range, int value, Zone* zone);
-  OutSet* Get(uc16 value);
-  void Dump();
-
-  template <typename Callback>
-  void ForEach(Callback* callback) {
-    return tree()->ForEach(callback);
-  }
-
- private:
-  // There can't be a static empty set since it allocates its
-  // successors in a zone and caches them.
-  OutSet* empty() { return &empty_; }
-  OutSet empty_;
-  ZoneSplayTree<Config>* tree() { return &tree_; }
-  ZoneSplayTree<Config> tree_;
-};
-
-
 #define FOR_EACH_NODE_TYPE(VISIT)                                    \
   VISIT(End)                                                         \
   VISIT(Action)                                                      \
@@ -199,7 +135,7 @@
 #undef FORWARD_DECLARE
 
 
-class TextElement FINAL BASE_EMBEDDED {
+class TextElement {
  public:
   enum TextType {
     ATOM,
@@ -209,21 +145,21 @@
   static TextElement Atom(RegExpAtom* atom);
   static TextElement CharClass(RegExpCharacterClass* char_class);
 
-  int cp_offset() const { return cp_offset_; }
-  void set_cp_offset(int cp_offset) { cp_offset_ = cp_offset; }
-  int length() const;
+  intptr_t cp_offset() const { return cp_offset_; }
+  void set_cp_offset(intptr_t cp_offset) { cp_offset_ = cp_offset; }
+  intptr_t length() const;
 
   TextType text_type() const { return text_type_; }
 
   RegExpTree* tree() const { return tree_; }
 
   RegExpAtom* atom() const {
-    DCHECK(text_type() == ATOM);
+    ASSERT(text_type() == ATOM);
     return reinterpret_cast<RegExpAtom*>(tree());
   }
 
   RegExpCharacterClass* char_class() const {
-    DCHECK(text_type() == CHAR_CLASS);
+    ASSERT(text_type() == CHAR_CLASS);
     return reinterpret_cast<RegExpCharacterClass*>(tree());
   }
 
@@ -231,9 +167,11 @@
   TextElement(TextType text_type, RegExpTree* tree)
       : cp_offset_(-1), text_type_(text_type), tree_(tree) {}
 
-  int cp_offset_;
+  intptr_t cp_offset_;
   TextType text_type_;
   RegExpTree* tree_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
@@ -314,30 +252,30 @@
         mask_(0),
         value_(0),
         cannot_match_(false) { }
-  explicit QuickCheckDetails(int characters)
+  explicit QuickCheckDetails(intptr_t characters)
       : characters_(characters),
         mask_(0),
         value_(0),
         cannot_match_(false) { }
   bool Rationalize(bool one_byte);
   // Merge in the information from another branch of an alternation.
-  void Merge(QuickCheckDetails* other, int from_index);
+  void Merge(QuickCheckDetails* other, intptr_t from_index);
   // Advance the current position by some amount.
-  void Advance(int by, bool one_byte);
+  void Advance(intptr_t by, bool one_byte);
   void Clear();
   bool cannot_match() { return cannot_match_; }
   void set_cannot_match() { cannot_match_ = true; }
   struct Position {
     Position() : mask(0), value(0), determines_perfectly(false) { }
-    uc16 mask;
-    uc16 value;
+    uint16_t mask;
+    uint16_t value;
     bool determines_perfectly;
   };
-  int characters() { return characters_; }
-  void set_characters(int characters) { characters_ = characters; }
-  Position* positions(int index) {
-    DCHECK(index >= 0);
-    DCHECK(index < characters_);
+  intptr_t characters() { return characters_; }
+  void set_characters(intptr_t characters) { characters_ = characters; }
+  Position* positions(intptr_t index) {
+    ASSERT(index >= 0);
+    ASSERT(index < characters_);
     return positions_ + index;
   }
   uint32_t mask() { return mask_; }
@@ -346,7 +284,7 @@
  private:
   // How many characters do we have quick check information from.  This is
   // the same for all branches of a choice node.
-  int characters_;
+  intptr_t characters_;
   Position positions_[4];
   // These values are the condensate of the above array after Rationalize().
   uint32_t mask_;
@@ -354,16 +292,15 @@
   // If set to true, there is no way this quick check can match at all.
   // E.g., if it requires to be at the start of the input, and isn't.
   bool cannot_match_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
-extern int kUninitializedRegExpNodePlaceHolder;
-
-
-class RegExpNode: public ZoneObject {
+class RegExpNode: public ZoneAllocated {
  public:
-  explicit RegExpNode(Zone* zone)
-  : replacement_(NULL), trace_count_(0), zone_(zone) {
+  explicit RegExpNode(Isolate* isolate)
+  : replacement_(NULL), trace_count_(0), isolate_(isolate) {
     bm_info_[0] = bm_info_[1] = NULL;
   }
   virtual ~RegExpNode();
@@ -377,7 +314,8 @@
   // used to indicate that we know we are not at the start of the input.  In
   // this case anchored branches will always fail and can be ignored when
   // determining how many characters are consumed on success.
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start) = 0;
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start) = 0;
   // Emits some quick code that checks whether the preloaded characters match.
   // Falls through on certain failure, jumps to the label on possible success.
   // If the node cannot make a quick check it does nothing and returns false.
@@ -385,7 +323,7 @@
                       Trace* bounds_check_trace,
                       Trace* trace,
                       bool preload_has_checked_bounds,
-                      Label* on_possible_success,
+                      BlockLabel* on_possible_success,
                       QuickCheckDetails* details_return,
                       bool fall_through_on_failure);
   // For a given number of characters this returns a mask and a value.  The
@@ -394,10 +332,12 @@
   // A comparison success indicates the node may match.
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start) = 0;
-  static const int kNodeIsTooComplexForGreedyLoops = -1;
-  virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
+  static const intptr_t kNodeIsTooComplexForGreedyLoops = -1;
+  virtual intptr_t GreedyLoopTextLength() {
+    return kNodeIsTooComplexForGreedyLoops;
+  }
   // Only returns the successor for a text node of length 1 that matches any
   // character and that has no guards on it.
   virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
@@ -410,9 +350,9 @@
   // implementation.  TODO(erikcorry):  This should share more code with
   // EatsAtLeast, GetQuickCheckDetails.  The budget argument is used to limit
   // the number of nodes we are willing to look at in order to create this data.
-  static const int kRecursionBudget = 200;
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  static const intptr_t kRecursionBudget = 200;
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
     UNREACHABLE();
@@ -421,12 +361,12 @@
   // If we know that the input is one-byte then there are some nodes that can
   // never match.  This method returns a node that can be substituted for
   // itself, or NULL if the node can never match.
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case) {
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case) {
     return this;
   }
   // Helper for FilterOneByte.
   RegExpNode* replacement() {
-    DCHECK(info()->replacement_calculated);
+    ASSERT(info()->replacement_calculated);
     return replacement_;
   }
   RegExpNode* set_replacement(RegExpNode* replacement) {
@@ -439,17 +379,17 @@
   // node.  Only info that is for this node is stored.  We can tell that the
   // info is for this node when offset == 0, so the information is calculated
   // relative to this node.
-  void SaveBMInfo(BoyerMooreLookahead* bm, bool not_at_start, int offset) {
+  void SaveBMInfo(BoyerMooreLookahead* bm, bool not_at_start, intptr_t offset) {
     if (offset == 0) set_bm_info(not_at_start, bm);
   }
 
-  Label* label() { return &label_; }
+  BlockLabel* label() { return &label_; }
   // If non-generic code is generated for a node (i.e. the node is not at the
   // start of the trace) then it cannot be reused.  This variable sets a limit
   // on how often we allow that to happen before we insist on starting a new
   // trace and generating generic code for a node that can be reused by flushing
   // the deferred actions in the current trace and generating a goto.
-  static const int kMaxCopiesCodeGenerated = 10;
+  static const intptr_t kMaxCopiesCodeGenerated = 10;
 
   NodeInfo* info() { return &info_; }
 
@@ -457,7 +397,7 @@
     return bm_info_[not_at_start ? 1 : 0];
   }
 
-  Zone* zone() const { return zone_; }
+  Isolate* isolate() const { return isolate_; }
 
  protected:
   enum LimitResult { DONE, CONTINUE };
@@ -470,18 +410,17 @@
   }
 
  private:
-  static const int kFirstCharBudget = 10;
-  Label label_;
+  static const intptr_t kFirstCharBudget = 10;
+  BlockLabel label_;
   NodeInfo info_;
   // This variable keeps track of how many times code has been generated for
   // this node (in different traces).  We don't keep track of where the
   // generated code is located unless the code is generated at the start of
   // a trace, in which case it is generic and can be reused by flushing the
   // deferred operations in the current trace and generating a goto.
-  int trace_count_;
+  intptr_t trace_count_;
   BoyerMooreLookahead* bm_info_[2];
-
-  Zone* zone_;
+  Isolate* isolate_;
 };
 
 
@@ -489,38 +428,43 @@
 class Interval {
  public:
   Interval() : from_(kNone), to_(kNone) { }
-  Interval(int from, int to) : from_(from), to_(to) { }
+  Interval(intptr_t from, intptr_t to) : from_(from), to_(to) { }
+
   Interval Union(Interval that) {
     if (that.from_ == kNone)
       return *this;
     else if (from_ == kNone)
       return that;
     else
-      return Interval(Min(from_, that.from_), Max(to_, that.to_));
+      return Interval(Utils::Minimum(from_, that.from_),
+                      Utils::Maximum(to_, that.to_));
   }
-  bool Contains(int value) {
+  bool Contains(intptr_t value) const {
     return (from_ <= value) && (value <= to_);
   }
-  bool is_empty() { return from_ == kNone; }
-  int from() const { return from_; }
-  int to() const { return to_; }
+  bool is_empty() const { return from_ == kNone; }
+  intptr_t from() const { return from_; }
+  intptr_t to() const { return to_; }
   static Interval Empty() { return Interval(); }
-  static const int kNone = -1;
+  static const intptr_t kNone = -1;
+
  private:
-  int from_;
-  int to_;
+  intptr_t from_;
+  intptr_t to_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
 class SeqRegExpNode: public RegExpNode {
  public:
   explicit SeqRegExpNode(RegExpNode* on_success)
-      : RegExpNode(on_success->zone()), on_success_(on_success) { }
+      : RegExpNode(on_success->isolate()), on_success_(on_success) { }
   RegExpNode* on_success() { return on_success_; }
   void set_on_success(RegExpNode* node) { on_success_ = node; }
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
     on_success_->FillInBMInfo(offset, budget - 1, bm, not_at_start);
@@ -528,7 +472,7 @@
   }
 
  protected:
-  RegExpNode* FilterSuccessor(int depth, bool ignore_case);
+  RegExpNode* FilterSuccessor(intptr_t depth, bool ignore_case);
 
  private:
   RegExpNode* on_success_;
@@ -546,69 +490,73 @@
     EMPTY_MATCH_CHECK,
     CLEAR_CAPTURES
   };
-  static ActionNode* SetRegister(int reg, int val, RegExpNode* on_success);
-  static ActionNode* IncrementRegister(int reg, RegExpNode* on_success);
-  static ActionNode* StorePosition(int reg,
+  static ActionNode* SetRegister(intptr_t reg, intptr_t val,
+                                 RegExpNode* on_success);
+  static ActionNode* IncrementRegister(intptr_t reg, RegExpNode* on_success);
+  static ActionNode* StorePosition(intptr_t reg,
                                    bool is_capture,
                                    RegExpNode* on_success);
   static ActionNode* ClearCaptures(Interval range, RegExpNode* on_success);
-  static ActionNode* BeginSubmatch(int stack_pointer_reg,
-                                   int position_reg,
+  static ActionNode* BeginSubmatch(intptr_t stack_pointer_reg,
+                                   intptr_t position_reg,
                                    RegExpNode* on_success);
-  static ActionNode* PositiveSubmatchSuccess(int stack_pointer_reg,
-                                             int restore_reg,
-                                             int clear_capture_count,
-                                             int clear_capture_from,
+  static ActionNode* PositiveSubmatchSuccess(intptr_t stack_pointer_reg,
+                                             intptr_t restore_reg,
+                                             intptr_t clear_capture_count,
+                                             intptr_t clear_capture_from,
                                              RegExpNode* on_success);
-  static ActionNode* EmptyMatchCheck(int start_register,
-                                     int repetition_register,
-                                     int repetition_limit,
+  static ActionNode* EmptyMatchCheck(intptr_t start_register,
+                                     intptr_t repetition_register,
+                                     intptr_t repetition_limit,
                                      RegExpNode* on_success);
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int filled_in,
+                                    intptr_t filled_in,
                                     bool not_at_start) {
     return on_success()->GetQuickCheckDetails(
         details, compiler, filled_in, not_at_start);
   }
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
   ActionType action_type() { return action_type_; }
   // TODO(erikcorry): We should allow some action nodes in greedy loops.
-  virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
+  virtual intptr_t GreedyLoopTextLength() {
+    return kNodeIsTooComplexForGreedyLoops;
+  }
 
  private:
   union {
     struct {
-      int reg;
-      int value;
+      intptr_t reg;
+      intptr_t value;
     } u_store_register;
     struct {
-      int reg;
+      intptr_t reg;
     } u_increment_register;
     struct {
-      int reg;
+      intptr_t reg;
       bool is_capture;
     } u_position_register;
     struct {
-      int stack_pointer_register;
-      int current_position_register;
-      int clear_register_count;
-      int clear_register_from;
+      intptr_t stack_pointer_register;
+      intptr_t current_position_register;
+      intptr_t clear_register_count;
+      intptr_t clear_register_from;
     } u_submatch;
     struct {
-      int start_register;
-      int repetition_register;
-      int repetition_limit;
+      intptr_t start_register;
+      intptr_t repetition_register;
+      intptr_t repetition_limit;
     } u_empty_match_check;
     struct {
-      int range_from;
-      int range_to;
+      intptr_t range_from;
+      intptr_t range_to;
     } u_clear_captures;
   } data_;
   ActionNode(ActionType action_type, RegExpNode* on_success)
@@ -621,34 +569,35 @@
 
 class TextNode: public SeqRegExpNode {
  public:
-  TextNode(ZoneList<TextElement>* elms,
+  TextNode(ZoneGrowableArray<TextElement>* elms,
            RegExpNode* on_success)
       : SeqRegExpNode(on_success),
         elms_(elms) { }
   TextNode(RegExpCharacterClass* that,
            RegExpNode* on_success)
       : SeqRegExpNode(on_success),
-        elms_(new(zone()) ZoneList<TextElement>(1, zone())) {
-    elms_->Add(TextElement::CharClass(that), zone());
+        elms_(new(isolate()) ZoneGrowableArray<TextElement>(1)) {
+    elms_->Add(TextElement::CharClass(that));
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start);
-  ZoneList<TextElement>* elements() { return elms_; }
+  ZoneGrowableArray<TextElement>* elements() { return elms_; }
   void MakeCaseIndependent(bool is_one_byte);
-  virtual int GreedyLoopTextLength();
+  virtual intptr_t GreedyLoopTextLength();
   virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
       RegExpCompiler* compiler);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
   void CalculateOffsets();
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
 
  private:
   enum TextEmitPassType {
@@ -658,17 +607,17 @@
     CASE_CHARACTER_MATCH,        // Case-independent single character check.
     CHARACTER_CLASS_MATCH        // Character class.
   };
-  static bool SkipPass(int pass, bool ignore_case);
-  static const int kFirstRealPass = SIMPLE_CHARACTER_MATCH;
-  static const int kLastPass = CHARACTER_CLASS_MATCH;
+  static bool SkipPass(intptr_t pass, bool ignore_case);
+  static const intptr_t kFirstRealPass = SIMPLE_CHARACTER_MATCH;
+  static const intptr_t kLastPass = CHARACTER_CLASS_MATCH;
   void TextEmitPass(RegExpCompiler* compiler,
                     TextEmitPassType pass,
                     bool preloaded,
                     Trace* trace,
                     bool first_element_checked,
-                    int* checked_up_to);
-  int Length();
-  ZoneList<TextElement>* elms_;
+                    intptr_t* checked_up_to);
+  intptr_t Length();
+  ZoneGrowableArray<TextElement>* elms_;
 };
 
 
@@ -682,29 +631,31 @@
     AFTER_NEWLINE
   };
   static AssertionNode* AtEnd(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_END, on_success);
+    return new(on_success->isolate()) AssertionNode(AT_END, on_success);
   }
   static AssertionNode* AtStart(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_START, on_success);
+    return new(on_success->isolate()) AssertionNode(AT_START, on_success);
   }
   static AssertionNode* AtBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_BOUNDARY, on_success);
+    return new(on_success->isolate()) AssertionNode(AT_BOUNDARY, on_success);
   }
   static AssertionNode* AtNonBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_NON_BOUNDARY, on_success);
+    return new(on_success->isolate()) AssertionNode(AT_NON_BOUNDARY,
+                                                    on_success);
   }
   static AssertionNode* AfterNewline(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AFTER_NEWLINE, on_success);
+    return new(on_success->isolate()) AssertionNode(AFTER_NEWLINE, on_success);
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int filled_in,
+                                    intptr_t filled_in,
                                     bool not_at_start);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
   AssertionType assertion_type() { return assertion_type_; }
@@ -723,55 +674,55 @@
 
 class BackReferenceNode: public SeqRegExpNode {
  public:
-  BackReferenceNode(int start_reg,
-                    int end_reg,
+  BackReferenceNode(intptr_t start_reg,
+                    intptr_t end_reg,
                     RegExpNode* on_success)
       : SeqRegExpNode(on_success),
         start_reg_(start_reg),
         end_reg_(end_reg) { }
   virtual void Accept(NodeVisitor* visitor);
-  int start_register() { return start_reg_; }
-  int end_register() { return end_reg_; }
+  intptr_t start_register() { return start_reg_; }
+  intptr_t end_register() { return end_reg_; }
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,
-                          int recursion_depth,
-                          bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                               intptr_t recursion_depth,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start) {
     return;
   }
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
 
  private:
-  int start_reg_;
-  int end_reg_;
+  intptr_t start_reg_;
+  intptr_t end_reg_;
 };
 
 
 class EndNode: public RegExpNode {
  public:
   enum Action { ACCEPT, BACKTRACK, NEGATIVE_SUBMATCH_SUCCESS };
-  explicit EndNode(Action action, Zone* zone)
-      : RegExpNode(zone), action_(action) { }
+  explicit EndNode(Action action, Isolate* isolate)
+      : RegExpNode(isolate), action_(action) { }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,
-                          int recursion_depth,
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,
+                          intptr_t recursion_depth,
                           bool not_at_start) { return 0; }
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start) {
     // Returning 0 from EatsAtLeast should ensure we never get here.
     UNREACHABLE();
   }
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
     // Returning 0 from EatsAtLeast should ensure we never get here.
@@ -785,12 +736,12 @@
 
 class NegativeSubmatchSuccess: public EndNode {
  public:
-  NegativeSubmatchSuccess(int stack_pointer_reg,
-                          int position_reg,
-                          int clear_capture_count,
-                          int clear_capture_start,
-                          Zone* zone)
-      : EndNode(NEGATIVE_SUBMATCH_SUCCESS, zone),
+  NegativeSubmatchSuccess(intptr_t stack_pointer_reg,
+                          intptr_t position_reg,
+                          intptr_t clear_capture_count,
+                          intptr_t clear_capture_start,
+                          Isolate* isolate)
+      : EndNode(NEGATIVE_SUBMATCH_SUCCESS, isolate),
         stack_pointer_register_(stack_pointer_reg),
         current_position_register_(position_reg),
         clear_capture_count_(clear_capture_count),
@@ -798,75 +749,78 @@
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
 
  private:
-  int stack_pointer_register_;
-  int current_position_register_;
-  int clear_capture_count_;
-  int clear_capture_start_;
+  intptr_t stack_pointer_register_;
+  intptr_t current_position_register_;
+  intptr_t clear_capture_count_;
+  intptr_t clear_capture_start_;
 };
 
 
-class Guard: public ZoneObject {
+class Guard: public ZoneAllocated {
  public:
   enum Relation { LT, GEQ };
-  Guard(int reg, Relation op, int value)
+  Guard(intptr_t reg, Relation op, intptr_t value)
       : reg_(reg),
         op_(op),
         value_(value) { }
-  int reg() { return reg_; }
+  intptr_t reg() { return reg_; }
   Relation op() { return op_; }
-  int value() { return value_; }
+  intptr_t value() { return value_; }
 
  private:
-  int reg_;
+  intptr_t reg_;
   Relation op_;
-  int value_;
+  intptr_t value_;
 };
 
 
 class GuardedAlternative {
  public:
   explicit GuardedAlternative(RegExpNode* node) : node_(node), guards_(NULL) { }
-  void AddGuard(Guard* guard, Zone* zone);
+  void AddGuard(Guard* guard, Isolate* isolate);
   RegExpNode* node() { return node_; }
   void set_node(RegExpNode* node) { node_ = node; }
-  ZoneList<Guard*>* guards() { return guards_; }
+  ZoneGrowableArray<Guard*>* guards() { return guards_; }
 
  private:
   RegExpNode* node_;
-  ZoneList<Guard*>* guards_;
+  ZoneGrowableArray<Guard*>* guards_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
-class AlternativeGeneration;
+struct AlternativeGeneration;
 
 
 class ChoiceNode: public RegExpNode {
  public:
-  explicit ChoiceNode(int expected_size, Zone* zone)
-      : RegExpNode(zone),
-        alternatives_(new(zone)
-                      ZoneList<GuardedAlternative>(expected_size, zone)),
-        table_(NULL),
+  explicit ChoiceNode(intptr_t expected_size, Isolate* isolate)
+      : RegExpNode(isolate),
+        alternatives_(new(isolate)
+                      ZoneGrowableArray<GuardedAlternative>(expected_size)),
         not_at_start_(false),
         being_calculated_(false) { }
   virtual void Accept(NodeVisitor* visitor);
   void AddAlternative(GuardedAlternative node) {
-    alternatives()->Add(node, zone());
+    alternatives()->Add(node);
   }
-  ZoneList<GuardedAlternative>* alternatives() { return alternatives_; }
-  DispatchTable* GetTable(bool ignore_case);
+  ZoneGrowableArray<GuardedAlternative>* alternatives() {
+    return alternatives_;
+  }
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  int EatsAtLeastHelper(int still_to_find,
-                        int budget,
-                        RegExpNode* ignore_this_node,
-                        bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start);
+  intptr_t EatsAtLeastHelper(intptr_t still_to_find,
+                             intptr_t budget,
+                             RegExpNode* ignore_this_node,
+                             bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
 
@@ -877,42 +831,42 @@
   virtual bool try_to_emit_quick_check_for_alternative(bool is_first) {
     return true;
   }
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
 
  protected:
-  int GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
-  ZoneList<GuardedAlternative>* alternatives_;
+  intptr_t GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
+  ZoneGrowableArray<GuardedAlternative>* alternatives_;
 
  private:
-  friend class DispatchTableConstructor;
   friend class Analysis;
   void GenerateGuard(RegExpMacroAssembler* macro_assembler,
                      Guard* guard,
                      Trace* trace);
-  int CalculatePreloadCharacters(RegExpCompiler* compiler, int eats_at_least);
+  intptr_t CalculatePreloadCharacters(RegExpCompiler* compiler,
+                                      intptr_t eats_at_least);
   void EmitOutOfLineContinuation(RegExpCompiler* compiler,
                                  Trace* trace,
                                  GuardedAlternative alternative,
                                  AlternativeGeneration* alt_gen,
-                                 int preload_characters,
+                                 intptr_t preload_characters,
                                  bool next_expects_preload);
   void SetUpPreLoad(RegExpCompiler* compiler,
                     Trace* current_trace,
                     PreloadState* preloads);
   void AssertGuardsMentionRegisters(Trace* trace);
-  int EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler, Trace* trace);
+  intptr_t EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler,
+                                         Trace* trace);
   Trace* EmitGreedyLoop(RegExpCompiler* compiler,
                         Trace* trace,
                         AlternativeGenerationList* alt_gens,
                         PreloadState* preloads,
                         GreedyLoopState* greedy_loop_state,
-                        int text_length);
+                        intptr_t text_length);
   void EmitChoices(RegExpCompiler* compiler,
                    AlternativeGenerationList* alt_gens,
-                   int first_choice,
+                   intptr_t first_choice,
                    Trace* trace,
                    PreloadState* preloads);
-  DispatchTable* table_;
   // If true, this node is never checked at the start of the input.
   // Allows a new trace to start with at_start() set to false.
   bool not_at_start_;
@@ -924,21 +878,22 @@
  public:
   explicit NegativeLookaheadChoiceNode(GuardedAlternative this_must_fail,
                                        GuardedAlternative then_do_this,
-                                       Zone* zone)
-      : ChoiceNode(2, zone) {
+                                       Isolate* isolate)
+      : ChoiceNode(2, isolate) {
     AddAlternative(this_must_fail);
     AddAlternative(then_do_this);
   }
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find, intptr_t budget,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start) {
-    alternatives_->at(1).node()->FillInBMInfo(
+    (*alternatives_)[1].node()->FillInBMInfo(
         offset, budget - 1, bm, not_at_start);
     if (offset == 0) set_bm_info(not_at_start, bm);
   }
@@ -950,35 +905,35 @@
   virtual bool try_to_emit_quick_check_for_alternative(bool is_first) {
     return !is_first;
   }
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
 };
 
 
 class LoopChoiceNode: public ChoiceNode {
  public:
-  explicit LoopChoiceNode(bool body_can_be_zero_length, Zone* zone)
-      : ChoiceNode(2, zone),
+  explicit LoopChoiceNode(bool body_can_be_zero_length, Isolate* isolate)
+      : ChoiceNode(2, isolate),
         loop_node_(NULL),
         continue_node_(NULL),
-        body_can_be_zero_length_(body_can_be_zero_length)
-        { }
+        body_can_be_zero_length_(body_can_be_zero_length) { }
   void AddLoopAlternative(GuardedAlternative alt);
   void AddContinueAlternative(GuardedAlternative alt);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,  int budget, bool not_at_start);
+  virtual intptr_t EatsAtLeast(intptr_t still_to_find,  intptr_t budget,
+                               bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
-                                    int characters_filled_in,
+                                    intptr_t characters_filled_in,
                                     bool not_at_start);
-  virtual void FillInBMInfo(int offset,
-                            int budget,
+  virtual void FillInBMInfo(intptr_t offset,
+                            intptr_t budget,
                             BoyerMooreLookahead* bm,
                             bool not_at_start);
   RegExpNode* loop_node() { return loop_node_; }
   RegExpNode* continue_node() { return continue_node_; }
   bool body_can_be_zero_length() { return body_can_be_zero_length_; }
   virtual void Accept(NodeVisitor* visitor);
-  virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
+  virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
 
  private:
   // AddAlternative is made private for loop nodes because alternatives
@@ -1033,41 +988,41 @@
 
 
 ContainedInLattice AddRange(ContainedInLattice a,
-                            const int* ranges,
-                            int ranges_size,
+                            const intptr_t* ranges,
+                            intptr_t ranges_size,
                             Interval new_range);
 
 
-class BoyerMoorePositionInfo : public ZoneObject {
+class BoyerMoorePositionInfo : public ZoneAllocated {
  public:
-  explicit BoyerMoorePositionInfo(Zone* zone)
-      : map_(new(zone) ZoneList<bool>(kMapSize, zone)),
+  explicit BoyerMoorePositionInfo(Isolate* isolate)
+      : map_(new(isolate) ZoneGrowableArray<bool>(kMapSize)),
         map_count_(0),
         w_(kNotYet),
         s_(kNotYet),
         d_(kNotYet),
         surrogate_(kNotYet) {
-     for (int i = 0; i < kMapSize; i++) {
-       map_->Add(false, zone);
+     for (intptr_t i = 0; i < kMapSize; i++) {
+       map_->Add(false);
      }
   }
 
-  bool& at(int i) { return map_->at(i); }
+  bool& at(intptr_t i) { return (*map_)[i]; }
 
-  static const int kMapSize = 128;
-  static const int kMask = kMapSize - 1;
+  static const intptr_t kMapSize = 128;
+  static const intptr_t kMask = kMapSize - 1;
 
-  int map_count() const { return map_count_; }
+  intptr_t map_count() const { return map_count_; }
 
-  void Set(int character);
+  void Set(intptr_t character);
   void SetInterval(const Interval& interval);
   void SetAll();
   bool is_non_word() { return w_ == kLatticeOut; }
   bool is_word() { return w_ == kLatticeIn; }
 
  private:
-  ZoneList<bool>* map_;
-  int map_count_;  // Number of set bits in the map.
+  ZoneGrowableArray<bool>* map_;
+  intptr_t map_count_;  // Number of set bits in the map.
   ContainedInLattice w_;  // The \w character class.
   ContainedInLattice s_;  // The \s character class.
   ContainedInLattice d_;  // The \d character class.
@@ -1075,29 +1030,30 @@
 };
 
 
-class BoyerMooreLookahead : public ZoneObject {
+class BoyerMooreLookahead : public ZoneAllocated{
  public:
-  BoyerMooreLookahead(int length, RegExpCompiler* compiler, Zone* zone);
+  BoyerMooreLookahead(intptr_t length, RegExpCompiler* compiler,
+                      Isolate* Isolate);
 
-  int length() { return length_; }
-  int max_char() { return max_char_; }
+  intptr_t length() { return length_; }
+  intptr_t max_char() { return max_char_; }
   RegExpCompiler* compiler() { return compiler_; }
 
-  int Count(int map_number) {
-    return bitmaps_->at(map_number)->map_count();
+  intptr_t Count(intptr_t map_number) {
+    return bitmaps_->At(map_number)->map_count();
   }
 
-  BoyerMoorePositionInfo* at(int i) { return bitmaps_->at(i); }
+  BoyerMoorePositionInfo* at(intptr_t i) { return bitmaps_->At(i); }
 
-  void Set(int map_number, int character) {
+  void Set(intptr_t map_number, intptr_t character) {
     if (character > max_char_) return;
-    BoyerMoorePositionInfo* info = bitmaps_->at(map_number);
+    BoyerMoorePositionInfo* info = bitmaps_->At(map_number);
     info->Set(character);
   }
 
-  void SetInterval(int map_number, const Interval& interval) {
+  void SetInterval(intptr_t map_number, const Interval& interval) {
     if (interval.from() > max_char_) return;
-    BoyerMoorePositionInfo* info = bitmaps_->at(map_number);
+    BoyerMoorePositionInfo* info = bitmaps_->At(map_number);
     if (interval.to() > max_char_) {
       info->SetInterval(Interval(interval.from(), max_char_));
     } else {
@@ -1105,12 +1061,12 @@
     }
   }
 
-  void SetAll(int map_number) {
-    bitmaps_->at(map_number)->SetAll();
+  void SetAll(intptr_t map_number) {
+    bitmaps_->At(map_number)->SetAll();
   }
 
-  void SetRest(int from_map) {
-    for (int i = from_map; i < length_; i++) SetAll(i);
+  void SetRest(intptr_t from_map) {
+    for (intptr_t i = from_map; i < length_; i++) SetAll(i);
   }
   void EmitSkipInstructions(RegExpMacroAssembler* masm);
 
@@ -1119,18 +1075,20 @@
   // many characters left in the sample string then the match is bound to fail.
   // Therefore it is OK to read a character this far ahead of the current match
   // point.
-  int length_;
+  intptr_t length_;
   RegExpCompiler* compiler_;
   // 0xff for Latin1, 0xffff for UTF-16.
-  int max_char_;
-  ZoneList<BoyerMoorePositionInfo*>* bitmaps_;
+  intptr_t max_char_;
+  ZoneGrowableArray<BoyerMoorePositionInfo*>* bitmaps_;
 
-  int GetSkipTable(int min_lookahead,
-                   int max_lookahead,
-                   Handle<ByteArray> boolean_skip_table);
-  bool FindWorthwhileInterval(int* from, int* to);
-  int FindBestInterval(
-    int max_number_of_chars, int old_biggest_points, int* from, int* to);
+  intptr_t GetSkipTable(intptr_t min_lookahead,
+                        intptr_t max_lookahead,
+                        const TypedData& boolean_skip_table);
+  bool FindWorthwhileInterval(intptr_t* from, intptr_t* to);
+  intptr_t FindBestInterval(
+      intptr_t max_number_of_chars,
+      intptr_t old_biggest_points,
+      intptr_t* from, intptr_t* to);
 };
 
 
@@ -1155,41 +1113,43 @@
 
   class DeferredAction {
    public:
-    DeferredAction(ActionNode::ActionType action_type, int reg)
+    DeferredAction(ActionNode::ActionType action_type, intptr_t reg)
         : action_type_(action_type), reg_(reg), next_(NULL) { }
     DeferredAction* next() { return next_; }
-    bool Mentions(int reg);
-    int reg() { return reg_; }
+    bool Mentions(intptr_t reg);
+    intptr_t reg() { return reg_; }
     ActionNode::ActionType action_type() { return action_type_; }
    private:
     ActionNode::ActionType action_type_;
-    int reg_;
+    intptr_t reg_;
     DeferredAction* next_;
     friend class Trace;
+
+    DISALLOW_ALLOCATION();
   };
 
   class DeferredCapture : public DeferredAction {
    public:
-    DeferredCapture(int reg, bool is_capture, Trace* trace)
+    DeferredCapture(intptr_t reg, bool is_capture, Trace* trace)
         : DeferredAction(ActionNode::STORE_POSITION, reg),
           cp_offset_(trace->cp_offset()),
           is_capture_(is_capture) { }
-    int cp_offset() { return cp_offset_; }
+    intptr_t cp_offset() { return cp_offset_; }
     bool is_capture() { return is_capture_; }
    private:
-    int cp_offset_;
+    intptr_t cp_offset_;
     bool is_capture_;
-    void set_cp_offset(int cp_offset) { cp_offset_ = cp_offset; }
+    void set_cp_offset(intptr_t cp_offset) { cp_offset_ = cp_offset; }
   };
 
   class DeferredSetRegister : public DeferredAction {
    public:
-    DeferredSetRegister(int reg, int value)
+    DeferredSetRegister(intptr_t reg, intptr_t value)
         : DeferredAction(ActionNode::SET_REGISTER, reg),
           value_(value) { }
-    int value() { return value_; }
+    intptr_t value() { return value_; }
    private:
-    int value_;
+    intptr_t value_;
   };
 
   class DeferredClearCaptures : public DeferredAction {
@@ -1204,7 +1164,7 @@
 
   class DeferredIncrementRegister : public DeferredAction {
    public:
-    explicit DeferredIncrementRegister(int reg)
+    explicit DeferredIncrementRegister(intptr_t reg)
         : DeferredAction(ActionNode::INCREMENT_REGISTER, reg) { }
   };
 
@@ -1224,7 +1184,7 @@
   // done we can start a new trace or go to one that has already been
   // generated.
   void Flush(RegExpCompiler* compiler, RegExpNode* successor);
-  int cp_offset() { return cp_offset_; }
+  intptr_t cp_offset() { return cp_offset_; }
   DeferredAction* actions() { return actions_; }
   // A trivial trace is one that has no deferred actions or other state that
   // affects the assumptions used when generating code.  There is no recorded
@@ -1249,59 +1209,63 @@
   void set_at_start(bool at_start) {
     at_start_ = at_start ? TRUE_VALUE : FALSE_VALUE;
   }
-  Label* backtrack() { return backtrack_; }
-  Label* loop_label() { return loop_label_; }
+  BlockLabel* backtrack() { return backtrack_; }
+  BlockLabel* loop_label() { return loop_label_; }
   RegExpNode* stop_node() { return stop_node_; }
-  int characters_preloaded() { return characters_preloaded_; }
-  int bound_checked_up_to() { return bound_checked_up_to_; }
-  int flush_budget() { return flush_budget_; }
+  intptr_t characters_preloaded() { return characters_preloaded_; }
+  intptr_t bound_checked_up_to() { return bound_checked_up_to_; }
+  intptr_t flush_budget() { return flush_budget_; }
   QuickCheckDetails* quick_check_performed() { return &quick_check_performed_; }
-  bool mentions_reg(int reg);
+  bool mentions_reg(intptr_t reg);
   // Returns true if a deferred position store exists to the specified
   // register and stores the offset in the out-parameter.  Otherwise
   // returns false.
-  bool GetStoredPosition(int reg, int* cp_offset);
+  bool GetStoredPosition(intptr_t reg, intptr_t* cp_offset);
   // These set methods and AdvanceCurrentPositionInTrace should be used only on
   // new traces - the intention is that traces are immutable after creation.
   void add_action(DeferredAction* new_action) {
-    DCHECK(new_action->next_ == NULL);
+    ASSERT(new_action->next_ == NULL);
     new_action->next_ = actions_;
     actions_ = new_action;
   }
-  void set_backtrack(Label* backtrack) { backtrack_ = backtrack; }
+  void set_backtrack(BlockLabel* backtrack) { backtrack_ = backtrack; }
   void set_stop_node(RegExpNode* node) { stop_node_ = node; }
-  void set_loop_label(Label* label) { loop_label_ = label; }
-  void set_characters_preloaded(int count) { characters_preloaded_ = count; }
-  void set_bound_checked_up_to(int to) { bound_checked_up_to_ = to; }
-  void set_flush_budget(int to) { flush_budget_ = to; }
+  void set_loop_label(BlockLabel* label) { loop_label_ = label; }
+  void set_characters_preloaded(intptr_t count) {
+    characters_preloaded_ = count;
+  }
+  void set_bound_checked_up_to(intptr_t to) { bound_checked_up_to_ = to; }
+  void set_flush_budget(intptr_t to) { flush_budget_ = to; }
   void set_quick_check_performed(QuickCheckDetails* d) {
     quick_check_performed_ = *d;
   }
   void InvalidateCurrentCharacter();
-  void AdvanceCurrentPositionInTrace(int by, RegExpCompiler* compiler);
+  void AdvanceCurrentPositionInTrace(intptr_t by, RegExpCompiler* compiler);
 
  private:
-  int FindAffectedRegisters(OutSet* affected_registers, Zone* zone);
+  intptr_t FindAffectedRegisters(OutSet* affected_registers, Isolate* isolate);
   void PerformDeferredActions(RegExpMacroAssembler* macro,
-                              int max_register,
+                              intptr_t max_register,
                               const OutSet& affected_registers,
                               OutSet* registers_to_pop,
                               OutSet* registers_to_clear,
-                              Zone* zone);
+                              Isolate* isolate);
   void RestoreAffectedRegisters(RegExpMacroAssembler* macro,
-                                int max_register,
+                                intptr_t max_register,
                                 const OutSet& registers_to_pop,
                                 const OutSet& registers_to_clear);
-  int cp_offset_;
+  intptr_t cp_offset_;
   DeferredAction* actions_;
-  Label* backtrack_;
+  BlockLabel* backtrack_;
   RegExpNode* stop_node_;
-  Label* loop_label_;
-  int characters_preloaded_;
-  int bound_checked_up_to_;
+  BlockLabel* loop_label_;
+  intptr_t characters_preloaded_;
+  intptr_t bound_checked_up_to_;
   QuickCheckDetails quick_check_performed_;
-  int flush_budget_;
+  intptr_t flush_budget_;
   TriBool at_start_;
+
+  DISALLOW_ALLOCATION();
 };
 
 
@@ -1309,28 +1273,30 @@
  public:
   explicit GreedyLoopState(bool not_at_start);
 
-  Label* label() { return &label_; }
+  BlockLabel* label() { return &label_; }
   Trace* counter_backtrack_trace() { return &counter_backtrack_trace_; }
 
  private:
-  Label label_;
+  BlockLabel label_;
   Trace counter_backtrack_trace_;
 };
 
 
 struct PreloadState {
-  static const int kEatsAtLeastNotYetInitialized = -1;
+  static const intptr_t kEatsAtLeastNotYetInitialized = -1;
   bool preload_is_current_;
   bool preload_has_checked_bounds_;
-  int preload_characters_;
-  int eats_at_least_;
+  intptr_t preload_characters_;
+  intptr_t eats_at_least_;
   void init() {
     eats_at_least_ = kEatsAtLeastNotYetInitialized;
   }
+
+  DISALLOW_ALLOCATION();
 };
 
 
-class NodeVisitor {
+class NodeVisitor : public ValueObject {
  public:
   virtual ~NodeVisitor() { }
 #define DECLARE_VISIT(Type)                                          \
@@ -1341,41 +1307,6 @@
 };
 
 
-// Node visitor used to add the start set of the alternatives to the
-// dispatch table of a choice node.
-class DispatchTableConstructor: public NodeVisitor {
- public:
-  DispatchTableConstructor(DispatchTable* table, bool ignore_case,
-                           Zone* zone)
-      : table_(table),
-        choice_index_(-1),
-        ignore_case_(ignore_case),
-        zone_(zone) { }
-
-  void BuildTable(ChoiceNode* node);
-
-  void AddRange(CharacterRange range) {
-    table()->AddRange(range, choice_index_, zone_);
-  }
-
-  void AddInverse(ZoneList<CharacterRange>* ranges);
-
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
-  DispatchTable* table() { return table_; }
-  void set_choice_index(int value) { choice_index_ = value; }
-
- protected:
-  DispatchTable* table_;
-  int choice_index_;
-  bool ignore_case_;
-  Zone* zone_;
-};
-
-
 // Assertion propagation moves information about assertions such as
 // \b to the affected nodes.  For instance, in /.\b./ information must
 // be propagated to the first '.' that whatever follows needs to know
@@ -1393,7 +1324,7 @@
   Analysis(bool ignore_case, bool is_one_byte)
       : ignore_case_(ignore_case),
         is_one_byte_(is_one_byte),
-        error_message_(NULL) {}
+        error_message_(NULL) { }
   void EnsureAnalyzed(RegExpNode* node);
 
 #define DECLARE_VISIT(Type)                                          \
@@ -1404,7 +1335,7 @@
 
   bool has_failed() { return error_message_ != NULL; }
   const char* error_message() {
-    DCHECK(error_message_ != NULL);
+    ASSERT(error_message_ != NULL);
     return error_message_;
   }
   void fail(const char* error_message) {
@@ -1420,43 +1351,60 @@
 };
 
 
-struct RegExpCompileData {
+struct RegExpCompileData : public ZoneAllocated {
   RegExpCompileData()
     : tree(NULL),
       node(NULL),
       simple(true),
       contains_anchor(false),
+      error(String::Handle(String::null())),
       capture_count(0) { }
   RegExpTree* tree;
   RegExpNode* node;
   bool simple;
   bool contains_anchor;
-  Handle<String> error;
-  int capture_count;
+  String& error;
+  intptr_t capture_count;
 };
 
 
 class RegExpEngine: public AllStatic {
  public:
   struct CompilationResult {
-    CompilationResult(Isolate* isolate, const char* error_message)
-        : error_message(error_message),
-          code(isolate->heap()->the_hole_value()),
-          num_registers(0) {}
-    CompilationResult(Object* code, int registers)
-      : error_message(NULL),
-        code(code),
-        num_registers(registers) {}
+    explicit CompilationResult(const char* error_message)
+        : backtrack_goto(NULL),
+          graph_entry(NULL),
+          num_blocks(-1),
+          num_stack_locals(-1),
+          error_message(error_message) {}
+    CompilationResult(IndirectGotoInstr* backtrack_goto,
+                      GraphEntryInstr* graph_entry,
+                      intptr_t num_blocks,
+                      intptr_t num_stack_locals)
+      : backtrack_goto(backtrack_goto),
+        graph_entry(graph_entry),
+        num_blocks(num_blocks),
+        num_stack_locals(num_stack_locals),
+        error_message(NULL) {}
+
+    IndirectGotoInstr* backtrack_goto;
+    GraphEntryInstr* graph_entry;
+    const intptr_t num_blocks;
+    const intptr_t num_stack_locals;
+
     const char* error_message;
-    Object* code;
-    int num_registers;
   };
 
-  static CompilationResult Compile(RegExpCompileData* input, bool ignore_case,
-                                   bool global, bool multiline, bool sticky,
-                                   Handle<String> pattern,
-                                   Handle<String> sample_subject,
-                                   bool is_one_byte, Zone* zone);
+  static CompilationResult Compile(
+      RegExpCompileData* input,
+      const ParsedFunction* parsed_function,
+      const ZoneGrowableArray<const ICData*>& ic_data_array);
+
+  static RawJSRegExp* CreateJSRegExp(
+      Isolate* isolate,
+      const String& pattern,
+      bool multi_line,
+      bool ignore_case);
 
   static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
 };
diff --git a/runtime/vm/regexp_assembler.cc b/runtime/vm/regexp_assembler.cc
index 8936d9d..fa666ae 100644
--- a/runtime/vm/regexp_assembler.cc
+++ b/runtime/vm/regexp_assembler.cc
@@ -4,20 +4,1811 @@
 
 #include "vm/regexp_assembler.h"
 
-// SNIP
+#include "vm/bit_vector.h"
+#include "vm/compiler.h"
+#include "vm/dart_entry.h"
+#include "vm/flow_graph_builder.h"
+#include "vm/il_printer.h"
+#include "vm/object_store.h"
+#include "vm/regexp.h"
+#include "vm/resolver.h"
+#include "vm/stack_frame.h"
+#include "vm/unibrow-inl.h"
+#include "vm/unicode.h"
+
+#define I isolate()
+
+// Debugging output macros. TAG() is called at the head of each interesting
+// function and prints its name during execution if irregexp tracing is enabled.
+#define TAG() if (FLAG_trace_irregexp) { TAG_(); }
+#define TAG_() \
+  Print(PushArgument( \
+    Bind(new(I) ConstantInstr(String::ZoneHandle(I, String::Concat( \
+        String::Handle(String::New("TAG: ")), \
+        String::Handle(String::New(__FUNCTION__)), Heap::kOld))))));
+
+#define PRINT(arg) if (FLAG_trace_irregexp) { Print(arg); }
 
 namespace dart {
 
-RegExpMacroAssembler::RegExpMacroAssembler(Zone* zone)
+DEFINE_FLAG(bool, trace_irregexp, false, "Trace irregexps");
+
+
+static const intptr_t kInvalidTryIndex = CatchClauseNode::kInvalidTryIndex;
+static const intptr_t kNoSourcePos = Scanner::kNoSourcePos;
+
+
+void PrintUtf16(uint16_t c) {
+  const char* format = (0x20 <= c && c <= 0x7F) ?
+        "%c" : (c <= 0xff) ? "\\x%02x" : "\\u%04x";
+  OS::Print(format, c);
+}
+
+
+/*
+ * This assembler uses the following main local variables:
+ * - stack_: A pointer to a growable list which we use as an all-purpose stack
+ *           storing backtracking offsets, positions & stored register values.
+ * - current_character_: Stores the currently loaded characters (possibly more
+ *                       than one).
+ * - current_position_: The current position within the string, stored as a
+ *                      negative offset from the end of the string (i.e. the
+ *                      position corresponding to str[0] is -str.length).
+ *                      Note that current_position_ is *not* byte-based, unlike
+ *                      original V8 code.
+ *
+ * Results are returned though an array of capture indices, stored at
+ * matches_param_. A null array specifies a failure to match. The match indices
+ * [start_inclusive, end_exclusive] for capture group i are stored at positions
+ * matches_param_[i * 2] and matches_param_[i * 2 + 1], respectively. Match
+ * indices of -1 denote non-matched groups. Note that we store these indices
+ * as a negative offset from the end of the string in position_registers_
+ * during processing, and convert them to standard indexes when copying them
+ * to matches_param_ on successful match.
+ */
+
+RegExpMacroAssembler::RegExpMacroAssembler(Isolate* isolate)
   : slow_safe_compiler_(false),
     global_mode_(NOT_GLOBAL),
-    zone_(zone) {
+    isolate_(isolate) {
 }
 
 
 RegExpMacroAssembler::~RegExpMacroAssembler() {
 }
 
-// SNIP
+
+IRRegExpMacroAssembler::IRRegExpMacroAssembler(
+    intptr_t specialization_cid,
+    intptr_t capture_count,
+    const ParsedFunction* parsed_function,
+    const ZoneGrowableArray<const ICData*>& ic_data_array,
+    Isolate* isolate)
+    : RegExpMacroAssembler(isolate),
+      specialization_cid_(specialization_cid),
+      parsed_function_(parsed_function),
+      ic_data_array_(ic_data_array),
+      current_instruction_(NULL),
+      stack_(NULL),
+      current_character_(NULL),
+      current_position_(NULL),
+      string_param_(NULL),
+      string_param_length_(NULL),
+      start_index_param_(NULL),
+      position_registers_count_((capture_count + 1) * 2),
+      stack_array_(GrowableObjectArray::ZoneHandle(
+          isolate, GrowableObjectArray::New(16, Heap::kOld))) {
+  switch (specialization_cid) {
+    case kOneByteStringCid:
+    case kExternalOneByteStringCid: mode_ = ASCII; break;
+    case kTwoByteStringCid:
+    case kExternalTwoByteStringCid: mode_ = UC16; break;
+    default: UNREACHABLE();
+  }
+
+  InitializeLocals();
+
+  // Create and generate all preset blocks.
+  entry_block_ =
+      new(isolate) GraphEntryInstr(
+        parsed_function_,
+        new(isolate) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
+        Isolate::kNoDeoptId);
+  start_block_ =
+      new(isolate) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+  success_block_ =
+      new(isolate) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+  backtrack_block_ =
+      new(isolate) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+  exit_block_ =
+      new(isolate) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+
+  GenerateEntryBlock();
+  GenerateSuccessBlock();
+  GenerateExitBlock();
+
+  blocks_.Add(entry_block_);
+  blocks_.Add(entry_block_->normal_entry());
+  blocks_.Add(start_block_);
+  blocks_.Add(success_block_);
+  blocks_.Add(backtrack_block_);
+  blocks_.Add(exit_block_);
+
+  // Begin emission at the start_block_.
+  set_current_instruction(start_block_);
+}
+
+
+IRRegExpMacroAssembler::~IRRegExpMacroAssembler() { }
+
+
+void IRRegExpMacroAssembler::InitializeLocals() {
+  // All generated functions are expected to have a current-context variable.
+  // This variable is unused in irregexp functions.
+  parsed_function_->current_context_var()->set_index(GetNextLocalIndex());
+
+  // Create local variables and parameters.
+  stack_ = Local(Symbols::stack());
+  current_character_ = Local(Symbols::current_character());
+  current_position_ = Local(Symbols::current_position());
+  string_param_length_ = Local(Symbols::string_param_length());
+  capture_length_ = Local(Symbols::capture_length());
+  match_start_index_ = Local(Symbols::match_start_index());
+  capture_start_index_ = Local(Symbols::capture_start_index());
+  match_end_index_ = Local(Symbols::match_end_index());
+  char_in_capture_ = Local(Symbols::char_in_capture());
+  char_in_match_ = Local(Symbols::char_in_match());
+  result_ = Local(Symbols::result());
+
+  string_param_ = Parameter(Symbols::string_param(), 0);
+  start_index_param_ = Parameter(Symbols::start_index_param(), 1);
+
+  // Reserve space for all captured group positions. Note that more might
+  // be created on the fly for internal use.
+  for (intptr_t i = 0; i < position_registers_count_; i++) {
+    position_register(i);
+  }
+}
+
+
+void IRRegExpMacroAssembler::GenerateEntryBlock() {
+  set_current_instruction(entry_block_->normal_entry());
+  TAG();
+
+  // Generate a local list variable which we will use as a backtracking stack.
+
+  StoreLocal(stack_, Bind(new(I) ConstantInstr(stack_array_)));
+  Do(InstanceCall(InstanceCallDescriptor(Symbols::clear()), PushLocal(stack_)));
+
+  // Store string.length.
+  PushArgumentInstr* string_push = PushLocal(string_param_);
+
+  StoreLocal(
+      string_param_length_,
+      Bind(InstanceCall(
+          InstanceCallDescriptor(
+              String::ZoneHandle(Field::GetterSymbol(Symbols::Length()))),
+          string_push)));
+
+  // Initialize all capture registers.
+  ClearRegisters(0, position_registers_count_ - 1);
+
+  // Store (start_index - string.length) as the current position (since it's a
+  // negative offset from the end of the string).
+  PushArgumentInstr* start_index_push = PushLocal(start_index_param_);
+  PushArgumentInstr* length_push = PushLocal(string_param_length_);
+
+  StoreLocal(current_position_, Bind(Sub(start_index_push, length_push)));
+
+  // Jump to the start block.
+  current_instruction_->Goto(start_block_);
+}
+
+
+void IRRegExpMacroAssembler::GenerateBacktrackBlock() {
+  set_current_instruction(backtrack_block_);
+  TAG();
+  CheckPreemption();
+
+  const intptr_t entries_count = entry_block_->indirect_entries().length();
+
+  GrowableObjectArray& offsets = GrowableObjectArray::ZoneHandle(
+      I, GrowableObjectArray::New(entries_count, Heap::kOld));
+
+  PushArgumentInstr* block_offsets_push =
+      PushArgument(Bind(new(I) ConstantInstr(offsets)));
+  PushArgumentInstr* block_id_push = PushArgument(PopStack());
+
+  Value* offset_value =
+      Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                        block_offsets_push,
+                        block_id_push));
+
+  backtrack_goto_ = new(I) IndirectGotoInstr(&offsets, offset_value);
+  CloseBlockWith(backtrack_goto_);
+
+  // Add an edge from the "indirect" goto to each of the targets.
+  for (intptr_t j = 0; j < entries_count; j++) {
+    backtrack_goto_->AddSuccessor(
+        TargetWithJoinGoto(entry_block_->indirect_entries().At(j)));
+  }
+}
+
+
+void IRRegExpMacroAssembler::GenerateSuccessBlock() {
+  set_current_instruction(success_block_);
+  TAG();
+
+  Definition* type_args_null_def = new(I) ConstantInstr(
+        TypeArguments::ZoneHandle(I, TypeArguments::null()));
+  PushArgumentInstr* type_arg_push = PushArgument(Bind(type_args_null_def));
+  PushArgumentInstr* length_push =
+      PushArgument(Bind(Uint64Constant(position_registers_count_)));
+
+  const Library& lib = Library::Handle(Library::CoreLibrary());
+  const Class& list_class = Class::Handle(
+        lib.LookupCoreClass(Symbols::List()));
+  const Function& list_ctor =
+      Function::ZoneHandle(I, list_class.LookupFactory(Symbols::ListFactory()));
+
+  // TODO(zerny): Use CreateArrayInstr and StoreIndexed instead.
+  StoreLocal(result_, Bind(StaticCall(list_ctor, type_arg_push, length_push)));
+
+  // Store captured offsets in the `matches` parameter.
+  // TODO(zerny): Eliminate position_register locals and access `matches`
+  // directly.
+  for (intptr_t i = 0; i < position_registers_count_; i++) {
+    PushArgumentInstr* matches_push = PushLocal(result_);
+    PushArgumentInstr* index_push = PushArgument(Bind(Uint64Constant(i)));
+
+    // Convert negative offsets from the end of the string to string indices.
+    PushArgumentInstr* offset_push = PushLocal(position_register(i));
+    PushArgumentInstr* len_push = PushLocal(string_param_length_);
+    PushArgumentInstr* value_push =
+        PushArgument(Bind(Add(offset_push, len_push)));
+
+    Do(InstanceCall(InstanceCallDescriptor::FromToken(Token::kASSIGN_INDEX),
+                    matches_push,
+                    index_push,
+                    value_push));
+  }
+
+  // Print the result if tracing.
+  PRINT(PushLocal(result_));
+
+  // Return true on success.
+  AppendInstruction(new(I) ReturnInstr(kNoSourcePos, Bind(LoadLocal(result_))));
+}
+
+
+void IRRegExpMacroAssembler::GenerateExitBlock() {
+  set_current_instruction(exit_block_);
+  TAG();
+
+  // Return false on failure.
+  AppendInstruction(new(I) ReturnInstr(kNoSourcePos, Bind(LoadLocal(result_))));
+}
+
+
+#if defined(TARGET_ARCH_ARM64) ||                                              \
+    defined(TARGET_ARCH_ARM) ||                                                \
+    defined(TARGET_ARCH_MIPS)
+// Disabling unaligned accesses forces the regexp engine to load characters one
+// by one instead of up to 4 at once, along with the associated performance hit.
+// TODO(zerny): Be less conservative about disabling unaligned accesses.
+// For instance, ARMv6 supports unaligned accesses. Once it is enabled here,
+// update LoadCodeUnitsInstr methods for the appropriate architectures.
+static const bool kEnableUnalignedAccesses = false;
+#else
+static const bool kEnableUnalignedAccesses = true;
+#endif
+bool IRRegExpMacroAssembler::CanReadUnaligned() {
+  return kEnableUnalignedAccesses && !slow_safe();
+}
+
+
+RawArray* IRRegExpMacroAssembler::Execute(
+    const Function& function,
+    const String& input,
+    const Smi& start_offset,
+    Isolate* isolate) {
+  // Create the argument list.
+  const Array& args = Array::Handle(Array::New(2));
+  args.SetAt(0, input);
+  args.SetAt(1, start_offset);
+
+  // And finally call the generated code.
+
+  const Object& retval =
+      Object::Handle(isolate, DartEntry::InvokeFunction(function, args));
+  if (retval.IsError()) {
+    const Error& error = Error::Cast(retval);
+    OS::Print("%s\n", error.ToErrorCString());
+    // Should never happen.
+    UNREACHABLE();
+  }
+
+  if (retval.IsNull()) {
+    return Array::null();
+  }
+
+  ASSERT(retval.IsArray());
+  return Array::Cast(retval).raw();
+}
+
+
+RawBool* IRRegExpMacroAssembler::CaseInsensitiveCompareUC16(
+    RawString* str_raw,
+    RawSmi* lhs_index_raw,
+    RawSmi* rhs_index_raw,
+    RawSmi* length_raw) {
+  const String& str = String::Handle(str_raw);
+  const Smi& lhs_index = Smi::Handle(lhs_index_raw);
+  const Smi& rhs_index = Smi::Handle(rhs_index_raw);
+  const Smi& length = Smi::Handle(length_raw);
+
+  // TODO(zerny): Optimize as single instance. V8 has this as an
+  // isolate member.
+  unibrow::Mapping<unibrow::Ecma262Canonicalize> canonicalize;
+
+  for (intptr_t i = 0; i < length.Value(); i++) {
+    int32_t c1 = str.CharAt(lhs_index.Value() + i);
+    int32_t c2 = str.CharAt(rhs_index.Value() + i);
+    if (c1 != c2) {
+      int32_t s1[1] = { c1 };
+      canonicalize.get(c1, '\0', s1);
+      if (s1[0] != c2) {
+        int32_t s2[1] = { c2 };
+        canonicalize.get(c2, '\0', s2);
+        if (s1[0] != s2[0]) {
+          return Bool::False().raw();
+        }
+      }
+    }
+  }
+  return Bool::True().raw();
+}
+
+
+LocalVariable* IRRegExpMacroAssembler::Parameter(const String& name,
+                                                 intptr_t index) const {
+  const Type& local_type = Type::ZoneHandle(I, Type::DynamicType());
+  LocalVariable* local =
+      new(I) LocalVariable(kNoSourcePos, name, local_type);
+
+  intptr_t param_frame_index = kParamEndSlotFromFp + kParamCount - index;
+  local->set_index(param_frame_index);
+
+  return local;
+}
+
+
+LocalVariable* IRRegExpMacroAssembler::Local(const String& name) {
+  const Type& local_type = Type::ZoneHandle(I, Type::DynamicType());
+  LocalVariable* local =
+      new(I) LocalVariable(kNoSourcePos, name, local_type);
+  local->set_index(GetNextLocalIndex());
+
+  return local;
+}
+
+
+ConstantInstr* IRRegExpMacroAssembler::Int64Constant(int64_t value) const {
+  return new(I) ConstantInstr(
+        Integer::ZoneHandle(I, Integer::New(value, Heap::kOld)));
+}
+
+
+ConstantInstr* IRRegExpMacroAssembler::Uint64Constant(uint64_t value) const {
+  return new(I) ConstantInstr(
+        Integer::ZoneHandle(I, Integer::NewFromUint64(value, Heap::kOld)));
+}
+
+
+ConstantInstr* IRRegExpMacroAssembler::BoolConstant(bool value) const {
+  return new(I) ConstantInstr(value ? Bool::True() : Bool::False());
+}
+
+
+ConstantInstr* IRRegExpMacroAssembler::StringConstant(const char* value) const {
+  return new(I) ConstantInstr(
+        String::ZoneHandle(I, String::New(value, Heap::kOld)));
+}
+
+
+ConstantInstr* IRRegExpMacroAssembler::WordCharacterMapConstant() const {
+  const Library& lib = Library::Handle(I, Library::CoreLibrary());
+  const Class& regexp_class = Class::Handle(I,
+        lib.LookupClassAllowPrivate(Symbols::JSSyntaxRegExp()));
+  const Field& word_character_field = Field::ZoneHandle(I,
+      regexp_class.LookupStaticField(Symbols::_wordCharacterMap()));
+  ASSERT(!word_character_field.IsNull());
+
+  if (word_character_field.IsUninitialized()) {
+    word_character_field.EvaluateInitializer();
+  }
+  ASSERT(!word_character_field.IsUninitialized());
+
+  return new(I) ConstantInstr(
+        Instance::ZoneHandle(I, word_character_field.value()));
+}
+
+
+ComparisonInstr* IRRegExpMacroAssembler::Comparison(
+    ComparisonKind kind, Definition* lhs, Definition* rhs) {
+  Token::Kind strict_comparison = Token::kEQ_STRICT;
+  Token::Kind intermediate_operator = Token::kILLEGAL;
+  switch (kind) {
+  case kEQ:
+    intermediate_operator = Token::kEQ;
+    break;
+  case kNE:
+    intermediate_operator = Token::kEQ;
+    strict_comparison = Token::kNE_STRICT;
+    break;
+  case kLT:
+    intermediate_operator = Token::kLT;
+    break;
+  case kGT:
+    intermediate_operator = Token::kGT;
+    break;
+  case kLTE:
+    intermediate_operator = Token::kLTE;
+    break;
+  case kGTE:
+    intermediate_operator = Token::kGTE;
+    break;
+  default:
+    UNREACHABLE();
+  }
+
+  ASSERT(intermediate_operator != Token::kILLEGAL);
+
+  PushArgumentInstr* lhs_push = PushArgument(Bind(lhs));
+  PushArgumentInstr* rhs_push = PushArgument(Bind(rhs));
+
+  Value* lhs_value =
+      Bind(InstanceCall(
+             InstanceCallDescriptor::FromToken(intermediate_operator),
+             lhs_push,
+             rhs_push));
+  Value* rhs_value = Bind(BoolConstant(true));
+
+  return new(I) StrictCompareInstr(
+      kNoSourcePos, strict_comparison, lhs_value, rhs_value, true);
+}
+
+
+StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
+    const Function& function) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(0);
+  return StaticCall(function, arguments);
+}
+
+
+StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
+    const Function& function,
+    PushArgumentInstr* arg1) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(1);
+  arguments->Add(arg1);
+
+  return StaticCall(function, arguments);
+}
+
+
+StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
+    const Function& function,
+    PushArgumentInstr* arg1,
+    PushArgumentInstr* arg2) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(2);
+  arguments->Add(arg1);
+  arguments->Add(arg2);
+
+  return StaticCall(function, arguments);
+}
+
+
+StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
+    const Function& function,
+    ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
+  return new(I) StaticCallInstr(kNoSourcePos,
+                                function,
+                                Object::null_array(),
+                                arguments,
+                                ic_data_array_);
+}
+
+
+InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
+    const InstanceCallDescriptor& desc,
+    PushArgumentInstr* arg1) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(1);
+  arguments->Add(arg1);
+
+  return InstanceCall(desc, arguments);
+}
+
+
+InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
+    const InstanceCallDescriptor& desc,
+    PushArgumentInstr* arg1,
+    PushArgumentInstr* arg2) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(2);
+  arguments->Add(arg1);
+  arguments->Add(arg2);
+
+  return InstanceCall(desc, arguments);
+}
+
+
+InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
+    const InstanceCallDescriptor& desc,
+    PushArgumentInstr* arg1,
+    PushArgumentInstr* arg2,
+    PushArgumentInstr* arg3) const {
+  ZoneGrowableArray<PushArgumentInstr*>* arguments =
+      new(I) ZoneGrowableArray<PushArgumentInstr*>(3);
+  arguments->Add(arg1);
+  arguments->Add(arg2);
+  arguments->Add(arg3);
+
+  return InstanceCall(desc, arguments);
+}
+
+
+InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
+    const InstanceCallDescriptor& desc,
+    ZoneGrowableArray<PushArgumentInstr*> *arguments) const {
+  return
+    new(I) InstanceCallInstr(kNoSourcePos,
+                             desc.name,
+                             desc.token_kind,
+                             arguments,
+                             Object::null_array(),
+                             desc.checked_argument_count,
+                             ic_data_array_);
+}
+
+
+LoadLocalInstr* IRRegExpMacroAssembler::LoadLocal(LocalVariable* local) const {
+  return new(I) LoadLocalInstr(*local);
+}
+
+
+void IRRegExpMacroAssembler::StoreLocal(LocalVariable* local,
+                                        Value* value) {
+  Do(new(I) StoreLocalInstr(*local, value));
+}
+
+
+void IRRegExpMacroAssembler::set_current_instruction(Instruction* instruction) {
+  current_instruction_ = instruction;
+}
+
+
+Value* IRRegExpMacroAssembler::Bind(Definition* definition) {
+  AppendInstruction(definition);
+  definition->set_temp_index(temp_id_.Alloc());
+
+  return new(I) Value(definition);
+}
+
+
+void IRRegExpMacroAssembler::Do(Definition* definition) {
+  AppendInstruction(definition);
+}
+
+
+Value* IRRegExpMacroAssembler::BindLoadLocal(const LocalVariable& local) {
+  if (local.IsConst()) {
+    return Bind(new(I) ConstantInstr(*local.ConstValue()));
+  }
+  ASSERT(!local.is_captured());
+  return Bind(new(I) LoadLocalInstr(local));
+}
+
+
+// In some cases, the V8 irregexp engine generates unreachable code by emitting
+// a jmp not followed by a bind. We cannot do the same, since it is impossible
+// to append to a block following a jmp. In such cases, assume that we are doing
+// the correct thing, but output a warning when tracing.
+#define HANDLE_DEAD_CODE_EMISSION() \
+  if (current_instruction_ == NULL) { \
+    if (FLAG_trace_irregexp) { \
+      OS::Print("WARNING: Attempting to append to a closed assembler. " \
+                "This could be either a bug or generation of dead code " \
+                "inherited from V8.\n"); \
+    } \
+    BlockLabel dummy; \
+    BindBlock(&dummy); \
+  }
+
+void IRRegExpMacroAssembler::AppendInstruction(Instruction* instruction) {
+  HANDLE_DEAD_CODE_EMISSION();
+
+  ASSERT(current_instruction_ != NULL);
+  ASSERT(current_instruction_->next() == NULL);
+
+  temp_id_.Dealloc(instruction->InputCount());
+  arg_id_.Dealloc(instruction->ArgumentCount());
+
+  current_instruction_->LinkTo(instruction);
+  set_current_instruction(instruction);
+}
+
+
+void IRRegExpMacroAssembler::CloseBlockWith(Instruction* instruction) {
+  HANDLE_DEAD_CODE_EMISSION();
+
+  ASSERT(current_instruction_ != NULL);
+  ASSERT(current_instruction_->next() == NULL);
+
+  temp_id_.Dealloc(instruction->InputCount());
+  arg_id_.Dealloc(instruction->ArgumentCount());
+
+  current_instruction_->LinkTo(instruction);
+  set_current_instruction(NULL);
+}
+
+
+void IRRegExpMacroAssembler::GoTo(BlockLabel* to) {
+  if (to == NULL) {
+    Backtrack();
+  } else {
+    to->SetLinked();
+    GoTo(to->block());
+  }
+}
+
+
+// Closes the current block with a goto, and unsets current_instruction_.
+// BindBlock() must be called before emission can continue.
+void IRRegExpMacroAssembler::GoTo(JoinEntryInstr* to) {
+  HANDLE_DEAD_CODE_EMISSION();
+
+  ASSERT(current_instruction_ != NULL);
+  ASSERT(current_instruction_->next() == NULL);
+  current_instruction_->Goto(to);
+  set_current_instruction(NULL);
+}
+
+
+PushArgumentInstr* IRRegExpMacroAssembler::PushArgument(Value* value) {
+  arg_id_.Alloc();
+  PushArgumentInstr* push = new(I) PushArgumentInstr(value);
+  // Do *not* use Do() for push argument instructions.
+  AppendInstruction(push);
+  return push;
+}
+
+
+PushArgumentInstr* IRRegExpMacroAssembler::PushLocal(LocalVariable* local) {
+  return PushArgument(Bind(LoadLocal(local)));
+}
+
+
+void IRRegExpMacroAssembler::Print(const char* str) {
+  Print(PushArgument(
+    Bind(new(I) ConstantInstr(
+           String::ZoneHandle(I, String::New(str, Heap::kOld))))));
+}
+
+
+void IRRegExpMacroAssembler::Print(PushArgumentInstr* argument) {
+  const Library& lib = Library::Handle(Library::CoreLibrary());
+  const Function& print_fn = Function::ZoneHandle(
+        I, lib.LookupFunctionAllowPrivate(Symbols::print()));
+  Do(StaticCall(print_fn, argument));
+}
+
+
+void IRRegExpMacroAssembler::PrintBlocks() {
+  for (intptr_t i = 0; i < blocks_.length(); i++) {
+    FlowGraphPrinter::PrintBlock(blocks_[i], false);
+  }
+}
+
+
+intptr_t IRRegExpMacroAssembler::stack_limit_slack()  {
+  return 32;
+}
+
+
+void IRRegExpMacroAssembler::AdvanceCurrentPosition(intptr_t by) {
+  TAG();
+  if (by != 0) {
+    PushArgumentInstr* cur_pos_push = PushLocal(current_position_);
+    PushArgumentInstr* by_push = PushArgument(Bind(Int64Constant(by)));
+
+    Value* new_pos_value = Bind(Add(cur_pos_push, by_push));
+    StoreLocal(current_position_, new_pos_value);
+  }
+}
+
+
+void IRRegExpMacroAssembler::AdvanceRegister(intptr_t reg, intptr_t by) {
+  TAG();
+  ASSERT(reg >= 0);
+  ASSERT(reg < position_registers_.length());
+
+  if (by != 0) {
+    PushArgumentInstr* reg_push = PushLocal(position_register(reg));
+    PushArgumentInstr* by_push = PushArgument(Bind(Int64Constant(by)));
+    StoreLocal(position_register(reg), Bind(Add(reg_push, by_push)));
+  }
+}
+
+
+void IRRegExpMacroAssembler::Backtrack() {
+  TAG();
+  GoTo(backtrack_block_);
+}
+
+
+// A BindBlock is analogous to assigning a label to a basic block.
+// If the BlockLabel does not yet contain a block, it is created.
+// If there is a current instruction, append a goto to the bound block.
+void IRRegExpMacroAssembler::BindBlock(BlockLabel* label) {
+  ASSERT(!label->IsBound());
+  ASSERT(label->block()->next() == NULL);
+
+  label->SetBound(block_id_.Alloc());
+  blocks_.Add(label->block());
+
+  if (current_instruction_ != NULL) {
+    GoTo(label);
+  }
+  set_current_instruction(label->block());
+
+  // Print the id of the current block if tracing.
+  PRINT(PushArgument(Bind(Uint64Constant(label->block()->block_id()))));
+}
+
+
+intptr_t IRRegExpMacroAssembler::GetNextLocalIndex() {
+  intptr_t id = local_id_.Alloc();
+  return kFirstLocalSlotFromFp - id;
+}
+
+
+LocalVariable* IRRegExpMacroAssembler::position_register(intptr_t index) {
+  // Create position registers as needed.
+  for (intptr_t i = position_registers_.length(); i < index + 1; i++) {
+    position_registers_.Add(Local(Symbols::position_registers()));
+  }
+
+  return position_registers_[index];
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacter(uint32_t c, BlockLabel* on_equal) {
+  TAG();
+  Definition* cur_char_def = LoadLocal(current_character_);
+  Definition* char_def = Uint64Constant(c);
+
+  BranchOrBacktrack(Comparison(kEQ, cur_char_def, char_def), on_equal);
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacterGT(uint16_t limit,
+                                              BlockLabel* on_greater) {
+  TAG();
+  BranchOrBacktrack(Comparison(kGT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(limit)),
+                    on_greater);
+}
+
+
+void IRRegExpMacroAssembler::CheckAtStart(BlockLabel* on_at_start) {
+  TAG();
+
+  BlockLabel not_at_start;
+
+  // Did we start the match at the start of the string at all?
+  BranchOrBacktrack(Comparison(kNE,
+                               LoadLocal(start_index_param_),
+                               Uint64Constant(0)),
+                    &not_at_start);
+
+  // If we did, are we still at the start of the input, i.e. is
+  // (offset == string_length * -1)?
+  Definition* neg_len_def =
+      InstanceCall(InstanceCallDescriptor::FromToken(Token::kNEGATE),
+                   PushLocal(string_param_length_));
+  Definition* offset_def = LoadLocal(current_position_);
+  BranchOrBacktrack(Comparison(kEQ, neg_len_def, offset_def),
+                    on_at_start);
+
+  BindBlock(&not_at_start);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotAtStart(BlockLabel* on_not_at_start) {
+  TAG();
+
+  // Did we start the match at the start of the string at all?
+  BranchOrBacktrack(Comparison(kNE,
+                               LoadLocal(start_index_param_),
+                               Uint64Constant(0)),
+                    on_not_at_start);
+
+  // If we did, are we still at the start of the input, i.e. is
+  // (offset == string_length * -1)?
+  Definition* neg_len_def =
+      InstanceCall(InstanceCallDescriptor::FromToken(Token::kNEGATE),
+                   PushLocal(string_param_length_));
+  Definition* offset_def = LoadLocal(current_position_);
+  BranchOrBacktrack(Comparison(kNE, neg_len_def, offset_def),
+                    on_not_at_start);
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacterLT(uint16_t limit,
+                                              BlockLabel* on_less) {
+  TAG();
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(limit)),
+                    on_less);
+}
+
+
+void IRRegExpMacroAssembler::CheckGreedyLoop(BlockLabel* on_equal) {
+  TAG();
+
+  BlockLabel fallthrough;
+
+  PushArgumentInstr* stack_push = PushLocal(stack_);
+  Definition* stack_tip_def = InstanceCall(
+        InstanceCallDescriptor(String::ZoneHandle(
+                                 I, Field::GetterSymbol(Symbols::last()))),
+        stack_push);
+  Definition* cur_pos_def = LoadLocal(current_position_);
+
+  BranchOrBacktrack(Comparison(kNE, stack_tip_def, cur_pos_def),
+                    &fallthrough);
+
+  // Pop, throwing away the value.
+  stack_push = PushLocal(stack_);
+  Do(InstanceCall(InstanceCallDescriptor(Symbols::removeLast()),
+                  stack_push));
+
+  BranchOrBacktrack(NULL, on_equal);
+
+  BindBlock(&fallthrough);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotBackReferenceIgnoreCase(
+    intptr_t start_reg,
+    BlockLabel* on_no_match) {
+  TAG();
+  ASSERT(start_reg + 1 <= position_registers_.length());
+
+  BlockLabel fallthrough;
+
+  PushArgumentInstr* end_push = PushLocal(position_register(start_reg + 1));
+  PushArgumentInstr* start_push = PushLocal(position_register(start_reg));
+  StoreLocal(capture_length_, Bind(Sub(end_push, start_push)));
+
+  // The length of a capture should not be negative. This can only happen
+  // if the end of the capture is unrecorded, or at a point earlier than
+  // the start of the capture.
+  // BranchOrBacktrack(less, on_no_match);
+
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(capture_length_),
+                               Uint64Constant(0)),
+                    on_no_match);
+
+  // If length is zero, either the capture is empty or it is completely
+  // uncaptured. In either case succeed immediately.
+  BranchOrBacktrack(Comparison(kEQ,
+                               LoadLocal(capture_length_),
+                               Uint64Constant(0)),
+                    &fallthrough);
+
+
+  // Check that there are sufficient characters left in the input.
+  PushArgumentInstr* pos_push = PushLocal(current_position_);
+  PushArgumentInstr* len_push = PushLocal(capture_length_);
+  BranchOrBacktrack(
+        Comparison(kGT,
+                   InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
+                                pos_push,
+                                len_push),
+                   Uint64Constant(0)),
+        on_no_match);
+
+  pos_push = PushLocal(current_position_);
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(match_start_index_, Bind(Add(pos_push, len_push)));
+
+  pos_push = PushLocal(position_register(start_reg));
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(capture_start_index_, Bind(Add(pos_push, len_push)));
+
+  pos_push = PushLocal(match_start_index_);
+  len_push = PushLocal(capture_length_);
+  StoreLocal(match_end_index_, Bind(Add(pos_push, len_push)));
+
+  BlockLabel success;
+  if (mode_ == ASCII) {
+    BlockLabel loop_increment;
+    BlockLabel loop;
+    BindBlock(&loop);
+
+    StoreLocal(char_in_capture_, CharacterAt(LoadLocal(capture_start_index_)));
+    StoreLocal(char_in_match_, CharacterAt(LoadLocal(match_start_index_)));
+
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(char_in_capture_),
+                                 LoadLocal(char_in_match_)),
+                      &loop_increment);
+
+    // Mismatch, try case-insensitive match (converting letters to lower-case).
+    PushArgumentInstr* match_char_push = PushLocal(char_in_match_);
+    PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(0x20)));
+    StoreLocal(char_in_match_,
+               Bind(InstanceCall(
+                      InstanceCallDescriptor::FromToken(Token::kBIT_OR),
+                      match_char_push,
+                      mask_push)));
+
+    BlockLabel convert_capture;
+    BlockLabel on_not_in_range;
+    BranchOrBacktrack(Comparison(kLT,
+                                 LoadLocal(char_in_match_),
+                                 Uint64Constant('a')),
+                      &on_not_in_range);
+    BranchOrBacktrack(Comparison(kGT,
+                                 LoadLocal(char_in_match_),
+                                 Uint64Constant('z')),
+                      &on_not_in_range);
+    GoTo(&convert_capture);
+    BindBlock(&on_not_in_range);
+
+    // Latin-1: Check for values in range [224,254] but not 247.
+    BranchOrBacktrack(Comparison(kLT,
+                                 LoadLocal(char_in_match_),
+                                 Uint64Constant(224)),
+                      on_no_match);
+    BranchOrBacktrack(Comparison(kGT,
+                                 LoadLocal(char_in_match_),
+                                 Uint64Constant(254)),
+                      on_no_match);
+
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(char_in_match_),
+                                 Uint64Constant(247)),
+                      on_no_match);
+
+    // Also convert capture character.
+    BindBlock(&convert_capture);
+
+    PushArgumentInstr* capture_char_push = PushLocal(char_in_capture_);
+    mask_push = PushArgument(Bind(Uint64Constant(0x20)));
+    StoreLocal(char_in_capture_,
+               Bind(InstanceCall(
+                      InstanceCallDescriptor::FromToken(Token::kBIT_OR),
+                      capture_char_push,
+                      mask_push)));
+
+    BranchOrBacktrack(Comparison(kNE,
+                                 LoadLocal(char_in_match_),
+                                 LoadLocal(char_in_capture_)),
+                      on_no_match);
+
+    BindBlock(&loop_increment);
+
+    // Increment indexes into capture and match strings.
+    PushArgumentInstr* index_push = PushLocal(capture_start_index_);
+    PushArgumentInstr* inc_push = PushArgument(Bind(Uint64Constant(1)));
+    StoreLocal(capture_start_index_, Bind(Add(index_push, inc_push)));
+
+    index_push = PushLocal(match_start_index_);
+    inc_push = PushArgument(Bind(Uint64Constant(1)));
+    StoreLocal(match_start_index_, Bind(Add(index_push, inc_push)));
+
+    // Compare to end of match, and loop if not done.
+    BranchOrBacktrack(Comparison(kLT,
+                                 LoadLocal(match_start_index_),
+                                 LoadLocal(match_end_index_)),
+                      &loop);
+  } else {
+    ASSERT(mode_ == UC16);
+
+    Value* string_value = Bind(LoadLocal(string_param_));
+    Value* lhs_index_value = Bind(LoadLocal(match_start_index_));
+    Value* rhs_index_value = Bind(LoadLocal(capture_start_index_));
+    Value* length_value = Bind(LoadLocal(capture_length_));
+
+    Definition* is_match_def =
+        new(I) CaseInsensitiveCompareUC16Instr(
+                            string_value,
+                            lhs_index_value,
+                            rhs_index_value,
+                            length_value,
+                            specialization_cid_);
+
+    BranchOrBacktrack(Comparison(kNE, is_match_def, BoolConstant(true)),
+                      on_no_match);
+  }
+
+  BindBlock(&success);
+
+  // Move current character position to position after match.
+  PushArgumentInstr* match_end_push = PushLocal(match_end_index_);
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(current_position_, Bind(Sub(match_end_push, len_push)));
+
+  BindBlock(&fallthrough);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotBackReference(
+    intptr_t start_reg,
+    BlockLabel* on_no_match) {
+  TAG();
+  ASSERT(start_reg + 1 <= position_registers_.length());
+
+  BlockLabel fallthrough;
+  BlockLabel success;
+
+  // Find length of back-referenced capture.
+  PushArgumentInstr* end_push = PushLocal(position_register(start_reg + 1));
+  PushArgumentInstr* start_push = PushLocal(position_register(start_reg));
+  StoreLocal(capture_length_, Bind(Sub(end_push, start_push)));
+
+  // Fail on partial or illegal capture (start of capture after end of capture).
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(capture_length_),
+                               Uint64Constant(0)),
+                    on_no_match);
+
+  // Succeed on empty capture (including no capture)
+  BranchOrBacktrack(Comparison(kEQ,
+                               LoadLocal(capture_length_),
+                               Uint64Constant(0)),
+                    &fallthrough);
+
+  // Check that there are sufficient characters left in the input.
+  PushArgumentInstr* pos_push = PushLocal(current_position_);
+  PushArgumentInstr* len_push = PushLocal(capture_length_);
+  BranchOrBacktrack(
+        Comparison(kGT,
+                   InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD),
+                                pos_push,
+                                len_push),
+                   Uint64Constant(0)),
+        on_no_match);
+
+  // Compute pointers to match string and capture string.
+  pos_push = PushLocal(current_position_);
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(match_start_index_, Bind(Add(pos_push, len_push)));
+
+  pos_push = PushLocal(position_register(start_reg));
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(capture_start_index_, Bind(Add(pos_push, len_push)));
+
+  pos_push = PushLocal(match_start_index_);
+  len_push = PushLocal(capture_length_);
+  StoreLocal(match_end_index_, Bind(Add(pos_push, len_push)));
+
+  BlockLabel loop;
+  BindBlock(&loop);
+
+  StoreLocal(char_in_capture_, CharacterAt(LoadLocal(capture_start_index_)));
+  StoreLocal(char_in_match_, CharacterAt(LoadLocal(match_start_index_)));
+
+  BranchOrBacktrack(Comparison(kNE,
+                               LoadLocal(char_in_capture_),
+                               LoadLocal(char_in_match_)),
+                    on_no_match);
+
+  // Increment indexes into capture and match strings.
+  PushArgumentInstr* index_push = PushLocal(capture_start_index_);
+  PushArgumentInstr* inc_push = PushArgument(Bind(Uint64Constant(1)));
+  StoreLocal(capture_start_index_, Bind(Add(index_push, inc_push)));
+
+  index_push = PushLocal(match_start_index_);
+  inc_push = PushArgument(Bind(Uint64Constant(1)));
+  StoreLocal(match_start_index_, Bind(Add(index_push, inc_push)));
+
+  // Check if we have reached end of match area.
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(match_start_index_),
+                               LoadLocal(match_end_index_)),
+                    &loop);
+
+  BindBlock(&success);
+
+  // Move current character position to position after match.
+  PushArgumentInstr* match_end_push = PushLocal(match_end_index_);
+  len_push = PushLocal(string_param_length_);
+  StoreLocal(current_position_, Bind(Sub(match_end_push, len_push)));
+
+  BindBlock(&fallthrough);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotCharacter(uint32_t c,
+                                               BlockLabel* on_not_equal) {
+  TAG();
+  BranchOrBacktrack(Comparison(kNE,
+                               LoadLocal(current_character_),
+                               Uint64Constant(c)),
+                    on_not_equal);
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacterAfterAnd(uint32_t c,
+                                                    uint32_t mask,
+                                                    BlockLabel* on_equal) {
+  TAG();
+
+  Definition* actual_def = LoadLocal(current_character_);
+  Definition* expected_def = Uint64Constant(c);
+
+  PushArgumentInstr* actual_push = PushArgument(Bind(actual_def));
+  PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
+  actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
+                            actual_push,
+                            mask_push);
+
+  BranchOrBacktrack(Comparison(kEQ, actual_def, expected_def), on_equal);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotCharacterAfterAnd(
+    uint32_t c,
+    uint32_t mask,
+    BlockLabel* on_not_equal) {
+  TAG();
+
+  Definition* actual_def = LoadLocal(current_character_);
+  Definition* expected_def = Uint64Constant(c);
+
+  PushArgumentInstr* actual_push = PushArgument(Bind(actual_def));
+  PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
+  actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
+                            actual_push,
+                            mask_push);
+
+  BranchOrBacktrack(Comparison(kNE, actual_def, expected_def), on_not_equal);
+}
+
+
+void IRRegExpMacroAssembler::CheckNotCharacterAfterMinusAnd(
+    uint16_t c,
+    uint16_t minus,
+    uint16_t mask,
+    BlockLabel* on_not_equal) {
+  TAG();
+  ASSERT(minus < Utf16::kMaxCodeUnit);  // NOLINT
+
+  Definition* actual_def = LoadLocal(current_character_);
+  Definition* expected_def = Uint64Constant(c);
+
+  PushArgumentInstr* actual_push = PushArgument(Bind(actual_def));
+  PushArgumentInstr* minus_push = PushArgument(Bind(Uint64Constant(minus)));
+
+  actual_push = PushArgument(Bind(Sub(actual_push, minus_push)));
+  PushArgumentInstr* mask_push = PushArgument(Bind(Uint64Constant(mask)));
+  actual_def = InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
+                            actual_push,
+                            mask_push);
+
+  BranchOrBacktrack(Comparison(kNE, actual_def, expected_def), on_not_equal);
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacterInRange(
+    uint16_t from,
+    uint16_t to,
+    BlockLabel* on_in_range) {
+  TAG();
+  ASSERT(from <= to);
+
+  // TODO(zerny): All range comparisons could be done cheaper with unsigned
+  // compares. This pattern repeats in various places.
+
+  BlockLabel on_not_in_range;
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(from)),
+                    &on_not_in_range);
+  BranchOrBacktrack(Comparison(kGT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(to)),
+                    &on_not_in_range);
+  BranchOrBacktrack(NULL, on_in_range);
+
+  BindBlock(&on_not_in_range);
+}
+
+
+void IRRegExpMacroAssembler::CheckCharacterNotInRange(
+    uint16_t from,
+    uint16_t to,
+    BlockLabel* on_not_in_range) {
+  TAG();
+  ASSERT(from <= to);
+
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(from)),
+                    on_not_in_range);
+
+  BranchOrBacktrack(Comparison(kGT,
+                               LoadLocal(current_character_),
+                               Uint64Constant(to)),
+                    on_not_in_range);
+}
+
+
+void IRRegExpMacroAssembler::CheckBitInTable(
+    const TypedData& table,
+    BlockLabel* on_bit_set) {
+  TAG();
+
+  PushArgumentInstr* table_push =
+      PushArgument(Bind(new(I) ConstantInstr(table)));
+  PushArgumentInstr* index_push = PushLocal(current_character_);
+
+  if (mode_ != ASCII || kTableMask != Symbols::kMaxOneCharCodeSymbol) {
+    PushArgumentInstr* mask_push =
+        PushArgument(Bind(Uint64Constant(kTableSize - 1)));
+    index_push = PushArgument(
+          Bind(InstanceCall(InstanceCallDescriptor::FromToken(Token::kBIT_AND),
+                            index_push,
+                            mask_push)));
+  }
+
+  Definition* byte_def =
+      InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                   table_push,
+                   index_push);
+  Definition* zero_def = Int64Constant(0);
+
+  BranchOrBacktrack(Comparison(kNE, byte_def, zero_def), on_bit_set);
+}
+
+
+bool IRRegExpMacroAssembler::CheckSpecialCharacterClass(
+    uint16_t type,
+    BlockLabel* on_no_match) {
+  TAG();
+
+  // Range checks (c in min..max) are generally implemented by an unsigned
+  // (c - min) <= (max - min) check
+  switch (type) {
+  case 's':
+    // Match space-characters
+    if (mode_ == ASCII) {
+      // One byte space characters are '\t'..'\r', ' ' and \u00a0.
+      BlockLabel success;
+      // Space (' ').
+      BranchOrBacktrack(Comparison(kEQ,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(' ')),
+                        &success);
+      // Check range 0x09..0x0d.
+      CheckCharacterInRange('\t', '\r', &success);
+      // \u00a0 (NBSP).
+      BranchOrBacktrack(Comparison(kNE,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(0x00a0)),
+                        on_no_match);
+      BindBlock(&success);
+      return true;
+    }
+    return false;
+  case 'S':
+    // The emitted code for generic character classes is good enough.
+    return false;
+  case 'd':
+    // Match ASCII digits ('0'..'9')
+    CheckCharacterNotInRange('0', '9', on_no_match);
+    return true;
+  case 'D':
+    // Match non ASCII-digits
+    CheckCharacterInRange('0', '9', on_no_match);
+    return true;
+  case '.': {
+    // Match non-newlines (not 0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(current_character_),
+                                 Uint64Constant('\n')),
+                      on_no_match);
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(current_character_),
+                                 Uint64Constant('\r')),
+                      on_no_match);
+    if (mode_ == UC16) {
+      BranchOrBacktrack(Comparison(kEQ,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(0x2028)),
+                        on_no_match);
+      BranchOrBacktrack(Comparison(kEQ,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(0x2029)),
+                        on_no_match);
+    }
+    return true;
+  }
+  case 'w': {
+    if (mode_ != ASCII) {
+      // Table is 128 entries, so all ASCII characters can be tested.
+      BranchOrBacktrack(Comparison(kGT,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant('z')),
+                        on_no_match);
+    }
+
+    PushArgumentInstr* table_push =
+        PushArgument(Bind(WordCharacterMapConstant()));
+    PushArgumentInstr* index_push = PushLocal(current_character_);
+
+    Definition* byte_def =
+        InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                     table_push,
+                     index_push);
+    Definition* zero_def = Int64Constant(0);
+
+    BranchOrBacktrack(Comparison(kEQ, byte_def, zero_def), on_no_match);
+
+    return true;
+  }
+  case 'W': {
+    BlockLabel done;
+    if (mode_ != ASCII) {
+      // Table is 128 entries, so all ASCII characters can be tested.
+      BranchOrBacktrack(Comparison(kGT,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant('z')),
+                        &done);
+    }
+
+    // TODO(zerny): Refactor to use CheckBitInTable if possible.
+
+    PushArgumentInstr* table_push =
+        PushArgument(Bind(WordCharacterMapConstant()));
+    PushArgumentInstr* index_push = PushLocal(current_character_);
+
+    Definition* byte_def =
+        InstanceCall(InstanceCallDescriptor::FromToken(Token::kINDEX),
+                     table_push,
+                     index_push);
+    Definition* zero_def = Int64Constant(0);
+
+    BranchOrBacktrack(Comparison(kNE, byte_def, zero_def), on_no_match);
+
+    if (mode_ != ASCII) {
+      BindBlock(&done);
+    }
+    return true;
+  }
+  // Non-standard classes (with no syntactic shorthand) used internally.
+  case '*':
+    // Match any character.
+    return true;
+  case 'n': {
+    // Match newlines (0x0a('\n'), 0x0d('\r'), 0x2028 or 0x2029).
+    // The opposite of '.'.
+    BlockLabel success;
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(current_character_),
+                                 Uint64Constant('\n')),
+                      &success);
+    BranchOrBacktrack(Comparison(kEQ,
+                                 LoadLocal(current_character_),
+                                 Uint64Constant('\r')),
+                      &success);
+    if (mode_ == UC16) {
+      BranchOrBacktrack(Comparison(kEQ,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(0x2028)),
+                        &success);
+      BranchOrBacktrack(Comparison(kEQ,
+                                   LoadLocal(current_character_),
+                                   Uint64Constant(0x2029)),
+                        &success);
+    }
+    BranchOrBacktrack(NULL, on_no_match);
+    BindBlock(&success);
+    return true;
+  }
+  // No custom implementation (yet): s(uint16_t), S(uint16_t).
+  default:
+    return false;
+  }
+}
+
+
+void IRRegExpMacroAssembler::Fail() {
+  TAG();
+  ASSERT(FAILURE == 0);  // Return value for failure is zero.
+  if (!global()) {
+    UNREACHABLE();  // Dart regexps are always global.
+  }
+  GoTo(exit_block_);
+}
+
+
+void IRRegExpMacroAssembler::IfRegisterGE(intptr_t reg,
+                                          intptr_t comparand,
+                                          BlockLabel* if_ge) {
+  TAG();
+  BranchOrBacktrack(Comparison(kGTE,
+                               LoadLocal(position_register(reg)),
+                               Int64Constant(comparand)),
+                    if_ge);
+}
+
+
+void IRRegExpMacroAssembler::IfRegisterLT(intptr_t reg,
+                                          intptr_t comparand,
+                                          BlockLabel* if_lt) {
+  TAG();
+  BranchOrBacktrack(Comparison(kLT,
+                               LoadLocal(position_register(reg)),
+                               Int64Constant(comparand)),
+                    if_lt);
+}
+
+
+void IRRegExpMacroAssembler::IfRegisterEqPos(intptr_t reg,
+                                             BlockLabel* if_eq) {
+  TAG();
+  BranchOrBacktrack(Comparison(kEQ,
+                               LoadLocal(position_register(reg)),
+                               LoadLocal(current_position_)),
+                    if_eq);
+}
+
+
+RegExpMacroAssembler::IrregexpImplementation
+    IRRegExpMacroAssembler::Implementation() {
+  return kIRImplementation;
+}
+
+
+void IRRegExpMacroAssembler::LoadCurrentCharacter(intptr_t cp_offset,
+                                                  BlockLabel* on_end_of_input,
+                                                  bool check_bounds,
+                                                  intptr_t characters) {
+  TAG();
+  ASSERT(cp_offset >= -1);      // ^ and \b can look behind one character.
+  ASSERT(cp_offset < (1<<30));  // Be sane! (And ensure negation works)
+  if (check_bounds) {
+    CheckPosition(cp_offset + characters - 1, on_end_of_input);
+  }
+  LoadCurrentCharacterUnchecked(cp_offset, characters);
+}
+
+
+void IRRegExpMacroAssembler::PopCurrentPosition() {
+  TAG();
+  StoreLocal(current_position_, PopStack());
+}
+
+
+void IRRegExpMacroAssembler::PopRegister(intptr_t register_index) {
+  TAG();
+  ASSERT(register_index < position_registers_.length());
+  StoreLocal(position_register(register_index), PopStack());
+}
+
+
+void IRRegExpMacroAssembler::PushStack(Definition *definition) {
+  PushArgumentInstr* stack_push = PushLocal(stack_);
+  PushArgumentInstr* value_push = PushArgument(Bind(definition));
+  Do(InstanceCall(InstanceCallDescriptor(Symbols::add()),
+                  stack_push,
+                  value_push));
+}
+
+
+Value* IRRegExpMacroAssembler::PopStack() {
+  PushArgumentInstr* stack_push = PushLocal(stack_);
+  return Bind(InstanceCall(InstanceCallDescriptor(Symbols::removeLast()),
+                           stack_push));
+}
+
+
+// Pushes the location corresponding to label to the backtracking stack.
+void IRRegExpMacroAssembler::PushBacktrack(BlockLabel* label) {
+  TAG();
+
+  // Ensure that targets of indirect jumps are never accessed through a
+  // normal control flow instructions by creating a new block for each backtrack
+  // target.
+  IndirectEntryInstr* indirect_target = IndirectWithJoinGoto(label->block());
+
+  // Add a fake edge from the graph entry for data flow analysis.
+  entry_block_->AddIndirectEntry(indirect_target);
+
+  ConstantInstr* offset = Uint64Constant(indirect_target->indirect_id());
+  PushStack(offset);
+}
+
+
+void IRRegExpMacroAssembler::PushCurrentPosition() {
+  TAG();
+  PushStack(LoadLocal(current_position_));
+}
+
+
+void IRRegExpMacroAssembler::PushRegister(intptr_t register_index) {
+  TAG();
+  PushStack(LoadLocal(position_register(register_index)));
+}
+
+
+void IRRegExpMacroAssembler::ReadCurrentPositionFromRegister(intptr_t reg) {
+  TAG();
+  StoreLocal(current_position_, Bind(LoadLocal(position_register(reg))));
+}
+
+// Resets the size of the stack to the value stored in reg.
+void IRRegExpMacroAssembler::ReadStackPointerFromRegister(intptr_t reg) {
+  TAG();
+  ASSERT(reg < position_registers_.length());
+
+  PushArgumentInstr* stack_push = PushLocal(stack_);
+  PushArgumentInstr* length_push = PushLocal(position_register(reg));
+
+  Do(InstanceCall(
+      InstanceCallDescriptor(
+          String::ZoneHandle(I, Field::SetterSymbol(Symbols::Length()))),
+      stack_push,
+      length_push));
+}
+
+void IRRegExpMacroAssembler::SetCurrentPositionFromEnd(intptr_t by)  {
+  TAG();
+
+  BlockLabel after_position;
+
+  Definition* cur_pos_def = LoadLocal(current_position_);
+  Definition* by_value_def = Int64Constant(-by);
+
+  BranchOrBacktrack(Comparison(kGTE, cur_pos_def, by_value_def),
+                    &after_position);
+
+  StoreLocal(current_position_, Bind(Int64Constant(-by)));
+
+  // On RegExp code entry (where this operation is used), the character before
+  // the current position is expected to be already loaded.
+  // We have advanced the position, so it's safe to read backwards.
+  LoadCurrentCharacterUnchecked(-1, 1);
+
+  BindBlock(&after_position);
+}
+
+
+void IRRegExpMacroAssembler::SetRegister(intptr_t register_index, intptr_t to) {
+  TAG();
+  // Reserved for positions!
+  ASSERT(register_index >= position_registers_count_);
+  StoreLocal(position_register(register_index), Bind(Int64Constant(to)));
+}
+
+
+bool IRRegExpMacroAssembler::Succeed() {
+  TAG();
+  GoTo(success_block_);
+  return global();
+}
+
+
+void IRRegExpMacroAssembler::WriteCurrentPositionToRegister(
+    intptr_t reg, intptr_t cp_offset) {
+  TAG();
+
+  PushArgumentInstr* pos_push = PushLocal(current_position_);
+  PushArgumentInstr* off_push =
+      PushArgument(Bind(Int64Constant(cp_offset)));
+
+  // Push the negative offset; these are converted to positive string positions
+  // within the success block.
+  StoreLocal(position_register(reg), Bind(Add(pos_push, off_push)));
+}
+
+
+void IRRegExpMacroAssembler::ClearRegisters(
+    intptr_t reg_from, intptr_t reg_to) {
+  TAG();
+
+  ASSERT(reg_from <= reg_to);
+  ASSERT(reg_to < position_registers_.length());
+
+  // In order to clear registers to a final result value of -1, set them to
+  // (-1 - string length), the offset of -1 from the end of the string.
+
+  for (intptr_t reg = reg_from; reg <= reg_to; reg++) {
+    PushArgumentInstr* minus_one_push =
+        PushArgument(Bind(Int64Constant(-1)));
+    PushArgumentInstr* length_push = PushLocal(string_param_length_);
+
+    StoreLocal(position_register(reg), Bind(Sub(minus_one_push, length_push)));
+  }
+}
+
+
+void IRRegExpMacroAssembler::WriteStackPointerToRegister(intptr_t reg) {
+  TAG();
+
+  PushArgumentInstr* stack_push = PushLocal(stack_);
+  Value* length_value =
+      Bind(InstanceCall(InstanceCallDescriptor(
+                          String::ZoneHandle(
+                            I, Field::GetterSymbol(Symbols::Length()))),
+                        stack_push));
+
+  StoreLocal(position_register(reg), length_value);
+}
+
+
+// Private methods:
+
+
+void IRRegExpMacroAssembler::CheckPosition(intptr_t cp_offset,
+                                           BlockLabel* on_outside_input) {
+  TAG();
+  Definition* curpos_def = LoadLocal(current_position_);
+  Definition* cp_off_def = Int64Constant(-cp_offset);
+
+  // If (current_position_ < -cp_offset), we are in bounds.
+  // Remember, current_position_ is a negative offset from the string end.
+
+  BranchOrBacktrack(Comparison(kGTE, curpos_def, cp_off_def),
+                    on_outside_input);
+}
+
+
+void IRRegExpMacroAssembler::BranchOrBacktrack(
+    ComparisonInstr* comparison,
+    BlockLabel* true_successor) {
+  if (comparison == NULL) {  // No condition
+    if (true_successor == NULL) {
+      Backtrack();
+      return;
+    }
+    GoTo(true_successor);
+    return;
+  }
+
+  // If no successor block has been passed in, backtrack.
+  JoinEntryInstr* true_successor_block = backtrack_block_;
+  if (true_successor != NULL) {
+    true_successor->SetLinked();
+    true_successor_block = true_successor->block();
+  }
+  ASSERT(true_successor_block != NULL);
+
+  // If the condition is not true, fall through to a new block.
+  BlockLabel fallthrough;
+
+  BranchInstr* branch = new(I) BranchInstr(comparison);
+  *branch->true_successor_address() =
+      TargetWithJoinGoto(true_successor_block);
+  *branch->false_successor_address() =
+      TargetWithJoinGoto(fallthrough.block());
+
+  CloseBlockWith(branch);
+  BindBlock(&fallthrough);
+}
+
+
+TargetEntryInstr* IRRegExpMacroAssembler::TargetWithJoinGoto(
+    JoinEntryInstr* dst) {
+  TargetEntryInstr* target = new(I) TargetEntryInstr(
+          block_id_.Alloc(), kInvalidTryIndex);
+  blocks_.Add(target);
+
+  target->AppendInstruction(new(I) GotoInstr(dst));
+
+  return target;
+}
+
+
+IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
+    JoinEntryInstr* dst) {
+  IndirectEntryInstr* target = new(I) IndirectEntryInstr(
+          block_id_.Alloc(), indirect_id_.Alloc(), kInvalidTryIndex);
+  blocks_.Add(target);
+
+  target->AppendInstruction(new(I) GotoInstr(dst));
+
+  return target;
+}
+
+
+void IRRegExpMacroAssembler::CheckPreemption() {
+  TAG();
+  AppendInstruction(new(I) CheckStackOverflowInstr(kNoSourcePos, 0));
+}
+
+
+Definition* IRRegExpMacroAssembler::Add(
+    PushArgumentInstr* lhs,
+    PushArgumentInstr* rhs) {
+  return InstanceCall(InstanceCallDescriptor::FromToken(Token::kADD), lhs, rhs);
+}
+
+
+Definition* IRRegExpMacroAssembler::Sub(
+    PushArgumentInstr* lhs,
+    PushArgumentInstr* rhs) {
+  return InstanceCall(InstanceCallDescriptor::FromToken(Token::kSUB), lhs, rhs);
+}
+
+
+void IRRegExpMacroAssembler::LoadCurrentCharacterUnchecked(
+    intptr_t cp_offset, intptr_t characters) {
+  TAG();
+
+  ASSERT(characters == 1 || CanReadUnaligned());
+  if (mode_ == ASCII) {
+    ASSERT(characters == 1 || characters == 2 || characters == 4);
+  } else {
+    ASSERT(mode_ == UC16);
+    ASSERT(characters == 1 || characters == 2);
+  }
+
+  // Bind the pattern as the load receiver.
+  Value* pattern = BindLoadLocal(*string_param_);
+
+  // Calculate the addressed string index as:
+  //    cp_offset + current_position_ + string_param_length_
+  // TODO(zerny): Avoid generating 'add' instance-calls here.
+  PushArgumentInstr* off_arg =
+      PushArgument(Bind(Int64Constant(cp_offset)));
+  PushArgumentInstr* pos_arg =
+      PushArgument(BindLoadLocal(*current_position_));
+  PushArgumentInstr* off_pos_arg =
+      PushArgument(Bind(Add(off_arg, pos_arg)));
+  PushArgumentInstr* len_arg =
+      PushArgument(BindLoadLocal(*string_param_length_));
+  Value* index = Bind(Add(off_pos_arg, len_arg));
+
+  // Load and store the code units.
+  Value* code_unit_value = LoadCodeUnitsAt(pattern, index, characters);
+  StoreLocal(current_character_, code_unit_value);
+  PRINT(PushLocal(current_character_));
+}
+
+
+Value* IRRegExpMacroAssembler::CharacterAt(Definition* index) {
+  Value* pattern_val = BindLoadLocal(*string_param_);
+  Value* index_val = Bind(index);
+  return LoadCodeUnitsAt(pattern_val, index_val, 1);
+}
+
+
+// Note: We can't replace pattern with a load-local of string_param_
+// because we need to maintain the stack discipline in unoptimized code.
+Value* IRRegExpMacroAssembler::LoadCodeUnitsAt(Value* pattern,
+                                               Value* index,
+                                               intptr_t characters) {
+  return Bind(new(I) LoadCodeUnitsInstr(
+      pattern,
+      index,
+      characters,
+      specialization_cid_,
+      Scanner::kNoSourcePos));
+}
+
+
+#undef __
 
 }  // namespace dart
diff --git a/runtime/vm/regexp_assembler.h b/runtime/vm/regexp_assembler.h
index ace607b..1c5d4fe 100644
--- a/runtime/vm/regexp_assembler.h
+++ b/runtime/vm/regexp_assembler.h
@@ -5,139 +5,196 @@
 #ifndef VM_REGEXP_ASSEMBLER_H_
 #define VM_REGEXP_ASSEMBLER_H_
 
-// SNIP
+#include "vm/assembler.h"
+#include "vm/intermediate_language.h"
+#include "vm/object.h"
 
 namespace dart {
 
-// SNIP
+// Utility function for the DotPrinter
+void PrintUtf16(uint16_t c);
 
-class RegExpMacroAssembler {
+
+/// Convenience wrapper around a BlockEntryInstr pointer.
+class BlockLabel : public ValueObject {
+ public:
+  BlockLabel()
+    : block_(new JoinEntryInstr(-1, -1)),
+      is_bound_(false),
+      is_linked_(false) { }
+
+  BlockLabel(const BlockLabel& that)
+    : ValueObject(),
+      block_(that.block_),
+      is_bound_(that.is_bound_),
+      is_linked_(that.is_linked_) { }
+
+  BlockLabel& operator=(const BlockLabel& that) {
+    block_ = that.block_;
+    is_bound_ = that.is_bound_;
+    is_linked_ = that.is_linked_;
+    return *this;
+  }
+
+  JoinEntryInstr* block() const { return block_; }
+
+  bool IsBound() const { return is_bound_; }
+  void SetBound(intptr_t block_id) {
+    ASSERT(!is_bound_);
+    block_->set_block_id(block_id);
+    is_bound_ = true;
+  }
+
+  bool IsLinked() const { return !is_bound_ && is_linked_; }
+  void SetLinked() {
+    is_linked_ = true;
+  }
+
+  intptr_t Position() const {
+    ASSERT(IsBound());
+    return block_->block_id();
+  }
+
+ private:
+  JoinEntryInstr* block_;
+
+  bool is_bound_;
+  bool is_linked_;
+};
+
+
+class RegExpMacroAssembler : public ZoneAllocated {
  public:
   // The implementation must be able to handle at least:
-  static const int kMaxRegister = (1 << 16) - 1;
-  static const int kMaxCPOffset = (1 << 15) - 1;
-  static const int kMinCPOffset = -(1 << 15);
+  static const intptr_t kMaxRegister = (1 << 16) - 1;
+  static const intptr_t kMaxCPOffset = (1 << 15) - 1;
+  static const intptr_t kMinCPOffset = -(1 << 15);
 
-  static const int kTableSizeBits = 7;
-  static const int kTableSize = 1 << kTableSizeBits;
-  static const int kTableMask = kTableSize - 1;
+  static const intptr_t kTableSizeBits = 7;
+  static const intptr_t kTableSize = 1 << kTableSizeBits;
+  static const intptr_t kTableMask = kTableSize - 1;
+
+  enum {
+    kParamStringIndex = 0,
+    kParamStartOffsetIndex,
+    kParamCount
+  };
 
   enum IrregexpImplementation {
-    kIA32Implementation,
-    kARMImplementation,
-    kARM64Implementation,
-    kMIPSImplementation,
-    kX64Implementation,
-    kX87Implementation,
-    kBytecodeImplementation
+    kIRImplementation
   };
 
-  enum StackCheckFlag {
-    kNoStackLimitCheck = false,
-    kCheckStackLimit = true
-  };
-
-  explicit RegExpMacroAssembler(Zone* zone);
+  explicit RegExpMacroAssembler(Isolate* isolate);
   virtual ~RegExpMacroAssembler();
   // The maximal number of pushes between stack checks. Users must supply
   // kCheckStackLimit flag to push operations (instead of kNoStackLimitCheck)
   // at least once for every stack_limit() pushes that are executed.
-  virtual int stack_limit_slack() = 0;
+  virtual intptr_t stack_limit_slack() = 0;
   virtual bool CanReadUnaligned() = 0;
-  virtual void AdvanceCurrentPosition(int by) = 0;  // Signed cp change.
-  virtual void AdvanceRegister(int reg, int by) = 0;  // r[reg] += by.
+  virtual void AdvanceCurrentPosition(intptr_t by) = 0;  // Signed cp change.
+  virtual void AdvanceRegister(intptr_t reg, intptr_t by) = 0;  // r[reg] += by.
   // Continues execution from the position pushed on the top of the backtrack
-  // stack by an earlier PushBacktrack(Label*).
+  // stack by an earlier PushBacktrack(BlockLabel*).
   virtual void Backtrack() = 0;
-  virtual void Bind(Label* label) = 0;
-  virtual void CheckAtStart(Label* on_at_start) = 0;
+  virtual void BindBlock(BlockLabel* label) = 0;
+  virtual void CheckAtStart(BlockLabel* on_at_start) = 0;
   // Dispatch after looking the current character up in a 2-bits-per-entry
   // map.  The destinations vector has up to 4 labels.
-  virtual void CheckCharacter(unsigned c, Label* on_equal) = 0;
+  virtual void CheckCharacter(unsigned c, BlockLabel* on_equal) = 0;
   // Bitwise and the current character with the given constant and then
   // check for a match with c.
   virtual void CheckCharacterAfterAnd(unsigned c,
                                       unsigned and_with,
-                                      Label* on_equal) = 0;
-  virtual void CheckCharacterGT(uc16 limit, Label* on_greater) = 0;
-  virtual void CheckCharacterLT(uc16 limit, Label* on_less) = 0;
-  virtual void CheckGreedyLoop(Label* on_tos_equals_current_position) = 0;
-  virtual void CheckNotAtStart(Label* on_not_at_start) = 0;
-  virtual void CheckNotBackReference(int start_reg, Label* on_no_match) = 0;
-  virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
-                                               Label* on_no_match) = 0;
+                                      BlockLabel* on_equal) = 0;
+  virtual void CheckCharacterGT(uint16_t limit, BlockLabel* on_greater) = 0;
+  virtual void CheckCharacterLT(uint16_t limit, BlockLabel* on_less) = 0;
+  virtual void CheckGreedyLoop(BlockLabel* on_tos_equals_current_position) = 0;
+  virtual void CheckNotAtStart(BlockLabel* on_not_at_start) = 0;
+  virtual void CheckNotBackReference(
+      intptr_t start_reg, BlockLabel* on_no_match) = 0;
+  virtual void CheckNotBackReferenceIgnoreCase(intptr_t start_reg,
+                                               BlockLabel* on_no_match) = 0;
   // Check the current character for a match with a literal character.  If we
   // fail to match then goto the on_failure label.  End of input always
   // matches.  If the label is NULL then we should pop a backtrack address off
   // the stack and go to that.
-  virtual void CheckNotCharacter(unsigned c, Label* on_not_equal) = 0;
+  virtual void CheckNotCharacter(unsigned c, BlockLabel* on_not_equal) = 0;
   virtual void CheckNotCharacterAfterAnd(unsigned c,
                                          unsigned and_with,
-                                         Label* on_not_equal) = 0;
+                                         BlockLabel* on_not_equal) = 0;
   // Subtract a constant from the current character, then and with the given
   // constant and then check for a match with c.
-  virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
-                                              uc16 minus,
-                                              uc16 and_with,
-                                              Label* on_not_equal) = 0;
-  virtual void CheckCharacterInRange(uc16 from,
-                                     uc16 to,  // Both inclusive.
-                                     Label* on_in_range) = 0;
-  virtual void CheckCharacterNotInRange(uc16 from,
-                                        uc16 to,  // Both inclusive.
-                                        Label* on_not_in_range) = 0;
+  virtual void CheckNotCharacterAfterMinusAnd(uint16_t c,
+                                              uint16_t minus,
+                                              uint16_t and_with,
+                                              BlockLabel* on_not_equal) = 0;
+  virtual void CheckCharacterInRange(uint16_t from,
+                                     uint16_t to,  // Both inclusive.
+                                     BlockLabel* on_in_range) = 0;
+  virtual void CheckCharacterNotInRange(uint16_t from,
+                                        uint16_t to,  // Both inclusive.
+                                        BlockLabel* on_not_in_range) = 0;
 
   // The current character (modulus the kTableSize) is looked up in the byte
   // array, and if the found byte is non-zero, we jump to the on_bit_set label.
-  virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set) = 0;
+  virtual void CheckBitInTable(const TypedData& table,
+                               BlockLabel* on_bit_set) = 0;
 
   // Checks whether the given offset from the current position is before
   // the end of the string.  May overwrite the current character.
-  virtual void CheckPosition(int cp_offset, Label* on_outside_input) {
+  virtual void CheckPosition(intptr_t cp_offset, BlockLabel* on_outside_input) {
     LoadCurrentCharacter(cp_offset, on_outside_input, true);
   }
   // Check whether a standard/default character class matches the current
   // character. Returns false if the type of special character class does
   // not have custom support.
   // May clobber the current loaded character.
-  virtual bool CheckSpecialCharacterClass(uc16 type,
-                                          Label* on_no_match) {
+  virtual bool CheckSpecialCharacterClass(uint16_t type,
+                                          BlockLabel* on_no_match) {
     return false;
   }
   virtual void Fail() = 0;
-  virtual Handle<HeapObject> GetCode(Handle<String> source) = 0;
-  virtual void GoTo(Label* label) = 0;
   // Check whether a register is >= a given constant and go to a label if it
   // is.  Backtracks instead if the label is NULL.
-  virtual void IfRegisterGE(int reg, int comparand, Label* if_ge) = 0;
+  virtual void IfRegisterGE(
+      intptr_t reg, intptr_t comparand, BlockLabel* if_ge) = 0;
   // Check whether a register is < a given constant and go to a label if it is.
   // Backtracks instead if the label is NULL.
-  virtual void IfRegisterLT(int reg, int comparand, Label* if_lt) = 0;
+  virtual void IfRegisterLT(
+      intptr_t reg, intptr_t comparand, BlockLabel* if_lt) = 0;
   // Check whether a register is == to the current position and go to a
   // label if it is.
-  virtual void IfRegisterEqPos(int reg, Label* if_eq) = 0;
+  virtual void IfRegisterEqPos(intptr_t reg, BlockLabel* if_eq) = 0;
   virtual IrregexpImplementation Implementation() = 0;
-  virtual void LoadCurrentCharacter(int cp_offset,
-                                    Label* on_end_of_input,
+  // The assembler is closed, iff there is no current instruction assigned.
+  virtual bool IsClosed() const = 0;
+  // Jump to the target label without setting it as the current instruction.
+  virtual void GoTo(BlockLabel* to) = 0;
+  virtual void LoadCurrentCharacter(intptr_t cp_offset,
+                                    BlockLabel* on_end_of_input,
                                     bool check_bounds = true,
-                                    int characters = 1) = 0;
+                                    intptr_t characters = 1) = 0;
   virtual void PopCurrentPosition() = 0;
-  virtual void PopRegister(int register_index) = 0;
+  virtual void PopRegister(intptr_t register_index) = 0;
+  // Prints string within the generated code. Used for debugging.
+  virtual void Print(const char* str) = 0;
+  // Prints all emitted blocks.
+  virtual void PrintBlocks() = 0;
   // Pushes the label on the backtrack stack, so that a following Backtrack
   // will go to this label. Always checks the backtrack stack limit.
-  virtual void PushBacktrack(Label* label) = 0;
+  virtual void PushBacktrack(BlockLabel* label) = 0;
   virtual void PushCurrentPosition() = 0;
-  virtual void PushRegister(int register_index,
-                            StackCheckFlag check_stack_limit) = 0;
-  virtual void ReadCurrentPositionFromRegister(int reg) = 0;
-  virtual void ReadStackPointerFromRegister(int reg) = 0;
-  virtual void SetCurrentPositionFromEnd(int by) = 0;
-  virtual void SetRegister(int register_index, int to) = 0;
+  virtual void PushRegister(intptr_t register_index) = 0;
+  virtual void ReadCurrentPositionFromRegister(intptr_t reg) = 0;
+  virtual void ReadStackPointerFromRegister(intptr_t reg) = 0;
+  virtual void SetCurrentPositionFromEnd(intptr_t by) = 0;
+  virtual void SetRegister(intptr_t register_index, intptr_t to) = 0;
   // Return whether the matching (with a global regexp) will be restarted.
   virtual bool Succeed() = 0;
-  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0;
-  virtual void ClearRegisters(int reg_from, int reg_to) = 0;
-  virtual void WriteStackPointerToRegister(int reg) = 0;
+  virtual void WriteCurrentPositionToRegister(
+      intptr_t reg, intptr_t cp_offset) = 0;
+  virtual void ClearRegisters(intptr_t reg_from, intptr_t reg_to) = 0;
+  virtual void WriteStackPointerToRegister(intptr_t reg) = 0;
 
   // Controls the generation of large inlined constants in the code.
   void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; }
@@ -152,15 +209,420 @@
     return global_mode_ == GLOBAL;
   }
 
-  Zone* zone() const { return zone_; }
+  Isolate* isolate() const { return isolate_; }
 
  private:
   bool slow_safe_compiler_;
   bool global_mode_;
-  Zone* zone_;
+  Isolate* isolate_;
 };
 
-// SNIP
+
+class IRRegExpMacroAssembler : public RegExpMacroAssembler {
+ public:
+  // Type of input string to generate code for.
+  enum Mode { ASCII = 1, UC16 = 2 };
+
+  // Result of calling generated native RegExp code.
+  // RETRY: Something significant changed during execution, and the matching
+  //        should be retried from scratch.
+  // EXCEPTION: Something failed during execution. If no exception has been
+  //        thrown, it's an internal out-of-memory, and the caller should
+  //        throw the exception.
+  // FAILURE: Matching failed.
+  // SUCCESS: Matching succeeded, and the output array has been filled with
+  //        capture positions.
+  enum Result { RETRY = -2, EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 };
+
+  IRRegExpMacroAssembler(intptr_t specialization_cid,
+                         intptr_t capture_count,
+                         const ParsedFunction* parsed_function,
+                         const ZoneGrowableArray<const ICData*>& ic_data_array,
+                         Isolate* isolate);
+  virtual ~IRRegExpMacroAssembler();
+
+  virtual bool CanReadUnaligned();
+
+  // Compares two-byte strings case insensitively.
+  // Called from generated RegExp code.
+  static RawBool* CaseInsensitiveCompareUC16(
+      RawString* str_raw,
+      RawSmi* lhs_index_raw,
+      RawSmi* rhs_index_raw,
+      RawSmi* length_raw);
+
+  static RawArray* Execute(const Function& function,
+                           const String& input,
+                           const Smi& start_offset,
+                           Isolate* isolate);
+
+  virtual bool IsClosed() const { return (current_instruction_ == NULL); }
+
+  virtual intptr_t stack_limit_slack();
+  virtual void AdvanceCurrentPosition(intptr_t by);
+  virtual void AdvanceRegister(intptr_t reg, intptr_t by);
+  virtual void Backtrack();
+  virtual void BindBlock(BlockLabel* label);
+  virtual void CheckAtStart(BlockLabel* on_at_start);
+  virtual void CheckCharacter(uint32_t c, BlockLabel* on_equal);
+  virtual void CheckCharacterAfterAnd(uint32_t c,
+                                      uint32_t mask,
+                                      BlockLabel* on_equal);
+  virtual void CheckCharacterGT(uint16_t limit, BlockLabel* on_greater);
+  virtual void CheckCharacterLT(uint16_t limit, BlockLabel* on_less);
+  // A "greedy loop" is a loop that is both greedy and with a simple
+  // body. It has a particularly simple implementation.
+  virtual void CheckGreedyLoop(BlockLabel* on_tos_equals_current_position);
+  virtual void CheckNotAtStart(BlockLabel* on_not_at_start);
+  virtual void CheckNotBackReference(intptr_t start_reg,
+                                     BlockLabel* on_no_match);
+  virtual void CheckNotBackReferenceIgnoreCase(intptr_t start_reg,
+                                               BlockLabel* on_no_match);
+  virtual void CheckNotCharacter(uint32_t c, BlockLabel* on_not_equal);
+  virtual void CheckNotCharacterAfterAnd(uint32_t c,
+                                         uint32_t mask,
+                                         BlockLabel* on_not_equal);
+  virtual void CheckNotCharacterAfterMinusAnd(uint16_t c,
+                                              uint16_t minus,
+                                              uint16_t mask,
+                                              BlockLabel* on_not_equal);
+  virtual void CheckCharacterInRange(uint16_t from,
+                                     uint16_t to,
+                                     BlockLabel* on_in_range);
+  virtual void CheckCharacterNotInRange(uint16_t from,
+                                        uint16_t to,
+                                        BlockLabel* on_not_in_range);
+  virtual void CheckBitInTable(const TypedData& table, BlockLabel* on_bit_set);
+
+  // Checks whether the given offset from the current position is before
+  // the end of the string.
+  virtual void CheckPosition(intptr_t cp_offset, BlockLabel* on_outside_input);
+  virtual bool CheckSpecialCharacterClass(
+      uint16_t type, BlockLabel* on_no_match);
+  virtual void Fail();
+  virtual void IfRegisterGE(intptr_t reg,
+                            intptr_t comparand, BlockLabel* if_ge);
+  virtual void IfRegisterLT(intptr_t reg,
+                            intptr_t comparand, BlockLabel* if_lt);
+  virtual void IfRegisterEqPos(intptr_t reg, BlockLabel* if_eq);
+  virtual IrregexpImplementation Implementation();
+  virtual void GoTo(BlockLabel* to);
+  virtual void LoadCurrentCharacter(intptr_t cp_offset,
+                                    BlockLabel* on_end_of_input,
+                                    bool check_bounds = true,
+                                    intptr_t characters = 1);
+  virtual void PopCurrentPosition();
+  virtual void PopRegister(intptr_t register_index);
+  virtual void Print(const char* str);
+  virtual void PushBacktrack(BlockLabel* label);
+  virtual void PushCurrentPosition();
+  virtual void PushRegister(intptr_t register_index);
+  virtual void ReadCurrentPositionFromRegister(intptr_t reg);
+  virtual void ReadStackPointerFromRegister(intptr_t reg);
+  virtual void SetCurrentPositionFromEnd(intptr_t by);
+  virtual void SetRegister(intptr_t register_index, intptr_t to);
+  virtual bool Succeed();
+  virtual void WriteCurrentPositionToRegister(intptr_t reg, intptr_t cp_offset);
+  virtual void ClearRegisters(intptr_t reg_from, intptr_t reg_to);
+  virtual void WriteStackPointerToRegister(intptr_t reg);
+
+  virtual void PrintBlocks();
+
+  IndirectGotoInstr* backtrack_goto() const { return backtrack_goto_; }
+  GraphEntryInstr* graph_entry() const { return entry_block_; }
+
+  intptr_t num_stack_locals() const { return local_id_.Count(); }
+  intptr_t num_blocks() const { return block_id_.Count(); }
+
+  // Generate a dispatch block implementing backtracking. Must be done after
+  // graph construction.
+  void GenerateBacktrackBlock();
+
+ private:
+  // Generate the contents of preset blocks. The entry block is the entry point
+  // of the generated code.
+  void GenerateEntryBlock();
+  // Copies capture indices into the result area and returns true.
+  void GenerateSuccessBlock();
+  // Returns false.
+  void GenerateExitBlock();
+
+  enum ComparisonKind {
+    kEQ,
+    kNE,
+    kLT,
+    kGT,
+    kLTE,
+    kGTE,
+  };
+
+  struct InstanceCallDescriptor {
+    // Standard (i.e. most non-Smi) functions.
+    explicit InstanceCallDescriptor(const String& name)
+      : name(name),
+        token_kind(Token::kILLEGAL),
+        checked_argument_count(1) { }
+
+    InstanceCallDescriptor(const String& name,
+                           Token::Kind token_kind,
+                           intptr_t checked_argument_count)
+      : name(name),
+        token_kind(token_kind),
+        checked_argument_count(checked_argument_count) { }
+
+    // Special cases for Smi and indexing functions.
+    static InstanceCallDescriptor FromToken(Token::Kind token_kind) {
+      switch (token_kind) {
+        case Token::kEQ: return InstanceCallDescriptor(
+                  Symbols::EqualOperator(), token_kind, 2);
+        case Token::kADD: return InstanceCallDescriptor(
+                Symbols::Plus(), token_kind, 2);
+        case Token::kSUB: return InstanceCallDescriptor(
+                Symbols::Minus(), token_kind, 2);
+        case Token::kBIT_OR: return InstanceCallDescriptor(
+                Symbols::BitOr(), token_kind, 2);
+        case Token::kBIT_AND: return InstanceCallDescriptor(
+                Symbols::BitAnd(), token_kind, 2);
+        case Token::kLT: return InstanceCallDescriptor(
+                Symbols::LAngleBracket(), token_kind, 2);
+        case Token::kLTE: return InstanceCallDescriptor(
+                Symbols::LessEqualOperator(), token_kind, 2);
+        case Token::kGT: return InstanceCallDescriptor(
+                Symbols::RAngleBracket(), token_kind, 2);
+        case Token::kGTE: return InstanceCallDescriptor(
+                Symbols::GreaterEqualOperator(), token_kind, 2);
+        case Token::kNEGATE: return InstanceCallDescriptor(
+                Symbols::UnaryMinus(), token_kind, 1);
+        case Token::kINDEX: return InstanceCallDescriptor(
+                Symbols::IndexToken(), token_kind, 2);
+        case Token::kASSIGN_INDEX: return InstanceCallDescriptor(
+                Symbols::AssignIndexToken(), token_kind, 3);
+        default:
+          UNREACHABLE();
+      }
+      UNREACHABLE();
+      return InstanceCallDescriptor(Symbols::Empty());
+    }
+
+    const String& name;
+    Token::Kind token_kind;
+    intptr_t checked_argument_count;
+  };
+
+  LocalVariable* Local(const String& name);
+  LocalVariable* Parameter(const String& name, intptr_t index) const;
+
+  ConstantInstr* Int64Constant(int64_t value) const;
+  ConstantInstr* Uint64Constant(uint64_t value) const;
+  ConstantInstr* BoolConstant(bool value) const;
+  ConstantInstr* StringConstant(const char* value) const;
+
+  // The word character map static member of the RegExp class.
+  // Byte map of one byte characters with a 0xff if the character is a word
+  // character (digit, letter or underscore) and 0x00 otherwise.
+  // Used by generated RegExp code.
+  ConstantInstr* WordCharacterMapConstant() const;
+
+  ComparisonInstr* Comparison(ComparisonKind kind,
+                              Definition* lhs, Definition* rhs);
+
+  InstanceCallInstr* InstanceCall(const InstanceCallDescriptor& desc,
+                                  PushArgumentInstr* arg1) const;
+  InstanceCallInstr* InstanceCall(const InstanceCallDescriptor& desc,
+                                  PushArgumentInstr* arg1,
+                                  PushArgumentInstr* arg2) const;
+  InstanceCallInstr* InstanceCall(const InstanceCallDescriptor& desc,
+                                  PushArgumentInstr* arg1,
+                                  PushArgumentInstr* arg2,
+                                  PushArgumentInstr* arg3) const;
+  InstanceCallInstr* InstanceCall(
+      const InstanceCallDescriptor& desc,
+      ZoneGrowableArray<PushArgumentInstr*>* arguments) const;
+
+  StaticCallInstr* StaticCall(const Function& function) const;
+  StaticCallInstr* StaticCall(const Function& function,
+                              PushArgumentInstr* arg1) const;
+  StaticCallInstr* StaticCall(const Function& function,
+                              PushArgumentInstr* arg1,
+                              PushArgumentInstr* arg2) const;
+  StaticCallInstr* StaticCall(
+      const Function& function,
+      ZoneGrowableArray<PushArgumentInstr*>* arguments) const;
+
+  // Creates a new block consisting simply of a goto to dst.
+  TargetEntryInstr* TargetWithJoinGoto(JoinEntryInstr* dst);
+  IndirectEntryInstr* IndirectWithJoinGoto(JoinEntryInstr* dst);
+
+  // Adds, respectively subtracts lhs and rhs and returns the result.
+  Definition* Add(PushArgumentInstr* lhs, PushArgumentInstr* rhs);
+  Definition* Sub(PushArgumentInstr* lhs, PushArgumentInstr* rhs);
+
+  LoadLocalInstr* LoadLocal(LocalVariable* local) const;
+  void StoreLocal(LocalVariable* local, Value* value);
+
+  PushArgumentInstr* PushArgument(Value* value);
+  PushArgumentInstr* PushLocal(LocalVariable* local);
+
+  // Load a number of characters at the given offset from the
+  // current position, into the current-character register.
+  void LoadCurrentCharacterUnchecked(intptr_t cp_offset,
+                                     intptr_t character_count);
+
+  // Returns the character within the passed string at the specified index.
+  Value* CharacterAt(Definition* index);
+
+  // Load a number of characters starting from index in the pattern string.
+  Value* LoadCodeUnitsAt(Value* pattern,
+                         Value* index,
+                         intptr_t character_count);
+
+  // Check whether preemption has been requested.
+  void CheckPreemption();
+
+  // Byte size of chars in the string to match (decided by the Mode argument)
+  inline intptr_t char_size() { return static_cast<int>(mode_); }
+
+  // Equivalent to a conditional branch to the label, unless the label
+  // is NULL, in which case it is a conditional Backtrack.
+  void BranchOrBacktrack(ComparisonInstr* comparison,
+                         BlockLabel* true_successor);
+
+  // Set up all local variables and parameters.
+  void InitializeLocals();
+
+  // Allocates a new local, and returns the appropriate id for placing it
+  // on the stack.
+  intptr_t GetNextLocalIndex();
+
+  // We never have any copied parameters.
+  intptr_t num_copied_params() const {
+    return 0;
+  }
+
+  // Return the position register at the specified index, creating it if
+  // necessary. Note that the number of such registers can exceed the amount
+  // required by the number of output captures.
+  LocalVariable* position_register(intptr_t index);
+
+  void set_current_instruction(Instruction* instruction);
+
+  // The following functions are responsible for appending instructions
+  // to the current instruction in various ways. The most simple one
+  // is AppendInstruction, which simply appends an instruction and performs
+  // bookkeeping.
+  void AppendInstruction(Instruction* instruction);
+  // Similar to AppendInstruction, but closes the current block by
+  // setting current_instruction_ to NULL.
+  void CloseBlockWith(Instruction* instruction);
+  // Appends definition and allocates a temp index for the result.
+  Value* Bind(Definition* definition);
+  // Loads and binds a local variable.
+  Value* BindLoadLocal(const LocalVariable& local);
+
+  // Appends the definition.
+  void Do(Definition* definition);
+  // Closes the current block with a jump to the specified block.
+  void GoTo(JoinEntryInstr* to);
+
+  // Accessors for our local stack_.
+  void PushStack(Definition* definition);
+  Value* PopStack();
+
+  // Prints the specified argument. Used for debugging.
+  void Print(PushArgumentInstr* argument);
+
+  // A utility class tracking ids of various objects such as blocks, temps, etc.
+  class IdAllocator : public ValueObject {
+   public:
+    IdAllocator() : next_id(0) { }
+
+    intptr_t Count() const { return next_id; }
+    intptr_t Alloc(intptr_t count = 1) {
+      ASSERT(count >= 0);
+      intptr_t current_id = next_id;
+      next_id += count;
+      return current_id;
+    }
+    void Dealloc(intptr_t count = 1) {
+      ASSERT(count <= next_id);
+      next_id -= count;
+    }
+
+   private:
+    intptr_t next_id;
+  };
+
+  // Which mode to generate code for (ASCII or UC16).
+  Mode mode_;
+
+  // Which specific string class to generate code for.
+  intptr_t specialization_cid_;
+
+  // Block entries used internally.
+  GraphEntryInstr* entry_block_;
+  JoinEntryInstr* start_block_;
+  JoinEntryInstr* success_block_;
+  JoinEntryInstr* exit_block_;
+
+  // Shared backtracking block.
+  JoinEntryInstr* backtrack_block_;
+  // Single indirect goto instruction which performs all backtracking.
+  IndirectGotoInstr* backtrack_goto_;
+
+  const ParsedFunction* parsed_function_;
+  const ZoneGrowableArray<const ICData*>& ic_data_array_;
+
+  // All created blocks are contained within this set. Used for printing
+  // the generated code.
+  GrowableArray<BlockEntryInstr*> blocks_;
+
+  // The current instruction to link to when new code is emitted.
+  Instruction* current_instruction_;
+
+  // A list, acting as the runtime stack for both backtrack locations and
+  // stored positions within the string.
+  LocalVariable* stack_;
+
+  // Stores the current character within the string.
+  LocalVariable* current_character_;
+
+  // Stores the current location within the string as a negative offset
+  // from the end of the string.
+  LocalVariable* current_position_;
+
+  // The string being processed, passed as a function parameter.
+  LocalVariable* string_param_;
+
+  // Stores the length of string_param_.
+  LocalVariable* string_param_length_;
+
+  // The start index within the string, passed as a function parameter.
+  LocalVariable* start_index_param_;
+
+  // An assortment of utility variables.
+  LocalVariable* capture_length_;
+  LocalVariable* match_start_index_;
+  LocalVariable* capture_start_index_;
+  LocalVariable* match_end_index_;
+  LocalVariable* char_in_capture_;
+  LocalVariable* char_in_match_;
+
+  LocalVariable* result_;
+
+  // Stored positions containing group bounds. Generated as needed.
+  const intptr_t position_registers_count_;
+  GrowableArray<LocalVariable*> position_registers_;
+
+  // The actual array object used as the stack.
+  GrowableObjectArray& stack_array_;
+
+  IdAllocator block_id_;
+  IdAllocator temp_id_;
+  IdAllocator arg_id_;
+  IdAllocator local_id_;
+  IdAllocator indirect_id_;
+};
+
 
 }  // namespace dart
 
diff --git a/runtime/vm/regexp_ast.cc b/runtime/vm/regexp_ast.cc
index c36b890..9296170 100644
--- a/runtime/vm/regexp_ast.cc
+++ b/runtime/vm/regexp_ast.cc
@@ -4,7 +4,8 @@
 
 #include "vm/regexp_ast.h"
 
-// SNIP
+#include "platform/utils.h"
+#include "vm/os.h"
 
 namespace dart {
 
@@ -19,7 +20,7 @@
   RegExp##Name* RegExpTree::As##Name() {                             \
     return NULL;                                                     \
   }                                                                  \
-  bool RegExpTree::Is##Name() { return false; }
+  bool RegExpTree::Is##Name() const { return false; }
 FOR_EACH_REG_EXP_TREE_TYPE(MAKE_TYPE_CASE)
 #undef MAKE_TYPE_CASE
 
@@ -27,59 +28,59 @@
   RegExp##Name* RegExp##Name::As##Name() {                          \
     return this;                                                    \
   }                                                                 \
-  bool RegExp##Name::Is##Name() { return true; }
+  bool RegExp##Name::Is##Name() const { return true; }
 FOR_EACH_REG_EXP_TREE_TYPE(MAKE_TYPE_CASE)
 #undef MAKE_TYPE_CASE
 
 
-static Interval ListCaptureRegisters(ZoneList<RegExpTree*>* children) {
+static Interval ListCaptureRegisters(ZoneGrowableArray<RegExpTree*>* children) {
   Interval result = Interval::Empty();
-  for (int i = 0; i < children->length(); i++)
-    result = result.Union(children->at(i)->CaptureRegisters());
+  for (intptr_t i = 0; i < children->length(); i++)
+    result = result.Union(children->At(i)->CaptureRegisters());
   return result;
 }
 
 
-Interval RegExpAlternative::CaptureRegisters() {
+Interval RegExpAlternative::CaptureRegisters() const {
   return ListCaptureRegisters(nodes());
 }
 
 
-Interval RegExpDisjunction::CaptureRegisters() {
+Interval RegExpDisjunction::CaptureRegisters() const {
   return ListCaptureRegisters(alternatives());
 }
 
 
-Interval RegExpLookahead::CaptureRegisters() {
+Interval RegExpLookahead::CaptureRegisters() const {
   return body()->CaptureRegisters();
 }
 
 
-Interval RegExpCapture::CaptureRegisters() {
+Interval RegExpCapture::CaptureRegisters() const {
   Interval self(StartRegister(index()), EndRegister(index()));
   return self.Union(body()->CaptureRegisters());
 }
 
 
-Interval RegExpQuantifier::CaptureRegisters() {
+Interval RegExpQuantifier::CaptureRegisters() const {
   return body()->CaptureRegisters();
 }
 
 
-bool RegExpAssertion::IsAnchoredAtStart() {
+bool RegExpAssertion::IsAnchoredAtStart() const {
   return assertion_type() == RegExpAssertion::START_OF_INPUT;
 }
 
 
-bool RegExpAssertion::IsAnchoredAtEnd() {
+bool RegExpAssertion::IsAnchoredAtEnd() const {
   return assertion_type() == RegExpAssertion::END_OF_INPUT;
 }
 
 
-bool RegExpAlternative::IsAnchoredAtStart() {
-  ZoneList<RegExpTree*>* nodes = this->nodes();
-  for (int i = 0; i < nodes->length(); i++) {
-    RegExpTree* node = nodes->at(i);
+bool RegExpAlternative::IsAnchoredAtStart() const {
+  ZoneGrowableArray<RegExpTree*>* nodes = this->nodes();
+  for (intptr_t i = 0; i < nodes->length(); i++) {
+    RegExpTree* node = nodes->At(i);
     if (node->IsAnchoredAtStart()) { return true; }
     if (node->max_match() > 0) { return false; }
   }
@@ -87,10 +88,10 @@
 }
 
 
-bool RegExpAlternative::IsAnchoredAtEnd() {
-  ZoneList<RegExpTree*>* nodes = this->nodes();
-  for (int i = nodes->length() - 1; i >= 0; i--) {
-    RegExpTree* node = nodes->at(i);
+bool RegExpAlternative::IsAnchoredAtEnd() const {
+  ZoneGrowableArray<RegExpTree*>* nodes = this->nodes();
+  for (intptr_t i = nodes->length() - 1; i >= 0; i--) {
+    RegExpTree* node = nodes->At(i);
     if (node->IsAnchoredAtEnd()) { return true; }
     if (node->max_match() > 0) { return false; }
   }
@@ -98,37 +99,37 @@
 }
 
 
-bool RegExpDisjunction::IsAnchoredAtStart() {
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  for (int i = 0; i < alternatives->length(); i++) {
-    if (!alternatives->at(i)->IsAnchoredAtStart())
+bool RegExpDisjunction::IsAnchoredAtStart() const {
+  ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
+  for (intptr_t i = 0; i < alternatives->length(); i++) {
+    if (!alternatives->At(i)->IsAnchoredAtStart())
       return false;
   }
   return true;
 }
 
 
-bool RegExpDisjunction::IsAnchoredAtEnd() {
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  for (int i = 0; i < alternatives->length(); i++) {
-    if (!alternatives->at(i)->IsAnchoredAtEnd())
+bool RegExpDisjunction::IsAnchoredAtEnd() const {
+  ZoneGrowableArray<RegExpTree*>* alternatives = this->alternatives();
+  for (intptr_t i = 0; i < alternatives->length(); i++) {
+    if (!alternatives->At(i)->IsAnchoredAtEnd())
       return false;
   }
   return true;
 }
 
 
-bool RegExpLookahead::IsAnchoredAtStart() {
+bool RegExpLookahead::IsAnchoredAtStart() const {
   return is_positive() && body()->IsAnchoredAtStart();
 }
 
 
-bool RegExpCapture::IsAnchoredAtStart() {
+bool RegExpCapture::IsAnchoredAtStart() const {
   return body()->IsAnchoredAtStart();
 }
 
 
-bool RegExpCapture::IsAnchoredAtEnd() {
+bool RegExpCapture::IsAnchoredAtEnd() const {
   return body()->IsAnchoredAtEnd();
 }
 
@@ -138,46 +139,43 @@
 // in as many cases as possible, to make it more difficult for incorrect
 // parses to look as correct ones which is likely if the input and
 // output formats are alike.
-class RegExpUnparser FINAL : public RegExpVisitor {
+class RegExpUnparser : public RegExpVisitor {
  public:
-  RegExpUnparser(OStream& os, Zone* zone) : os_(os), zone_(zone) {}
   void VisitCharacterRange(CharacterRange that);
 #define MAKE_CASE(Name) virtual void* Visit##Name(RegExp##Name*,          \
-                                                  void* data) OVERRIDE;
+                                                  void* data);
   FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
 #undef MAKE_CASE
- private:
-  OStream& os_;
-  Zone* zone_;
 };
 
 
 void* RegExpUnparser::VisitDisjunction(RegExpDisjunction* that, void* data) {
-  os_ << "(|";
-  for (int i = 0; i <  that->alternatives()->length(); i++) {
-    os_ << " ";
-    that->alternatives()->at(i)->Accept(this, data);
+  OS::Print("(|");
+  for (intptr_t i = 0; i <  that->alternatives()->length(); i++) {
+    OS::Print(" ");
+    (*that->alternatives())[i]->Accept(this, data);
   }
-  os_ << ")";
+  OS::Print(")");
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitAlternative(RegExpAlternative* that, void* data) {
-  os_ << "(:";
-  for (int i = 0; i <  that->nodes()->length(); i++) {
-    os_ << " ";
-    that->nodes()->at(i)->Accept(this, data);
+  OS::Print("(:");
+  for (intptr_t i = 0; i < that->nodes()->length(); i++) {
+    OS::Print(" ");
+    (*that->nodes())[i]->Accept(this, data);
   }
-  os_ << ")";
+  OS::Print(")");
   return NULL;
 }
 
 
 void RegExpUnparser::VisitCharacterRange(CharacterRange that) {
-  os_ << AsUC16(that.from());
+  PrintUtf16(that.from());
   if (!that.IsSingleton()) {
-    os_ << "-" << AsUC16(that.to());
+    OS::Print("-");
+    PrintUtf16(that.to());
   }
 }
 
@@ -185,13 +183,13 @@
 
 void* RegExpUnparser::VisitCharacterClass(RegExpCharacterClass* that,
                                           void* data) {
-  if (that->is_negated()) os_ << "^";
-  os_ << "[";
-  for (int i = 0; i < that->ranges(zone_)->length(); i++) {
-    if (i > 0) os_ << " ";
-    VisitCharacterRange(that->ranges(zone_)->at(i));
+  if (that->is_negated()) OS::Print("^");
+  OS::Print("[");
+  for (intptr_t i = 0; i < that->ranges()->length(); i++) {
+    if (i > 0) OS::Print(" ");
+    VisitCharacterRange((*that->ranges())[i]);
   }
-  os_ << "]";
+  OS::Print("]");
   return NULL;
 }
 
@@ -199,22 +197,22 @@
 void* RegExpUnparser::VisitAssertion(RegExpAssertion* that, void* data) {
   switch (that->assertion_type()) {
     case RegExpAssertion::START_OF_INPUT:
-      os_ << "@^i";
+      OS::Print("@^i");
       break;
     case RegExpAssertion::END_OF_INPUT:
-      os_ << "@$i";
+      OS::Print("@$i");
       break;
     case RegExpAssertion::START_OF_LINE:
-      os_ << "@^l";
+      OS::Print("@^l");
       break;
     case RegExpAssertion::END_OF_LINE:
-      os_ << "@$l";
+      OS::Print("@$l");
        break;
     case RegExpAssertion::BOUNDARY:
-      os_ << "@b";
+      OS::Print("@b");
       break;
     case RegExpAssertion::NON_BOUNDARY:
-      os_ << "@B";
+      OS::Print("@B");
       break;
   }
   return NULL;
@@ -222,96 +220,96 @@
 
 
 void* RegExpUnparser::VisitAtom(RegExpAtom* that, void* data) {
-  os_ << "'";
-  Vector<const uc16> chardata = that->data();
-  for (int i = 0; i < chardata.length(); i++) {
-    os_ << AsUC16(chardata[i]);
+  OS::Print("'");
+  ZoneGrowableArray<uint16_t>* chardata = that->data();
+  for (intptr_t i = 0; i < chardata->length(); i++) {
+    PrintUtf16(chardata->At(i));
   }
-  os_ << "'";
+  OS::Print("'");
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitText(RegExpText* that, void* data) {
   if (that->elements()->length() == 1) {
-    that->elements()->at(0).tree()->Accept(this, data);
+    (*that->elements())[0].tree()->Accept(this, data);
   } else {
-    os_ << "(!";
-    for (int i = 0; i < that->elements()->length(); i++) {
-      os_ << " ";
-      that->elements()->at(i).tree()->Accept(this, data);
+    OS::Print("(!");
+    for (intptr_t i = 0; i < that->elements()->length(); i++) {
+      OS::Print(" ");
+      (*that->elements())[i].tree()->Accept(this, data);
     }
-    os_ << ")";
+    OS::Print(")");
   }
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitQuantifier(RegExpQuantifier* that, void* data) {
-  os_ << "(# " << that->min() << " ";
+  OS::Print("(# %" Pd " ", that->min());
   if (that->max() == RegExpTree::kInfinity) {
-    os_ << "- ";
+    OS::Print("- ");
   } else {
-    os_ << that->max() << " ";
+    OS::Print("%" Pd " ", that->max());
   }
-  os_ << (that->is_greedy() ? "g " : that->is_possessive() ? "p " : "n ");
+  OS::Print(that->is_greedy() ? "g " : that->is_possessive() ? "p " : "n ");
   that->body()->Accept(this, data);
-  os_ << ")";
+  OS::Print(")");
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitCapture(RegExpCapture* that, void* data) {
-  os_ << "(^ ";
+  OS::Print("(^ ");
   that->body()->Accept(this, data);
-  os_ << ")";
+  OS::Print(")");
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitLookahead(RegExpLookahead* that, void* data) {
-  os_ << "(-> " << (that->is_positive() ? "+ " : "- ");
+  OS::Print("(-> %s", (that->is_positive() ? "+ " : "- "));
   that->body()->Accept(this, data);
-  os_ << ")";
+  OS::Print(")");
   return NULL;
 }
 
 
 void* RegExpUnparser::VisitBackReference(RegExpBackReference* that,
-                                         void* data) {
-  os_ << "(<- " << that->index() << ")";
+                                         void*) {
+  OS::Print("(<- %" Pd ")", that->index());
   return NULL;
 }
 
 
-void* RegExpUnparser::VisitEmpty(RegExpEmpty* that, void* data) {
-  os_ << '%';
+void* RegExpUnparser::VisitEmpty(RegExpEmpty*, void*) {
+  OS::Print("%%");
   return NULL;
 }
 
 
-OStream& RegExpTree::Print(OStream& os, Zone* zone) {  // NOLINT
-  RegExpUnparser unparser(os, zone);
+void RegExpTree::Print() {
+  RegExpUnparser unparser;
   Accept(&unparser, NULL);
-  return os;
 }
 
 
-RegExpDisjunction::RegExpDisjunction(ZoneList<RegExpTree*>* alternatives)
+RegExpDisjunction::RegExpDisjunction(
+    ZoneGrowableArray<RegExpTree*>* alternatives)
     : alternatives_(alternatives) {
-  DCHECK(alternatives->length() > 1);
-  RegExpTree* first_alternative = alternatives->at(0);
+  ASSERT(alternatives->length() > 1);
+  RegExpTree* first_alternative = alternatives->At(0);
   min_match_ = first_alternative->min_match();
   max_match_ = first_alternative->max_match();
-  for (int i = 1; i < alternatives->length(); i++) {
-    RegExpTree* alternative = alternatives->at(i);
-    min_match_ = Min(min_match_, alternative->min_match());
-    max_match_ = Max(max_match_, alternative->max_match());
+  for (intptr_t i = 1; i < alternatives->length(); i++) {
+    RegExpTree* alternative = alternatives->At(i);
+    min_match_ = Utils::Minimum(min_match_, alternative->min_match());
+    max_match_ = Utils::Maximum(max_match_, alternative->max_match());
   }
 }
 
 
-static int IncreaseBy(int previous, int increase) {
+static intptr_t IncreaseBy(intptr_t previous, intptr_t increase) {
   if (RegExpTree::kInfinity - previous < increase) {
     return RegExpTree::kInfinity;
   } else {
@@ -319,16 +317,16 @@
   }
 }
 
-RegExpAlternative::RegExpAlternative(ZoneList<RegExpTree*>* nodes)
+RegExpAlternative::RegExpAlternative(ZoneGrowableArray<RegExpTree*>* nodes)
     : nodes_(nodes) {
-  DCHECK(nodes->length() > 1);
+  ASSERT(nodes->length() > 1);
   min_match_ = 0;
   max_match_ = 0;
-  for (int i = 0; i < nodes->length(); i++) {
-    RegExpTree* node = nodes->at(i);
-    int node_min_match = node->min_match();
+  for (intptr_t i = 0; i < nodes->length(); i++) {
+    RegExpTree* node = nodes->At(i);
+    intptr_t node_min_match = node->min_match();
     min_match_ = IncreaseBy(min_match_, node_min_match);
-    int node_max_match = node->max_match();
+    intptr_t node_max_match = node->max_match();
     max_match_ = IncreaseBy(max_match_, node_max_match);
   }
 }
diff --git a/runtime/vm/regexp_ast.h b/runtime/vm/regexp_ast.h
index e0d68c9..2be61ec 100644
--- a/runtime/vm/regexp_ast.h
+++ b/runtime/vm/regexp_ast.h
@@ -5,12 +5,13 @@
 #ifndef VM_REGEXP_AST_H_
 #define VM_REGEXP_AST_H_
 
-// SNIP
+#include "platform/globals.h"
+#include "platform/utils.h"
+#include "vm/allocation.h"
+#include "vm/regexp.h"
 
 namespace dart {
 
-// SNIP
-
 class RegExpAlternative;
 class RegExpAssertion;
 class RegExpAtom;
@@ -24,9 +25,8 @@
 class RegExpQuantifier;
 class RegExpText;
 
-// SNIP
 
-class RegExpVisitor BASE_EMBEDDED {
+class RegExpVisitor : public ValueObject {
  public:
   virtual ~RegExpVisitor() { }
 #define MAKE_CASE(Name)                                              \
@@ -36,74 +36,74 @@
 };
 
 
-class RegExpTree : public ZoneObject {
+class RegExpTree : public ZoneAllocated {
  public:
-  static const int kInfinity = kMaxInt;
+  static const intptr_t kInfinity = kMaxInt32;
   virtual ~RegExpTree() {}
   virtual void* Accept(RegExpVisitor* visitor, void* data) = 0;
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
                              RegExpNode* on_success) = 0;
-  virtual bool IsTextElement() { return false; }
-  virtual bool IsAnchoredAtStart() { return false; }
-  virtual bool IsAnchoredAtEnd() { return false; }
-  virtual int min_match() = 0;
-  virtual int max_match() = 0;
+  virtual bool IsTextElement() const { return false; }
+  virtual bool IsAnchoredAtStart() const { return false; }
+  virtual bool IsAnchoredAtEnd() const { return false; }
+  virtual intptr_t min_match() const = 0;
+  virtual intptr_t max_match() const = 0;
   // Returns the interval of registers used for captures within this
   // expression.
-  virtual Interval CaptureRegisters() { return Interval::Empty(); }
-  virtual void AppendToText(RegExpText* text, Zone* zone);
-  OStream& Print(OStream& os, Zone* zone);  // NOLINT
+  virtual Interval CaptureRegisters() const { return Interval::Empty(); }
+  virtual void AppendToText(RegExpText* text);
+  void Print();
 #define MAKE_ASTYPE(Name)                                                  \
   virtual RegExp##Name* As##Name();                                        \
-  virtual bool Is##Name();
+  virtual bool Is##Name() const;
   FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ASTYPE)
 #undef MAKE_ASTYPE
 };
 
 
-class RegExpDisjunction FINAL : public RegExpTree {
+class RegExpDisjunction : public RegExpTree {
  public:
-  explicit RegExpDisjunction(ZoneList<RegExpTree*>* alternatives);
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  explicit RegExpDisjunction(ZoneGrowableArray<RegExpTree*>* alternatives);
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpDisjunction* AsDisjunction() OVERRIDE;
-  virtual Interval CaptureRegisters() OVERRIDE;
-  virtual bool IsDisjunction() OVERRIDE;
-  virtual bool IsAnchoredAtStart() OVERRIDE;
-  virtual bool IsAnchoredAtEnd() OVERRIDE;
-  virtual int min_match() OVERRIDE { return min_match_; }
-  virtual int max_match() OVERRIDE { return max_match_; }
-  ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
+                             RegExpNode* on_success);
+  virtual RegExpDisjunction* AsDisjunction();
+  virtual Interval CaptureRegisters() const;
+  virtual bool IsDisjunction() const;
+  virtual bool IsAnchoredAtStart() const;
+  virtual bool IsAnchoredAtEnd() const;
+  virtual intptr_t min_match() const { return min_match_; }
+  virtual intptr_t max_match() const { return max_match_; }
+  ZoneGrowableArray<RegExpTree*>* alternatives() const { return alternatives_; }
  private:
-  ZoneList<RegExpTree*>* alternatives_;
-  int min_match_;
-  int max_match_;
+  ZoneGrowableArray<RegExpTree*>* alternatives_;
+  intptr_t min_match_;
+  intptr_t max_match_;
 };
 
 
-class RegExpAlternative FINAL : public RegExpTree {
+class RegExpAlternative : public RegExpTree {
  public:
-  explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes);
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  explicit RegExpAlternative(ZoneGrowableArray<RegExpTree*>* nodes);
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpAlternative* AsAlternative() OVERRIDE;
-  virtual Interval CaptureRegisters() OVERRIDE;
-  virtual bool IsAlternative() OVERRIDE;
-  virtual bool IsAnchoredAtStart() OVERRIDE;
-  virtual bool IsAnchoredAtEnd() OVERRIDE;
-  virtual int min_match() OVERRIDE { return min_match_; }
-  virtual int max_match() OVERRIDE { return max_match_; }
-  ZoneList<RegExpTree*>* nodes() { return nodes_; }
+                             RegExpNode* on_success);
+  virtual RegExpAlternative* AsAlternative();
+  virtual Interval CaptureRegisters() const;
+  virtual bool IsAlternative() const;
+  virtual bool IsAnchoredAtStart() const;
+  virtual bool IsAnchoredAtEnd() const;
+  virtual intptr_t min_match() const { return min_match_; }
+  virtual intptr_t max_match() const { return max_match_; }
+  ZoneGrowableArray<RegExpTree*>* nodes() const { return nodes_; }
  private:
-  ZoneList<RegExpTree*>* nodes_;
-  int min_match_;
-  int max_match_;
+  ZoneGrowableArray<RegExpTree*>* nodes_;
+  intptr_t min_match_;
+  intptr_t max_match_;
 };
 
 
-class RegExpAssertion FINAL : public RegExpTree {
+class RegExpAssertion : public RegExpTree {
  public:
   enum AssertionType {
     START_OF_LINE,
@@ -114,65 +114,70 @@
     NON_BOUNDARY
   };
   explicit RegExpAssertion(AssertionType type) : assertion_type_(type) { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpAssertion* AsAssertion() OVERRIDE;
-  virtual bool IsAssertion() OVERRIDE;
-  virtual bool IsAnchoredAtStart() OVERRIDE;
-  virtual bool IsAnchoredAtEnd() OVERRIDE;
-  virtual int min_match() OVERRIDE { return 0; }
-  virtual int max_match() OVERRIDE { return 0; }
-  AssertionType assertion_type() { return assertion_type_; }
+                             RegExpNode* on_success);
+  virtual RegExpAssertion* AsAssertion();
+  virtual bool IsAssertion() const;
+  virtual bool IsAnchoredAtStart() const;
+  virtual bool IsAnchoredAtEnd() const;
+  virtual intptr_t min_match() const { return 0; }
+  virtual intptr_t max_match() const { return 0; }
+  AssertionType assertion_type() const { return assertion_type_; }
  private:
   AssertionType assertion_type_;
 };
 
 
-class CharacterSet FINAL BASE_EMBEDDED {
+class CharacterSet : public ValueObject {
  public:
-  explicit CharacterSet(uc16 standard_set_type)
+  explicit CharacterSet(uint16_t standard_set_type)
       : ranges_(NULL),
         standard_set_type_(standard_set_type) {}
-  explicit CharacterSet(ZoneList<CharacterRange>* ranges)
+  explicit CharacterSet(ZoneGrowableArray<CharacterRange>* ranges)
       : ranges_(ranges),
         standard_set_type_(0) {}
-  ZoneList<CharacterRange>* ranges(Zone* zone);
-  uc16 standard_set_type() { return standard_set_type_; }
-  void set_standard_set_type(uc16 special_set_type) {
+  CharacterSet(const CharacterSet& that)
+      : ValueObject(),
+        ranges_(that.ranges_),
+        standard_set_type_(that.standard_set_type_) {}
+  ZoneGrowableArray<CharacterRange>* ranges();
+  uint16_t standard_set_type() const { return standard_set_type_; }
+  void set_standard_set_type(uint16_t special_set_type) {
     standard_set_type_ = special_set_type;
   }
   bool is_standard() { return standard_set_type_ != 0; }
   void Canonicalize();
  private:
-  ZoneList<CharacterRange>* ranges_;
+  ZoneGrowableArray<CharacterRange>* ranges_;
   // If non-zero, the value represents a standard set (e.g., all whitespace
   // characters) without having to expand the ranges.
-  uc16 standard_set_type_;
+  uint16_t standard_set_type_;
 };
 
 
-class RegExpCharacterClass FINAL : public RegExpTree {
+class RegExpCharacterClass : public RegExpTree {
  public:
-  RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
+  RegExpCharacterClass(ZoneGrowableArray<CharacterRange>* ranges,
+                       bool is_negated)
       : set_(ranges),
         is_negated_(is_negated) { }
-  explicit RegExpCharacterClass(uc16 type)
+  explicit RegExpCharacterClass(uint16_t type)
       : set_(type),
         is_negated_(false) { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpCharacterClass* AsCharacterClass() OVERRIDE;
-  virtual bool IsCharacterClass() OVERRIDE;
-  virtual bool IsTextElement() OVERRIDE { return true; }
-  virtual int min_match() OVERRIDE { return 1; }
-  virtual int max_match() OVERRIDE { return 1; }
-  virtual void AppendToText(RegExpText* text, Zone* zone) OVERRIDE;
-  CharacterSet character_set() { return set_; }
+                             RegExpNode* on_success);
+  virtual RegExpCharacterClass* AsCharacterClass();
+  virtual bool IsCharacterClass() const;
+  virtual bool IsTextElement() const { return true; }
+  virtual intptr_t min_match() const { return 1; }
+  virtual intptr_t max_match() const { return 1; }
+  virtual void AppendToText(RegExpText* text);
+  CharacterSet character_set() const { return set_; }
   // TODO(lrn): Remove need for complex version if is_standard that
   // recognizes a mangled standard set and just do { return set_.is_special(); }
-  bool is_standard(Zone* zone);
+  bool is_standard();
   // Returns a value representing the standard character set if is_standard()
   // returns true.
   // Currently used values are:
@@ -184,9 +189,11 @@
   // D : non-ASCII digit
   // . : non-unicode non-newline
   // * : All characters
-  uc16 standard_type() { return set_.standard_set_type(); }
-  ZoneList<CharacterRange>* ranges(Zone* zone) { return set_.ranges(zone); }
-  bool is_negated() { return is_negated_; }
+  uint16_t standard_type() const { return set_.standard_set_type(); }
+  ZoneGrowableArray<CharacterRange>* ranges() {
+    return set_.ranges();
+  }
+  bool is_negated() const { return is_negated_; }
 
  private:
   CharacterSet set_;
@@ -194,52 +201,53 @@
 };
 
 
-class RegExpAtom FINAL : public RegExpTree {
+class RegExpAtom : public RegExpTree {
  public:
-  explicit RegExpAtom(Vector<const uc16> data) : data_(data) { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  explicit RegExpAtom(ZoneGrowableArray<uint16_t>* data) : data_(data) { }
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpAtom* AsAtom() OVERRIDE;
-  virtual bool IsAtom() OVERRIDE;
-  virtual bool IsTextElement() OVERRIDE { return true; }
-  virtual int min_match() OVERRIDE { return data_.length(); }
-  virtual int max_match() OVERRIDE { return data_.length(); }
-  virtual void AppendToText(RegExpText* text, Zone* zone) OVERRIDE;
-  Vector<const uc16> data() { return data_; }
-  int length() { return data_.length(); }
+                             RegExpNode* on_success);
+  virtual RegExpAtom* AsAtom();
+  virtual bool IsAtom() const;
+  virtual bool IsTextElement() const { return true; }
+  virtual intptr_t min_match() const { return data_->length(); }
+  virtual intptr_t max_match() const { return data_->length(); }
+  virtual void AppendToText(RegExpText* text);
+  ZoneGrowableArray<uint16_t>* data() const { return data_; }
+  intptr_t length() const { return data_->length(); }
  private:
-  Vector<const uc16> data_;
+  ZoneGrowableArray<uint16_t>* data_;
 };
 
 
-class RegExpText FINAL : public RegExpTree {
+class RegExpText : public RegExpTree {
  public:
-  explicit RegExpText(Zone* zone) : elements_(2, zone), length_(0) {}
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  RegExpText() : elements_(2), length_(0) {}
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpText* AsText() OVERRIDE;
-  virtual bool IsText() OVERRIDE;
-  virtual bool IsTextElement() OVERRIDE { return true; }
-  virtual int min_match() OVERRIDE { return length_; }
-  virtual int max_match() OVERRIDE { return length_; }
-  virtual void AppendToText(RegExpText* text, Zone* zone) OVERRIDE;
-  void AddElement(TextElement elm, Zone* zone)  {
-    elements_.Add(elm, zone);
+                             RegExpNode* on_success);
+  virtual RegExpText* AsText();
+  virtual bool IsText() const;
+  virtual bool IsTextElement() const { return true; }
+  virtual intptr_t min_match() const { return length_; }
+  virtual intptr_t max_match() const { return length_; }
+  virtual void AppendToText(RegExpText* text);
+  void AddElement(TextElement elm)  {
+    elements_.Add(elm);
     length_ += elm.length();
   }
-  ZoneList<TextElement>* elements() { return &elements_; }
+  GrowableArray<TextElement>* elements() { return &elements_; }
  private:
-  ZoneList<TextElement> elements_;
-  int length_;
+  GrowableArray<TextElement> elements_;
+  intptr_t length_;
 };
 
 
-class RegExpQuantifier FINAL : public RegExpTree {
+class RegExpQuantifier : public RegExpTree {
  public:
   enum QuantifierType { GREEDY, NON_GREEDY, POSSESSIVE };
-  RegExpQuantifier(int min, int max, QuantifierType type, RegExpTree* body)
+  RegExpQuantifier(intptr_t min, intptr_t max,
+                   QuantifierType type, RegExpTree* body)
       : body_(body),
         min_(min),
         max_(max),
@@ -251,136 +259,134 @@
       max_match_ = max * body->max_match();
     }
   }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  static RegExpNode* ToNode(int min,
-                            int max,
+                             RegExpNode* on_success);
+  static RegExpNode* ToNode(intptr_t min,
+                            intptr_t max,
                             bool is_greedy,
                             RegExpTree* body,
                             RegExpCompiler* compiler,
                             RegExpNode* on_success,
                             bool not_at_start = false);
-  virtual RegExpQuantifier* AsQuantifier() OVERRIDE;
-  virtual Interval CaptureRegisters() OVERRIDE;
-  virtual bool IsQuantifier() OVERRIDE;
-  virtual int min_match() OVERRIDE { return min_match_; }
-  virtual int max_match() OVERRIDE { return max_match_; }
-  int min() { return min_; }
-  int max() { return max_; }
-  bool is_possessive() { return quantifier_type_ == POSSESSIVE; }
-  bool is_non_greedy() { return quantifier_type_ == NON_GREEDY; }
-  bool is_greedy() { return quantifier_type_ == GREEDY; }
-  RegExpTree* body() { return body_; }
+  virtual RegExpQuantifier* AsQuantifier();
+  virtual Interval CaptureRegisters() const;
+  virtual bool IsQuantifier() const;
+  virtual intptr_t min_match() const { return min_match_; }
+  virtual intptr_t max_match() const { return max_match_; }
+  intptr_t min() const { return min_; }
+  intptr_t max() const { return max_; }
+  bool is_possessive() const { return quantifier_type_ == POSSESSIVE; }
+  bool is_non_greedy() const { return quantifier_type_ == NON_GREEDY; }
+  bool is_greedy() const { return quantifier_type_ == GREEDY; }
+  RegExpTree* body() const { return body_; }
 
  private:
   RegExpTree* body_;
-  int min_;
-  int max_;
-  int min_match_;
-  int max_match_;
+  intptr_t min_;
+  intptr_t max_;
+  intptr_t min_match_;
+  intptr_t max_match_;
   QuantifierType quantifier_type_;
 };
 
 
-class RegExpCapture FINAL : public RegExpTree {
+class RegExpCapture : public RegExpTree {
  public:
-  explicit RegExpCapture(RegExpTree* body, int index)
+  explicit RegExpCapture(RegExpTree* body, intptr_t index)
       : body_(body), index_(index) { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
+                             RegExpNode* on_success);
   static RegExpNode* ToNode(RegExpTree* body,
-                            int index,
+                            intptr_t index,
                             RegExpCompiler* compiler,
                             RegExpNode* on_success);
-  virtual RegExpCapture* AsCapture() OVERRIDE;
-  virtual bool IsAnchoredAtStart() OVERRIDE;
-  virtual bool IsAnchoredAtEnd() OVERRIDE;
-  virtual Interval CaptureRegisters() OVERRIDE;
-  virtual bool IsCapture() OVERRIDE;
-  virtual int min_match() OVERRIDE { return body_->min_match(); }
-  virtual int max_match() OVERRIDE { return body_->max_match(); }
-  RegExpTree* body() { return body_; }
-  int index() { return index_; }
-  static int StartRegister(int index) { return index * 2; }
-  static int EndRegister(int index) { return index * 2 + 1; }
+  virtual RegExpCapture* AsCapture();
+  virtual bool IsAnchoredAtStart() const;
+  virtual bool IsAnchoredAtEnd() const;
+  virtual Interval CaptureRegisters() const;
+  virtual bool IsCapture() const;
+  virtual intptr_t min_match() const { return body_->min_match(); }
+  virtual intptr_t max_match() const { return body_->max_match(); }
+  RegExpTree* body() const { return body_; }
+  intptr_t index() const { return index_; }
+  static intptr_t StartRegister(intptr_t index) { return index * 2; }
+  static intptr_t EndRegister(intptr_t index) { return index * 2 + 1; }
 
  private:
   RegExpTree* body_;
-  int index_;
+  intptr_t index_;
 };
 
 
-class RegExpLookahead FINAL : public RegExpTree {
+class RegExpLookahead : public RegExpTree {
  public:
   RegExpLookahead(RegExpTree* body,
                   bool is_positive,
-                  int capture_count,
-                  int capture_from)
+                  intptr_t capture_count,
+                  intptr_t capture_from)
       : body_(body),
         is_positive_(is_positive),
         capture_count_(capture_count),
         capture_from_(capture_from) { }
 
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpLookahead* AsLookahead() OVERRIDE;
-  virtual Interval CaptureRegisters() OVERRIDE;
-  virtual bool IsLookahead() OVERRIDE;
-  virtual bool IsAnchoredAtStart() OVERRIDE;
-  virtual int min_match() OVERRIDE { return 0; }
-  virtual int max_match() OVERRIDE { return 0; }
-  RegExpTree* body() { return body_; }
-  bool is_positive() { return is_positive_; }
-  int capture_count() { return capture_count_; }
-  int capture_from() { return capture_from_; }
+                             RegExpNode* on_success);
+  virtual RegExpLookahead* AsLookahead();
+  virtual Interval CaptureRegisters() const;
+  virtual bool IsLookahead() const;
+  virtual bool IsAnchoredAtStart() const;
+  virtual intptr_t min_match() const { return 0; }
+  virtual intptr_t max_match() const { return 0; }
+  RegExpTree* body() const { return body_; }
+  bool is_positive() const { return is_positive_; }
+  intptr_t capture_count() const { return capture_count_; }
+  intptr_t capture_from() const { return capture_from_; }
 
  private:
   RegExpTree* body_;
   bool is_positive_;
-  int capture_count_;
-  int capture_from_;
+  intptr_t capture_count_;
+  intptr_t capture_from_;
 };
 
 
-class RegExpBackReference FINAL : public RegExpTree {
+class RegExpBackReference : public RegExpTree {
  public:
   explicit RegExpBackReference(RegExpCapture* capture)
       : capture_(capture) { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpBackReference* AsBackReference() OVERRIDE;
-  virtual bool IsBackReference() OVERRIDE;
-  virtual int min_match() OVERRIDE { return 0; }
-  virtual int max_match() OVERRIDE { return capture_->max_match(); }
-  int index() { return capture_->index(); }
-  RegExpCapture* capture() { return capture_; }
+                             RegExpNode* on_success);
+  virtual RegExpBackReference* AsBackReference();
+  virtual bool IsBackReference() const;
+  virtual intptr_t min_match() const { return 0; }
+  virtual intptr_t max_match() const { return capture_->max_match(); }
+  intptr_t index() const { return capture_->index(); }
+  RegExpCapture* capture() const { return capture_; }
  private:
   RegExpCapture* capture_;
 };
 
 
-class RegExpEmpty FINAL : public RegExpTree {
+class RegExpEmpty : public RegExpTree {
  public:
   RegExpEmpty() { }
-  virtual void* Accept(RegExpVisitor* visitor, void* data) OVERRIDE;
+  virtual void* Accept(RegExpVisitor* visitor, void* data);
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
-                             RegExpNode* on_success) OVERRIDE;
-  virtual RegExpEmpty* AsEmpty() OVERRIDE;
-  virtual bool IsEmpty() OVERRIDE;
-  virtual int min_match() OVERRIDE { return 0; }
-  virtual int max_match() OVERRIDE { return 0; }
+                             RegExpNode* on_success);
+  virtual RegExpEmpty* AsEmpty();
+  virtual bool IsEmpty() const;
+  virtual intptr_t min_match() const { return 0; }
+  virtual intptr_t max_match() const { return 0; }
   static RegExpEmpty* GetInstance() {
     static RegExpEmpty* instance = ::new RegExpEmpty();
     return instance;
   }
 };
 
-// SNIP
-
 }  // namespace dart
 
 #endif  // VM_REGEXP_AST_H_
diff --git a/runtime/vm/regexp_parser.cc b/runtime/vm/regexp_parser.cc
index 72e8d7f..79e802b 100644
--- a/runtime/vm/regexp_parser.cc
+++ b/runtime/vm/regexp_parser.cc
@@ -2,17 +2,23 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+#include "vm/longjump.h"
+#include "vm/object_store.h"
 #include "vm/regexp_parser.h"
 
-// SNIP
-
 namespace dart {
 
-RegExpBuilder::RegExpBuilder(Zone* zone)
-    : zone_(zone),
+#define I isolate()
+
+// Enables possessive quantifier syntax for testing.
+static const bool FLAG_regexp_possessive_quantifier = false;
+
+RegExpBuilder::RegExpBuilder()
+    : isolate_(Isolate::Current()),
       pending_empty_(false),
       characters_(NULL),
       terms_(),
+      text_(),
       alternatives_()
 #ifdef DEBUG
     , last_added_(ADD_NONE)
@@ -23,9 +29,9 @@
 void RegExpBuilder::FlushCharacters() {
   pending_empty_ = false;
   if (characters_ != NULL) {
-    RegExpTree* atom = new(zone()) RegExpAtom(characters_->ToConstVector());
+    RegExpTree* atom = new(I) RegExpAtom(characters_);
     characters_ = NULL;
-    text_.Add(atom, zone());
+    text_.Add(atom);
     LAST(ADD_ATOM);
   }
 }
@@ -33,27 +39,27 @@
 
 void RegExpBuilder::FlushText() {
   FlushCharacters();
-  int num_text = text_.length();
+  intptr_t num_text = text_.length();
   if (num_text == 0) {
     return;
   } else if (num_text == 1) {
-    terms_.Add(text_.last(), zone());
+    terms_.Add(text_.Last());
   } else {
-    RegExpText* text = new(zone()) RegExpText(zone());
-    for (int i = 0; i < num_text; i++)
-      text_.Get(i)->AppendToText(text, zone());
-    terms_.Add(text, zone());
+    RegExpText* text = new(I) RegExpText();
+    for (intptr_t i = 0; i < num_text; i++)
+      text_[i]->AppendToText(text);
+    terms_.Add(text);
   }
   text_.Clear();
 }
 
 
-void RegExpBuilder::AddCharacter(uc16 c) {
+void RegExpBuilder::AddCharacter(uint16_t c) {
   pending_empty_ = false;
   if (characters_ == NULL) {
-    characters_ = new(zone()) ZoneList<uc16>(4, zone());
+    characters_ = new(I) ZoneGrowableArray<uint16_t>(4);
   }
-  characters_->Add(c, zone());
+  characters_->Add(c);
   LAST(ADD_CHAR);
 }
 
@@ -70,10 +76,10 @@
   }
   if (term->IsTextElement()) {
     FlushCharacters();
-    text_.Add(term, zone());
+    text_.Add(term);
   } else {
     FlushText();
-    terms_.Add(term, zone());
+    terms_.Add(term);
   }
   LAST(ADD_ATOM);
 }
@@ -81,7 +87,7 @@
 
 void RegExpBuilder::AddAssertion(RegExpTree* assert) {
   FlushText();
-  terms_.Add(assert, zone());
+  terms_.Add(assert);
   LAST(ADD_ASSERT);
 }
 
@@ -93,16 +99,21 @@
 
 void RegExpBuilder::FlushTerms() {
   FlushText();
-  int num_terms = terms_.length();
+  intptr_t num_terms = terms_.length();
   RegExpTree* alternative;
   if (num_terms == 0) {
     alternative = RegExpEmpty::GetInstance();
   } else if (num_terms == 1) {
-    alternative = terms_.last();
+    alternative = terms_.Last();
   } else {
-    alternative = new(zone()) RegExpAlternative(terms_.GetList(zone()));
+    ZoneGrowableArray<RegExpTree*>* terms =
+        new(I) ZoneGrowableArray<RegExpTree*>();
+    for (intptr_t i = 0; i < terms_.length(); i++) {
+      terms->Add(terms_[i]);
+    }
+    alternative = new(I) RegExpAlternative(terms);
   }
-  alternatives_.Add(alternative, zone());
+  alternatives_.Add(alternative);
   terms_.Clear();
   LAST(ADD_NONE);
 }
@@ -110,43 +121,59 @@
 
 RegExpTree* RegExpBuilder::ToRegExp() {
   FlushTerms();
-  int num_alternatives = alternatives_.length();
+  intptr_t num_alternatives = alternatives_.length();
   if (num_alternatives == 0) {
     return RegExpEmpty::GetInstance();
   }
   if (num_alternatives == 1) {
-    return alternatives_.last();
+    return alternatives_.Last();
   }
-  return new(zone()) RegExpDisjunction(alternatives_.GetList(zone()));
+  ZoneGrowableArray<RegExpTree*>* alternatives =
+      new(I) ZoneGrowableArray<RegExpTree*>();
+  for (intptr_t i = 0; i < alternatives_.length(); i++) {
+    alternatives->Add(alternatives_[i]);
+  }
+  return new(I) RegExpDisjunction(alternatives);
 }
 
 
 void RegExpBuilder::AddQuantifierToAtom(
-    int min, int max, RegExpQuantifier::QuantifierType quantifier_type) {
+    intptr_t min,
+    intptr_t max,
+    RegExpQuantifier::QuantifierType quantifier_type) {
   if (pending_empty_) {
     pending_empty_ = false;
     return;
   }
   RegExpTree* atom;
   if (characters_ != NULL) {
-    DCHECK(last_added_ == ADD_CHAR);
+    DEBUG_ASSERT(last_added_ == ADD_CHAR);
     // Last atom was character.
-    Vector<const uc16> char_vector = characters_->ToConstVector();
-    int num_chars = char_vector.length();
+
+    ZoneGrowableArray<uint16_t> *char_vector =
+        new(I) ZoneGrowableArray<uint16_t>();
+    char_vector->AddArray(*characters_);
+    intptr_t num_chars = char_vector->length();
     if (num_chars > 1) {
-      Vector<const uc16> prefix = char_vector.SubVector(0, num_chars - 1);
-      text_.Add(new(zone()) RegExpAtom(prefix), zone());
-      char_vector = char_vector.SubVector(num_chars - 1, num_chars);
+      ZoneGrowableArray<uint16_t> *prefix =
+          new(I) ZoneGrowableArray<uint16_t>();
+      for (intptr_t i = 0; i < num_chars - 1; i++) {
+        prefix->Add(char_vector->At(i));
+      }
+      text_.Add(new(I) RegExpAtom(prefix));
+      ZoneGrowableArray<uint16_t> *tail = new(I) ZoneGrowableArray<uint16_t>();
+      tail->Add(char_vector->At(num_chars - 1));
+      char_vector = tail;
     }
     characters_ = NULL;
-    atom = new(zone()) RegExpAtom(char_vector);
+    atom = new(I) RegExpAtom(char_vector);
     FlushText();
   } else if (text_.length() > 0) {
-    DCHECK(last_added_ == ADD_ATOM);
+    DEBUG_ASSERT(last_added_ == ADD_ATOM);
     atom = text_.RemoveLast();
     FlushText();
   } else if (terms_.length() > 0) {
-    DCHECK(last_added_ == ADD_ATOM);
+    DEBUG_ASSERT(last_added_ == ADD_ATOM);
     atom = terms_.RemoveLast();
     if (atom->max_match() == 0) {
       // Guaranteed to only match an empty string.
@@ -154,7 +181,7 @@
       if (min == 0) {
         return;
       }
-      terms_.Add(atom, zone());
+      terms_.Add(atom);
       return;
     }
   } else {
@@ -162,22 +189,17 @@
     UNREACHABLE();
     return;
   }
-  terms_.Add(
-      new(zone()) RegExpQuantifier(min, max, quantifier_type, atom), zone());
+  terms_.Add(new(I) RegExpQuantifier(min, max, quantifier_type, atom));
   LAST(ADD_TERM);
 }
 
-// SNIP
-
 // ----------------------------------------------------------------------------
-// Regular expressions
+// Implementation of Parser
 
-RegExpParser::RegExpParser(FlatStringReader* in,
-                           Handle<String>* error,
-                           bool multiline,
-                           Zone* zone)
-    : isolate_(zone->isolate()),
-      zone_(zone),
+RegExpParser::RegExpParser(const String& in,
+                           String* error,
+                           bool multiline)
+    : isolate_(Isolate::Current()),
       error_(error),
       captures_(NULL),
       in_(in),
@@ -194,9 +216,35 @@
 }
 
 
-uc32 RegExpParser::Next() {
+bool RegExpParser::ParseFunction(ParsedFunction *parsed_function) {
+  Isolate* isolate = parsed_function->isolate();
+  JSRegExp& regexp = JSRegExp::Handle(parsed_function->function().regexp());
+
+  const String& pattern = String::Handle(regexp.pattern());
+  const bool multiline = regexp.is_multi_line();
+
+  RegExpCompileData* compile_data = new(isolate) RegExpCompileData();
+  if (!RegExpParser::ParseRegExp(pattern, multiline, compile_data)) {
+    // Parsing failures are handled in the JSRegExp factory constructor.
+    UNREACHABLE();
+  }
+
+  regexp.set_num_bracket_expressions(compile_data->capture_count);
+  if (compile_data->simple) {
+    regexp.set_is_simple();
+  } else {
+    regexp.set_is_complex();
+  }
+
+  parsed_function->SetRegExpCompileData(compile_data);
+
+  return true;
+}
+
+
+uint32_t RegExpParser::Next() {
   if (has_next()) {
-    return in()->Get(next_pos_);
+    return in().CharAt(next_pos_);
   } else {
     return kEndMarker;
   }
@@ -204,16 +252,9 @@
 
 
 void RegExpParser::Advance() {
-  if (next_pos_ < in()->length()) {
-    StackLimitCheck check(isolate());
-    if (check.HasOverflowed()) {
-      ReportError(CStrVector(Isolate::kStackOverflowMessage));
-    } else if (zone()->excess_allocation()) {
-      ReportError(CStrVector("Regular expression too large"));
-    } else {
-      current_ = in()->Get(next_pos_);
-      next_pos_++;
-    }
+  if (next_pos_ < in().Length()) {
+    current_ = in().CharAt(next_pos_);
+    next_pos_++;
   } else {
     current_ = kEndMarker;
     has_more_ = false;
@@ -221,14 +262,14 @@
 }
 
 
-void RegExpParser::Reset(int pos) {
+void RegExpParser::Reset(intptr_t pos) {
   next_pos_ = pos;
-  has_more_ = (pos < in()->length());
+  has_more_ = (pos < in().Length());
   Advance();
 }
 
 
-void RegExpParser::Advance(int dist) {
+void RegExpParser::Advance(intptr_t dist) {
   next_pos_ += dist - 1;
   Advance();
 }
@@ -239,24 +280,27 @@
 }
 
 
-RegExpTree* RegExpParser::ReportError(Vector<const char> message) {
+void RegExpParser::ReportError(const char* message) {
   failed_ = true;
-  *error_ = isolate()->factory()->NewStringFromAscii(message).ToHandleChecked();
+  *error_ = String::New(message);
   // Zip to the end to make sure the no more input is read.
   current_ = kEndMarker;
-  next_pos_ = in()->length();
-  return NULL;
+  next_pos_ = in().Length();
+
+  const Error& error = Error::Handle(LanguageError::New(*error_));
+  Report::LongJump(error);
+  UNREACHABLE();
 }
 
 
 // Pattern ::
 //   Disjunction
 RegExpTree* RegExpParser::ParsePattern() {
-  RegExpTree* result = ParseDisjunction(CHECK_FAILED);
-  DCHECK(!has_more());
+  RegExpTree* result = ParseDisjunction();
+  ASSERT(!has_more());
   // If the result of parsing is a literal string atom, and it has the
   // same length as the input, then the atom is identical to the input.
-  if (result->IsAtom() && result->AsAtom()->length() == in()->length()) {
+  if (result->IsAtom() && result->AsAtom()->length() == in().Length()) {
     simple_ = true;
   }
   return result;
@@ -275,7 +319,7 @@
 //   Atom Quantifier
 RegExpTree* RegExpParser::ParseDisjunction() {
   // Used to store current state while parsing subexpressions.
-  RegExpParserState initial_state(NULL, INITIAL, 0, zone());
+  RegExpParserState initial_state(NULL, INITIAL, 0, I);
   RegExpParserState* stored_state = &initial_state;
   // Cache the builder in a local variable for quick access.
   RegExpBuilder* builder = initial_state.builder();
@@ -284,25 +328,27 @@
     case kEndMarker:
       if (stored_state->IsSubexpression()) {
         // Inside a parenthesized group when hitting end of input.
-        ReportError(CStrVector("Unterminated group") CHECK_FAILED);
+        ReportError("Unterminated group");
+        UNREACHABLE();
       }
-      DCHECK_EQ(INITIAL, stored_state->group_type());
+      ASSERT(INITIAL == stored_state->group_type());
       // Parsing completed successfully.
       return builder->ToRegExp();
     case ')': {
       if (!stored_state->IsSubexpression()) {
-        ReportError(CStrVector("Unmatched ')'") CHECK_FAILED);
+        ReportError("Unmatched ')'");
+        UNREACHABLE();
       }
-      DCHECK_NE(INITIAL, stored_state->group_type());
+      ASSERT(INITIAL != stored_state->group_type());
 
       Advance();
       // End disjunction parsing and convert builder content to new single
       // regexp atom.
       RegExpTree* body = builder->ToRegExp();
 
-      int end_capture_index = captures_started();
+      intptr_t end_capture_index = captures_started();
 
-      int capture_index = stored_state->capture_index();
+      intptr_t capture_index = stored_state->capture_index();
       SubexpressionType group_type = stored_state->group_type();
 
       // Restore previous state.
@@ -311,20 +357,20 @@
 
       // Build result of subexpression.
       if (group_type == CAPTURE) {
-        RegExpCapture* capture = new(zone()) RegExpCapture(body, capture_index);
-        captures_->at(capture_index - 1) = capture;
+        RegExpCapture* capture = new(I) RegExpCapture(body, capture_index);
+        (*captures_)[capture_index - 1] = capture;
         body = capture;
       } else if (group_type != GROUPING) {
-        DCHECK(group_type == POSITIVE_LOOKAHEAD ||
+        ASSERT(group_type == POSITIVE_LOOKAHEAD ||
                group_type == NEGATIVE_LOOKAHEAD);
         bool is_positive = (group_type == POSITIVE_LOOKAHEAD);
-        body = new(zone()) RegExpLookahead(body,
-                                   is_positive,
-                                   end_capture_index - capture_index,
-                                   capture_index);
+        body = new(I) RegExpLookahead(body,
+                                      is_positive,
+                                      end_capture_index - capture_index,
+                                      capture_index);
       }
       builder->AddAtom(body);
-      // For compatability with JSC and ES3, we allow quantifiers after
+      // For compatibility with JSC and ES3, we allow quantifiers after
       // lookaheads, and break in all cases.
       break;
     }
@@ -336,15 +382,16 @@
     case '*':
     case '+':
     case '?':
-      return ReportError(CStrVector("Nothing to repeat"));
+      ReportError("Nothing to repeat");
+      UNREACHABLE();
     case '^': {
       Advance();
       if (multiline_) {
         builder->AddAssertion(
-            new(zone()) RegExpAssertion(RegExpAssertion::START_OF_LINE));
+            new(I) RegExpAssertion(RegExpAssertion::START_OF_LINE));
       } else {
         builder->AddAssertion(
-            new(zone()) RegExpAssertion(RegExpAssertion::START_OF_INPUT));
+            new(I) RegExpAssertion(RegExpAssertion::START_OF_INPUT));
         set_contains_anchor();
       }
       continue;
@@ -354,16 +401,16 @@
       RegExpAssertion::AssertionType assertion_type =
           multiline_ ? RegExpAssertion::END_OF_LINE :
                        RegExpAssertion::END_OF_INPUT;
-      builder->AddAssertion(new(zone()) RegExpAssertion(assertion_type));
+      builder->AddAssertion(new RegExpAssertion(assertion_type));
       continue;
     }
     case '.': {
       Advance();
       // everything except \x0a, \x0d, \u2028 and \u2029
-      ZoneList<CharacterRange>* ranges =
-          new(zone()) ZoneList<CharacterRange>(2, zone());
-      CharacterRange::AddClassEscape('.', ranges, zone());
-      RegExpTree* atom = new(zone()) RegExpCharacterClass(ranges, false);
+      ZoneGrowableArray<CharacterRange>* ranges =
+          new ZoneGrowableArray<CharacterRange>(2);
+      CharacterRange::AddClassEscape('.', ranges);
+      RegExpTree* atom = new RegExpCharacterClass(ranges, false);
       builder->AddAtom(atom);
       break;
     }
@@ -382,27 +429,28 @@
             subexpr_type = NEGATIVE_LOOKAHEAD;
             break;
           default:
-            ReportError(CStrVector("Invalid group") CHECK_FAILED);
-            break;
+            ReportError("Invalid group");
+            UNREACHABLE();
         }
         Advance(2);
       } else {
         if (captures_ == NULL) {
-          captures_ = new(zone()) ZoneList<RegExpCapture*>(2, zone());
+          captures_ = new ZoneGrowableArray<RegExpCapture*>(2);
         }
         if (captures_started() >= kMaxCaptures) {
-          ReportError(CStrVector("Too many captures") CHECK_FAILED);
+          ReportError("Too many captures");
+          UNREACHABLE();
         }
-        captures_->Add(NULL, zone());
+        captures_->Add(NULL);
       }
       // Store current state and begin new disjunction parsing.
-      stored_state = new(zone()) RegExpParserState(stored_state, subexpr_type,
-                                                   captures_started(), zone());
+      stored_state = new RegExpParserState(stored_state, subexpr_type,
+                                           captures_started(), I);
       builder = stored_state->builder();
       continue;
     }
     case '[': {
-      RegExpTree* atom = ParseCharacterClass(CHECK_FAILED);
+      RegExpTree* atom = ParseCharacterClass();
       builder->AddAtom(atom);
       break;
     }
@@ -411,16 +459,17 @@
     case '\\':
       switch (Next()) {
       case kEndMarker:
-        return ReportError(CStrVector("\\ at end of pattern"));
+        ReportError("\\ at end of pattern");
+        UNREACHABLE();
       case 'b':
         Advance(2);
         builder->AddAssertion(
-            new(zone()) RegExpAssertion(RegExpAssertion::BOUNDARY));
+            new RegExpAssertion(RegExpAssertion::BOUNDARY));
         continue;
       case 'B':
         Advance(2);
         builder->AddAssertion(
-            new(zone()) RegExpAssertion(RegExpAssertion::NON_BOUNDARY));
+            new RegExpAssertion(RegExpAssertion::NON_BOUNDARY));
         continue;
       // AtomEscape ::
       //   CharacterClassEscape
@@ -428,32 +477,32 @@
       // CharacterClassEscape :: one of
       //   d D s S w W
       case 'd': case 'D': case 's': case 'S': case 'w': case 'W': {
-        uc32 c = Next();
+        uint32_t c = Next();
         Advance(2);
-        ZoneList<CharacterRange>* ranges =
-            new(zone()) ZoneList<CharacterRange>(2, zone());
-        CharacterRange::AddClassEscape(c, ranges, zone());
-        RegExpTree* atom = new(zone()) RegExpCharacterClass(ranges, false);
+        ZoneGrowableArray<CharacterRange>* ranges =
+            new ZoneGrowableArray<CharacterRange>(2);
+        CharacterRange::AddClassEscape(c, ranges);
+        RegExpTree* atom = new RegExpCharacterClass(ranges, false);
         builder->AddAtom(atom);
         break;
       }
       case '1': case '2': case '3': case '4': case '5': case '6':
       case '7': case '8': case '9': {
-        int index = 0;
+        intptr_t index = 0;
         if (ParseBackReferenceIndex(&index)) {
           RegExpCapture* capture = NULL;
           if (captures_ != NULL && index <= captures_->length()) {
-            capture = captures_->at(index - 1);
+            capture = captures_->At(index - 1);
           }
           if (capture == NULL) {
             builder->AddEmpty();
             break;
           }
-          RegExpTree* atom = new(zone()) RegExpBackReference(capture);
+          RegExpTree* atom = new RegExpBackReference(capture);
           builder->AddAtom(atom);
           break;
         }
-        uc32 first_digit = Next();
+        uint32_t first_digit = Next();
         if (first_digit == '8' || first_digit == '9') {
           // Treat as identity escape
           builder->AddCharacter(first_digit);
@@ -464,7 +513,7 @@
       // FALLTHROUGH
       case '0': {
         Advance();
-        uc32 octal = ParseOctalLiteral();
+        uint32_t octal = ParseOctalLiteral();
         builder->AddCharacter(octal);
         break;
       }
@@ -492,10 +541,10 @@
         break;
       case 'c': {
         Advance();
-        uc32 controlLetter = Next();
+        uint32_t controlLetter = Next();
         // Special case if it is an ASCII letter.
         // Convert lower case letters to uppercase.
-        uc32 letter = controlLetter & ~('a' ^ 'A');
+        uint32_t letter = controlLetter & ~('a' ^ 'A');
         if (letter < 'A' || 'Z' < letter) {
           // controlLetter is not in range 'A'-'Z' or 'a'-'z'.
           // This is outside the specification. We match JSC in
@@ -510,7 +559,7 @@
       }
       case 'x': {
         Advance(2);
-        uc32 value;
+        uint32_t value;
         if (ParseHexEscape(2, &value)) {
           builder->AddCharacter(value);
         } else {
@@ -520,7 +569,7 @@
       }
       case 'u': {
         Advance(2);
-        uc32 value;
+        uint32_t value;
         if (ParseHexEscape(4, &value)) {
           builder->AddCharacter(value);
         } else {
@@ -536,9 +585,10 @@
       }
       break;
     case '{': {
-      int dummy;
+      intptr_t dummy;
       if (ParseIntervalQuantifier(&dummy, &dummy)) {
-        ReportError(CStrVector("Nothing to repeat") CHECK_FAILED);
+        ReportError("Nothing to repeat");
+        UNREACHABLE();
       }
       // fallthrough
     }
@@ -548,8 +598,8 @@
       break;
     }  // end switch(current())
 
-    int min;
-    int max;
+    intptr_t min;
+    intptr_t max;
     switch (current()) {
     // QuantifierPrefix ::
     //   *
@@ -574,8 +624,8 @@
     case '{':
       if (ParseIntervalQuantifier(&min, &max)) {
         if (max < min) {
-          ReportError(CStrVector("numbers out of order in {} quantifier.")
-                      CHECK_FAILED);
+          ReportError("numbers out of order in {} quantifier.");
+          UNREACHABLE();
         }
         break;
       } else {
@@ -599,8 +649,8 @@
 
 
 #ifdef DEBUG
-// Currently only used in an DCHECK.
-static bool IsSpecialClassEscape(uc32 c) {
+// Currently only used in an ASSERT.
+static bool IsSpecialClassEscape(uint32_t c) {
   switch (c) {
     case 'd': case 'D':
     case 's': case 'S':
@@ -621,9 +671,9 @@
 // characters.
 void RegExpParser::ScanForCaptures() {
   // Start with captures started previous to current position
-  int capture_count = captures_started();
+  intptr_t capture_count = captures_started();
   // Add count of captures after this position.
-  int n;
+  intptr_t n;
   while ((n = current()) != kEndMarker) {
     Advance();
     switch (n) {
@@ -631,7 +681,7 @@
         Advance();
         break;
       case '[': {
-        int c;
+        intptr_t c;
         while ((c = current()) != kEndMarker) {
           Advance();
           if (c == '\\') {
@@ -652,16 +702,21 @@
 }
 
 
-bool RegExpParser::ParseBackReferenceIndex(int* index_out) {
-  DCHECK_EQ('\\', current());
-  DCHECK('1' <= Next() && Next() <= '9');
+static inline bool IsDecimalDigit(int32_t c) {
+  return '0' <= c && c <= '9';
+}
+
+
+bool RegExpParser::ParseBackReferenceIndex(intptr_t* index_out) {
+  ASSERT('\\' == current());
+  ASSERT('1' <= Next() && Next() <= '9');
   // Try to parse a decimal literal that is no greater than the total number
   // of left capturing parentheses in the input.
-  int start = position();
-  int value = Next() - '0';
+  intptr_t start = position();
+  intptr_t value = Next() - '0';
   Advance(2);
   while (true) {
-    uc32 c = current();
+    uint32_t c = current();
     if (IsDecimalDigit(c)) {
       value = 10 * value + (c - '0');
       if (value > kMaxCaptures) {
@@ -675,7 +730,7 @@
   }
   if (value > captures_started()) {
     if (!is_scanned_for_captures_) {
-      int saved_position = position();
+      intptr_t saved_position = position();
       ScanForCaptures();
       Reset(saved_position);
     }
@@ -696,17 +751,18 @@
 //
 // Returns true if parsing succeeds, and set the min_out and max_out
 // values. Values are truncated to RegExpTree::kInfinity if they overflow.
-bool RegExpParser::ParseIntervalQuantifier(int* min_out, int* max_out) {
-  DCHECK_EQ(current(), '{');
-  int start = position();
+bool RegExpParser::ParseIntervalQuantifier(intptr_t* min_out,
+                                           intptr_t* max_out) {
+  ASSERT(current() == '{');
+  intptr_t start = position();
   Advance();
-  int min = 0;
+  intptr_t min = 0;
   if (!IsDecimalDigit(current())) {
     Reset(start);
     return false;
   }
   while (IsDecimalDigit(current())) {
-    int next = current() - '0';
+    intptr_t next = current() - '0';
     if (min > (RegExpTree::kInfinity - next) / 10) {
       // Overflow. Skip past remaining decimal digits and return -1.
       do {
@@ -718,7 +774,7 @@
     min = 10 * min + next;
     Advance();
   }
-  int max = 0;
+  intptr_t max = 0;
   if (current() == '}') {
     max = min;
     Advance();
@@ -729,7 +785,7 @@
       Advance();
     } else {
       while (IsDecimalDigit(current())) {
-        int next = current() - '0';
+        intptr_t next = current() - '0';
         if (max > (RegExpTree::kInfinity - next) / 10) {
           do {
             Advance();
@@ -756,11 +812,11 @@
 }
 
 
-uc32 RegExpParser::ParseOctalLiteral() {
-  DCHECK(('0' <= current() && current() <= '7') || current() == kEndMarker);
+uint32_t RegExpParser::ParseOctalLiteral() {
+  ASSERT(('0' <= current() && current() <= '7') || current() == kEndMarker);
   // For compatibility with some other browsers (not all), we parse
   // up to three octal digits with a value below 256.
-  uc32 value = current() - '0';
+  uint32_t value = current() - '0';
   Advance();
   if ('0' <= current() && current() <= '7') {
     value = value * 8 + current() - '0';
@@ -774,13 +830,24 @@
 }
 
 
-bool RegExpParser::ParseHexEscape(int length, uc32 *value) {
-  int start = position();
-  uc32 val = 0;
+// Returns the value (0 .. 15) of a hexadecimal character c.
+// If c is not a legal hexadecimal character, returns a value < 0.
+static inline intptr_t HexValue(uint32_t c) {
+  c -= '0';
+  if (static_cast<unsigned>(c) <= 9) return c;
+  c = (c | 0x20) - ('a' - '0');  // detect 0x11..0x16 and 0x31..0x36.
+  if (static_cast<unsigned>(c) <= 5) return c + 10;
+  return -1;
+}
+
+
+bool RegExpParser::ParseHexEscape(intptr_t length, uint32_t *value) {
+  intptr_t start = position();
+  uint32_t val = 0;
   bool done = false;
-  for (int i = 0; !done; i++) {
-    uc32 c = current();
-    int d = HexValue(c);
+  for (intptr_t i = 0; !done; i++) {
+    uint32_t c = current();
+    intptr_t d = HexValue(c);
     if (d < 0) {
       Reset(start);
       return false;
@@ -796,9 +863,9 @@
 }
 
 
-uc32 RegExpParser::ParseClassCharacterEscape() {
-  DCHECK(current() == '\\');
-  DCHECK(has_next() && !IsSpecialClassEscape(Next()));
+uint32_t RegExpParser::ParseClassCharacterEscape() {
+  ASSERT(current() == '\\');
+  DEBUG_ASSERT(has_next() && !IsSpecialClassEscape(Next()));
   Advance();
   switch (current()) {
     case 'b':
@@ -822,8 +889,8 @@
       Advance();
       return '\v';
     case 'c': {
-      uc32 controlLetter = Next();
-      uc32 letter = controlLetter & ~('A' ^ 'a');
+      uint32_t controlLetter = Next();
+      uint32_t letter = controlLetter & ~('A' ^ 'a');
       // For compatibility with JSC, inside a character class
       // we also accept digits and underscore as control characters.
       if ((controlLetter >= '0' && controlLetter <= '9') ||
@@ -846,7 +913,7 @@
       return ParseOctalLiteral();
     case 'x': {
       Advance();
-      uc32 value;
+      uint32_t value;
       if (ParseHexEscape(2, &value)) {
         return value;
       }
@@ -856,7 +923,7 @@
     }
     case 'u': {
       Advance();
-      uc32 value;
+      uint32_t value;
       if (ParseHexEscape(4, &value)) {
         return value;
       }
@@ -868,7 +935,7 @@
       // Extended identity escape. We accept any character that hasn't
       // been matched by a more specific case, not just the subset required
       // by the ECMAScript specification.
-      uc32 result = current();
+      uint32_t result = current();
       Advance();
       return result;
     }
@@ -877,9 +944,9 @@
 }
 
 
-CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) {
-  DCHECK_EQ(0, *char_class);
-  uc32 first = current();
+CharacterRange RegExpParser::ParseClassAtom(uint16_t* char_class) {
+  ASSERT(0 == *char_class);
+  uint32_t first = current();
   if (first == '\\') {
     switch (Next()) {
       case 'w': case 'W': case 'd': case 'D': case 's': case 'S': {
@@ -888,9 +955,10 @@
         return CharacterRange::Singleton(0);  // Return dummy value.
       }
       case kEndMarker:
-        return ReportError(CStrVector("\\ at end of pattern"));
+        ReportError("\\ at end of pattern");
+        UNREACHABLE();
       default:
-        uc32 c = ParseClassCharacterEscape(CHECK_FAILED);
+        uint32_t c = ParseClassCharacterEscape();
         return CharacterRange::Singleton(c);
     }
   } else {
@@ -900,19 +968,18 @@
 }
 
 
-static const uc16 kNoCharClass = 0;
+static const uint16_t kNoCharClass = 0;
 
 // Adds range or pre-defined character class to character ranges.
 // If char_class is not kInvalidClass, it's interpreted as a class
 // escape (i.e., 's' means whitespace, from '\s').
-static inline void AddRangeOrEscape(ZoneList<CharacterRange>* ranges,
-                                    uc16 char_class,
-                                    CharacterRange range,
-                                    Zone* zone) {
+static inline void AddRangeOrEscape(ZoneGrowableArray<CharacterRange>* ranges,
+                                    uint16_t char_class,
+                                    CharacterRange range) {
   if (char_class != kNoCharClass) {
-    CharacterRange::AddClassEscape(char_class, ranges, zone);
+    CharacterRange::AddClassEscape(char_class, ranges);
   } else {
-    ranges->Add(range, zone);
+    ranges->Add(range);
   }
 }
 
@@ -921,18 +988,18 @@
   static const char* kUnterminated = "Unterminated character class";
   static const char* kRangeOutOfOrder = "Range out of order in character class";
 
-  DCHECK_EQ(current(), '[');
+  ASSERT(current() == '[');
   Advance();
   bool is_negated = false;
   if (current() == '^') {
     is_negated = true;
     Advance();
   }
-  ZoneList<CharacterRange>* ranges =
-      new(zone()) ZoneList<CharacterRange>(2, zone());
+  ZoneGrowableArray<CharacterRange>* ranges =
+      new(I) ZoneGrowableArray<CharacterRange>(2);
   while (has_more() && current() != ']') {
-    uc16 char_class = kNoCharClass;
-    CharacterRange first = ParseClassAtom(&char_class CHECK_FAILED);
+    uint16_t char_class = kNoCharClass;
+    CharacterRange first = ParseClassAtom(&char_class);
     if (current() == '-') {
       Advance();
       if (current() == kEndMarker) {
@@ -940,64 +1007,72 @@
         // following code report an error.
         break;
       } else if (current() == ']') {
-        AddRangeOrEscape(ranges, char_class, first, zone());
-        ranges->Add(CharacterRange::Singleton('-'), zone());
+        AddRangeOrEscape(ranges, char_class, first);
+        ranges->Add(CharacterRange::Singleton('-'));
         break;
       }
-      uc16 char_class_2 = kNoCharClass;
-      CharacterRange next = ParseClassAtom(&char_class_2 CHECK_FAILED);
+      uint16_t char_class_2 = kNoCharClass;
+      CharacterRange next = ParseClassAtom(&char_class_2);
       if (char_class != kNoCharClass || char_class_2 != kNoCharClass) {
         // Either end is an escaped character class. Treat the '-' verbatim.
-        AddRangeOrEscape(ranges, char_class, first, zone());
-        ranges->Add(CharacterRange::Singleton('-'), zone());
-        AddRangeOrEscape(ranges, char_class_2, next, zone());
+        AddRangeOrEscape(ranges, char_class, first);
+        ranges->Add(CharacterRange::Singleton('-'));
+        AddRangeOrEscape(ranges, char_class_2, next);
         continue;
       }
       if (first.from() > next.to()) {
-        return ReportError(CStrVector(kRangeOutOfOrder) CHECK_FAILED);
+        ReportError(kRangeOutOfOrder);
+        UNREACHABLE();
       }
-      ranges->Add(CharacterRange::Range(first.from(), next.to()), zone());
+      ranges->Add(CharacterRange::Range(first.from(), next.to()));
     } else {
-      AddRangeOrEscape(ranges, char_class, first, zone());
+      AddRangeOrEscape(ranges, char_class, first);
     }
   }
   if (!has_more()) {
-    return ReportError(CStrVector(kUnterminated) CHECK_FAILED);
+    ReportError(kUnterminated);
+    UNREACHABLE();
   }
   Advance();
   if (ranges->length() == 0) {
-    ranges->Add(CharacterRange::Everything(), zone());
+    ranges->Add(CharacterRange::Everything());
     is_negated = !is_negated;
   }
-  return new(zone()) RegExpCharacterClass(ranges, is_negated);
+  return new(I) RegExpCharacterClass(ranges, is_negated);
 }
 
 
 // ----------------------------------------------------------------------------
 // The Parser interface.
 
-bool RegExpParser::ParseRegExp(FlatStringReader* input,
+bool RegExpParser::ParseRegExp(const String& input,
                                bool multiline,
-                               RegExpCompileData* result,
-                               Zone* zone) {
-  DCHECK(result != NULL);
-  RegExpParser parser(input, &result->error, multiline, zone);
-  RegExpTree* tree = parser.ParsePattern();
-  if (parser.failed()) {
-    DCHECK(tree == NULL);
-    DCHECK(!result->error.is_null());
-  } else {
-    DCHECK(tree != NULL);
-    DCHECK(result->error.is_null());
+                               RegExpCompileData* result) {
+  ASSERT(result != NULL);
+  LongJumpScope jump;
+  RegExpParser parser(input, &result->error, multiline);
+  if (setjmp(*jump.Set()) == 0) {
+    RegExpTree* tree = parser.ParsePattern();
+    ASSERT(tree != NULL);
+    ASSERT(result->error.IsNull());
     result->tree = tree;
-    int capture_count = parser.captures_started();
+    intptr_t capture_count = parser.captures_started();
     result->simple = tree->IsAtom() && parser.simple() && capture_count == 0;
     result->contains_anchor = parser.contains_anchor();
     result->capture_count = capture_count;
+  } else {
+    ASSERT(!result->error.IsNull());
+    Isolate::Current()->object_store()->clear_sticky_error();
+
+    // Throw a FormatException on parsing failures.
+    const String& message = String::Handle(
+          String::Concat(result->error, input));
+    const Array& args = Array::Handle(Array::New(1));
+    args.SetAt(0, message);
+
+    Exceptions::ThrowByType(Exceptions::kFormat, args);
   }
   return !parser.failed();
 }
 
-// SNIP
-
 }  // namespace dart
diff --git a/runtime/vm/regexp_parser.h b/runtime/vm/regexp_parser.h
index 42cedd4..3030782 100644
--- a/runtime/vm/regexp_parser.h
+++ b/runtime/vm/regexp_parser.h
@@ -5,17 +5,18 @@
 #ifndef VM_REGEXP_PARSER_H_
 #define VM_REGEXP_PARSER_H_
 
-// SNIP
+#include "vm/allocation.h"
+#include "vm/growable_array.h"
+#include "vm/regexp_ast.h"
 
 namespace dart {
 
-// SNIP
-
 // Accumulates RegExp atoms and assertions into lists of terms and alternatives.
-class RegExpBuilder: public ZoneObject {
+class RegExpBuilder: public ZoneAllocated {
  public:
-  explicit RegExpBuilder(Zone* zone);
-  void AddCharacter(uc16 character);
+  RegExpBuilder();
+
+  void AddCharacter(uint16_t character);
   // "Adds" an empty expression. Does nothing except consume a
   // following quantifier
   void AddEmpty();
@@ -23,21 +24,22 @@
   void AddAssertion(RegExpTree* tree);
   void NewAlternative();  // '|'
   void AddQuantifierToAtom(
-      int min, int max, RegExpQuantifier::QuantifierType type);
+      intptr_t min, intptr_t max, RegExpQuantifier::QuantifierType type);
   RegExpTree* ToRegExp();
 
  private:
   void FlushCharacters();
   void FlushText();
   void FlushTerms();
-  Zone* zone() const { return zone_; }
 
-  Zone* zone_;
+  Isolate* isolate() const { return isolate_; }
+
+  Isolate* isolate_;
   bool pending_empty_;
-  ZoneList<uc16>* characters_;
-  BufferedZoneList<RegExpTree, 2> terms_;
-  BufferedZoneList<RegExpTree, 2> text_;
-  BufferedZoneList<RegExpTree, 2> alternatives_;
+  ZoneGrowableArray<uint16_t>* characters_;
+  GrowableArray<RegExpTree*> terms_;
+  GrowableArray<RegExpTree*> text_;
+  GrowableArray<RegExpTree*> alternatives_;
 #ifdef DEBUG
   enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
 #define LAST(x) last_added_ = x;
@@ -46,18 +48,17 @@
 #endif
 };
 
-
-class RegExpParser BASE_EMBEDDED {
+class RegExpParser : public ValueObject {
  public:
-  RegExpParser(FlatStringReader* in,
-               Handle<String>* error,
-               bool multiline_mode,
-               Zone* zone);
+  RegExpParser(const String& in,
+               String* error,
+               bool multiline_mode);
 
-  static bool ParseRegExp(FlatStringReader* input,
+  static bool ParseFunction(ParsedFunction* parsed_function);
+
+  static bool ParseRegExp(const String& input,
                           bool multiline,
-                          RegExpCompileData* result,
-                          Zone* zone);
+                          RegExpCompileData* result);
 
   RegExpTree* ParsePattern();
   RegExpTree* ParseDisjunction();
@@ -66,41 +67,42 @@
 
   // Parses a {...,...} quantifier and stores the range in the given
   // out parameters.
-  bool ParseIntervalQuantifier(int* min_out, int* max_out);
+  bool ParseIntervalQuantifier(intptr_t* min_out, intptr_t* max_out);
 
   // Parses and returns a single escaped character.  The character
   // must not be 'b' or 'B' since they are usually handle specially.
-  uc32 ParseClassCharacterEscape();
+  uint32_t ParseClassCharacterEscape();
 
   // Checks whether the following is a length-digit hexadecimal number,
   // and sets the value if it is.
-  bool ParseHexEscape(int length, uc32* value);
+  bool ParseHexEscape(intptr_t length, uint32_t* value);
 
-  uc32 ParseOctalLiteral();
+  uint32_t ParseOctalLiteral();
 
   // Tries to parse the input as a back reference.  If successful it
   // stores the result in the output parameter and returns true.  If
   // it fails it will push back the characters read so the same characters
   // can be reparsed.
-  bool ParseBackReferenceIndex(int* index_out);
+  bool ParseBackReferenceIndex(intptr_t* index_out);
 
-  CharacterRange ParseClassAtom(uc16* char_class);
-  RegExpTree* ReportError(Vector<const char> message);
+  CharacterRange ParseClassAtom(uint16_t* char_class);
+  void ReportError(const char* message);
   void Advance();
-  void Advance(int dist);
-  void Reset(int pos);
+  void Advance(intptr_t dist);
+  void Reset(intptr_t pos);
 
   // Reports whether the pattern might be used as a literal search string.
   // Only use if the result of the parse is a single atom node.
   bool simple();
   bool contains_anchor() { return contains_anchor_; }
   void set_contains_anchor() { contains_anchor_ = true; }
-  int captures_started() { return captures_ == NULL ? 0 : captures_->length(); }
-  int position() { return next_pos_ - 1; }
+  intptr_t captures_started() { return captures_ == NULL ?
+          0 : captures_->length(); }
+  intptr_t position() { return next_pos_ - 1; }
   bool failed() { return failed_; }
 
-  static const int kMaxCaptures = 1 << 16;
-  static const uc32 kEndMarker = (1 << 21);
+  static const intptr_t kMaxCaptures = 1 << 16;
+  static const uint32_t kEndMarker = (1 << 21);
 
  private:
   enum SubexpressionType {
@@ -111,14 +113,14 @@
     GROUPING
   };
 
-  class RegExpParserState : public ZoneObject {
+  class RegExpParserState : public ZoneAllocated {
    public:
     RegExpParserState(RegExpParserState* previous_state,
                       SubexpressionType group_type,
-                      int disjunction_capture_index,
-                      Zone* zone)
+                      intptr_t disjunction_capture_index,
+                      Isolate *isolate)
         : previous_state_(previous_state),
-          builder_(new(zone) RegExpBuilder(zone)),
+          builder_(new(isolate) RegExpBuilder()),
           group_type_(group_type),
           disjunction_capture_index_(disjunction_capture_index) {}
     // Parser state of containing expression, if any.
@@ -131,7 +133,7 @@
     // Index in captures array of first capture in this sub-expression, if any.
     // Also the capture index of this sub-expression itself, if group_type
     // is CAPTURE.
-    int capture_index() { return disjunction_capture_index_; }
+    intptr_t capture_index() { return disjunction_capture_index_; }
 
    private:
     // Linked list implementation of stack of states.
@@ -141,28 +143,26 @@
     // Stored disjunction type (capture, look-ahead or grouping), if any.
     SubexpressionType group_type_;
     // Stored disjunction's capture index (if any).
-    int disjunction_capture_index_;
+    intptr_t disjunction_capture_index_;
   };
 
   Isolate* isolate() { return isolate_; }
-  Zone* zone() const { return zone_; }
 
-  uc32 current() { return current_; }
+  uint32_t current() { return current_; }
   bool has_more() { return has_more_; }
-  bool has_next() { return next_pos_ < in()->length(); }
-  uc32 Next();
-  FlatStringReader* in() { return in_; }
+  bool has_next() { return next_pos_ < in().Length(); }
+  uint32_t Next();
+  const String& in() { return in_; }
   void ScanForCaptures();
 
   Isolate* isolate_;
-  Zone* zone_;
-  Handle<String>* error_;
-  ZoneList<RegExpCapture*>* captures_;
-  FlatStringReader* in_;
-  uc32 current_;
-  int next_pos_;
+  String* error_;
+  ZoneGrowableArray<RegExpCapture*>* captures_;
+  const String& in_;
+  uint32_t current_;
+  intptr_t next_pos_;
   // The capture count is only valid after we have scanned for captures.
-  int capture_count_;
+  intptr_t capture_count_;
   bool has_more_;
   bool multiline_;
   bool simple_;
@@ -171,8 +171,6 @@
   bool failed_;
 };
 
-// SNIP
-
 }  // namespace dart
 
 #endif  // VM_REGEXP_PARSER_H_
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index f493484..51f6863 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -16,6 +16,7 @@
 #include "vm/object_id_ring.h"
 #include "vm/stack_frame.h"
 #include "vm/store_buffer.h"
+#include "vm/verified_memory.h"
 #include "vm/verifier.h"
 #include "vm/visitor.h"
 #include "vm/weak_table.h"
@@ -227,6 +228,7 @@
       memmove(reinterpret_cast<void*>(new_addr),
               reinterpret_cast<void*>(raw_addr),
               size);
+      VerifiedMemory::Accept(new_addr, size);
       // Remember forwarding address.
       ForwardTo(raw_addr, new_addr);
     }
@@ -235,6 +237,7 @@
     *p = new_obj;
     // Update the store buffer as needed.
     if (visiting_old_object_ != NULL) {
+      VerifiedMemory::Accept(reinterpret_cast<uword>(p), sizeof(*p));
       UpdateStoreBuffer(p, new_obj);
     }
   }
@@ -356,7 +359,7 @@
     return new SemiSpace(NULL);
   } else {
     intptr_t size_in_bytes = size_in_words << kWordSizeLog2;
-    VirtualMemory* reserved = VirtualMemory::Reserve(size_in_bytes);
+    VirtualMemory* reserved = VerifiedMemory::Reserve(size_in_bytes);
     if ((reserved == NULL) || !reserved->Commit(false)) {  // Not executable.
       // TODO(koda): If cache_ is not empty, we could try to delete it.
       delete reserved;
@@ -364,6 +367,7 @@
     }
 #if defined(DEBUG)
     memset(reserved->address(), kZapValue, size_in_bytes);
+    VerifiedMemory::Accept(reserved->start(), size_in_bytes);
 #endif  // defined(DEBUG)
     return new SemiSpace(reserved);
   }
@@ -486,7 +490,7 @@
     // objects candidates for promotion next time.
     survivor_end_ = end_;
   }
-
+  VerifiedMemory::Accept(to_->start(), to_->end() - to_->start());
 #if defined(DEBUG)
   // We can only safely verify the store buffers from old space if there is no
   // concurrent old space task. At the same time we prevent new tasks from
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 399079c..6532308 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -786,6 +786,16 @@
     return reinterpret_cast<Redirection*>(addr_of_redirection);
   }
 
+  static uword FunctionForRedirect(uword address_of_svc) {
+    Redirection* current;
+    for (current = list_; current != NULL; current = current->next_) {
+      if (current->address_of_svc_instruction() == address_of_svc) {
+        return current->external_function_;
+      }
+    }
+    return 0;
+  }
+
  private:
   static const int32_t kRedirectSvcInstruction =
     ((AL << kConditionShift) | (0xf << 24) | kRedirectionSvcCode);
@@ -821,6 +831,11 @@
 }
 
 
+uword Simulator::FunctionForRedirect(uword redirect) {
+  return Redirection::FunctionForRedirect(redirect);
+}
+
+
 // Get the active Simulator for the current isolate.
 Simulator* Simulator::Current() {
   Simulator* simulator = Isolate::Current()->simulator();
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index b858b00f..322c582 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -113,6 +113,8 @@
                                          CallKind call_kind,
                                          int argument_count);
 
+  static uword FunctionForRedirect(uword redirect);
+
   void Longjmp(uword pc,
                uword sp,
                uword fp,
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 5f126e4..d284e1e 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -630,6 +630,16 @@
     return reinterpret_cast<Redirection*>(addr_of_redirection);
   }
 
+  static uword FunctionForRedirect(uword address_of_hlt) {
+    Redirection* current;
+    for (current = list_; current != NULL; current = current->next_) {
+      if (current->address_of_hlt_instruction() == address_of_hlt) {
+        return current->external_function_;
+      }
+    }
+    return 0;
+  }
+
  private:
   static const int32_t kRedirectInstruction = Instr::kRedirectInstruction;
   Redirection(uword external_function,
@@ -664,6 +674,11 @@
 }
 
 
+uword Simulator::FunctionForRedirect(uword redirect) {
+  return Redirection::FunctionForRedirect(redirect);
+}
+
+
 // Get the active Simulator for the current isolate.
 Simulator* Simulator::Current() {
   Simulator* simulator = Isolate::Current()->simulator();
diff --git a/runtime/vm/simulator_arm64.h b/runtime/vm/simulator_arm64.h
index be1679d..1a0fe9b 100644
--- a/runtime/vm/simulator_arm64.h
+++ b/runtime/vm/simulator_arm64.h
@@ -110,6 +110,8 @@
                                          CallKind call_kind,
                                          int argument_count);
 
+  static uword FunctionForRedirect(uword redirect);
+
   void Longjmp(uword pc,
                uword sp,
                uword fp,
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index 62c81f7..09109c0 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -656,6 +656,16 @@
     return reinterpret_cast<Redirection*>(addr_of_redirection);
   }
 
+  static uword FunctionForRedirect(uword address_of_break) {
+    Redirection* current;
+    for (current = list_; current != NULL; current = current->next_) {
+      if (current->address_of_break_instruction() == address_of_break) {
+        return current->external_function_;
+      }
+    }
+    return 0;
+  }
+
  private:
   static const int32_t kRedirectInstruction =
     Instr::kBreakPointInstruction | (Instr::kRedirectCode << kBreakCodeShift);
@@ -692,6 +702,11 @@
 }
 
 
+uword Simulator::FunctionForRedirect(uword redirect) {
+  return Redirection::FunctionForRedirect(redirect);
+}
+
+
 // Get the active Simulator for the current isolate.
 Simulator* Simulator::Current() {
   Simulator* simulator = Isolate::Current()->simulator();
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index 1df5523..d84f04a 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -129,6 +129,8 @@
                                          CallKind call_kind,
                                          int argument_count);
 
+  static uword FunctionForRedirect(uword redirect);
+
   void Longjmp(uword pc,
                uword sp,
                uword fp,
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index ad1ab1a..19e8b2b 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -15,6 +15,7 @@
 #include "vm/object_store.h"
 #include "vm/snapshot_ids.h"
 #include "vm/symbols.h"
+#include "vm/verified_memory.h"
 #include "vm/version.h"
 
 namespace dart {
@@ -847,6 +848,7 @@
   // Make sure to initialize the last word, as this can be left untouched in
   // case the object deserialized has an alignment tail.
   *reinterpret_cast<RawObject**>(address + size - kWordSize) = Object::null();
+  VerifiedMemory::Accept(address, size);
 
   RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
   uword tags = 0;
@@ -949,10 +951,11 @@
     ASSERT(next_field_offset > 0);
     // Instance::NextFieldOffset() returns the offset of the first field in
     // a Dart object.
+    bool is_canonical = RawObject::IsCanonical(tags);
     intptr_t offset = Instance::NextFieldOffset();
     intptr_t result_cid = result->GetClassId();
     while (offset < next_field_offset) {
-      pobj_ = ReadObjectRef();
+      pobj_ = is_canonical ? ReadObjectImpl() : ReadObjectRef();
       result->SetFieldAtOffset(offset, pobj_);
       if ((offset != type_argument_field_offset) &&
           (kind_ == Snapshot::kMessage)) {
@@ -979,7 +982,7 @@
         offset += kWordSize;
       }
       result->SetCreatedFromSnapshot();
-    } else if (result->IsCanonical()) {
+    } else if (RawObject::IsCanonical(tags)) {
       *result = result->CheckAndCanonicalize(NULL);
       ASSERT(!result->IsNull());
     }
@@ -1032,8 +1035,10 @@
   *TypeArgumentsHandle() ^= ReadObjectImpl();
   result.SetTypeArguments(*TypeArgumentsHandle());
 
+  bool is_canonical = RawObject::IsCanonical(tags);
+
   for (intptr_t i = 0; i < len; i++) {
-    *PassiveObjectHandle() = ReadObjectRef();
+    *PassiveObjectHandle() = is_canonical ? ReadObjectImpl() : ReadObjectRef();
     result.SetAt(i, *PassiveObjectHandle());
   }
 }
@@ -1591,8 +1596,13 @@
   WriteObjectImpl(type_arguments);
 
   // Write out the individual object ids.
+  bool is_canonical = RawObject::IsCanonical(tags);
   for (intptr_t i = 0; i < len; i++) {
-    WriteObjectRef(data[i]);
+    if (is_canonical) {
+      WriteObjectImpl(data[i]);
+    } else {
+      WriteObjectRef(data[i]);
+    }
   }
 }
 
@@ -1650,10 +1660,16 @@
   // Write out all the fields for the object.
   // Instance::NextFieldOffset() returns the offset of the first field in
   // a Dart object.
+  bool is_canonical = RawObject::IsCanonical(tags);
   intptr_t offset = Instance::NextFieldOffset();
   while (offset < next_field_offset) {
-    WriteObjectRef(*reinterpret_cast<RawObject**>(
-        reinterpret_cast<uword>(raw->ptr()) + offset));
+    RawObject* raw_obj = *reinterpret_cast<RawObject**>(
+        reinterpret_cast<uword>(raw->ptr()) + offset);
+    if (is_canonical) {
+      WriteObjectImpl(raw_obj);
+    } else {
+      WriteObjectRef(raw_obj);
+    }
     offset += kWordSize;
   }
   return;
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 7e836b3..1933d66 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -403,18 +403,19 @@
   // R0: newly allocated array.
   // R2: smi-tagged argument count, may be zero (was preserved by the stub).
   __ Push(R0);  // Array is in R0 and on top of stack.
-  __ add(R1, FP, Operand(R2, LSL, 1));
-  __ AddImmediate(R1, kParamEndSlotFromFp * kWordSize);
+  __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize);
   __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag);
-  // R1: address of first argument on stack.
+  // Copy arguments from stack to array (starting at the end).
+  // R1: address just beyond last argument on stack.
   // R3: address of first argument in array.
+  Label enter;
+  __ b(&enter);
   Label loop;
   __ Bind(&loop);
+  __ ldr(IP, Address(R1, kWordSize, Address::PreIndex));
+  __ StoreIntoObjectNoBarrier(R0, Address(R3, R2, LSL, 1), IP);
+  __ Bind(&enter);
   __ subs(R2, R2, Operand(Smi::RawValue(1)));  // R2 is Smi.
-  __ ldr(IP, Address(R1, 0), PL);
-  __ str(IP, Address(R3, 0), PL);
-  __ AddImmediate(R1, -kWordSize, PL);
-  __ AddImmediate(R3, kWordSize, PL);
   __ b(&loop, PL);
 }
 
@@ -690,22 +691,16 @@
   // Initialize all array elements to raw_null.
   // R0: new object start as a tagged pointer.
   // R3: allocation stats address.
-  // R7: new object end address.
-  // R8: iterator which initially points to the start of the variable
-  // data area to be initialized.
   // R4, R5: null
+  // R6: iterator which initially points to the start of the variable
+  // data area to be initialized.
+  // R7: new object end address.
+  // R8: allocation size.
+
   __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
   __ mov(R5, Operand(R4));
-  __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag);
-
-  Label init_loop;
-  __ Bind(&init_loop);
-  __ AddImmediate(R8, 2 * kWordSize);
-  __ cmp(R8, Operand(R7));
-  __ strd(R4, Address(R8, -2 * kWordSize), LS);
-  __ b(&init_loop, CC);
-  __ str(R4, Address(R8, -2 * kWordSize), HI);
-
+  __ AddImmediate(R6, R0, sizeof(RawArray) - kHeapObjectTag);
+  __ InitializeFieldsNoBarrier(R0, R6, R7, R4, R5);
   __ IncrementAllocationStatsWithSize(R3, R8, cid, space);
   __ Ret();  // Returns the newly allocated object in R0.
   // Unable to allocate the array using the fast inline code, just call
@@ -880,61 +875,61 @@
 
     // Successfully allocated the object, now update top to point to
     // next object start and initialize the object.
-    // R0: new object.
+    // R0: new object start (untagged).
     // R1: number of context variables.
     // R2: object size.
     // R3: next object start.
     // R5: top address.
-    __ LoadAllocationStatsAddress(R4, cid, space);
+    __ LoadAllocationStatsAddress(R6, cid, space);
     __ str(R3, Address(R5, 0));
     __ add(R0, R0, Operand(kHeapObjectTag));
 
     // Calculate the size tag.
-    // R0: new object.
+    // R0: new object (tagged).
     // R1: number of context variables.
     // R2: object size.
-    // R4: allocation stats address.
+    // R3: next object start.
+    // R6: allocation stats address.
     const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
     __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag);
     // If no size tag overflow, shift R2 left, else set R2 to zero.
-    __ mov(R3, Operand(R2, LSL, shift), LS);
-    __ mov(R3, Operand(0), HI);
+    __ mov(R5, Operand(R2, LSL, shift), LS);
+    __ mov(R5, Operand(0), HI);
 
     // Get the class index and insert it into the tags.
-    // R3: size and bit tags.
+    // R5: size and bit tags.
     __ LoadImmediate(IP, RawObject::ClassIdTag::encode(cid));
-    __ orr(R3, R3, Operand(IP));
-    __ str(R3, FieldAddress(R0, Context::tags_offset()));
+    __ orr(R5, R5, Operand(IP));
+    __ str(R5, FieldAddress(R0, Context::tags_offset()));
 
     // Setup up number of context variables field.
     // R0: new object.
     // R1: number of context variables as integer value (not object).
     // R2: object size.
-    // R4: allocation stats address.
+    // R3: next object start.
+    // R6: allocation stats address.
     __ str(R1, FieldAddress(R0, Context::num_variables_offset()));
 
     // Setup the parent field.
     // R0: new object.
     // R1: number of context variables.
     // R2: object size.
-    // R4: allocation stats address.
-    __ LoadImmediate(R3, reinterpret_cast<intptr_t>(Object::null()));
-    __ str(R3, FieldAddress(R0, Context::parent_offset()));
+    // R3: next object start.
+    // R6: allocation stats address.
+    __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
+    __ str(R4, FieldAddress(R0, Context::parent_offset()));
 
     // Initialize the context variables.
     // R0: new object.
     // R1: number of context variables.
     // R2: object size.
-    // R3: raw null.
-    // R4: allocation stats address.
+    // R3: next object start.
+    // R4, R5: raw null.
+    // R6: allocation stats address.
     Label loop;
-    __ AddImmediate(R5, R0, Context::variable_offset(0) - kHeapObjectTag);
-    __ Bind(&loop);
-    __ subs(R1, R1, Operand(1));
-    __ str(R3, Address(R5, R1, LSL, 2), PL);  // Store if R1 positive or zero.
-    __ b(&loop, NE);  // Loop if R1 not zero.
-
-    __ IncrementAllocationStatsWithSize(R4, R2, cid, space);
+    __ AddImmediate(R7, R0, Context::variable_offset(0) - kHeapObjectTag);
+    __ InitializeFieldsNoBarrier(R0, R7, R3, R4, R5);
+    __ IncrementAllocationStatsWithSize(R6, R2, cid, space);
 
     // Done allocating and initializing the context.
     // R0: new object.
@@ -1065,42 +1060,43 @@
     Heap* heap = Isolate::Current()->heap();
     Heap::Space space = heap->SpaceForAllocation(cls.id());
     __ LoadImmediate(R5, heap->TopAddress(space));
-    __ ldr(R2, Address(R5, 0));
-    __ AddImmediate(R3, R2, instance_size);
+    __ ldr(R0, Address(R5, 0));
+    __ AddImmediate(R1, R0, instance_size);
     // Check if the allocation fits into the remaining space.
-    // R2: potential new object start.
-    // R3: potential next object start.
+    // R0: potential new object start.
+    // R1: potential next object start.
     __ LoadImmediate(IP, heap->EndAddress(space));
     __ ldr(IP, Address(IP, 0));
-    __ cmp(R3, Operand(IP));
+    __ cmp(R1, Operand(IP));
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
       __ b(&slow_case, CS);  // Unsigned higher or equal.
     }
-    __ str(R3, Address(R5, 0));
+    __ str(R1, Address(R5, 0));
 
     // Load the address of the allocation stats table. We split up the load
     // and the increment so that the dependent load is not too nearby.
     __ LoadAllocationStatsAddress(R5, cls.id(), space);
 
-    // R2: new object start.
-    // R3: next object start.
+    // R0: new object start.
+    // R1: next object start.
     // R5: allocation stats table.
     // Set the tags.
     uword tags = 0;
     tags = RawObject::SizeTag::update(instance_size, tags);
     ASSERT(cls.id() != kIllegalCid);
     tags = RawObject::ClassIdTag::update(cls.id(), tags);
-    __ LoadImmediate(R0, tags);
-    __ str(R0, Address(R2, Instance::tags_offset()));
+    __ LoadImmediate(R2, tags);
+    __ str(R2, Address(R0, Instance::tags_offset()));
+    __ add(R0, R0, Operand(kHeapObjectTag));
 
     // Initialize the remaining words of the object.
-    __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
 
-    // R0: raw null.
-    // R2: new object start.
-    // R3: next object start.
+    // R2: raw null.
+    // R0: new object (tagged).
+    // R1: next object start.
     // R5: allocation stats table.
     // First try inlining the initialization without a loop.
     if (instance_size < (kInlineInstanceSize * kWordSize)) {
@@ -1109,51 +1105,45 @@
       intptr_t current_offset = Instance::NextFieldOffset();
       // Write two nulls at a time.
       if (instance_size >= 2 * kWordSize) {
-        __ mov(R1, Operand(R0));
+        __ mov(R3, Operand(R2));
         while (current_offset + kWordSize < instance_size) {
-          __ StoreToOffset(kWordPair, R0, R2, current_offset);
+          __ StoreToOffset(kWordPair, R2, R0, current_offset - kHeapObjectTag);
           current_offset += 2 * kWordSize;
         }
       }
       // Write remainder.
       while (current_offset < instance_size) {
-        __ StoreToOffset(kWord, R0, R2, current_offset);
+        __ StoreToOffset(kWord, R2, R0, current_offset - kHeapObjectTag);
         current_offset += kWordSize;
       }
     } else {
       // There are more than kInlineInstanceSize(12) fields
-      __ add(R4, R2, Operand(Instance::NextFieldOffset()));
-      __ mov(R1, Operand(R0));
+      __ add(R4, R0, Operand(Instance::NextFieldOffset() - kHeapObjectTag));
+      __ mov(R3, Operand(R2));
       // Loop until the whole object is initialized.
-      // R0: raw null.
-      // R1: raw null.
-      // R2: new object.
-      // R3: next object start.
+      // R2: raw null.
+      // R3: raw null.
+      // R0: new object (tagged).
+      // R1: next object start.
       // R4: next word to be initialized.
       // R5: allocation stats table.
-      Label init_loop;
-      __ Bind(&init_loop);
-      __ AddImmediate(R4, 2 * kWordSize);
-      __ cmp(R4, Operand(R3));
-      __ strd(R0, Address(R4, -2 * kWordSize), LS);
-      __ b(&init_loop, CC);
-      __ str(R0, Address(R4, -2 * kWordSize), HI);
+      __ InitializeFieldsNoBarrier(R0, R4, R1, R2, R3);
     }
     if (is_cls_parameterized) {
       // Set the type arguments in the new object.
       __ ldr(R4, Address(SP, 0));
-      __ StoreToOffset(kWord, R4, R2, cls.type_arguments_field_offset());
+      __ StoreToOffset(kWord, R4,
+                       R0, cls.type_arguments_field_offset() - kHeapObjectTag);
     }
 
     // Done allocating and initializing the instance.
-    // R2: new object still missing its heap tag.
+    // R0: new object (tagged).
     // R5: allocation stats table.
-    __ add(R0, R2, Operand(kHeapObjectTag));
 
     // Update allocation stats.
     __ IncrementAllocationStats(R5, cls.id(), space);
 
-    // R0: new object.
+    // R0: new object (tagged).
     __ Ret();
 
     __ Bind(&slow_case);
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 92e9979..331c300 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -1540,7 +1540,7 @@
   __ addl(EAX, Immediate(Smi::RawValue(1)));
   __ movl(EDI, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovno(EDI, EAX);
-  __ movl(Address(EBX, count_offset), EDI);
+  __ StoreIntoSmiField(Address(EBX, count_offset), EDI);
 
   // Load arguments descriptor into EDX.
   __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset()));
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index c2f69e0..6f01264 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -366,8 +366,9 @@
   Label loop, loop_condition;
   __ jmp(&loop_condition, Assembler::kNearJump);
   __ Bind(&loop);
-  __ movq(RAX, Address(R12, 0));
-  __ movq(Address(RBX, 0), RAX);
+  __ movq(RDI, Address(R12, 0));
+  // No generational barrier needed, since array is in new space.
+  __ StoreIntoObjectNoBarrier(RAX, Address(RBX, 0), RDI);
   __ addq(RBX, Immediate(kWordSize));
   __ subq(R12, Immediate(kWordSize));
   __ Bind(&loop_condition);
@@ -652,7 +653,8 @@
   __ Bind(&init_loop);
   __ cmpq(RDI, RCX);
   __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
-  __ movq(Address(RDI, 0), R12);
+  // No generational barrier needed, since we are storing null.
+  __ StoreIntoObjectNoBarrier(RAX, Address(RDI, 0), R12);
   __ addq(RDI, Immediate(kWordSize));
   __ jmp(&init_loop, Assembler::kNearJump);
   __ Bind(&done);
@@ -885,7 +887,10 @@
     // Setup the parent field.
     // RAX: new object.
     // R10: number of context variables.
-    __ movq(FieldAddress(RAX, Context::parent_offset()), R12);
+    // No generational barrier needed, since we are storing null.
+    __ StoreIntoObjectNoBarrier(RAX,
+                                FieldAddress(RAX, Context::parent_offset()),
+                                R12);
 
     // Initialize the context variables.
     // RAX: new object.
@@ -897,7 +902,10 @@
       __ jmp(&entry, Assembler::kNearJump);
       __ Bind(&loop);
       __ decq(R10);
-      __ movq(Address(R13, R10, TIMES_8, 0), R12);
+      // No generational barrier needed, since we are storing null.
+      __ StoreIntoObjectNoBarrier(RAX,
+                                  Address(R13, R10, TIMES_8, 0),
+                                  R12);
       __ Bind(&entry);
       __ cmpq(R10, Immediate(0));
       __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
@@ -928,50 +936,58 @@
 
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
-//   RAX: Address being stored
+//   RDX: Address being stored
 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
   // Save registers being destroyed.
-  __ pushq(RDX);
+  __ pushq(RAX);
   __ pushq(RCX);
 
   Label add_to_buffer;
   // Check whether this object has already been remembered. Skip adding to the
   // store buffer if the object is in the store buffer already.
-  // Spilled: RDX, RCX
-  // RAX: Address being stored
-  __ movq(RCX, FieldAddress(RAX, Object::tags_offset()));
+  // Spilled: RAX, RCX
+  // RDX: Address being stored
+  Label reload;
+  __ Bind(&reload);
+  __ movq(RCX, FieldAddress(RDX, Object::tags_offset()));
   __ testq(RCX, Immediate(1 << RawObject::kRememberedBit));
   __ j(EQUAL, &add_to_buffer, Assembler::kNearJump);
   __ popq(RCX);
-  __ popq(RDX);
+  __ popq(RAX);
   __ ret();
 
+  // Update the tags that this object has been remembered.
+  // RDX: Address being stored
+  // RAX: Current tag value
   __ Bind(&add_to_buffer);
+  __ movq(RCX, RAX);
   __ orq(RCX, Immediate(1 << RawObject::kRememberedBit));
-  __ movq(FieldAddress(RAX, Object::tags_offset()), RCX);
+  // Compare the tag word with RAX, update to RCX if unchanged.
+  __ LockCmpxchgq(FieldAddress(RDX, Object::tags_offset()), RCX);
+  __ j(NOT_EQUAL, &reload);
 
   // Load the isolate.
-  // RAX: Address being stored
-  __ LoadIsolate(RDX);
+  // RDX: Address being stored
+  __ LoadIsolate(RAX);
 
   // Load the StoreBuffer block out of the isolate. Then load top_ out of the
   // StoreBufferBlock and add the address to the pointers_.
-  // RAX: Address being stored
-  // RDX: Isolate
-  __ movq(RDX, Address(RDX, Isolate::store_buffer_offset()));
-  __ movl(RCX, Address(RDX, StoreBufferBlock::top_offset()));
-  __ movq(Address(RDX, RCX, TIMES_8, StoreBufferBlock::pointers_offset()), RAX);
+  // RDX: Address being stored
+  // RAX: Isolate
+  __ movq(RAX, Address(RAX, Isolate::store_buffer_offset()));
+  __ movl(RCX, Address(RAX, StoreBufferBlock::top_offset()));
+  __ movq(Address(RAX, RCX, TIMES_8, StoreBufferBlock::pointers_offset()), RDX);
 
   // Increment top_ and check for overflow.
   // RCX: top_
-  // RDX: StoreBufferBlock
+  // RAX: StoreBufferBlock
   Label L;
   __ incq(RCX);
-  __ movl(Address(RDX, StoreBufferBlock::top_offset()), RCX);
+  __ movl(Address(RAX, StoreBufferBlock::top_offset()), RCX);
   __ cmpl(RCX, Immediate(StoreBufferBlock::kSize));
   // Restore values.
   __ popq(RCX);
-  __ popq(RDX);
+  __ popq(RAX);
   __ j(EQUAL, &L, Assembler::kNearJump);
   __ ret();
 
@@ -1038,7 +1054,7 @@
     __ movq(Address(RCX, 0), RBX);
     __ UpdateAllocationStats(cls.id(), space);
 
-    // RAX: new object start.
+    // RAX: new object start (untagged).
     // RBX: next object start.
     // RDX: new object type arguments (if is_cls_parameterized).
     // Set the tags.
@@ -1047,9 +1063,10 @@
     ASSERT(cls.id() != kIllegalCid);
     tags = RawObject::ClassIdTag::update(cls.id(), tags);
     __ movq(Address(RAX, Instance::tags_offset()), Immediate(tags));
+    __ addq(RAX, Immediate(kHeapObjectTag));
 
     // Initialize the remaining words of the object.
-    // RAX: new object start.
+    // RAX: new object (tagged).
     // RBX: next object start.
     // RDX: new object type arguments (if is_cls_parameterized).
     // R12: raw null.
@@ -1060,12 +1077,14 @@
       for (intptr_t current_offset = Instance::NextFieldOffset();
            current_offset < instance_size;
            current_offset += kWordSize) {
-        __ movq(Address(RAX, current_offset), R12);
+        __ StoreIntoObjectNoBarrier(RAX,
+                                    FieldAddress(RAX, current_offset),
+                                    R12);
       }
     } else {
-      __ leaq(RCX, Address(RAX, Instance::NextFieldOffset()));
+      __ leaq(RCX, FieldAddress(RAX, Instance::NextFieldOffset()));
       // Loop until the whole object is initialized.
-      // RAX: new object.
+      // RAX: new object (tagged).
       // RBX: next object start.
       // RCX: next word to be initialized.
       // RDX: new object type arguments (if is_cls_parameterized).
@@ -1074,7 +1093,7 @@
       __ Bind(&init_loop);
       __ cmpq(RCX, RBX);
       __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
-      __ movq(Address(RCX, 0), R12);
+      __ StoreIntoObjectNoBarrier(RAX, Address(RCX, 0), R12);
       __ addq(RCX, Immediate(kWordSize));
       __ jmp(&init_loop, Assembler::kNearJump);
       __ Bind(&done);
@@ -1082,11 +1101,11 @@
     if (is_cls_parameterized) {
       // RDX: new object type arguments.
       // Set the type arguments in the new object.
-      __ movq(Address(RAX, cls.type_arguments_field_offset()), RDX);
+      intptr_t offset = cls.type_arguments_field_offset();
+      __ StoreIntoObjectNoBarrier(RAX, FieldAddress(RAX, offset), RDX);
     }
     // Done allocating and initializing the instance.
-    // RAX: new object.
-    __ addq(RAX, Immediate(kHeapObjectTag));
+    // RAX: new object (tagged).
     __ ret();
 
     __ Bind(&slow_case);
@@ -1196,16 +1215,21 @@
   __ movq(R12, RCX);
   __ orq(R12, RAX);
   __ testq(R12, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, not_smi_or_overflow, Assembler::kNearJump);
+#if defined(DEBUG)
+  const bool jump_length = Assembler::kFarJump;
+#else
+  const bool jump_length = Assembler::kNearJump;
+#endif
+  __ j(NOT_ZERO, not_smi_or_overflow, jump_length);
   switch (kind) {
     case Token::kADD: {
       __ addq(RAX, RCX);
-      __ j(OVERFLOW, not_smi_or_overflow, Assembler::kNearJump);
+      __ j(OVERFLOW, not_smi_or_overflow, jump_length);
       break;
     }
     case Token::kSUB: {
       __ subq(RAX, RCX);
-      __ j(OVERFLOW, not_smi_or_overflow, Assembler::kNearJump);
+      __ j(OVERFLOW, not_smi_or_overflow, jump_length);
       break;
     }
     case Token::kEQ: {
@@ -1247,7 +1271,7 @@
   __ addq(R8, Immediate(Smi::RawValue(1)));
   __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovnoq(R9, R8);
-  __ movq(Address(R12, count_offset), R9);
+  __ StoreIntoSmiField(Address(R12, count_offset), R9);
 
   __ ret();
 }
@@ -1389,7 +1413,7 @@
   __ addq(R8, Immediate(Smi::RawValue(1)));
   __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovnoq(R9, R8);
-  __ movq(Address(R12, count_offset), R9);
+  __ StoreIntoSmiField(Address(R12, count_offset), R9);
 
   __ Bind(&call_target_function);
   // RAX: Target function.
@@ -1535,7 +1559,7 @@
   __ addq(R8, Immediate(Smi::RawValue(1)));
   __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovnoq(R9, R8);
-  __ movq(Address(R12, count_offset), R9);
+  __ StoreIntoSmiField(Address(R12, count_offset), R9);
 
   // Load arguments descriptor into R10.
   __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset()));
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index cb9cb70..bab0a96 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -18,6 +18,9 @@
 #define PREDEFINED_SYMBOLS_LIST(V)                                             \
   V(Empty, "")                                                                 \
   V(EqualOperator, "==")                                                       \
+  V(GreaterEqualOperator, ">=")                                                \
+  V(LessEqualOperator, "<=")                                                   \
+  V(UnaryMinus, "unary-")                                                      \
   V(Identical, "identical")                                                    \
   V(Length, "length")                                                          \
   V(IndexToken, "[]")                                                          \
@@ -163,6 +166,8 @@
   V(_SendPortImpl, "_SendPortImpl")                                            \
   V(StackTrace, "StackTrace")                                                  \
   V(JSSyntaxRegExp, "_JSSyntaxRegExp")                                         \
+  V(RegExp, "RegExp")                                                          \
+  V(IrregExp, ":irregexp")                                                     \
   V(Object, "Object")                                                          \
   V(Int, "int")                                                                \
   V(Double, "double")                                                          \
@@ -331,6 +336,27 @@
   V(StubPrefix, "[Stub] ")                                                     \
   V(ClassID, "ClassID")                                                        \
   V(DartIsVM, "dart.isVM")                                                     \
+  V(stack, ":stack")                                                           \
+  V(current_character, ":current_character")                                   \
+  V(current_position, ":current_position")                                     \
+  V(string_param_length, ":string_param_length")                               \
+  V(capture_length, ":capture_length")                                         \
+  V(word_character_map, ":word_character_map")                                 \
+  V(match_start_index, ":match_start_index")                                   \
+  V(capture_start_index, ":capture_start_index")                               \
+  V(match_end_index, ":match_end_index")                                       \
+  V(char_in_capture, ":char_in_capture")                                       \
+  V(char_in_match, ":char_in_match")                                           \
+  V(result, ":result")                                                         \
+  V(position_registers, ":position_registers")                                 \
+  V(string_param, ":string_param")                                             \
+  V(start_index_param, ":start_index_param")                                   \
+  V(clear, "clear")                                                            \
+  V(_wordCharacterMap, "_wordCharacterMap")                                    \
+  V(print, "print")                                                            \
+  V(last, "last")                                                              \
+  V(removeLast, "removeLast")                                                  \
+  V(add, "add")                                                                \
 
 
 // Contains a list of frequently used strings in a canonicalized form. This
@@ -374,6 +400,18 @@
   static const String& Equals() {
     return *(symbol_handles_[kNullCharId + '=']);
   }
+  static const String& Plus() {
+    return *(symbol_handles_[kNullCharId + '+']);
+  }
+  static const String& Minus() {
+    return *(symbol_handles_[kNullCharId + '-']);
+  }
+  static const String& BitOr() {
+    return *(symbol_handles_[kNullCharId + '|']);
+  }
+  static const String& BitAnd() {
+    return *(symbol_handles_[kNullCharId + '&']);
+  }
   static const String& LAngleBracket() {
     return *(symbol_handles_[kNullCharId + '<']);
   }
diff --git a/runtime/vm/unibrow-inl.h b/runtime/vm/unibrow-inl.h
index a7e3b22..340d1be 100644
--- a/runtime/vm/unibrow-inl.h
+++ b/runtime/vm/unibrow-inl.h
@@ -7,14 +7,12 @@
 
 #include "vm/unibrow.h"
 
-// SNIP
+#include "platform/assert.h"
 
 namespace unibrow {
 
-// SNIP
-
-template <class T, int s> int Mapping<T, s>::get(uchar c, uchar n,
-    uchar* result) {
+template <class T, intptr_t s> intptr_t Mapping<T, s>::get(
+    int32_t c, int32_t n, int32_t* result) {
   CacheEntry entry = entries_[c & kMask];
   if (entry.code_point_ == c) {
     if (entry.offset_ == 0) {
@@ -28,10 +26,10 @@
   }
 }
 
-template <class T, int s> int Mapping<T, s>::CalculateValue(uchar c, uchar n,
-    uchar* result) {
+template <class T, intptr_t s> intptr_t Mapping<T, s>::CalculateValue(
+    int32_t c, int32_t n, int32_t* result) {
   bool allow_caching = true;
-  int length = T::Convert(c, n, result, &allow_caching);
+  intptr_t length = T::Convert(c, n, result, &allow_caching);
   if (allow_caching) {
     if (length == 1) {
       entries_[c & kMask] = CacheEntry(c, result[0] - c);
@@ -45,8 +43,6 @@
   }
 }
 
-// SNIP
-
 }  // namespace unibrow
 
 #endif  // VM_UNIBROW_INL_H_
diff --git a/runtime/vm/unibrow.cc b/runtime/vm/unibrow.cc
index 7b4246b..197db69 100644
--- a/runtime/vm/unibrow.cc
+++ b/runtime/vm/unibrow.cc
@@ -4,31 +4,29 @@
 //
 // This file was generated at 2014-10-08 15:25:47.940335 (in v8, copied to dart)
 
-#include "vm/unicode-inl.h"
+#include "vm/unibrow-inl.h"
 #include <stdio.h>
 #include <stdlib.h>
 
 namespace unibrow {
 
-static const int kStartBit = (1 << 30);
-static const int kChunkBits = (1 << 13);
-static const uchar kSentinel = static_cast<uchar>(-1);
+static const intptr_t kStartBit = (1 << 30);
+static const intptr_t kChunkBits = (1 << 13);
+static const int32_t kSentinel = static_cast<int32_t>(-1);
 
 /**
  * \file
  * Implementations of functions for working with unicode.
  */
 
-// SNIP
-
 // All access to the character table should go through this function.
-template <int D>
-static inline uchar TableGet(const int32_t* table, int index) {
+template <intptr_t D>
+static inline int32_t TableGet(const int32_t* table, intptr_t index) {
   return table[D * index];
 }
 
 
-static inline uchar GetEntry(int32_t entry) {
+static inline int32_t GetEntry(int32_t entry) {
   return entry & (kStartBit - 1);
 }
 
@@ -48,14 +46,14 @@
  * about a character is around 10, slightly higher if there is no
  * information available about the character.
  */
-static bool LookupPredicate(const int32_t* table, uint16_t size, uchar chr) {
-  static const int kEntryDist = 1;
+static bool LookupPredicate(const int32_t* table, uint16_t size, int32_t chr) {
+  static const intptr_t kEntryDist = 1;
   uint16_t value = chr & (kChunkBits - 1);
-  unsigned int low = 0;
-  unsigned int high = size - 1;
+  uint32_t low = 0;
+  uint32_t high = size - 1;
   while (high != low) {
-    unsigned int mid = low + ((high - low) >> 1);
-    uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
+    uint32_t mid = low + ((high - low) >> 1);
+    int32_t current_value = GetEntry(TableGet<kEntryDist>(table, mid));
     // If we've found an entry less than or equal to this one, and the
     // next one is not also less than this one, we've arrived.
     if ((current_value <= value) &&
@@ -73,15 +71,15 @@
     }
   }
   int32_t field = TableGet<kEntryDist>(table, low);
-  uchar entry = GetEntry(field);
+  int32_t entry = GetEntry(field);
   bool is_start = IsStart(field);
   return (entry == value) || (entry < value && is_start);
 }
 
-template <int kW>
+template <intptr_t kW>
 struct MultiCharacterSpecialCase {
-  static const uchar kEndOfEncoding = kSentinel;
-  uchar chars[kW];
+  static const int32_t kEndOfEncoding = kSentinel;
+  int32_t chars[kW];
 };
 
 
@@ -96,22 +94,22 @@
 // If ranges are linear, a match between a start and end point is
 // offset by the distance between the match and the start. Otherwise
 // the result is the same as for the start point on the entire range.
-template <bool ranges_are_linear, int kW>
-static int LookupMapping(const int32_t* table,
-                         uint16_t size,
-                         const MultiCharacterSpecialCase<kW>* multi_chars,
-                         uchar chr,
-                         uchar next,
-                         uchar* result,
-                         bool* allow_caching_ptr) {
-  static const int kEntryDist = 2;
+template <bool ranges_are_linear, intptr_t kW>
+static intptr_t LookupMapping(const int32_t* table,
+                              uint16_t size,
+                              const MultiCharacterSpecialCase<kW>* multi_chars,
+                              int32_t chr,
+                              int32_t next,
+                              int32_t* result,
+                              bool* allow_caching_ptr) {
+  static const intptr_t kEntryDist = 2;
   uint16_t key = chr & (kChunkBits - 1);
   uint16_t chunk_start = chr - key;
-  unsigned int low = 0;
-  unsigned int high = size - 1;
+  uint32_t low = 0;
+  uint32_t high = size - 1;
   while (high != low) {
-    unsigned int mid = low + ((high - low) >> 1);
-    uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
+    uint32_t mid = low + ((high - low) >> 1);
+    int32_t current_value = GetEntry(TableGet<kEntryDist>(table, mid));
     // If we've found an entry less than or equal to this one, and the next one
     // is not also less than this one, we've arrived.
     if ((current_value <= key) &&
@@ -129,7 +127,7 @@
     }
   }
   int32_t field = TableGet<kEntryDist>(table, low);
-  uchar entry = GetEntry(field);
+  int32_t entry = GetEntry(field);
   bool is_start = IsStart(field);
   bool found = (entry == key) || (entry < key && is_start);
   if (found) {
@@ -149,9 +147,9 @@
       // Low bits 1 means a special case mapping
       if (allow_caching_ptr) *allow_caching_ptr = false;
       const MultiCharacterSpecialCase<kW>& mapping = multi_chars[value >> 2];
-      int length = 0;
+      intptr_t length = 0;
       for (length = 0; length < kW; length++) {
-        uchar mapped = mapping.chars[length];
+        int32_t mapped = mapping.chars[length];
         if (mapped == MultiCharacterSpecialCase<kW>::kEndOfEncoding) break;
         if (ranges_are_linear) {
           result[length] = mapped + (key - entry);
@@ -187,431 +185,6 @@
 }
 
 
-uchar Utf8::CalculateValue(const byte* str,
-                           unsigned length,
-                           unsigned* cursor) {
-  // We only get called for non-ASCII characters.
-  if (length == 1) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  byte first = str[0];
-  byte second = str[1] ^ 0x80;
-  if (second & 0xC0) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  if (first < 0xE0) {
-    if (first < 0xC0) {
-      *cursor += 1;
-      return kBadChar;
-    }
-    uchar code_point = ((first << 6) | second) & kMaxTwoByteChar;
-    if (code_point <= kMaxOneByteChar) {
-      *cursor += 1;
-      return kBadChar;
-    }
-    *cursor += 2;
-    return code_point;
-  }
-  if (length == 2) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  byte third = str[2] ^ 0x80;
-  if (third & 0xC0) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  if (first < 0xF0) {
-    uchar code_point = ((((first << 6) | second) << 6) | third)
-        & kMaxThreeByteChar;
-    if (code_point <= kMaxTwoByteChar) {
-      *cursor += 1;
-      return kBadChar;
-    }
-    *cursor += 3;
-    return code_point;
-  }
-  if (length == 3) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  byte fourth = str[3] ^ 0x80;
-  if (fourth & 0xC0) {
-    *cursor += 1;
-    return kBadChar;
-  }
-  if (first < 0xF8) {
-    uchar code_point = (((((first << 6 | second) << 6) | third) << 6) | fourth)
-        & kMaxFourByteChar;
-    if (code_point <= kMaxThreeByteChar) {
-      *cursor += 1;
-      return kBadChar;
-    }
-    *cursor += 4;
-    return code_point;
-  }
-  *cursor += 1;
-  return kBadChar;
-}
-
-
-// Uppercase:            point.category == 'Lu'
-
-static const uint16_t kUppercaseTable0Size = 455;
-static const int32_t kUppercaseTable0[455] = {
-    1073741889, 90,         1073742016, 214,
-    1073742040, 222,        256,        258,  // NOLINT
-    260,        262,        264,        266,
-    268,        270,        272,        274,  // NOLINT
-    276,        278,        280,        282,
-    284,        286,        288,        290,  // NOLINT
-    292,        294,        296,        298,
-    300,        302,        304,        306,  // NOLINT
-    308,        310,        313,        315,
-    317,        319,        321,        323,  // NOLINT
-    325,        327,        330,        332,
-    334,        336,        338,        340,  // NOLINT
-    342,        344,        346,        348,
-    350,        352,        354,        356,  // NOLINT
-    358,        360,        362,        364,
-    366,        368,        370,        372,  // NOLINT
-    374,        1073742200, 377,        379,
-    381,        1073742209, 386,        388,  // NOLINT
-    1073742214, 391,        1073742217, 395,
-    1073742222, 401,        1073742227, 404,  // NOLINT
-    1073742230, 408,        1073742236, 413,
-    1073742239, 416,        418,        420,  // NOLINT
-    1073742246, 423,        425,        428,
-    1073742254, 431,        1073742257, 435,  // NOLINT
-    437,        1073742263, 440,        444,
-    452,        455,        458,        461,  // NOLINT
-    463,        465,        467,        469,
-    471,        473,        475,        478,  // NOLINT
-    480,        482,        484,        486,
-    488,        490,        492,        494,  // NOLINT
-    497,        500,        1073742326, 504,
-    506,        508,        510,        512,  // NOLINT
-    514,        516,        518,        520,
-    522,        524,        526,        528,  // NOLINT
-    530,        532,        534,        536,
-    538,        540,        542,        544,  // NOLINT
-    546,        548,        550,        552,
-    554,        556,        558,        560,  // NOLINT
-    562,        1073742394, 571,        1073742397,
-    574,        577,        1073742403, 582,  // NOLINT
-    584,        586,        588,        590,
-    880,        882,        886,        895,  // NOLINT
-    902,        1073742728, 906,        908,
-    1073742734, 911,        1073742737, 929,  // NOLINT
-    1073742755, 939,        975,        1073742802,
-    980,        984,        986,        988,  // NOLINT
-    990,        992,        994,        996,
-    998,        1000,       1002,       1004,  // NOLINT
-    1006,       1012,       1015,       1073742841,
-    1018,       1073742845, 1071,       1120,  // NOLINT
-    1122,       1124,       1126,       1128,
-    1130,       1132,       1134,       1136,  // NOLINT
-    1138,       1140,       1142,       1144,
-    1146,       1148,       1150,       1152,  // NOLINT
-    1162,       1164,       1166,       1168,
-    1170,       1172,       1174,       1176,  // NOLINT
-    1178,       1180,       1182,       1184,
-    1186,       1188,       1190,       1192,  // NOLINT
-    1194,       1196,       1198,       1200,
-    1202,       1204,       1206,       1208,  // NOLINT
-    1210,       1212,       1214,       1073743040,
-    1217,       1219,       1221,       1223,  // NOLINT
-    1225,       1227,       1229,       1232,
-    1234,       1236,       1238,       1240,  // NOLINT
-    1242,       1244,       1246,       1248,
-    1250,       1252,       1254,       1256,  // NOLINT
-    1258,       1260,       1262,       1264,
-    1266,       1268,       1270,       1272,  // NOLINT
-    1274,       1276,       1278,       1280,
-    1282,       1284,       1286,       1288,  // NOLINT
-    1290,       1292,       1294,       1296,
-    1298,       1300,       1302,       1304,  // NOLINT
-    1306,       1308,       1310,       1312,
-    1314,       1316,       1318,       1320,  // NOLINT
-    1322,       1324,       1326,       1073743153,
-    1366,       1073746080, 4293,       4295,  // NOLINT
-    4301,       7680,       7682,       7684,
-    7686,       7688,       7690,       7692,  // NOLINT
-    7694,       7696,       7698,       7700,
-    7702,       7704,       7706,       7708,  // NOLINT
-    7710,       7712,       7714,       7716,
-    7718,       7720,       7722,       7724,  // NOLINT
-    7726,       7728,       7730,       7732,
-    7734,       7736,       7738,       7740,  // NOLINT
-    7742,       7744,       7746,       7748,
-    7750,       7752,       7754,       7756,  // NOLINT
-    7758,       7760,       7762,       7764,
-    7766,       7768,       7770,       7772,  // NOLINT
-    7774,       7776,       7778,       7780,
-    7782,       7784,       7786,       7788,  // NOLINT
-    7790,       7792,       7794,       7796,
-    7798,       7800,       7802,       7804,  // NOLINT
-    7806,       7808,       7810,       7812,
-    7814,       7816,       7818,       7820,  // NOLINT
-    7822,       7824,       7826,       7828,
-    7838,       7840,       7842,       7844,  // NOLINT
-    7846,       7848,       7850,       7852,
-    7854,       7856,       7858,       7860,  // NOLINT
-    7862,       7864,       7866,       7868,
-    7870,       7872,       7874,       7876,  // NOLINT
-    7878,       7880,       7882,       7884,
-    7886,       7888,       7890,       7892,  // NOLINT
-    7894,       7896,       7898,       7900,
-    7902,       7904,       7906,       7908,  // NOLINT
-    7910,       7912,       7914,       7916,
-    7918,       7920,       7922,       7924,  // NOLINT
-    7926,       7928,       7930,       7932,
-    7934,       1073749768, 7951,       1073749784,  // NOLINT
-    7965,       1073749800, 7983,       1073749816,
-    7999,       1073749832, 8013,       8025,  // NOLINT
-    8027,       8029,       8031,       1073749864,
-    8047,       1073749944, 8123,       1073749960,  // NOLINT
-    8139,       1073749976, 8155,       1073749992,
-    8172,       1073750008, 8187};  // NOLINT
-static const uint16_t kUppercaseTable1Size = 86;
-static const int32_t kUppercaseTable1[86] = {
-  258, 263, 1073742091, 269, 1073742096, 274, 277, 1073742105,  // NOLINT
-  285, 292, 294, 296, 1073742122, 301, 1073742128, 307,  // NOLINT
-  1073742142, 319, 325, 387, 1073744896, 3118, 3168, 1073744994,  // NOLINT
-  3172, 3175, 3177, 3179, 1073745005, 3184, 3186, 3189,  // NOLINT
-  1073745022, 3200, 3202, 3204, 3206, 3208, 3210, 3212,  // NOLINT
-  3214, 3216, 3218, 3220, 3222, 3224, 3226, 3228,  // NOLINT
-  3230, 3232, 3234, 3236, 3238, 3240, 3242, 3244,  // NOLINT
-  3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260,  // NOLINT
-  3262, 3264, 3266, 3268, 3270, 3272, 3274, 3276,  // NOLINT
-  3278, 3280, 3282, 3284, 3286, 3288, 3290, 3292,  // NOLINT
-  3294, 3296, 3298, 3307, 3309, 3314 };  // NOLINT
-static const uint16_t kUppercaseTable5Size = 101;
-static const int32_t kUppercaseTable5[101] = {
-    1600, 1602,       1604, 1606,       1608, 1610,       1612, 1614,  // NOLINT
-    1616, 1618,       1620, 1622,       1624, 1626,       1628, 1630,  // NOLINT
-    1632, 1634,       1636, 1638,       1640, 1642,       1644, 1664,  // NOLINT
-    1666, 1668,       1670, 1672,       1674, 1676,       1678, 1680,  // NOLINT
-    1682, 1684,       1686, 1688,       1690, 1826,       1828, 1830,  // NOLINT
-    1832, 1834,       1836, 1838,       1842, 1844,       1846, 1848,  // NOLINT
-    1850, 1852,       1854, 1856,       1858, 1860,       1862, 1864,  // NOLINT
-    1866, 1868,       1870, 1872,       1874, 1876,       1878, 1880,  // NOLINT
-    1882, 1884,       1886, 1888,       1890, 1892,       1894, 1896,  // NOLINT
-    1898, 1900,       1902, 1913,       1915, 1073743741, 1918, 1920,  // NOLINT
-    1922, 1924,       1926, 1931,       1933, 1936,       1938, 1942,  // NOLINT
-    1944, 1946,       1948, 1950,       1952, 1954,       1956, 1958,  // NOLINT
-    1960, 1073743786, 1965, 1073743792, 1969};                         // NOLINT
-static const uint16_t kUppercaseTable7Size = 2;
-static const int32_t kUppercaseTable7[2] = {
-  1073749793, 7994 };  // NOLINT
-bool Uppercase::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupPredicate(kUppercaseTable0,
-                                       kUppercaseTable0Size,
-                                       c);
-    case 1: return LookupPredicate(kUppercaseTable1,
-                                       kUppercaseTable1Size,
-                                       c);
-    case 5: return LookupPredicate(kUppercaseTable5,
-                                       kUppercaseTable5Size,
-                                       c);
-    case 7: return LookupPredicate(kUppercaseTable7,
-                                       kUppercaseTable7Size,
-                                       c);
-    default: return false;
-  }
-}
-
-
-// Lowercase:            point.category == 'Ll'
-
-static const uint16_t kLowercaseTable0Size = 467;
-static const int32_t kLowercaseTable0[467] = {
-    1073741921, 122,        181,        1073742047,
-    246,        1073742072, 255,        257,  // NOLINT
-    259,        261,        263,        265,
-    267,        269,        271,        273,  // NOLINT
-    275,        277,        279,        281,
-    283,        285,        287,        289,  // NOLINT
-    291,        293,        295,        297,
-    299,        301,        303,        305,  // NOLINT
-    307,        309,        1073742135, 312,
-    314,        316,        318,        320,  // NOLINT
-    322,        324,        326,        1073742152,
-    329,        331,        333,        335,  // NOLINT
-    337,        339,        341,        343,
-    345,        347,        349,        351,  // NOLINT
-    353,        355,        357,        359,
-    361,        363,        365,        367,  // NOLINT
-    369,        371,        373,        375,
-    378,        380,        1073742206, 384,  // NOLINT
-    387,        389,        392,        1073742220,
-    397,        402,        405,        1073742233,  // NOLINT
-    411,        414,        417,        419,
-    421,        424,        1073742250, 427,  // NOLINT
-    429,        432,        436,        438,
-    1073742265, 442,        1073742269, 447,  // NOLINT
-    454,        457,        460,        462,
-    464,        466,        468,        470,  // NOLINT
-    472,        474,        1073742300, 477,
-    479,        481,        483,        485,  // NOLINT
-    487,        489,        491,        493,
-    1073742319, 496,        499,        501,  // NOLINT
-    505,        507,        509,        511,
-    513,        515,        517,        519,  // NOLINT
-    521,        523,        525,        527,
-    529,        531,        533,        535,  // NOLINT
-    537,        539,        541,        543,
-    545,        547,        549,        551,  // NOLINT
-    553,        555,        557,        559,
-    561,        1073742387, 569,        572,  // NOLINT
-    1073742399, 576,        578,        583,
-    585,        587,        589,        1073742415,  // NOLINT
-    659,        1073742485, 687,        881,
-    883,        887,        1073742715, 893,  // NOLINT
-    912,        1073742764, 974,        1073742800,
-    977,        1073742805, 983,        985,  // NOLINT
-    987,        989,        991,        993,
-    995,        997,        999,        1001,  // NOLINT
-    1003,       1005,       1073742831, 1011,
-    1013,       1016,       1073742843, 1020,  // NOLINT
-    1073742896, 1119,       1121,       1123,
-    1125,       1127,       1129,       1131,  // NOLINT
-    1133,       1135,       1137,       1139,
-    1141,       1143,       1145,       1147,  // NOLINT
-    1149,       1151,       1153,       1163,
-    1165,       1167,       1169,       1171,  // NOLINT
-    1173,       1175,       1177,       1179,
-    1181,       1183,       1185,       1187,  // NOLINT
-    1189,       1191,       1193,       1195,
-    1197,       1199,       1201,       1203,  // NOLINT
-    1205,       1207,       1209,       1211,
-    1213,       1215,       1218,       1220,  // NOLINT
-    1222,       1224,       1226,       1228,
-    1073743054, 1231,       1233,       1235,  // NOLINT
-    1237,       1239,       1241,       1243,
-    1245,       1247,       1249,       1251,  // NOLINT
-    1253,       1255,       1257,       1259,
-    1261,       1263,       1265,       1267,  // NOLINT
-    1269,       1271,       1273,       1275,
-    1277,       1279,       1281,       1283,  // NOLINT
-    1285,       1287,       1289,       1291,
-    1293,       1295,       1297,       1299,  // NOLINT
-    1301,       1303,       1305,       1307,
-    1309,       1311,       1313,       1315,  // NOLINT
-    1317,       1319,       1321,       1323,
-    1325,       1327,       1073743201, 1415,  // NOLINT
-    1073749248, 7467,       1073749355, 7543,
-    1073749369, 7578,       7681,       7683,  // NOLINT
-    7685,       7687,       7689,       7691,
-    7693,       7695,       7697,       7699,  // NOLINT
-    7701,       7703,       7705,       7707,
-    7709,       7711,       7713,       7715,  // NOLINT
-    7717,       7719,       7721,       7723,
-    7725,       7727,       7729,       7731,  // NOLINT
-    7733,       7735,       7737,       7739,
-    7741,       7743,       7745,       7747,  // NOLINT
-    7749,       7751,       7753,       7755,
-    7757,       7759,       7761,       7763,  // NOLINT
-    7765,       7767,       7769,       7771,
-    7773,       7775,       7777,       7779,  // NOLINT
-    7781,       7783,       7785,       7787,
-    7789,       7791,       7793,       7795,  // NOLINT
-    7797,       7799,       7801,       7803,
-    7805,       7807,       7809,       7811,  // NOLINT
-    7813,       7815,       7817,       7819,
-    7821,       7823,       7825,       7827,  // NOLINT
-    1073749653, 7837,       7839,       7841,
-    7843,       7845,       7847,       7849,  // NOLINT
-    7851,       7853,       7855,       7857,
-    7859,       7861,       7863,       7865,  // NOLINT
-    7867,       7869,       7871,       7873,
-    7875,       7877,       7879,       7881,  // NOLINT
-    7883,       7885,       7887,       7889,
-    7891,       7893,       7895,       7897,  // NOLINT
-    7899,       7901,       7903,       7905,
-    7907,       7909,       7911,       7913,  // NOLINT
-    7915,       7917,       7919,       7921,
-    7923,       7925,       7927,       7929,  // NOLINT
-    7931,       7933,       1073749759, 7943,
-    1073749776, 7957,       1073749792, 7975,  // NOLINT
-    1073749808, 7991,       1073749824, 8005,
-    1073749840, 8023,       1073749856, 8039,  // NOLINT
-    1073749872, 8061,       1073749888, 8071,
-    1073749904, 8087,       1073749920, 8103,  // NOLINT
-    1073749936, 8116,       1073749942, 8119,
-    8126,       1073749954, 8132,       1073749958,  // NOLINT
-    8135,       1073749968, 8147,       1073749974,
-    8151,       1073749984, 8167,       1073750002,  // NOLINT
-    8180,       1073750006, 8183};                   // NOLINT
-static const uint16_t kLowercaseTable1Size = 84;
-static const int32_t kLowercaseTable1[84] = {
-  266, 1073742094, 271, 275, 303, 308, 313, 1073742140,  // NOLINT
-  317, 1073742150, 329, 334, 388, 1073744944, 3166, 3169,  // NOLINT
-  1073744997, 3174, 3176, 3178, 3180, 3185, 1073745011, 3188,  // NOLINT
-  1073745014, 3195, 3201, 3203, 3205, 3207, 3209, 3211,  // NOLINT
-  3213, 3215, 3217, 3219, 3221, 3223, 3225, 3227,  // NOLINT
-  3229, 3231, 3233, 3235, 3237, 3239, 3241, 3243,  // NOLINT
-  3245, 3247, 3249, 3251, 3253, 3255, 3257, 3259,  // NOLINT
-  3261, 3263, 3265, 3267, 3269, 3271, 3273, 3275,  // NOLINT
-  3277, 3279, 3281, 3283, 3285, 3287, 3289, 3291,  // NOLINT
-  3293, 3295, 3297, 1073745123, 3300, 3308, 3310, 3315,  // NOLINT
-  1073745152, 3365, 3367, 3373 };  // NOLINT
-static const uint16_t kLowercaseTable5Size = 105;
-static const int32_t kLowercaseTable5[105] = {
-    1601,       1603,       1605, 1607,
-    1609,       1611,       1613, 1615,  // NOLINT
-    1617,       1619,       1621, 1623,
-    1625,       1627,       1629, 1631,  // NOLINT
-    1633,       1635,       1637, 1639,
-    1641,       1643,       1645, 1665,  // NOLINT
-    1667,       1669,       1671, 1673,
-    1675,       1677,       1679, 1681,  // NOLINT
-    1683,       1685,       1687, 1689,
-    1691,       1827,       1829, 1831,  // NOLINT
-    1833,       1835,       1837, 1073743663,
-    1841,       1843,       1845, 1847,  // NOLINT
-    1849,       1851,       1853, 1855,
-    1857,       1859,       1861, 1863,  // NOLINT
-    1865,       1867,       1869, 1871,
-    1873,       1875,       1877, 1879,  // NOLINT
-    1881,       1883,       1885, 1887,
-    1889,       1891,       1893, 1895,  // NOLINT
-    1897,       1899,       1901, 1903,
-    1073743729, 1912,       1914, 1916,  // NOLINT
-    1919,       1921,       1923, 1925,
-    1927,       1932,       1934, 1937,  // NOLINT
-    1073743763, 1941,       1943, 1945,
-    1947,       1949,       1951, 1953,  // NOLINT
-    1955,       1957,       1959, 1961,
-    2042,       1073744688, 2906, 1073744740,  // NOLINT
-    2917};                                     // NOLINT
-static const uint16_t kLowercaseTable7Size = 6;
-static const int32_t kLowercaseTable7[6] = {
-  1073748736, 6918, 1073748755, 6935, 1073749825, 8026 };  // NOLINT
-bool Lowercase::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupPredicate(kLowercaseTable0,
-                                       kLowercaseTable0Size,
-                                       c);
-    case 1: return LookupPredicate(kLowercaseTable1,
-                                       kLowercaseTable1Size,
-                                       c);
-    case 5: return LookupPredicate(kLowercaseTable5,
-                                       kLowercaseTable5Size,
-                                       c);
-    case 7: return LookupPredicate(kLowercaseTable7,
-                                       kLowercaseTable7Size,
-                                       c);
-    default: return false;
-  }
-}
-
-
 // Letter:               point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl']
 
 static const uint16_t kLetterTable0Size = 431;
@@ -784,8 +357,8 @@
   1073749328, 7567, 1073749394, 7623, 1073749488, 7675, 1073749616, 7796,  // NOLINT
   1073749622, 7932, 1073749793, 7994, 1073749825, 8026, 1073749862, 8126,  // NOLINT
   1073749954, 8135, 1073749962, 8143, 1073749970, 8151, 1073749978, 8156 };  // NOLINT
-bool Letter::Is(uchar c) {
-  int chunk_index = c >> 13;
+bool Letter::Is(int32_t c) {
+  intptr_t chunk_index = c >> 13;
   switch (chunk_index) {
     case 0: return LookupPredicate(kLetterTable0,
                                        kLetterTable0Size,
@@ -816,1010 +389,6 @@
 }
 
 
-// ID_Start:             ((point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo',
-// 'Nl'] or 'Other_ID_Start' in point.properties) and ('Pattern_Syntax' not in
-// point.properties) and ('Pattern_White_Space' not in point.properties)) or
-// ('JS_ID_Start' in point.properties)
-
-static const uint16_t kID_StartTable0Size = 434;
-static const int32_t kID_StartTable0[434] = {
-    36,         1073741889, 90,         92,
-    95,         1073741921, 122,        170,  // NOLINT
-    181,        186,        1073742016, 214,
-    1073742040, 246,        1073742072, 705,  // NOLINT
-    1073742534, 721,        1073742560, 740,
-    748,        750,        1073742704, 884,  // NOLINT
-    1073742710, 887,        1073742714, 893,
-    895,        902,        1073742728, 906,  // NOLINT
-    908,        1073742734, 929,        1073742755,
-    1013,       1073742839, 1153,       1073742986,  // NOLINT
-    1327,       1073743153, 1366,       1369,
-    1073743201, 1415,       1073743312, 1514,  // NOLINT
-    1073743344, 1522,       1073743392, 1610,
-    1073743470, 1647,       1073743473, 1747,  // NOLINT
-    1749,       1073743589, 1766,       1073743598,
-    1775,       1073743610, 1788,       1791,  // NOLINT
-    1808,       1073743634, 1839,       1073743693,
-    1957,       1969,       1073743818, 2026,  // NOLINT
-    1073743860, 2037,       2042,       1073743872,
-    2069,       2074,       2084,       2088,  // NOLINT
-    1073743936, 2136,       1073744032, 2226,
-    1073744132, 2361,       2365,       2384,  // NOLINT
-    1073744216, 2401,       1073744241, 2432,
-    1073744261, 2444,       1073744271, 2448,  // NOLINT
-    1073744275, 2472,       1073744298, 2480,
-    2482,       1073744310, 2489,       2493,  // NOLINT
-    2510,       1073744348, 2525,       1073744351,
-    2529,       1073744368, 2545,       1073744389,  // NOLINT
-    2570,       1073744399, 2576,       1073744403,
-    2600,       1073744426, 2608,       1073744434,  // NOLINT
-    2611,       1073744437, 2614,       1073744440,
-    2617,       1073744473, 2652,       2654,  // NOLINT
-    1073744498, 2676,       1073744517, 2701,
-    1073744527, 2705,       1073744531, 2728,  // NOLINT
-    1073744554, 2736,       1073744562, 2739,
-    1073744565, 2745,       2749,       2768,  // NOLINT
-    1073744608, 2785,       1073744645, 2828,
-    1073744655, 2832,       1073744659, 2856,  // NOLINT
-    1073744682, 2864,       1073744690, 2867,
-    1073744693, 2873,       2877,       1073744732,  // NOLINT
-    2909,       1073744735, 2913,       2929,
-    2947,       1073744773, 2954,       1073744782,  // NOLINT
-    2960,       1073744786, 2965,       1073744793,
-    2970,       2972,       1073744798, 2975,  // NOLINT
-    1073744803, 2980,       1073744808, 2986,
-    1073744814, 3001,       3024,       1073744901,  // NOLINT
-    3084,       1073744910, 3088,       1073744914,
-    3112,       1073744938, 3129,       3133,  // NOLINT
-    1073744984, 3161,       1073744992, 3169,
-    1073745029, 3212,       1073745038, 3216,  // NOLINT
-    1073745042, 3240,       1073745066, 3251,
-    1073745077, 3257,       3261,       3294,  // NOLINT
-    1073745120, 3297,       1073745137, 3314,
-    1073745157, 3340,       1073745166, 3344,  // NOLINT
-    1073745170, 3386,       3389,       3406,
-    1073745248, 3425,       1073745274, 3455,  // NOLINT
-    1073745285, 3478,       1073745306, 3505,
-    1073745331, 3515,       3517,       1073745344,  // NOLINT
-    3526,       1073745409, 3632,       1073745458,
-    3635,       1073745472, 3654,       1073745537,  // NOLINT
-    3714,       3716,       1073745543, 3720,
-    3722,       3725,       1073745556, 3735,  // NOLINT
-    1073745561, 3743,       1073745569, 3747,
-    3749,       3751,       1073745578, 3755,  // NOLINT
-    1073745581, 3760,       1073745586, 3763,
-    3773,       1073745600, 3780,       3782,  // NOLINT
-    1073745628, 3807,       3840,       1073745728,
-    3911,       1073745737, 3948,       1073745800,  // NOLINT
-    3980,       1073745920, 4138,       4159,
-    1073746000, 4181,       1073746010, 4189,  // NOLINT
-    4193,       1073746021, 4198,       1073746030,
-    4208,       1073746037, 4225,       4238,  // NOLINT
-    1073746080, 4293,       4295,       4301,
-    1073746128, 4346,       1073746172, 4680,  // NOLINT
-    1073746506, 4685,       1073746512, 4694,
-    4696,       1073746522, 4701,       1073746528,  // NOLINT
-    4744,       1073746570, 4749,       1073746576,
-    4784,       1073746610, 4789,       1073746616,  // NOLINT
-    4798,       4800,       1073746626, 4805,
-    1073746632, 4822,       1073746648, 4880,  // NOLINT
-    1073746706, 4885,       1073746712, 4954,
-    1073746816, 5007,       1073746848, 5108,  // NOLINT
-    1073746945, 5740,       1073747567, 5759,
-    1073747585, 5786,       1073747616, 5866,  // NOLINT
-    1073747694, 5880,       1073747712, 5900,
-    1073747726, 5905,       1073747744, 5937,  // NOLINT
-    1073747776, 5969,       1073747808, 5996,
-    1073747822, 6000,       1073747840, 6067,  // NOLINT
-    6103,       6108,       1073748000, 6263,
-    1073748096, 6312,       6314,       1073748144,  // NOLINT
-    6389,       1073748224, 6430,       1073748304,
-    6509,       1073748336, 6516,       1073748352,  // NOLINT
-    6571,       1073748417, 6599,       1073748480,
-    6678,       1073748512, 6740,       6823,  // NOLINT
-    1073748741, 6963,       1073748805, 6987,
-    1073748867, 7072,       1073748910, 7087,  // NOLINT
-    1073748922, 7141,       1073748992, 7203,
-    1073749069, 7247,       1073749082, 7293,  // NOLINT
-    1073749225, 7404,       1073749230, 7409,
-    1073749237, 7414,       1073749248, 7615,  // NOLINT
-    1073749504, 7957,       1073749784, 7965,
-    1073749792, 8005,       1073749832, 8013,  // NOLINT
-    1073749840, 8023,       8025,       8027,
-    8029,       1073749855, 8061,       1073749888,  // NOLINT
-    8116,       1073749942, 8124,       8126,
-    1073749954, 8132,       1073749958, 8140,  // NOLINT
-    1073749968, 8147,       1073749974, 8155,
-    1073749984, 8172,       1073750002, 8180,  // NOLINT
-    1073750006, 8188};                         // NOLINT
-static const uint16_t kID_StartTable1Size = 84;
-static const int32_t kID_StartTable1[84] = {
-    113,        127,        1073741968, 156,
-    258,        263,        1073742090, 275,  // NOLINT
-    277,        1073742104, 285,        292,
-    294,        296,        1073742122, 313,  // NOLINT
-    1073742140, 319,        1073742149, 329,
-    334,        1073742176, 392,        1073744896,  // NOLINT
-    3118,       1073744944, 3166,       1073744992,
-    3300,       1073745131, 3310,       1073745138,  // NOLINT
-    3315,       1073745152, 3365,       3367,
-    3373,       1073745200, 3431,       3439,  // NOLINT
-    1073745280, 3478,       1073745312, 3494,
-    1073745320, 3502,       1073745328, 3510,  // NOLINT
-    1073745336, 3518,       1073745344, 3526,
-    1073745352, 3534,       1073745360, 3542,  // NOLINT
-    1073745368, 3550,       1073745925, 4103,
-    1073745953, 4137,       1073745969, 4149,  // NOLINT
-    1073745976, 4156,       1073745985, 4246,
-    1073746075, 4255,       1073746081, 4346,  // NOLINT
-    1073746172, 4351,       1073746181, 4397,
-    1073746225, 4494,       1073746336, 4538,   // NOLINT
-    1073746416, 4607,       1073746944, 8191};  // NOLINT
-static const uint16_t kID_StartTable2Size = 4;
-static const int32_t kID_StartTable2[4] = {1073741824, 3509, 1073745408,
-                                           8191};  // NOLINT
-static const uint16_t kID_StartTable3Size = 2;
-static const int32_t kID_StartTable3[2] = {1073741824, 8191};  // NOLINT
-static const uint16_t kID_StartTable4Size = 2;
-static const int32_t kID_StartTable4[2] = {1073741824, 8140};  // NOLINT
-static const uint16_t kID_StartTable5Size = 100;
-static const int32_t kID_StartTable5[100] = {
-    1073741824, 1164,       1073743056, 1277,
-    1073743104, 1548,       1073743376, 1567,  // NOLINT
-    1073743402, 1579,       1073743424, 1646,
-    1073743487, 1693,       1073743520, 1775,  // NOLINT
-    1073743639, 1823,       1073743650, 1928,
-    1073743755, 1934,       1073743760, 1965,  // NOLINT
-    1073743792, 1969,       1073743863, 2049,
-    1073743875, 2053,       1073743879, 2058,  // NOLINT
-    1073743884, 2082,       1073743936, 2163,
-    1073744002, 2227,       1073744114, 2295,  // NOLINT
-    2299,       1073744138, 2341,       1073744176,
-    2374,       1073744224, 2428,       1073744260,  // NOLINT
-    2482,       2511,       1073744352, 2532,
-    1073744358, 2543,       1073744378, 2558,  // NOLINT
-    1073744384, 2600,       1073744448, 2626,
-    1073744452, 2635,       1073744480, 2678,  // NOLINT
-    2682,       1073744510, 2735,       2737,
-    1073744565, 2742,       1073744569, 2749,  // NOLINT
-    2752,       2754,       1073744603, 2781,
-    1073744608, 2794,       1073744626, 2804,  // NOLINT
-    1073744641, 2822,       1073744649, 2830,
-    1073744657, 2838,       1073744672, 2854,  // NOLINT
-    1073744680, 2862,       1073744688, 2906,
-    1073744732, 2911,       1073744740, 2917,   // NOLINT
-    1073744832, 3042,       1073744896, 8191};  // NOLINT
-static const uint16_t kID_StartTable6Size = 6;
-static const int32_t kID_StartTable6[6] = {1073741824, 6051, 1073747888, 6086,
-                                           1073747915, 6139};  // NOLINT
-static const uint16_t kID_StartTable7Size = 48;
-static const int32_t kID_StartTable7[48] = {
-    1073748224, 6765,       1073748592, 6873,
-    1073748736, 6918,       1073748755, 6935,  // NOLINT
-    6941,       1073748767, 6952,       1073748778,
-    6966,       1073748792, 6972,       6974,  // NOLINT
-    1073748800, 6977,       1073748803, 6980,
-    1073748806, 7089,       1073748947, 7485,  // NOLINT
-    1073749328, 7567,       1073749394, 7623,
-    1073749488, 7675,       1073749616, 7796,  // NOLINT
-    1073749622, 7932,       1073749793, 7994,
-    1073749825, 8026,       1073749862, 8126,  // NOLINT
-    1073749954, 8135,       1073749962, 8143,
-    1073749970, 8151,       1073749978, 8156};  // NOLINT
-bool ID_Start::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0:
-      return LookupPredicate(kID_StartTable0, kID_StartTable0Size, c);
-    case 1:
-      return LookupPredicate(kID_StartTable1, kID_StartTable1Size, c);
-    case 2:
-      return LookupPredicate(kID_StartTable2, kID_StartTable2Size, c);
-    case 3:
-      return LookupPredicate(kID_StartTable3, kID_StartTable3Size, c);
-    case 4:
-      return LookupPredicate(kID_StartTable4, kID_StartTable4Size, c);
-    case 5:
-      return LookupPredicate(kID_StartTable5, kID_StartTable5Size, c);
-    case 6:
-      return LookupPredicate(kID_StartTable6, kID_StartTable6Size, c);
-    case 7:
-      return LookupPredicate(kID_StartTable7, kID_StartTable7Size, c);
-    default:
-      return false;
-  }
-}
-
-
-// ID_Continue:          point.category in ['Nd', 'Mn', 'Mc', 'Pc'] or
-// 'Other_ID_Continue' in point.properties or 'JS_ID_Continue' in
-// point.properties
-
-static const uint16_t kID_ContinueTable0Size = 315;
-static const int32_t kID_ContinueTable0[315] = {
-    1073741872, 57,         95,         183,
-    1073742592, 879,        903,        1073742979,  // NOLINT
-    1159,       1073743249, 1469,       1471,
-    1073743297, 1474,       1073743300, 1477,  // NOLINT
-    1479,       1073743376, 1562,       1073743435,
-    1641,       1648,       1073743574, 1756,  // NOLINT
-    1073743583, 1764,       1073743591, 1768,
-    1073743594, 1773,       1073743600, 1785,  // NOLINT
-    1809,       1073743664, 1866,       1073743782,
-    1968,       1073743808, 1993,       1073743851,  // NOLINT
-    2035,       1073743894, 2073,       1073743899,
-    2083,       1073743909, 2087,       1073743913,  // NOLINT
-    2093,       1073743961, 2139,       1073744100,
-    2307,       1073744186, 2364,       1073744190,  // NOLINT
-    2383,       1073744209, 2391,       1073744226,
-    2403,       1073744230, 2415,       1073744257,  // NOLINT
-    2435,       2492,       1073744318, 2500,
-    1073744327, 2504,       1073744331, 2509,  // NOLINT
-    2519,       1073744354, 2531,       1073744358,
-    2543,       1073744385, 2563,       2620,  // NOLINT
-    1073744446, 2626,       1073744455, 2632,
-    1073744459, 2637,       2641,       1073744486,  // NOLINT
-    2673,       2677,       1073744513, 2691,
-    2748,       1073744574, 2757,       1073744583,  // NOLINT
-    2761,       1073744587, 2765,       1073744610,
-    2787,       1073744614, 2799,       1073744641,  // NOLINT
-    2819,       2876,       1073744702, 2884,
-    1073744711, 2888,       1073744715, 2893,  // NOLINT
-    1073744726, 2903,       1073744738, 2915,
-    1073744742, 2927,       2946,       1073744830,  // NOLINT
-    3010,       1073744838, 3016,       1073744842,
-    3021,       3031,       1073744870, 3055,  // NOLINT
-    1073744896, 3075,       1073744958, 3140,
-    1073744966, 3144,       1073744970, 3149,  // NOLINT
-    1073744981, 3158,       1073744994, 3171,
-    1073744998, 3183,       1073745025, 3203,  // NOLINT
-    3260,       1073745086, 3268,       1073745094,
-    3272,       1073745098, 3277,       1073745109,  // NOLINT
-    3286,       1073745122, 3299,       1073745126,
-    3311,       1073745153, 3331,       1073745214,  // NOLINT
-    3396,       1073745222, 3400,       1073745226,
-    3405,       3415,       1073745250, 3427,  // NOLINT
-    1073745254, 3439,       1073745282, 3459,
-    3530,       1073745359, 3540,       3542,  // NOLINT
-    1073745368, 3551,       1073745382, 3567,
-    1073745394, 3571,       3633,       1073745460,  // NOLINT
-    3642,       1073745479, 3662,       1073745488,
-    3673,       3761,       1073745588, 3769,  // NOLINT
-    1073745595, 3772,       1073745608, 3789,
-    1073745616, 3801,       1073745688, 3865,  // NOLINT
-    1073745696, 3881,       3893,       3895,
-    3897,       1073745726, 3903,       1073745777,  // NOLINT
-    3972,       1073745798, 3975,       1073745805,
-    3991,       1073745817, 4028,       4038,  // NOLINT
-    1073745963, 4158,       1073745984, 4169,
-    1073746006, 4185,       1073746014, 4192,  // NOLINT
-    1073746018, 4196,       1073746023, 4205,
-    1073746033, 4212,       1073746050, 4237,  // NOLINT
-    1073746063, 4253,       1073746781, 4959,
-    1073746793, 4977,       1073747730, 5908,  // NOLINT
-    1073747762, 5940,       1073747794, 5971,
-    1073747826, 6003,       1073747892, 6099,  // NOLINT
-    6109,       1073747936, 6121,       1073747979,
-    6157,       1073747984, 6169,       6313,  // NOLINT
-    1073748256, 6443,       1073748272, 6459,
-    1073748294, 6479,       1073748400, 6592,  // NOLINT
-    1073748424, 6601,       1073748432, 6618,
-    1073748503, 6683,       1073748565, 6750,  // NOLINT
-    1073748576, 6780,       1073748607, 6793,
-    1073748624, 6809,       1073748656, 6845,  // NOLINT
-    1073748736, 6916,       1073748788, 6980,
-    1073748816, 7001,       1073748843, 7027,  // NOLINT
-    1073748864, 7042,       1073748897, 7085,
-    1073748912, 7097,       1073748966, 7155,  // NOLINT
-    1073749028, 7223,       1073749056, 7241,
-    1073749072, 7257,       1073749200, 7378,  // NOLINT
-    1073749204, 7400,       7405,       1073749234,
-    7412,       1073749240, 7417,       1073749440,  // NOLINT
-    7669,       1073749500, 7679};                   // NOLINT
-static const uint16_t kID_ContinueTable1Size = 19;
-static const int32_t kID_ContinueTable1[19] = {
-    1073741836, 13,         1073741887, 64,
-    84,         1073742032, 220,        225,  // NOLINT
-    1073742053, 240,        1073745135, 3313,
-    3455,       1073745376, 3583,       1073745962,  // NOLINT
-    4143,       1073746073, 4250};                   // NOLINT
-static const uint16_t kID_ContinueTable5Size = 63;
-static const int32_t kID_ContinueTable5[63] = {
-    1073743392, 1577,       1647,       1073743476,
-    1661,       1695,       1073743600, 1777,  // NOLINT
-    2050,       2054,       2059,       1073743907,
-    2087,       1073744000, 2177,       1073744052,  // NOLINT
-    2244,       1073744080, 2265,       1073744096,
-    2289,       1073744128, 2313,       1073744166,  // NOLINT
-    2349,       1073744199, 2387,       1073744256,
-    2435,       1073744307, 2496,       1073744336,  // NOLINT
-    2521,       2533,       1073744368, 2553,
-    1073744425, 2614,       2627,       1073744460,  // NOLINT
-    2637,       1073744464, 2649,       1073744507,
-    2685,       2736,       1073744562, 2740,  // NOLINT
-    1073744567, 2744,       1073744574, 2751,
-    2753,       1073744619, 2799,       1073744629,  // NOLINT
-    2806,       1073744867, 3050,       1073744876,
-    3053,       1073744880, 3065};  // NOLINT
-static const uint16_t kID_ContinueTable7Size = 12;
-static const int32_t kID_ContinueTable7[12] = {
-    6942, 1073749504, 7695, 1073749536,
-    7725, 1073749555, 7732, 1073749581,  // NOLINT
-    7759, 1073749776, 7961, 7999};       // NOLINT
-bool ID_Continue::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0:
-      return LookupPredicate(kID_ContinueTable0, kID_ContinueTable0Size, c);
-    case 1:
-      return LookupPredicate(kID_ContinueTable1, kID_ContinueTable1Size, c);
-    case 5:
-      return LookupPredicate(kID_ContinueTable5, kID_ContinueTable5Size, c);
-    case 7:
-      return LookupPredicate(kID_ContinueTable7, kID_ContinueTable7Size, c);
-    default: return false;
-  }
-}
-
-
-// WhiteSpace:           (point.category == 'Zs') or ('JS_White_Space' in
-// point.properties)
-
-static const uint16_t kWhiteSpaceTable0Size = 7;
-static const int32_t kWhiteSpaceTable0[7] = {9,   1073741835, 12,  32,
-                                             160, 5760,       6158};  // NOLINT
-static const uint16_t kWhiteSpaceTable1Size = 5;
-static const int32_t kWhiteSpaceTable1[5] = {
-  1073741824, 10, 47, 95, 4096 };  // NOLINT
-static const uint16_t kWhiteSpaceTable7Size = 1;
-static const int32_t kWhiteSpaceTable7[1] = {7935};  // NOLINT
-bool WhiteSpace::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupPredicate(kWhiteSpaceTable0,
-                                       kWhiteSpaceTable0Size,
-                                       c);
-    case 1: return LookupPredicate(kWhiteSpaceTable1,
-                                       kWhiteSpaceTable1Size,
-                                       c);
-    case 7:
-      return LookupPredicate(kWhiteSpaceTable7, kWhiteSpaceTable7Size, c);
-    default: return false;
-  }
-}
-
-
-// LineTerminator:       'JS_Line_Terminator' in point.properties
-
-static const uint16_t kLineTerminatorTable0Size = 2;
-static const int32_t kLineTerminatorTable0[2] = {
-  10, 13 };  // NOLINT
-static const uint16_t kLineTerminatorTable1Size = 2;
-static const int32_t kLineTerminatorTable1[2] = {
-  1073741864, 41 };  // NOLINT
-bool LineTerminator::Is(uchar c) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupPredicate(kLineTerminatorTable0,
-                                       kLineTerminatorTable0Size,
-                                       c);
-    case 1: return LookupPredicate(kLineTerminatorTable1,
-                                       kLineTerminatorTable1Size,
-                                       c);
-    default: return false;
-  }
-}
-
-static const MultiCharacterSpecialCase<2> kToLowercaseMultiStrings0[2] = {  // NOLINT
-  {{105, 775}}, {{kSentinel}} }; // NOLINT
-static const uint16_t kToLowercaseTable0Size = 488;  // NOLINT
-static const int32_t kToLowercaseTable0[976] = {
-    1073741889, 128,    90,         128,   1073742016, 128,
-    214,        128,    1073742040, 128,   222,        128,
-    256,        4,      258,        4,  // NOLINT
-    260,        4,      262,        4,     264,        4,
-    266,        4,      268,        4,     270,        4,
-    272,        4,      274,        4,  // NOLINT
-    276,        4,      278,        4,     280,        4,
-    282,        4,      284,        4,     286,        4,
-    288,        4,      290,        4,  // NOLINT
-    292,        4,      294,        4,     296,        4,
-    298,        4,      300,        4,     302,        4,
-    304,        1,      306,        4,  // NOLINT
-    308,        4,      310,        4,     313,        4,
-    315,        4,      317,        4,     319,        4,
-    321,        4,      323,        4,  // NOLINT
-    325,        4,      327,        4,     330,        4,
-    332,        4,      334,        4,     336,        4,
-    338,        4,      340,        4,  // NOLINT
-    342,        4,      344,        4,     346,        4,
-    348,        4,      350,        4,     352,        4,
-    354,        4,      356,        4,  // NOLINT
-    358,        4,      360,        4,     362,        4,
-    364,        4,      366,        4,     368,        4,
-    370,        4,      372,        4,  // NOLINT
-    374,        4,      376,        -484,  377,        4,
-    379,        4,      381,        4,     385,        840,
-    386,        4,      388,        4,  // NOLINT
-    390,        824,    391,        4,     1073742217, 820,
-    394,        820,    395,        4,     398,        316,
-    399,        808,    400,        812,  // NOLINT
-    401,        4,      403,        820,   404,        828,
-    406,        844,    407,        836,   408,        4,
-    412,        844,    413,        852,  // NOLINT
-    415,        856,    416,        4,     418,        4,
-    420,        4,      422,        872,   423,        4,
-    425,        872,    428,        4,  // NOLINT
-    430,        872,    431,        4,     1073742257, 868,
-    434,        868,    435,        4,     437,        4,
-    439,        876,    440,        4,  // NOLINT
-    444,        4,      452,        8,     453,        4,
-    455,        8,      456,        4,     458,        8,
-    459,        4,      461,        4,  // NOLINT
-    463,        4,      465,        4,     467,        4,
-    469,        4,      471,        4,     473,        4,
-    475,        4,      478,        4,  // NOLINT
-    480,        4,      482,        4,     484,        4,
-    486,        4,      488,        4,     490,        4,
-    492,        4,      494,        4,  // NOLINT
-    497,        8,      498,        4,     500,        4,
-    502,        -388,   503,        -224,  504,        4,
-    506,        4,      508,        4,  // NOLINT
-    510,        4,      512,        4,     514,        4,
-    516,        4,      518,        4,     520,        4,
-    522,        4,      524,        4,  // NOLINT
-    526,        4,      528,        4,     530,        4,
-    532,        4,      534,        4,     536,        4,
-    538,        4,      540,        4,  // NOLINT
-    542,        4,      544,        -520,  546,        4,
-    548,        4,      550,        4,     552,        4,
-    554,        4,      556,        4,  // NOLINT
-    558,        4,      560,        4,     562,        4,
-    570,        43180,  571,        4,     573,        -652,
-    574,        43168,  577,        4,  // NOLINT
-    579,        -780,   580,        276,   581,        284,
-    582,        4,      584,        4,     586,        4,
-    588,        4,      590,        4,  // NOLINT
-    880,        4,      882,        4,     886,        4,
-    895,        464,    902,        152,   1073742728, 148,
-    906,        148,    908,        256,  // NOLINT
-    1073742734, 252,    911,        252,   1073742737, 128,
-    929,        128,    931,        6,     1073742756, 128,
-    939,        128,    975,        32,  // NOLINT
-    984,        4,      986,        4,     988,        4,
-    990,        4,      992,        4,     994,        4,
-    996,        4,      998,        4,  // NOLINT
-    1000,       4,      1002,       4,     1004,       4,
-    1006,       4,      1012,       -240,  1015,       4,
-    1017,       -28,    1018,       4,  // NOLINT
-    1073742845, -520,   1023,       -520,  1073742848, 320,
-    1039,       320,    1073742864, 128,   1071,       128,
-    1120,       4,      1122,       4,  // NOLINT
-    1124,       4,      1126,       4,     1128,       4,
-    1130,       4,      1132,       4,     1134,       4,
-    1136,       4,      1138,       4,  // NOLINT
-    1140,       4,      1142,       4,     1144,       4,
-    1146,       4,      1148,       4,     1150,       4,
-    1152,       4,      1162,       4,  // NOLINT
-    1164,       4,      1166,       4,     1168,       4,
-    1170,       4,      1172,       4,     1174,       4,
-    1176,       4,      1178,       4,  // NOLINT
-    1180,       4,      1182,       4,     1184,       4,
-    1186,       4,      1188,       4,     1190,       4,
-    1192,       4,      1194,       4,  // NOLINT
-    1196,       4,      1198,       4,     1200,       4,
-    1202,       4,      1204,       4,     1206,       4,
-    1208,       4,      1210,       4,  // NOLINT
-    1212,       4,      1214,       4,     1216,       60,
-    1217,       4,      1219,       4,     1221,       4,
-    1223,       4,      1225,       4,  // NOLINT
-    1227,       4,      1229,       4,     1232,       4,
-    1234,       4,      1236,       4,     1238,       4,
-    1240,       4,      1242,       4,  // NOLINT
-    1244,       4,      1246,       4,     1248,       4,
-    1250,       4,      1252,       4,     1254,       4,
-    1256,       4,      1258,       4,  // NOLINT
-    1260,       4,      1262,       4,     1264,       4,
-    1266,       4,      1268,       4,     1270,       4,
-    1272,       4,      1274,       4,  // NOLINT
-    1276,       4,      1278,       4,     1280,       4,
-    1282,       4,      1284,       4,     1286,       4,
-    1288,       4,      1290,       4,  // NOLINT
-    1292,       4,      1294,       4,     1296,       4,
-    1298,       4,      1300,       4,     1302,       4,
-    1304,       4,      1306,       4,  // NOLINT
-    1308,       4,      1310,       4,     1312,       4,
-    1314,       4,      1316,       4,     1318,       4,
-    1320,       4,      1322,       4,  // NOLINT
-    1324,       4,      1326,       4,     1073743153, 192,
-    1366,       192,    1073746080, 29056, 4293,       29056,
-    4295,       29056,  4301,       29056,  // NOLINT
-    7680,       4,      7682,       4,     7684,       4,
-    7686,       4,      7688,       4,     7690,       4,
-    7692,       4,      7694,       4,  // NOLINT
-    7696,       4,      7698,       4,     7700,       4,
-    7702,       4,      7704,       4,     7706,       4,
-    7708,       4,      7710,       4,  // NOLINT
-    7712,       4,      7714,       4,     7716,       4,
-    7718,       4,      7720,       4,     7722,       4,
-    7724,       4,      7726,       4,  // NOLINT
-    7728,       4,      7730,       4,     7732,       4,
-    7734,       4,      7736,       4,     7738,       4,
-    7740,       4,      7742,       4,  // NOLINT
-    7744,       4,      7746,       4,     7748,       4,
-    7750,       4,      7752,       4,     7754,       4,
-    7756,       4,      7758,       4,  // NOLINT
-    7760,       4,      7762,       4,     7764,       4,
-    7766,       4,      7768,       4,     7770,       4,
-    7772,       4,      7774,       4,  // NOLINT
-    7776,       4,      7778,       4,     7780,       4,
-    7782,       4,      7784,       4,     7786,       4,
-    7788,       4,      7790,       4,  // NOLINT
-    7792,       4,      7794,       4,     7796,       4,
-    7798,       4,      7800,       4,     7802,       4,
-    7804,       4,      7806,       4,  // NOLINT
-    7808,       4,      7810,       4,     7812,       4,
-    7814,       4,      7816,       4,     7818,       4,
-    7820,       4,      7822,       4,  // NOLINT
-    7824,       4,      7826,       4,     7828,       4,
-    7838,       -30460, 7840,       4,     7842,       4,
-    7844,       4,      7846,       4,  // NOLINT
-    7848,       4,      7850,       4,     7852,       4,
-    7854,       4,      7856,       4,     7858,       4,
-    7860,       4,      7862,       4,  // NOLINT
-    7864,       4,      7866,       4,     7868,       4,
-    7870,       4,      7872,       4,     7874,       4,
-    7876,       4,      7878,       4,  // NOLINT
-    7880,       4,      7882,       4,     7884,       4,
-    7886,       4,      7888,       4,     7890,       4,
-    7892,       4,      7894,       4,  // NOLINT
-    7896,       4,      7898,       4,     7900,       4,
-    7902,       4,      7904,       4,     7906,       4,
-    7908,       4,      7910,       4,  // NOLINT
-    7912,       4,      7914,       4,     7916,       4,
-    7918,       4,      7920,       4,     7922,       4,
-    7924,       4,      7926,       4,  // NOLINT
-    7928,       4,      7930,       4,     7932,       4,
-    7934,       4,      1073749768, -32,   7951,       -32,
-    1073749784, -32,    7965,       -32,  // NOLINT
-    1073749800, -32,    7983,       -32,   1073749816, -32,
-    7999,       -32,    1073749832, -32,   8013,       -32,
-    8025,       -32,    8027,       -32,  // NOLINT
-    8029,       -32,    8031,       -32,   1073749864, -32,
-    8047,       -32,    1073749896, -32,   8079,       -32,
-    1073749912, -32,    8095,       -32,  // NOLINT
-    1073749928, -32,    8111,       -32,   1073749944, -32,
-    8121,       -32,    1073749946, -296,  8123,       -296,
-    8124,       -36,    1073749960, -344,  // NOLINT
-    8139,       -344,   8140,       -36,   1073749976, -32,
-    8153,       -32,    1073749978, -400,  8155,       -400,
-    1073749992, -32,    8169,       -32,  // NOLINT
-    1073749994, -448,   8171,       -448,  8172,       -28,
-    1073750008, -512,   8185,       -512,  1073750010, -504,
-    8187,       -504,   8188,       -36};                 // NOLINT
-static const uint16_t kToLowercaseMultiStrings0Size = 2;  // NOLINT
-static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings1[1] = {  // NOLINT
-  {{kSentinel}} }; // NOLINT
-static const uint16_t kToLowercaseTable1Size = 79;  // NOLINT
-static const int32_t kToLowercaseTable1[158] = {
-  294, -30068, 298, -33532, 299, -33048, 306, 112, 1073742176, 64, 367, 64, 387, 4, 1073743030, 104,  // NOLINT
-  1231, 104, 1073744896, 192, 3118, 192, 3168, 4, 3170, -42972, 3171, -15256, 3172, -42908, 3175, 4,  // NOLINT
-  3177, 4, 3179, 4, 3181, -43120, 3182, -42996, 3183, -43132, 3184, -43128, 3186, 4, 3189, 4,  // NOLINT
-  1073745022, -43260, 3199, -43260, 3200, 4, 3202, 4, 3204, 4, 3206, 4, 3208, 4, 3210, 4,  // NOLINT
-  3212, 4, 3214, 4, 3216, 4, 3218, 4, 3220, 4, 3222, 4, 3224, 4, 3226, 4,  // NOLINT
-  3228, 4, 3230, 4, 3232, 4, 3234, 4, 3236, 4, 3238, 4, 3240, 4, 3242, 4,  // NOLINT
-  3244, 4, 3246, 4, 3248, 4, 3250, 4, 3252, 4, 3254, 4, 3256, 4, 3258, 4,  // NOLINT
-  3260, 4, 3262, 4, 3264, 4, 3266, 4, 3268, 4, 3270, 4, 3272, 4, 3274, 4,  // NOLINT
-  3276, 4, 3278, 4, 3280, 4, 3282, 4, 3284, 4, 3286, 4, 3288, 4, 3290, 4,  // NOLINT
-  3292, 4, 3294, 4, 3296, 4, 3298, 4, 3307, 4, 3309, 4, 3314, 4 };  // NOLINT
-static const uint16_t kToLowercaseMultiStrings1Size = 1;  // NOLINT
-static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings5[1] = {  // NOLINT
-  {{kSentinel}} }; // NOLINT
-static const uint16_t kToLowercaseTable5Size = 103;  // NOLINT
-static const int32_t kToLowercaseTable5[206] = {
-    1600, 4,       1602, 4,       1604, 4,       1606, 4,
-    1608, 4,       1610, 4,       1612, 4,       1614, 4,  // NOLINT
-    1616, 4,       1618, 4,       1620, 4,       1622, 4,
-    1624, 4,       1626, 4,       1628, 4,       1630, 4,  // NOLINT
-    1632, 4,       1634, 4,       1636, 4,       1638, 4,
-    1640, 4,       1642, 4,       1644, 4,       1664, 4,  // NOLINT
-    1666, 4,       1668, 4,       1670, 4,       1672, 4,
-    1674, 4,       1676, 4,       1678, 4,       1680, 4,  // NOLINT
-    1682, 4,       1684, 4,       1686, 4,       1688, 4,
-    1690, 4,       1826, 4,       1828, 4,       1830, 4,  // NOLINT
-    1832, 4,       1834, 4,       1836, 4,       1838, 4,
-    1842, 4,       1844, 4,       1846, 4,       1848, 4,  // NOLINT
-    1850, 4,       1852, 4,       1854, 4,       1856, 4,
-    1858, 4,       1860, 4,       1862, 4,       1864, 4,  // NOLINT
-    1866, 4,       1868, 4,       1870, 4,       1872, 4,
-    1874, 4,       1876, 4,       1878, 4,       1880, 4,  // NOLINT
-    1882, 4,       1884, 4,       1886, 4,       1888, 4,
-    1890, 4,       1892, 4,       1894, 4,       1896, 4,  // NOLINT
-    1898, 4,       1900, 4,       1902, 4,       1913, 4,
-    1915, 4,       1917, -141328, 1918, 4,       1920, 4,  // NOLINT
-    1922, 4,       1924, 4,       1926, 4,       1931, 4,
-    1933, -169120, 1936, 4,       1938, 4,       1942, 4,  // NOLINT
-    1944, 4,       1946, 4,       1948, 4,       1950, 4,
-    1952, 4,       1954, 4,       1956, 4,       1958, 4,  // NOLINT
-    1960, 4,       1962, -169232, 1963, -169276, 1964, -169260,
-    1965, -169220, 1968, -169032, 1969, -169128};         // NOLINT
-static const uint16_t kToLowercaseMultiStrings5Size = 1;  // NOLINT
-static const MultiCharacterSpecialCase<1> kToLowercaseMultiStrings7[1] = {  // NOLINT
-  {{kSentinel}} }; // NOLINT
-static const uint16_t kToLowercaseTable7Size = 2;  // NOLINT
-static const int32_t kToLowercaseTable7[4] = {
-  1073749793, 128, 7994, 128 };  // NOLINT
-static const uint16_t kToLowercaseMultiStrings7Size = 1;  // NOLINT
-int ToLowercase::Convert(uchar c,
-                      uchar n,
-                      uchar* result,
-                      bool* allow_caching_ptr) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupMapping<true>(kToLowercaseTable0,
-                                           kToLowercaseTable0Size,
-                                           kToLowercaseMultiStrings0,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 1: return LookupMapping<true>(kToLowercaseTable1,
-                                           kToLowercaseTable1Size,
-                                           kToLowercaseMultiStrings1,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 5: return LookupMapping<true>(kToLowercaseTable5,
-                                           kToLowercaseTable5Size,
-                                           kToLowercaseMultiStrings5,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 7: return LookupMapping<true>(kToLowercaseTable7,
-                                           kToLowercaseTable7Size,
-                                           kToLowercaseMultiStrings7,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    default: return 0;
-  }
-}
-
-static const MultiCharacterSpecialCase<3> kToUppercaseMultiStrings0[62] = {  // NOLINT
-  {{83, 83, kSentinel}}, {{700, 78, kSentinel}}, {{74, 780, kSentinel}}, {{921, 776, 769}},  // NOLINT
-  {{933, 776, 769}}, {{1333, 1362, kSentinel}}, {{72, 817, kSentinel}}, {{84, 776, kSentinel}},  // NOLINT
-  {{87, 778, kSentinel}}, {{89, 778, kSentinel}}, {{65, 702, kSentinel}}, {{933, 787, kSentinel}},  // NOLINT
-  {{933, 787, 768}}, {{933, 787, 769}}, {{933, 787, 834}}, {{7944, 921, kSentinel}},  // NOLINT
-  {{7945, 921, kSentinel}}, {{7946, 921, kSentinel}}, {{7947, 921, kSentinel}}, {{7948, 921, kSentinel}},  // NOLINT
-  {{7949, 921, kSentinel}}, {{7950, 921, kSentinel}}, {{7951, 921, kSentinel}}, {{7976, 921, kSentinel}},  // NOLINT
-  {{7977, 921, kSentinel}}, {{7978, 921, kSentinel}}, {{7979, 921, kSentinel}}, {{7980, 921, kSentinel}},  // NOLINT
-  {{7981, 921, kSentinel}}, {{7982, 921, kSentinel}}, {{7983, 921, kSentinel}}, {{8040, 921, kSentinel}},  // NOLINT
-  {{8041, 921, kSentinel}}, {{8042, 921, kSentinel}}, {{8043, 921, kSentinel}}, {{8044, 921, kSentinel}},  // NOLINT
-  {{8045, 921, kSentinel}}, {{8046, 921, kSentinel}}, {{8047, 921, kSentinel}}, {{8122, 921, kSentinel}},  // NOLINT
-  {{913, 921, kSentinel}}, {{902, 921, kSentinel}}, {{913, 834, kSentinel}}, {{913, 834, 921}},  // NOLINT
-  {{8138, 921, kSentinel}}, {{919, 921, kSentinel}}, {{905, 921, kSentinel}}, {{919, 834, kSentinel}},  // NOLINT
-  {{919, 834, 921}}, {{921, 776, 768}}, {{921, 834, kSentinel}}, {{921, 776, 834}},  // NOLINT
-  {{933, 776, 768}}, {{929, 787, kSentinel}}, {{933, 834, kSentinel}}, {{933, 776, 834}},  // NOLINT
-  {{8186, 921, kSentinel}}, {{937, 921, kSentinel}}, {{911, 921, kSentinel}}, {{937, 834, kSentinel}},  // NOLINT
-  {{937, 834, 921}}, {{kSentinel}} }; // NOLINT
-static const uint16_t kToUppercaseTable0Size = 590;  // NOLINT
-static const int32_t kToUppercaseTable0[1180] = {
-    1073741921, -128,   122,        -128,   181,        2972,
-    223,        1,      1073742048, -128,   246,        -128,
-    1073742072, -128,   254,        -128,  // NOLINT
-    255,        484,    257,        -4,     259,        -4,
-    261,        -4,     263,        -4,     265,        -4,
-    267,        -4,     269,        -4,  // NOLINT
-    271,        -4,     273,        -4,     275,        -4,
-    277,        -4,     279,        -4,     281,        -4,
-    283,        -4,     285,        -4,  // NOLINT
-    287,        -4,     289,        -4,     291,        -4,
-    293,        -4,     295,        -4,     297,        -4,
-    299,        -4,     301,        -4,  // NOLINT
-    303,        -4,     305,        -928,   307,        -4,
-    309,        -4,     311,        -4,     314,        -4,
-    316,        -4,     318,        -4,  // NOLINT
-    320,        -4,     322,        -4,     324,        -4,
-    326,        -4,     328,        -4,     329,        5,
-    331,        -4,     333,        -4,  // NOLINT
-    335,        -4,     337,        -4,     339,        -4,
-    341,        -4,     343,        -4,     345,        -4,
-    347,        -4,     349,        -4,  // NOLINT
-    351,        -4,     353,        -4,     355,        -4,
-    357,        -4,     359,        -4,     361,        -4,
-    363,        -4,     365,        -4,  // NOLINT
-    367,        -4,     369,        -4,     371,        -4,
-    373,        -4,     375,        -4,     378,        -4,
-    380,        -4,     382,        -4,  // NOLINT
-    383,        -1200,  384,        780,    387,        -4,
-    389,        -4,     392,        -4,     396,        -4,
-    402,        -4,     405,        388,  // NOLINT
-    409,        -4,     410,        652,    414,        520,
-    417,        -4,     419,        -4,     421,        -4,
-    424,        -4,     429,        -4,  // NOLINT
-    432,        -4,     436,        -4,     438,        -4,
-    441,        -4,     445,        -4,     447,        224,
-    453,        -4,     454,        -8,  // NOLINT
-    456,        -4,     457,        -8,     459,        -4,
-    460,        -8,     462,        -4,     464,        -4,
-    466,        -4,     468,        -4,  // NOLINT
-    470,        -4,     472,        -4,     474,        -4,
-    476,        -4,     477,        -316,   479,        -4,
-    481,        -4,     483,        -4,  // NOLINT
-    485,        -4,     487,        -4,     489,        -4,
-    491,        -4,     493,        -4,     495,        -4,
-    496,        9,      498,        -4,  // NOLINT
-    499,        -8,     501,        -4,     505,        -4,
-    507,        -4,     509,        -4,     511,        -4,
-    513,        -4,     515,        -4,  // NOLINT
-    517,        -4,     519,        -4,     521,        -4,
-    523,        -4,     525,        -4,     527,        -4,
-    529,        -4,     531,        -4,  // NOLINT
-    533,        -4,     535,        -4,     537,        -4,
-    539,        -4,     541,        -4,     543,        -4,
-    547,        -4,     549,        -4,  // NOLINT
-    551,        -4,     553,        -4,     555,        -4,
-    557,        -4,     559,        -4,     561,        -4,
-    563,        -4,     572,        -4,  // NOLINT
-    1073742399, 43260,  576,        43260,  578,        -4,
-    583,        -4,     585,        -4,     587,        -4,
-    589,        -4,     591,        -4,  // NOLINT
-    592,        43132,  593,        43120,  594,        43128,
-    595,        -840,   596,        -824,   1073742422, -820,
-    599,        -820,   601,        -808,  // NOLINT
-    603,        -812,   604,        169276, 608,        -820,
-    609,        169260, 611,        -828,   613,        169120,
-    614,        169232, 616,        -836,  // NOLINT
-    617,        -844,   619,        42972,  620,        169220,
-    623,        -844,   625,        42996,  626,        -852,
-    629,        -856,   637,        42908,  // NOLINT
-    640,        -872,   643,        -872,   647,        169128,
-    648,        -872,   649,        -276,   1073742474, -868,
-    651,        -868,   652,        -284,  // NOLINT
-    658,        -876,   670,        169032, 837,        336,
-    881,        -4,     883,        -4,     887,        -4,
-    1073742715, 520,    893,        520,  // NOLINT
-    912,        13,     940,        -152,   1073742765, -148,
-    943,        -148,   944,        17,     1073742769, -128,
-    961,        -128,   962,        -124,  // NOLINT
-    1073742787, -128,   971,        -128,   972,        -256,
-    1073742797, -252,   974,        -252,   976,        -248,
-    977,        -228,   981,        -188,  // NOLINT
-    982,        -216,   983,        -32,    985,        -4,
-    987,        -4,     989,        -4,     991,        -4,
-    993,        -4,     995,        -4,  // NOLINT
-    997,        -4,     999,        -4,     1001,       -4,
-    1003,       -4,     1005,       -4,     1007,       -4,
-    1008,       -344,   1009,       -320,  // NOLINT
-    1010,       28,     1011,       -464,   1013,       -384,
-    1016,       -4,     1019,       -4,     1073742896, -128,
-    1103,       -128,   1073742928, -320,  // NOLINT
-    1119,       -320,   1121,       -4,     1123,       -4,
-    1125,       -4,     1127,       -4,     1129,       -4,
-    1131,       -4,     1133,       -4,  // NOLINT
-    1135,       -4,     1137,       -4,     1139,       -4,
-    1141,       -4,     1143,       -4,     1145,       -4,
-    1147,       -4,     1149,       -4,  // NOLINT
-    1151,       -4,     1153,       -4,     1163,       -4,
-    1165,       -4,     1167,       -4,     1169,       -4,
-    1171,       -4,     1173,       -4,  // NOLINT
-    1175,       -4,     1177,       -4,     1179,       -4,
-    1181,       -4,     1183,       -4,     1185,       -4,
-    1187,       -4,     1189,       -4,  // NOLINT
-    1191,       -4,     1193,       -4,     1195,       -4,
-    1197,       -4,     1199,       -4,     1201,       -4,
-    1203,       -4,     1205,       -4,  // NOLINT
-    1207,       -4,     1209,       -4,     1211,       -4,
-    1213,       -4,     1215,       -4,     1218,       -4,
-    1220,       -4,     1222,       -4,  // NOLINT
-    1224,       -4,     1226,       -4,     1228,       -4,
-    1230,       -4,     1231,       -60,    1233,       -4,
-    1235,       -4,     1237,       -4,  // NOLINT
-    1239,       -4,     1241,       -4,     1243,       -4,
-    1245,       -4,     1247,       -4,     1249,       -4,
-    1251,       -4,     1253,       -4,  // NOLINT
-    1255,       -4,     1257,       -4,     1259,       -4,
-    1261,       -4,     1263,       -4,     1265,       -4,
-    1267,       -4,     1269,       -4,  // NOLINT
-    1271,       -4,     1273,       -4,     1275,       -4,
-    1277,       -4,     1279,       -4,     1281,       -4,
-    1283,       -4,     1285,       -4,  // NOLINT
-    1287,       -4,     1289,       -4,     1291,       -4,
-    1293,       -4,     1295,       -4,     1297,       -4,
-    1299,       -4,     1301,       -4,  // NOLINT
-    1303,       -4,     1305,       -4,     1307,       -4,
-    1309,       -4,     1311,       -4,     1313,       -4,
-    1315,       -4,     1317,       -4,  // NOLINT
-    1319,       -4,     1321,       -4,     1323,       -4,
-    1325,       -4,     1327,       -4,     1073743201, -192,
-    1414,       -192,   1415,       21,  // NOLINT
-    7545,       141328, 7549,       15256,  7681,       -4,
-    7683,       -4,     7685,       -4,     7687,       -4,
-    7689,       -4,     7691,       -4,  // NOLINT
-    7693,       -4,     7695,       -4,     7697,       -4,
-    7699,       -4,     7701,       -4,     7703,       -4,
-    7705,       -4,     7707,       -4,  // NOLINT
-    7709,       -4,     7711,       -4,     7713,       -4,
-    7715,       -4,     7717,       -4,     7719,       -4,
-    7721,       -4,     7723,       -4,  // NOLINT
-    7725,       -4,     7727,       -4,     7729,       -4,
-    7731,       -4,     7733,       -4,     7735,       -4,
-    7737,       -4,     7739,       -4,  // NOLINT
-    7741,       -4,     7743,       -4,     7745,       -4,
-    7747,       -4,     7749,       -4,     7751,       -4,
-    7753,       -4,     7755,       -4,  // NOLINT
-    7757,       -4,     7759,       -4,     7761,       -4,
-    7763,       -4,     7765,       -4,     7767,       -4,
-    7769,       -4,     7771,       -4,  // NOLINT
-    7773,       -4,     7775,       -4,     7777,       -4,
-    7779,       -4,     7781,       -4,     7783,       -4,
-    7785,       -4,     7787,       -4,  // NOLINT
-    7789,       -4,     7791,       -4,     7793,       -4,
-    7795,       -4,     7797,       -4,     7799,       -4,
-    7801,       -4,     7803,       -4,  // NOLINT
-    7805,       -4,     7807,       -4,     7809,       -4,
-    7811,       -4,     7813,       -4,     7815,       -4,
-    7817,       -4,     7819,       -4,  // NOLINT
-    7821,       -4,     7823,       -4,     7825,       -4,
-    7827,       -4,     7829,       -4,     7830,       25,
-    7831,       29,     7832,       33,  // NOLINT
-    7833,       37,     7834,       41,     7835,       -236,
-    7841,       -4,     7843,       -4,     7845,       -4,
-    7847,       -4,     7849,       -4,  // NOLINT
-    7851,       -4,     7853,       -4,     7855,       -4,
-    7857,       -4,     7859,       -4,     7861,       -4,
-    7863,       -4,     7865,       -4,  // NOLINT
-    7867,       -4,     7869,       -4,     7871,       -4,
-    7873,       -4,     7875,       -4,     7877,       -4,
-    7879,       -4,     7881,       -4,  // NOLINT
-    7883,       -4,     7885,       -4,     7887,       -4,
-    7889,       -4,     7891,       -4,     7893,       -4,
-    7895,       -4,     7897,       -4,  // NOLINT
-    7899,       -4,     7901,       -4,     7903,       -4,
-    7905,       -4,     7907,       -4,     7909,       -4,
-    7911,       -4,     7913,       -4,  // NOLINT
-    7915,       -4,     7917,       -4,     7919,       -4,
-    7921,       -4,     7923,       -4,     7925,       -4,
-    7927,       -4,     7929,       -4,  // NOLINT
-    7931,       -4,     7933,       -4,     7935,       -4,
-    1073749760, 32,     7943,       32,     1073749776, 32,
-    7957,       32,     1073749792, 32,  // NOLINT
-    7975,       32,     1073749808, 32,     7991,       32,
-    1073749824, 32,     8005,       32,     8016,       45,
-    8017,       32,     8018,       49,  // NOLINT
-    8019,       32,     8020,       53,     8021,       32,
-    8022,       57,     8023,       32,     1073749856, 32,
-    8039,       32,     1073749872, 296,  // NOLINT
-    8049,       296,    1073749874, 344,    8053,       344,
-    1073749878, 400,    8055,       400,    1073749880, 512,
-    8057,       512,    1073749882, 448,  // NOLINT
-    8059,       448,    1073749884, 504,    8061,       504,
-    8064,       61,     8065,       65,     8066,       69,
-    8067,       73,     8068,       77,  // NOLINT
-    8069,       81,     8070,       85,     8071,       89,
-    8072,       61,     8073,       65,     8074,       69,
-    8075,       73,     8076,       77,  // NOLINT
-    8077,       81,     8078,       85,     8079,       89,
-    8080,       93,     8081,       97,     8082,       101,
-    8083,       105,    8084,       109,  // NOLINT
-    8085,       113,    8086,       117,    8087,       121,
-    8088,       93,     8089,       97,     8090,       101,
-    8091,       105,    8092,       109,  // NOLINT
-    8093,       113,    8094,       117,    8095,       121,
-    8096,       125,    8097,       129,    8098,       133,
-    8099,       137,    8100,       141,  // NOLINT
-    8101,       145,    8102,       149,    8103,       153,
-    8104,       125,    8105,       129,    8106,       133,
-    8107,       137,    8108,       141,  // NOLINT
-    8109,       145,    8110,       149,    8111,       153,
-    1073749936, 32,     8113,       32,     8114,       157,
-    8115,       161,    8116,       165,  // NOLINT
-    8118,       169,    8119,       173,    8124,       161,
-    8126,       -28820, 8130,       177,    8131,       181,
-    8132,       185,    8134,       189,  // NOLINT
-    8135,       193,    8140,       181,    1073749968, 32,
-    8145,       32,     8146,       197,    8147,       13,
-    8150,       201,    8151,       205,  // NOLINT
-    1073749984, 32,     8161,       32,     8162,       209,
-    8163,       17,     8164,       213,    8165,       28,
-    8166,       217,    8167,       221,  // NOLINT
-    8178,       225,    8179,       229,    8180,       233,
-    8182,       237,    8183,       241,    8188,       229};  // NOLINT
-static const uint16_t kToUppercaseMultiStrings0Size = 62;  // NOLINT
-static const MultiCharacterSpecialCase<1> kToUppercaseMultiStrings1[1] = {  // NOLINT
-  {{kSentinel}} }; // NOLINT
-static const uint16_t kToUppercaseTable1Size = 73;  // NOLINT
-static const int32_t kToUppercaseTable1[146] = {
-  334, -112, 1073742192, -64, 383, -64, 388, -4, 1073743056, -104, 1257, -104, 1073744944, -192, 3166, -192,  // NOLINT
-  3169, -4, 3173, -43180, 3174, -43168, 3176, -4, 3178, -4, 3180, -4, 3187, -4, 3190, -4,  // NOLINT
-  3201, -4, 3203, -4, 3205, -4, 3207, -4, 3209, -4, 3211, -4, 3213, -4, 3215, -4,  // NOLINT
-  3217, -4, 3219, -4, 3221, -4, 3223, -4, 3225, -4, 3227, -4, 3229, -4, 3231, -4,  // NOLINT
-  3233, -4, 3235, -4, 3237, -4, 3239, -4, 3241, -4, 3243, -4, 3245, -4, 3247, -4,  // NOLINT
-  3249, -4, 3251, -4, 3253, -4, 3255, -4, 3257, -4, 3259, -4, 3261, -4, 3263, -4,  // NOLINT
-  3265, -4, 3267, -4, 3269, -4, 3271, -4, 3273, -4, 3275, -4, 3277, -4, 3279, -4,  // NOLINT
-  3281, -4, 3283, -4, 3285, -4, 3287, -4, 3289, -4, 3291, -4, 3293, -4, 3295, -4,  // NOLINT
-  3297, -4, 3299, -4, 3308, -4, 3310, -4, 3315, -4, 1073745152, -29056, 3365, -29056, 3367, -29056,  // NOLINT
-  3373, -29056 };  // NOLINT
-static const uint16_t kToUppercaseMultiStrings1Size = 1;  // NOLINT
-static const MultiCharacterSpecialCase<1> kToUppercaseMultiStrings5[1] = {  // NOLINT
-  {{kSentinel}} }; // NOLINT
-static const uint16_t kToUppercaseTable5Size = 95;  // NOLINT
-static const int32_t
-    kToUppercaseTable5[190] = {1601, -4, 1603, -4, 1605, -4, 1607, -4, 1609, -4,
-                               1611, -4, 1613, -4, 1615, -4,  // NOLINT
-                               1617, -4, 1619, -4, 1621, -4, 1623, -4, 1625, -4,
-                               1627, -4, 1629, -4, 1631, -4,  // NOLINT
-                               1633, -4, 1635, -4, 1637, -4, 1639, -4, 1641, -4,
-                               1643, -4, 1645, -4, 1665, -4,  // NOLINT
-                               1667, -4, 1669, -4, 1671, -4, 1673, -4, 1675, -4,
-                               1677, -4, 1679, -4, 1681, -4,  // NOLINT
-                               1683, -4, 1685, -4, 1687, -4, 1689, -4, 1691, -4,
-                               1827, -4, 1829, -4, 1831, -4,  // NOLINT
-                               1833, -4, 1835, -4, 1837, -4, 1839, -4, 1843, -4,
-                               1845, -4, 1847, -4, 1849, -4,  // NOLINT
-                               1851, -4, 1853, -4, 1855, -4, 1857, -4, 1859, -4,
-                               1861, -4, 1863, -4, 1865, -4,  // NOLINT
-                               1867, -4, 1869, -4, 1871, -4, 1873, -4, 1875, -4,
-                               1877, -4, 1879, -4, 1881, -4,  // NOLINT
-                               1883, -4, 1885, -4, 1887, -4, 1889, -4, 1891, -4,
-                               1893, -4, 1895, -4, 1897, -4,  // NOLINT
-                               1899, -4, 1901, -4, 1903, -4, 1914, -4, 1916, -4,
-                               1919, -4, 1921, -4, 1923, -4,  // NOLINT
-                               1925, -4, 1927, -4, 1932, -4, 1937, -4, 1939, -4,
-                               1943, -4, 1945, -4, 1947, -4,  // NOLINT
-                               1949, -4, 1951, -4, 1953, -4, 1955, -4, 1957, -4,
-                               1959, -4, 1961, -4};       // NOLINT
-static const uint16_t kToUppercaseMultiStrings5Size = 1;  // NOLINT
-static const MultiCharacterSpecialCase<3> kToUppercaseMultiStrings7[12] = {  // NOLINT
-  {{70, 70, kSentinel}}, {{70, 73, kSentinel}}, {{70, 76, kSentinel}}, {{70, 70, 73}},  // NOLINT
-  {{70, 70, 76}}, {{83, 84, kSentinel}}, {{1348, 1350, kSentinel}}, {{1348, 1333, kSentinel}},  // NOLINT
-  {{1348, 1339, kSentinel}}, {{1358, 1350, kSentinel}}, {{1348, 1341, kSentinel}}, {{kSentinel}} }; // NOLINT
-static const uint16_t kToUppercaseTable7Size = 14;  // NOLINT
-static const int32_t kToUppercaseTable7[28] = {
-  6912, 1, 6913, 5, 6914, 9, 6915, 13, 6916, 17, 6917, 21, 6918, 21, 6931, 25,  // NOLINT
-  6932, 29, 6933, 33, 6934, 37, 6935, 41, 1073749825, -128, 8026, -128 };  // NOLINT
-static const uint16_t kToUppercaseMultiStrings7Size = 12;  // NOLINT
-int ToUppercase::Convert(uchar c,
-                      uchar n,
-                      uchar* result,
-                      bool* allow_caching_ptr) {
-  int chunk_index = c >> 13;
-  switch (chunk_index) {
-    case 0: return LookupMapping<true>(kToUppercaseTable0,
-                                           kToUppercaseTable0Size,
-                                           kToUppercaseMultiStrings0,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 1: return LookupMapping<true>(kToUppercaseTable1,
-                                           kToUppercaseTable1Size,
-                                           kToUppercaseMultiStrings1,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 5: return LookupMapping<true>(kToUppercaseTable5,
-                                           kToUppercaseTable5Size,
-                                           kToUppercaseMultiStrings5,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    case 7: return LookupMapping<true>(kToUppercaseTable7,
-                                           kToUppercaseTable7Size,
-                                           kToUppercaseMultiStrings7,
-                                           c,
-                                           n,
-                                           result,
-                                           allow_caching_ptr);
-    default: return 0;
-  }
-}
-
 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings0[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kEcma262CanonicalizeTable0Size = 498;  // NOLINT
@@ -2011,7 +580,6 @@
     8113,       32,     8126,       -28820, 1073749968, 32,
     8145,       32,     1073749984, 32,                           // NOLINT
     8161,       32,     8165,       28};                          // NOLINT
-static const uint16_t kEcma262CanonicalizeMultiStrings0Size = 1;  // NOLINT
 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings1[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kEcma262CanonicalizeTable1Size = 73;  // NOLINT
@@ -2026,7 +594,6 @@
   3281, -4, 3283, -4, 3285, -4, 3287, -4, 3289, -4, 3291, -4, 3293, -4, 3295, -4,  // NOLINT
   3297, -4, 3299, -4, 3308, -4, 3310, -4, 3315, -4, 1073745152, -29056, 3365, -29056, 3367, -29056,  // NOLINT
   3373, -29056 };  // NOLINT
-static const uint16_t kEcma262CanonicalizeMultiStrings1Size = 1;  // NOLINT
 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings5[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kEcma262CanonicalizeTable5Size = 95;  // NOLINT
@@ -2055,18 +622,16 @@
              1939, -4, 1943, -4, 1945, -4, 1947, -4,  // NOLINT
              1949, -4, 1951, -4, 1953, -4, 1955, -4,
              1957, -4, 1959, -4, 1961, -4};                       // NOLINT
-static const uint16_t kEcma262CanonicalizeMultiStrings5Size = 1;  // NOLINT
 static const MultiCharacterSpecialCase<1> kEcma262CanonicalizeMultiStrings7[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kEcma262CanonicalizeTable7Size = 2;  // NOLINT
 static const int32_t kEcma262CanonicalizeTable7[4] = {
   1073749825, -128, 8026, -128 };  // NOLINT
-static const uint16_t kEcma262CanonicalizeMultiStrings7Size = 1;  // NOLINT
-int Ecma262Canonicalize::Convert(uchar c,
-                      uchar n,
-                      uchar* result,
+intptr_t Ecma262Canonicalize::Convert(int32_t c,
+                      int32_t n,
+                      int32_t* result,
                       bool* allow_caching_ptr) {
-  int chunk_index = c >> 13;
+  intptr_t chunk_index = c >> 13;
   switch (chunk_index) {
     case 0: return LookupMapping<true>(kEcma262CanonicalizeTable0,
                                            kEcma262CanonicalizeTable0Size,
@@ -2988,7 +1553,6 @@
     1073749994, 1981, 8171,       1985,  // NOLINT
     8172,       2021, 1073750008, 1973, 8185,       1977,
     1073750010, 1989, 8187,       1993};                              // NOLINT
-static const uint16_t kEcma262UnCanonicalizeMultiStrings0Size = 507;  // NOLINT
 static const MultiCharacterSpecialCase<2> kEcma262UnCanonicalizeMultiStrings1[83] = {  // NOLINT
   {{8498, 8526}}, {{8544, 8560}}, {{8559, 8575}}, {{8579, 8580}},  // NOLINT
   {{9398, 9424}}, {{9423, 9449}}, {{11264, 11312}}, {{11310, 11358}},  // NOLINT
@@ -3032,7 +1596,6 @@
   3289, 277, 3290, 281, 3291, 281, 3292, 285, 3293, 285, 3294, 289, 3295, 289, 3296, 293,  // NOLINT
   3297, 293, 3298, 297, 3299, 297, 3307, 301, 3308, 301, 3309, 305, 3310, 305, 3314, 309,  // NOLINT
   3315, 309, 1073745152, 313, 3365, 317, 3367, 321, 3373, 325 };  // NOLINT
-static const uint16_t kEcma262UnCanonicalizeMultiStrings1Size = 83;  // NOLINT
 static const MultiCharacterSpecialCase<2>
     kEcma262UnCanonicalizeMultiStrings5[104] = {  // NOLINT
         {{42560, 42561}},
@@ -3191,18 +1754,16 @@
              1958, 381, 1959, 381, 1960, 385, 1961, 385,  // NOLINT
              1962, 389, 1963, 393, 1964, 397, 1965, 401,
              1968, 405, 1969, 409};                                   // NOLINT
-static const uint16_t kEcma262UnCanonicalizeMultiStrings5Size = 104;  // NOLINT
 static const MultiCharacterSpecialCase<2> kEcma262UnCanonicalizeMultiStrings7[3] = {  // NOLINT
   {{65313, 65345}}, {{65338, 65370}}, {{kSentinel}} }; // NOLINT
 static const uint16_t kEcma262UnCanonicalizeTable7Size = 4;  // NOLINT
 static const int32_t kEcma262UnCanonicalizeTable7[8] = {
   1073749793, 1, 7994, 5, 1073749825, 1, 8026, 5 };  // NOLINT
-static const uint16_t kEcma262UnCanonicalizeMultiStrings7Size = 3;  // NOLINT
-int Ecma262UnCanonicalize::Convert(uchar c,
-                      uchar n,
-                      uchar* result,
+intptr_t Ecma262UnCanonicalize::Convert(int32_t c,
+                      int32_t n,
+                      int32_t* result,
                       bool* allow_caching_ptr) {
-  int chunk_index = c >> 13;
+  intptr_t chunk_index = c >> 13;
   switch (chunk_index) {
     case 0: return LookupMapping<true>(kEcma262UnCanonicalizeTable0,
                                            kEcma262UnCanonicalizeTable0Size,
@@ -3249,25 +1810,22 @@
   1073749784, 20, 7965, 0, 1073749792, 28, 7975, 0, 1073749800, 28, 7983, 0, 1073749808, 28, 7991, 0,  // NOLINT
   1073749816, 28, 7999, 0, 1073749824, 20, 8005, 0, 1073749832, 20, 8013, 0, 1073749856, 28, 8039, 0,  // NOLINT
   1073749864, 28, 8047, 0, 1073749874, 12, 8053, 0, 1073749960, 12, 8139, 0 };  // NOLINT
-static const uint16_t kCanonicalizationRangeMultiStrings0Size = 1;  // NOLINT
 static const MultiCharacterSpecialCase<1> kCanonicalizationRangeMultiStrings1[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kCanonicalizationRangeTable1Size = 14;  // NOLINT
 static const int32_t kCanonicalizationRangeTable1[28] = {
   1073742176, 60, 367, 0, 1073742192, 60, 383, 0, 1073743030, 100, 1231, 0, 1073743056, 100, 1257, 0,  // NOLINT
   1073744896, 184, 3118, 0, 1073744944, 184, 3166, 0, 1073745152, 148, 3365, 0 };  // NOLINT
-static const uint16_t kCanonicalizationRangeMultiStrings1Size = 1;  // NOLINT
 static const MultiCharacterSpecialCase<1> kCanonicalizationRangeMultiStrings7[1] = {  // NOLINT
   {{kSentinel}} }; // NOLINT
 static const uint16_t kCanonicalizationRangeTable7Size = 4;  // NOLINT
 static const int32_t kCanonicalizationRangeTable7[8] = {
   1073749793, 100, 7994, 0, 1073749825, 100, 8026, 0 };  // NOLINT
-static const uint16_t kCanonicalizationRangeMultiStrings7Size = 1;  // NOLINT
-int CanonicalizationRange::Convert(uchar c,
-                      uchar n,
-                      uchar* result,
+intptr_t CanonicalizationRange::Convert(int32_t c,
+                      int32_t n,
+                      int32_t* result,
                       bool* allow_caching_ptr) {
-  int chunk_index = c >> 13;
+  intptr_t chunk_index = c >> 13;
   switch (chunk_index) {
     case 0: return LookupMapping<false>(kCanonicalizationRangeTable0,
                                            kCanonicalizationRangeTable0Size,
@@ -3294,100 +1852,4 @@
   }
 }
 
-
-const uchar UnicodeData::kMaxCodePoint = 65533;
-
-int UnicodeData::GetByteCount() {
-  return kUppercaseTable0Size * sizeof(int32_t)         // NOLINT
-         + kUppercaseTable1Size * sizeof(int32_t)       // NOLINT
-         + kUppercaseTable5Size * sizeof(int32_t)       // NOLINT
-         + kUppercaseTable7Size * sizeof(int32_t)       // NOLINT
-         + kLowercaseTable0Size * sizeof(int32_t)       // NOLINT
-         + kLowercaseTable1Size * sizeof(int32_t)       // NOLINT
-         + kLowercaseTable5Size * sizeof(int32_t)       // NOLINT
-         + kLowercaseTable7Size * sizeof(int32_t)       // NOLINT
-         + kLetterTable0Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable1Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable2Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable3Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable4Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable5Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable6Size * sizeof(int32_t)          // NOLINT
-         + kLetterTable7Size * sizeof(int32_t)          // NOLINT
-         + kID_StartTable0Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable1Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable2Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable3Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable4Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable5Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable6Size * sizeof(int32_t)        // NOLINT
-         + kID_StartTable7Size * sizeof(int32_t)        // NOLINT
-         + kID_ContinueTable0Size * sizeof(int32_t)     // NOLINT
-         + kID_ContinueTable1Size * sizeof(int32_t)     // NOLINT
-         + kID_ContinueTable5Size * sizeof(int32_t)     // NOLINT
-         + kID_ContinueTable7Size * sizeof(int32_t)     // NOLINT
-         + kWhiteSpaceTable0Size * sizeof(int32_t)      // NOLINT
-         + kWhiteSpaceTable1Size * sizeof(int32_t)      // NOLINT
-         + kWhiteSpaceTable7Size * sizeof(int32_t)      // NOLINT
-         + kLineTerminatorTable0Size * sizeof(int32_t)  // NOLINT
-         + kLineTerminatorTable1Size * sizeof(int32_t)  // NOLINT
-         +
-         kToLowercaseMultiStrings0Size *
-             sizeof(MultiCharacterSpecialCase<2>)  // NOLINT
-         +
-         kToLowercaseMultiStrings1Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kToLowercaseMultiStrings5Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kToLowercaseMultiStrings7Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kToUppercaseMultiStrings0Size *
-             sizeof(MultiCharacterSpecialCase<3>)  // NOLINT
-         +
-         kToUppercaseMultiStrings1Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kToUppercaseMultiStrings5Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kToUppercaseMultiStrings7Size *
-             sizeof(MultiCharacterSpecialCase<3>)  // NOLINT
-         +
-         kEcma262CanonicalizeMultiStrings0Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kEcma262CanonicalizeMultiStrings1Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kEcma262CanonicalizeMultiStrings5Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kEcma262CanonicalizeMultiStrings7Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kEcma262UnCanonicalizeMultiStrings0Size *
-             sizeof(MultiCharacterSpecialCase<4>)  // NOLINT
-         +
-         kEcma262UnCanonicalizeMultiStrings1Size *
-             sizeof(MultiCharacterSpecialCase<2>)  // NOLINT
-         +
-         kEcma262UnCanonicalizeMultiStrings5Size *
-             sizeof(MultiCharacterSpecialCase<2>)  // NOLINT
-         +
-         kEcma262UnCanonicalizeMultiStrings7Size *
-             sizeof(MultiCharacterSpecialCase<2>)  // NOLINT
-         +
-         kCanonicalizationRangeMultiStrings0Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kCanonicalizationRangeMultiStrings1Size *
-             sizeof(MultiCharacterSpecialCase<1>)  // NOLINT
-         +
-         kCanonicalizationRangeMultiStrings7Size *
-             sizeof(MultiCharacterSpecialCase<1>);  // NOLINT
-}
-
 }  // namespace unibrow
diff --git a/runtime/vm/unibrow.h b/runtime/vm/unibrow.h
index d1f287d..82250d2 100644
--- a/runtime/vm/unibrow.h
+++ b/runtime/vm/unibrow.h
@@ -7,7 +7,7 @@
 
 #include <sys/types.h>
 
-// SNIP
+#include "vm/globals.h"
 
 /**
  * \file
@@ -16,59 +16,55 @@
 
 namespace unibrow {
 
-// SNIP
-
 // A cache used in case conversion.  It caches the value for characters
 // that either have no mapping or map to a single character independent
 // of context.  Characters that map to more than one character or that
 // map differently depending on context are always looked up.
-template <class T, int size = 256>
+template <class T, intptr_t size = 256>
 class Mapping {
  public:
   inline Mapping() { }
-  inline int get(uchar c, uchar n, uchar* result);
+  inline intptr_t get(int32_t c, int32_t n, int32_t* result);
  private:
   friend class Test;
-  int CalculateValue(uchar c, uchar n, uchar* result);
+  intptr_t CalculateValue(int32_t c, int32_t n, int32_t* result);
   struct CacheEntry {
     inline CacheEntry() : code_point_(kNoChar), offset_(0) { }
-    inline CacheEntry(uchar code_point, signed offset)
+    inline CacheEntry(int32_t code_point, signed offset)
       : code_point_(code_point),
         offset_(offset) { }
-    uchar code_point_;
+    int32_t code_point_;
     signed offset_;
-    static const int kNoChar = (1 << 21) - 1;
+    static const intptr_t kNoChar = (1 << 21) - 1;
   };
-  static const int kSize = size;
-  static const int kMask = kSize - 1;
+  static const intptr_t kSize = size;
+  static const intptr_t kMask = kSize - 1;
   CacheEntry entries_[kSize];
 };
 
-// SNIP
-
 struct Letter {
-  static bool Is(uchar c);
+  static bool Is(int32_t c);
 };
 struct Ecma262Canonicalize {
-  static const int kMaxWidth = 1;
-  static int Convert(uchar c,
-                     uchar n,
-                     uchar* result,
-                     bool* allow_caching_ptr);
+  static const intptr_t kMaxWidth = 1;
+  static intptr_t Convert(int32_t c,
+                          int32_t n,
+                          int32_t* result,
+                          bool* allow_caching_ptr);
 };
 struct Ecma262UnCanonicalize {
-  static const int kMaxWidth = 4;
-  static int Convert(uchar c,
-                     uchar n,
-                     uchar* result,
-                     bool* allow_caching_ptr);
+  static const intptr_t kMaxWidth = 4;
+  static intptr_t Convert(int32_t c,
+                          int32_t n,
+                          int32_t* result,
+                          bool* allow_caching_ptr);
 };
 struct CanonicalizationRange {
-  static const int kMaxWidth = 1;
-  static int Convert(uchar c,
-                     uchar n,
-                     uchar* result,
-                     bool* allow_caching_ptr);
+  static const intptr_t kMaxWidth = 1;
+  static intptr_t Convert(int32_t c,
+                          int32_t n,
+                          int32_t* result,
+                          bool* allow_caching_ptr);
 };
 
 }  // namespace unibrow
diff --git a/runtime/vm/unicode.h b/runtime/vm/unicode.h
index fd7649c..e06f1f9 100644
--- a/runtime/vm/unicode.h
+++ b/runtime/vm/unicode.h
@@ -154,9 +154,9 @@
   // Encodes a single code point.
   static void Encode(int32_t codepoint, uint16_t* dst);
 
- private:
   static const int32_t kMaxCodeUnit = 0xFFFF;
 
+ private:
   static const int32_t kLeadSurrogateOffset = (0xD800 - (0x10000 >> 10));
 
   static const int32_t kSurrogateOffset = (0x10000 - (0xD800 << 10) - 0xDC00);
diff --git a/runtime/vm/verified_memory.h b/runtime/vm/verified_memory.h
index 45c50e4..db292cc 100644
--- a/runtime/vm/verified_memory.h
+++ b/runtime/vm/verified_memory.h
@@ -81,6 +81,8 @@
 #endif
 
   friend class Assembler;  // To use enabled/offset when generating code.
+  friend class FlowGraphCompiler;  // To compute edge counter code size.
+  friend class Intrinsifier;  // To know whether a jump is near or far.
 };
 
 }  // namespace dart
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc
index ddbc792..8b4898c 100644
--- a/runtime/vm/verifier.cc
+++ b/runtime/vm/verifier.cc
@@ -46,6 +46,7 @@
 
 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) {
   for (RawObject** current = first; current <= last; current++) {
+    VerifiedMemory::Verify(reinterpret_cast<uword>(current), kWordSize);
     RawObject* raw_obj = *current;
     if (raw_obj->IsHeapObject()) {
       if (!allocated_set_->Contains(raw_obj)) {
diff --git a/runtime/vm/vm_sources.gypi b/runtime/vm/vm_sources.gypi
index 241b95e..30d1ff0 100644
--- a/runtime/vm/vm_sources.gypi
+++ b/runtime/vm/vm_sources.gypi
@@ -331,6 +331,14 @@
     'raw_object.cc',
     'raw_object.h',
     'raw_object_snapshot.cc',
+    'regexp.cc',
+    'regexp.h',
+    'regexp_assembler.cc',
+    'regexp_assembler.h',
+    'regexp_ast.cc',
+    'regexp_ast.h',
+    'regexp_parser.cc',
+    'regexp_parser.h',
     'report.cc',
     'report.h',
     'report_test.cc',
@@ -429,6 +437,9 @@
     'trace_buffer.cc',
     'trace_buffer.h',
     'trace_buffer_test.cc',
+    'unibrow.cc',
+    'unibrow.h',
+    'unibrow-inl.h',
     'unicode.cc',
     'unicode.h',
     'unicode_data.cc',
diff --git a/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart b/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
index c151154..156ab63 100644
--- a/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/foreign_helper.dart
@@ -208,6 +208,9 @@
 /// Returns the name used for generated function types on classes and methods.
 String JS_SIGNATURE_NAME() {}
 
+/// Returns the name used to tag typedefs.
+String JS_TYPEDEF_TAG() {}
+
 /// Returns the name used to tag function type representations in JavaScript.
 String JS_FUNCTION_TYPE_TAG() {}
 
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index ae5c853..3ce3a10 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -720,7 +720,7 @@
     return "Instance of '$name'";
   }
 
-  static num dateNow() => JS('num', r'Date.now()');
+  static num dateNow() => JS('int', r'Date.now()');
 
   static void initTicker() {
     if (timerFrequency != null) return;
@@ -1970,7 +1970,6 @@
     // So we only use the new instance to access the constructor property and
     // use Object.create to create the desired prototype.
     var prototype = isStatic
-        // TODO(ahe): Safe to use Object.create?
         ? JS('TearOffClosure', 'Object.create(#.constructor.prototype)',
              new TearOffClosure())
         : JS('BoundClosure', 'Object.create(#.constructor.prototype)',
@@ -1986,7 +1985,8 @@
                      '"this.\$initialize(a,b,c,d);"+#)',
                  functionCounter++);
 
-    // TODO(ahe): Is it necessary to set the constructor property?
+    // It is necessary to set the constructor property, otherwise it will be
+    // "Object".
     JS('', '#.constructor = #', prototype, constructor);
 
     JS('', '#.prototype = #', constructor, prototype);
@@ -2031,7 +2031,7 @@
       throw 'Error in reflectionInfo.';
     }
 
-    JS('', '#.\$signature = #', prototype, signatureFunction);
+    JS('', '#[#] = #', prototype, JS_SIGNATURE_NAME(), signatureFunction);
 
     JS('', '#[#] = #', prototype, callName, trampoline);
     for (int i = 1; i < functions.length; i++) {
diff --git a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
index 5f613d3..d634385 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
@@ -23,7 +23,15 @@
     JS_CURRENT_ISOLATE,
     JS_CURRENT_ISOLATE_CONTEXT,
     JS_EMBEDDED_GLOBAL,
-    JS_GET_NAME;
+    JS_GET_NAME,
+    JS_TYPEDEF_TAG,
+    JS_FUNCTION_TYPE_TAG,
+    JS_FUNCTION_TYPE_RETURN_TYPE_TAG,
+    JS_FUNCTION_TYPE_VOID_RETURN_TAG,
+    JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
+    JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG,
+    JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG;
+
 
 import 'dart:_internal' as _symbol_dev;
 
@@ -733,6 +741,8 @@
     }
     // Constructors aren't 'members'.
     if (method.isConstructor) continue;
+    // Filter out synthetic tear-off stubs
+    if (JS('bool', r'!!#.$getterStub', method._jsFunction)) continue;
     // Use putIfAbsent to filter-out getters corresponding to variables.
     result.putIfAbsent(method.simpleName, () => method);
   }
@@ -1664,6 +1674,7 @@
       if (simpleName == null) continue;
       var function = JS('', '#[#]', prototype, key);
       if (isNoSuchMethodStub(function)) continue;
+      if (isAliasedSuperMethod(function, key)) continue;
       var mirror =
           new JsMethodMirror.fromUnmangledName(
               simpleName, function, false, false);
@@ -2599,19 +2610,44 @@
 
   JsFunctionTypeMirror(this._typeData, this.owner);
 
-  bool get _hasReturnType => JS('bool', '"ret" in #', _typeData);
-  get _returnType => JS('', '#.ret', _typeData);
+  bool get _hasReturnType {
+    return JS('bool', '# in #', JS_FUNCTION_TYPE_RETURN_TYPE_TAG(), _typeData);
+  }
+  get _returnType {
+    return JS('', '#[#]', _typeData, JS_FUNCTION_TYPE_RETURN_TYPE_TAG());
+  }
 
-  bool get _isVoid => JS('bool', '!!#.void', _typeData);
+  bool get _isVoid {
+    return JS('bool', '!!#[#]', _typeData, JS_FUNCTION_TYPE_VOID_RETURN_TAG());
+  }
 
-  bool get _hasArguments => JS('bool', '"args" in #', _typeData);
-  List get _arguments => JS('JSExtendableArray', '#.args', _typeData);
+  bool get _hasArguments {
+    return JS('bool', '# in #',
+              JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG(), _typeData);
+  }
+  List get _arguments {
+    return JS('JSExtendableArray', '#[#]',
+              _typeData, JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG());
+  }
 
-  bool get _hasOptionalArguments => JS('bool', '"opt" in #', _typeData);
-  List get _optionalArguments => JS('JSExtendableArray', '#.opt', _typeData);
+  bool get _hasOptionalArguments {
+    return JS('bool', '# in #',
+              JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG(), _typeData);
+  }
+  List get _optionalArguments {
+    return JS('JSExtendableArray', '#[#]',
+              _typeData, JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG());
+  }
 
-  bool get _hasNamedArguments => JS('bool', '"named" in #', _typeData);
-  get _namedArguments => JS('=Object', '#.named', _typeData);
+  bool get _hasNamedArguments {
+    return JS('bool', '# in #',
+              JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG(), _typeData);
+  }
+  get _namedArguments {
+    return JS('=Object', '#[#]',
+              _typeData, JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG());
+  }
+
   bool get isOriginalDeclaration => true;
 
   bool get isAbstract => false;
@@ -2796,10 +2832,13 @@
     return reflectClassByMangledName(
         getMangledTypeName(createRuntimeType(representation)));
   }
-  if (type != null && JS('', '#.typedef', type) != null) {
+  String typedefPropertyName = JS_TYPEDEF_TAG();
+  String functionTagPropertyName = JS_FUNCTION_TYPE_TAG();
+  if (type != null && JS('', '#[#]', type, typedefPropertyName) != null) {
     return typeMirrorFromRuntimeTypeRepresentation(
-        owner, JS('', '#.typedef', type));
-  } else if (type != null && JS('', '#.func', type) != null) {
+        owner, JS('', '#[#]', type, typedefPropertyName));
+  } else if (type != null &&
+             JS('', '#[#]', type, functionTagPropertyName) != null) {
     return new JsFunctionTypeMirror(type, owner);
   }
   return reflectClass(Function);
@@ -2905,6 +2944,13 @@
   return JS('bool', r'#.$reflectable == 2', jsFunction);
 }
 
+/// Returns true if [key] is only an aliased entry for [function] in the
+/// prototype.
+bool isAliasedSuperMethod(var jsFunction, String key) {
+  var stubName = JS('String|Null', r'#.$stubName', jsFunction);
+  return stubName != null && key != stubName;
+}
+
 class NoSuchStaticMethodError extends Error implements NoSuchMethodError {
   static const int MISSING_CONSTRUCTOR = 0;
   static const int MISSING_METHOD = 1;
diff --git a/sdk/lib/_internal/compiler/js_lib/js_number.dart b/sdk/lib/_internal/compiler/js_lib/js_number.dart
index 3970f03..81adc2b 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_number.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_number.dart
@@ -202,22 +202,22 @@
 
   bool _isInt32(value) => JS('bool', '(# | 0) === #', value, value);
 
-  num operator ~/(num other) {
+  int operator ~/(num other) {
     if (false) _tdivFast(other); // Ensure resolution.
     if (_isInt32(this) && _isInt32(other) && 0 != other && -1 != other) {
-      return JS('num', r'(# / #) | 0', this, other);
+      return JS('int', r'(# / #) | 0', this, other);
     } else {
       return _tdivSlow(other);
     }
   }
 
-  num _tdivFast(num other) {
+  int _tdivFast(num other) {
     return _isInt32(this)
-        ? JS('num', r'(# / #) | 0', this, other)
+        ? JS('int', r'(# / #) | 0', this, other)
         : (JS('num', r'# / #', this, other)).toInt();
   }
 
-  num _tdivSlow(num other) {
+  int _tdivSlow(num other) {
     if (other is !num) throw new ArgumentError(other);
     return (JS('num', r'# / #', this, other)).toInt();
   }
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index c3e1acd..10aa237 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -479,8 +479,13 @@
   Future<T> whenComplete(action());
 
   /**
-   * Creates a [Stream] that sends [this]' completion value, data or error, to
-   * its subscribers. The stream closes after the completion value.
+   * Creates a [Stream] containing the result of this future.
+   *
+   * The stream will produce single data or error event containing the
+   * completion result of this future, and then it will close with a
+   * done event.
+   *
+   * If the future never completes, the stream will not produce any events.
    */
   Stream<T> asStream();
 
@@ -512,12 +517,10 @@
   TimeoutException(this.message, [this.duration]);
 
   String toString() {
-    if (message != null) {
-      if (duration != null) return "TimeoutException after $duration: $message";
-      return "TimeoutException: $message";
-    }
-    if (duration != null) return "TimeoutException after $duration";
-    return "TimeoutException";
+    String result = "TimeoutException";
+    if (duration != null) result = "TimeoutException after $duration";
+    if (message != null) result = "$result: $message";
+    return result;
   }
 }
 
@@ -595,6 +598,29 @@
    * known to be the final result of another asynchronous operation. If in doubt
    * use the default [Completer] constructor.
    *
+   * Using an normal, asynchronous, completer will never give the wrong
+   * behavior, but using a synchronous completer incorrectly can cause
+   * otherwise correct programs to break.
+   *
+   * An asynchronous completer is only intended for optimizing event
+   * propagation when one asynchronous event immediately triggers another.
+   * It should not be used unless the calls to [complete] and [completeError]
+   * are guaranteed to occur in places where it won't break `Future` invariants.
+   *
+   * Completing synchronously means that the completer's future will be
+   * completed immediately when calling the [complete] or [completeError]
+   * method on a synchronous completer, which also calls any callbacks
+   * registered on that future.
+   *
+   * Completing synchronously must not break the rule that when you add a
+   * callback on a future, that callback must not be called until the code
+   * that added the callback has completed.
+   * For that reason, a synchronous completion must only occur at the very end
+   * (in "tail position") of another synchronous event,
+   * because at that point, completing the future immediately is be equivalent
+   * to returning to the event loop and completing the future in the next
+   * microtask.
+   *
    * Example:
    *
    *     var completer = new Completer.sync();
@@ -618,11 +644,14 @@
   factory Completer.sync() => new _SyncCompleter<T>();
 
   /** The future that will contain the result provided to this completer. */
-  Future get future;
+  Future<T> get future;
 
   /**
    * Completes [future] with the supplied values.
    *
+   * The value must be either a value of type [T]
+   * or a future of type `Future<T>`.
+   *
    * If the value is itself a future, the completer will wait for that future
    * to complete, and complete with the same result, whether it is a success
    * or an error.
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 5f761ae..3e5d09e 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -1165,17 +1165,19 @@
     if (index is! int || index < 0) throw new ArgumentError(index);
     _Future<T> future = new _Future<T>();
     StreamSubscription subscription;
+    int elementIndex = 0;
     subscription = this.listen(
       (T value) {
-        if (index == 0) {
+        if (index == elementIndex) {
           _cancelAndValue(subscription, future, value);
           return;
         }
-        index -= 1;
+        elementIndex += 1;
       },
       onError: future._completeError,
       onDone: () {
-        future._completeError(new RangeError.value(index));
+        future._completeError(
+            new RangeError.index(index, this, "index", null, elementIndex));
       },
       cancelOnError: true);
     return future;
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index 36a1efd..2269819 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -186,15 +186,17 @@
   }
 
   E elementAt(int index) {
-    if (index is! int || index < 0) throw new RangeError.value(index);
-    int remaining = index;
+    if (index is! int) throw new ArgumentError.notNull("index");
+    RangeError.checkNotNegative(index, "index");
+    int elementIndex = 0;
     for (E element in this) {
-      if (remaining == 0) return element;
-      remaining--;
+      if (index == elementIndex) return element;
+      elementIndex++;
     }
-    throw new RangeError.value(index);
+    throw new RangeError.index(index, this, "index", null, elementIndex);
   }
 
+
   String toString() => IterableBase.iterableToShortString(this, '(', ')');
 }
 
@@ -380,13 +382,14 @@
   }
 
   E elementAt(int index) {
-    if (index is! int || index < 0) throw new RangeError.value(index);
-    int remaining = index;
+    if (index is! int) throw new ArgumentError.notNull("index");
+    RangeError.checkNotNegative(index, "index");
+    int elementIndex = 0;
     for (E element in this) {
-      if (remaining == 0) return element;
-      remaining--;
+      if (index == elementIndex) return element;
+      elementIndex++;
     }
-    throw new RangeError.value(index);
+    throw new RangeError.index(index, this, "index", null, elementIndex);
   }
 
   /**
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index ec28fbe..df5ab4e 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -205,13 +205,13 @@
     return value;
   }
 
-  Iterable<E> skip(int count) => new SubListIterable(this, count, null);
+  Iterable<E> skip(int count) => new SubListIterable<E>(this, count, null);
 
   Iterable<E> skipWhile(bool test(E element)) {
     return new SkipWhileIterable<E>(this, test);
   }
 
-  Iterable<E> take(int count) => new SubListIterable(this, 0, count);
+  Iterable<E> take(int count) => new SubListIterable<E>(this, 0, count);
 
   Iterable<E> takeWhile(bool test(E element)) {
     return new TakeWhileIterable<E>(this, test);
@@ -325,18 +325,10 @@
     return new ListMapView(this);
   }
 
-  void _rangeCheck(int start, int end) {
-    if (start < 0 || start > this.length) {
-      throw new RangeError.range(start, 0, this.length);
-    }
-    if (end < start || end > this.length) {
-      throw new RangeError.range(end, start, this.length);
-    }
-  }
-
   List<E> sublist(int start, [int end]) {
-    if (end == null) end = this.length;
-    _rangeCheck(start, end);
+    int listLength = this.length;
+    if (end == null) end = listLength;
+    RangeError.checkValidRange(start, end, listLength);
     int length = end - start;
     List<E> result = new List<E>()..length = length;
     for (int i = 0; i < length; i++) {
@@ -346,30 +338,29 @@
   }
 
   Iterable<E> getRange(int start, int end) {
-    _rangeCheck(start, end);
-    return new SubListIterable(this, start, end);
+    RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<E>(this, start, end);
   }
 
   void removeRange(int start, int end) {
-    _rangeCheck(start, end);
+    RangeError.checkValidRange(start, end, this.length);
     int length = end - start;
     setRange(start, this.length - length, this, end);
     this.length -= length;
   }
 
   void fillRange(int start, int end, [E fill]) {
-    _rangeCheck(start, end);
+    RangeError.checkValidRange(start, end, this.length);
     for (int i = start; i < end; i++) {
       this[i] = fill;
     }
   }
 
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    _rangeCheck(start, end);
+    RangeError.checkValidRange(start, end, this.length);
     int length = end - start;
     if (length == 0) return;
-
-    if (skipCount < 0) throw new ArgumentError(skipCount);
+    RangeError.checkNotNegative(skipCount, "skipCount");
 
     List otherList;
     int otherStart;
@@ -397,7 +388,7 @@
   }
 
   void replaceRange(int start, int end, Iterable<E> newContents) {
-    _rangeCheck(start, end);
+    RangeError.checkValidRange(start, end, this.length);
     if (newContents is! EfficientLength) {
       newContents = newContents.toList();
     }
@@ -462,9 +453,7 @@
   }
 
   void insert(int index, E element) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
-    }
+    RangeError.checkValueInInterval(index, 0, length, "index");
     if (index == this.length) {
       add(element);
       return;
@@ -486,9 +475,7 @@
   }
 
   void insertAll(int index, Iterable<E> iterable) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
-    }
+    RangeError.checkValueInInterval(index, 0, length, "index");
     if (iterable is EfficientLength) {
       iterable = iterable.toList();
     }
@@ -511,7 +498,7 @@
     }
   }
 
-  Iterable<E> get reversed => new ReversedListIterable(this);
+  Iterable<E> get reversed => new ReversedListIterable<E>(this);
 
   String toString() => IterableBase.iterableToFullString(this, '[', ']');
 }
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index fc568ff..eb92c712 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -427,9 +427,7 @@
   }
 
   E elementAt(int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this);
-    }
+    RangeError.checkValidIndex(index, this);
     return _table[(_head + index) & (_table.length - 1)];
   }
 
diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart
index 906312a..7470761 100644
--- a/sdk/lib/collection/set.dart
+++ b/sdk/lib/collection/set.dart
@@ -271,13 +271,14 @@
   }
 
   E elementAt(int index) {
-    if (index is! int || index < 0) throw new RangeError.value(index);
-    int remaining = index;
+    if (index is! int) throw new ArgumentError.notNull("index");
+    RangeError.checkNotNegative(index, "index");
+    int elementIndex = 0;
     for (E element in this) {
-      if (remaining == 0) return element;
-      remaining--;
+      if (index == elementIndex) return element;
+      elementIndex++;
     }
-    throw new RangeError.value(index);
+    throw new RangeError.index(index, this, "index", null, elementIndex);
   }
 }
 
diff --git a/sdk/lib/convert/ascii.dart b/sdk/lib/convert/ascii.dart
index 40ff5a8..1caffe0 100644
--- a/sdk/lib/convert/ascii.dart
+++ b/sdk/lib/convert/ascii.dart
@@ -60,9 +60,9 @@
     }
   }
 
-  Converter<String, List<int>> get encoder => const AsciiEncoder();
+  AsciiEncoder get encoder => const AsciiEncoder();
 
-  Converter<List<int>, String> get decoder =>
+  AsciiDecoder get decoder =>
       _allowInvalid ? const AsciiDecoder(allowInvalid: true)
                     : const AsciiDecoder(allowInvalid: false);
 }
@@ -74,10 +74,20 @@
 
   const _UnicodeSubsetEncoder(this._subsetMask);
 
-  List<int> convert(String string) {
-    List result = new Uint8List(string.length);
-    for (int i = 0; i < string.length; i++) {
-      var codeUnit = string.codeUnitAt(i);
+  /**
+   * Converts the [String] into a list of its code units.
+   *
+   * If [start] and [end] are provided, only the substring
+   * `string.substring(start, end)` is used as input to the conversion.
+   */
+  List<int> convert(String string, [int start = 0, int end]) {
+    int stringLength = string.length;
+    RangeError.checkValidRange(start, end, stringLength);
+    if (end == null) end = stringLength;
+    int length = end - start;
+    List result = new Uint8List(length);
+    for (int i = 0; i < length; i++) {
+      var codeUnit = string.codeUnitAt(start + i);
       if ((codeUnit & ~_subsetMask) != 0) {
         throw new ArgumentError("String contains invalid characters.");
       }
@@ -125,12 +135,7 @@
   }
 
   void addSlice(String source, int start, int end, bool isLast) {
-    if (start < 0 || start > source.length) {
-      throw new RangeError.range(start, 0, source.length);
-    }
-    if (end < start || end > source.length) {
-      throw new RangeError.range(end, start, source.length);
-    }
+    RangeError.checkValidRange(start, end, source.length);
     for (int i = start; i < end; i++) {
       int codeUnit = source.codeUnitAt(i);
       if ((codeUnit & ~_subsetMask) != 0) {
@@ -172,23 +177,31 @@
   /**
    * Converts the [bytes] (a list of unsigned 7- or 8-bit integers) to the
    * corresponding string.
+   *
+   * If [start] and [end] are provided, only the sub-list of bytes from
+   * `start` to `end` (`end` not inclusive) is used as input to the conversion.
    */
-  String convert(List<int> bytes) {
-    for (int i = 0; i < bytes.length; i++) {
+  String convert(List<int> bytes, [int start = 0, int end]) {
+    int byteCount = bytes.length;
+    RangeError.checkValidRange(start, end, byteCount);
+    if (end == null) end = byteCount;
+    int length = end - start;
+
+    for (int i = start; i < end; i++) {
       int byte = bytes[i];
       if ((byte & ~_subsetMask) != 0) {
         if (!_allowInvalid) {
           throw new FormatException("Invalid value in input: $byte");
         }
-        return _convertInvalid(bytes);
+        return _convertInvalid(bytes, start, end);
       }
     }
-    return new String.fromCharCodes(bytes);
+    return new String.fromCharCodes(bytes, start, end);
   }
 
-  String _convertInvalid(List<int> bytes) {
+  String _convertInvalid(List<int> bytes, int start, int end) {
     StringBuffer buffer = new StringBuffer();
-    for (int i = 0; i < bytes.length; i++) {
+    for (int i = start; i < end; i++) {
       int value = bytes[i];
       if ((value & ~_subsetMask) != 0) value = 0xFFFD;
       buffer.writeCharCode(value);
@@ -250,12 +263,7 @@
   }
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
-    if (start < 0 || start > source.length) {
-      throw new RangeError.range(start, 0, source.length);
-    }
-    if (end < start || end > source.length) {
-      throw new RangeError.range(end, start, source.length);
-    }
+    RangeError.checkValidRange(start, end, source.length);
     for (int i = start; i < end; i++) {
       if ((source[i] & ~_ASCII_MASK) != 0) {
         if (i > start) _utf8Sink.addSlice(source, start, i, false);
@@ -291,12 +299,7 @@
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
     final int length = source.length;
-    if (start < 0 || start > length) {
-      throw new RangeError.range(start, 0, length);
-    }
-    if (end < start || end > length) {
-      throw new RangeError.range(end, start, length);
-    }
+    RangeError.checkValidRange(start, end, length);
     if (start < end) {
       if (start != 0 || end != length) {
         source = source.sublist(start, end);
diff --git a/sdk/lib/convert/latin1.dart b/sdk/lib/convert/latin1.dart
index dd9c65f..7f7fef8 100644
--- a/sdk/lib/convert/latin1.dart
+++ b/sdk/lib/convert/latin1.dart
@@ -132,12 +132,7 @@
   }
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
-    if (start < 0 || start > source.length) {
-      throw new RangeError.range(start, 0, source.length);
-    }
-    if (end < start || end > source.length) {
-      throw new RangeError.range(end, start, source.length);
-    }
+    RangeError.checkValidRange(start, end, source.length);
     for (int i = start; i < end; i++) {
       int char = source[i];
       if (char > _LATIN1_MASK || char < 0) {
@@ -157,12 +152,7 @@
   _Latin1AllowInvalidDecoderSink(StringConversionSink sink): super(sink);
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
-    if (start < 0 || start > source.length) {
-      throw new RangeError.range(start, 0, source.length);
-    }
-    if (end < start || end > source.length) {
-      throw new RangeError.range(end, start, source.length);
-    }
+    RangeError.checkValidRange(start, end, source.length);
     for (int i = start; i < end; i++) {
       int char = source[i];
       if (char > _LATIN1_MASK || char < 0) {
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index 2fcb915..d16d2c6 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -66,8 +66,8 @@
     return new Utf8Decoder(allowMalformed: allowMalformed).convert(codeUnits);
   }
 
-  Converter<String, List<int>> get encoder => new Utf8Encoder();
-  Converter<List<int>, String> get decoder {
+  Utf8Encoder get encoder => new Utf8Encoder();
+  Utf8Decoder get decoder {
     return new Utf8Decoder(allowMalformed: _allowMalformed);
   }
 }
@@ -83,15 +83,26 @@
   /**
    * Converts [string] to its UTF-8 code units (a list of
    * unsigned 8-bit integers).
+   *
+   * If [start] and [end] are provided, only the substring
+   * `string.substring(start, end)` is converted.
    */
-  List<int> convert(String string) {
+  List<int> convert(String string, [int start = 0, int end]) {
+    int stringLength = string.length;
+    RangeError.checkValidRange(start, end, stringLength);
+    if (end == null) end = stringLength;
+    int length = end - start;
+    if (length == 0) return new Uint8List(0);
     // Create a new encoder with a length that is guaranteed to be big enough.
-    // A single code unit uses at most 3 bytes. Two code units at most 4.
-    _Utf8Encoder encoder = new _Utf8Encoder.withBufferSize(string.length * 3);
-    int endPosition = encoder._fillBuffer(string, 0, string.length);
-    assert(endPosition >= string.length - 1);
-    if (endPosition != string.length) {
-      int lastCodeUnit = string.codeUnitAt(string.length - 1);
+    // A single code unit uses at most 3 bytes, a surrogate pair at most 4.
+    _Utf8Encoder encoder = new _Utf8Encoder.withBufferSize(length * 3);
+    int endPosition = encoder._fillBuffer(string, start, end);
+    assert(endPosition >= end - 1);
+    if (endPosition != end) {
+      // Encoding skipped the last code unit.
+      // That can only happen if the last code unit is a leadsurrogate.
+      // Force encoding of the lead surrogate by itself.
+      int lastCodeUnit = string.codeUnitAt(end - 1);
       assert(_isLeadSurrogate(lastCodeUnit));
       // We use a non-surrogate as `nextUnit` so that _writeSurrogate just
       // writes the lead-surrogate.
@@ -313,13 +324,19 @@
    * Converts the UTF-8 [codeUnits] (a list of unsigned 8-bit integers) to the
    * corresponding string.
    *
+   * Uses the code units from [start] to, but no including, [end].
+   * If [end] is omitted, it defaults to `codeUnits.length`.
+   *
    * If the [codeUnits] start with a leading [UNICODE_BOM_CHARACTER_RUNE] this
    * character is discarded.
    */
-  String convert(List<int> codeUnits) {
+  String convert(List<int> codeUnits, [int start = 0, int end]) {
+    int length = codeUnits.length;
+    RangeError.checkValidRange(start, end, length);
+    if (end == null) end = length;
     StringBuffer buffer = new StringBuffer();
     _Utf8Decoder decoder = new _Utf8Decoder(buffer, _allowMalformed);
-    decoder.convert(codeUnits, 0, codeUnits.length);
+    decoder.convert(codeUnits, start, end);
     decoder.close();
     return buffer.toString();
   }
diff --git a/sdk/lib/core/duration.dart b/sdk/lib/core/duration.dart
index c081422..402d289 100644
--- a/sdk/lib/core/duration.dart
+++ b/sdk/lib/core/duration.dart
@@ -92,19 +92,24 @@
                   int seconds: 0,
                   int milliseconds: 0,
                   int microseconds: 0})
-      : _duration = days * MICROSECONDS_PER_DAY +
-                    hours * MICROSECONDS_PER_HOUR +
-                    minutes * MICROSECONDS_PER_MINUTE +
-                    seconds * MICROSECONDS_PER_SECOND +
-                    milliseconds * MICROSECONDS_PER_MILLISECOND +
-                    microseconds;
+      : this._microseconds(
+            days * MICROSECONDS_PER_DAY +
+            hours * MICROSECONDS_PER_HOUR +
+            minutes * MICROSECONDS_PER_MINUTE +
+            seconds * MICROSECONDS_PER_SECOND +
+            milliseconds * MICROSECONDS_PER_MILLISECOND +
+            microseconds);
+
+  // Fast path internal direct constructor to avoids the optional arguments and
+  // [_microseconds] recomputation.
+  const Duration._microseconds(this._duration);
 
   /**
    * Adds this Duration and [other] and
    * returns the sum as a new Duration object.
    */
   Duration operator +(Duration other) {
-    return new Duration(microseconds: _duration + other._duration);
+    return new Duration._microseconds(_duration + other._duration);
   }
 
   /**
@@ -112,7 +117,7 @@
    * returns the difference as a new Duration object.
    */
   Duration operator -(Duration other) {
-    return new Duration(microseconds: _duration - other._duration);
+    return new Duration._microseconds(_duration - other._duration);
   }
 
   /**
@@ -123,7 +128,7 @@
    * 53 bits, precision is lost because of double-precision arithmetic.
    */
   Duration operator *(num factor) {
-    return new Duration(microseconds: (_duration * factor).round());
+    return new Duration._microseconds((_duration * factor).round());
   }
 
   /**
@@ -136,7 +141,7 @@
     // By doing the check here instead of relying on "~/" below we get the
     // exception even with dart2js.
     if (quotient == 0) throw new IntegerDivisionByZeroException();
-    return new Duration(microseconds: _duration ~/ quotient);
+    return new Duration._microseconds(_duration ~/ quotient);
   }
 
   /**
@@ -248,9 +253,7 @@
     }
 
     if (inMicroseconds < 0) {
-      Duration duration =
-          new Duration(microseconds: -inMicroseconds);
-      return "-$duration";
+      return "-${-this}";
     }
     String twoDigitMinutes = twoDigits(inMinutes.remainder(MINUTES_PER_HOUR));
     String twoDigitSeconds = twoDigits(inSeconds.remainder(SECONDS_PER_MINUTE));
@@ -274,7 +277,7 @@
    * The returned `Duration` has the same length as this one, but is always
    * positive.
    */
-  Duration abs() => new Duration(microseconds: _duration.abs());
+  Duration abs() => new Duration._microseconds(_duration.abs());
 
   /**
    * Returns a new `Duration` representing this `Duration` negated.
@@ -282,5 +285,5 @@
    * The returned `Duration` has the same length as this one, but will have the
    * opposite sign of this one.
    */
-  Duration operator -() => new Duration(microseconds: -_duration);
+  Duration operator -() => new Duration._microseconds(-_duration);
 }
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index b8a3157..0ac1880 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -218,8 +218,9 @@
   /**
    * Create a new [RangeError] with for an invalid value being outside a range.
    *
-   * The allowed range is from [start] to [end], inclusive.
-   * If `start` or `end` are `null`, the range is infinite in that direction.
+   * The allowed range is from [minValue] to [maxValue], inclusive.
+   * If `minValue` or `maxValue` are `null`, the range is infinite in
+   * that direction.
    *
    * For a range from 0 to the length of something, end exclusive, use
    * [RangeError.index].
@@ -228,9 +229,11 @@
    * invalid value, and the [message] can override the default error
    * description.
    */
-  RangeError.range(num invalidValue, this.start, this.end,
+  RangeError.range(num invalidValue, int minValue, int maxValue,
                    [String name, String message])
-      : super.value(invalidValue, name,
+      : start = minValue,
+        end = maxValue,
+        super.value(invalidValue, name,
                     (message != null) ? message : "Invalid value");
 
   /**
@@ -249,6 +252,74 @@
                             String message,
                             int length]) = IndexError;
 
+  /**
+   * Check that a [value] lies in a specific interval.
+   *
+   * Throws if [value] is not in the interval.
+   * The interval is from [minValue] to [maxValue], both inclusive.
+   */
+  static void checkValueInInterval(int value, int minValue, int maxValue,
+                                   [String name, String message]) {
+    if (value < minValue || value > maxValue) {
+      throw new RangeError.range(value, minValue, maxValue, name, message);
+    }
+  }
+
+  /**
+   * Check that a value is a valid index into an indexable object.
+   *
+   * Throws if [index] is not a valid index into [indexable].
+   *
+   * An indexable object is one that has a `length` and a and index-operator
+   * `[]` that accepts an index if `0 <= index < length`.
+   *
+   * If [length] is provided, it is used as the length of the indexable object,
+   * otherwise the length is found as `idexable.length`.
+   */
+  static void checkValidIndex(int index, var indexable,
+                              [String name, int length, String message]) {
+    if (length == null) length = indexable.length;
+    if (index < 0 || index >= length) {
+      if (name == null) name = "index";
+      throw new RangeError.index(index, indexable, name, message, length);
+    }
+  }
+
+  /**
+   * Check that a range represents a slice of an indexable object.
+   *
+   * Throws if the range is not valid for an indexable object with
+   * the given [length].
+   * A range is valid for an indexable object with a given [length]
+   *
+   * if `0 <= [start] <= [end] <= [length]`.
+   * An `end` of `null` is considered equivalent to `length`.
+   *
+   * The [startName] and [endName] defaults to `"start"` and `"end"`,
+   * respectively.
+   */
+  static void checkValidRange(int start, int end, int length,
+                              [String startName, String endName,
+                               String message]) {
+    if (start < 0 || start > length) {
+      if (startName == null) startName = "start";
+      throw new RangeError.range(start, 0, length, startName, message);
+    }
+    if (end != null && (end < start || end > length)) {
+      if (endName == null) endName = "end";
+      throw new RangeError.range(end, start, length, endName, message);
+    }
+  }
+
+  /**
+   * Check that an integer value isn't negative.
+   *
+   * Throws if the value is negative.
+   */
+  static void checkNotNegative(int value, [String name, String message]) {
+    if (value < 0) throw new RangeError.range(value, 0, null, name, message);
+  }
+
   String toString() {
     if (!_hasValue) return "RangeError: $message";
     String value = Error.safeToString(invalidValue);
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index a6bf3e9..7f2c5d6 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -201,14 +201,14 @@
   bool get isNotEmpty;
 
   /**
-   * Returns an [Iterable] with at most [n] elements.
+   * Returns an [Iterable] with at most [count] elements.
    *
-   * The returned [Iterable] may contain fewer than [n] elements, if `this`
-   * contains fewer than [n] elements.
+   * The returned `Iterable` may contain fewer than `count` elements, if `this`
+   * contains fewer than `count` elements.
    *
-   * It is an error if [n] is negative.
+   * It is an error if `count` is negative.
    */
-  Iterable<E> take(int n);
+  Iterable<E> take(int count);
 
   /**
    * Returns an Iterable that stops once [test] is not satisfied anymore.
@@ -223,14 +223,14 @@
   Iterable<E> takeWhile(bool test(E value));
 
   /**
-   * Returns an Iterable that skips the first [n] elements.
+   * Returns an Iterable that skips the first [count] elements.
    *
-   * If `this` has fewer than [n] elements, then the resulting Iterable is
+   * If `this` has fewer than `count` elements, then the resulting Iterable is
    * empty.
    *
-   * It is an error if [n] is negative.
+   * It is an error if `count` is negative.
    */
-  Iterable<E> skip(int n);
+  Iterable<E> skip(int count);
 
   /**
    * Returns an Iterable that skips elements while [test] is satisfied.
@@ -321,18 +321,18 @@
       new _GeneratorIterator<E>(_start, _end, _generator);
   int get length => _end - _start;
 
-  Iterable<E> skip(int n) {
-    if (n < 0) throw new RangeError.value(n);
-    if (n == 0) return this;
-    int newStart = _start + n;
+  Iterable<E> skip(int count) {
+    RangeError.checkNotNegative(count, "count");
+    if (count == 0) return this;
+    int newStart = _start + count;
     if (newStart >= _end) return new EmptyIterable<E>();
     return new _GeneratorIterable<E>.slice(newStart, _end, _generator);
   }
 
-  Iterable<E> take(int n) {
-    if (n < 0) throw new RangeError.value(n);
-    if (n == 0) return new EmptyIterable<E>();
-    int newEnd = _start + n;
+  Iterable<E> take(int count) {
+    RangeError.checkNotNegative(count, "count");
+    if (count == 0) return new EmptyIterable<E>();
+    int newEnd = _start + count;
     if (newEnd >= _end) return this;
     return new _GeneratorIterable<E>.slice(_start, newEnd, _generator);
   }
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index b95c6e1..e4a1c1d 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -640,14 +640,11 @@
    * and a [movePrevious] will use the rune ending just before [index] as the
    * the current value.
    *
-   * It is an error if the [index] position is in the middle of a surrogate
-   * pair.
+   * The [index] position must not be in the middle of a surrogate pair.
    */
   RuneIterator.at(String string, int index)
       : string = string, _position = index, _nextPosition = index {
-    if (index < 0 || index > string.length) {
-      throw new RangeError.range(index, 0, string.length);
-    }
+    RangeError.checkValueInInterval(index, 0, string.length);
     _checkSplitSurrogate(index);
   }
 
@@ -677,9 +674,7 @@
    * Setting the position to the end of then string will set [current] to null.
    */
   void set rawIndex(int rawIndex) {
-    if (rawIndex >= string.length) {
-      throw new RangeError.index(rawIndex, string);
-    }
+    RangeError.checkValidIndex(rawIndex, string, "rawIndex");
     reset(rawIndex);
     moveNext();
   }
@@ -695,9 +690,7 @@
    * is an error. So is setting it in the middle of a surrogate pair.
    */
   void reset([int rawIndex = 0]) {
-    if (rawIndex < 0 || rawIndex > string.length) {
-      throw new RangeError.range(rawIndex, 0, string.length);
-    }
+    RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex");
     _checkSplitSurrogate(rawIndex);
     _position = _nextPosition = rawIndex;
     _currentCodePoint = null;
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 8e0f4b2..deb76fc 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -237,15 +237,11 @@
   final int _endOrLength;
 
   SubListIterable(this._iterable, this._start, this._endOrLength) {
-    if (_start < 0) {
-      throw new RangeError.value(_start);
-    }
+    RangeError.checkNotNegative(_start, "start");
     if (_endOrLength != null) {
-      if (_endOrLength < 0) {
-        throw new RangeError.value(_endOrLength);
-      }
+      RangeError.checkNotNegative(_endOrLength, "end");
       if (_start > _endOrLength) {
-        throw new RangeError.range(_start, 0, _endOrLength);
+        throw new RangeError.range(_start, 0, _endOrLength, "start");
       }
     }
   }
@@ -274,13 +270,13 @@
   E elementAt(int index) {
     int realIndex = _startIndex + index;
     if (index < 0 || realIndex >= _endIndex) {
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this, "index");
     }
     return _iterable.elementAt(realIndex);
   }
 
   Iterable<E> skip(int count) {
-    if (count < 0) throw new RangeError.value(count);
+    RangeError.checkNotNegative(count, "count");
     int newStart = _start + count;
     if (_endOrLength != null && newStart >= _endOrLength) {
       return new EmptyIterable<E>();
@@ -289,7 +285,7 @@
   }
 
   Iterable<E> take(int count) {
-    if (count < 0) throw new RangeError.value(count);
+    RangeError.checkNotNegative(count, "count");
     if (_endOrLength == null) {
       return new SubListIterable<E>(_iterable, _start, _start + count);
     } else {
@@ -586,24 +582,26 @@
   final Iterable<E> _iterable;
   final int _skipCount;
 
-  factory SkipIterable(Iterable<E> iterable, int skipCount) {
+  factory SkipIterable(Iterable<E> iterable, int count) {
     if (iterable is EfficientLength) {
-      return new EfficientLengthSkipIterable<E>(iterable, skipCount);
+      return new EfficientLengthSkipIterable<E>(iterable, count);
     }
-    return new SkipIterable<E>._(iterable, skipCount);
+    return new SkipIterable<E>._(iterable, count);
   }
 
   SkipIterable._(this._iterable, this._skipCount) {
-    if (_skipCount is! int || _skipCount < 0) {
-      throw new RangeError(_skipCount);
+    if (_skipCount is! int) {
+      throw new ArgumentError.value(_skipCount, "count is not an integer");
     }
+    RangeError.checkNotNegative(_skipCount, "count");
   }
 
-  Iterable<E> skip(int n) {
-    if (n is! int || n < 0) {
-      throw new RangeError.value(n);
+  Iterable<E> skip(int count) {
+    if (_skipCount is! int) {
+      throw new ArgumentError.value(_skipCount, "count is not an integer");
     }
-    return new SkipIterable<E>(_iterable, _skipCount + n);
+    RangeError.checkNotNegative(_skipCount, "count");
+    return new SkipIterable<E>._(_iterable, _skipCount + count);
   }
 
   Iterator<E> get iterator {
@@ -691,7 +689,7 @@
 
   E get single { throw IterableElementError.noElement(); }
 
-  E elementAt(int index) { throw new RangeError.value(index); }
+  E elementAt(int index) { throw new RangeError.range(index, 0, 0, "index"); }
 
   bool contains(Object element) => false;
 
@@ -729,14 +727,14 @@
   }
 
   Iterable<E> skip(int count) {
-    if (count < 0) throw new RangeError.value(count);
+    RangeError.checkNotNegative(count, "count");
     return this;
   }
 
   Iterable<E> skipWhile(bool test(E element)) => this;
 
   Iterable<E> take(int count) {
-    if (count < 0) throw new RangeError.value(count);
+    RangeError.checkNotNegative(count, "count");
     return this;
   }
 
@@ -924,14 +922,15 @@
     throw IterableElementError.noElement();
   }
 
-  static dynamic elementAt(Iterable iterable, int index) {
-    if (index is! int || index < 0) throw new RangeError.value(index);
-    int remaining = index;
-    for (dynamic element in iterable) {
-      if (remaining == 0) return element;
-      remaining--;
+  static elementAt(Iterable iterable, int index) {
+    if (index is! int) throw new ArgumentError.notNull("index");
+    RangeError.checkNotNegative(index, "index");
+    int elementIndex = 0;
+    for (var element in iterable) {
+      if (index == elementIndex) return element;
+      elementIndex++;
     }
-    throw new RangeError.value(index);
+    throw new RangeError.index(index, iterable, "index", null, elementIndex);
   }
 
   static String join(Iterable iterable, [String separator]) {
@@ -1025,12 +1024,7 @@
   }
 
   static void _rangeCheck(List list, int start, int end) {
-    if (start < 0 || start > list.length) {
-      throw new RangeError.range(start, 0, list.length);
-    }
-    if (end < start || end > list.length) {
-      throw new RangeError.range(end, start, list.length);
-    }
+    RangeError.checkValidRange(start, end, list.length);
   }
 
   Iterable<T> getRangeList(List list, int start, int end) {
@@ -1098,9 +1092,7 @@
   }
 
   static void insertAllList(List list, int index, Iterable iterable) {
-    if (index < 0 || index > list.length) {
-      throw new RangeError.range(index, 0, list.length);
-    }
+    RangeError.checkValueInInterval(index, 0, list.length, "index");
     if (iterable is! EfficientLength) {
       iterable = iterable.toList(growable: false);
     }
@@ -1113,9 +1105,7 @@
   }
 
   static void setAllList(List list, int index, Iterable iterable) {
-    if (index < 0 || index > list.length) {
-      throw new RangeError.range(index, 0, list.length);
-    }
+    RangeError.checkValueInInterval(index, 0, list.length, "index");
     for (var element in iterable) {
       list[index++] = element;
     }
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index 71e08f8..6b94c6c 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.dart
@@ -238,9 +238,7 @@
 
   int get length => _backedList.length;
   int elementAt(int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this);
-    }
+    RangeError.checkValidIndex(index, this);
     return index;
   }
 }
diff --git a/sdk/lib/internal/lists.dart b/sdk/lib/internal/lists.dart
index f821616..0f5d8e7 100644
--- a/sdk/lib/internal/lists.dart
+++ b/sdk/lib/internal/lists.dart
@@ -75,25 +75,16 @@
   }
 
   static void indicesCheck(List a, int start, int end) {
-    if (start < 0 || start > a.length) {
-      throw new RangeError.range(start, 0, a.length);
-    }
-    if (end != null && (end < start || end > a.length)) {
-      throw new RangeError.range(end, start, a.length);
-    }
+    RangeError.checkValidRange(start, end, a.length);
   }
 
   static void rangeCheck(List a, int start, int length) {
-    if (length < 0) {
-      throw new ArgumentError("negative length $length");
-    }
-    if (start < 0 ) {
-      String message = "$start must be greater than or equal to 0";
-      throw new RangeError(message);
-    }
+    RangeError.checkNotNegative(length);
+    RangeError.checkNotNegative(start);
     if (start + length > a.length) {
-      String message = "$start + $length must be in the range [0..${a.length})";
-      throw new RangeError(message);
+      String message = "$start + $length must be in the range [0..${a.length}]";
+      throw new RangeError.range(length, 0, a.length - start,
+                                 "length", message);
     }
   }
 }
diff --git a/sdk/lib/io/console.dart b/sdk/lib/io/console.dart
new file mode 100644
index 0000000..c4ab7f2
--- /dev/null
+++ b/sdk/lib/io/console.dart
@@ -0,0 +1,97 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart.io;
+
+Console _console;
+
+Console get console {
+  if (_console == null) {
+    _console = new Console._();
+  }
+  return _console;
+}
+
+/**
+ * [Console] provides synchronous write access to stdout and stderr.
+ *
+ * The direct access to stdout and stderr through [stdout] and [stderr]
+ * provides non-blocking async operations.
+ */
+class Console {
+  final ConsoleSink _stdout;
+  final ConsoleSink _stderr;
+
+  Console._()
+      : _stdout = new ConsoleSink._(1),
+        _stderr = new ConsoleSink._(2);
+
+  /**
+   * Write to stdout.
+   */
+  ConsoleSink get log => _stdout;
+
+  /**
+   * Write to stderr.
+   */
+  ConsoleSink get error => _stderr;
+}
+
+/**
+ * Sink class used for console writing.
+ *
+ * This class has a call method so you can call it directly. Calling
+ * it directly is the same as calling its `writeln` method.
+ */
+class ConsoleSink implements Sink<List<int>>, StringSink {
+  IOSink _sink;
+
+  ConsoleSink._(int fd) {
+    _sink = new IOSink(new _ConsoleConsumer(fd));
+  }
+
+  void call([Object message = ""]) => _sink.writeln(message);
+
+  void add(List<int> data) => _sink.add(data);
+
+  void close() {}
+
+  void write(Object obj) => _sink.write(obj);
+
+  void writeAll(Iterable objects, [String separator=""]) =>
+      _sink.writeAll(objects, separator);
+
+  void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
+
+  void writeln([Object obj=""]) => _sink.writeln(obj);
+}
+
+class _ConsoleConsumer implements StreamConsumer<List<int>> {
+  final _file;
+
+  _ConsoleConsumer(int fd) : _file = _File._openStdioSync(fd);
+
+  Future addStream(Stream<List<int>> stream) {
+    var completer = new Completer();
+    var sub;
+    sub = stream.listen(
+        (data) {
+          try {
+            _file.writeFromSync(data);
+          } catch (e, s) {
+            sub.cancel();
+            completer.completeError(e, s);
+          }
+        },
+        onError: completer.completeError,
+        onDone: completer.complete,
+        cancelOnError: true);
+    return completer.future;
+  }
+
+  Future close() {
+    _file.closeSync();
+    return new Future.value();
+  }
+}
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index cd1ad33..72d5a6d 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -176,6 +176,11 @@
     _openFuture = _file.open(mode: mode);
   }
 
+  _FileStreamConsumer.fromStdio(int fd) {
+    assert(1 <= fd && fd <= 2);
+    _openFuture = new Future.value(_File._openStdioSync(fd));
+  }
+
   Future<File> addStream(Stream<List<int>> stream) {
     Completer<File> completer = new Completer<File>.sync();
     _openFuture
@@ -708,11 +713,7 @@
   }
 
   static void _checkReadWriteListArguments(int length, int start, int end) {
-    if (start < 0) throw new RangeError.value(start);
-    if (end < start) throw new RangeError.value(end);
-    if (end > length) {
-      throw new RangeError.value(end);
-    }
+    RangeError.checkValidRange(start, end, length);
   }
 
   external static _readInto(int id, List<int> buffer, int start, int end);
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index da5d2b6..5c49c2f 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1329,8 +1329,11 @@
                                          proxy,
                                          _httpClient,
                                          this);
+    // For the Host header an IPv6 address must be enclosed in []'s.
+    var host = uri.host;
+    if (host.contains(':')) host = "[$host]";
     request.headers
-        ..host = uri.host
+        ..host = host
         ..port = port
         .._add(HttpHeaders.ACCEPT_ENCODING, "gzip");
     if (_httpClient.userAgent != null) {
diff --git a/sdk/lib/io/io.dart b/sdk/lib/io/io.dart
index 4a9300a..dc2d5b0 100644
--- a/sdk/lib/io/io.dart
+++ b/sdk/lib/io/io.dart
@@ -212,6 +212,7 @@
 
 part 'bytes_builder.dart';
 part 'common.dart';
+part 'console.dart';
 part 'crypto.dart';
 part 'data_transformer.dart';
 part 'directory.dart';
diff --git a/sdk/lib/io/iolib_sources.gypi b/sdk/lib/io/iolib_sources.gypi
index 5b82147..2195247 100644
--- a/sdk/lib/io/iolib_sources.gypi
+++ b/sdk/lib/io/iolib_sources.gypi
@@ -6,6 +6,7 @@
   'sources': [
     'bytes_builder.dart',
     'common.dart',
+    'console.dart',
     'crypto.dart',
     'data_transformer.dart',
     'directory.dart',
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index f36dd83..e4bdf01 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -191,36 +191,6 @@
 }
 
 
-class _StdConsumer implements StreamConsumer<List<int>> {
-  final _file;
-
-  _StdConsumer(int fd) : _file = _File._openStdioSync(fd);
-
-  Future addStream(Stream<List<int>> stream) {
-    var completer = new Completer();
-    var sub;
-    sub = stream.listen(
-        (data) {
-          try {
-            _file.writeFromSync(data);
-          } catch (e, s) {
-            sub.cancel();
-            completer.completeError(e, s);
-          }
-        },
-        onError: completer.completeError,
-        onDone: completer.complete,
-        cancelOnError: true);
-    return completer.future;
-  }
-
-  Future close() {
-    _file.closeSync();
-    return new Future.value();
-  }
-}
-
-
 class _StdSink implements IOSink {
   final IOSink _sink;
 
diff --git a/site/try/poi/poi.dart b/site/try/poi/poi.dart
index 0261ba5..5a8900e 100644
--- a/site/try/poi/poi.dart
+++ b/site/try/poi/poi.dart
@@ -14,6 +14,7 @@
     UTF8;
 
 import 'package:dart2js_incremental/dart2js_incremental.dart' show
+    INCREMENTAL_OPTIONS,
     reuseCompiler;
 
 import 'package:dart2js_incremental/library_updater.dart' show
@@ -63,6 +64,9 @@
 import 'package:compiler/src/js/js.dart' show
     js;
 
+import 'scope_information_visitor.dart' show
+    ScopeInformationVisitor;
+
 /// Enabled by the option --enable-dart-mind.  Controls if this program should
 /// be querying Dart Mind.
 bool isDartMindEnabled = false;
@@ -382,12 +386,10 @@
 
   var options = [
       '--analyze-main',
-      '--no-source-maps',
       '--verbose',
       '--categories=Client,Server',
-      '--incremental-support',
-      '--disable-type-inference',
   ];
+  options.addAll(INCREMENTAL_OPTIONS);
 
   if (!isCompiler) {
     options.add('--analyze-only');
@@ -492,7 +494,7 @@
 
 String scopeInformation(Element element, int position) {
   ScopeInformationVisitor visitor =
-      new ScopeInformationVisitor(element, position);
+      new ScopeInformationVisitor(cachedCompiler, element, position);
   element.accept(visitor);
   return '${visitor.buffer}';
 }
@@ -545,259 +547,6 @@
   }
 }
 
-/**
- * Serializes scope information about an element. This is accomplished by
- * calling the [serialize] method on each element. Some elements need special
- * treatment, as their enclosing scope must also be serialized.
- */
-class ScopeInformationVisitor extends ElementVisitor/* <void> */ {
-  // TODO(ahe): Include function parameters and local variables.
-
-  final Element currentElement;
-  final int position;
-  final StringBuffer buffer = new StringBuffer();
-  int indentationLevel = 0;
-  ClassElement currentClass;
-
-  ScopeInformationVisitor(this.currentElement, this.position);
-
-  String get indentation => '  ' * indentationLevel;
-
-  StringBuffer get indented => buffer..write(indentation);
-
-  void visitElement(Element e) {
-    serialize(e, omitEnclosing: false);
-  }
-
-  void visitLibraryElement(LibraryElement e) {
-    bool isFirst = true;
-    forEach(Element member) {
-      if (!isFirst) {
-        buffer.write(',');
-      }
-      buffer.write('\n');
-      indented;
-      serialize(member);
-      isFirst = false;
-    }
-    serialize(
-        e,
-        // TODO(ahe): We omit the import scope if there is no current
-        // class. That's wrong.
-        omitEnclosing: currentClass == null,
-        name: e.getLibraryName(),
-        serializeEnclosing: () {
-          // The enclosing scope of a library is a scope which contains all the
-          // imported names.
-          isFirst = true;
-          buffer.write('{\n');
-          indentationLevel++;
-          indented.write('"kind": "imports",\n');
-          indented.write('"members": [');
-          indentationLevel++;
-          importScope(e).importScope.values.forEach(forEach);
-          indentationLevel--;
-          buffer.write('\n');
-          indented.write('],\n');
-          // The enclosing scope of the imported names scope is the superclass
-          // scope of the current class.
-          indented.write('"enclosing": ');
-          serializeClassSide(
-              currentClass.superclass, isStatic: false, includeSuper: true);
-          buffer.write('\n');
-          indentationLevel--;
-          indented.write('}');
-        },
-        serializeMembers: () {
-          isFirst = true;
-          localScope(e).values.forEach(forEach);
-        });
-  }
-
-  void visitClassElement(ClassElement e) {
-    currentClass = e;
-    serializeClassSide(e, isStatic: true);
-  }
-
-  /// Serializes one of the "sides" a class. The sides of a class are "instance
-  /// side" and "class side". These terms are from Smalltalk. The instance side
-  /// is all the local instance members of the class (the members of the
-  /// mixin), and the class side is the equivalent for static members and
-  /// constructors.
-  /// The scope chain is ordered so that the "class side" is searched before
-  /// the "instance side".
-  void serializeClassSide(
-      ClassElement e,
-      {bool isStatic: false,
-       bool omitEnclosing: false,
-       bool includeSuper: false}) {
-    bool isFirst = true;
-    var serializeEnclosing;
-    String kind;
-    if (isStatic) {
-      kind = 'class side';
-      serializeEnclosing = () {
-        serializeClassSide(e, isStatic: false, omitEnclosing: omitEnclosing);
-      };
-    } else {
-      kind = 'instance side';
-    }
-    if (includeSuper) {
-      assert(!omitEnclosing && !isStatic);
-      if (e.superclass == null) {
-        omitEnclosing = true;
-      } else {
-        // Members of the superclass are represented as a separate scope.
-        serializeEnclosing = () {
-          serializeClassSide(
-              e.superclass, isStatic: false, omitEnclosing: false,
-              includeSuper: true);
-        };
-      }
-    }
-    serialize(
-        e, omitEnclosing: omitEnclosing, serializeEnclosing: serializeEnclosing,
-        kind: kind, serializeMembers: () {
-      e.forEachLocalMember((Element member) {
-        // Filter out members that don't belong to this "side".
-        if (member.isConstructor) {
-          // In dart2js, some constructors aren't static, but that isn't
-          // convenient here.
-          if (!isStatic) return;
-        } else if (member.isStatic != isStatic) {
-          return;
-        }
-        if (!isFirst) {
-          buffer.write(',');
-        }
-        buffer.write('\n');
-        indented;
-        serialize(member);
-        isFirst = false;
-      });
-    });
-  }
-
-  void visitScopeContainerElement(ScopeContainerElement e) {
-    bool isFirst = true;
-    serialize(e, omitEnclosing: false, serializeMembers: () {
-      e.forEachLocalMember((Element member) {
-        if (!isFirst) {
-          buffer.write(',');
-        }
-        buffer.write('\n');
-        indented;
-        serialize(member);
-        isFirst = false;
-      });
-    });
-  }
-
-  void visitCompilationUnitElement(CompilationUnitElement e) {
-    e.enclosingElement.accept(this);
-  }
-
-  void visitAbstractFieldElement(AbstractFieldElement e) {
-    throw new UnsupportedError('AbstractFieldElement cannot be serialized.');
-  }
-
-  void serialize(
-      Element element,
-      {bool omitEnclosing: true,
-       void serializeMembers(),
-       void serializeEnclosing(),
-       String kind,
-       String name}) {
-    if (element.isAbstractField) {
-      AbstractFieldElement field = element;
-      FunctionElement getter = field.getter;
-      FunctionElement setter = field.setter;
-      if (getter != null) {
-        serialize(
-            getter,
-            omitEnclosing: omitEnclosing,
-            serializeMembers: serializeMembers,
-            serializeEnclosing: serializeEnclosing,
-            kind: kind,
-            name: name);
-      }
-      if (setter != null) {
-        if (getter != null) {
-          buffer.write(',\n');
-          indented;
-        }
-        serialize(
-            getter,
-            omitEnclosing: omitEnclosing,
-            serializeMembers: serializeMembers,
-            serializeEnclosing: serializeEnclosing,
-            kind: kind,
-            name: name);
-      }
-      return;
-    }
-    DartType type;
-    int category = element.kind.category;
-    if (category == ElementCategory.FUNCTION ||
-        category == ElementCategory.VARIABLE ||
-        element.isConstructor) {
-      type = element.computeType(cachedCompiler);
-    }
-    if (name == null) {
-      name = element.name;
-    }
-    if (kind == null) {
-      kind = '${element.kind}';
-    }
-    buffer.write('{\n');
-    indentationLevel++;
-    if (name != '') {
-      indented
-          ..write('"name": "')
-          ..write(name)
-          ..write('",\n');
-    }
-    indented
-        ..write('"kind": "')
-        ..write(kind)
-        ..write('"');
-    if (type != null) {
-      buffer.write(',\n');
-      indented
-          ..write('"type": "')
-          ..write(type)
-          ..write('"');
-    }
-    if (serializeMembers != null) {
-      buffer.write(',\n');
-      indented.write('"members": [');
-      indentationLevel++;
-      serializeMembers();
-      indentationLevel--;
-      buffer.write('\n');
-      indented.write(']');
-    }
-    if (!omitEnclosing) {
-      buffer.write(',\n');
-      indented.write('"enclosing": ');
-      if (serializeEnclosing != null) {
-        serializeEnclosing();
-      } else {
-        element.enclosingElement.accept(this);
-      }
-    }
-    indentationLevel--;
-    buffer.write('\n');
-    indented.write('}');
-  }
-}
-
-modelx.ScopeX localScope(modelx.LibraryElementX element) => element.localScope;
-
-modelx.ImportScope importScope(modelx.LibraryElementX element) {
-  return element.importScope;
-}
-
 class PoiTask extends CompilerTask {
   PoiTask(Compiler compiler) : super(compiler);
 
diff --git a/site/try/poi/scope_information_visitor.dart b/site/try/poi/scope_information_visitor.dart
new file mode 100644
index 0000000..9db8969
--- /dev/null
+++ b/site/try/poi/scope_information_visitor.dart
@@ -0,0 +1,305 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library trydart.poi.scope_information_visitor;
+
+import 'package:compiler/src/elements/modelx.dart' as modelx;
+
+import 'package:compiler/src/elements/modelx.dart' show
+    CompilationUnitElementX,
+    FieldElementX;
+
+import 'package:compiler/src/elements/visitor.dart' show
+    ElementVisitor;
+
+import 'package:compiler/src/dart2jslib.dart' show
+    Compiler;
+
+import 'package:compiler/src/elements/elements.dart' show
+    AbstractFieldElement,
+    ClassElement,
+    CompilationUnitElement,
+    Element,
+    ElementCategory,
+    FunctionElement,
+    LibraryElement,
+    ScopeContainerElement;
+
+import 'package:compiler/src/dart_types.dart' show
+    DartType;
+
+/**
+ * Serializes scope information about an element. This is accomplished by
+ * calling the [serialize] method on each element. Some elements need special
+ * treatment, as their enclosing scope must also be serialized.
+ */
+class ScopeInformationVisitor extends ElementVisitor/* <void> */ {
+  // TODO(ahe): Include function parameters and local variables.
+
+  final Compiler compiler;
+  final Element currentElement;
+  final int position;
+  final StringBuffer buffer = new StringBuffer();
+  int indentationLevel = 0;
+  ClassElement currentClass;
+
+  bool sortMembers = false;
+
+  bool ignoreImports = false;
+
+  ScopeInformationVisitor(this.compiler, this.currentElement, this.position);
+
+  String get indentation => '  ' * indentationLevel;
+
+  StringBuffer get indented => buffer..write(indentation);
+
+  void visitElement(Element e) {
+    serialize(e, omitEnclosing: false);
+  }
+
+  void visitLibraryElement(LibraryElement e) {
+    bool isFirst = true;
+    forEach(Element member) {
+      if (!isFirst) {
+        buffer.write(',');
+      }
+      buffer.write('\n');
+      indented;
+      serialize(member);
+      isFirst = false;
+    }
+    serialize(
+        e,
+        // TODO(ahe): We omit the import scope if there is no current
+        // class. That's wrong.
+        omitEnclosing: ignoreImports || currentClass == null,
+        name: e.getLibraryName(),
+        serializeEnclosing: () {
+          // The enclosing scope of a library is a scope which contains all the
+          // imported names.
+          isFirst = true;
+          buffer.write('{\n');
+          indentationLevel++;
+          indented.write('"kind": "imports",\n');
+          indented.write('"members": [');
+          indentationLevel++;
+          sortElements(importScope(e).importScope.values).forEach(forEach);
+          indentationLevel--;
+          buffer.write('\n');
+          indented.write('],\n');
+          // The enclosing scope of the imported names scope is the superclass
+          // scope of the current class.
+          indented.write('"enclosing": ');
+          serializeClassSide(
+              currentClass.superclass, isStatic: false, includeSuper: true);
+          buffer.write('\n');
+          indentationLevel--;
+          indented.write('}');
+        },
+        serializeMembers: () {
+          isFirst = true;
+          sortElements(localScope(e).values).forEach(forEach);
+        });
+  }
+
+  void visitClassElement(ClassElement e) {
+    currentClass = e;
+    serializeClassSide(e, isStatic: true);
+  }
+
+  /// Serializes one of the "sides" a class. The sides of a class are "instance
+  /// side" and "class side". These terms are from Smalltalk. The instance side
+  /// is all the local instance members of the class (the members of the
+  /// mixin), and the class side is the equivalent for static members and
+  /// constructors.
+  /// The scope chain is ordered so that the "class side" is searched before
+  /// the "instance side".
+  void serializeClassSide(
+      ClassElement e,
+      {bool isStatic: false,
+       bool omitEnclosing: false,
+       bool includeSuper: false}) {
+    e.ensureResolved(compiler);
+    bool isFirst = true;
+    var serializeEnclosing;
+    String kind;
+    if (isStatic) {
+      kind = 'class side';
+      serializeEnclosing = () {
+        serializeClassSide(e, isStatic: false, omitEnclosing: omitEnclosing);
+      };
+    } else {
+      kind = 'instance side';
+    }
+    if (includeSuper) {
+      assert(!omitEnclosing && !isStatic);
+      if (e.superclass == null) {
+        omitEnclosing = true;
+      } else {
+        // Members of the superclass are represented as a separate scope.
+        serializeEnclosing = () {
+          serializeClassSide(
+              e.superclass, isStatic: false, omitEnclosing: false,
+              includeSuper: true);
+        };
+      }
+    }
+    serialize(
+        e, omitEnclosing: omitEnclosing, serializeEnclosing: serializeEnclosing,
+        kind: kind, serializeMembers: () {
+      localMembersSorted(e).forEach((Element member) {
+        // Filter out members that don't belong to this "side".
+        if (member.isConstructor) {
+          // In dart2js, some constructors aren't static, but that isn't
+          // convenient here.
+          if (!isStatic) return;
+        } else if (member.isStatic != isStatic) {
+          return;
+        }
+        if (!isFirst) {
+          buffer.write(',');
+        }
+        buffer.write('\n');
+        indented;
+        serialize(member);
+        isFirst = false;
+      });
+    });
+  }
+
+  void visitScopeContainerElement(ScopeContainerElement e) {
+    bool isFirst = true;
+    serialize(e, omitEnclosing: false, serializeMembers: () {
+      localMembersSorted(e).forEach((Element member) {
+        if (!isFirst) {
+          buffer.write(',');
+        }
+        buffer.write('\n');
+        indented;
+        serialize(member);
+        isFirst = false;
+      });
+    });
+  }
+
+  void visitCompilationUnitElement(CompilationUnitElement e) {
+    e.enclosingElement.accept(this);
+  }
+
+  void visitAbstractFieldElement(AbstractFieldElement e) {
+    throw new UnsupportedError('AbstractFieldElement cannot be serialized.');
+  }
+
+  void serialize(
+      Element element,
+      {bool omitEnclosing: true,
+       void serializeMembers(),
+       void serializeEnclosing(),
+       String kind,
+       String name}) {
+    if (element.isAbstractField) {
+      AbstractFieldElement field = element;
+      FunctionElement getter = field.getter;
+      FunctionElement setter = field.setter;
+      if (getter != null) {
+        serialize(
+            getter,
+            omitEnclosing: omitEnclosing,
+            serializeMembers: serializeMembers,
+            serializeEnclosing: serializeEnclosing,
+            kind: kind,
+            name: name);
+      }
+      if (setter != null) {
+        if (getter != null) {
+          buffer.write(',\n');
+          indented;
+        }
+        serialize(
+            getter,
+            omitEnclosing: omitEnclosing,
+            serializeMembers: serializeMembers,
+            serializeEnclosing: serializeEnclosing,
+            kind: kind,
+            name: name);
+      }
+      return;
+    }
+    DartType type;
+    int category = element.kind.category;
+    if (category == ElementCategory.FUNCTION ||
+        category == ElementCategory.VARIABLE ||
+        element.isConstructor) {
+      type = element.computeType(compiler);
+    }
+    if (name == null) {
+      name = element.name;
+    }
+    if (kind == null) {
+      kind = '${element.kind}';
+    }
+    buffer.write('{\n');
+    indentationLevel++;
+    if (name != '') {
+      indented
+          ..write('"name": "')
+          ..write(name)
+          ..write('",\n');
+    }
+    indented
+        ..write('"kind": "')
+        ..write(kind)
+        ..write('"');
+    if (type != null) {
+      buffer.write(',\n');
+      indented
+          ..write('"type": "')
+          ..write(type)
+          ..write('"');
+    }
+    if (serializeMembers != null) {
+      buffer.write(',\n');
+      indented.write('"members": [');
+      indentationLevel++;
+      serializeMembers();
+      indentationLevel--;
+      buffer.write('\n');
+      indented.write(']');
+    }
+    if (!omitEnclosing) {
+      buffer.write(',\n');
+      indented.write('"enclosing": ');
+      if (serializeEnclosing != null) {
+        serializeEnclosing();
+      } else {
+        element.enclosingElement.accept(this);
+      }
+    }
+    indentationLevel--;
+    buffer.write('\n');
+    indented.write('}');
+  }
+
+  List<Element> localMembersSorted(ScopeContainerElement element) {
+    List<Element> result = <Element>[];
+    element.forEachLocalMember((Element member) {
+      result.add(member);
+    });
+    return sortElements(result);
+  }
+
+  List<Element> sortElements(Iterable<Element> elements) {
+    List<Element> result = new List<Element>.from(elements);
+    if (sortMembers) {
+      result.sort((Element a, Element b) => a.name.compareTo(b.name));
+    }
+    return result;
+  }
+}
+
+modelx.ScopeX localScope(modelx.LibraryElementX element) => element.localScope;
+
+modelx.ImportScope importScope(modelx.LibraryElementX element) {
+  return element.importScope;
+}
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 02ccf9f..5553cf7 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -22,6 +22,8 @@
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t02: fail # 13363
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A12_t02: fail # 13363
 
+LibTest/core/Function/apply_A01_t01: RuntimeError # Issue 21673
+
 
 Language/13_Statements/04_Local_Function_Declaration_A04_t01: Fail, MissingCompileTimeError # co19-roll r607: Please triage this failure
 
@@ -40,7 +42,6 @@
 
 Language/03_Overview/1_Scoping_A02_t05: Fail # Inherited from dart2js
 Language/03_Overview/1_Scoping_A02_t06: Fail # inherited from dart2js
-Language/06_Functions/4_External_Functions_A01_t01: Fail # inherited from VM
 Language/07_Classes/3_Setters_A04_t01: Fail # inherited from VM
 Language/07_Classes/3_Setters_A04_t02: Fail # inherited from VM
 Language/07_Classes/3_Setters_A04_t07: Fail # inherited from VM
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index baab387..9660f1f 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -7,6 +7,9 @@
 
 [ $compiler == none && $runtime == dartium && $system == macos ]
 LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots
+LayoutTests/fast/css-generated-content/pseudo-animation-before-onload_t01: Skip # Depends on animation timing, commented as known to be flaky in test.  Will not fix.
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
+LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Pass, RuntimeError # Issue 21605
 
 [ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
 LayoutTests/fast/canvas/canvas-lineDash-input-sequence_t01: Skip # Issue 20867
@@ -795,6 +798,7 @@
 LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
 LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
 LayoutTests/fast/dom/text-api-arguments_t01: RuntimeError # Re-enable fast/dom tests: Please triage this failure.
+Language/14_Libraries_and_Scripts/3_Parts_A01_t05: Skip # Times out flakily. Issue 20881
 
 [ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid ) && $checked ]
 # New Dartium checked failures on new co19 browser tests in co19 revision 706.
@@ -876,7 +880,6 @@
 LibTest/html/Element/getBoundingClientRect_A01_t02: RuntimeError # Issue 19127.
 LibTest/html/Window/animationFrame_A01_t01: Skip # Times out. co19-roll r786: Please triage this failure.
 LibTest/math/log_A01_t01: Pass, Fail # co19 issue 44.
-Language/14_Libraries_and_Scripts/3_Parts_A01_t05: Skip # Times out flakily. Issue 20881
 LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: RuntimeError # co19-roll r761: Please triage this failure.
 LayoutTests/fast/canvas/canvas-scale-drawImage-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
 LayoutTests/fast/canvas/canvas-scale-fillPath-shadow_t01: RuntimeError, Pass # co19-roll r761: Please triage this failure.
diff --git a/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart b/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
index 0861957..d1f4e5c 100644
--- a/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
@@ -34,7 +34,7 @@
     compiler.processQueue(compiler.enqueuer.resolution, element);
     compiler.world.populate();
     compiler.backend.onResolutionComplete();
-    compiler.irBuilder.buildNodes(useNewBackend: true);
+    compiler.irBuilder.buildNodes();
     compiler.phase = Compiler.PHASE_COMPILING;
     DartBackend backend = compiler.backend;
     backend.assembleProgram();
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index b414c7f..56315ad 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -39,6 +39,10 @@
   ExecutableElement get executableContext => null;
 }
 
+// TODO(karlklose): we should remove all references to [ErroneousElement] from
+// the CPS IR.  Instead, the builder must construct appropriate terms for ASTs
+// that could not be resolved correctly.  Perhaps the IR should not rely on
+// elements at all for naming.
 /// Used whenever a node constructed by [SExpressionUnstringifier] requires
 /// an [Element] or [FunctionElement]. Extends [ErroneousElementX] since there
 /// is currently a large amount of overhead when extending the base abstract
diff --git a/tests/compiler/dart2js/backend_dart/test_helper.dart b/tests/compiler/dart2js/backend_dart/test_helper.dart
index 52d6aec..60cca7b 100644
--- a/tests/compiler/dart2js/backend_dart/test_helper.dart
+++ b/tests/compiler/dart2js/backend_dart/test_helper.dart
@@ -31,7 +31,7 @@
     compiler.world.populate();

     compiler.backend.onResolutionComplete();

 

-    compiler.irBuilder.buildNodes(useNewBackend: true);

+    compiler.irBuilder.buildNodes();

 

     return compiler;

   });

diff --git a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
index 6ece06e..d397aba 100644
--- a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
+++ b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
@@ -52,8 +52,10 @@
   asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
     String mainOutput = outputs['main.js'].mem[0];
     String deferredOutput = outputs['out_1.part.js'].mem[0];
-    RegExp re = new RegExp(r"\n  _ = .\.A;\n  _.\$isA = TRUE;");
-    print(deferredOutput);
+    String isPrefix = compiler.backend.namer.operatorIsPrefix;
+    String escapedIsPrefix = isPrefix.replaceAll(r'$', r'\$');
+    RegExp re = new RegExp(r"\n  _ = .\.A;\n  _."
+                            "${escapedIsPrefix}A = TRUE;");
     Expect.isTrue(re.hasMatch(deferredOutput));
     Expect.isFalse(re.hasMatch(mainOutput));
   }));
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_basic.dart b/tests/compiler/dart2js/js_backend_cps_ir_basic.dart
new file mode 100644
index 0000000..1455f5b
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_basic.dart
@@ -0,0 +1,97 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests for basic functionality.
+
+library basic_tests;
+
+import 'js_backend_cps_ir_test.dart';
+
+const List<TestEntry> tests = const [
+  const TestEntry("""
+foo(a, [b = "b"]) => b;
+bar(a, {b: "b", c: "c"}) => c;
+main() {
+  foo(0);
+  foo(0, 1);
+  bar(0);
+  bar(0, b: 1);
+  bar(0, c: 1);
+  bar(0, b: 1, c: 2);
+}
+""",
+"""
+function() {
+  V.foo(0, "b");
+  V.foo(0, 1);
+  V.bar(0, "b", "c");
+  V.bar(0, 1, "c");
+  V.bar(0, "b", 1);
+  V.bar(0, 1, 2);
+  return null;
+}"""),
+  const TestEntry(
+  """
+foo(a) {
+  return a;
+}
+main() {
+  var a = 10;
+  var b = 1;
+  var t;
+  t = a;
+  a = b;
+  b = t;
+  print(a);
+  print(b);
+  print(b);
+  print(foo(a));
+}
+  """,
+  """
+function() {
+  var a, b;
+  a = 10;
+  b = 1;
+  P.print(b);
+  P.print(a);
+  P.print(a);
+  P.print(V.foo(b));
+  return null;
+}"""),
+  const TestEntry(
+  """
+foo() { return 42; }
+main() { return foo(); }
+  """,
+  """function() {
+  return V.foo();
+}"""),
+  const TestEntry("main() {}"),
+  const TestEntry("main() { return 42; }"),
+  const TestEntry("main() { return; }", """
+function() {
+  return null;
+}"""),
+  // Constructor invocation
+  const TestEntry("""
+main() {
+  print(new Set());
+  print(new Set.from([1, 2, 3]));
+}""", r"""
+function() {
+  P.print(P.Set_Set());
+  P.print(P.Set_Set$from([1, 2, 3]));
+  return null;
+}"""),
+  // Method invocation
+  const TestEntry("""
+main() {
+  print(new DateTime.now().isBefore(new DateTime.now()));
+}""", r"""
+function() {
+  P.print(P.DateTime$now().isBefore$1(P.DateTime$now()));
+  return null;
+}"""),
+];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
new file mode 100644
index 0000000..746735b
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
@@ -0,0 +1,126 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of control flow statements.
+
+library control_flow_tests;
+
+import 'js_backend_cps_ir_test.dart';
+
+const List<TestEntry> tests = const [
+  const TestEntry("""
+main() {
+  while (true);
+}
+""", """
+function() {
+  while (true)
+    ;
+}"""),
+  const TestEntry("""
+foo(a) => a;
+
+main() {
+  while (true) {
+    l: while (true) {
+      while (foo(true)) {
+        if (foo(false)) break l;
+      }
+      print(1);
+    }
+    print(2);
+  }
+}
+""", """
+function() {
+  L0:
+    while (true)
+      while (true) {
+        while (P.identical(V.foo(true), true))
+          if (P.identical(V.foo(false), true)) {
+            P.print(2);
+            continue L0;
+          }
+        P.print(1);
+      }
+}"""),
+  const TestEntry("""
+foo(a) => a;
+
+main() {
+  for (int i = 0; foo(true); i = foo(i)) {
+    print(1);
+    if (foo(false)) break;
+  }
+  print(2);
+}""", """
+function() {
+  var i;
+  i = 0;
+  L1:
+    while (true) {
+      if (P.identical(V.foo(true), true)) {
+        P.print(1);
+        if (!P.identical(V.foo(false), true)) {
+          i = V.foo(i);
+          continue L1;
+        }
+      }
+      P.print(2);
+      return null;
+    }
+}"""),
+const TestEntry("""
+foo(a) => a;
+
+main() {
+ if (foo(true)) {
+   print(1);
+ } else {
+   print(2);
+ }
+ print(3);
+}""", """
+function() {
+  P.identical(V.foo(true), true) ? P.print(1) : P.print(2);
+  P.print(3);
+  return null;
+}"""),
+const TestEntry("""
+foo(a) => a;
+
+main() {
+ if (foo(true)) {
+   print(1);
+   print(1);
+ } else {
+   print(2);
+   print(2);
+ }
+ print(3);
+}""", """
+function() {
+  if (P.identical(V.foo(true), true)) {
+    P.print(1);
+    P.print(1);
+  } else {
+    P.print(2);
+    P.print(2);
+  }
+  P.print(3);
+  return null;
+}"""),
+const TestEntry("""
+main() {
+  if (1) {
+    print('bad');
+  } else {
+    print('ok');
+  }
+}""","""
+function() {
+  P.print("bad");
+  return null;
+}"""),
+];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_literals.dart b/tests/compiler/dart2js/js_backend_cps_ir_literals.dart
new file mode 100644
index 0000000..02cfefe
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_literals.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of literals.
+
+library literals_tests;
+
+import 'js_backend_cps_ir_test.dart';
+
+const List<TestEntry> tests = const [
+  const TestEntry("""
+main() {
+  print([]);
+  print([1]);
+  print([1, 2]);
+  print([1, [1, 2]]);
+  print({});
+  print({1: 2});
+  print({[1, 2]: [3, 4]});
+}
+""",
+r"""
+function() {
+  P.print([]);
+  P.print([1]);
+  P.print([1, 2]);
+  P.print([1, [1, 2]]);
+  P.print(P.LinkedHashMap_LinkedHashMap$_empty());
+  P.print(P.LinkedHashMap_LinkedHashMap$_literal([1, 2]));
+  P.print(P.LinkedHashMap_LinkedHashMap$_literal([[1, 2], [3, 4]]));
+  return null;
+}"""),
+];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators.dart
new file mode 100644
index 0000000..3cdcf9b
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests of operators.
+
+library operators_tests;
+
+import 'js_backend_cps_ir_test.dart';
+
+const List<TestEntry> tests = const [
+  const TestEntry("main() { return true ? 42 : 'foo'; }"),
+  const TestEntry("""
+foo() => foo;
+main() {
+  print(foo() ? "hello world" : "bad bad");
+}""",
+"""function() {
+  P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad");
+  return null;
+}"""),
+  const TestEntry("""
+get foo => foo;
+main() {
+  print(foo ? "hello world" : "bad bad");
+}""",
+"""function() {
+  P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad");
+  return null;
+}"""),
+  const TestEntry("""
+get foo => foo;
+main() { print(foo && foo); }""",
+"""function() {
+  P.print(P.identical(V.foo(), true) && P.identical(V.foo(), true));
+  return null;
+}"""),
+  const TestEntry("""
+get foo => foo;
+main() { print(foo || foo); }""",
+"""function() {
+  P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true));
+  return null;
+}"""),
+];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_test.dart
new file mode 100644
index 0000000..030b214
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_test.dart
@@ -0,0 +1,71 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=-DUSE_CPS_IR=true
+
+// Test that the CPS IR code generator compiles programs and produces the
+// the expected output.
+
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'package:compiler/src/apiimpl.dart'
+       show Compiler;
+import 'memory_compiler.dart';
+import 'package:compiler/src/js/js.dart' as js;
+import 'package:compiler/src/common.dart' show Element;
+
+import 'js_backend_cps_ir_basic.dart' as basic;
+import 'js_backend_cps_ir_literals.dart' as literals;
+import 'js_backend_cps_ir_operators.dart' as operators;
+import 'js_backend_cps_ir_control_flow.dart' as control_flow;
+
+const String TEST_MAIN_FILE = 'test.dart';
+
+List<TestEntry> tests = <TestEntry>[]
+     ..addAll(basic.tests)
+     ..addAll(literals.tests)
+     ..addAll(control_flow.tests)
+     ..addAll(operators.tests);
+
+class TestEntry {
+  final String source;
+  final String expectation;
+  const TestEntry(this.source, [this.expectation]);
+}
+
+String formatTest(Map test) {
+  return test[TEST_MAIN_FILE];
+}
+
+String getCodeForMain(Compiler compiler) {
+  Element mainFunction = compiler.mainFunction;
+  js.Node ast = compiler.enqueuer.codegen.generatedCode[mainFunction];
+  return js.prettyPrint(ast, compiler).getText();
+}
+
+main() {
+  Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
+
+  for (TestEntry test in tests) {
+    Map files = {TEST_MAIN_FILE: test.source};
+    asyncTest(() {
+      Compiler compiler = compilerFor(files);
+      Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
+      return compiler.run(uri).then((_) {
+        Expect.isNotNull(compiler.assembledCode);
+        String expectation = test.expectation;
+        if (expectation != null) {
+          String expected = test.expectation;
+          String found = getCodeForMain(compiler);
+          if (expected != found) {
+            Expect.fail('Expected:\n$expected\nbut found\n$found');
+          }
+        }
+      }).catchError((e) {
+        print(e);
+        Expect.fail('The following test failed to compile:\n'
+                    '${formatTest(files)}');
+      });
+    });
+  }
+}
diff --git a/tests/compiler/dart2js/link_test.dart b/tests/compiler/dart2js/link_test.dart
index a2c2122..5ee61e4 100644
--- a/tests/compiler/dart2js/link_test.dart
+++ b/tests/compiler/dart2js/link_test.dart
@@ -21,6 +21,8 @@
   testFromList([0, 1, 2, 3, 4]);
   testFromList([0, 1, 2, 3, 4, 5]);
   testSkip();
+
+  testCopyWithout();
 }
 
 testFromList(List list) {
@@ -61,3 +63,14 @@
   Expect.isTrue(emptyLink.skip(0).isEmpty);
   Expect.throws(() => emptyLink.skip(1), (e) => e is RangeError);
 }
+
+testCopyWithout() {
+  test(const Link().copyWithout(0), []);
+
+  test(LinkFromList([0]).copyWithout(0), []);
+  test(LinkFromList([0, 1]).copyWithout(0), [1]);
+  test(LinkFromList([0, 1, 2]).copyWithout(0), [1, 2]);
+  test(LinkFromList([0, 1, 2]).copyWithout(1), [0, 2]);
+  test(LinkFromList([0, 1, 2]).copyWithout(2), [0, 1]);
+  test(LinkFromList([0, 1, 2]).copyWithout(3), [0, 1, 2]);
+}
diff --git a/tests/compiler/dart2js/type_representation_test.dart b/tests/compiler/dart2js/type_representation_test.dart
index 7bd7f3c..4f63420 100644
--- a/tests/compiler/dart2js/type_representation_test.dart
+++ b/tests/compiler/dart2js/type_representation_test.dart
@@ -78,12 +78,13 @@
     }
 
     JavaScriptBackend backend = env.compiler.backend;
-    String func = backend.namer.functionTypeTag();
-    String retvoid = backend.namer.functionTypeVoidReturnTag();
-    String ret = backend.namer.functionTypeReturnTypeTag();
-    String args = backend.namer.functionTypeRequiredParametersTag();
-    String opt = backend.namer.functionTypeOptionalParametersTag();
-    String named = backend.namer.functionTypeNamedParametersTag();
+    String func = backend.namer.functionTypeTag;
+    String retvoid = backend.namer.functionTypeVoidReturnTag;
+    String ret = backend.namer.functionTypeReturnTypeTag;
+    String args = backend.namer.functionTypeRequiredParametersTag;
+    String opt = backend.namer.functionTypeOptionalParametersTag;
+    String named = backend.namer.functionTypeNamedParametersTag;
+    String typedefTag = backend.namer.typedefTag;
 
     ClassElement List_ = env.getElement('List');
     TypeVariableType List_E = List_.typeVariables[0];
@@ -142,52 +143,55 @@
     // List<Typedef>
     expect(instantiate(List_, [Typedef_]),
         '[$List_rep, {$func: "void_", $retvoid: true}]',
-        '[$List_rep, {$func: "void_", $retvoid: true, typedef: $Typedef_rep}]');
+        '[$List_rep, {$func: "void_", $retvoid: true,'
+          ' $typedefTag: $Typedef_rep}]');
     expect(instantiate(List_, [Typedef2_]),
         '[$List_rep, {$func: "int_", $ret: $int_rep}]',
-        '[$List_rep, {$func: "int_", $ret: $int_rep, typedef: $Typedef2_rep}]');
+        '[$List_rep, {$func: "int_", $ret: $int_rep,'
+          ' $typedefTag: $Typedef2_rep}]');
     expect(instantiate(List_, [Typedef3_]),
         '[$List_rep, {$func: "List_", $ret: [$List_rep, $int_rep]}]',
         '[$List_rep, {$func: "List_", $ret: [$List_rep, $int_rep],'
-          ' typedef: $Typedef3_rep}]');
+          ' $typedefTag: $Typedef3_rep}]');
     expect(instantiate(List_, [Typedef4_]),
         '[$List_rep, {$func: "args0"}]',
-        '[$List_rep, {$func: "args0", typedef: $Typedef4_rep}]');
+        '[$List_rep, {$func: "args0", $typedefTag: $Typedef4_rep}]');
     expect(instantiate(List_, [Typedef5_]),
         '[$List_rep, {$func: "dynamic__int_String",'
           ' $args: [$int_rep, $String_rep]}]',
         '[$List_rep, {$func: "dynamic__int_String",'
-          ' $args: [$int_rep, $String_rep], typedef: $Typedef5_rep}]');
+          ' $args: [$int_rep, $String_rep], $typedefTag: $Typedef5_rep}]');
     expect(instantiate(List_, [Typedef6_]),
         '[$List_rep, {$func: "dynamic__int__String",'
           ' $args: [$int_rep], $opt: [$String_rep]}]',
         '[$List_rep, {$func: "dynamic__int__String",'
-          ' $args: [$int_rep], $opt: [$String_rep], typedef: $Typedef6_rep}]');
+          ' $args: [$int_rep], $opt: [$String_rep],'
+          ' $typedefTag: $Typedef6_rep}]');
     expect(instantiate(List_, [Typedef7_]),
         '[$List_rep, {$func: "dynamic__int_String__List_dynamic", $args: '
           '[$int_rep, $String_rep], $opt: [[$List_rep, $int_rep], null]}]',
         '[$List_rep, {$func: "dynamic__int_String__List_dynamic", $args: '
           '[$int_rep, $String_rep], $opt: [[$List_rep, $int_rep], null], '
-          'typedef: $Typedef7_rep}]');
+          '$typedefTag: $Typedef7_rep}]');
     expect(instantiate(List_, [Typedef8_]),
         '[$List_rep, {$func: "dynamic__int__String0", $args: [$int_rep],'
           ' $named: {b: $String_rep}}]',
         '[$List_rep, {$func: "dynamic__int__String0", $args: [$int_rep],'
-          ' $named: {b: $String_rep}, typedef: $Typedef8_rep}]');
+          ' $named: {b: $String_rep}, $typedefTag: $Typedef8_rep}]');
     expect(instantiate(List_, [Typedef9_]),
         '[$List_rep, {$func: "dynamic__int_String__List_dynamic0", '
           '$args: [$int_rep, $String_rep], $named: '
           '{c: [$List_rep, $int_rep], d: null}}]',
         '[$List_rep, {$func: "dynamic__int_String__List_dynamic0", '
           '$args: [$int_rep, $String_rep], $named: {c: [$List_rep, $int_rep],'
-          ' d: null}, typedef: $Typedef9_rep}]');
+          ' d: null}, $typedefTag: $Typedef9_rep}]');
     expect(instantiate(List_, [Typedef10_]),
         '[$List_rep, {$func: "dynamic__void__int__dynamic", '
           '$args: [{$func: "void__int__dynamic", $retvoid: true, '
           '$args: [$int_rep], $opt: [null]}]}]',
         '[$List_rep, {$func: "dynamic__void__int__dynamic", '
           '$args: [{$func: "void__int__dynamic", $retvoid: true, '
-          '$args: [$int_rep], $opt: [null]}], typedef: $Typedef10_rep}]');
+          '$args: [$int_rep], $opt: [null]}], $typedefTag: $Typedef10_rep}]');
 
     // Map<K,V>
     expect(Map_.computeType(env.compiler),
@@ -250,5 +254,3 @@
            ' $retvoid: true, $args: [$int_rep], $opt: [null]}]}');
   }));
 }
-
-
diff --git a/tests/compiler/dart2js_extra/21666_test.dart b/tests/compiler/dart2js_extra/21666_test.dart
new file mode 100644
index 0000000..ceb147a
--- /dev/null
+++ b/tests/compiler/dart2js_extra/21666_test.dart
@@ -0,0 +1,86 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+// Regression test for issue 21666 - problems with method that has super calls.
+//
+// Use a method and getter with super calls in various ways.
+
+import 'package:expect/expect.dart';
+
+@MirrorsUsed(targets: const [A, B, Object])
+import 'dart:mirrors';
+
+class X { const X(); }
+class Y { const Y(); }
+
+typedef fInt(int x);
+typedef fString(String x);
+
+class A {
+  @X()
+  foo(int x) => x + 1;
+  int get bar => A.g;
+
+  static int g = 0;
+}
+
+class B extends A {
+  @Y()
+  foo(int x) => 100 * super.foo(x);
+  int get bar => 1000 * super.bar;
+}
+
+String dump(ClassMirror cm) {
+  var sb = new StringBuffer();
+  sb.write('$cm\n');
+  for (var mm in cm.declarations.values) {
+    sb.write('  $mm\n');
+    // Walking declaration metadata triggers issue 21666.
+    for (var a in mm.metadata) {
+      sb.write('    $a\n');
+    }
+  }
+  print(sb);
+  return '$sb';
+}
+
+main() {
+  var cmB = reflectClass(B);
+  var cmBdump = dump(cmB);
+  var cmAdump = dump(cmB.superclass);
+
+  Expect.equals(dump(reflectClass(A)), cmAdump);
+  Expect.isTrue(cmAdump.contains("'foo'"));
+  Expect.isTrue(cmAdump.contains("'bar'"));
+  Expect.isTrue(cmBdump.contains("'foo'"));
+  Expect.isTrue(cmBdump.contains("'bar'"));
+
+  A.g = 123;
+  var a = new A();
+  var am = reflect(a);
+  var agfoo = am.getField(#foo);
+  var agbar = am.getField(#bar);
+
+  Expect.equals(3, agfoo.reflectee(2));
+  Expect.equals(4, am.invoke(#foo, [3]).reflectee);
+  Expect.equals(123, agbar.reflectee);
+  Expect.isTrue(a.foo is fInt);
+  Expect.isTrue(a.foo is! fString);
+  Expect.isTrue(agfoo.reflectee is fInt);
+  Expect.isTrue(agfoo.reflectee is! fString);
+
+  var b = new B();
+  var bm = reflect(b);
+  var bgfoo = bm.getField(#foo);
+  var bgbar = bm.getField(#bar);
+
+  Expect.equals(300, bgfoo.reflectee(2));
+  Expect.equals(400, bm.invoke(#foo, [3]).reflectee);
+  Expect.equals(123000, bgbar.reflectee);
+  Expect.isTrue(b.foo is fInt);
+  Expect.isTrue(b.foo is! fString);
+  Expect.isTrue(bgfoo.reflectee is fInt);
+  Expect.isTrue(bgfoo.reflectee is! fString);
+}
diff --git a/tests/compiler/dart2js_extra/many_fields_test.dart b/tests/compiler/dart2js_extra/many_fields_test.dart
new file mode 100644
index 0000000..559238f
--- /dev/null
+++ b/tests/compiler/dart2js_extra/many_fields_test.dart
@@ -0,0 +1,192 @@
+// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+// A plain class that implements many fields.
+class A {
+  var fieldA1 = 0x1;
+  var fieldA2 = 0x2;
+  var fieldA3 = 0x4;
+  var fieldA4 = 0x8;
+
+  var fieldB1 = 0x10;
+  var fieldB2 = 0x20;
+  var fieldB3 = 0x40;
+  var fieldB4 = 0x80;
+
+  var fieldC1 = 0x100;
+  var fieldC2 = 0x200;
+  var fieldC3 = 0x400;
+  var fieldC4 = 0x800;
+
+  var fieldD1 = 0x1000;
+  var fieldD2 = 0x2000;
+  var fieldD3 = 0x4000;
+  var fieldD4 = 0x8000;
+  
+  var fieldXA1 = 0x1;
+  var fieldXA2 = 0x2;
+  var fieldXA3 = 0x4;
+  var fieldXA4 = 0x8;
+
+  var fieldXB1 = 0x10;
+  var fieldXB2 = 0x20;
+  var fieldXB3 = 0x40;
+  var fieldXB4 = 0x80;
+
+  var fieldXC1 = 0x1;
+  var fieldXC2 = 0x2;
+  var fieldXC3 = 0x4;
+  var fieldXC4 = 0x8;
+
+  var fieldXD1 = 0x10;
+  var fieldXD2 = 0x20;
+  var fieldXD3 = 0x40;
+  var fieldXD4 = 0x80;
+  
+  var fieldYA1 = 0x1;
+  var fieldYA2 = 0x200;
+  var fieldYA3 = 0x400;
+  var fieldYA4 = 0x800;
+
+  var fieldYB1 = 0x10;
+  var fieldYB2 = 0x200;
+  var fieldYB3 = 0x400;
+  var fieldYB4 = 0x800;
+
+  var fieldYC1 = 0x100;
+  var fieldYC2 = 0x2000;
+  var fieldYC3 = 0x4000;
+  var fieldYC4 = 0x8000;
+
+  var fieldYD1 = 0x1000;
+  var fieldYD2 = 0x2000;
+  var fieldYD3 = 0x4000;
+  var fieldYD4 = 0x8000;
+}
+
+// Implementing the same fields using inheritance and a mixin.
+class B {
+  var fieldA1 = 0x0011;
+  var fieldA2 = 0x0002;
+  var fieldA3 = 0x0044;
+  var fieldA4 = 0x0008;
+
+  var fieldB1 = 0x0010;
+  var fieldB2 = 0x0220;
+  var fieldB3 = 0x0040;
+  var fieldB4 = 0x0880;
+
+  var fieldC1 = 0x0101;
+  var fieldC2 = 0x0200;
+  var fieldC3 = 0x0404;
+  var fieldC4 = 0x0810;
+
+  var fieldD1 = 0x1000;
+  var fieldD2 = 0x2204;
+  var fieldD3 = 0x4040;
+  var fieldD4 = 0x8801;
+}
+
+class C {
+  var fieldXA1 = 0x8001;
+  var fieldXA2 = 0x4002;
+  var fieldXA3 = 0x2004;
+  var fieldXA4 = 0x1008;
+
+  var fieldXB1 = 0x810;
+  var fieldXB2 = 0x420;
+  var fieldXB3 = 0x240;
+  var fieldXB4 = 0x180;
+
+  var fieldXC1 = 0x180;
+  var fieldXC2 = 0x240;
+  var fieldXC3 = 0x420;
+  var fieldXC4 = 0x810;
+
+  var fieldXD1 = 0x1008;
+  var fieldXD2 = 0x2004;
+  var fieldXD3 = 0x4002;
+  var fieldXD4 = 0x8001;
+}
+
+class D extends B with C {
+  var fieldYA1 = 0x8001;
+  var fieldYA2 = 0x4002;
+  var fieldYA3 = 0x2004;
+  var fieldYA4 = 0x0008;
+
+  var fieldYB1 = 0x810;
+  var fieldYB2 = 0x420;
+  var fieldYB3 = 0x240;
+  var fieldYB4 = 0x080;
+
+  var fieldYC1 = 0x180;
+  var fieldYC2 = 0x240;
+  var fieldYC3 = 0x420;
+  var fieldYC4 = 0x800;
+
+  var fieldYD1 = 0x1008;
+  var fieldYD2 = 0x2004;
+  var fieldYD3 = 0x4002;
+  var fieldYD4 = 0x8000;
+}
+
+// Mix in the mixin into the full implementation, shadowing some fields.
+class E extends A with C {
+}
+
+// Another mixin for block C.
+class F {
+  var fieldYA1 = 0x0001;
+  var fieldYA2 = 0x1022;
+  var fieldYA3 = 0x0004;
+  var fieldYA4 = 0x0088;
+
+  var fieldYB1 = 0x0410;
+  var fieldYB2 = 0x0022;
+  var fieldYB3 = 0x0040;
+  var fieldYB4 = 0x0880;
+
+  var fieldYC1 = 0x1001;
+  var fieldYC2 = 0x2200;
+  var fieldYC3 = 0x4400;
+  var fieldYC4 = 0x8800;
+
+  var fieldYD1 = 0x1108;
+  var fieldYD2 = 0x2200;
+  var fieldYD3 = 0x4044;
+  var fieldYD4 = 0x8001;
+}
+
+// Use two mixins in a single class.
+class G extends B with C, F {
+}
+
+bool checkFields(cls) {
+  var blockA = 
+    cls.fieldA1 ^ cls.fieldA2 ^ cls.fieldA3 ^ cls.fieldA4 ^
+    cls.fieldB1 ^ cls.fieldB2 ^ cls.fieldB3 ^ cls.fieldB4 ^
+    cls.fieldC1 ^ cls.fieldC2 ^ cls.fieldC3 ^ cls.fieldC4 ^
+    cls.fieldD1 ^ cls.fieldD2 ^ cls.fieldD3 ^ cls.fieldD4;
+  var blockB =
+    cls.fieldXA1 ^ cls.fieldXA2 ^ cls.fieldXA3 ^ cls.fieldXA4 ^
+    cls.fieldXB1 ^ cls.fieldXB2 ^ cls.fieldXB3 ^ cls.fieldXB4 ^
+    cls.fieldXC1 ^ cls.fieldXC2 ^ cls.fieldXC3 ^ cls.fieldXC4 ^
+    cls.fieldXD1 ^ cls.fieldXD2 ^ cls.fieldXD3 ^ cls.fieldXD4;
+  var blockC =
+    cls.fieldYA1 ^ cls.fieldYA2 ^ cls.fieldYA3 ^ cls.fieldYA4 ^
+    cls.fieldYB1 ^ cls.fieldYB2 ^ cls.fieldYB3 ^ cls.fieldYB4 ^
+    cls.fieldYC1 ^ cls.fieldYC2 ^ cls.fieldYC3 ^ cls.fieldYC4 ^
+    cls.fieldYD1 ^ cls.fieldYD2 ^ cls.fieldYD3 ^ cls.fieldYD4;
+  return blockA == 0xFFFF && blockB == 0x0000 && blockC == 0x1111;
+}
+
+main () {
+  var instances = [new A(), new D(), new E(), new G()];
+  for (var instance in instances) {
+    Expect.isTrue(checkFields(instance));
+  }
+}
diff --git a/tests/corelib/big_integer_parsed_arith_vm_test.dart b/tests/corelib/big_integer_parsed_arith_vm_test.dart
index bbf01cc..79dfe1c 100644
--- a/tests/corelib/big_integer_parsed_arith_vm_test.dart
+++ b/tests/corelib/big_integer_parsed_arith_vm_test.dart
@@ -568,7 +568,6 @@
   Expect.equals(a.toLowerCase(), str_back);
 }
 
-
 testBigintBitNot() {
   String zero = "0x0";
   String one = "0x1";
@@ -586,894 +585,6 @@
                "-0x1234567890ABCDEF012345679");
 }
 
-mulDivParsed(String a, String b, String product) {
-  int int_a = int.parse(a);
-  int int_b = int.parse(b);
-  int int_product = int.parse(product);
-  int computed_product = int_a * int_b;
-  Expect.equals(int_product, computed_product);
-  String str_product = computed_product >= 0 ?
-      "0x${computed_product.toRadixString(16)}" :
-      "-0x${(-computed_product).toRadixString(16)}";
-  Expect.equals(product.toLowerCase(), str_product);
-  int computed_product2 = int_b * int_a;
-  Expect.equals(int_product, computed_product2);
-  String str_product2 = computed_product2 >= 0 ?
-      "0x${computed_product2.toRadixString(16)}" :
-      "-0x${(-computed_product2).toRadixString(16)}";
-  Expect.equals(product.toLowerCase(), str_product2);
-
-  if (int_a != 0) {
-    int computed_quotient1 = int_product ~/ int_a;
-    Expect.equals(int_b, computed_quotient1);
-    String str_quotient1 = computed_quotient1 >= 0 ?
-        "0x${computed_quotient1.toRadixString(16)}" :
-        "-0x${(-computed_quotient1).toRadixString(16)}";
-    Expect.equals(b.toLowerCase(), str_quotient1);
-  }
-
-  if (int_b != 0) {
-    int computed_quotient2 = int_product ~/ int_b;
-    Expect.equals(int_a, computed_quotient2);
-    String str_quotient2 = computed_quotient2 >= 0 ?
-        "0x${computed_quotient2.toRadixString(16)}" :
-        "-0x${(-computed_quotient2).toRadixString(16)}";
-    Expect.equals(a.toLowerCase(), str_quotient2);
-  }
-}
-
-testBigintMultiplyDivide() {
-  String zero = "0x0";
-  String one = "0x1";
-  String minus_one = "-0x1";
-
-  mulDivParsed(zero, zero, zero);
-  mulDivParsed(one, one, one);
-  mulDivParsed(one, zero, zero);
-  mulDivParsed(zero, one, zero);
-  mulDivParsed(one, minus_one, minus_one);
-  mulDivParsed(minus_one, minus_one, one);
-  mulDivParsed("0x42", one, "0x42");
-  mulDivParsed("0x42", "0x2", "0x84");
-  mulDivParsed("0xFFFF", "0x2", "0x1FFFE");
-  mulDivParsed("0x3", "0x5", "0xF");
-  mulDivParsed("0xFFFFF", "0x5", "0x4FFFFB");
-  mulDivParsed("0xFFFFFFF", "0x5", "0x4FFFFFFB");
-  mulDivParsed("0xFFFFFFFF", "0x5", "0x4FFFFFFFB");
-  mulDivParsed("0xFFFFFFFFFFFFFFFF", "0x5", "0x4FFFFFFFFFFFFFFFB");
-  mulDivParsed("0xFFFFFFFFFFFFFFFF", "0x3039",
-               "0x3038FFFFFFFFFFFFCFC7");
-  mulDivParsed("0xFFFFFFFFFFFFFFFF",
-               "0xFFFFFFFFFFFFFFFFFFFFFFFFFF",
-               "0xFFFFFFFFFFFFFFFEFFFFFFFFFF0000000000000001");
-  mulDivParsed(
-      "0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000",
-      "0xFFFFFFFFFFFFFFFEFFFFFFFFFF000000000000000100000000000000"
-      "000000000000000000000000000000000000000000000000000000000000");
-  mulDivParsed("0x10000001", "0x5", "0x50000005");
-  mulDivParsed(
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF01234567890ABCDEF",
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF01234567890ABCDEF",
-      "0x14B66DC328828BCA670CBE52943AA3894CCCE15C8F5ED1E55F"
-      "328F6D3F579F992299850C4B5B95213EF3FB7B4E73B5F43D4299"
-      "5B9F6FD5441C275F2FF89F86F28F47A94CA37481090DCCCDCA6475F09A2F2A521");
-  mulDivParsed(
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF",
-      "0x1234567890123456789012345678901234567890123456789012345678901234567890"
-      "123456789012345678901234567890123456789012345678901234567890123456789012"
-      "345678901234567890123456789012345678901234567890123456789012345678901234"
-      "567890123456789012345678901234567890123456789012345678901234567890123456"
-      "789012345678901234567890123456789012345678901234567890123456789012345678"
-      "90123456789012345678901234567890",
-      "0x14B66DC327D3C88D7EAA988BBFFA9BBA877826E7EDAF373907A931FBFC3A25231DF7F2"
-      "516F511FB1638F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A"
-      "8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F"
-      "0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B"
-      "570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B57"
-      "0F4A8F0B570F4A8F0B570F4A8F0B570F35D89D93E776C67DD864B2034B5C739007933027"
-      "5CDFD41E07A15D0F5AD5256BED5F1CF91FBA375DE70");
-  mulDivParsed(
-      "0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFF",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-      "0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000"
-      "0000000000000000000000000000000000000000000000000000000000000000000001");
-  mulDivParsed(
-      "0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFF",
-      "0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFF",
-      "0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "0000000000000000000000000000001");
-
-  // A 256 28-bit digits number squared.
-  mulDivParsed(
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "0000000000000000000000000000000000000000000000000000000001");
-
-  mulDivParsed(
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-      "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "000000000000000000000000000000000000000000000000000000000000000000000000"
-      "0000000000000000000000000000000000000000000000000000000001");
-}
-
-divRemParsed(String a, String b, String quotient, String remainder) {
-  int int_a = int.parse(a);
-  int int_b = int.parse(b);
-  int int_quotient = int.parse(quotient);
-  int int_remainder = int.parse(remainder);
-  int computed_quotient = int_a ~/ int_b;
-  Expect.equals(int_quotient, computed_quotient);
-  String str_quotient = computed_quotient >= 0 ?
-      "0x${computed_quotient.toRadixString(16)}" :
-      "-0x${(-computed_quotient).toRadixString(16)}";
-  Expect.equals(quotient.toLowerCase(), str_quotient);
-  int computed_remainder = int_a.remainder(int_b);
-  Expect.equals(int_remainder, computed_remainder);
-  String str_remainder = computed_remainder >= 0 ?
-      "0x${computed_remainder.toRadixString(16)}" :
-      "-0x${(-computed_remainder).toRadixString(16)}";
-  Expect.equals(remainder.toLowerCase(), str_remainder);
-}
-
-
-testBigintDivideRemainder() {
-  String zero = "0x0";
-  String one = "0x1";
-  String minus_one = "-0x1";
-
-  divRemParsed(one, one, one, zero);
-  divRemParsed(zero, one, zero, zero);
-  divRemParsed(minus_one, one, minus_one, zero);
-  divRemParsed(one, "0x2", zero, one);
-  divRemParsed(minus_one, "0x7", zero, minus_one);
-  divRemParsed("0xB", "0x7", one, "0x4");
-  divRemParsed("0x12345678", "0x7", "0x299C335", "0x5");
-  divRemParsed("-0x12345678", "0x7", "-0x299C335", "-0x5");
-  divRemParsed("0x12345678", "-0x7", "-0x299C335", "0x5");
-  divRemParsed("-0x12345678", "-0x7", "0x299C335", "-0x5");
-  divRemParsed("0x7", "0x12345678", zero, "0x7");
-  divRemParsed("-0x7", "0x12345678", zero, "-0x7");
-  divRemParsed("-0x7", "-0x12345678", zero, "-0x7");
-  divRemParsed("0x7", "-0x12345678", zero, "0x7");
-  divRemParsed("0x12345678", "0x7", "0x299C335", "0x5");
-  divRemParsed("-0x12345678", "0x7", "-0x299C335", "-0x5");
-  divRemParsed("0x12345678", "-0x7", "-0x299C335", "0x5");
-  divRemParsed("-0x12345678", "-0x7", "0x299C335", "-0x5");
-  divRemParsed(
-      "0x14B66DC327D3C88D7EAA988BBFFA9BBA877826E7EDAF373907A931FBFC3A25231DF7F2"
-      "516F511FB1638F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A"
-      "8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F"
-      "0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B"
-      "570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B57"
-      "0F4A8F0B570F4A8F0B570F4A8F0B570F35D89D93E776C67DD864B2034B5C739007933027"
-      "5CDFD41E07A15D0F5AD5256BED5F1CF91FBA375DE70",
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF",
-      "0x1234567890123456789012345678901234567890123456789012345678901234567890"
-      "123456789012345678901234567890123456789012345678901234567890123456789012"
-      "345678901234567890123456789012345678901234567890123456789012345678901234"
-      "567890123456789012345678901234567890123456789012345678901234567890123456"
-      "789012345678901234567890123456789012345678901234567890123456789012345678"
-      "90123456789012345678901234567890",
-      zero);
-  divRemParsed(
-      "0x14B66DC327D3C88D7EAA988BBFFA9BBA877826E7EDAF373907A931FBFC3A25231DF7F2"
-      "516F511FB1638F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A"
-      "8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F"
-      "0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B"
-      "570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B57"
-      "0F4A8F0B570F4A8F0B570F4A8F0B570F35D89D93E776C67DD864B2034B5C739007933027"
-      "5CDFD41E07A15D0F5AD5256BED5F1CF91FBA375DE71",
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF",
-      "0x1234567890123456789012345678901234567890123456789012345678901234567890"
-      "123456789012345678901234567890123456789012345678901234567890123456789012"
-      "345678901234567890123456789012345678901234567890123456789012345678901234"
-      "567890123456789012345678901234567890123456789012345678901234567890123456"
-      "789012345678901234567890123456789012345678901234567890123456789012345678"
-      "90123456789012345678901234567890",
-      one);
-  divRemParsed(
-      "0x14B66DC327D3C88D7EAA988BBFFA9BBA877826E7EDAF373907A931FBFC3A25231DF7F2"
-      "516F511FB1638F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A"
-      "8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F"
-      "0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B"
-      "570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B570F4A8F0B57"
-      "0F4A8F0B570F4A8F0B570F4A8F0B5710591E051CF233A56DEA99087BDC08417F08B6758E"
-      "E5EA90FCF7B39165D365D139DC60403E8743421AC5E",
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEF",
-      "0x1234567890123456789012345678901234567890123456789012345678901234567890"
-      "123456789012345678901234567890123456789012345678901234567890123456789012"
-      "345678901234567890123456789012345678901234567890123456789012345678901234"
-      "567890123456789012345678901234567890123456789012345678901234567890123456"
-      "789012345678901234567890123456789012345678901234567890123456789012345678"
-      "90123456789012345678901234567890",
-      "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF"
-      "01234567890ABCDEE");
-}
-
 main() {
   testBigintAddSub();
   testBigintLeftShift();
@@ -1482,6 +593,4 @@
   testBigintBitOr();
   testBigintBitXor();
   testBigintBitNot();
-  testBigintMultiplyDivide();
-  testBigintDivideRemainder();
 }
diff --git a/tests/corelib/big_integer_parsed_div_rem_vm_test.dart b/tests/corelib/big_integer_parsed_div_rem_vm_test.dart
index 23525aa..7adf367 100644
--- a/tests/corelib/big_integer_parsed_div_rem_vm_test.dart
+++ b/tests/corelib/big_integer_parsed_div_rem_vm_test.dart
@@ -28,7 +28,6 @@
   Expect.equals(remainder.toLowerCase(), str_remainder);
 }
 
-
 testBigintDivideRemainder() {
   String zero = "0x0";
   String one = "0x1";
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index f1be4a96..5b00f9e 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -121,6 +121,8 @@
 compare_to2_test: RuntimeError, OK    # Requires bigint support.
 string_base_vm_test: RuntimeError, OK # VM specific test.
 nan_infinity_test/01: Fail # Issue 11551
+regexp/pcre_test: Pass, Slow # Issue 21593
+regress_r21715_test: RuntimeError # Requires bigint support.
 
 [ $compiler == dart2js && $runtime == none ]
 *: Fail, Pass # TODO(ahe): Triage these tests.
@@ -151,12 +153,13 @@
 [ $compiler == dart2dart ]
 compare_to2_test: Fail # inherited from VM
 unicode_test: Fail # inherited from VM
-string_split_test: RuntimeError # Issue 21441.
 
 [ $compiler == dart2dart && $minified ]
 error_stack_trace1_test: Fail # Fails in minified mode, test depends on method names.
 
 [ $compiler == dartanalyzer ]
+from_environment_const_type_test: Skip # The -D option that defines a constant
+# for the Dart vm is not accepted by the deprecated java dartanalyzer.
 int_parse_radix_test: Fail, OK # Test contains errors but doesn’t mark them as expected
 list_insert_test: Fail, OK # Test contains errors but doesn’t mark them as expected
 list_removeat_test: Fail, OK # Test contains errors but doesn’t mark them as expected
@@ -201,18 +204,9 @@
 list_insert_test: fail
 list_removeat_test: fail
 
-[ $arch == simarm || $arch == simarm64 ]
-big_integer_parsed_*: Pass, Slow
-
-[ $arch == simmips ]
-int_parse_radix_test: Skip # Timeout
-
 [ $arch == simmips || $arch == mips ]
-big_integer_parsed_*: Skip # Timeout. Issue 20879
-big_integer_huge_mul_vm_test: Skip # Timeout
-
-[ $arch == simarm && $checked ]
-num_parse_test: Skip  # Pass, Timeout
+big_integer_parsed_mul_div_vm_test: Skip # Timeout. Issue 20879.
+big_integer_huge_mul_vm_test: Skip # Timeout. Issue 20879.
 
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
 error_stack_trace_test: StaticWarning, OK # Test generates errors on purpose.
@@ -228,6 +222,8 @@
 stopwatch_test: Skip  # Flaky test due to expected performance behaviour.
 
 [ $runtime != d8 ]
-# JSCRE does not pass all of the tests ported for irregexp.
-# Ignore all of the tests until irregexp is fully ported.
+# The regexp tests are not verified to work on non d8 platforms yet.
 regexp/*: Skip
+
+[ $runtime == vm ]
+regexp/global_test: Skip # Timeout. Issue 21709 and 21708
diff --git a/tests/corelib/regress_r21715_test.dart b/tests/corelib/regress_r21715_test.dart
new file mode 100644
index 0000000..cfbcef1
--- /dev/null
+++ b/tests/corelib/regress_r21715_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=--optimization_counter_threshold=5
+
+import "package:expect/expect.dart";
+
+sll(x, shift) => x << shift;
+
+main() {
+  for (int i = 0; i < 10; i++) {
+    var x = 0x50000000;
+    var shift = 34;
+    Expect.equals(sll(x, shift), 0x14000000000000000);
+  }
+}
diff --git a/tests/html/html.status b/tests/html/html.status
index ecf5d31..510b2fa 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -15,10 +15,15 @@
 indexeddb_4_test: Skip # Issue 19726
 mouse_event_test: Fail # Issue 20437
 storage_quota_test/missingenumcheck: Fail
+worker_api_test: Fail # Issue 10223
+two_scripts_htmltest: Fail # Issue 16603
 
 [ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
 datalistelement_test: Skip # Issue 20540
 
+[ $compiler == dart2js ]
+input_element_test/attributes: Fail # Issue 21555
+
 [ $compiler == dart2js && $csp ]
 custom/js_custom_test: Fail # Issue 14643
 custom/element_upgrade_test: Fail # Issue 17298
@@ -60,6 +65,7 @@
 fileapi_test/fileEntry: Pass, RuntimeError # Issue 20488
 fileapi_test/getFile: Pass, RuntimeError # Issue 20488
 indexeddb_5_test: Pass, RuntimeError # Issue 21262
+native_gc_test: Pass, Slow
 
 [ $compiler == none && $runtime == drt && $system == windows ]
 worker_test/functional: Pass, Crash # Issue 9929.
@@ -99,9 +105,6 @@
 [$runtime == drt || $runtime == dartium || $runtime == chrome || $runtime == chromeOnAndroid || $runtime == ContentShellOnAndroid ]
 webgl_1_test: Pass, Fail # Issue 8219
 
-[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
-worker_api_test: Fail # http://dartbug.com/10223
-
 [ $compiler == none && ($runtime == drt || $runtime == dartium) && $system == windows]
 websql_test: Skip # Issue 4941: stderr contains a backtrace.
 
@@ -122,6 +125,7 @@
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # IE does not support drawImage w/ video element
 no_linked_scripts_htmltest: Skip # Times out on IE.  Issue 21537
 scripts_htmltest: Skip # Times out on IE.  Issue 21537
+two_scripts_htmltest: Skip # Times out on IE.  Issue 21537
 
 [$runtime == ie10 ]
 # IE10 Feature support statuses-
@@ -352,6 +356,10 @@
 [ $compiler == dart2js && ($runtime == drt || $runtime ==chrome) ]
 wheelevent_test: Fail # http://dartbug.com/12958
 
+[ $compiler == dart2js &&  $runtime == chrome && $system == windows ]
+css_test/functional: Fail # Issue 21710
+css_test/supportsPointConversions: Fail # Issue 21710
+
 [ $runtime == dartium && ($system == macos || $system == windows || $system == linux)]
 # Desktop operation systems do not support touch events on chrome 34 dartium.
 touchevent_test/supported: Fail
diff --git a/tests/html/input_element_test.dart b/tests/html/input_element_test.dart
index 02fb062..0a12d0b 100644
--- a/tests/html/input_element_test.dart
+++ b/tests/html/input_element_test.dart
@@ -184,5 +184,11 @@
       e.value = null;
       expect(e.value, '');
     });
+    test('valueSetNullProxy', () {
+      final e = new TextInputElement();
+      var list = new List(5);
+      e.value = list[0];
+      expect(e.value, '');
+    });
   });
 }
diff --git a/tests/html/scripts_test_dart.dart b/tests/html/scripts_test_dart.dart
index 38df274..ab62d3a 100644
--- a/tests/html/scripts_test_dart.dart
+++ b/tests/html/scripts_test_dart.dart
@@ -13,4 +13,4 @@
     window.postMessage('squid', '*');  // Duplicate message OK.
     window.postMessage('sea urchin', '*');
   });
-}
\ No newline at end of file
+}
diff --git a/tests/html/two_scripts_htmltest.html b/tests/html/two_scripts_htmltest.html
new file mode 100644
index 0000000..1a244ca
--- /dev/null
+++ b/tests/html/two_scripts_htmltest.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+for details. All rights reserved. Use of this source code is governed by a
+BSD-style license that can be found in the LICENSE file.
+-->
+<!--
+START_HTML_DART_TEST
+{
+  "scripts": ["two_scripts_test_first.dart", "two_scripts_test_second.dart"],
+  "expectedMessages":
+      ["first_local", "first_global", "second_local", "second_global"]
+}
+END_HTML_DART_TEST
+-->
+<html>
+<head>
+  <script>window.parent.dispatchEvent(new Event('detect_errors'));</script>
+  <title>Two Scripts HTML test</title>
+</head><body>
+  <h1>Two Scripts HTML test</h1>
+  <script src="two_scripts_test_first.dart" type="application/dart"></script>
+  <script src="two_scripts_test_second.dart" type="application/dart"></script>
+</body>
+</html>
diff --git a/tests/html/two_scripts_test_first.dart b/tests/html/two_scripts_test_first.dart
new file mode 100644
index 0000000..1813aa5
--- /dev/null
+++ b/tests/html/two_scripts_test_first.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library TwoScriptsTestFirst;
+import 'dart:html';
+
+aGlobalFunction() {
+  window.postMessage('first_global', '*');
+}
+
+main() {
+  window.postMessage('first_local', '*');
+  aGlobalFunction();
+}
diff --git a/tests/html/two_scripts_test_second.dart b/tests/html/two_scripts_test_second.dart
new file mode 100644
index 0000000..eab4493
--- /dev/null
+++ b/tests/html/two_scripts_test_second.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library TwoScriptsTestSecond;
+import 'dart:html';
+
+aGlobalFunction() {
+  window.postMessage('second_global', '*');
+}
+
+main() {
+  window.postMessage('second_local', '*');
+  aGlobalFunction();
+}
diff --git a/tests/language/await_future_test.dart b/tests/language/await_future_test.dart
index f1e21bc..c8c3bee 100644
--- a/tests/language/await_future_test.dart
+++ b/tests/language/await_future_test.dart
@@ -20,6 +20,8 @@
   return b;
 }
 
+faa() async => (await bar('faa')).length;
+
 quaz(p) async {
   var x = 0;
   try {
@@ -184,6 +186,8 @@
   for (int i = 0; i < 10; i++) {
     result = await foo();
     Expect.equals(30, result);
+    result = await faa();
+    Expect.equals(3, result);
     result = await quaz(17);
     Expect.equals(17, result);
     result = await quazz();
diff --git a/tests/language/await_regression_test.dart b/tests/language/await_regression_test.dart
new file mode 100644
index 0000000..d21e175
--- /dev/null
+++ b/tests/language/await_regression_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// VMOptions=--enable_async
+//
+
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+later(vodka) => new Future.value(vodka);
+
+manana(tequila) async => tequila;
+
+// Regression test for issue 21536.
+testNestedFunctions() async {
+  var a = await later('Asterix').then((tonic) {
+    return later(tonic);
+  });
+  var o = await manana('Obelix').then(manana);
+  Expect.equals("$a and $o", "Asterix and Obelix");
+}
+
+addLater({a, b}) => new Future.value(a + b);
+
+// Regression test for issue 21480.
+testNamedArguments() async {
+  var sum = await addLater(a:5, b:10);
+  Expect.equals(sum, 15);
+  sum = await addLater(b:11, a:-11);
+  Expect.equals(sum, 0);
+}
+
+main() async {
+  testNestedFunctions();
+  testNamedArguments();
+}
diff --git a/tests/language/enum_const_test.dart b/tests/language/enum_const_test.dart
new file mode 100644
index 0000000..0eb7204
--- /dev/null
+++ b/tests/language/enum_const_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// SharedOptions=--enable-enum
+
+import "dart:isolate";
+import "package:expect/expect.dart";
+
+enum Foo {
+  BAR, BAZ
+}
+
+verify(val) {
+  Expect.identical(Foo.BAR, val);
+}
+
+main() {
+  verify(Foo.BAR);
+  var rp;
+  rp = new RawReceivePort((val) {
+    verify(val);
+    rp.close();
+  });
+  rp.sendPort.send(Foo.BAR);
+}
diff --git a/tests/language/enum_mirror_test.dart b/tests/language/enum_mirror_test.dart
new file mode 100644
index 0000000..e85f121
--- /dev/null
+++ b/tests/language/enum_mirror_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// SharedOptions=--enable-enum
+
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
+
+enum Foo { BAR, BAZ }
+
+main() {
+  Expect.equals('Foo.BAR', Foo.BAR.toString());
+  var name = reflect(Foo.BAR).invoke(#toString, []).reflectee;
+  Expect.equals('Foo.BAR', name);
+}
diff --git a/tests/language/isssue_21159.dart b/tests/language/isssue_21159.dart
deleted file mode 100644
index 2d2b6c8..0000000
--- a/tests/language/isssue_21159.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class C {
- get call => this;
-}
-
-main() {
- new C()();
-}
diff --git a/tests/language/issue21159_test.dart b/tests/language/issue21159_test.dart
new file mode 100644
index 0000000..ff90966
--- /dev/null
+++ b/tests/language/issue21159_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class C {
+ get call => this;
+}
+
+// Recurs outside the try-block to avoid disabling inlining.
+foo() {
+ var c = new C();
+ c();
+}
+
+main() {
+ bool exceptionCaught = false;
+ try {
+  foo();
+ } on StackOverflowError catch (e) {
+  exceptionCaught = true;
+ }
+ Expect.equals(true, exceptionCaught);
+}
diff --git a/tests/language/issue_1751477.dart b/tests/language/issue_1751477_test.dart
similarity index 100%
rename from tests/language/issue_1751477.dart
rename to tests/language/issue_1751477_test.dart
diff --git a/tests/language/language.status b/tests/language/language.status
index 2c26cee..1091d75 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -23,6 +23,7 @@
 async_test/*: Skip
 async_control_structures_test: Skip
 await_test: Skip
+await_regression_test: Skip
 await_for_test: Skip
 await_future_test: Skip
 await_nonfuture_test: Skip
@@ -35,6 +36,7 @@
 async_test/*: Skip
 async_control_structures_test: Skip
 await_test: Skip
+await_regression_test: Skip
 await_for_test: Skip
 await_future_test: Skip
 await_nonfuture_test: Skip
@@ -50,6 +52,7 @@
 deferred_inlined_test: Fail  # Issue 17523
 deferred_optimized_test: Fail  # Issue 17523
 enum_test: Crash # Issue 21416/21417
+enum_mirror_test: Skip # Issue 11511.
 
 override_inheritance_mixed_test/08: Fail # Issue 18124
 override_inheritance_mixed_test/09: Fail # Issue 18124
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index 7e82a9c..1392f0d 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -6,6 +6,12 @@
 # Runtime negative test. No static errors or warnings.
 closure_call_wrong_argument_count_negative_test: skip
 
+enum_syntax_test/02: Fail # 21649
+enum_syntax_test/03: Fail # 21649
+enum_syntax_test/04: Fail # 21649
+enum_syntax_test/05: Fail # 21649
+enum_syntax_test/06: Fail # 21649
+
 # Test issue 12694 (was analyzer issue), (1) when "abstract" is import prefix using it as type is warning; (2) currently analyzer resolves prefix as field (don't ask)
 built_in_identifier_prefix_test: CompileTimeError # Issue 12694
 
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index 083c89c..b27091a 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -26,7 +26,6 @@
 reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
 reify_typevar_static_test/01: MissingCompileTimeError # Issue 21565
 
-
 # Please add new failing tests before this line.
 # Section below is for invalid tests.
 #
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index ffd3428..09d51d8 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -40,9 +40,6 @@
 ref_before_declaration_test/05: MissingCompileTimeError
 ref_before_declaration_test/06: MissingCompileTimeError
 
-external_test/10: Fail
-external_test/20: Fail
-
 enum_syntax_test/01: Fail # Issue 21648
 
 
@@ -148,7 +145,9 @@
 const_var_test: CompileTimeError # Issue 12793
 map_literal3_test: CompileTimeError # Issue 12793
 method_override5_test: RuntimeError # Issue 12809
+external_test/10: CompileTimeError # Issue 12887
 external_test/13: CompileTimeError # Issue 12887
+external_test/20: CompileTimeError # Issue 12887
 list_literal4_test: RuntimeError # Issue 12890
 built_in_identifier_test/01: CompileTimeError # Issue 13022
 
@@ -197,6 +196,7 @@
 regress_13494_test: Fail # Issue 13494
 reify_typevar_static_test/00: MissingCompileTimeError # Issue 21566
 reify_typevar_static_test/01: MissingCompileTimeError # Issue 21566
+enum_const_test: Crash # Issue 21681
 
 built_in_identifier_prefix_test: Fail # Issue 6972
 constructor_initializer_test/none: Fail # Issue 12633
@@ -220,7 +220,6 @@
 const_evaluation_test/01: Fail # Issue 12762
 const_var_test: CompileTimeError # Issue 12794
 map_literal3_test: Fail # Issue 12794
-external_test/13: Fail # Issue 12888
 built_in_identifier_test/01: Fail # Issue 13022
 method_override4_test: Fail # Issue 12810
 method_override5_test: Fail # Issue 12810
@@ -232,8 +231,6 @@
 constructor6_test: Fail
 closure_in_initializer_test: Fail
 
-# Minified mode failures.
-
 new_expression_type_args_test/00: Fail # Wrongly reports compile-time error.
 new_expression_type_args_test/01: Fail # Wrongly reports compile-time error.
 
@@ -241,6 +238,15 @@
 cha_deopt1_test: skip # Issue 17523
 cha_deopt2_test: skip # Issue 17523
 cha_deopt3_test: skip # Issue 17523
+issue_1751477_test: skip # Issue 17523
+
+external_test/21: MissingCompileTimeError # Issue 12888
+external_test/24: MissingCompileTimeError # Issue 12888
+
+function_propagation_test: RuntimeError # Issue 21673
+function_subtype_call0_test: RuntimeError # Issue 21673
+function_subtype_call1_test: RuntimeError # Issue 21673
+function_subtype_call2_test: RuntimeError # Issue 21673
 
 [ $compiler == dart2dart && $minified ]
 cyclic_type_test/0*: Fail # Issue 12605.
diff --git a/tests/language/vm/canonicalization_preserves_deopt_test.dart b/tests/language/vm/canonicalization_preserves_deopt_test.dart
new file mode 100644
index 0000000..76c97a6
--- /dev/null
+++ b/tests/language/vm/canonicalization_preserves_deopt_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--optimization_counter_threshold=10 --no-use-osr
+
+import "package:expect/expect.dart";
+
+class X {
+  operator * (other) => "NaNNaNNaNNaNBatman";
+}
+
+foo(x) => (x * 1.0) is double;
+
+bar(x) {
+  try {
+    int i = (x * 1);
+    return true;
+  } catch (e) {
+    return false;
+  }
+}
+
+baz(x) => (x * 1) == x;
+
+main() {
+  for (var i = 0; i < 100; i++) {
+    Expect.isTrue(foo(1.0));
+    assert(() {
+      Expect.isTrue(bar(-1 << 63));
+      return true;
+    });
+    Expect.isTrue(baz(-1 << 63));
+  }
+  Expect.isFalse(foo(new X()));
+  assert(() {
+    Expect.isFalse(bar(new X()));
+    return true;
+  });
+  Expect.isFalse(baz(new X()));
+}
+
diff --git a/tests/language/vm/load_elimination_any_use_creates_alias_test.dart b/tests/language/vm/load_elimination_any_use_creates_alias_test.dart
new file mode 100644
index 0000000..1ad73c1
--- /dev/null
+++ b/tests/language/vm/load_elimination_any_use_creates_alias_test.dart
@@ -0,0 +1,52 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test correctness of side effects tracking used by load to load forwarding.
+
+// VMOptions=--no-use-osr --optimization-counter-threshold=10 --enable-inlining-annotations
+
+import "package:expect/expect.dart";
+
+const alwaysInline = "AlwaysInline";
+const noInline = "NeverInline";
+
+B G;
+
+@noInline
+modify() {
+  G.bval = 123;
+}
+
+class B {
+
+ @alwaysInline
+ poly() {
+   G = this;
+   modify();
+   return bval;
+ }
+ var bval = -1;
+}
+
+class C {
+  poly() => null;
+}
+
+
+@alwaysInline
+foo(obj) => obj.poly();
+
+@noInline
+test() {
+  var b = new B();
+
+  foo(b);
+  return b.bval;
+}
+
+main() {
+  foo(new C());
+  foo(new B());
+  for (var i = 0; i < 100; i++) test();
+  Expect.equals(123, test());
+}
diff --git a/tests/language/vm/load_elimination_has_loads_from_place_test.dart b/tests/language/vm/load_elimination_has_loads_from_place_test.dart
new file mode 100644
index 0000000..24414eb
--- /dev/null
+++ b/tests/language/vm/load_elimination_has_loads_from_place_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test correctness of side effects tracking used by load to load forwarding.
+
+// VMOptions=--optimization-counter-threshold=10 --no-use-osr --enable-inlining-annotations
+
+// Tests correct handling of redefinitions in aliasing computation.
+
+import "package:expect/expect.dart";
+
+const alwaysInline = "AlwaysInline";
+const noInline = "NeverInline";
+
+var H = true;
+
+class A {
+  B bb;
+
+  @alwaysInline
+  poly(p) {
+    if (H) {
+      bb = p;
+    }
+    B t = bb;
+    t.bval = 123;
+    return t.bval;
+  }
+}
+
+class B {
+  int bval = -1;
+
+  @alwaysInline
+  poly(p) {
+    return bval;
+  }
+}
+
+@alwaysInline
+foo(obj, p) => obj.poly(p);
+
+@noInline
+test() {
+  A a = new A();
+  B b = new B();
+  foo(a, b);
+  return b.bval;
+}
+
+main() {
+  // Prime foo with polymorphic type feedback.
+  foo(new B(), new A());
+  foo(new A(), new B());
+
+  for (var i = 0; i < 100; i++) test();
+  Expect.equals(123, test());
+}
diff --git a/tests/language/vm/load_elimination_mark_stored_values_escaping_test.dart b/tests/language/vm/load_elimination_mark_stored_values_escaping_test.dart
new file mode 100644
index 0000000..3ea4271
--- /dev/null
+++ b/tests/language/vm/load_elimination_mark_stored_values_escaping_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test correctness of side effects tracking used by load to load forwarding.
+
+// VMOptions=--no-use-osr --optimization-counter-threshold=10 --enable-inlining-annotations
+
+// Tests correct handling of redefinitions in aliasing computation.
+
+import "package:expect/expect.dart";
+
+const alwaysInline = "AlwaysInline";
+const noInline = "NeverInline";
+
+B G;
+
+class A {
+  int val = -1;
+
+  @alwaysInline
+  poly(p) {
+    p.aa = this;
+  }
+}
+
+
+@noInline
+modify() {
+  G.aa.val = 123;
+}
+
+class B {
+ A aa;
+
+ @alwaysInline
+ poly(p) {
+   G = this;
+   foo2(p, this);
+   modify();
+ }
+}
+
+@alwaysInline
+foo(obj, p) => obj.poly(p);
+
+@alwaysInline
+foo2(obj, p) => obj.poly(p);
+
+@noInline
+testfunc() {
+  var a = new A();
+  var b = new B();
+  foo(b, a);
+  return a.val;
+}
+
+main() {
+  foo(new B(), new A());
+  foo(new A(), new B());
+  foo2(new B(), new A());
+  foo2(new A(), new B());
+  for (var i = 0; i < 100; i++) testfunc();
+  Expect.equals(123, testfunc());
+}
diff --git a/tests/language/vm/load_elimination_two_redefinitions_test.dart b/tests/language/vm/load_elimination_two_redefinitions_test.dart
new file mode 100644
index 0000000..58a8f17
--- /dev/null
+++ b/tests/language/vm/load_elimination_two_redefinitions_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test correctness of side effects tracking used by load to load forwarding.
+
+// VMOptions=--optimization-counter-threshold=10 --no-use-osr --enable-inlining-annotations
+
+// Tests correct handling of redefinitions in aliasing computation.
+
+import "package:expect/expect.dart";
+
+const alwaysInline = "AlwaysInline";
+const noInline = "NeverInline";
+
+var H = true;
+
+class A {
+  B bb;
+
+  @alwaysInline
+  poly(p) {
+    if (H) {
+      bb = p;
+    }
+    B t = bb;
+    t.bval = 123;
+    return t.bval;
+  }
+}
+
+class B {
+  int bval = -1;
+
+  @alwaysInline
+  poly(p) {
+    return bval;
+  }
+}
+
+@alwaysInline
+foo(obj, p) => obj.poly(p);
+
+@noInline
+test() {
+  A a = new A();
+  B b = new B();
+  foo(a, b);
+  foo(a, b);
+  return b.bval;
+}
+
+main() {
+  // Prime foo with polymorphic type feedback.
+  foo(new B(), new A());
+  foo(new A(), new B());
+
+  for (var i = 0; i < 100; i++) test();
+  Expect.equals(123, test());
+}
diff --git a/tests/lib/analyzer/analyze_library.status b/tests/lib/analyzer/analyze_library.status
index bb3a64f..e48684e 100644
--- a/tests/lib/analyzer/analyze_library.status
+++ b/tests/lib/analyzer/analyze_library.status
@@ -23,3 +23,12 @@
 # Pub is starting to use the new async syntax, which isn't supported on the
 # analyzer bots yet.
 lib/_internal/pub/*: Pass, CompileTimeError
+
+[ $compiler == dart2analyzer ]
+lib/web_gl/dartium/web_gl_dartium: CompileTimeError # Issue 21647
+lib/web_sql/dartium/web_sql_dartium: CompileTimeError # Issue 21647
+lib/html/dartium/html_dartium: CompileTimeError # Issue 21647
+lib/html/html_common/html_common: CompileTimeError # Issue 21647
+lib/indexed_db/dartium/indexed_db_dartium: CompileTimeError # Issue 21647
+lib/web_audio/dartium/web_audio_dartium: CompileTimeError # Issue 21647
+lib/svg/dartium/svg_dartium: CompileTimeError # Issue 21647
diff --git a/tests/lib/convert/ascii_test.dart b/tests/lib/convert/ascii_test.dart
index 239130f..f70558e 100644
--- a/tests/lib/convert/ascii_test.dart
+++ b/tests/lib/convert/ascii_test.dart
@@ -54,6 +54,28 @@
         print(codec.encoder.convert(nonAsciiString));
       }, null, nonAsciiString);
     }
+
+    var encode = codec.encoder.convert;
+    Expect.listEquals([0x42, 0x43, 0x44], encode("ABCDE", 1, 4));
+    Expect.listEquals([0x42, 0x43, 0x44, 0x45], encode("ABCDE", 1));
+    Expect.listEquals([0x42, 0x43, 0x44], encode("\xffBCD\xff", 1, 4));
+    Expect.throws(() { encode("\xffBCD\xff", 0, 4); });
+    Expect.throws(() { encode("\xffBCD\xff", 1); });
+    Expect.throws(() { encode("\xffBCD\xff", 1, 5); });
+    Expect.throws(() { encode("\xffBCD\xff", -1, 4); });
+    Expect.throws(() { encode("\xffBCD\xff", 1, -1); });
+    Expect.throws(() { encode("\xffBCD\xff", 3, 2); });
+
+    var decode = codec.decoder.convert;
+    Expect.equals("BCD", decode([0x41, 0x42, 0x43, 0x44, 0x45], 1, 4));
+    Expect.equals("BCDE", decode([0x41, 0x42, 0x43, 0x44, 0x45], 1));
+    Expect.equals("BCD", decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 1, 4));
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 0, 4); });
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 1); });
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 1, 5); });
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], -1, 4); });
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 1, -1); });
+    Expect.throws(() { decode([0xFF, 0x42, 0x43, 0x44, 0xFF], 3, 2); });
   }
 
   var allowInvalidCodec = new AsciiCodec(allowInvalid: true);
diff --git a/tests/lib/convert/latin1_test.dart b/tests/lib/convert/latin1_test.dart
index 18a7797..22e2950 100644
--- a/tests/lib/convert/latin1_test.dart
+++ b/tests/lib/convert/latin1_test.dart
@@ -52,6 +52,28 @@
         print(codec.encoder.convert(nonLatin1String));
       }, null, nonLatin1String);
     }
+
+    var encode = codec.encoder.convert;
+    Expect.listEquals([0x42, 0xff, 0x44], encode("AB\xffDE", 1, 4));
+    Expect.listEquals([0x42, 0xff, 0x44, 0x45], encode("AB\xffDE", 1));
+    Expect.listEquals([0x42, 0xff, 0x44], encode("\u3000B\xffD\u3000", 1, 4));
+    Expect.throws(() { encode("\u3000B\xffD\u3000", 0, 4); });
+    Expect.throws(() { encode("\u3000B\xffD\u3000", 1); });
+    Expect.throws(() { encode("\u3000B\xffD\u3000", 1, 5); });
+    Expect.throws(() { encode("\u3000B\xffD\u3000", -1, 4); });
+    Expect.throws(() { encode("\u3000B\xffD\u3000", 1, -1); });
+    Expect.throws(() { encode("\u3000B\xffD\u3000", 3, 2); });
+
+    var decode = codec.decoder.convert;
+    Expect.equals("B\xffD", decode([0x41, 0x42, 0xff, 0x44, 0x45], 1, 4));
+    Expect.equals("B\xffDE", decode([0x41, 0x42, 0xff, 0x44, 0x45], 1));
+    Expect.equals("B\xffD", decode([0xFF, 0x42, 0xff, 0x44, 0xFF], 1, 4));
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], 0, 4); });
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], 1); });
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], 1, 5); });
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], -1, 4); });
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], 1, -1); });
+    Expect.throws(() { decode([0x3000, 0x42, 0xff, 0x44, 0x3000], 3, 2); });
   }
 
   var allowInvalidCodec = new Latin1Codec(allowInvalid: true);
diff --git a/tests/lib/convert/streamed_conversion_json_utf8_decode_test.dart b/tests/lib/convert/streamed_conversion_json_utf8_decode_test.dart
index 7516a1d..783e079 100644
--- a/tests/lib/convert/streamed_conversion_json_utf8_decode_test.dart
+++ b/tests/lib/convert/streamed_conversion_json_utf8_decode_test.dart
@@ -1,6 +1,9 @@
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
+// Test write barrier verification mode.
+// VMOptions=--verified_mem --verify_before_gc --verify_after_gc --old_gen_growth_rate=1
+// VMOptions=
 
 import "package:expect/expect.dart";
 import 'dart:async';
diff --git a/tests/lib/convert/utf8_encode_test.dart b/tests/lib/convert/utf8_encode_test.dart
index 4e15646..489a124 100644
--- a/tests/lib/convert/utf8_encode_test.dart
+++ b/tests/lib/convert/utf8_encode_test.dart
@@ -9,11 +9,54 @@
 List<int> encode(String str) => new Utf8Encoder().convert(str);
 List<int> encode2(String str) => UTF8.encode(str);
 
-main() {
+void main() {
   for (var test in UNICODE_TESTS) {
     List<int> bytes = test[0];
     String string = test[1];
     Expect.listEquals(bytes, encode(string));
     Expect.listEquals(bytes, encode2(string));
   }
+
+  testEncodeSlice();
+}
+
+void testEncodeSlice() {
+  var encoder = UTF8.encoder;
+  String ascii = "ABCDE";
+  Expect.listEquals([0x41, 0x42, 0x43, 0x44, 0x45],
+                    encoder.convert(ascii));
+  Expect.listEquals([0x41, 0x42, 0x43, 0x44, 0x45],
+                    encoder.convert(ascii, 0));
+  Expect.listEquals([0x41, 0x42, 0x43, 0x44, 0x45],
+                    encoder.convert(ascii, 0, 5));
+  Expect.listEquals([0x42, 0x43, 0x44, 0x45],
+                    encoder.convert(ascii, 1));
+  Expect.listEquals([0x41, 0x42, 0x43, 0x44],
+                    encoder.convert(ascii, 0, 4));
+  Expect.listEquals([0x42, 0x43, 0x44],
+                    encoder.convert(ascii, 1, 4));
+
+  Expect.throws(() => encoder.convert(ascii, -1));    // start < 0.
+  Expect.throws(() => encoder.convert(ascii, 6));     // start > length
+  Expect.throws(() => encoder.convert(ascii, 0, -1)); // end < 0
+  Expect.throws(() => encoder.convert(ascii, 0, 6));  // end > length
+  Expect.throws(() => encoder.convert(ascii, 3, 2));  // end < start
+
+  var unicode = "\u0081\u0082\u1041\u{10101}";
+
+  Expect.listEquals([0xc2, 0x81, 0xc2, 0x82, 0xe1, 0x81, 0x81,
+                     0xf0, 0x90, 0x84, 0x81],
+                    encoder.convert(unicode));
+  Expect.listEquals([0xc2, 0x81, 0xc2, 0x82, 0xe1, 0x81, 0x81,
+                     0xf0, 0x90, 0x84, 0x81],
+                    encoder.convert(unicode, 0, unicode.length));
+  Expect.listEquals([0xc2, 0x82, 0xe1, 0x81, 0x81,
+                     0xf0, 0x90, 0x84, 0x81],
+                    encoder.convert(unicode, 1));
+  Expect.listEquals([0xc2, 0x82, 0xe1, 0x81, 0x81],
+                    encoder.convert(unicode, 1, 3));
+  // Split in the middle of a surrogate pair.
+  Expect.listEquals([0xc2, 0x82, 0xe1, 0x81, 0x81,
+                     0xed, 0xa0, 0x80],
+                    encoder.convert(unicode, 1, 4));
 }
diff --git a/tests/lib/convert/utf8_test.dart b/tests/lib/convert/utf8_test.dart
index ba5bc89..cc4c7f5 100644
--- a/tests/lib/convert/utf8_test.dart
+++ b/tests/lib/convert/utf8_test.dart
@@ -8,10 +8,38 @@
 
 String decode(List<int> bytes) => new Utf8Decoder().convert(bytes);
 
-main() {
+void main() {
   for (var test in UNICODE_TESTS) {
     List<int> bytes = test[0];
     String expected = test[1];
     Expect.stringEquals(expected, decode(bytes));
   }
+
+  testDecodeSlice();
+}
+
+void testDecodeSlice() {
+  var decoder = UTF8.decoder;  // Doesn't allow malformed.
+  var ascii = [0x41, 0x42, 0x43, 0x44, 0x45];
+  Expect.equals("ABCDE", decoder.convert(ascii));
+  Expect.equals("ABCDE", decoder.convert(ascii, 0));
+  Expect.equals("ABCDE", decoder.convert(ascii, 0, ascii.length));
+  Expect.equals("CDE", decoder.convert(ascii, 2));
+  Expect.equals("BCD", decoder.convert(ascii, 1, 4));
+  Expect.equals("ABCD", decoder.convert(ascii, 0, 4));
+
+  Expect.throws(() => decoder.convert(ascii, -1));    // start < 0.
+  Expect.throws(() => decoder.convert(ascii, 6));     // start > length
+  Expect.throws(() => decoder.convert(ascii, 0, -1)); // end < 0
+  Expect.throws(() => decoder.convert(ascii, 0, 6));  // end > length
+  Expect.throws(() => decoder.convert(ascii, 3, 2));  // end < start
+
+  var utf8 = [0xc2, 0x81, 0xc2, 0x82, 0xe1, 0x81, 0x81];
+  Expect.equals("\u0081\u0082\u1041", decoder.convert(utf8));
+  Expect.equals("\u0082\u1041", decoder.convert(utf8, 2));
+  Expect.equals("\u0081\u0082", decoder.convert(utf8, 0, 4));
+  Expect.equals("\u0082", decoder.convert(utf8, 2, 4));
+  Expect.throws(() => decoder.convert(utf8, 1));
+  Expect.throws(() => decoder.convert(utf8, 0, 1));
+  Expect.throws(() => decoder.convert(utf8, 2, 5));
 }
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 4a89f01..85b8e2c 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -118,15 +118,18 @@
 math/math_test: RuntimeError
 math/math2_test: RuntimeError
 
-[ $compiler == dart2js && ($jscl || $runtime == d8) && $unchecked ]
+[ $compiler == dart2js && $jscl && $unchecked ]
 mirrors/invocation_fuzz_test: RuntimeError # Issue 15566
 
-[ $compiler == dart2js && ($jscl || $runtime == d8) && $checked ]
+[ $compiler == dart2js && $jscl && $checked ]
 mirrors/invocation_fuzz_test/none: RuntimeError # Issue 15566
 
 [ $compiler == dart2js && ($minified || $runtime == jsshell) ]
 mirrors/invocation_fuzz_test: RuntimeError # Issue 15566
 
+[ $runtime == vm && $mode == debug && $system == macos ]
+mirrors/invocation_fuzz_test: Pass, RuntimeError # Issue 21707
+
 [ $compiler == dart2js && $runtime == jsshell ]
 async/future_test: RuntimeError # Timer interface not supported; dartbug.com/7728.
 async/slow_consumer2_test: RuntimeError # Timer interface not supported; dartbug.com/7728.
@@ -255,6 +258,7 @@
 [$compiler == none && $runtime == ContentShellOnAndroid ]
 async/stream_timeout_test: RuntimeError, Pass # Issue 19127
 async/slow_consumer3_test: Skip # Times out flakily. Issue 20956
+async/slow_consumer2_test: Skip # Times out flakily. Issue 20956
 convert/streamed_conversion_utf8_encode_test: Skip # Times out or passes. Issue 19127
 convert/streamed_conversion_utf8_decode_test: Skip # Times out or passes. Issue 19127
 mirrors/lazy_static_test: Skip # Times out. Issue 19127
@@ -315,3 +319,9 @@
 
 [ $arch == simarm64 ]
 convert/utf85_test: Skip # Pass, Slow Issue 20111.
+
+[ $mode == debug && $arch == ia32 && $system == windows ]
+convert/streamed_conversion_json_utf8_decode_test: Skip  # Verification OOM.
+
+[ $mode == debug && $arch != ia32 && $arch != x64 ]
+convert/streamed_conversion_json_utf8_decode_test: Skip  # Verification not yet implemented.
diff --git a/tests/standalone/io/addlatexhash_test.dart b/tests/standalone/io/addlatexhash_test.dart
old mode 100644
new mode 100755
index 98f1ba5..dbefe39
--- a/tests/standalone/io/addlatexhash_test.dart
+++ b/tests/standalone/io/addlatexhash_test.dart
@@ -1,3 +1,4 @@
+#!/usr/bin/env dart
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -54,11 +55,72 @@
   oneTestSisp(sispIsDartEnd, "End", "whatever else ..", false);
 }
 
+// Check that the hash values of paragraphs in the specially prepared
+// LaTeX source 'addlatexhash_test_src.tex' are identical in groups
+// of eight (so we get 8 identical hash values, then another hash
+// value 8 times, etc.)
+testSameHash() {
+  // set up temporary directory to hold output
+  final tmpDir = Directory.systemTemp.createTempSync("addlatexhash_test");
+  final tmpDirPath = tmpDir.path;
+
+  // file names/paths for file containing groups of 8 variants of a paragraph
+  const par8timesName = "addlatexhash_test_src";
+  const par8timesFileName = "$par8timesName.tex";
+  final par8timesDirPath = path.join(dartRootDir, "tests", "standalone", "io");
+  final par8timesPath = path.join(par8timesDirPath, par8timesFileName);
+  final tmpPar8timesPath = path.join(tmpDirPath, par8timesFileName);
+
+  // file names paths for output
+  final hashName = par8timesName + "-hash";
+  final hashFileName = "$hashName.tex";
+  final hashPath = path.join(tmpDirPath, hashFileName);
+  final listName = par8timesName + "-list";
+  final listFileName = "$listName.txt";
+  final listPath = path.join(tmpDirPath, listFileName);
+
+  // dart executable
+  final dartExecutable = Platform.executable;
+  if (dartExecutable == "") throw "dart executable not available";
+
+  // actions to take
+  runAddHash() =>
+      Process.runSync(dartExecutable,
+                      [path.join(dartRootPath, "tools", "addlatexhash.dart"),
+                       tmpPar8timesPath,
+                       hashPath,
+                       listPath]);
+
+  // perform test
+  new File(par8timesPath).copySync(tmpPar8timesPath);
+  checkAction(runAddHash(), "addlatexhash.dart failed");
+  var listFile = new File(listPath);
+  var listLines = listFile.readAsLinesSync();
+  var latestLine = null;
+  var sameCount = 0;
+  for (var line in listLines) {
+    if (!line.startsWith("  ")) continue; // section marker
+    if (line.startsWith("  %")) continue; // transformed text "comment"
+    if (line != latestLine) {
+      // new hash, check for number of equal hashes, then reset
+      if (sameCount % 8 == 0) {
+        // saw zero or more blocks of 8 identical hash values: OK
+        latestLine = line;
+        sameCount = 1;
+      } else {
+        throw "normalization failed to produce same result";
+      }
+    } else {
+      sameCount++;
+    }
+  }
+}
+
 // Check that the LaTeX source transformation done by addlatexhash.dart
 // does not affect the generated output, as seen via dvi2tty and diff.
 // NB: Not part of normal testing (only local): latex and dvi2tty are
 // not installed in the standard test environment.
-testNoChange() {
+testSameDVI() {
   // set up /tmp directory to hold output
   final tmpDir = Directory.systemTemp.createTempSync("addlatexhash_test");
   final tmpDirPath = tmpDir.path;
@@ -83,15 +145,24 @@
   final hashPath = path.join(tmpDirPath, hashFileName);
   final hashDviPath = path.join(tmpDirPath, "$hashName.dvi");
 
-  // actions to take
+  final listName = "$specName-list";
+  final listFileName = "$listName.txt";
+  final listPath = path.join(tmpDirPath, listFileName);
+
+  // dart executable
+  final dartExecutable = Platform.executable;
+  if (dartExecutable == "") throw "dart executable not available";
+
+  // actions to take; rely on having latex and dvi2tty in PATH
   runLatex(fileName,workingDirectory) =>
       Process.runSync("latex", [fileName], workingDirectory: workingDirectory);
 
   runAddHash() =>
-      Process.runSync("dart",
+      Process.runSync(dartExecutable,
                       [path.join(dartRootPath, "tools", "addlatexhash.dart"),
                        tmpSpecPath,
-                       hashPath]);
+                       hashPath,
+                       listPath]);
 
   runDvi2tty(dviFile) =>
       Process.runSync("dvi2tty", [dviFile], workingDirectory: tmpDir.path);
@@ -100,12 +171,16 @@
       checkAction(runDvi2tty(file), "dvitty on $subject failed");
 
   // perform test
-  new File(styPath).copySync(tmpStyPath);
+  var renewLMHashCmd = r"\renewcommand{\LMHash}[1]{\OriginalLMHash{xxxx}}";
+  new File(styPath)
+      .copySync(tmpStyPath)
+      .writeAsStringSync(renewLMHashCmd, mode: FileMode.APPEND);
   new File(specPath).copySync(tmpSpecPath);
+
+  checkAction(runAddHash(),"addlatexhash.dart failed");
   for (var i = 0; i < 5; i++) {
     checkAction(runLatex(specName, tmpDirPath), "LaTeX on spec failed");
   }
-  checkAction(runAddHash(),"addlatexhash.dart failed");
   for (var i = 0; i < 5; i++) {
     checkAction(runLatex(hashFileName, tmpDirPath), "LaTeX on output failed");
   }
@@ -117,6 +192,7 @@
 main([args]) {
   testCutMatch();
   testSisp();
+  testSameHash();
   // latex and dvi2tty are not installed in the standard test environment
-  if (args.length > 0 && args[0] == "local") testNoChange();
+  if (args.length > 0 && args[0] == "local") testSameDVI();
 }
diff --git a/tests/standalone/io/addlatexhash_test_src.tex b/tests/standalone/io/addlatexhash_test_src.tex
new file mode 100644
index 0000000..8f2881b
--- /dev/null
+++ b/tests/standalone/io/addlatexhash_test_src.tex
@@ -0,0 +1,825 @@
+\documentclass{article}
+\usepackage{epsfig}
+\usepackage{color}
+\usepackage{dart}
+\usepackage{bnf}
+\usepackage{hyperref}
+\usepackage{lmodern}
+\newcommand{\code}[1]{{\sf #1}}
+\title{Test File used by addlatexhash}
+
+\begin{document}
+\maketitle
+\tableofcontents
+\newpage
+
+\pagestyle{myheadings}
+\markright{Test file used by addlatexhash}
+
+% begin Ecma boilerplate
+\section{Scope}
+\LMLabel{ecmaScope}
+
+% Selected certain paragraphs from the spec, created exactly eight
+% copies of each of them, modifying the copies in ways that should
+% not affect the hash values; to verify correct behavior, grep for
+% '^ *\\LMHash' in the output LaTeX source or take every 2nd line
+% from the list file, and check that the sequence of hashes consists
+% of subsequences of identical values, all with length eight.
+
+% Test a "normal" paragraph -------------------------------------------
+
+%0 original
+\LMHash{}
+This Ecma standard specifies the syntax and semantics of the Dart programming language.  It does not specify the APIs of the Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+%1 enlarge white space; NB: cannot add new white space, just enlarge
+\LMHash{}
+This Ecma         standard specifies the syntax and semantics of the Dart programming language.  It does not 		specify the APIs of the Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+%2 insert extra newlines
+\LMHash{}
+This Ecma standard specifies the syntax and semantics of the Dart
+programming language.  It does not specify the APIs of the Dart
+libraries except where those library elements are essential to the
+correct functioning of the language itself (e.g., the existence of
+class \cd{Object} with methods such as \cd{noSuchMethod},
+\cd{runtimeType}).
+
+%3 insert comments
+\LMHash{}
+This Ecma standard specifies the syntax and semantics of the Dart % blah
+programming language.  It does not specify the APIs of the Dart%blah
+libraries except where those library elements are essential to the% blah
+correct functioning of the language itself (e.g., the existence of
+class \cd{Object} with methods such as \cd{noSuchMethod},
+\cd{runtimeType}). % blah blah
+
+%4 insert commentary
+\LMHash{}
+This Ecma standard specifies the syntax and semantics of the Dart programming language.  It does not specify the APIs of the Dart libraries except where those library elements are \commentary{whatever} essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+%5 insert rationale
+\LMHash{}
+This Ecma standard specifies the syntax and semantics of the Dart programming language.  It does not specify the APIs of the \rationale{whatever} Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+%6 insert nested rationale/commentary
+\LMHash{}
+This Ecma standard specifies \rationale{whatever \commentary{whatever}} the syntax and semantics of the Dart programming language.  It does not specify the APIs of the Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+%7 insert all; note that this block ends with more blank lines, too
+\LMHash{}
+This Ecma         standard 		specifies the syntax \rationale{whatever \commentary{whatever}} and semantics of the Dart programming language.  It does not specify the APIs of the
+             Dart libraries except where those library elements are
+essential to the correct functioning of
+the language itself (e.g., the existence of class
+\cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
+
+
+
+
+
+\section{Conformance}
+\LMLabel{ecmaConformance}
+
+% Test a paragraph including math mode --------------------------------
+
+%0 original
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
+
+%1 enlarge white space in math mode; NB: cannot add new ws, even in math mode
+\LMHash{}
+A list $x_1,        \ldots,      x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
+
+%2 enlarge other white space
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes         any list of $n$ elements
+of the form $x_i, 1 \le i \le n$.
+		 Note that $n$ may be zero, in
+which case the list is empty. We use such lists
+ extensively throughout this
+specification.
+
+%3 add comments, also in math mode
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements% blah % blah
+of the form $x_i, 1% blah
+\le i % blah
+ \le n$. Note that $n$ may be zero, in which
+% blah blah %
+case the list is empty. We use such lists extensively throughout this
+specification.
+
+%4 even multiple newlines do not count when before '$'
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form
+
+
+$x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
+
+%5 multiple new lines and leading ws before '$', and comments
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that
+
+% blah blah blah blah blah blah blah blah
+% blah blah blah blah blah blah blah blah
+% blah blah blah blah blah blah blah blah
+% blah blah blah blah blah blah blah blah
+
+ 	 $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
+
+%6 precede paragraph with comments
+\LMHash{}
+% blah
+% blah
+%
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
+
+%7 insert comment lines in the middle of the paragraph
+\LMHash{}
+A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero,
+%
+% blah
+%
+in which case the list is empty. We use such lists extensively throughout this specification.
+
+
+% Test paragraph plus dartCode, with commentary -----------------------
+
+%0 original
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {
+A consequence of these rules is that it is possible to hide a type with a method or variable.
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";
+\}
+\end{dartCode}
+
+%1 delete/insert in the commentary, altering number of paragraphs in there
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {% NB: this space before brace begin is ignored by LaTeX
+New paragraph.
+
+New paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph new paragraph.
+
+New paragraph,
+new paragraph, and
+new paragraph. % blah \commentary{ with unbalanced '{'
+
+  \rationale{nested rationale}
+
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";
+\}
+\end{dartCode}
+
+%2 remove commentary entirely, including newlines
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\begin{dartCode}
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";
+\}
+\end{dartCode}
+
+%3 change the amount of indentation in dartCode
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {
+A consequence of these rules is that it is possible to hide a type with a method or variable.
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+      \CLASS{} HighlyStrung \{
+                  String() $=>$ "?";
+      \}
+\end{dartCode}
+
+%4 change other white space in dartCode
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {
+A consequence of these rules is that it is possible to hide a type with a method or variable.
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+
+\CLASS{} 			HighlyStrung \{
+String() $=>$ "?";
+
+
+\}
+\end{dartCode}
+
+%5 add comments in dartCode
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {
+A consequence of these rules is that it is possible to hide a type with a method or variable.
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";% blah % blah
+\} % blah
+%blah
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{dartCode}
+
+%6 remove commentary
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\begin{dartCode}
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";
+\}
+\end{dartCode}
+
+%7 add comment lines after the block
+\LMHash{}
+If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$.
+
+\commentary {
+A consequence of these rules is that it is possible to hide a type with a method or variable.
+Naming conventions usually prevent such abuses. Nevertheless,the following program is legal:
+}
+
+\begin{dartCode}
+\CLASS{} HighlyStrung \{
+  String() $=>$ "?";
+\}
+\end{dartCode}
+
+% blah blah blah blah blah blah blah blah blah
+% blah blah blah blah blah blah blah blah blah
+% blah blah blah blah blah blah blah blah blah
+% no blank lines before \section this time
+\section{Variables}
+\LMLabel{variables}
+
+% Test paragraph followed by grammar ----------------------------------
+
+%0 original
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier (`,' identifier)*
+      .
+
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+
+
+
+
+  \end{grammar}
+
+%1 collecting grammar rules on single lines
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+  {\bf variableDeclaration:} declaredIdentifier (`,' identifier)* .
+
+  {\bf declaredIdentifier:} metadata finalConstVarOrType identifier .
+
+  {\bf finalConstVarOrType:}\FINAL{} type?; \CONST{} type?; varOrType .
+
+  {\bf varOrType:}\VAR{}; type .
+
+  {\bf initializedVariableDeclaration:} declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* .
+
+  {\bf initializedIdentifier:} identifier (`=' expression)? .
+
+  {\bf initializedIdentifierList:} initializedIdentifier (`,' initializedIdentifier)* .
+\end{grammar}
+
+%2 adding comments to grammar
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}% blah
+%blah
+{\bf variableDeclaration:}%blah
+      declaredIdentifier (`,' identifier)*%blah
+      .%blah
+%blah
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .%        blah
+
+
+
+%blah
+  \end{grammar}%blah
+
+%3 removing empty lines from grammar
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier (`,' identifier)*
+      .
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+ {\bf varOrType:}\VAR{};
+	type
+    .
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+  \end{grammar}
+
+%4 inserting comment block in grammar
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier (`,' identifier)*
+      .
+
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+%% {\bf finalConstVarOrType:}\FINAL{} type?;
+%%            \CONST{} type?;
+%% 	varOrType
+%%     .
+
+%%  {\bf varOrType:}\VAR{};
+%% 	type
+%%     .
+
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+
+
+
+
+  \end{grammar}
+
+%5 adding commentary/rationale in grammar (may not happen, is OK anyway)
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier (`,' identifier)*
+      .
+
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+
+\rationale{blah \commentary{blah}}
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+
+
+
+
+  \end{grammar}
+
+%6 inserting newlines in grammar (not new paragraph, only at existing ws)
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier
+(`,'
+identifier)*
+      .
+
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType
+                                   identifier
+    .
+
+{\bf
+finalConstVarOrType:}\FINAL{}
+type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)?
+                         (`,' initializedIdentifier)*
+                         % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+
+
+
+
+  \end{grammar}
+
+%7
+\LMHash{}
+Variables are storage locations in memory.
+
+\begin{grammar}
+{\bf variableDeclaration:}
+      declaredIdentifier (`,' identifier)*
+      .
+
+{\bf declaredIdentifier:}
+      metadata finalConstVarOrType identifier
+    .
+
+{\bf finalConstVarOrType:}\FINAL{} type?;
+           \CONST{} type?;
+	varOrType
+    .
+
+ {\bf varOrType:}\VAR{};
+	type
+    .
+
+ {\bf initializedVariableDeclaration:}
+      declaredIdentifier (`=' expression)? (`,' initializedIdentifier)* % could do top level here
+    .
+
+{\bf initializedIdentifier:}
+      identifier (`=' expression)? % could do top-level here
+    .
+
+{\bf initializedIdentifierList:}
+      initializedIdentifier (`,' initializedIdentifier)*
+    .
+
+
+
+
+  \end{grammar}
+
+\subsection{Evaluation of Implicit  Variable Getters}
+\LMLabel{evaluationOfImplicitVariableGetters}
+
+% Test itemized list, right after paragraph ---------------------------
+
+%0 original
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+\begin{itemize}
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$.
+\item  {\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+
+%1 insert blank lines and comments between paragraph and list ---------
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+
+%blah
+%blah
+
+\begin{itemize}
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$.
+\item  {\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+
+%2 insert line break before each item
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+\begin{itemize}
+\item
+{\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$.
+\item
+{\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+\item
+{\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+
+%3 insert blank/comment lines between,before,after items, and on begin/end
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+\begin{itemize}%blah
+
+% blah
+
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$.
+
+\item  {\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+
+%blah
+%blah
+%blah
+
+
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+
+% blah
+\end{itemize}%blah
+
+%4 insert commentary/rationale inside itemized list
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+\begin{itemize}
+\commentary{maybe this will not happen, but it is ok}
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$.
+\rationale{but rationale at the end of an item seems to make sense}
+\item  {\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+\rationale{and we can of course have it immediately after the list}
+
+%5 add line breaks in items, with/without indentation
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows:
+\begin{itemize}
+\item {\bf Non-constant variable declaration with initializer}. If $d$
+is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,
+\code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;},
+\code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; },
+\code{\STATIC{} \FINAL{} $v$ = $e$; } or
+\code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored
+into $v$ then the initializer expression $e$ is evaluated. If, during
+the evaluation of $e$, the getter for $v$ is invoked, a
+\code{CyclicInitializationError} is thrown. If the evaluation succeeded
+yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In
+any case, $r$ is stored into $v$. The result of executing the getter
+is $r$.
+\item  {\bf Constant variable declaration}. If $d$ is of one of the
+    forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },
+    \code{\STATIC{} \CONST{} $v$ = $e$; } or
+    \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the
+    value of the compile time constant $e$.
+    \commentary{Note that a compile time constant cannot depend on
+      itself, so no cyclic references can occur.}
+    Otherwise
+\item {\bf Variable declaration without initializer}. The result of
+    executing the getter method is the value stored in $v$.
+\end{itemize}
+
+%6 add line breaks, then "eliminate" them with comments
+\LMHash{}
+Let $d$ be the declaration of a static or instance%
+variable $v$.  If $d$ is an instance variable, then the %
+invocation of the implicit getter  of $v$ evaluates to%
+                   the value stored in $v$.
+If $d$ is a static or library variable then the implicit %
+getter method of $v$ executes as follows: %
+
+\begin{itemize}
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$. %
+
+\item  {\bf Constant variable declaration}. If $d$ is of one of the%
+ forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  %
+\code{\STATIC{} \CONST{} $v$ = $e$; }  or%
+\code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+
+%7 eliminate line break before environment and before \item
+\LMHash{}
+Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
+If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows: \begin{itemize}
+\item {\bf Non-constant variable declaration with initializer}. If $d$ is of one of the forms \code{\VAR{} $v$ = $e$;} ,  \code{$T$ $v$ = $e$;} ,   \code{\FINAL{} $v$ = $e$;} ,  \code{\FINAL{} $T$ $v$ = $e$;}, \code{\STATIC{} $v$ = $e$; }, \code{\STATIC{} $T$ $v$ = $e$; }, \code{\STATIC{} \FINAL{} $v$ = $e$; } or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} and no value has yet been stored into $v$ then the initializer expression $e$ is evaluated. If, during the evaluation of $e$, the getter for $v$ is invoked, a \code{CyclicInitializationError} is thrown. If the evaluation succeeded yielding an object $o$, let $r = o$, otherwise let $r = \NULL{}$. In any case, $r$ is stored into $v$. The result of executing the getter is $r$. \item  {\bf Constant variable declaration}. If $d$ is of one of the forms \code{\CONST{} $v$ = $e$; } ,  \code{\CONST{} $T$  $v$ = $e$; },  \code{\STATIC{} \CONST{} $v$ = $e$; }  or \code{\STATIC{} \CONST{} $T$ $v$ = $e$;} the result of the getter is the value of the compile time constant $e$. \commentary{Note that a compile time constant cannot depend on itself, so no cyclic references can occur.}
+Otherwise%
+\item {\bf Variable declaration without initializer}. The result of executing the getter method is the value stored in $v$.
+\end{itemize}
+
+% Test multiple commentary/rationale blocks in succession -------------
+
+%0 original
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+
+\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runtimeType} will actually be \cd{Function}, or that any two distinct function objects necessarily have the same runtime type.
+}
+
+\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.
+
+}
+
+%1 remove commentary/first
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+
+\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.
+
+}
+
+%2 remove rationale second
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+
+\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runtimeType} will actually be \cd{Function}, or that any two distinct function objects necessarily have the same runtime type.
+}
+
+%3 remove both
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+
+%4 make first in paragraph, even with \par (double newline)
+\LMHash{}
+\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runtimeType} will actually be \cd{Function}, or that any two distinct function objects necessarily have the same runtime type.
+}
+
+\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.
+
+}
+
+The run time type of a function object always implements the class \cd{Function}.
+
+%5 insert misleading 'dartCode' comments
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+
+\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runt
+imeType} will actually be \cd{Function}, or that any two distinct function objec
+%\begin{dartCode}
+ts necessarily have the same runtime type.
+}
+
+\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+%\end{dartCode}
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.
+
+}
+
+%6 remove empty lines between normative and non-normative text
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.
+\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runtimeType} will actually be \cd{Function}, or that any two distinct function objects necessarily have the same runtime type.
+}
+\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.
+
+}
+
+%7 remove white space between normative and non-normative text
+\LMHash{}
+The run time type of a function object always implements the class \cd{Function}.\commentary{
+One cannot assume, based on the above, that  given a function \cd{f}, \cd{f.runtimeType} will actually be \cd{Function}, or that any two distinct function objects necessarily have the same runtime type.
+}\rationale{
+It is up to the implementation to choose an appropriate representation for functions.
+For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class. Implementations may also use different classes for functions based on arity and or type. Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not. The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \cd{Function}.}
+
+% Test structure command (\section) with leading white space ----------
+
+ \subsection{ Equality}
+ \LMLabel{equality}
+
+ The subsection should end the hashing block, so these words should
+ not affect the previous hash value.
+
+% ---------------------------------------------------------------------
+
+\end{document}
diff --git a/tests/standalone/io/console_script.dart b/tests/standalone/io/console_script.dart
new file mode 100644
index 0000000..130031e
--- /dev/null
+++ b/tests/standalone/io/console_script.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "dart:io";
+
+class Message {
+  final message;
+  Message(this.message);
+  toString() => message;
+}
+
+void test(ConsoleSink sink) {
+  sink.add([65, 66, 67]);
+  sink.write('DEF');
+  sink.writeAll(['GH', 'I']);
+  sink.writeCharCode(74);
+  sink.writeln('KLM');
+}
+
+void main(List<String> arguments) {
+  console.log('stdout');
+  console.error('stderr');
+  console.log();
+  console.error();
+  console.log(new Message('tuodts'));
+  console.error(new Message('rredts'));
+  test(console.log);
+  test(console.error);
+  exit(1);
+}
diff --git a/tests/standalone/io/console_test.dart b/tests/standalone/io/console_test.dart
new file mode 100644
index 0000000..30d1c9f
--- /dev/null
+++ b/tests/standalone/io/console_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "dart:convert";
+import "dart:io";
+
+import "package:expect/expect.dart";
+
+void main() {
+  var script = Platform.script.resolve("console_script.dart").toFilePath();
+  Process.run(Platform.executable,
+              ['--checked', script],
+              stdoutEncoding: ASCII,
+              stderrEncoding: ASCII).then((result) {
+                  print(result.stdout);
+                  print(result.stderr);
+    Expect.equals(1, result.exitCode);
+    if (Platform.isWindows) {
+      Expect.equals('stdout\r\n\r\ntuodts\r\nABCDEFGHIJKLM\r\n', result.stdout);
+      Expect.equals('stderr\r\n\r\nrredts\r\nABCDEFGHIJKLM\r\n', result.stderr);
+    } else {
+      Expect.equals('stdout\n\ntuodts\nABCDEFGHIJKLM\n', result.stdout);
+      Expect.equals('stderr\n\nrredts\nABCDEFGHIJKLM\n', result.stderr);
+    }
+  });
+}
diff --git a/tests/standalone/io/http_ipv6_test.dart b/tests/standalone/io/http_ipv6_test.dart
new file mode 100644
index 0000000..b0d2acf
--- /dev/null
+++ b/tests/standalone/io/http_ipv6_test.dart
@@ -0,0 +1,47 @@
+// (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "dart:async";
+import "dart:io";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+// Client makes a HTTP 1.0 request without connection keep alive. The
+// server sets a content length but still needs to close the
+// connection as there is no keep alive.
+void testHttpIPv6() {
+  asyncStart();
+  HttpServer.bind("::", 0).then((server) {
+    server.listen((HttpRequest request) {
+      Expect.equals(request.headers["host"][0], "[::1]:${server.port}");
+      Expect.equals(request.requestedUri.host, "::1");
+      request.response.close();
+    });
+
+    var client = new HttpClient();
+    var url = Uri.parse('http://[::1]:${server.port}/xxx');
+    Expect.equals(url.host, '::1');
+    client.openUrl('GET', url)
+        .then((request) => request.close())
+        .then((response) {
+          Expect.equals(response.statusCode, HttpStatus.OK);
+        }).whenComplete(() {
+          server.close();
+          client.close();
+          asyncEnd();
+        });
+  });
+}
+
+
+
+void main() {
+  testHttpIPv6();
+}
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index d51d56e..a15a598 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -160,3 +160,5 @@
 [ $system != linux ]
 io/server_socket_reference_issue21383_and_issue21384_test: Skip # Not supported on other platforms so far
 
+[ $arch != ia32 && $arch != x64 && $mode == debug ]
+verified_mem_test: Skip  # Not yet implemented.
diff --git a/tests/standalone/verified_mem_test.dart b/tests/standalone/verified_mem_test.dart
new file mode 100644
index 0000000..7139e09
--- /dev/null
+++ b/tests/standalone/verified_mem_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Test write barrier verification mode.
+// VMOptions=--verified_mem --verify_before_gc --verify_after_gc --old_gen_growth_rate=1
+
+var a = [];
+
+void main() {
+  for (int i = 0; i < 12; ++i) {
+    a.add(new List(12345));
+  }
+  for (int i = 0; i < 1234; ++i) {
+    a[0] = new List(100000);
+  }
+}
diff --git a/tests/try/poi/apply_updates_test.dart b/tests/try/poi/apply_updates_test.dart
index 91ecd9a..8d79435 100644
--- a/tests/try/poi/apply_updates_test.dart
+++ b/tests/try/poi/apply_updates_test.dart
@@ -32,7 +32,7 @@
       : this.expectedUpdate = update,
         super(before: before, after: after, canReuse: true);
 
-  Future run() => mainApp.then((LibraryElement library) {
+  Future run() => loadMainApp().then((LibraryElement library) {
     // Capture the current version of [before] before invoking the [updater].
     PartialFunctionElement before = library.localLookup(expectedUpdate);
     var beforeNode = before.parseNode(compiler);
diff --git a/tests/try/poi/compiler_test_case.dart b/tests/try/poi/compiler_test_case.dart
index ce59033..7642364 100644
--- a/tests/try/poi/compiler_test_case.dart
+++ b/tests/try/poi/compiler_test_case.dart
@@ -59,7 +59,7 @@
   CompilerTestCase(String source, [String path])
       : this.intermediate(source, customUri(path == null ? 'main.dart' : path));
 
-  Future<LibraryElement> get mainApp {
+  Future<LibraryElement> loadMainApp() {
     return compiler.libraryLoader.loadLibrary(scriptUri)
         .then((LibraryElement library) {
           if (compiler.mainApp == null) {
@@ -77,7 +77,7 @@
 
   /// Returns a future for the mainApp after running the compiler.
   Future<LibraryElement> compile() {
-    return mainApp.then((LibraryElement library) {
+    return loadMainApp().then((LibraryElement library) {
       return compiler.runCompiler(scriptUri).then((_) => library);
     });
   }
diff --git a/tests/try/poi/forget_element_test.dart b/tests/try/poi/forget_element_test.dart
index b674f7c..ea27be5 100644
--- a/tests/try/poi/forget_element_test.dart
+++ b/tests/try/poi/forget_element_test.dart
@@ -400,4 +400,5 @@
         constantCount: 1,
         initialValueCount: 1),
 
+    // TODO(ahe): Add test for super sends [backend.aliasedSuperMembers].
 ]..addAll(assertUnimplementedLocalMetadata());
diff --git a/tests/try/poi/library_updater_test.dart b/tests/try/poi/library_updater_test.dart
index 34a4022..d97dbed 100644
--- a/tests/try/poi/library_updater_test.dart
+++ b/tests/try/poi/library_updater_test.dart
@@ -33,7 +33,7 @@
         this.expectedUpdates = updates,
         super(before);
 
-  Future run() => mainApp.then((LibraryElement library) {
+  Future run() => loadMainApp().then((LibraryElement library) {
     LibraryUpdater updater =
         new LibraryUpdater(this.compiler, null, scriptUri, nolog, nolog);
     bool actualCanReuse =
@@ -42,12 +42,18 @@
 
     Expect.setEquals(
         expectedUpdates.toSet(),
-        updater.updates.map((Update update) => update.before.name).toSet());
+        updater.updates.map(nameOfUpdate).toSet());
   });
 
   String toString() => 'Before:\n$source\n\n\nAfter:\n$newSource';
 }
 
+String nameOfUpdate(Update update) {
+  var element = update.before;
+  if (element == null) element = update.after;
+  return element.name;
+}
+
 void main() {
   runTests(
       [
@@ -63,8 +69,8 @@
           new LibraryUpdaterTestCase(
               before: 'main() { print("Hello, World!"); }',
               after: 'void main() { print("Hello, World!"); }',
-              canReuse: false,
-              updates: []),
+              canReuse: true,
+              updates: ['main']),
 
           // Only whitespace changes. Can be reused; no updates/patches needed.
           new LibraryUpdaterTestCase(
diff --git a/tests/try/poi/qualified_names_test.dart b/tests/try/poi/qualified_names_test.dart
new file mode 100644
index 0000000..0d512f3
--- /dev/null
+++ b/tests/try/poi/qualified_names_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test of [qualifiedNamesIn] and [canNamesResolveStaticallyTo].
+library trydart.qualified_names_test;
+
+import 'package:dart2js_incremental/library_updater.dart' show
+    canNamesResolveStaticallyTo,
+    qualifiedNamesIn;
+
+import 'compiler_test_case.dart';
+
+typedef Checker(LibraryElement script);
+
+class NameTestCase extends CompilerTestCase {
+  final Checker check;
+
+  NameTestCase(String source, this.check)
+      : super(source);
+
+  Future run() => loadMainApp().then(check);
+}
+
+main() {
+  runTests(tests.map((l) => new NameTestCase(l.first, l.last)).toList());
+}
+
+final List tests = [
+    ["main() { x; }",
+     (LibraryElement script) {
+       var names = qualifiedNamesIn(script.findLocal("main"));
+       Expect.setEquals(["main", "x"].toSet(), names);
+     }],
+
+    ["main() { x; x.y; }",
+     (LibraryElement script) {
+       var names = qualifiedNamesIn(script.findLocal("main"));
+       Expect.setEquals(["main", "x", "x.y"].toSet(), names);
+     }],
+
+    ["main() { x; x.y; x.y.z; x.y.z.w;}",
+     (LibraryElement script) {
+       var names = qualifiedNamesIn(script.findLocal("main"));
+       // ".w" is skipped.
+       Expect.setEquals(["main", "x", "x.y", "x.y.z"].toSet(), names);
+     }],
+
+
+    ["x() {} y() {} z() {} w() {} main() { x; x.y; x.y.z; x.y.z.w;}",
+     (LibraryElement script) {
+       var main = script.findLocal("main");
+       var names = qualifiedNamesIn(main);
+       var x = script.findLocal("x");
+       var y = script.findLocal("y");
+       var z = script.findLocal("z");
+       var w = script.findLocal("w");
+       Expect.isTrue(canNamesResolveStaticallyTo(names, main, script));
+       Expect.isTrue(canNamesResolveStaticallyTo(names, x, script));
+       Expect.isFalse(canNamesResolveStaticallyTo(names, y, script));
+       Expect.isFalse(canNamesResolveStaticallyTo(names, z, script));
+       Expect.isFalse(canNamesResolveStaticallyTo(names, w, script));
+     }],
+];
diff --git a/tests/try/poi/serialize_test.dart b/tests/try/poi/serialize_test.dart
index c161d97..8cc192d 100644
--- a/tests/try/poi/serialize_test.dart
+++ b/tests/try/poi/serialize_test.dart
@@ -28,6 +28,7 @@
     FormattingDiagnosticHandler;
 
 Future testInteresting() {
+  poi.cachedCompiler = null;
   Uri script = Platform.script.resolve('data/interesting.dart');
   FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler();
 
@@ -48,6 +49,7 @@
 }
 
 Future testSubclass(FormattingDiagnosticHandler handler) {
+  poi.cachedCompiler = null;
   int position = 506;
 
   Uri script = Platform.script.resolve('data/subclass.dart');
@@ -67,6 +69,7 @@
 }
 
 Future testAbstractField(FormattingDiagnosticHandler handler) {
+  poi.cachedCompiler = null;
   int position = 321;
 
   Uri script = Platform.script.resolve('data/abstract_field.dart');
diff --git a/tests/try/try.status b/tests/try/try.status
index fa0dfba..ebb8795 100644
--- a/tests/try/try.status
+++ b/tests/try/try.status
@@ -2,6 +2,8 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
+web/incremental_compilation_update_test: Slow, Pass
+
 [ $runtime == ie10 || $runtime == ie9 || $runtime == vm || $jscl ]
 web/*: Skip
 
@@ -23,6 +25,9 @@
 web/source_update_test: Fail, Pass
 web/paste_content_rewriting_test: Fail, Pass
 
+[ $runtime == safarimobilesim ]
+web/end_to_end_test: Skip # Issue 21608
+
 [ $browser ]
 poi/poi_test: SkipByDesign # Uses dart:io.
 poi/poi_find_test: SkipByDesign # Uses dart:io.
diff --git a/tests/try/web/incremental_compilation_update_test.dart b/tests/try/web/incremental_compilation_update_test.dart
index 70c6544..d8fea21 100644
--- a/tests/try/web/incremental_compilation_update_test.dart
+++ b/tests/try/web/incremental_compilation_update_test.dart
@@ -4,7 +4,8 @@
 
 library trydart.incremental_compilation_update_test;
 
-import 'dart:html';
+import 'dart:html' hide
+    Element;
 
 import 'dart:async' show
     Future;
@@ -12,6 +13,15 @@
 import 'package:async_helper/async_helper.dart' show
     asyncTest;
 
+import 'package:expect/expect.dart' show
+    Expect;
+
+import 'package:try/src/interaction_manager.dart' show
+    splitLines;
+
+import 'package:try/poi/scope_information_visitor.dart' show
+    ScopeInformationVisitor;
+
 import 'sandbox.dart' show
     appendIFrame,
     listener;
@@ -20,6 +30,16 @@
     WebCompilerTestCase,
     WebInputProvider;
 
+import '../poi/compiler_test_case.dart' show
+    CompilerTestCase;
+
+import 'package:compiler/src/elements/elements.dart' show
+    Element,
+    LibraryElement;
+
+import 'package:compiler/src/dart2jslib.dart' show
+    Compiler;
+
 import 'program_result.dart';
 
 const int TIMEOUT = 100;
@@ -197,14 +217,869 @@
 """,
             const <String> ['v2']),
     ],
+
+    // Test that deleting an instance method works.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+class C {
+  m() {
+    print('v1');
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  try {
+    instance.m();
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String> ['v1']),
+        const ProgramResult(
+            """
+class C {
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  try {
+    instance.m();
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String> ['v2']),
+    ],
+
+    // Test that deleting an instance method works, even when accessed through
+    // super.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+class A {
+  m() {
+    print('v2');
+  }
+}
+class B extends A {
+  m() {
+    print('v1');
+  }
+}
+class C extends B {
+  m() {
+    super.m();
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v1']),
+        const ProgramResult(
+            """
+class A {
+  m() {
+    print('v2');
+  }
+}
+class B extends A {
+}
+class C extends B {
+  m() {
+    super.m();
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v2']),
+    ],
+
+    // Test that deleting a top-level method works.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+toplevel() {
+  print('v1');
+}
+class C {
+  m() {
+    try {
+      toplevel();
+    } catch (e) {
+      print('v2');
+    }
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v1']),
+        const ProgramResult(
+            """
+class C {
+  m() {
+    try {
+      toplevel();
+    } catch (e) {
+      print('v2');
+    }
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v2']),
+    ],
+
+    // Test that deleting a static method works.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+class B {
+  static staticMethod() {
+    print('v1');
+  }
+}
+class C {
+  m() {
+    try {
+      B.staticMethod();
+    } catch (e) {
+      print('v2');
+    }
+    try {
+      // Ensure that noSuchMethod support is compiled. This test is not about
+      // adding new classes.
+      B.missingMethod();
+      print('bad');
+    } catch (e) {
+    }
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v1']),
+        const ProgramResult(
+            """
+class B {
+}
+class C {
+  m() {
+    try {
+      B.staticMethod();
+    } catch (e) {
+      print('v2');
+    }
+    try {
+      // Ensure that noSuchMethod support is compiled. This test is not about
+      // adding new classes.
+      B.missingMethod();
+      print('bad');
+    } catch (e) {
+    }
+  }
+}
+var instance;
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String> ['v2']),
+    ],
+
+    // Test that a newly instantiated class is handled.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+class A {
+  m() {
+    print('Called A.m');
+  }
+}
+
+class B {
+  m() {
+    print('Called B.m');
+  }
+}
+
+var instance;
+main() {
+  if (instance == null) {
+    instance = new A();
+//   } else {
+//     instance = new B();
+  }
+  instance.m();
+}
+""",
+            const <String>['Called A.m']),
+        const ProgramResult(
+            """
+class A {
+  m() {
+    print('Called A.m');
+  }
+}
+
+class B {
+  m() {
+    print('Called B.m');
+  }
+}
+
+var instance;
+main() {
+  if (instance == null) {
+    instance = new A();
+  } else {
+    instance = new B();
+  }
+  instance.m();
+}
+""",
+            const <String>['Called B.m']),
+    ],
+
+    // Test that source maps don't throw exceptions.
+    const <ProgramResult>[
+        const ProgramResult(
+            """
+main() {
+  print('a');
+}
+""",
+            const <String>['a']),
+
+        const ProgramResult(
+            """
+main() {
+  print('a');
+  print('b');
+  print('c');
+}
+""",
+            const <String>['a', 'b', 'c']),
+    ],
+
+    // Test that a newly instantiated class is handled.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class A {
+  get name => 'A.m';
+
+  m() {
+    print('Called $name');
+  }
+}
+
+class B extends A {
+  get name => 'B.m';
+}
+
+var instance;
+main() {
+  if (instance == null) {
+    instance = new A();
+//   } else {
+//     instance = new B();
+  }
+  instance.m();
+}
+""",
+            const <String>['Called A.m']),
+        const ProgramResult(
+            r"""
+class A {
+  get name => 'A.m';
+
+  m() {
+    print('Called $name');
+  }
+}
+
+class B extends A {
+  get name => 'B.m';
+}
+
+var instance;
+main() {
+  if (instance == null) {
+    instance = new A();
+  } else {
+    instance = new B();
+  }
+  instance.m();
+}
+""",
+            const <String>['Called B.m']),
+    ],
+
+    // Test that fields of a newly instantiated class are handled.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class A {
+  var x;
+  A(this.x);
+}
+var instance;
+foo() {
+  if (instance != null) {
+    print(instance.x);
+  } else {
+    print('v1');
+  }
+}
+main() {
+  foo();
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class A {
+  var x;
+  A(this.x);
+}
+var instance;
+foo() {
+  if (instance != null) {
+    print(instance.x);
+  } else {
+    print('v1');
+  }
+}
+main() {
+  instance = new A('v2');
+  foo();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that top-level functions can be added.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+main() {
+  try {
+    foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+foo() {
+  print('v2');
+}
+
+main() {
+  try {
+    foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that static methods can be added.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+}
+
+main() {
+  try {
+    C.foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class C {
+  static foo() {
+    print('v2');
+  }
+}
+
+main() {
+  try {
+    C.foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that instance methods can be added.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+
+  try {
+    instance.foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class C {
+  foo() {
+    print('v2');
+  }
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+
+  try {
+    instance.foo();
+  } catch(e) {
+    print('v1');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that top-level functions can have signature changed.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+foo() {
+  print('v1');
+}
+
+main() {
+  foo();
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+void foo() {
+  print('v2');
+}
+
+main() {
+  foo();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that static methods can have signature changed.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+  static foo() {
+    print('v1');
+  }
+}
+
+main() {
+  C.foo();
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class C {
+  static void foo() {
+    print('v2');
+  }
+}
+
+main() {
+  C.foo();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that instance methods can have signature changed.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+  foo() {
+    print('v1');
+  }
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+
+  instance.foo();
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class C {
+  void foo() {
+    print('v2');
+  }
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+
+  instance.foo();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that adding a class is supported.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+main() {
+  print('v1');
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class C {
+  void foo() {
+    print('v2');
+  }
+}
+
+main() {
+  new C().foo();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that removing a class is supported, using constructor.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+}
+
+main() {
+  try {
+    new C();
+    print('v1');
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+main() {
+  try {
+    new C();
+    print('v1');
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that removing a class is supported, using a static method.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class C {
+  static m() {
+    print('v1');
+  }
+}
+
+main() {
+  try {
+    // TODO(ahe): Incremental compiler can't handle new noSuchMethod
+    // situations, crashes when compiling a constructor which uses type
+    // arguments.
+    C.missing();
+  } catch (e) {
+  }
+  try {
+    C.m();
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+main() {
+  try {
+    C.m();
+  } catch (e) {
+    print('v2');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test that changing the supertype of a class.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class A {
+  m() {
+    print('v2');
+  }
+}
+class B extends A {
+  m() {
+    print('v1');
+  }
+}
+class C extends B {
+  m() {
+    super.m();
+  }
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class A {
+  m() {
+    print('v2');
+  }
+}
+class B extends A {
+  m() {
+    print('v1');
+  }
+}
+class C extends A {
+  m() {
+    super.m();
+  }
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new C();
+  }
+  instance.m();
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test adding a field to a class works.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class A {
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new A();
+  }
+  try {
+    instance.x = 'v2';
+  } catch(e) {
+    print('setter threw');
+  }
+  try {
+    print(instance.x);
+  } catch (e) {
+    print('getter threw');
+  }
+}
+""",
+            const <String>['setter threw', 'getter threw']),
+        const ProgramResult(
+            r"""
+class A {
+  var x;
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new A();
+  }
+  try {
+    instance.x = 'v2';
+  } catch(e) {
+    print('setter threw');
+  }
+  try {
+    print(instance.x);
+  } catch (e) {
+    print('getter threw');
+  }
+}
+""",
+            const <String>['v2']),
+    ],
+
+    // Test removing a field from a class works.
+    // TODO(ahe): The emitter still see the field, and we need to ensure that
+    // old names aren't used again.
+    const <ProgramResult>[
+        const ProgramResult(
+            r"""
+class A {
+  var x;
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new A();
+  }
+  try {
+    instance.x = 'v1';
+  } catch(e) {
+    print('setter threw');
+  }
+  try {
+    print(instance.x);
+  } catch (e) {
+    print('getter threw');
+  }
+}
+""",
+            const <String>['v1']),
+        const ProgramResult(
+            r"""
+class A {
+}
+
+var instance;
+
+main() {
+  if (instance == null) {
+    instance = new A();
+  }
+  try {
+    instance.x = 'v1';
+  } catch(e) {
+    print('setter threw');
+  }
+  try {
+    print(instance.x);
+  } catch (e) {
+    print('getter threw');
+  }
+}
+""",
+            const <String>['setter threw', 'getter threw']),
+    ],
 ];
 
 void main() {
   listener.start();
 
+  document.head.append(lineNumberStyle());
+
   return asyncTest(() => Future.forEach(tests, compileAndRun));
 }
 
+int testCount = 1;
+
 Future compileAndRun(List<ProgramResult> programs) {
   var status = new DivElement();
   document.body.append(status);
@@ -218,7 +1093,12 @@
 
   return listener.expect('iframe-ready').then((_) {
     ProgramResult program = programs.first;
-    status.append(new PreElement()..appendText(program.code));
+
+    status.append(
+        new HeadingElement.h2()
+            ..appendText("Full program #${testCount++}:"));
+    status.append(numberedLines(program.code));
+
     status.style.color = 'orange';
     WebCompilerTestCase test = new WebCompilerTestCase(program.code);
     return test.run().then((String jsCode) {
@@ -233,7 +1113,8 @@
         int version = 2;
         return Future.forEach(programs.skip(1), (ProgramResult program) {
 
-          status.append(new PreElement()..appendText(program.code));
+          status.append(new HeadingElement.h2()..appendText("Update:"));
+          status.append(numberedLines(program.code));
 
           WebInputProvider inputProvider =
               test.incrementalCompiler.inputProvider;
@@ -246,7 +1127,12 @@
             iframe.contentWindow.postMessage(['apply-update', update], '*');
 
             return listener.expect(
-                program.messagesWith('iframe-dart-updated-main-done'));
+                program.messagesWith('iframe-dart-updated-main-done'))
+                .then((_) {
+                  return new SerializeScopeTestCase(
+                      program.code, test.incrementalCompiler.mainApp,
+                      test.incrementalCompiler.compiler).run();
+                });
           });
         });
       });
@@ -259,6 +1145,46 @@
   });
 }
 
+class SerializeScopeTestCase extends CompilerTestCase {
+  final String scopeInfo;
+
+  SerializeScopeTestCase(
+      String source,
+      LibraryElement library,
+      Compiler compiler)
+      : scopeInfo = computeScopeInfo(compiler, library),
+        super(source, '${library.canonicalUri}');
+
+  Future run() => loadMainApp().then(checkScopes);
+
+  void checkScopes(LibraryElement library) {
+    Expect.stringEquals(computeScopeInfo(compiler, library), scopeInfo);
+  }
+
+  static String computeScopeInfo(Compiler compiler, LibraryElement library) {
+    ScopeInformationVisitor visitor =
+        new ScopeInformationVisitor(compiler, library, 0);
+
+    visitor.ignoreImports = true;
+    visitor.sortMembers = true;
+    visitor.indented.write('[\n');
+    visitor.indentationLevel++;
+    visitor.indented;
+    library.accept(visitor);
+    library.forEachLocalMember((Element member) {
+      if (member.isClass) {
+        visitor.buffer.write(',\n');
+        visitor.indented;
+        member.accept(visitor);
+      }
+    });
+    visitor.buffer.write('\n');
+    visitor.indentationLevel--;
+    visitor.indented.write(']');
+    return '${visitor.buffer}';
+  }
+}
+
 void logger(x) {
   print(x);
   bool isCheckedMode = false;
@@ -268,3 +1194,51 @@
     throw 'Test timed out.';
   }
 }
+
+DivElement numberedLines(String code) {
+  DivElement result = new DivElement();
+  result.classes.add("output");
+
+  for (String text in splitLines(code)) {
+    PreElement line = new PreElement()
+        ..appendText(text.trimRight())
+        ..classes.add("line");
+    result.append(line);
+  }
+
+  return result;
+}
+
+
+StyleElement lineNumberStyle() {
+  StyleElement style = new StyleElement()..appendText('''
+h2 {
+  color: black;
+}
+
+.output {
+  padding: 0px;
+  counter-reset: line-number;
+  padding-bottom: 1em;
+}
+
+.line {
+  white-space: pre-wrap;
+  padding-left: 3.5em;
+  margin-top: 0;
+  margin-bottom: 0;
+}
+
+.line::before {
+  counter-increment: line-number;
+  content: counter(line-number) " ";
+  position: absolute;
+  left: 0px;
+  width: 3em;
+  text-align: right;
+  background-color: lightgoldenrodyellow;
+}
+''');
+  style.type = 'text/css';
+  return style;
+}
diff --git a/tests/try/web/web_compiler_test_case.dart b/tests/try/web/web_compiler_test_case.dart
index 60dd8b9..baaff00 100644
--- a/tests/try/web/web_compiler_test_case.dart
+++ b/tests/try/web/web_compiler_test_case.dart
@@ -81,6 +81,8 @@
 
   final Map<Uri, Future> cachedSources = new Map<Uri, Future>();
 
+  static final Map<String, Future> cachedRequests = new Map<String, Future>();
+
   WebInputProvider(
       this.source, this.mainUri, this.libraryRoot, this.packageRoot);
 
@@ -88,12 +90,16 @@
     return cachedSources.putIfAbsent(uri, () {
       if (uri == mainUri) return new Future.value(source);
       if (uri.scheme == WEB_SCHEME) {
-        return HttpRequest.getString('/root_dart${uri.path}');
+        return cachedHttpRequest('/root_dart${uri.path}');
       } else {
-        return HttpRequest.getString('$uri');
+        return cachedHttpRequest('$uri');
       }
     });
   }
+
+  static Future cachedHttpRequest(String uri) {
+    return cachedRequests.putIfAbsent(uri, () => HttpRequest.getString(uri));
+  }
 }
 
 /// Output provider which collect output in [output].
diff --git a/tools/VERSION b/tools/VERSION
index b192111..507dd98 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -25,7 +25,7 @@
 #
 CHANNEL dev
 MAJOR 1
-MINOR 8
+MINOR 9
 PATCH 0
-PRERELEASE 4
-PRERELEASE_PATCH 6
+PRERELEASE 0
+PRERELEASE_PATCH 0
diff --git a/tools/addlatexhash.dart b/tools/addlatexhash.dart
old mode 100644
new mode 100755
index f79a0b3..28d194d
--- a/tools/addlatexhash.dart
+++ b/tools/addlatexhash.dart
@@ -1,3 +1,4 @@
+#!/usr/bin/env dart
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -6,35 +7,38 @@
 // This is a very specialized tool which was created in order to support
 // adding hash values used as location markers in the LaTeX source of the
 // language specification.  It is intended to take its input file as the
-// first argument and the output file name as the second argument. From
-// docs/language a typical usage would be as follows:
+// first argument, an output file name as the second argument, and a
+// hash listing file name as the third argument. From docs/language a
+// typical usage would be as follows:
 //
-//   dart ../../tools/addlatexhash.dart dartLangSpec.tex tmp.tex
+//   dart ../../tools/addlatexhash.dart dartLangSpec.tex out.tex hash.txt
 //
-// This will yield a normalized variant tmp.tex of the language
-// specification with hash values filled in.  For more details, please
-// check the language specification source itself.
+// This will produce a normalized variant out.tex of the language
+// specification with hash values filled in, and a listing hash.txt of
+// all the hash values along with the label of their textual context
+// (section, subsection, subsubsection, paragraph) .  For more details,
+// please check the language specification source itself.
 //
 // NB: This utility assumes UN*X style line endings, \n, in the LaTeX
 // source file receieved as input; it will not work with other styles.
-//
-// TODO: The current version does not fill in hash values, it only
-// standardizes the LaTeX source by removing comments and normalizing
-// white space.
 
 import 'dart:io';
 import 'dart:convert';
+import '../pkg/utf/lib/utf.dart';
 import '../pkg/crypto/lib/crypto.dart';
 
-// Normalization of the text, i.e., removal or normalization
-// of elements that do not affect the output from latex
+// ----------------------------------------------------------------------
+// Normalization of the text: removal or normalization of parts that
+// do not affect the output from latex, such as white space.
 
-final commentRE = new RegExp(r"[^\\]%.*"); // NB: . does not match \n
+final commentRE = new RegExp(r"[^\\]%.*");  // NB: . does not match \n.
 final whitespaceAllRE = new RegExp(r"^\s+$");
-final whitespaceRE = new RegExp(r"[ \t]{2,}");
+final whitespaceRE = new RegExp(r"(?:(?=\s).){2,}");  // \s except end-of-line
 
-// normalization steps
-
+/// Removes [match]ing part of [line], adjusting that part with the
+/// given [startOffset] and [endOffset], bounded to be valid indices
+/// into the string if needed, then inserts [glue] where text was
+/// removed.  If there is no match then [line] is returned.
 cutMatch(line, match, {startOffset: 0, endOffset: 0, glue: ""}) {
   if (match == null) return line;
   var start = match.start + startOffset;
@@ -52,6 +56,9 @@
                   glue: glue);
 }
 
+/// Removes the rest of [line] starting from the beginning of the
+/// given [match], and adjusting with the given [offset].  If there
+/// is no match then [line] is returned.
 cutFromMatch(line, match, {offset: 0, glue: ""}) {
   if (match == null) return line;
   return line.substring(0, match.start + offset) + glue;
@@ -61,127 +68,479 @@
   return cutFromMatch(line, re.firstMatch(line), offset: offset, glue: glue);
 }
 
-isWsOnly(line) => whitespaceAllRE.firstMatch(line) != null;
+isWsOnly(line) => line.contains(whitespaceAllRE);
 isCommentOnly(line) => line.startsWith("%");
 
+/// Returns the end-of-line character at the end of [line], if any,
+/// otherwise returns the empty string.
 justEol(line) {
   return line.endsWith("\n") ? "\n" : "";
 }
 
+/// Removes the contents of the comment at the end of [line],
+/// leaving the "%" in place.  If no comment is present,
+/// return [line].
+///
+/// NB: it is tempting to remove everything from the '%' and out,
+/// including the final newline, if any, but this does not work.
+/// The problem is that TeX will do exactly this, but then it will
+/// add back a character that depends on its state (S, M, or N),
+/// and it is tricky to maintain a similar state that matches the
+/// state of TeX faithfully.  Hence, we remove the content of
+/// comments but do not remove the comments themselves, we just
+/// leave the '%' at the end of the line and let TeX manage its
+/// states in a way that does not differ from the file from before
+/// stripComment.
 stripComment(line) {
-  // NB: it is tempting to remove everything from the '%' and out,
-  // including the final newline, if any, but this does not work.
-  // The problem is that TeX will do exactly this, but then it will
-  // add back a character that depends on its state (S, M, or N),
-  // and it is tricky to maintain a similar state that matches the
-  // state of TeX faithfully.  Hence, we remove the content of
-  // comments but do not remove the comments themselves, we just
-  // leave the '%' at the end of the line and let TeX manage its
-  // states in a way that does not differ from the file from before
-  // stripComment
   if (isCommentOnly(line)) return "%\n";
   return cutRegexp(line, commentRE, startOffset: 2);
 }
 
-// Reduce a wsOnly line to its eol, remove leading ws
-// entirely, and reduce multiple ws chars to one
+/// Reduces a white-space-only [line] to its eol character,
+/// removes leading ws entirely, and reduces multiple
+/// white-space chars to one.
 normalizeWhitespace(line) {
   var trimLine = line.trimLeft();
   if (trimLine.isEmpty) return justEol(line);
   return trimLine.replaceAll(whitespaceRE, " ");
 }
 
-// Reduce sequences of >1 wsOnly lines to 1, and sequences of >1
-// commentOnly lines to 1; moreover, treat commentOnly lines as
-// wsOnly when occurring in wsOnly line blocks
+/// Reduces sequences of >1 white-space-only lines in [lines] to 1,
+/// and sequences of >1 comment-only lines to 1.  Treats comment-only
+/// lines as white-space-only when they occur in white-space-only
+/// line blocks.
 multilineNormalize(lines) {
-  var afterBlankLines = false; // does 'line' succeed >0 empty lines?
-  var afterCommentLines = false; // .. succeed >0 commentOnly lines?
+  var afterBlankLines = false;    // Does [line] succeed >0 empty lines?
+  var afterCommentLines = false;  // Does [line] succeed >0 commentOnly lines?
   var newLines = new List();
   for (var line in lines) {
     if (afterBlankLines && afterCommentLines) {
-      // can never happen
+      // Previous line was both blank and a comment: not possible.
       throw "Bug, please report to eernst@";
     } else if (afterBlankLines && !afterCommentLines) {
-      // at least one line before 'line' is wsOnly
+      // At least one line before [line] is wsOnly.
       if (!isWsOnly(line)) {
-        // blank line block ended
+        // Blank line block ended.
         afterCommentLines = isCommentOnly(line);
-        // special case: it seems to be safe to remove commentOnly lines
+        // Special case: It seems to be safe to remove commentOnly lines
         // after wsOnly lines, so the TeX state must be predictably right;
         // next line will then be afterCommentLines and be dropped, so
-        // we drop the entire comment block---which is very useful; we can
+        // we drop the entire comment block---which is very useful.  We can
         // also consider this comment line to be an empty line, such that
         // subsequent empty lines can be considered to be in a block of
-        // empty lines; note that almost all variants of this will break..
+        // empty lines.  Note that almost all variants of this breaks.
         if (afterCommentLines) {
-          // _current_ 'line' a commentOnly here
+          // _Current_ 'line' is a commentOnly here.
           afterBlankLines = true;
           afterCommentLines = false;
-          // and do not add 'line'
+          // Omit addition of [line].
         } else {
-          // after blanks, but current 'line' is neither blank nor comment
+          // After blanks, but current 'line' is neither blank nor comment.
           afterBlankLines = false;
           newLines.add(line);
         }
       } else {
-        // blank line block continues, do not add 'line'
+        // Blank line block continues, omit addition of [line].
       }
     } else if (!afterBlankLines && afterCommentLines) {
-      // at least one line before 'line' is commentOnly
+      // At least one line before [line] is commentOnly.
       if (!isCommentOnly(line)) {
-        // comment line block ended
+        // Comment block ended.
         afterBlankLines = isWsOnly(line);
         afterCommentLines = false;
         newLines.add(line);
       } else {
-        // comment line block continues, do not add 'line'
+        // Comment block continues, do not add [line].
       }
     } else {
       assert(!afterBlankLines && !afterCommentLines);
-      // no wsOnly or commentOnly lines preceed 'line'
+      // No wsOnly or commentOnly lines preceed [line].
       afterBlankLines = isWsOnly(line);
       afterCommentLines = isCommentOnly(line);
-      if (!afterCommentLines) newLines.add(line);
-      // else skipping commentOnly line after nonWs, nonComment text
+      if (!afterCommentLines) {
+        newLines.add(line);
+      } else {
+        // skip commentOnly line after nonWs/nonComment text.
+      }
     }
   }
   return newLines;
 }
 
-// Selecting the elements in the pipeline
-
+/// Selects the elements in the normalization pipeline.
 normalize(line) => normalizeWhitespace(stripComment(line));
+
+/// Selects the elements in the significant-spacing block
+/// normalization pipeline.
 sispNormalize(line) => stripComment(line);
 
-// Managing fragments with significant spacing
+// Managing fragments with significant spacing.
 
-final dartCodeBeginRE = new RegExp(r"^\s*\\begin\{dartCode\}");
-final dartCodeEndRE = new RegExp (r"^\s*\\end\{dartCode\}");
+final dartCodeBeginRE = new RegExp(r"^\s*\\begin\s*\{dartCode\}");
+final dartCodeEndRE = new RegExp (r"^\s*\\end\s*\{dartCode\}");
 
-sispIs(line, targetRE) {
-  return targetRE.firstMatch(line) != null;
+/// Recognizes beginning of dartCode block.
+sispIsDartBegin(line) => line.contains(dartCodeBeginRE);
+
+/// Recognizes end of dartCode block.
+sispIsDartEnd(line) => line.contains(dartCodeEndRE);
+
+// ----------------------------------------------------------------------
+// Analyzing the input to point out "interesting" lines
+
+/// Returns the event information for [lines] as determined by the
+/// given [analyzer].  The method [analyzer.analyze] indicates that a
+/// line is "uninteresting" by returning null (i.e., no events here),
+/// and "interesting" lines may be characterized by [analysisFunc] via
+/// the returned event object.
+findEvents(lines, analyzer) {
+  var events = new List();
+  for (var line in lines) {
+    var event = analyzer.analyze(line);
+    if (event != null) events.add(event);
+  }
+  return events;
 }
 
-sispIsDartBegin(line) => sispIs(line, dartCodeBeginRE);
-sispIsDartEnd(line) => sispIs(line, dartCodeEndRE);
+/// Returns RegExp text for recognizing a command occupying a line
+/// of its own, given the part of the RegExp that recognizes the
+/// command name, [cmdNameRE]
+lineCommandRE(cmdNameRE) =>
+    new RegExp(r"^\s*\\" + cmdNameRE + r"\s*\{.*\}\s*$");
 
-// Transform input file into output file
+final hashLabelStartRE = new RegExp(r"^\s*\\LMLabel\s*\{");
+final hashLabelEndRE = new RegExp(r"\}\s*$");
 
-main ([args]) {
-  if (args.length != 2) {
-    print("Usage: addlatexhash.dart <input-file> <output-file>");
-    throw "Received ${args.length} arguments, expected two";
+final hashMarkRE = lineCommandRE("LMHash");
+final hashLabelRE = lineCommandRE("LMLabel");
+final sectioningRE = lineCommandRE("((|sub(|sub))section|paragraph)");
+final sectionRE = lineCommandRE("section");
+final subsectionRE = lineCommandRE("subsection");
+final subsubsectionRE = lineCommandRE("subsubsection");
+final paragraphRE = lineCommandRE("paragraph");
+
+/// Returns true iff [line] begins a block of lines that gets a hash value.
+isHashMarker(line) => line.contains(hashMarkRE);
+
+/// Returns true iff [line] defines a sectioning label.
+isHashLabel(line) => line.contains(hashLabelRE);
+
+/// Returns true iff [line] is a sectioning command resp. one of its
+/// more specific forms; note that it is assumed that sectioning commands
+/// do not contain a newline between the command name and the '{'.
+isSectioningCommand(line) => line.contains(sectioningRE);
+isSectionCommand(line) => line.contains(sectionRE);
+isSubsectionCommand(line) => line.contains(subsectionRE);
+isSubsubsectionCommand(line) => line.contains(subsubsectionRE);
+isParagraphCommand(line) => line.contains(paragraphRE);
+
+/// Returns true iff [line] does not end a block of lines that gets
+/// a hash value.
+isntHashBlockTerminator(line) => !isSectioningCommand(line);
+
+/// Returns the label text part from [line], based on the assumption
+/// that isHashLabel(line) returns true.
+extractHashLabel(line) {
+  var startMatch = hashLabelStartRE.firstMatch(line);
+  var endMatch = hashLabelEndRE.firstMatch(line);
+  assert(startMatch != null && endMatch != null);
+  return line.substring(startMatch.end, endMatch.start);
+}
+
+// Event classes: Keep track of relevant information about the LaTeX
+// source code lines, such as where \LMHash and \LMLabel commands are
+// used, and how they are embedded in the sectioning structure.
+
+/// Abstract events, enabling us to [setEndLineNumber] on all events.
+abstract class HashEvent {
+  /// For events that have an endLineNumber, set it; otherwise ignore.
+  /// The endLineNumber specifies the end of the block of lines
+  /// associated with a given event, for event types concerned with
+  /// blocks of lines rather than single lines.
+  setEndLineNumber(n) {}
+
+  /// Returns null except for \LMHash{} events, where it returns
+  /// the startLineNumber.  This serves to specify a boundary because
+  /// the preceding \LMHash{} block should stop before the line of
+  /// this \LMHash{} command.  Note that hash blocks may stop earlier,
+  /// because they cannot contain sectioning commands.
+  getStartLineNumber() => null;
+}
+
+class HashMarkerEvent extends HashEvent {
+
+  // Line number of first line in block that gets hashed.
+  var startLineNumber;
+
+  // Highest possible number of first line after block that gets
+  // hashed (where the next \LMHash{} occurs).  Note that this value
+  // is not known initially (because that line has not yet been
+  // reached), so [endLineNumber] will be initialized in a separate
+  // scan.  Also note that the block may end earlier, because a block
+  // ends if it would otherwise include a sectioning command.
+  var endLineNumber;
+
+  HashMarkerEvent(this.startLineNumber);
+
+  setEndLineNumber(n) { endLineNumber = n; }
+  getStartLineNumber() => startLineNumber;
+}
+
+class HashLabelEvent extends HashEvent {
+  var labelText;
+  HashLabelEvent(this.labelText);
+}
+
+class HashAnalyzer {
+  // List of kinds of pending (= most recently seen) sectioning command.
+  // When updating this list, also update sectioningPrefix below.
+  static const PENDING_IS_NONE = 0;
+  static const PENDING_IS_SECTION = 1;
+  static const PENDING_IS_SUBSECTION = 2;
+  static const PENDING_IS_SUBSUBSECTION = 3;
+  static const PENDING_IS_PARAGRAPH = 1;
+
+  var lineNumber = 0;
+  var pendingSectioning = PENDING_IS_NONE;
+
+  HashAnalyzer();
+
+  setPendingToSection() {
+    pendingSectioning = PENDING_IS_SECTION;
   }
 
-  var inputFile = new File(args[0]);
-  var outputFile = new File(args[1]);
-  assert(inputFile.existsSync());
+  setPendingToSubsection() {
+    pendingSectioning = PENDING_IS_SUBSECTION;
+  }
 
+  setPendingToSubsubsection() {
+    pendingSectioning = PENDING_IS_SUBSUBSECTION;
+  }
+
+  setPendingToParagraph() {
+    pendingSectioning = PENDING_IS_PARAGRAPH;
+  }
+
+  clearPending() {
+    pendingSectioning = PENDING_IS_NONE;
+  }
+
+  sectioningPrefix() {
+    switch (pendingSectioning) {
+      case PENDING_IS_SECTION: return "sec:";
+      case PENDING_IS_SUBSECTION: return "subsec:";
+      case PENDING_IS_SUBSUBSECTION: return "subsubsec:";
+      case PENDING_IS_PARAGRAPH: return "par:";
+      case PENDING_IS_NONE:
+        throw
+            "\\LMHash{..} should only be used after a sectioning command " +
+            "(\\section, \\subsection, \\subsubsection, \\paragraph)";
+      default:
+        // set of PENDING_IS_.. was extended, but updates here omitted
+        throw "Bug, please report to eernst@";
+    }
+  }
+
+  analyze(line) {
+    var currentLineNumber = lineNumber++;
+    if (isHashMarker(line)) {
+      return new HashMarkerEvent(currentLineNumber);
+    } else if (isHashLabel(line)) {
+      var labelText = sectioningPrefix() + extractHashLabel(line);
+      return new HashLabelEvent(labelText);
+    } else {
+      // No events to emit, but we may need to note state changes
+      if (isSectionCommand(line)) {
+        setPendingToSection();
+      } else if (isSubsectionCommand(line)) {
+        setPendingToSubsection();
+      } else if (isSubsubsectionCommand(line)) {
+        setPendingToSubsubsection();
+      } else if (isParagraphCommand(line)) {
+        setPendingToParagraph();
+      } else {
+        // No state changes.
+      }
+      return null;
+    }
+  }
+}
+
+findHashEvents(lines) {
+  // Create the list of events, omitting endLineNumbers.
+  var events = findEvents(lines, new HashAnalyzer());
+  // Set the endLineNumbers.
+  var currentEndLineNumber = lines.length;
+  for (var event in events.reversed) {
+    event.setEndLineNumber(currentEndLineNumber);
+    var nextEndLineNumber = event.getStartLineNumber();
+    if (nextEndLineNumber != null) currentEndLineNumber = nextEndLineNumber;
+  }
+  return events;
+}
+
+// ----------------------------------------------------------------------
+// Removal of non-normative elements of the text (rationale, commentary).
+
+/// Returns [line] without the command [cmdName] (based on a match
+/// on "\\cmdName\s*{..}") starting at [startIndex]; note that it is
+/// assumed but not checked that [line] contains "\\cmdType\s*{..",
+/// and note that the end of the {..} block is found via brace matching
+/// (i.e., nested {..} blocks are handled), but it may break if '{' is
+/// made an active character etc.etc.
+removeCommand(line, cmdName, startIndex) {
+  const BACKSLASH = 92;     // char code for '\\'.
+  const BRACE_BEGIN = 123;  // char code for '{'.
+  const BRACE_END = 125;    // char code for '}'.
+
+  var blockStartIndex = startIndex + cmdName.length + 1;
+  while (blockStartIndex < line.length &&
+         line.codeUnitAt(blockStartIndex) != BRACE_BEGIN) {
+    blockStartIndex++;
+  }
+  blockStartIndex++;
+  if (blockStartIndex > line.length) {
+    throw "Bug, please report to eernst@";
+  }
+  // [blockStartIndex] has index just after '{'.
+
+  var afterEscape = false;  // Is true iff [index] is just after '{'.
+  var braceLevel = 1;       // Have seen so many '{'s minus so many '}'s.
+
+  for (var index = blockStartIndex; index < line.length; index++) {
+    switch (line.codeUnitAt(index)) {
+      case BRACE_BEGIN:
+        if (afterEscape) {
+          afterEscape = false;
+        } else {
+          braceLevel++;
+        }
+        break;
+      case BRACE_END:
+        if (afterEscape) {
+          afterEscape = false;
+        } else {
+          braceLevel--;
+        }
+        break;
+      case BACKSLASH:
+        afterEscape = true;
+        break;
+      default:
+        afterEscape = false;
+    }
+    if (braceLevel == 0) {
+      return line.substring(0, startIndex) + line.substring(index + 1);
+    }
+  }
+  // Removal failed; we consider this to mean that the input is ill-formed.
+  throw "Unmatched braces";
+}
+
+final commentaryRE = new RegExp(r"\\commentary\s*\{");
+final rationaleRE = new RegExp(r"\\rationale\s*\{");
+
+/// Removes {}-balanced '\commentary{..}' commands from [line].
+removeCommentary(line) {
+  var match = commentaryRE.firstMatch(line);
+  if (match == null) return line;
+  return removeCommentary(removeCommand(line, r"commentary", match.start));
+}
+
+/// Removes {}-balanced '\rationale{..}' commands from [line].
+removeRationale(line) {
+  var match = rationaleRE.firstMatch(line);
+  if (match == null) return line;
+  return removeRationale(removeCommand(line, r"rationale", match.start));
+}
+
+/// Removes {}-balanced '\commentary{..}' and '\rationale{..}'
+/// commands from [line], then normalizes its white-space.
+simplifyLine(line) {
+  var simplerLine = removeCommentary(line);
+  simplerLine = removeRationale(simplerLine);
+  simplerLine = normalizeWhitespace(simplerLine);
+  return simplerLine;
+}
+
+// ----------------------------------------------------------------------
+// Recognition of line blocks, insertion of block hash into \LMHash{}.
+
+final latexArgumentRE = new RegExp(r"\{.*\}");
+
+cleanupLine(line) => cutRegexp(line, commentRE, startOffset: 1).trimRight();
+
+/// Returns concatenation of all lines from [startIndex] in [lines] until
+/// a hash block terminator is encountered or [nextIndex] reached (if so,
+/// the line lines[nextIndex] itself is not included); each line is cleaned
+/// up using [cleanupLine], and " " is inserted between the lines gathered.
+gatherLines(lines, startIndex, nextIndex) =>
+    lines.getRange(startIndex, nextIndex)
+      .takeWhile(isntHashBlockTerminator)
+      .map(cleanupLine)
+      .join(" ");
+
+/// Computes the hash value for the line block starting at [startIndex]
+/// in [lines], stopping just before [nextIndex].  SIDE EFFECT:
+/// Outputs the simplified text and its hash value to [listSink].
+computeHashValue(lines, startIndex, nextIndex, listSink) {
+  final hashEncoder = new SHA1();
+  final gatheredLine = gatherLines(lines, startIndex, nextIndex);
+  final simplifiedLine = simplifyLine(gatheredLine);
+  listSink.write("  % $simplifiedLine\n");
+  hashEncoder.add(encodeUtf8(simplifiedLine));
+  return hashEncoder.close();
+}
+
+computeHashString(lines, startIndex, nextIndex, listSink) =>
+    CryptoUtils.bytesToHex(computeHashValue(lines,
+                                            startIndex,
+                                            nextIndex,
+                                            listSink));
+
+/// Computes and adds hashes to \LMHash{} lines in [lines] (which
+/// must be on the line numbers specified in [hashEvents]), and emits
+/// sectioning markers and hash values to [listSink], along with
+/// "comments" containing the simplified text (using the format
+/// '  % <text>', where the text is one, long line, for easy grepping
+/// etc.).
+addHashMarks(lines, hashEvents, listSink) {
+  for (var hashEvent in hashEvents) {
+    if (hashEvent is HashMarkerEvent) {
+      var start = hashEvent.startLineNumber;
+      var end = hashEvent.endLineNumber;
+      final hashValue = computeHashString(lines, start + 1, end, listSink);
+      lines[start] =
+          lines[start].replaceAll(latexArgumentRE, "{" + hashValue + "}");
+      listSink.write("  $hashValue\n");
+    } else if (hashEvent is HashLabelEvent) {
+      listSink.write("${hashEvent.labelText}\n");
+    }
+  }
+}
+
+/// Transforms LaTeX input to LaTeX output plus hash value list file.
+main ([args]) {
+  if (args.length != 3) {
+    print("Usage: addlatexhash.dart <input-file> <output-file> <list-file>");
+    throw "Received ${args.length} arguments, expected three";
+  }
+
+  // Get LaTeX source.
+  var inputFile = new File(args[0]);
+  assert(inputFile.existsSync());
   var lines = inputFile.readAsLinesSync();
-  // single-line normalization
+
+  // Will hold LaTeX source with normalized spacing etc., plus hash values.
+  var outputFile = new File(args[1]);
+
+  // Will hold hierarchical list of hash values.
+  var listFile = new File(args[2]);
+  var listSink = listFile.openWrite();
+
+  // Perform single-line normalization.
   var inDartCode = false;
-  var newLines = new List();
+  var normalizedLines = new List();
 
   for (var line in lines) {
     if (sispIsDartBegin(line)) {
@@ -190,15 +549,20 @@
       inDartCode = false;
     }
     if (inDartCode) {
-      newLines.add(sispNormalize(line + "\n"));
+      normalizedLines.add(sispNormalize(line + "\n"));
     } else {
-      newLines.add(normalize(line + "\n"));
+      normalizedLines.add(normalize(line + "\n"));
     }
   }
 
-  // multi-line normalization
-  newLines = multilineNormalize(newLines);
+  // Perform multi-line normalization.
+  normalizedLines = multilineNormalize(normalizedLines);
 
-  // output result
-  outputFile.writeAsStringSync(newLines.join());
+  // Insert hash values.
+  var hashEvents = findHashEvents(normalizedLines);
+  addHashMarks(normalizedLines, hashEvents, listSink);
+
+  // Produce/finalize output.
+  outputFile.writeAsStringSync(normalizedLines.join());
+  listSink.close();
 }
diff --git a/tools/bots/compiler.py b/tools/bots/compiler.py
index 3a94d30..1a9b119 100644
--- a/tools/bots/compiler.py
+++ b/tools/bots/compiler.py
@@ -270,16 +270,21 @@
       # Failed to obtain version information. Continue running tests.
       pass
 
+  unit_test_flags = [flag for flag in flags if flag.startswith('--shard')]
+  # Run the unit tests in checked mode (the VM's checked mode).
+  unit_test_flags.append('--checked')
   if runtime == 'd8':
     # The dart2js compiler isn't self-hosted (yet) so we run its
     # unit tests on the VM. We avoid doing this on the builders
     # that run the browser tests to cut down on the cycle time.
-    unit_test_flags = [flag for flag in flags if flag.startswith('--shard')]
-    # Run the unit tests in checked mode (the VM's checked mode).
-    unit_test_flags.append('--checked')
     TestStep("dart2js_unit", mode, system, 'none', 'vm', ['dart2js', 'try'],
              unit_test_flags, arch)
 
+  if compiler == 'dart2js' and runtime == 'drt':
+    # Ensure that we run the "try" tests on Content Shell.
+    TestStep("incremental_compilation", mode, system, 'none', runtime,
+             ['try'], unit_test_flags, arch)
+
   if compiler == 'dart2js' and runtime in ['ie10', 'ie11']:
     TestStep(compiler, mode, system, compiler, runtime,
              ['html', 'pkg', 'samples'], flags, arch)
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index e7012d0..661104d 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -247,6 +247,13 @@
     _testBrowserOutput = new BrowserOutput();
   }
 
+  /**
+   * Add useful info about the browser to the _testBrowserOutput.stdout,
+   * where it will be reported for failing tests.  Used to report which
+   * android device a failing test is running on.
+   */
+  void logBrowserInfoToTestBrowserOutput() { }
+
   String toString();
 
   /** Starts the browser loading the given url */
@@ -620,6 +627,11 @@
     return new Future.value(true);
   }
 
+  void logBrowserInfoToTestBrowserOutput() {
+    _testBrowserOutput.stdout.write(
+        'Android device id: ${_adbDevice.deviceId}\n');
+  }
+
   String toString() => _config.name;
 }
 
@@ -687,6 +699,11 @@
     return new Future.value(true);
   }
 
+  void logBrowserInfoToTestBrowserOutput() {
+    _testBrowserOutput.stdout.write(
+        'Android device id: ${_adbDevice.deviceId}\n');
+  }
+
   String toString() => "chromeOnAndroid";
 }
 
@@ -1167,8 +1184,9 @@
     status.currentTest.stopwatch = new Stopwatch()..start();
 
     // Reset the test specific output information (stdout, stderr) on the
-    // browser since a new test is begin started.
+    // browser, since a new test is being started.
     status.browser.resetTestBrowserOutput();
+    status.browser.logBrowserInfoToTestBrowserOutput();
 
     return test;
   }
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 8b1cc55..bf28d11 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -262,10 +262,12 @@
   final String browser;
   final String url;
   final Map configuration;
+  final bool retry;
 
   BrowserTestCommand._(String _browser,
                        this.url,
-                       this.configuration)
+                       this.configuration,
+                       this.retry)
       : super._(_browser), browser = _browser;
 
   void _buildHashCode(HashCodeBuilder builder) {
@@ -273,13 +275,15 @@
     builder.addJson(browser);
     builder.addJson(url);
     builder.add(configuration);
+    builder.add(retry);
   }
 
   bool _equal(BrowserTestCommand other) =>
       super._equal(other) &&
       browser == other.browser &&
       url == other.url &&
-      identical(configuration, other.configuration);
+      identical(configuration, other.configuration) &&
+      retry == other.retry;
 
   String get reproductionCommand {
     var parts = [TestUtils.dartTestExecutable.toString(),
@@ -295,8 +299,9 @@
   BrowserHtmlTestCommand._(String browser,
                            String url,
                            Map configuration,
-                           this.expectedMessages)
-      : super._(browser, url, configuration);
+                           this.expectedMessages,
+                           bool retry)
+      : super._(browser, url, configuration, retry);
 
   void _buildHashCode(HashCodeBuilder builder) {
     super._buildHashCode(builder);
@@ -566,17 +571,19 @@
 
   BrowserTestCommand getBrowserTestCommand(String browser,
                                            String url,
-                                           Map configuration) {
-    var command = new BrowserTestCommand._(browser, url, configuration);
+                                           Map configuration,
+                                           bool retry) {
+    var command = new BrowserTestCommand._(browser, url, configuration, retry);
     return _getUniqueCommand(command);
   }
 
   BrowserHtmlTestCommand getBrowserHtmlTestCommand(String browser,
                                                String url,
                                                Map configuration,
-                                               List<String> expectedMessages) {
+                                               List<String> expectedMessages,
+                                               bool retry) {
     var command = new BrowserHtmlTestCommand._(
-        browser, url, configuration, expectedMessages);
+        browser, url, configuration, expectedMessages, retry);
     return _getUniqueCommand(command);
   }
 
@@ -2616,10 +2623,11 @@
 bool shouldRetryCommand(CommandOutput output) {
   var command = output.command;
   // We rerun tests on Safari because 6.2 and 7.1 are flaky. Issue 21434.
-  if (command is BrowserTestCommand && command.browser == 'safari' &&
+  if (command is BrowserTestCommand &&
+      command.retry &&
+      command.browser == 'safari' &&
       output is BrowserControllerTestOutcome &&
       output._rawOutcome != Expectation.PASS) {
-    // TODO(whesse): This retries tests that fail intentionally. Fix this
     return true;
   }
 
@@ -2647,7 +2655,9 @@
     }
 
     // We currently rerun dartium tests, see issue 14074.
-    if (command is BrowserTestCommand && command.browser == 'dartium') {
+    if (command is BrowserTestCommand &&
+        command.retry &&
+        command.browser == 'dartium') {
       return true;
     }
   }
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 0d0b6bf..8f9e996 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -1009,8 +1009,8 @@
     String tempDir;
     if (compilerConfiguration.hasCompiler) {
       compileTimeArguments
-          ..addAll(args)
-          ..addAll(sharedOptions);
+          ..addAll(sharedOptions)
+          ..addAll(args);
       // Avoid doing this for analyzer.
       tempDir = createCompilationOutputDirectory(info.filePath);
     }
@@ -1353,7 +1353,8 @@
             CommandBuilder.instance.getBrowserTestCommand(
                 runtime,
                 fullHtmlPath,
-                configuration));
+                configuration,
+                !isNegative(info)));
       }
 
       // Create BrowserTestCase and queue it.
@@ -1436,7 +1437,8 @@
         runtime,
         fullHtmlPath,
         configuration,
-        info.expectedMessages));
+        info.expectedMessages,
+        !isNegative(info)));
     String testDisplayName = '$suiteName/$testName';
     var testCase = new BrowserTestCase(
         testDisplayName,
@@ -1843,7 +1845,7 @@
         var fullPath = _createUrlPathFromFile(customHtmlPath);
 
         commands.add(CommandBuilder.instance.getBrowserTestCommand(
-            runtime, fullPath, configuration));
+            runtime, fullPath, configuration, !isNegative(info)));
         String testDisplayName = '$suiteName/$testName';
         enqueueNewTestCase(new BrowserTestCase(testDisplayName,
                                                commands,